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 7*7ef62cebSEmmanuel 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 66c66ec88fSEmmanuel Vadot clocks: 67c66ec88fSEmmanuel Vadot description: List of clocks used by the framebuffer. 68c66ec88fSEmmanuel Vadot 69c66ec88fSEmmanuel Vadot power-domains: 70c66ec88fSEmmanuel Vadot description: List of power domains used by the framebuffer. 71c66ec88fSEmmanuel Vadot 72c66ec88fSEmmanuel Vadot width: 73c66ec88fSEmmanuel Vadot $ref: /schemas/types.yaml#/definitions/uint32 74c66ec88fSEmmanuel Vadot description: Width of the framebuffer in pixels 75c66ec88fSEmmanuel Vadot 76c66ec88fSEmmanuel Vadot height: 77c66ec88fSEmmanuel Vadot $ref: /schemas/types.yaml#/definitions/uint32 78c66ec88fSEmmanuel Vadot description: Height of the framebuffer in pixels 79c66ec88fSEmmanuel Vadot 80c66ec88fSEmmanuel Vadot stride: 81c66ec88fSEmmanuel Vadot $ref: /schemas/types.yaml#/definitions/uint32 82c66ec88fSEmmanuel Vadot description: Number of bytes of a line in the framebuffer 83c66ec88fSEmmanuel Vadot 84c66ec88fSEmmanuel Vadot format: 85c66ec88fSEmmanuel Vadot description: > 86c66ec88fSEmmanuel Vadot Format of the framebuffer: 87e67e8565SEmmanuel Vadot * `a1r5g5b5` - 16-bit pixels, d[15]=a, d[14:10]=r, d[9:5]=g, d[4:0]=b 88e67e8565SEmmanuel Vadot * `a2r10g10b10` - 32-bit pixels, d[31:30]=a, d[29:20]=r, d[19:10]=g, d[9:0]=b 89c66ec88fSEmmanuel Vadot * `a8b8g8r8` - 32-bit pixels, d[31:24]=a, d[23:16]=b, d[15:8]=g, d[7:0]=r 90e67e8565SEmmanuel Vadot * `a8r8g8b8` - 32-bit pixels, d[31:24]=a, d[23:16]=r, d[15:8]=g, d[7:0]=b 91c66ec88fSEmmanuel Vadot * `r5g6b5` - 16-bit pixels, d[15:11]=r, d[10:5]=g, d[4:0]=b 92e67e8565SEmmanuel Vadot * `r5g5b5a1` - 16-bit pixels, d[15:11]=r, d[10:6]=g, d[5:1]=b d[1:0]=a 93e67e8565SEmmanuel Vadot * `r8g8b8` - 24-bit pixels, d[23:16]=r, d[15:8]=g, d[7:0]=b 94e67e8565SEmmanuel Vadot * `x1r5g5b5` - 16-bit pixels, d[14:10]=r, d[9:5]=g, d[4:0]=b 952eb4d8dcSEmmanuel Vadot * `x2r10g10b10` - 32-bit pixels, d[29:20]=r, d[19:10]=g, d[9:0]=b 962eb4d8dcSEmmanuel Vadot * `x8r8g8b8` - 32-bit pixels, d[23:16]=r, d[15:8]=g, d[7:0]=b 97c66ec88fSEmmanuel Vadot enum: 98e67e8565SEmmanuel Vadot - a1r5g5b5 99e67e8565SEmmanuel Vadot - a2r10g10b10 100c66ec88fSEmmanuel Vadot - a8b8g8r8 101e67e8565SEmmanuel Vadot - a8r8g8b8 102c66ec88fSEmmanuel Vadot - r5g6b5 103e67e8565SEmmanuel Vadot - r5g5b5a1 104e67e8565SEmmanuel Vadot - r8g8b8 105e67e8565SEmmanuel Vadot - x1r5g5b5 1062eb4d8dcSEmmanuel Vadot - x2r10g10b10 1072eb4d8dcSEmmanuel Vadot - x8r8g8b8 108c66ec88fSEmmanuel Vadot 109c66ec88fSEmmanuel Vadot display: 110c66ec88fSEmmanuel Vadot $ref: /schemas/types.yaml#/definitions/phandle 111c66ec88fSEmmanuel Vadot description: Primary display hardware node 112c66ec88fSEmmanuel Vadot 113c66ec88fSEmmanuel Vadot allwinner,pipeline: 114c66ec88fSEmmanuel Vadot description: Pipeline used by the framebuffer on Allwinner SoCs 115c66ec88fSEmmanuel Vadot enum: 116c66ec88fSEmmanuel Vadot - de_be0-lcd0 117c66ec88fSEmmanuel Vadot - de_be0-lcd0-hdmi 118c66ec88fSEmmanuel Vadot - de_be0-lcd0-tve0 119c66ec88fSEmmanuel Vadot - de_be1-lcd0 120c66ec88fSEmmanuel Vadot - de_be1-lcd1-hdmi 121c66ec88fSEmmanuel Vadot - de_fe0-de_be0-lcd0 122c66ec88fSEmmanuel Vadot - de_fe0-de_be0-lcd0-hdmi 123c66ec88fSEmmanuel Vadot - de_fe0-de_be0-lcd0-tve0 124c66ec88fSEmmanuel Vadot - mixer0-lcd0 125c66ec88fSEmmanuel Vadot - mixer0-lcd0-hdmi 126c66ec88fSEmmanuel Vadot - mixer1-lcd1-hdmi 127c66ec88fSEmmanuel Vadot - mixer1-lcd1-tve 128c66ec88fSEmmanuel Vadot 129c66ec88fSEmmanuel Vadot amlogic,pipeline: 130c66ec88fSEmmanuel Vadot description: Pipeline used by the framebuffer on Amlogic SoCs 131c66ec88fSEmmanuel Vadot enum: 132c66ec88fSEmmanuel Vadot - vpu-cvbs 133c66ec88fSEmmanuel Vadot - vpu-hdmi 134c66ec88fSEmmanuel Vadot 135c66ec88fSEmmanuel VadotpatternProperties: 136c66ec88fSEmmanuel Vadot "^[a-zA-Z0-9-]+-supply$": 137c66ec88fSEmmanuel Vadot $ref: /schemas/types.yaml#/definitions/phandle 138c66ec88fSEmmanuel Vadot description: 139c66ec88fSEmmanuel Vadot Regulators used by the framebuffer. These should be named 140c66ec88fSEmmanuel Vadot according to the names in the device design. 141c66ec88fSEmmanuel Vadot 142c66ec88fSEmmanuel Vadotrequired: 143c66ec88fSEmmanuel Vadot # The binding requires also reg, width, height, stride and format, 144c66ec88fSEmmanuel Vadot # but usually they will be filled by the bootloader. 145c66ec88fSEmmanuel Vadot - compatible 146c66ec88fSEmmanuel Vadot 147c66ec88fSEmmanuel VadotallOf: 148c66ec88fSEmmanuel Vadot - if: 149c66ec88fSEmmanuel Vadot properties: 150c66ec88fSEmmanuel Vadot compatible: 151c66ec88fSEmmanuel Vadot contains: 152c66ec88fSEmmanuel Vadot const: allwinner,simple-framebuffer 153c66ec88fSEmmanuel Vadot 154c66ec88fSEmmanuel Vadot then: 155c66ec88fSEmmanuel Vadot required: 156c66ec88fSEmmanuel Vadot - allwinner,pipeline 157c66ec88fSEmmanuel Vadot 158c66ec88fSEmmanuel Vadot - if: 159c66ec88fSEmmanuel Vadot properties: 160c66ec88fSEmmanuel Vadot compatible: 161c66ec88fSEmmanuel Vadot contains: 162c66ec88fSEmmanuel Vadot const: amlogic,simple-framebuffer 163c66ec88fSEmmanuel Vadot 164c66ec88fSEmmanuel Vadot then: 165c66ec88fSEmmanuel Vadot required: 166c66ec88fSEmmanuel Vadot - amlogic,pipeline 167c66ec88fSEmmanuel Vadot 168c66ec88fSEmmanuel Vadot 169c66ec88fSEmmanuel VadotadditionalProperties: false 170c66ec88fSEmmanuel Vadot 171c66ec88fSEmmanuel Vadotexamples: 172c66ec88fSEmmanuel Vadot - | 173c66ec88fSEmmanuel Vadot / { 174c66ec88fSEmmanuel Vadot compatible = "foo"; 175c66ec88fSEmmanuel Vadot model = "foo"; 176c66ec88fSEmmanuel Vadot #address-cells = <1>; 177c66ec88fSEmmanuel Vadot #size-cells = <1>; 178c66ec88fSEmmanuel Vadot 179c66ec88fSEmmanuel Vadot chosen { 180c66ec88fSEmmanuel Vadot #address-cells = <1>; 181c66ec88fSEmmanuel Vadot #size-cells = <1>; 182c66ec88fSEmmanuel Vadot framebuffer0: framebuffer@1d385000 { 183c66ec88fSEmmanuel Vadot compatible = "allwinner,simple-framebuffer", "simple-framebuffer"; 184c66ec88fSEmmanuel Vadot allwinner,pipeline = "de_be0-lcd0"; 185c66ec88fSEmmanuel Vadot reg = <0x1d385000 3840000>; 186c66ec88fSEmmanuel Vadot width = <1600>; 187c66ec88fSEmmanuel Vadot height = <1200>; 188c66ec88fSEmmanuel Vadot stride = <3200>; 189c66ec88fSEmmanuel Vadot format = "r5g6b5"; 190c66ec88fSEmmanuel Vadot clocks = <&ahb_gates 36>, <&ahb_gates 43>, <&ahb_gates 44>; 191c66ec88fSEmmanuel Vadot lcd-supply = <®_dc1sw>; 192c66ec88fSEmmanuel Vadot display = <&lcdc0>; 193c66ec88fSEmmanuel Vadot }; 194c66ec88fSEmmanuel Vadot }; 195c66ec88fSEmmanuel Vadot }; 196c66ec88fSEmmanuel Vadot 197c66ec88fSEmmanuel Vadot... 198