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 29*fac71e4eSEmmanuel Vadot If a panel node is given, then the driver uses this to configure the 30*fac71e4eSEmmanuel Vadot physical width and height of the display. If no panel node is given, 31*fac71e4eSEmmanuel Vadot then the driver uses the width and height properties of the simplefb 32*fac71e4eSEmmanuel Vadot node to estimate it. 33*fac71e4eSEmmanuel Vadot 34c66ec88fSEmmanuel Vadot It is advised to add display# aliases to help the OS determine how 35c66ec88fSEmmanuel Vadot to number things. If display# aliases are used, then if the simplefb 36c66ec88fSEmmanuel Vadot node contains a display property then the /aliases/display# path 37c66ec88fSEmmanuel Vadot must point to the display hw node the display property points to, 38c66ec88fSEmmanuel Vadot otherwise it must point directly to the simplefb node. 39c66ec88fSEmmanuel Vadot 40c66ec88fSEmmanuel Vadot If a simplefb node represents the preferred console for user 41c66ec88fSEmmanuel Vadot interaction, then the chosen node stdout-path property should point 42c66ec88fSEmmanuel Vadot to it, or to the primary display hw node, as with display# 43c66ec88fSEmmanuel Vadot aliases. If display aliases are used then it should be set to the 44c66ec88fSEmmanuel Vadot alias instead. 45c66ec88fSEmmanuel Vadot 46c66ec88fSEmmanuel Vadot It is advised that devicetree files contain pre-filled, disabled 47c66ec88fSEmmanuel Vadot framebuffer nodes, so that the firmware only needs to update the 48c66ec88fSEmmanuel Vadot mode information and enable them. This way if e.g. later on support 49c66ec88fSEmmanuel Vadot for more display clocks get added, the simplefb nodes will already 50c66ec88fSEmmanuel Vadot contain this info and the firmware does not need to be updated. 51c66ec88fSEmmanuel Vadot 52c66ec88fSEmmanuel Vadot If pre-filled framebuffer nodes are used, the firmware may need 53c66ec88fSEmmanuel Vadot extra information to find the right node. In that case an extra 54c66ec88fSEmmanuel Vadot platform specific compatible and platform specific properties should 55c66ec88fSEmmanuel Vadot be used and documented. 56c66ec88fSEmmanuel Vadot 57c66ec88fSEmmanuel Vadotproperties: 58c66ec88fSEmmanuel Vadot compatible: 59c9ccf3a3SEmmanuel Vadot oneOf: 60c9ccf3a3SEmmanuel Vadot - items: 61c66ec88fSEmmanuel Vadot - enum: 622eb4d8dcSEmmanuel Vadot - apple,simple-framebuffer 63c66ec88fSEmmanuel Vadot - allwinner,simple-framebuffer 64c66ec88fSEmmanuel Vadot - amlogic,simple-framebuffer 65c66ec88fSEmmanuel Vadot - const: simple-framebuffer 66c9ccf3a3SEmmanuel Vadot - const: simple-framebuffer 67c66ec88fSEmmanuel Vadot 68c66ec88fSEmmanuel Vadot reg: 69c66ec88fSEmmanuel Vadot description: Location and size of the framebuffer memory 70c66ec88fSEmmanuel Vadot 71cb7aa33aSEmmanuel Vadot memory-region: 72cb7aa33aSEmmanuel Vadot maxItems: 1 73cb7aa33aSEmmanuel Vadot description: Phandle to a node describing the memory to be used for the 74cb7aa33aSEmmanuel Vadot framebuffer. If present, overrides the "reg" property (if one exists). 75cb7aa33aSEmmanuel Vadot 76c66ec88fSEmmanuel Vadot clocks: 77c66ec88fSEmmanuel Vadot description: List of clocks used by the framebuffer. 78c66ec88fSEmmanuel Vadot 79c66ec88fSEmmanuel Vadot power-domains: 80c66ec88fSEmmanuel Vadot description: List of power domains used by the framebuffer. 81c66ec88fSEmmanuel Vadot 82c66ec88fSEmmanuel Vadot width: 83c66ec88fSEmmanuel Vadot $ref: /schemas/types.yaml#/definitions/uint32 84c66ec88fSEmmanuel Vadot description: Width of the framebuffer in pixels 85c66ec88fSEmmanuel Vadot 86c66ec88fSEmmanuel Vadot height: 87c66ec88fSEmmanuel Vadot $ref: /schemas/types.yaml#/definitions/uint32 88c66ec88fSEmmanuel Vadot description: Height of the framebuffer in pixels 89c66ec88fSEmmanuel Vadot 90c66ec88fSEmmanuel Vadot stride: 91c66ec88fSEmmanuel Vadot $ref: /schemas/types.yaml#/definitions/uint32 92c66ec88fSEmmanuel Vadot description: Number of bytes of a line in the framebuffer 93c66ec88fSEmmanuel Vadot 94c66ec88fSEmmanuel Vadot format: 95c66ec88fSEmmanuel Vadot description: > 96c66ec88fSEmmanuel Vadot Format of the framebuffer: 97e67e8565SEmmanuel Vadot * `a1r5g5b5` - 16-bit pixels, d[15]=a, d[14:10]=r, d[9:5]=g, d[4:0]=b 98e67e8565SEmmanuel Vadot * `a2r10g10b10` - 32-bit pixels, d[31:30]=a, d[29:20]=r, d[19:10]=g, d[9:0]=b 99c66ec88fSEmmanuel Vadot * `a8b8g8r8` - 32-bit pixels, d[31:24]=a, d[23:16]=b, d[15:8]=g, d[7:0]=r 100e67e8565SEmmanuel Vadot * `a8r8g8b8` - 32-bit pixels, d[31:24]=a, d[23:16]=r, d[15:8]=g, d[7:0]=b 101c66ec88fSEmmanuel Vadot * `r5g6b5` - 16-bit pixels, d[15:11]=r, d[10:5]=g, d[4:0]=b 102e67e8565SEmmanuel Vadot * `r5g5b5a1` - 16-bit pixels, d[15:11]=r, d[10:6]=g, d[5:1]=b d[1:0]=a 103e67e8565SEmmanuel Vadot * `r8g8b8` - 24-bit pixels, d[23:16]=r, d[15:8]=g, d[7:0]=b 104e67e8565SEmmanuel Vadot * `x1r5g5b5` - 16-bit pixels, d[14:10]=r, d[9:5]=g, d[4:0]=b 1052eb4d8dcSEmmanuel Vadot * `x2r10g10b10` - 32-bit pixels, d[29:20]=r, d[19:10]=g, d[9:0]=b 1062eb4d8dcSEmmanuel Vadot * `x8r8g8b8` - 32-bit pixels, d[23:16]=r, d[15:8]=g, d[7:0]=b 107cb7aa33aSEmmanuel Vadot * `x8b8g8r8` - 32-bit pixels, d[23:16]=b, d[15:8]=g, d[7:0]=r 108c66ec88fSEmmanuel Vadot enum: 109e67e8565SEmmanuel Vadot - a1r5g5b5 110e67e8565SEmmanuel Vadot - a2r10g10b10 111c66ec88fSEmmanuel Vadot - a8b8g8r8 112e67e8565SEmmanuel Vadot - a8r8g8b8 113c66ec88fSEmmanuel Vadot - r5g6b5 114e67e8565SEmmanuel Vadot - r5g5b5a1 115e67e8565SEmmanuel Vadot - r8g8b8 116e67e8565SEmmanuel Vadot - x1r5g5b5 1172eb4d8dcSEmmanuel Vadot - x2r10g10b10 1182eb4d8dcSEmmanuel Vadot - x8r8g8b8 119cb7aa33aSEmmanuel Vadot - x8b8g8r8 120c66ec88fSEmmanuel Vadot 121c66ec88fSEmmanuel Vadot display: 122c66ec88fSEmmanuel Vadot $ref: /schemas/types.yaml#/definitions/phandle 123c66ec88fSEmmanuel Vadot description: Primary display hardware node 124c66ec88fSEmmanuel Vadot 125*fac71e4eSEmmanuel Vadot panel: 126*fac71e4eSEmmanuel Vadot $ref: /schemas/types.yaml#/definitions/phandle 127*fac71e4eSEmmanuel Vadot description: Display panel node 128*fac71e4eSEmmanuel Vadot 129c66ec88fSEmmanuel Vadot allwinner,pipeline: 130c66ec88fSEmmanuel Vadot description: Pipeline used by the framebuffer on Allwinner SoCs 131c66ec88fSEmmanuel Vadot enum: 132c66ec88fSEmmanuel Vadot - de_be0-lcd0 133c66ec88fSEmmanuel Vadot - de_be0-lcd0-hdmi 134c66ec88fSEmmanuel Vadot - de_be0-lcd0-tve0 135c66ec88fSEmmanuel Vadot - de_be1-lcd0 136c66ec88fSEmmanuel Vadot - de_be1-lcd1-hdmi 137c66ec88fSEmmanuel Vadot - de_fe0-de_be0-lcd0 138c66ec88fSEmmanuel Vadot - de_fe0-de_be0-lcd0-hdmi 139c66ec88fSEmmanuel Vadot - de_fe0-de_be0-lcd0-tve0 140c66ec88fSEmmanuel Vadot - mixer0-lcd0 141c66ec88fSEmmanuel Vadot - mixer0-lcd0-hdmi 142c66ec88fSEmmanuel Vadot - mixer1-lcd1-hdmi 143c66ec88fSEmmanuel Vadot - mixer1-lcd1-tve 144c66ec88fSEmmanuel Vadot 145c66ec88fSEmmanuel Vadot amlogic,pipeline: 146c66ec88fSEmmanuel Vadot description: Pipeline used by the framebuffer on Amlogic SoCs 147c66ec88fSEmmanuel Vadot enum: 148c66ec88fSEmmanuel Vadot - vpu-cvbs 149c66ec88fSEmmanuel Vadot - vpu-hdmi 150c66ec88fSEmmanuel Vadot 151c66ec88fSEmmanuel VadotpatternProperties: 152c66ec88fSEmmanuel Vadot "^[a-zA-Z0-9-]+-supply$": 153c66ec88fSEmmanuel Vadot $ref: /schemas/types.yaml#/definitions/phandle 154c66ec88fSEmmanuel Vadot description: 155c66ec88fSEmmanuel Vadot Regulators used by the framebuffer. These should be named 156c66ec88fSEmmanuel Vadot according to the names in the device design. 157c66ec88fSEmmanuel Vadot 158c66ec88fSEmmanuel Vadotrequired: 159c66ec88fSEmmanuel Vadot # The binding requires also reg, width, height, stride and format, 160c66ec88fSEmmanuel Vadot # but usually they will be filled by the bootloader. 161c66ec88fSEmmanuel Vadot - compatible 162c66ec88fSEmmanuel Vadot 163c66ec88fSEmmanuel VadotallOf: 164c66ec88fSEmmanuel Vadot - if: 165c66ec88fSEmmanuel Vadot properties: 166c66ec88fSEmmanuel Vadot compatible: 167c66ec88fSEmmanuel Vadot contains: 168c66ec88fSEmmanuel Vadot const: allwinner,simple-framebuffer 169c66ec88fSEmmanuel Vadot 170c66ec88fSEmmanuel Vadot then: 171c66ec88fSEmmanuel Vadot required: 172c66ec88fSEmmanuel Vadot - allwinner,pipeline 173c66ec88fSEmmanuel Vadot 174c66ec88fSEmmanuel Vadot - if: 175c66ec88fSEmmanuel Vadot properties: 176c66ec88fSEmmanuel Vadot compatible: 177c66ec88fSEmmanuel Vadot contains: 178c66ec88fSEmmanuel Vadot const: amlogic,simple-framebuffer 179c66ec88fSEmmanuel Vadot 180c66ec88fSEmmanuel Vadot then: 181c66ec88fSEmmanuel Vadot required: 182c66ec88fSEmmanuel Vadot - amlogic,pipeline 183c66ec88fSEmmanuel Vadot 184c66ec88fSEmmanuel Vadot 185c66ec88fSEmmanuel VadotadditionalProperties: false 186c66ec88fSEmmanuel Vadot 187c66ec88fSEmmanuel Vadotexamples: 188c66ec88fSEmmanuel Vadot - | 189c66ec88fSEmmanuel Vadot / { 190c66ec88fSEmmanuel Vadot compatible = "foo"; 191c66ec88fSEmmanuel Vadot model = "foo"; 192c66ec88fSEmmanuel Vadot #address-cells = <1>; 193c66ec88fSEmmanuel Vadot #size-cells = <1>; 194c66ec88fSEmmanuel Vadot 195c66ec88fSEmmanuel Vadot chosen { 196c66ec88fSEmmanuel Vadot #address-cells = <1>; 197c66ec88fSEmmanuel Vadot #size-cells = <1>; 198c66ec88fSEmmanuel Vadot framebuffer0: framebuffer@1d385000 { 199c66ec88fSEmmanuel Vadot compatible = "allwinner,simple-framebuffer", "simple-framebuffer"; 200c66ec88fSEmmanuel Vadot allwinner,pipeline = "de_be0-lcd0"; 201c66ec88fSEmmanuel Vadot reg = <0x1d385000 3840000>; 202c66ec88fSEmmanuel Vadot width = <1600>; 203c66ec88fSEmmanuel Vadot height = <1200>; 204c66ec88fSEmmanuel Vadot stride = <3200>; 205c66ec88fSEmmanuel Vadot format = "r5g6b5"; 206c66ec88fSEmmanuel Vadot clocks = <&ahb_gates 36>, <&ahb_gates 43>, <&ahb_gates 44>; 207c66ec88fSEmmanuel Vadot lcd-supply = <®_dc1sw>; 208c66ec88fSEmmanuel Vadot display = <&lcdc0>; 209c66ec88fSEmmanuel Vadot }; 210c66ec88fSEmmanuel Vadot }; 211c66ec88fSEmmanuel Vadot }; 212c66ec88fSEmmanuel Vadot 213c66ec88fSEmmanuel Vadot... 214