Stephen Warren | 26549c8 | 2013-05-24 15:55:13 -0700 | [diff] [blame] | 1 | Simple Framebuffer |
| 2 | |
Hans de Goede | 9ee4cd1 | 2014-11-14 13:26:47 +0100 | [diff] [blame] | 3 | A simple frame-buffer describes a frame-buffer setup by firmware or |
| 4 | the bootloader, with the assumption that the display hardware has already |
| 5 | been set up to scan out from the memory pointed to by the reg property. |
Stephen Warren | 26549c8 | 2013-05-24 15:55:13 -0700 | [diff] [blame] | 6 | |
Hans de Goede | 9bb5b20 | 2014-11-14 13:26:51 +0100 | [diff] [blame] | 7 | Since simplefb nodes represent runtime information they must be sub-nodes of |
| 8 | the chosen node (*). Simplefb nodes must be named "framebuffer@<address>". |
| 9 | |
| 10 | If the devicetree contains nodes for the display hardware used by a simplefb, |
| 11 | then the simplefb node must contain a property called "display", which |
| 12 | contains a phandle pointing to the primary display hw node, so that the OS |
| 13 | knows which simplefb to disable when handing over control to a driver for the |
| 14 | real hardware. The bindings for the hw nodes must specify which node is |
| 15 | considered the primary node. |
| 16 | |
| 17 | It is advised to add display# aliases to help the OS determine how to number |
| 18 | things. If display# aliases are used, then if the simplefb node contains a |
| 19 | "display" property then the /aliases/display# path must point to the display |
| 20 | hw node the "display" property points to, otherwise it must point directly |
| 21 | to the simplefb node. |
| 22 | |
| 23 | If a simplefb node represents the preferred console for user interaction, |
| 24 | then the chosen node's stdout-path property should point to it, or to the |
| 25 | primary display hw node, as with display# aliases. If display aliases are |
| 26 | used then it should be set to the alias instead. |
| 27 | |
| 28 | It is advised that devicetree files contain pre-filled, disabled framebuffer |
| 29 | nodes, so that the firmware only needs to update the mode information and |
| 30 | enable them. This way if e.g. later on support for more display clocks get |
| 31 | added, the simplefb nodes will already contain this info and the firmware |
| 32 | does not need to be updated. |
| 33 | |
Hans de Goede | 5d85a84 | 2014-11-18 12:10:50 +0100 | [diff] [blame] | 34 | If pre-filled framebuffer nodes are used, the firmware may need extra |
| 35 | information to find the right node. In that case an extra platform specific |
| 36 | compatible and platform specific properties should be used and documented, |
| 37 | see e.g. simple-framebuffer-sunxi.txt . |
Hans de Goede | 9bb5b20 | 2014-11-14 13:26:51 +0100 | [diff] [blame] | 38 | |
Stephen Warren | 26549c8 | 2013-05-24 15:55:13 -0700 | [diff] [blame] | 39 | Required properties: |
| 40 | - compatible: "simple-framebuffer" |
| 41 | - reg: Should contain the location and size of the framebuffer memory. |
| 42 | - width: The width of the framebuffer in pixels. |
| 43 | - height: The height of the framebuffer in pixels. |
| 44 | - stride: The number of bytes in each line of the framebuffer. |
| 45 | - format: The format of the framebuffer surface. Valid values are: |
| 46 | - r5g6b5 (16-bit pixels, d[15:11]=r, d[10:5]=g, d[4:0]=b). |
Alexandre Courbot | dbb5ff4 | 2013-06-07 16:31:30 +0900 | [diff] [blame] | 47 | - a8b8g8r8 (32-bit pixels, d[31:24]=a, d[23:16]=b, d[15:8]=g, d[7:0]=r). |
Stephen Warren | 26549c8 | 2013-05-24 15:55:13 -0700 | [diff] [blame] | 48 | |
Hans de Goede | 9ee4cd1 | 2014-11-14 13:26:47 +0100 | [diff] [blame] | 49 | Optional properties: |
Chen-Yu Tsai | bd58a39 | 2015-11-17 12:31:02 +0800 | [diff] [blame] | 50 | - clocks : List of clocks used by the framebuffer. |
| 51 | - *-supply : Any number of regulators used by the framebuffer. These should |
| 52 | be named according to the names in the device's design. |
| 53 | |
| 54 | The above resources are expected to already be configured correctly. |
| 55 | The OS must ensure they are not modified or disabled while the simple |
| 56 | framebuffer remains active. |
| 57 | |
Hans de Goede | 9bb5b20 | 2014-11-14 13:26:51 +0100 | [diff] [blame] | 58 | - display : phandle pointing to the primary display hardware node |
Hans de Goede | 9ee4cd1 | 2014-11-14 13:26:47 +0100 | [diff] [blame] | 59 | |
Stephen Warren | 26549c8 | 2013-05-24 15:55:13 -0700 | [diff] [blame] | 60 | Example: |
| 61 | |
Hans de Goede | 9bb5b20 | 2014-11-14 13:26:51 +0100 | [diff] [blame] | 62 | aliases { |
| 63 | display0 = &lcdc0; |
| 64 | } |
| 65 | |
| 66 | chosen { |
| 67 | framebuffer0: framebuffer@1d385000 { |
Stephen Warren | 26549c8 | 2013-05-24 15:55:13 -0700 | [diff] [blame] | 68 | compatible = "simple-framebuffer"; |
| 69 | reg = <0x1d385000 (1600 * 1200 * 2)>; |
| 70 | width = <1600>; |
| 71 | height = <1200>; |
| 72 | stride = <(1600 * 2)>; |
| 73 | format = "r5g6b5"; |
Hans de Goede | 9bb5b20 | 2014-11-14 13:26:51 +0100 | [diff] [blame] | 74 | clocks = <&ahb_gates 36>, <&ahb_gates 43>, <&ahb_gates 44>; |
Chen-Yu Tsai | bd58a39 | 2015-11-17 12:31:02 +0800 | [diff] [blame] | 75 | lcd-supply = <®_dc1sw>; |
Hans de Goede | 9bb5b20 | 2014-11-14 13:26:51 +0100 | [diff] [blame] | 76 | display = <&lcdc0>; |
Stephen Warren | 26549c8 | 2013-05-24 15:55:13 -0700 | [diff] [blame] | 77 | }; |
Hans de Goede | 9bb5b20 | 2014-11-14 13:26:51 +0100 | [diff] [blame] | 78 | stdout-path = "display0"; |
| 79 | }; |
| 80 | |
Marco Franchi | 48c926c | 2017-11-08 14:27:48 -0200 | [diff] [blame^] | 81 | soc@1c00000 { |
Hans de Goede | 9bb5b20 | 2014-11-14 13:26:51 +0100 | [diff] [blame] | 82 | lcdc0: lcdc@1c0c000 { |
| 83 | compatible = "allwinner,sun4i-a10-lcdc"; |
| 84 | ... |
| 85 | }; |
| 86 | }; |
| 87 | |
| 88 | |
| 89 | *) Older devicetree files may have a compatible = "simple-framebuffer" node |
| 90 | in a different place, operating systems must first enumerate any compatible |
| 91 | nodes found under chosen and then check for other compatible nodes. |