arm64: dts: allwinner: h616: add LCD timing controller and display engine support
Subsystems (6)
v2 cover arm64: dts: allwinner: h616: add LCD timing controller and display engine support
Hi All,
V2 of this patch adding display engine and timing controller support for the H616 and related SoCs, and enabling LCD output for the RG35XX series of handheld gaming devices using this SoC. V2 updates with feedback and Acks from the previous v1, with changes largely improving consistency of DT compatible and fallback strings, and removing the temporary GPIO switched backlight from v1 in favour of waiting for proper PWM support.
Regards,
Ryan
Original blurb below:
The H616 series of SoCs has an LCD timing controller as part of its display pipeline, capable of outputting to an LCD display, as well as HDMI and (depending on the SoC) composite TV signals. The pins are not exposed on all die variants, but the H700 variant is exposes RGB and LVDS pins. Building on the DE33 display engine patches on the list (https://lore.kernel.org/linux-sunxi/[email protected]), this patch series:
- adds the required device tree configuration for the display pipeline to the H616 (bus, display engine, mixer and timing controller)
- adds a quirk to the sun4i TCON driver for the Allwinner R40 (compatible with the H616/H618/H700/T507)
- describes the H616 RGB and LVDS GPIO pins
- adds the required pipeline endpoints to the device tree for the Anbernic RG35XX devices featuring this SoC
- adds LCD panel description, and required power supply configuration for the panel, backlight and GPIO pins for the RG35XX
Thanks to Jernej Skrabec for the initial out-of-tree patch for the T507.
Regards,
Ryan
Chris Morgan (1):
dt-bindings: allwinner: add H616 DE33 bus binding
Jernej Skrabec (1):
drm/sun4i: tcon: add support for R40
Ryan Walklin (10):
dt-bindings: allwinner: Add TCON_TOP_LCD clock defines
dt-bindings: display: sun4i: Add compatible strings for H616 DE
dt-bindings: display: sun4i: Add compatible strings for H616 TCON TOP
dt-bindings: display: sun4i: add allwinner R40 and H616 tcon
compatible strings
dt-bindings: sram: sunxi-sram: Add H616 SRAM C compatible
drm: sun4i: add compatible for h616 display engine
arm64: dts: allwinner: h616: add display engine, bus and mixer nodes
arm64: dts: allwinner: h616: Add LCD timing controller nodes
arm64: dts: allwinner: h616: add LCD and LVDS pins
arm64: dts: allwinner: rg35xx: Enable LCD output
.../bus/allwinner,sun50i-a64-de2.yaml | 7 +- .../allwinner,sun4i-a10-display-engine.yaml | 1 + .../display/allwinner,sun4i-a10-tcon.yaml | 10 + .../display/allwinner,sun8i-r40-tcon-top.yaml | 13 +- .../allwinner,sun4i-a10-system-control.yaml | 4 +- .../arm64/boot/dts/allwinner/sun50i-h616.dtsi | 225 ++++++++++++++++++ .../sun50i-h700-anbernic-rg35xx-2024.dts | 56 +++++ drivers/gpu/drm/sun4i/sun4i_drv.c | 1 + drivers/gpu/drm/sun4i/sun4i_tcon.c | 9 + include/dt-bindings/clock/sun8i-tcon-top.h | 2 + 10 files changed, 319 insertions(+), 9 deletions(-)
Signature · 1 line
2.50.1
PATCH v2 1/12 dt-bindings: allwinner: Add TCON_TOP_LCD clock defines
The Allwinner H700 exposes RGB and LVDS pins as well as a HDMI connector. This requires additional clocks for the TCON_TOP as per the T507 datasheet (which shares the same die).
--- include/dt-bindings/clock/sun8i-tcon-top.h | 2 ++ 1 file changed, 2 insertions(+)
include/dt-bindings/clock/sun8i-tcon-top.h +2 -0
@@ -7,5 +7,7 @@#define CLK_TCON_TOP_TV0 0#define CLK_TCON_TOP_TV1 1#define CLK_TCON_TOP_DSI 2 +#define CLK_TCON_TOP_LCD0 3 +#define CLK_TCON_TOP_LCD1 4#endif /* _DT_BINDINGS_CLOCK_SUN8I_TCON_TOP_H_ */
Signature · 1 line
2.50.1
PATCH v2 2/12 dt-bindings: allwinner: add H616 DE33 bus binding
In reply to Ryan WalklinFrom: Chris Morgan <[email protected]>
The Allwinner H616 and variants have a new display engine revision (DE33).
Add a display engine bus binding for the DE33. Note that the DE33 requires 3 register blocks instead of 1. To keep things simple remove the maxItems value for registers for the child nodes and instead rely on the bindings for the child nodes such as allwinner,sun8i-a83t-de2-mixer.yaml to enforce the max values.
--- .../devicetree/bindings/bus/allwinner,sun50i-a64-de2.yaml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)
Documentation/devicetree/bindings/bus/allwinner,sun50i-a64-de2.yaml +3 -4
@@ -24,7 +24,9 @@ properties: oneOf: - const: allwinner,sun50i-a64-de2 - items: - - const: allwinner,sun50i-h6-de3 + - enum: + - allwinner,sun50i-h6-de3 + - allwinner,sun50i-h616-de33 - const: allwinner,sun50i-a64-de2 reg:
@@ -47,9 +49,6 @@ patternProperties: "^[a-zA-Z][a-zA-Z0-9,+\\-._]{0,63}@[0-9a-fA-F]+$": type: object additionalProperties: true - properties: - reg: - maxItems: 1 required: - reg
Signature · 1 line
2.50.1
PATCH v2 3/12 dt-bindings: display: sun4i: Add compatible strings for H616 DE
In reply to Ryan WalklinAdd compatible strings for allwinner,sun50i-h616-display-engine. The device is functionally identical to the allwinner,sun50i-h6-display-engine. This is added as a new device rather than a fallback as all other DEs are modelled this way, and the device is essentially "virtual", with the relevant functional differences represented in the mixer and TCON components.
--
Changelog v1..v2:
- DE compatible added for H616
--- .../bindings/display/allwinner,sun4i-a10-display-engine.yaml | 1 + 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/display/allwinner,sun4i-a10-display-engine.yaml +1 -0
@@ -65,6 +65,7 @@ properties: - allwinner,sun20i-d1-display-engine - allwinner,sun50i-a64-display-engine - allwinner,sun50i-h6-display-engine + - allwinner,sun50i-h616-display-engine allwinner,pipelines: $ref: /schemas/types.yaml#/definitions/phandle-array
Signature · 1 line
2.50.1
PATCH v2 4/12 dt-bindings: display: sun4i: Add compatible strings for H616 TCON TOP
In reply to Ryan WalklinAdd compatible string for allwinner,sun50i-h616-tcon-top with a fallback string of allwinner,sun50i-h6-tcon-top.
--
Changelog v1..v2:
- Add H616 TCON TOP compatible.
--- .../display/allwinner,sun8i-r40-tcon-top.yaml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-)
Documentation/devicetree/bindings/display/allwinner,sun8i-r40-tcon-top.yaml +9 -4
@@ -39,10 +39,15 @@ properties: const: 1 compatible: - enum: - - allwinner,sun8i-r40-tcon-top - - allwinner,sun20i-d1-tcon-top - - allwinner,sun50i-h6-tcon-top + oneOf: + - enum: + - allwinner,sun8i-r40-tcon-top + - allwinner,sun20i-d1-tcon-top + - allwinner,sun50i-h6-tcon-top + - items: + - enum: + - allwinner,sun50i-h616-tcon-top + - const: allwinner,sun50i-h6-tcon-top reg: maxItems: 1
Signature · 1 line
2.50.1
PATCH v2 5/12 dt-bindings: display: sun4i: add allwinner R40 and H616 tcon compatible strings
In reply to Ryan WalklinAdd compatible strings for the Allwinner R40 and H616 LCD timing controller. The H616 LCD timing controller is compatible with the R40's, so is added with a fallback to the R40.
--
Changelog v1..v2:
- Add additional H616 strings
--- .../bindings/display/allwinner,sun4i-a10-tcon.yaml | 10 ++++++++++ 1 file changed, 10 insertions(+)
Documentation/devicetree/bindings/display/allwinner,sun4i-a10-tcon.yaml +10 -0
@@ -29,6 +29,7 @@ properties: - const: allwinner,sun8i-a33-tcon - const: allwinner,sun8i-a83t-tcon-lcd - const: allwinner,sun8i-a83t-tcon-tv + - const: allwinner,sun8i-r40-tcon-lcd - const: allwinner,sun8i-r40-tcon-tv - const: allwinner,sun8i-v3s-tcon - const: allwinner,sun9i-a80-tcon-lcd
@@ -47,6 +48,11 @@ properties: - allwinner,sun50i-a64-tcon-lcd - const: allwinner,sun8i-a83t-tcon-lcd + - items: + - enum: + - allwinner,sun50i-h616-tcon-lcd + - const: allwinner,sun8i-r40-tcon-lcd + - items: - enum: - allwinner,sun8i-h3-tcon-tv
@@ -56,6 +62,7 @@ properties: - items: - enum: - allwinner,sun50i-h6-tcon-tv + - allwinner,sun50i-h616-tcon-tv - const: allwinner,sun8i-r40-tcon-tv reg:
@@ -231,6 +238,7 @@ allOf: contains: enum: - allwinner,sun8i-a83t-tcon-lcd + - allwinner,sun8i-r40-tcon-lcd - allwinner,sun8i-v3s-tcon - allwinner,sun9i-a80-tcon-lcd - allwinner,sun20i-d1-tcon-lcd
@@ -280,6 +288,7 @@ allOf: - allwinner,sun9i-a80-tcon-lcd - allwinner,sun4i-a10-tcon - allwinner,sun8i-a83t-tcon-lcd + - allwinner,sun8i-r40-tcon-lcd - allwinner,sun20i-d1-tcon-lcd then:
@@ -297,6 +306,7 @@ allOf: - allwinner,sun8i-a23-tcon - allwinner,sun8i-a33-tcon - allwinner,sun8i-a83t-tcon-lcd + - allwinner,sun8i-r40-tcon-lcd - allwinner,sun20i-d1-tcon-lcd then:
Signature · 1 line
2.50.1
PATCH v2 6/12 dt-bindings: sram: sunxi-sram: Add H616 SRAM C compatible
In reply to Ryan WalklinAdd a compatible string for the H616 SRAM C region which is functionally similar to the A64 SRAM C region.
--
Changelog v1..v2: Add H616 fallback string
--- .../bindings/sram/allwinner,sun4i-a10-system-control.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/sram/allwinner,sun4i-a10-system-control.yaml +3 -1
@@ -103,7 +103,9 @@ patternProperties: - allwinner,sun7i-a20-sram-d - const: allwinner,sun4i-a10-sram-d - items: - - const: allwinner,sun50i-h6-sram-c + - enum: + - allwinner,sun50i-h6-sram-c + - allwinner,sun50i-h616-sram-c - const: allwinner,sun50i-a64-sram-c required:
Signature · 1 line
2.50.1
PATCH v2 7/12 drm/sun4i: tcon: add support for R40
In reply to Ryan WalklinFrom: Jernej Skrabec <[email protected]>
The Allwinner H616 and related SOCs have an LCD timing controller (TCON) which is compatible with the R40 SOC's controller and existing sun4i driver. The H616 does not expose this controller but the H700 and T507 (based on the same die) do. The controller supports LVDS and RGB output.
Add quirks and compatible string to cover these SOCs.
--- drivers/gpu/drm/sun4i/sun4i_tcon.c | 9 +++++++++ 1 file changed, 9 insertions(+)
drivers/gpu/drm/sun4i/sun4i_tcon.c +9 -0
@@ -1514,6 +1514,14 @@ static const struct sun4i_tcon_quirks sun8i_a83t_tv_quirks = { .has_channel_1 = true, }; +static const struct sun4i_tcon_quirks sun8i_r40_lcd_quirks = { + .supports_lvds = true, + .has_channel_0 = true, + .set_mux = sun8i_r40_tcon_tv_set_mux, + .dclk_min_div =1 , + .setup_lvds_phy = sun6i_tcon_setup_lvds_phy, +}; +static const struct sun4i_tcon_quirks sun8i_r40_tv_quirks = { .has_channel_1 = true, .polarity_in_ch0 = true,
@@ -1555,6 +1563,7 @@ const struct of_device_id sun4i_tcon_of_table[] = { { .compatible = "allwinner,sun8i-a33-tcon", .data = &sun8i_a33_quirks }, { .compatible = "allwinner,sun8i-a83t-tcon-lcd", .data = &sun8i_a83t_lcd_quirks }, { .compatible = "allwinner,sun8i-a83t-tcon-tv", .data = &sun8i_a83t_tv_quirks }, + { .compatible = "allwinner,sun8i-r40-tcon-lcd", .data = &sun8i_r40_lcd_quirks }, { .compatible = "allwinner,sun8i-r40-tcon-tv", .data = &sun8i_r40_tv_quirks }, { .compatible = "allwinner,sun8i-v3s-tcon", .data = &sun8i_v3s_quirks }, { .compatible = "allwinner,sun9i-a80-tcon-lcd", .data = &sun9i_a80_tcon_lcd_quirks },
Signature · 1 line
2.50.1
PATCH v2 8/12 drm: sun4i: add compatible for h616 display engine
In reply to Ryan WalklinAs discussed on list in the previous version of this patch [1], H616 DE compatible could be added using the H6 as a fallback, however all other SoCs have individual compatibles, so add the H616 here for consistency.
Add a compatible for the H616 display engine.
[1] https://lore.kernel.org/linux-sunxi/[email protected]
--
Changelog v1..v2:
- Add a compatible for the H616 display engine
--- drivers/gpu/drm/sun4i/sun4i_drv.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/sun4i/sun4i_drv.c +1 -0
@@ -436,6 +436,7 @@ static const struct of_device_id sun4i_drv_of_table[] = { { .compatible = "allwinner,sun20i-d1-display-engine" }, { .compatible = "allwinner,sun50i-a64-display-engine" }, { .compatible = "allwinner,sun50i-h6-display-engine" }, + { .compatible = "allwinner,sun50i-h616-display-engine" }, { } };MODULE_DEVICE_TABLE (of, sun4i_drv_of_table);
Signature · 1 line
2.50.1
PATCH v2 9/12 arm64: dts: allwinner: h616: add display engine, bus and mixer nodes
In reply to Ryan WalklinThe Allwinner H616 and variants (H618, H700 and T507) have a new display engine variant (DE33). Support has been added to the existing DE2/DE3 sun4i driver in a previous patch series [1]. The variant is selected via the appropriate mixer device tree compatible string.
Add the respective device-tree nodes for the DE, bus, clock and mixer to the H616 DTSI, and the matching SRAM section for the DE.
[1] https://lore.kernel.org/linux-sunxi/[email protected]
--
Changelog v1..v2:
- Use A64 fallback for bus driver rather than add additional compatible in driver, enum added to dt-binding in previous patch.
- amend order of display clocks (bus/mod) to match dt binding.
- add mixer register names.
- removed IOMMU binding due to late binding warning likely reflecting sunxi IOMMU driver bug. This is not required for RGB LCD output.
- use H616 compatibles
- Update SRAM name to DE33
--- .../arm64/boot/dts/allwinner/sun50i-h616.dtsi | 58 +++++++++++++++++++ 1 file changed, 58 insertions(+)
arch/arm64/boot/dts/allwinner/sun50i-h616.dtsi +58 -0
@@ -94,6 +94,12 @@ l2_cache: l2-cache { }; }; + de: display-engine { + compatible = "allwinner,sun50i-h616-display-engine"; + allwinner,pipelines = <&mixer0>; + status = "disabled"; + }; + reserved-memory { #address-cells = <2>; #size-cells = <2>;
@@ -150,6 +156,52 @@ soc { #size-cells = <1>; ranges = <0x0 0x0 0x0 0x40000000>; + bus: bus@1000000 { + compatible = "allwinner,sun50i-h616-de33", + "allwinner,sun50i-a64-de2"; + reg = <0x1000000 0x400000>; + allwinner,sram = <&de33_sram 1>; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0 0x1000000 0x400000>; + + display_clocks: clock@8000 { + compatible = "allwinner,sun50i-h616-de33-clk"; + reg = <0x8000 0x100>; + clocks = <&ccu CLK_BUS_DE>, + <&ccu CLK_DE>; + clock-names = "bus", "mod"; + resets = <&ccu RST_BUS_DE>; + #clock-cells = <1>; + #reset-cells = <1>; + }; + + mixer0: mixer@100000 { + compatible = "allwinner,sun50i-h616-de33-mixer-0"; + reg = <0x100000 0x100000>, + <0x8100 0x40>, + <0x280000 0x20000>; + reg-names = "layers", "top", "display"; + clocks = <&display_clocks CLK_BUS_MIXER0>, + <&display_clocks CLK_MIXER0>; + clock-names = "bus", "mod"; + resets = <&display_clocks RST_MIXER0>; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + mixer0_out: port@1 { + reg = <1>; + + mixer0_out_tcon_top: endpoint { + remote-endpoint = <&tcon_top_mixer0_in_mixer0>; + }; + }; + }; + }; + }; + gpu: gpu@1800000 { compatible = "allwinner,sun50i-h616-mali", "arm,mali-bifrost";
@@ -188,6 +240,12 @@ sram_c: sram@28000 { #address-cells = <1>; #size-cells = <1>; ranges = <0 0x00028000 0x30000>; + + de33_sram: sram-section@0 { + compatible = "sun50i-h616-sram-c", + "allwinner,sun50i-a64-sram-c"; + reg = <0x0000 0x1e000>; + }; }; };
Signature · 1 line
2.50.1
PATCH v2 10/12 arm64: dts: allwinner: h616: Add LCD timing controller nodes
In reply to Ryan WalklinThe Allwinner H616 has a display pipeline similar to other Allwinner devices, specifically the A10, but using a newer display engine revision (DE33).
Not all output pins are exposed on all package variants, for example only the H700 and T507 have LCD pins exposed, but all variants support HDMI output. On the die these are connected to a display engine via a TCON TOP and one or more timing controllers (TCONs).
Add TCON nodes for the TOP, and the LCD and TV timing controllers. The timing controllers are compatible with the existing R40 driver.
HDMI output support is not provided in this series so for now note this within the relevant node to prevent a DT compiler error.
--
Changelog v1..v2:
- Add correct register, address and size cell, and endpoint definitions
- Add stub tcon_lcd0_out_lcd endpoint so that device DTs only need to provide remote endpoint.
--- .../arm64/boot/dts/allwinner/sun50i-h616.dtsi | 141 ++++++++++++++++++ 1 file changed, 141 insertions(+)
arch/arm64/boot/dts/allwinner/sun50i-h616.dtsi +141 -0
@@ -7,9 +7,12 @@ #include <dt-bindings/clock/sun50i-h616-ccu.h> #include <dt-bindings/clock/sun50i-h6-r-ccu.h> #include <dt-bindings/clock/sun6i-rtc.h> +#include <dt-bindings/clock/sun8i-de2.h> +#include <dt-bindings/clock/sun8i-tcon-top.h> #include <dt-bindings/reset/sun50i-h616-ccu.h> #include <dt-bindings/reset/sun50i-h6-r-ccu.h> #include <dt-bindings/thermal/thermal.h> +#include <dt-bindings/reset/sun8i-de2.h> / { interrupt-parent = <&gic>;
@@ -926,6 +929,144 @@ ohci3: usb@5311400 { status = "disabled"; }; + tcon_top: tcon-top@6510000 { + compatible = "allwinner,sun50i-h6-tcon-top"; + reg = <0x06510000 0x1000>; + clocks = <&ccu CLK_BUS_TCON_TOP>, + <&ccu CLK_TCON_TV0>; + clock-names = "bus", "tcon-tv0"; + clock-output-names = "tcon-top-tv0"; + #clock-cells = <1>; + resets = <&ccu RST_BUS_TCON_TOP>; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + tcon_top_mixer0_in: port@0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + + tcon_top_mixer0_in_mixer0: endpoint@0 { + reg = <0>; + remote-endpoint = <&mixer0_out_tcon_top>; + }; + }; + + tcon_top_mixer0_out: port@1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + + tcon_top_mixer0_out_tcon_lcd0: endpoint@0 { + reg = <0>; + remote-endpoint = <&tcon_lcd0_in_tcon_top_mixer0>; + }; + + tcon_top_mixer0_out_tcon_tv0: endpoint@2 { + reg = <2>; + remote-endpoint = <&tcon_tv0_in_tcon_top_mixer0>; + }; + }; + + tcon_top_hdmi_in: port@4 { + #address-cells = <1>; + #size-cells = <0>; + reg = <4>; + + tcon_top_hdmi_in_tcon_tv0: endpoint@0 { + reg = <0>; + remote-endpoint = <&tcon_tv0_out_tcon_top>; + }; + }; + + tcon_top_hdmi_out: port@5 { + reg = <5>; + + tcon_top_hdmi_out_hdmi: endpoint { + /* placeholder for HDMI - remote-endpoint = <&hdmi_in_tcon_top>;*/ + }; + }; + }; + }; + + tcon_lcd0: lcd-controller@6511000 { + compatible = "allwinner,sun8i-r40-tcon-lcd"; + reg = <0x06511000 0x1000>; + interrupts = <GIC_SPI 64 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&ccu CLK_BUS_TCON_LCD0>, <&ccu CLK_TCON_LCD0>; + clock-names = "ahb", "tcon-ch0"; + clock-output-names = "tcon-data-clock"; + #clock-cells = <0>; + resets = <&ccu RST_BUS_TCON_LCD0>, <&ccu RST_BUS_LVDS>; + reset-names = "lcd", "lvds"; + status = "disabled"; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + tcon_lcd0_in: port@0 { + reg = <0>; + #address-cells = <1>; + #size-cells = <0>; + + tcon_lcd0_in_tcon_top_mixer0: endpoint { + remote-endpoint = <&tcon_top_mixer0_out_tcon_lcd0>; + }; + }; + + tcon_lcd0_out: port@1 { + reg = <1>; + #address-cells = <1>; + #size-cells = <0>; + + tcon_lcd0_out_lcd: endpoint@0 { + reg = <0>; + }; + }; + }; + }; + + tcon_tv0: lcd-controller@6515000 { + compatible = "allwinner,sun50i-h6-tcon-tv", + "allwinner,sun8i-r40-tcon-tv"; + reg = <0x06515000 0x1000>; + interrupts = <GIC_SPI 66 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&ccu CLK_BUS_TCON_TV0>, + <&tcon_top CLK_TCON_TOP_TV0>; + clock-names = "ahb", "tcon-ch1"; + #clock-cells = <0>; + resets = <&ccu RST_BUS_TCON_TV0>; + reset-names = "lcd"; + status = "disabled"; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + tcon_tv0_in: port@0 { + reg = <0>; + #address-cells = <1>; + #size-cells = <0>; + tcon_tv0_in_tcon_top_mixer0: endpoint { + remote-endpoint = <&tcon_top_mixer0_out_tcon_tv0>; + }; + }; + + tcon_tv0_out: port@1 { + reg = <1>; + #address-cells = <1>; + #size-cells = <0>; + tcon_tv0_out_tcon_top: endpoint@1 { + reg = <1>; + remote-endpoint = <&tcon_top_hdmi_in_tcon_tv0>; + }; + }; + }; + }; + rtc: rtc@7000000 { compatible = "allwinner,sun50i-h616-rtc"; reg = <0x07000000 0x400>;
Signature · 1 line
2.50.1
PATCH v2 11/12 arm64: dts: allwinner: h616: add LCD and LVDS pins
In reply to Ryan WalklinThe Allwinner H616 (and its H618, H700 and T507 package variants with the same die) have 28 video output pins for RGB/SPI and LVDS display. These are in GPIO Bank D and are multiplexed.
In RGB mode, pins PD0-PD23 are for 24-bit RGB pixel output, pins PD24-PD27 are for clock, DE, HSYNC and VSYNC.
In LVDS mode, pins PD0-PD9 are for LVDS0 and pins PD10-19 for LVDS1, and can be configured by the H616 display engine for either one high- resolution (dual link) or two low resolution displays.
Add device tree nodes for the LCD and LVDS pins.
--
Changelog v1..v2:
- Remove PWM pin assignment as driver not implemented
--- .../arm64/boot/dts/allwinner/sun50i-h616.dtsi | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+)
arch/arm64/boot/dts/allwinner/sun50i-h616.dtsi +26 -0
@@ -339,6 +339,32 @@ ir_rx_pin: ir-rx-pin { function = "ir_rx"; }; + /omit-if-no-ref/ + lcd0_rgb888_pins: lcd0-rgb888-pins { + pins = "PD0", "PD1", "PD2", "PD3", + "PD4", "PD5", "PD6", "PD7", + "PD8", "PD9", "PD10", "PD11", + "PD12", "PD13", "PD14", "PD15", + "PD16", "PD17", "PD18", "PD19", + "PD20", "PD21", "PD22", "PD23", + "PD24", "PD25", "PD26", "PD27"; + function = "lcd0"; + }; + + /omit-if-no-ref/ + lvds0_pins: lvds0-pins { + pins = "PD0", "PD1", "PD2", "PD3", "PD4", + "PD5", "PD6", "PD7", "PD8", "PD9"; + function = "lvds0"; + }; + + /omit-if-no-ref/ + lvds1_pins: lvds1-pins { + pins = "PD10", "PD11", "PD12", "PD13", "PD14", + "PD15", "PD16", "PD17", "PD18", "PD19"; + function = "lvds1"; + }; + mmc0_pins: mmc0-pins { pins = "PF0", "PF1", "PF2", "PF3", "PF4", "PF5";
Signature · 1 line
2.50.1
PATCH v2 12/12 arm64: dts: allwinner: rg35xx: Enable LCD output
In reply to Ryan WalklinThe RG35XX has a 640x480 RGB/SPI LCD panel, supported by the SoC display pipeline and an NV3052C controller. The H616 SOC's GPIO bank D contains the muxed display pins for RGB and LVDS output support.
The backlight for this device is not modelled as the PWM driver for the H616 is not yet implemented.
Enable the display engine and LCD timing controller, configure the panel, and add a fixed 3.3v GPIO-controlled regulator for the panel, and a VCC supply for the display pins as per the other GPIO banks.
Changelog v1..v2:
- Remove GPIO backlight node.
--- .../sun50i-h700-anbernic-rg35xx-2024.dts | 56 +++++++++++++++++++ 1 file changed, 56 insertions(+)
arch/arm64/boot/dts/allwinner/sun50i-h700-anbernic-rg35xx-2024.dts +55 -0
@@ -181,6 +181,49 @@ reg_vcc5v: regulator-vcc5v { /* USB-C power input */ regulator-min-microvolt = <5000000>; regulator-max-microvolt = <5000000>; }; + + reg_lcd: regulator-gpio-lcd-vdd { + compatible = "regulator-fixed"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-name = "vdd-lcd"; + gpio = <&pio 8 15 GPIO_ACTIVE_HIGH>; // PI15 + enable-active-high; + }; + + spi_lcd: spi { + compatible = "spi-gpio"; + #address-cells = <1>; + #size-cells = <0>; + + sck-gpios = <&pio 8 9 GPIO_ACTIVE_HIGH>; // PI9 + mosi-gpios = <&pio 8 10 GPIO_ACTIVE_HIGH>; // PI10 + cs-gpios = <&pio 8 8 GPIO_ACTIVE_HIGH>; // PI8 + num-chipselects = <1>; + + panel: panel@0 { + compatible = "anbernic,rg35xx-plus-panel"; + + reg = <0>; + + spi-max-frequency = <3125000>; + spi-3wire; + + reset-gpios = <&pio 8 14 GPIO_ACTIVE_LOW>; // PI14 + + power-supply = <®_lcd>; + + pinctrl-0 = <&lcd0_rgb888_pins>; + pinctrl-names = "default"; + + port { + panel_in_rgb: endpoint { + remote-endpoint = <&tcon_lcd0_out_lcd>; + }; + }; + }; + }; }; &codec {
@@ -196,6 +239,10 @@ &cpu0 { cpu-supply = <®_dcdc1>; }; +&de { + status = "okay"; +}; + &ehci0 { status = "okay"; };
@@ -220,6 +267,7 @@ &ohci0 { &pio { vcc-pa-supply = <®_cldo3>; vcc-pc-supply = <®_cldo3>; + vcc-pd-supply = <®_cldo3>; vcc-pe-supply = <®_cldo3>; vcc-pf-supply = <®_cldo3>; vcc-pg-supply = <®_aldo4>;
@@ -379,3 +427,11 @@ &usbotg { &usbphy { status = "okay"; }; + +&tcon_lcd0 { + status = "okay"; +}; + +&tcon_lcd0_out_lcd { + remote-endpoint = <&panel_in_rgb>; +};
Signature · 1 line
2.50.1
Re: [PATCH v2 02/12] dt-bindings: allwinner: add H616 DE33 bus binding
In reply to Ryan WalklinDocumentation/devicetree/bindings/bus/allwinner,sun50i-a64-de2.yaml patternProperties: · line 54
Quoted 12 lines · Ryan Walklin
reg:
Documentation/devicetree/bindings/bus/allwinner,sun50i-a64-de2.yaml +0
-3@@ -47,9 +49,6 @@ patternProperties: "^[a-zA-Z][a-zA-Z0-9,+\\-._]{0,63}@[0-9a-fA-F]+$": type: object additionalProperties: true - properties: - reg: - maxItems: 1 required: - reg
Then this is also not needed, but usually we expect here specific children enforced by compatible (see for example qcom display bindings). What sort of children do you have here?
Best regards,
Krzysztof
Re: [PATCH v2 04/12] dt-bindings: display: sun4i: Add compatible strings for H616 TCON TOP
In reply to Ryan WalklinQuoted 6 lines · Ryan Walklin
Add compatible string for allwinner,sun50i-h616-tcon-top with a fallback string of allwinner,sun50i-h6-tcon-top.
Signed-off-by Chris Morgan <[email protected]>Signed-off-by Ryan Walklin <[email protected]>
Quoted 6 lines
--
Changelog v1..v2:
- Add H616 TCON TOP compatible.--- .../display/allwinner,sun8i-r40-tcon-top.yaml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-)
Best regards,
Krzysztof
Re: [PATCH v2 06/12] dt-bindings: sram: sunxi-sram: Add H616 SRAM C compatible
In reply to Ryan WalklinQuoted 2 lines · Ryan Walklin
Add a compatible string for the H616 SRAM C region which is functionally similar to the A64 SRAM C region.
h616 for the parent device is already documented in the top, right? This should be one patch.
Post complete bindings for the device, not chunk by chunk.
Best regards,
Krzysztof
Re: [PATCH v2 01/12] dt-bindings: allwinner: Add TCON_TOP_LCD clock defines
In reply to Ryan WalklinHi.
Quoted 16 lines · Ryan Walklin
The Allwinner H700 exposes RGB and LVDS pins as well as a HDMI connector. This requires additional clocks for the
TCON_TOPas per the T507 datasheet (which shares the same die).Signed-off-by Ryan Walklin <[email protected]>--- include/dt-bindings/clock/sun8i-tcon-top.h | 2 ++ 1 file changed, 2 insertions(+)include/dt-bindings/clock/sun8i-tcon-top.h +0
-0
include/dt-bindings/clock/sun8i-tcon-top.h line 11
Quoted 5 lines
include/dt-bindings/clock/sun8i-tcon-top.h +2
-0@@ -7,5 +7,7 @@#define CLK_TCON_TOP_TV0 0#define CLK_TCON_TOP_TV1 1#define CLK_TCON_TOP_DSI 2 +#define CLK_TCON_TOP_LCD0 3 +#define CLK_TCON_TOP_LCD1 4
I'm confused as I don't see these new ones used anywhere in the series.
ChenYu