1c66ec88fSEmmanuel Vadot# SPDX-License-Identifier: GPL-2.0 2c66ec88fSEmmanuel Vadot%YAML 1.2 3c66ec88fSEmmanuel Vadot--- 4c66ec88fSEmmanuel Vadot$id: http://devicetree.org/schemas/display/simple-framebuffer.yaml# 5c66ec88fSEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml# 6c66ec88fSEmmanuel Vadot 77ef62cebSEmmanuel Vadottitle: Simple Framebuffer 8c66ec88fSEmmanuel Vadot 9c66ec88fSEmmanuel Vadotmaintainers: 10c66ec88fSEmmanuel Vadot - Hans de Goede <hdegoede@redhat.com> 11c66ec88fSEmmanuel Vadot 12c66ec88fSEmmanuel Vadotdescription: |+ 13c66ec88fSEmmanuel Vadot A simple frame-buffer describes a frame-buffer setup by firmware or 14c66ec88fSEmmanuel Vadot the bootloader, with the assumption that the display hardware has 15c66ec88fSEmmanuel Vadot already been set up to scan out from the memory pointed to by the 16c66ec88fSEmmanuel Vadot reg property. 17c66ec88fSEmmanuel Vadot 18c66ec88fSEmmanuel Vadot Since simplefb nodes represent runtime information they must be 19c66ec88fSEmmanuel Vadot sub-nodes of the chosen node (*). Simplefb nodes must be named 20c66ec88fSEmmanuel Vadot framebuffer@<address>. 21c66ec88fSEmmanuel Vadot 22c66ec88fSEmmanuel Vadot If the devicetree contains nodes for the display hardware used by a 23c66ec88fSEmmanuel Vadot simplefb, then the simplefb node must contain a property called 24c66ec88fSEmmanuel Vadot display, which contains a phandle pointing to the primary display 25c66ec88fSEmmanuel Vadot hw node, so that the OS knows which simplefb to disable when handing 26c66ec88fSEmmanuel Vadot over control to a driver for the real hardware. The bindings for the 27c66ec88fSEmmanuel Vadot hw nodes must specify which node is considered the primary node. 28c66ec88fSEmmanuel Vadot 29c66ec88fSEmmanuel Vadot It is advised to add display# aliases to help the OS determine how 30c66ec88fSEmmanuel Vadot to number things. If display# aliases are used, then if the simplefb 31c66ec88fSEmmanuel Vadot node contains a display property then the /aliases/display# path 32c66ec88fSEmmanuel Vadot must point to the display hw node the display property points to, 33c66ec88fSEmmanuel Vadot otherwise it must point directly to the simplefb node. 34c66ec88fSEmmanuel Vadot 35c66ec88fSEmmanuel Vadot If a simplefb node represents the preferred console for user 36c66ec88fSEmmanuel Vadot interaction, then the chosen node stdout-path property should point 37c66ec88fSEmmanuel Vadot to it, or to the primary display hw node, as with display# 38c66ec88fSEmmanuel Vadot aliases. If display aliases are used then it should be set to the 39c66ec88fSEmmanuel Vadot alias instead. 40c66ec88fSEmmanuel Vadot 41c66ec88fSEmmanuel Vadot It is advised that devicetree files contain pre-filled, disabled 42c66ec88fSEmmanuel Vadot framebuffer nodes, so that the firmware only needs to update the 43c66ec88fSEmmanuel Vadot mode information and enable them. This way if e.g. later on support 44c66ec88fSEmmanuel Vadot for more display clocks get added, the simplefb nodes will already 45c66ec88fSEmmanuel Vadot contain this info and the firmware does not need to be updated. 46c66ec88fSEmmanuel Vadot 47c66ec88fSEmmanuel Vadot If pre-filled framebuffer nodes are used, the firmware may need 48c66ec88fSEmmanuel Vadot extra information to find the right node. In that case an extra 49c66ec88fSEmmanuel Vadot platform specific compatible and platform specific properties should 50c66ec88fSEmmanuel Vadot be used and documented. 51c66ec88fSEmmanuel Vadot 52c66ec88fSEmmanuel Vadotproperties: 53c66ec88fSEmmanuel Vadot compatible: 54c9ccf3a3SEmmanuel Vadot oneOf: 55c9ccf3a3SEmmanuel Vadot - items: 56c66ec88fSEmmanuel Vadot - enum: 572eb4d8dcSEmmanuel Vadot - apple,simple-framebuffer 58c66ec88fSEmmanuel Vadot - allwinner,simple-framebuffer 59c66ec88fSEmmanuel Vadot - amlogic,simple-framebuffer 60c66ec88fSEmmanuel Vadot - const: simple-framebuffer 61c9ccf3a3SEmmanuel Vadot - const: simple-framebuffer 62c66ec88fSEmmanuel Vadot 63c66ec88fSEmmanuel Vadot reg: 64c66ec88fSEmmanuel Vadot description: Location and size of the framebuffer memory 65c66ec88fSEmmanuel Vadot 66*cb7aa33aSEmmanuel Vadot memory-region: 67*cb7aa33aSEmmanuel Vadot maxItems: 1 68*cb7aa33aSEmmanuel Vadot description: Phandle to a node describing the memory to be used for the 69*cb7aa33aSEmmanuel Vadot framebuffer. If present, overrides the "reg" property (if one exists). 70*cb7aa33aSEmmanuel Vadot 71c66ec88fSEmmanuel Vadot clocks: 72c66ec88fSEmmanuel Vadot description: List of clocks used by the framebuffer. 73c66ec88fSEmmanuel Vadot 74c66ec88fSEmmanuel Vadot power-domains: 75c66ec88fSEmmanuel Vadot description: List of power domains used by the framebuffer. 76c66ec88fSEmmanuel Vadot 77c66ec88fSEmmanuel Vadot width: 78c66ec88fSEmmanuel Vadot $ref: /schemas/types.yaml#/definitions/uint32 79c66ec88fSEmmanuel Vadot description: Width of the framebuffer in pixels 80c66ec88fSEmmanuel Vadot 81c66ec88fSEmmanuel Vadot height: 82c66ec88fSEmmanuel Vadot $ref: /schemas/types.yaml#/definitions/uint32 83c66ec88fSEmmanuel Vadot description: Height of the framebuffer in pixels 84c66ec88fSEmmanuel Vadot 85c66ec88fSEmmanuel Vadot stride: 86c66ec88fSEmmanuel Vadot $ref: /schemas/types.yaml#/definitions/uint32 87c66ec88fSEmmanuel Vadot description: Number of bytes of a line in the framebuffer 88c66ec88fSEmmanuel Vadot 89c66ec88fSEmmanuel Vadot format: 90c66ec88fSEmmanuel Vadot description: > 91c66ec88fSEmmanuel Vadot Format of the framebuffer: 92e67e8565SEmmanuel Vadot * `a1r5g5b5` - 16-bit pixels, d[15]=a, d[14:10]=r, d[9:5]=g, d[4:0]=b 93e67e8565SEmmanuel Vadot * `a2r10g10b10` - 32-bit pixels, d[31:30]=a, d[29:20]=r, d[19:10]=g, d[9:0]=b 94c66ec88fSEmmanuel Vadot * `a8b8g8r8` - 32-bit pixels, d[31:24]=a, d[23:16]=b, d[15:8]=g, d[7:0]=r 95e67e8565SEmmanuel Vadot * `a8r8g8b8` - 32-bit pixels, d[31:24]=a, d[23:16]=r, d[15:8]=g, d[7:0]=b 96c66ec88fSEmmanuel Vadot * `r5g6b5` - 16-bit pixels, d[15:11]=r, d[10:5]=g, d[4:0]=b 97e67e8565SEmmanuel Vadot * `r5g5b5a1` - 16-bit pixels, d[15:11]=r, d[10:6]=g, d[5:1]=b d[1:0]=a 98e67e8565SEmmanuel Vadot * `r8g8b8` - 24-bit pixels, d[23:16]=r, d[15:8]=g, d[7:0]=b 99e67e8565SEmmanuel Vadot * `x1r5g5b5` - 16-bit pixels, d[14:10]=r, d[9:5]=g, d[4:0]=b 1002eb4d8dcSEmmanuel Vadot * `x2r10g10b10` - 32-bit pixels, d[29:20]=r, d[19:10]=g, d[9:0]=b 1012eb4d8dcSEmmanuel Vadot * `x8r8g8b8` - 32-bit pixels, d[23:16]=r, d[15:8]=g, d[7:0]=b 102*cb7aa33aSEmmanuel Vadot * `x8b8g8r8` - 32-bit pixels, d[23:16]=b, d[15:8]=g, d[7:0]=r 103c66ec88fSEmmanuel Vadot enum: 104e67e8565SEmmanuel Vadot - a1r5g5b5 105e67e8565SEmmanuel Vadot - a2r10g10b10 106c66ec88fSEmmanuel Vadot - a8b8g8r8 107e67e8565SEmmanuel Vadot - a8r8g8b8 108c66ec88fSEmmanuel Vadot - r5g6b5 109e67e8565SEmmanuel Vadot - r5g5b5a1 110e67e8565SEmmanuel Vadot - r8g8b8 111e67e8565SEmmanuel Vadot - x1r5g5b5 1122eb4d8dcSEmmanuel Vadot - x2r10g10b10 1132eb4d8dcSEmmanuel Vadot - x8r8g8b8 114*cb7aa33aSEmmanuel Vadot - x8b8g8r8 115c66ec88fSEmmanuel Vadot 116c66ec88fSEmmanuel Vadot display: 117c66ec88fSEmmanuel Vadot $ref: /schemas/types.yaml#/definitions/phandle 118c66ec88fSEmmanuel Vadot description: Primary display hardware node 119c66ec88fSEmmanuel Vadot 120c66ec88fSEmmanuel Vadot allwinner,pipeline: 121c66ec88fSEmmanuel Vadot description: Pipeline used by the framebuffer on Allwinner SoCs 122c66ec88fSEmmanuel Vadot enum: 123c66ec88fSEmmanuel Vadot - de_be0-lcd0 124c66ec88fSEmmanuel Vadot - de_be0-lcd0-hdmi 125c66ec88fSEmmanuel Vadot - de_be0-lcd0-tve0 126c66ec88fSEmmanuel Vadot - de_be1-lcd0 127c66ec88fSEmmanuel Vadot - de_be1-lcd1-hdmi 128c66ec88fSEmmanuel Vadot - de_fe0-de_be0-lcd0 129c66ec88fSEmmanuel Vadot - de_fe0-de_be0-lcd0-hdmi 130c66ec88fSEmmanuel Vadot - de_fe0-de_be0-lcd0-tve0 131c66ec88fSEmmanuel Vadot - mixer0-lcd0 132c66ec88fSEmmanuel Vadot - mixer0-lcd0-hdmi 133c66ec88fSEmmanuel Vadot - mixer1-lcd1-hdmi 134c66ec88fSEmmanuel Vadot - mixer1-lcd1-tve 135c66ec88fSEmmanuel Vadot 136c66ec88fSEmmanuel Vadot amlogic,pipeline: 137c66ec88fSEmmanuel Vadot description: Pipeline used by the framebuffer on Amlogic SoCs 138c66ec88fSEmmanuel Vadot enum: 139c66ec88fSEmmanuel Vadot - vpu-cvbs 140c66ec88fSEmmanuel Vadot - vpu-hdmi 141c66ec88fSEmmanuel Vadot 142c66ec88fSEmmanuel VadotpatternProperties: 143c66ec88fSEmmanuel Vadot "^[a-zA-Z0-9-]+-supply$": 144c66ec88fSEmmanuel Vadot $ref: /schemas/types.yaml#/definitions/phandle 145c66ec88fSEmmanuel Vadot description: 146c66ec88fSEmmanuel Vadot Regulators used by the framebuffer. These should be named 147c66ec88fSEmmanuel Vadot according to the names in the device design. 148c66ec88fSEmmanuel Vadot 149c66ec88fSEmmanuel Vadotrequired: 150c66ec88fSEmmanuel Vadot # The binding requires also reg, width, height, stride and format, 151c66ec88fSEmmanuel Vadot # but usually they will be filled by the bootloader. 152c66ec88fSEmmanuel Vadot - compatible 153c66ec88fSEmmanuel Vadot 154c66ec88fSEmmanuel VadotallOf: 155c66ec88fSEmmanuel Vadot - if: 156c66ec88fSEmmanuel Vadot properties: 157c66ec88fSEmmanuel Vadot compatible: 158c66ec88fSEmmanuel Vadot contains: 159c66ec88fSEmmanuel Vadot const: allwinner,simple-framebuffer 160c66ec88fSEmmanuel Vadot 161c66ec88fSEmmanuel Vadot then: 162c66ec88fSEmmanuel Vadot required: 163c66ec88fSEmmanuel Vadot - allwinner,pipeline 164c66ec88fSEmmanuel Vadot 165c66ec88fSEmmanuel Vadot - if: 166c66ec88fSEmmanuel Vadot properties: 167c66ec88fSEmmanuel Vadot compatible: 168c66ec88fSEmmanuel Vadot contains: 169c66ec88fSEmmanuel Vadot const: amlogic,simple-framebuffer 170c66ec88fSEmmanuel Vadot 171c66ec88fSEmmanuel Vadot then: 172c66ec88fSEmmanuel Vadot required: 173c66ec88fSEmmanuel Vadot - amlogic,pipeline 174c66ec88fSEmmanuel Vadot 175c66ec88fSEmmanuel Vadot 176c66ec88fSEmmanuel VadotadditionalProperties: false 177c66ec88fSEmmanuel Vadot 178c66ec88fSEmmanuel Vadotexamples: 179c66ec88fSEmmanuel Vadot - | 180c66ec88fSEmmanuel Vadot / { 181c66ec88fSEmmanuel Vadot compatible = "foo"; 182c66ec88fSEmmanuel Vadot model = "foo"; 183c66ec88fSEmmanuel Vadot #address-cells = <1>; 184c66ec88fSEmmanuel Vadot #size-cells = <1>; 185c66ec88fSEmmanuel Vadot 186c66ec88fSEmmanuel Vadot chosen { 187c66ec88fSEmmanuel Vadot #address-cells = <1>; 188c66ec88fSEmmanuel Vadot #size-cells = <1>; 189c66ec88fSEmmanuel Vadot framebuffer0: framebuffer@1d385000 { 190c66ec88fSEmmanuel Vadot compatible = "allwinner,simple-framebuffer", "simple-framebuffer"; 191c66ec88fSEmmanuel Vadot allwinner,pipeline = "de_be0-lcd0"; 192c66ec88fSEmmanuel Vadot reg = <0x1d385000 3840000>; 193c66ec88fSEmmanuel Vadot width = <1600>; 194c66ec88fSEmmanuel Vadot height = <1200>; 195c66ec88fSEmmanuel Vadot stride = <3200>; 196c66ec88fSEmmanuel Vadot format = "r5g6b5"; 197c66ec88fSEmmanuel Vadot clocks = <&ahb_gates 36>, <&ahb_gates 43>, <&ahb_gates 44>; 198c66ec88fSEmmanuel Vadot lcd-supply = <®_dc1sw>; 199c66ec88fSEmmanuel Vadot display = <&lcdc0>; 200c66ec88fSEmmanuel Vadot }; 201c66ec88fSEmmanuel Vadot }; 202c66ec88fSEmmanuel Vadot }; 203c66ec88fSEmmanuel Vadot 204c66ec88fSEmmanuel Vadot... 205