ARM: sun9i: a80: Add display support
Subsystems (5)
cover ARM: sun9i: a80: Add display support
Hi everyone,
This series adds basic support for the display pipelines found on the Allwinner A80 SoC. Currently only parallel RGB output via TCON0 is supported. TCON1 drives the HDMI encoder, which I've not been able to get working yet.
Patch 1 adds device tree bindings for the TCONs on the A80. In particular, TCON0 requires the eDP reset control in addition to its own.
Patch 2 adds a device tree binding for the Detail Enhancement Unit found only on the A80.
Patch 3 adds driver support for the TCONs.
Patch 4 adds compatible strings to the device tree bindings for all the remaining peripherals covered by this series.
Patch 5 adds support for the compatible strings from the previous patch to the sun4i-drm driver.
Patch 6 adds the display pipeline device nodes to the A80 .dtsi file.
Patch 7 adds a pinmux setting for RGB888 output for TCON0.
Patch 8 enables VGA output on the Cubieboard4 via an external DAC and an I2C bus from the SoC for DDC.
I've had these patches for quite some time now, rebasing them as more features were added to sun4i-drm. Please have a look.
Regards
ChenYu
Chen-Yu Tsai (8):
drm/sun4i: Add compatible strings for A80 TCONs
drm/sun4i: Add DT binding for Detail Enhancement Unit in Allwinner A80
SoC
drm/sun4i: Add support for A80 TCONs
drm/sun4i: Add compatible strings for the A80 display pipeline drm/sun4i: Add driver support for A80 display pipeline
ARM: dts: sun9i: Add device nodes for documented display pipelines for
A80
ARM: dts: sun9i: Add pinmux settings for LCD0 RGB888 output.
ARM: dts: sun9i: cubieboard4: Enable VGA display output
.../bindings/display/sunxi/sun4i-drm.txt | 39 +- arch/arm/boot/dts/sun9i-a80-cubieboard4.dts | 68 ++++ arch/arm/boot/dts/sun9i-a80.dtsi | 392 +++++++++++++++++++++ drivers/gpu/drm/sun4i/sun4i_backend.c | 7 + drivers/gpu/drm/sun4i/sun4i_drv.c | 12 +- drivers/gpu/drm/sun4i/sun4i_tcon.c | 27 ++ drivers/gpu/drm/sun4i/sun4i_tcon.h | 1 + drivers/gpu/drm/sun4i/sun6i_drc.c | 1 + 8 files changed, 541 insertions(+), 6 deletions(-)
Signature · 1 line
2.16.2
PATCH 1/8 drm/sun4i: Add compatible strings for A80 TCONs
The A80 has 2 or 3 TCONs. The documentation and vendor kernel are very vague about the third TCON, to the point that it might not exist.
In the documentation, the first TCON is missing channel 1, and the second is missing channel 0. However the vendor kernel seems to be able to use them regardless. Here we model them like the old TCONs.
An oddity is that TCON0 requires the reset control for the eDP block to be deasserted, for any register access to stick.
This patch adds compatible strings for TCON0 and TCON1, with TCON0 requiring an extra "edp" reset control.
--- Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-)
Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt +8 -3
@@ -146,13 +146,16 @@ Required properties: * allwinner,sun8i-a83t-tcon-lcd * allwinner,sun8i-a83t-tcon-tv * allwinner,sun8i-v3s-tcon + * allwinner,sun9i-a80-tcon-lcd + * allwinner,sun9i-a80-tcon-tv - reg: base address and size of memory-mapped region - interrupts: interrupt associated to this IP - clocks: phandles to the clocks feeding the TCON. - 'ahb': the interface clocks - - 'tcon-ch0': The clock driving the TCON channel 0, except for A83T TV TCON + - 'tcon-ch0': The clock driving the TCON channel 0, if supported - resets: phandles to the reset controllers driving the encoder - - "lcd": the reset line for the TCON channel 0 + - "lcd": the reset line for the TCON + - "edp": the reset line for the eDP block (A80 only) - clock-names: the clock names mentioned above - reset-names: the reset names mentioned above
@@ -171,7 +174,9 @@ Required properties: channel the endpoint is associated to. If that property is not present, the endpoint number will be used as the channel number. -On SoCs other than the A33 and V3s, there is one more clock required: +For TCONs with channel 0, there is one more clock required: + - 'tcon-ch0': The clock driving the TCON channel 0 +For TCONs with channel 1, there is one more clock required: - 'tcon-ch1': The clock driving the TCON channel 1 When TCON support LVDS (all TCONs except TV TCON on A83T and those found
Signature · 1 line
2.16.2
PATCH 2/8 drm/sun4i: Add DT binding for Detail Enhancement Unit in Allwinner A80 SoC
In reply to Chen-Yu TsaiThe display pipeline on the A80 SoC has what is called the Detail Enhancement Unit, or DEU for short, block in between the display frontend and backend. This unit can sharpen images in both luma and chroma channels. It seems to also do colorspace conversion.
This patch adds the device tree binding for this hardware block.
--- .../bindings/display/sunxi/sun4i-drm.txt | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+)
Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt +22 -0
@@ -248,6 +248,28 @@ On the A33, some additional properties are required: - resets and reset-names need to have a phandle to the SAT bus resets, whose name will be "sat" +DEU +--- + +The DEU (Detail Enhancement Unit), found in the Allwinner A80 SoC, +can sharpen the display content in both luma and chroma channels. + +Required properties: + - compatible: value must be one of: + * allwinner,sun9i-a80-deu + - reg: base address and size of the memory-mapped region. + - interrupts: interrupt associated to this IP + - clocks: phandles to the clocks feeding the DEU + * ahb: the DEU interface clock + * mod: the DEU module clock + * ram: the DEU DRAM clock + - clock-names: the clock names mentioned above + - resets: phandles to the reset line driving the DEU + +- ports: A ports node with endpoint definitions as defined in + Documentation/devicetree/bindings/media/video-interfaces.txt. The + first port should be the input endpoints, the second one the outputs + Display Engine Frontend -----------------------
Signature · 1 line
2.16.2
PATCH 3/8 drm/sun4i: Add support for A80 TCONs
In reply to Chen-Yu TsaiThe Allwinner A80 SoC has 2 documented TCONs. The display pipeline diagram from the user manual shows a third TCON, but it's missing an interrupt line, and its registers are not explained either. It's also not used in Allwinner's vendor BSP.
The first TCON only has channel 0, for LCD panel output. The TCON hardware setup is peculiar in that the eDP reset must also be deasserted to allow access to the TCON. How the eDP module is wired in the SoC itself is never explained.
The second TCON only has channel 1, and its output is connected to the HDMI encoder block.
This patch adds a "needs_edp_reset" field to the tcon quirks structure, and adds quirks and compatible strings for the 2 documented TCONs.
--- drivers/gpu/drm/sun4i/sun4i_tcon.c | 27 +++++++++++++++++++++++++++ drivers/gpu/drm/sun4i/sun4i_tcon.h | 1 + 2 files changed, 28 insertions(+)
drivers/gpu/drm/sun4i/sun4i_tcon.c +27 -0
@@ -855,6 +855,7 @@ static int sun4i_tcon_bind(struct device *dev, struct device *master,struct sunxi_engine *engine;struct device_node *remote;struct sun4i_tcon *tcon; +struct reset_control *edp_rstc;bool has_lvds_rst, has_lvds_alt, can_lvds;int ret;
@@ -879,6 +880,20 @@ static int sun4i_tcon_bind(struct device *dev, struct device *master,return PTR_ERR (tcon->lcd_rst); } +if (tcon->quirks->needs_edp_reset) { + edp_rstc =devm_reset_control_get_shared (dev,"edp" ); +if (IS_ERR (edp_rstc)) { +dev_err (dev,"Couldn't get edp reset line\n" ); +return PTR_ERR (edp_rstc); + } + + ret =reset_control_deassert (edp_rstc); +if (ret) { +dev_err (dev,"Couldn't deassert edp reset line\n" ); +return ret; + } + } +/* Make sure our TCON is reset */ ret =reset_control_reset (tcon->lcd_rst);if (ret) {
@@ -1176,6 +1191,16 @@ static const struct sun4i_tcon_quirks sun8i_v3s_quirks = { .has_channel_0 = true, }; +static const struct sun4i_tcon_quirks sun9i_a80_tcon_lcd_quirks = { + .has_channel_0 = true, + .needs_edp_reset = true, +}; + +static const struct sun4i_tcon_quirks sun9i_a80_tcon_tv_quirks = { + .has_channel_1 = true, + .needs_edp_reset = true, +}; +/* sun4i_drv uses this list to check if a device node is a TCON */ const struct of_device_id sun4i_tcon_of_table[] = { { .compatible ="allwinner,sun4i-a10-tcon" , .data = &sun4i_a10_quirks },
@@ -1187,6 +1212,8 @@ const struct of_device_id sun4i_tcon_of_table[] = { { .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-v3s-tcon", .data = &sun8i_v3s_quirks }, + { .compatible = "allwinner,sun9i-a80-tcon-lcd", .data = &sun9i_a80_tcon_lcd_quirks }, + { .compatible = "allwinner,sun9i-a80-tcon-tv", .data = &sun9i_a80_tcon_tv_quirks }, { } };MODULE_DEVICE_TABLE (of, sun4i_tcon_of_table);
drivers/gpu/drm/sun4i/sun4i_tcon.h +1 -0
@@ -176,6 +176,7 @@ struct sun4i_tcon_quirks {bool has_channel_1;/* a33 does not have channel 1 */ bool has_lvds_alt;/* Does the LVDS clock have a parent other than the TCON clock? */ bool needs_de_be_mux;/* sun6i needs mux to select backend */ +bool needs_edp_reset;/* a80 edp reset needed for tcon0 access */ bool supports_lvds;/* Does the TCON support an LVDS output? */ /* callback to handle tcon muxing options */
Signature · 1 line
2.16.2
PATCH 4/8 drm/sun4i: Add compatible strings for the A80 display pipeline
In reply to Chen-Yu TsaiThis patch adds compatible strings for the remaining documented components of the Allwinner A80 display pipeline.
--- Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt +5 -1
@@ -191,7 +191,7 @@ DRC --- The DRC (Dynamic Range Controller), found in the latest Allwinner SoCs -(A31, A23, A33), allows to dynamically adjust pixel +(A31, A23, A33, A80), allows to dynamically adjust pixel brightness/contrast based on histogram measurements for LCD content adaptive backlight control.
@@ -201,6 +201,7 @@ Required properties: * allwinner,sun6i-a31-drc * allwinner,sun6i-a31s-drc * allwinner,sun8i-a33-drc + * allwinner,sun9i-a80-drc - reg: base address and size of the memory-mapped region. - interrupts: interrupt associated to this IP - clocks: phandles to the clocks feeding the DRC
@@ -227,6 +228,7 @@ Required properties: * allwinner,sun6i-a31-display-backend * allwinner,sun7i-a20-display-backend * allwinner,sun8i-a33-display-backend + * allwinner,sun9i-a80-display-backend - reg: base address and size of the memory-mapped region. - interrupts: interrupt associated to this IP - clocks: phandles to the clocks feeding the frontend and backend
@@ -283,6 +285,7 @@ Required properties: * allwinner,sun6i-a31-display-frontend * allwinner,sun7i-a20-display-frontend * allwinner,sun8i-a33-display-frontend + * allwinner,sun9i-a80-display-frontend - reg: base address and size of the memory-mapped region. - interrupts: interrupt associated to this IP - clocks: phandles to the clocks feeding the frontend and backend
@@ -339,6 +342,7 @@ Required properties: * allwinner,sun8i-a83t-display-engine * allwinner,sun8i-h3-display-engine * allwinner,sun8i-v3s-display-engine + * allwinner,sun9i-a80-display-engine - allwinner,pipelines: list of phandle to the display engine frontends (DE 1.0) or mixers (DE 2.0) available.
Signature · 1 line
2.16.2
PATCH 5/8 drm/sun4i: Add driver support for A80 display pipeline
In reply to Chen-Yu TsaiThis patch adds support for the compatible strings of the A80 display pipeline.
--- drivers/gpu/drm/sun4i/sun4i_backend.c | 7 +++++++ drivers/gpu/drm/sun4i/sun4i_drv.c | 12 ++++++++++-- drivers/gpu/drm/sun4i/sun6i_drc.c | 1 + 3 files changed, 18 insertions(+), 2 deletions(-)
drivers/gpu/drm/sun4i/sun4i_backend.c +7 -0
@@ -793,6 +793,9 @@ static const struct sun4i_backend_quirks sun7i_backend_quirks = {static const struct sun4i_backend_quirks sun8i_a33_backend_quirks = { }; +static const struct sun4i_backend_quirks sun9i_backend_quirks = { +}; +static const struct of_device_id sun4i_backend_of_table[] = { { .compatible ="allwinner,sun4i-a10-display-backend" ,
@@ -814,6 +817,10 @@ static const struct of_device_id sun4i_backend_of_table[] = { .compatible = "allwinner,sun8i-a33-display-backend", .data = &sun8i_a33_backend_quirks, }, + { + .compatible = "allwinner,sun9i-a80-display-backend", + .data = &sun9i_backend_quirks, + }, { } };MODULE_DEVICE_TABLE (of, sun4i_backend_of_table);
drivers/gpu/drm/sun4i/sun4i_drv.c +10 -2
@@ -176,7 +176,13 @@ static bool sun4i_drv_node_is_frontend(struct device_node *node)of_device_is_compatible (node,"allwinner,sun5i-a13-display-frontend" ) ||of_device_is_compatible (node,"allwinner,sun6i-a31-display-frontend" ) ||of_device_is_compatible (node,"allwinner,sun7i-a20-display-frontend" ) || -of_device_is_compatible (node,"allwinner,sun8i-a33-display-frontend" ); +of_device_is_compatible (node,"allwinner,sun8i-a33-display-frontend" ) || +of_device_is_compatible (node,"allwinner,sun9i-a80-display-frontend" ); +} + +static bool sun4i_drv_node_is_deu (struct device_node *node) +{ +return of_device_is_compatible (node,"allwinner,sun9i-a80-deu" ); }static bool sun4i_drv_node_is_supported_frontend (struct device_node *node)
@@ -257,7 +263,8 @@ static int sun4i_drv_add_endpoints(struct device *dev,* enabled frontend supported by the driver, we add it to our * component list. */ -if (!sun4i_drv_node_is_frontend (node) || +if (!(sun4i_drv_node_is_frontend (node) || +sun4i_drv_node_is_deu (node)) || (sun4i_drv_node_is_supported_frontend (node) &&of_device_is_available (node))) {/* Add current component */
@@ -361,6 +368,7 @@ static const struct of_device_id sun4i_drv_of_table[] = { { .compatible = "allwinner,sun8i-a83t-display-engine" }, { .compatible = "allwinner,sun8i-h3-display-engine" }, { .compatible = "allwinner,sun8i-v3s-display-engine" }, + { .compatible = "allwinner,sun9i-a80-display-engine" }, { } };MODULE_DEVICE_TABLE (of, sun4i_drv_of_table);
drivers/gpu/drm/sun4i/sun6i_drc.c +1 -0
@@ -101,6 +101,7 @@ static const struct of_device_id sun6i_drc_of_table[] = { { .compatible = "allwinner,sun6i-a31-drc" }, { .compatible = "allwinner,sun6i-a31s-drc" }, { .compatible = "allwinner,sun8i-a33-drc" }, + { .compatible = "allwinner,sun9i-a80-drc" }, { } };MODULE_DEVICE_TABLE (of, sun6i_drc_of_table);
Signature · 1 line
2.16.2
PATCH 6/8 ARM: dts: sun9i: Add device nodes for documented display pipelines for A80
In reply to Chen-Yu TsaiThe Allwinner A80 SoC has 3 display pipelines, of which some parts are documented:
- 3x display front ends (FE), documented
- 2x display enhancement units (DEU), undocumented
- 3x display back ends (BE), documented
- 2x dynamic range controller (DRC), undocumented
- 2x LCDC/TCONs, documented
- 1x LCDC/TCON, undocumented, and probably not useable
- 1x HDMI transmitter, undocumented but DesignWare compatible
- 1x MERGE block, function unknown
This patch adds device nodes for the first 2 documented pipelines:
FE0 - DEU0 - - BE0 - DRC0 - TCON0
x
FE1 - DEU1 - - BE1 - DRC1 - TCON1--- arch/arm/boot/dts/sun9i-a80.dtsi | 381 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 381 insertions(+)
arch/arm/boot/dts/sun9i-a80.dtsi +381 -0
@@ -248,6 +248,12 @@ }; }; + de: display-engine { + compatible = "allwinner,sun9i-a80-display-engine"; + allwinner,pipelines = <&fe0>, <&fe1>; + status = "disabled"; + }; + soc { compatible = "simple-bus"; #address-cells = <1>;
@@ -523,6 +529,381 @@ #reset-cells = <1>; }; + fe0: display-frontend@3100000 { + compatible = "allwinner,sun9i-a80-display-frontend"; + reg = <0x03100000 0x40000>; + interrupts = <GIC_SPI 93 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&de_clocks CLK_BUS_FE0>, <&de_clocks CLK_FE0>, + <&de_clocks CLK_DRAM_FE0>; + clock-names = "ahb", "mod", + "ram"; + resets = <&de_clocks RST_FE0>; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + fe0_out: port@1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + + fe0_out_deu0: endpoint@0 { + reg = <0>; + remote-endpoint = <&deu0_in_fe0>; + }; + }; + }; + }; + + fe1: display-frontend@3140000 { + compatible = "allwinner,sun9i-a80-display-frontend"; + reg = <0x03140000 0x40000>; + interrupts = <GIC_SPI 94 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&de_clocks CLK_BUS_FE1>, <&de_clocks CLK_FE1>, + <&de_clocks CLK_DRAM_FE1>; + clock-names = "ahb", "mod", + "ram"; + resets = <&de_clocks RST_FE0>; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + fe1_out: port@1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + + fe1_out_deu1: endpoint@0 { + reg = <0>; + remote-endpoint = <&deu1_in_fe1>; + }; + }; + }; + }; + + be0: display-backend@3200000 { + compatible = "allwinner,sun9i-a80-display-backend"; + reg = <0x03200000 0x40000>; + interrupts = <GIC_SPI 95 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&de_clocks CLK_BUS_BE0>, <&de_clocks CLK_BE0>, + <&de_clocks CLK_DRAM_BE0>; + clock-names = "ahb", "mod", + "ram"; + resets = <&de_clocks RST_BE0>; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + be0_in: port@0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + + be0_in_deu0: endpoint@0 { + reg = <0>; + remote-endpoint = <&deu0_out_be0>; + }; + + be0_in_deu1: endpoint@1 { + reg = <1>; + remote-endpoint = <&deu1_out_be0>; + }; + }; + + be0_out: port@1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + + be0_out_drc0: endpoint@0 { + reg = <0>; + remote-endpoint = <&drc0_in_be0>; + }; + }; + }; + }; + + be1: display-backend@3240000 { + compatible = "allwinner,sun9i-a80-display-backend"; + reg = <0x03240000 0x40000>; + interrupts = <GIC_SPI 96 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&de_clocks CLK_BUS_BE1>, <&de_clocks CLK_BE1>, + <&de_clocks CLK_DRAM_BE1>; + clock-names = "ahb", "mod", + "ram"; + resets = <&de_clocks RST_BE1>; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + be1_in: port@0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + + be1_in_deu0: endpoint@0 { + reg = <0>; + remote-endpoint = <&deu0_out_be1>; + }; + + be1_in_deu1: endpoint@1 { + reg = <1>; + remote-endpoint = <&deu1_out_be1>; + }; + }; + + be1_out: port@1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + + be1_out_drc1: endpoint@0 { + reg = <0>; + remote-endpoint = <&drc1_in_be1>; + }; + }; + }; + }; + + deu0: deu@3300000 { + compatible = "allwinner,sun9i-a80-deu"; + reg = <0x03300000 0x40000>; + interrupts = <GIC_SPI 92 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&de_clocks CLK_BUS_DEU0>, + <&de_clocks CLK_IEP_DEU0>, + <&de_clocks CLK_DRAM_DEU0>; + clock-names = "ahb", + "mod", + "ram"; + resets = <&de_clocks RST_DEU0>; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + deu0_in: port@0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + + deu0_in_fe0: endpoint@0 { + reg = <0>; + remote-endpoint = <&fe0_out_deu0>; + }; + }; + + deu0_out: port@1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + + deu0_out_be0: endpoint@0 { + reg = <0>; + remote-endpoint = <&be0_in_deu0>; + }; + + deu0_out_be1: endpoint@1 { + reg = <1>; + remote-endpoint = <&be1_in_deu0>; + }; + }; + }; + }; + + deu1: deu@3340000 { + compatible = "allwinner,sun9i-a80-deu"; + reg = <0x03340000 0x40000>; + interrupts = <GIC_SPI 92 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&de_clocks CLK_BUS_DEU1>, + <&de_clocks CLK_IEP_DEU1>, + <&de_clocks CLK_DRAM_DEU1>; + clock-names = "ahb", + "mod", + "ram"; + resets = <&de_clocks RST_DEU1>; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + deu1_in: port@0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + + deu1_in_fe1: endpoint@0 { + reg = <0>; + remote-endpoint = <&fe1_out_deu1>; + }; + }; + + deu1_out: port@1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + + deu1_out_be0: endpoint@0 { + reg = <0>; + remote-endpoint = <&be0_in_deu1>; + }; + + deu1_out_be1: endpoint@1 { + reg = <1>; + remote-endpoint = <&be1_in_deu1>; + }; + }; + }; + }; + + drc0: drc@3400000 { + compatible = "allwinner,sun9i-a80-drc"; + reg = <0x03400000 0x40000>; + interrupts = <GIC_SPI 91 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&de_clocks CLK_BUS_DRC0>, + <&de_clocks CLK_IEP_DRC0>, + <&de_clocks CLK_DRAM_DRC0>; + clock-names = "ahb", + "mod", + "ram"; + resets = <&de_clocks RST_DRC0>; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + drc0_in: port@0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + + drc0_in_be0: endpoint@0 { + reg = <0>; + remote-endpoint = <&be0_out_drc0>; + }; + }; + + drc0_out: port@1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + + drc0_out_tcon0: endpoint@0 { + reg = <0>; + remote-endpoint = <&tcon0_in_drc0>; + }; + }; + }; + }; + + drc1: drc@3440000 { + compatible = "allwinner,sun9i-a80-drc"; + reg = <0x03440000 0x40000>; + interrupts = <GIC_SPI 91 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&de_clocks CLK_BUS_DRC1>, + <&de_clocks CLK_IEP_DRC1>, + <&de_clocks CLK_DRAM_DRC1>; + clock-names = "ahb", + "mod", + "ram"; + resets = <&de_clocks RST_DRC1>; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + drc1_in: port@0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + + drc1_in_be1: endpoint@0 { + reg = <0>; + remote-endpoint = <&be1_out_drc1>; + }; + }; + + drc1_out: port@1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + + drc1_out_tcon1: endpoint@0 { + reg = <0>; + remote-endpoint = <&tcon1_in_drc1>; + }; + }; + }; + }; + + tcon0: lcd-controller@3c00000 { + compatible = "allwinner,sun9i-a80-tcon-lcd"; + reg = <0x03c00000 0x10000>; + interrupts = <GIC_SPI 86 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&ccu CLK_BUS_LCD0>, <&ccu CLK_LCD0>; + clock-names = "ahb", "tcon-ch0"; + resets = <&ccu RST_BUS_LCD0>, <&ccu RST_BUS_EDP>; + reset-names = "lcd", "edp"; + clock-output-names = "tcon0-pixel-clock"; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + tcon0_in: port@0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + + tcon0_in_drc0: endpoint@0 { + reg = <0>; + remote-endpoint = <&drc0_out_tcon0>; + }; + }; + + tcon0_out: port@1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + }; + }; + }; + + tcon1: lcd-controller@3c10000 { + compatible = "allwinner,sun9i-a80-tcon-tv"; + reg = <0x03c10000 0x10000>; + interrupts = <GIC_SPI 87 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&ccu CLK_BUS_LCD1>, <&ccu CLK_LCD1>; + clock-names = "ahb", "tcon-ch1"; + resets = <&ccu RST_BUS_LCD1>, <&ccu RST_BUS_EDP>; + reset-names = "lcd", "edp"; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + tcon1_in: port@0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + + tcon1_in_drc1: endpoint@0 { + reg = <0>; + remote-endpoint = <&drc1_out_tcon1>; + }; + }; + + tcon1_out: port@1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + }; + }; + }; + ccu: clock@6000000 { compatible = "allwinner,sun9i-a80-ccu"; reg = <0x06000000 0x800>;
Signature · 1 line
2.16.2
PATCH 7/8 ARM: dts: sun9i: Add pinmux settings for LCD0 RGB888 output.
In reply to Chen-Yu TsaiThe A80 supports RGB888 with H/V sync from LCD0. Add a pinmux setting for the needed pins.
--- arch/arm/boot/dts/sun9i-a80.dtsi | 11 +++++++++++ 1 file changed, 11 insertions(+)
arch/arm/boot/dts/sun9i-a80.dtsi +11 -0
@@ -953,6 +953,17 @@ function = "i2c3"; }; + 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"; + }; + mmc0_pins: mmc0-pins { pins = "PF0", "PF1" ,"PF2", "PF3", "PF4", "PF5";
Signature · 1 line
2.16.2
PATCH 8/8 ARM: dts: sun9i: cubieboard4: Enable VGA display output
In reply to Chen-Yu TsaiThe Cubieboard4 has a dumb VGA DAC connected to the output of LCD0, providing VGA output through the onboard VGA connector. The DDC lines are connected to i2c3.
The VGA DAC is a GM7123, which is compatible with Analog Devices' ADV7123, except it only takes 3.3V power, and has a lower standby power consumption. The datasheet found online lists "Chengdu GoldTel Electronical Technology Co., Ltd." as its designer. The company changed its name in 2014 to "Chengdu Corpro Technology Co., Ltd.". Their website lists similar ICs, but not actually the GM7123.
Enable the display pipeline with the VGA DAC and connector, and i2c3 for DDC.
--- arch/arm/boot/dts/sun9i-a80-cubieboard4.dts | 68 +++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+)
arch/arm/boot/dts/sun9i-a80-cubieboard4.dts +68 -0
@@ -74,6 +74,52 @@ }; }; + vga-connector { + compatible = "vga-connector"; + label = "vga"; + ddc-i2c-bus = <&i2c3>; + + port { + vga_con_in: endpoint { + remote-endpoint = <&vga_dac_out>; + }; + }; + }; + + vga-dac { + compatible = "corpro,gm7123", "adi,adv7123", "dumb-vga-dac"; + vdd-supply = <®_dcdc1>; + #address-cells = <1>; + #size-cells = <0>; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + + vga_dac_in: endpoint@0 { + reg = <0>; + remote-endpoint = <&tcon0_out_vga>; + }; + }; + + port@1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + + vga_dac_out: endpoint@0 { + reg = <0>; + remote-endpoint = <&vga_con_in>; + }; + }; + }; + }; + wifi_pwrseq: wifi-pwrseq { compatible = "mmc-pwrseq-simple"; clocks = <&ac100_rtc 1>;
@@ -83,6 +129,16 @@ }; }; +&de { + status = "okay"; +}; + +&i2c3 { + pinctrl-names = "default"; + pinctrl-0 = <&i2c3_pins>; + status = "okay"; +}; + &mmc0 { pinctrl-names = "default"; pinctrl-0 = <&mmc0_pins>;
@@ -402,6 +458,18 @@ #include "axp809.dtsi" +&tcon0 { + pinctrl-names = "default"; + pinctrl-0 = <&lcd0_rgb888_pins>; +}; + +&tcon0_out { + tcon0_out_vga: endpoint@0 { + reg = <0>; + remote-endpoint = <&vga_dac_in>; + }; +}; + &uart0 { pinctrl-names = "default"; pinctrl-0 = <&uart0_ph_pins>;
Signature · 1 line
2.16.2
Re: [PATCH 1/8] drm/sun4i: Add compatible strings for A80 TCONs
In reply to Chen-Yu TsaiQuoted 10 lines · Chen-Yu Tsai
The A80 has 2 or 3 TCONs. The documentation and vendor kernel are very vague about the third TCON, to the point that it might not exist.
In the documentation, the first TCON is missing channel 1, and the second is missing channel 0. However the vendor kernel seems to be able to use them regardless. Here we model them like the old TCONs.
An oddity is that TCON0 requires the reset control for the eDP block to be deasserted, for any register access to stick.
Quoted 7 lines
This patch adds compatible strings for TCON0 and TCON1, with TCON0 requiring an extra "edp" reset control.
Signed-off-by Chen-Yu Tsai <[email protected]>--- Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-)
Re: [PATCH 2/8] drm/sun4i: Add DT binding for Detail Enhancement Unit in Allwinner A80 SoC
In reply to Chen-Yu TsaiQuoted 11 lines · Chen-Yu Tsai
The display pipeline on the A80 SoC has what is called the Detail Enhancement Unit, or DEU for short, block in between the display frontend and backend. This unit can sharpen images in both luma and chroma channels. It seems to also do colorspace conversion.
This patch adds the device tree binding for this hardware block.
Signed-off-by Chen-Yu Tsai <[email protected]>--- .../bindings/display/sunxi/sun4i-drm.txt | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+)
Re: [PATCH 4/8] drm/sun4i: Add compatible strings for the A80 display pipeline
In reply to Chen-Yu TsaiQuoted 7 lines · Chen-Yu Tsai
This patch adds compatible strings for the remaining documented components of the Allwinner A80 display pipeline.
Signed-off-by Chen-Yu Tsai <[email protected]>--- Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
Maxime Ripard
AppliedQuoted 23 lines · Chen-Yu Tsai
Hi everyone,
This series adds basic support for the display pipelines found on the Allwinner A80 SoC. Currently only parallel RGB output via TCON0 is supported. TCON1 drives the HDMI encoder, which I've not been able to get working yet.
Patch 1 adds device tree bindings for the TCONs on the A80. In particular, TCON0 requires the eDP reset control in addition to its own.
Patch 2 adds a device tree binding for the Detail Enhancement Unit found only on the A80.
Patch 3 adds driver support for the TCONs.
Patch 4 adds compatible strings to the device tree bindings for all the remaining peripherals covered by this series.
Patch 5 adds support for the compatible strings from the previous patch to the sun4i-drm driver.
Patch 6 adds the display pipeline device nodes to the A80 .dtsi file.
Quoted 8 lines
Patch 7 adds a pinmux setting for RGB888 output for TCON0.
Patch 8 enables VGA output on the Cubieboard4 via an external DAC and an I2C bus from the SoC for DDC.
I've had these patches for quite some time now, rebasing them as more features were added to sun4i-drm. Please have a look.
Applied all, thanks!
Maxime
Signature · 3 lines
Maxime Ripard, Bootlin (formerly Free Electrons) Embedded Linux and Kernel engineering https://bootlin.com