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