Advertisement
zmatt

lcd-panel.dtsi

Oct 30th, 2019 (edited)
186
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 3.43 KB | None | 0 0
  1. // The "ports" linking lcdc to its panel are officially required, and you
  2. // get a warning for omitting them.  But, if you uncomment them then lcdc
  3. // actually no longer works.  The framebuffer never appears.  Lol.
  4.  
  5. &lcdc {
  6.     status = "okay";
  7.  
  8.     // "straight" if d0 is blue, typical for 16-bit color (supports RGB565, BGR888, and XBGR8888)
  9.     // "crossed" if d0 is red, typical for 24-bit color (supports BGR565, RGB888, and XRGB8888)
  10.     blue-and-red-wiring = "straight";
  11.  
  12. //  port {
  13. //      lcd_output: endpoint {
  14. //          remote-endpoint = <&lcd_input>;
  15. //      };
  16. //  };
  17. };
  18.  
  19. / {
  20.     lcd-panel {
  21.         compatible = "ti,tilcdc,panel";
  22.  
  23.         pinctrl-names = "default";
  24.         pinctrl-0 = <&lcd_pins>;
  25.  
  26.         enable-gpios = <&gpio1 13 0>;
  27.  
  28. //      port {
  29. //          lcd_input: endpoint {
  30. //              remote-endpoint = <&lcd_output>;
  31. //          };
  32. //      };
  33.  
  34.         panel-info {
  35.             // all these properties are required by the driver,
  36.             // even the ones which are completely useless.
  37.  
  38.             // pixel format
  39.             bpp               = <16>;   // bits/pixel
  40.  
  41.             // by default, data and OE change on rising pclk edge.
  42.             // following property selects falling edge:
  43.             //invert-pxl-clk;
  44.  
  45.             // pclk edge on which hsync and vsync change:
  46.             sync-edge         = <1>;    // 0=falling, 1=rising
  47.             // if hsync/vsync don't use same pclk edge as data/OE
  48.             // then sync is delayed by 1/2 clock, increasing the
  49.             // back porch and decreasing the front porch time.
  50.  
  51.             // useless but must be 1
  52.             sync-ctrl         = <1>;
  53.  
  54.             // DMA config
  55.             dma-burst-sz      = <16>;   // burst size (words)
  56.             fifo-th           = <4>;    // FIFO threshold
  57.  
  58.             // for palette mode only, which isn't even supported
  59.             raster-order      = <0>;
  60.             fdd               = <0x80>;
  61.             //tft-alt-mode;
  62.  
  63.             // for passive matrix only, which isn't even supported
  64.             ac-bias           = <255>;
  65.             ac-bias-intrpt    = <0>;
  66.         };
  67.  
  68.         display-timings {
  69.             // ranges supported by LCDC:
  70.             //  1-2048  vactive, hactive
  71.             //  1-64    vsync, hsync
  72.             //  0-255   vfront, vback
  73.             //  1-256   hfront, vback
  74.             // hactive must additionally be multiple of 16 pixels.
  75.  
  76.             native-mode = <&lcd_mode>;
  77.  
  78.             lcd_mode: 1024x786-60 {
  79.                 vactive     = < 768>;
  80.                 hactive     = <1024>;
  81.  
  82.                 // our panel specifies:
  83.                 //       min     typ     max
  84.                 //  hblank   216     320     440    pixels
  85.                 //  vblank     6      38      80    lines
  86.                 //  vfreq     56      60      75    Hz
  87.                 //  pfreq     57.5    64.9    74.4  MHz
  88.                 //
  89.                 // hsync/vsync not used
  90.  
  91.                 // VESA timings for 1024x768p60:
  92.                 // (+/- after sync indicates polarity)
  93.                 //       DMT     GTF     CVT
  94.                 //  vfront     3       1       3
  95.                 //  vsync      6-      3+      4+
  96.                 //  vback     29      23      23
  97.                 //
  98.                 //  vblank    38      27      30
  99.                 //  vtotal   806     795     798
  100.                 //
  101.                 //  hfreq    ~48.4    47.7   ~47.9  kHz
  102.                 //
  103.                 //  hfront    24      56      48
  104.                 //  hsync    136-    104-    104-
  105.                 //  hback    160     160     152
  106.                 //
  107.                 //  hblank   320     320     304
  108.                 //  htotal  1344    1344    1328
  109.                 //
  110.                 //  pfreq    ~65.0   ~64.1   ~63.6  MHz
  111.                 //
  112.                 // DMT matches panel 'typ', let's use that.
  113.  
  114.                 // note: you can also specify <min typ max>
  115.  
  116.                 vfront-porch    = <   3>;
  117.                 vsync-len   = <   6>;
  118.                 vback-porch = <  29>;
  119.  
  120.                 hfront-porch    = <  24>;
  121.                 hsync-len   = < 136>;
  122.                 hback-porch = < 160>;
  123.  
  124.                 clock-frequency = <65000000>;
  125.  
  126.                 // 0 = active low
  127.                 // 1 = active high
  128.                 // omitted = unused
  129.                 de-active   = <1>;  // lcdc ignores this
  130.                 pixelclk-active = <1>;  // lcdc ignores this
  131.                 vsync-active    = <0>;
  132.                 hsync-active    = <1>;
  133.             };
  134.         };
  135.     };
  136. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement