drm/sun4i: Allwinner R40 MIPI-DSI support
Subsystems (7)
cover drm/sun4i: Allwinner R40 MIPI-DSI support
This is initial version for supporting MIPI-DSI on Allwinner R40.
The controller look similar like, Allwinnwe A64 so it has dependencies with A64 MIPI DSI changes, DSI fixes and R40 pwm driver [1] [2] [3]
PLL-MIPI, dclk divders logic bpp/lanes are properly work for R40, like A31, A64.
patch 1, 2: TCON LCD support
patch 3, 4: Use clock index macros instead of numbers
patch 5: Add tcon top lcd clocking
patch 6, 7: Add dt-bindings for r40 dsi, dphy
patch 8: Add R40 MIPI DSI pipeline
patch 9: Overlay patch to test it on BPI-M2U
[1] https://patchwork.freedesktop.org/series/61310/
[2] https://patchwork.freedesktop.org/series/60847/
[3] https://lore.kernel.org/patchwork/cover/862766/
Jagan Teki (9):
dt-bindings: display: Add TCON LCD compatible for R40
drm/sun4i: tcon: Add TCON LCD support for R40
ARM: dts: sun8i: r40: Use tcon top clock index macros
drm/sun4i: tcon_top: Use clock name index macros
ARM: dts: sun8i: r40: Add TCON TOP LCD clocking
dt-bindings: sun6i-dsi: Add R40 MIPI-DSI compatible (w/ A64 fallback)
dt-bindings: sun6i-dsi: Add R40 DPHY compatible (w/ A31 fallback)
ARM: dts: sun8i: r40: Add MIPI DSI pipeline
[DO NOT MERGE] ARM: dts: sun8i-r40: bananapi-m2-ultra: Enable Bananapi S070WV20-CT16 DSI panel
.../bindings/display/sunxi/sun4i-drm.txt | 1 + .../bindings/display/sunxi/sun6i-dsi.txt | 2 + .../boot/dts/sun8i-r40-bananapi-m2-ultra.dts | 36 ++++++++ arch/arm/boot/dts/sun8i-r40.dtsi | 84 +++++++++++++++++-- drivers/gpu/drm/sun4i/sun4i_tcon.c | 7 ++ drivers/gpu/drm/sun4i/sun8i_tcon_top.c | 13 +-- include/dt-bindings/clock/sun8i-tcon-top.h | 2 +- 7 files changed, 134 insertions(+), 11 deletions(-)
Signature · 1 line
2.18.0.321.gffc6fa0e3
PATCH 1/9 dt-bindings: display: Add TCON LCD compatible for R40
Like TCON TV0, TV1 allwinner R40 has TCON LCD0, LCD1 which are managed via TCON TOP.
Add tcon lcd compatible R40, the same compatible can handle TCON LCD0, LCD1.
--- Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt | 1 + 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt +1 -0
@@ -160,6 +160,7 @@ Required properties: * allwinner,sun8i-a33-tcon * allwinner,sun8i-a83t-tcon-lcd * allwinner,sun8i-a83t-tcon-tv + * allwinner,sun8i-r40-tcon-lcd * allwinner,sun8i-r40-tcon-tv * allwinner,sun8i-v3s-tcon * allwinner,sun9i-a80-tcon-lcd
Signature · 1 line
2.18.0.321.gffc6fa0e3
PATCH 2/9 drm/sun4i: tcon: Add TCON LCD support for R40
In reply to Jagan TekiTCON LCD0, LCD1 in allwinner R40, are used for managing LCD interfaces like RGB, LVDS and DSI.
Like TCON TV0, TV1 these LCD0, LCD1 are also managed via tcon top.
Add support for it, in tcon driver.
--- drivers/gpu/drm/sun4i/sun4i_tcon.c | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/gpu/drm/sun4i/sun4i_tcon.c +7 -0
@@ -1471,6 +1471,12 @@ 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, +}; +static const struct sun4i_tcon_quirks sun8i_r40_tv_quirks = { .has_channel_1 = true, .set_mux = sun8i_r40_tcon_tv_set_mux,
@@ -1501,6 +1507,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.18.0.321.gffc6fa0e3
PATCH 3/9 ARM: dts: sun8i: r40: Use tcon top clock index macros
In reply to Jagan Tekitcon_tv0, tcon_tv1 nodes have a clock names of tcon-ch0, tcon-ch1 which are referring tcon_top clocks via index numbers like 0, 1 with CLK_TCON_TV0 and CLK_TCON_TV1 respectively.
Use the macro in place of index numbers, for more code readability.
--- arch/arm/boot/dts/sun8i-r40.dtsi | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
arch/arm/boot/dts/sun8i-r40.dtsi +3 -2
@@ -44,6 +44,7 @@ #include <dt-bindings/interrupt-controller/arm-gic.h> #include <dt-bindings/clock/sun8i-de2.h> #include <dt-bindings/clock/sun8i-r40-ccu.h> +#include <dt-bindings/clock/sun8i-tcon-top.h> #include <dt-bindings/reset/sun8i-r40-ccu.h> #include <dt-bindings/reset/sun8i-de2.h>
@@ -704,7 +705,7 @@ compatible = "allwinner,sun8i-r40-tcon-tv"; reg = <0x01c73000 0x1000>; interrupts = <GIC_SPI 51 IRQ_TYPE_LEVEL_HIGH>; - clocks = <&ccu CLK_BUS_TCON_TV0>, <&tcon_top 0>; + clocks = <&ccu CLK_BUS_TCON_TV0>, <&tcon_top CLK_TCON_TOP_TV0>; clock-names = "ahb", "tcon-ch1"; resets = <&ccu RST_BUS_TCON_TV0>; reset-names = "lcd";
@@ -747,7 +748,7 @@ compatible = "allwinner,sun8i-r40-tcon-tv"; reg = <0x01c74000 0x1000>; interrupts = <GIC_SPI 52 IRQ_TYPE_LEVEL_HIGH>; - clocks = <&ccu CLK_BUS_TCON_TV1>, <&tcon_top 1>; + clocks = <&ccu CLK_BUS_TCON_TV1>, <&tcon_top CLK_TCON_TOP_TV1>; clock-names = "ahb", "tcon-ch1"; resets = <&ccu RST_BUS_TCON_TV1>; reset-names = "lcd";
Signature · 1 line
2.18.0.321.gffc6fa0e3
PATCH 4/9 drm/sun4i: tcon_top: Use clock name index macros
In reply to Jagan TekiTCON TOP mux blocks in R40 are registering clock using tcon top clock index numbers.
Right now the code is using, real numbers start with 0, but we have proper macros that defined these name index numbers.
Use the existing macros, instead of real numbers for more code readability.
--- drivers/gpu/drm/sun4i/sun8i_tcon_top.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
drivers/gpu/drm/sun4i/sun8i_tcon_top.c +6 -3
@@ -194,19 +194,22 @@ static int sun8i_tcon_top_bind(struct device *dev, struct device *master, clk_data->hws[CLK_TCON_TOP_TV0 ] =sun8i_tcon_top_register_gate (dev,"tcon-tv0" , regs, &tcon_top->reg_lock, -TCON_TOP_TCON_TV0_GATE ,0 ); +TCON_TOP_TCON_TV0_GATE , +CLK_TCON_TOP_TV0 );if (quirks->has_tcon_tv1) clk_data->hws[CLK_TCON_TOP_TV1 ] =sun8i_tcon_top_register_gate (dev,"tcon-tv1" , regs, &tcon_top->reg_lock, -TCON_TOP_TCON_TV1_GATE ,1 ); +TCON_TOP_TCON_TV1_GATE , +CLK_TCON_TOP_TV1 );if (quirks->has_dsi) clk_data->hws[CLK_TCON_TOP_DSI ] =sun8i_tcon_top_register_gate (dev,"dsi" , regs, &tcon_top->reg_lock, -TCON_TOP_TCON_DSI_GATE ,2 ); +TCON_TOP_TCON_DSI_GATE , +CLK_TCON_TOP_DSI );for (i =0 ; i <CLK_NUM ; i++)if (IS_ERR (clk_data->hws[i])) {
Signature · 1 line
2.18.0.321.gffc6fa0e3
PATCH 5/9 ARM: dts: sun8i: r40: Add TCON TOP LCD clocking
In reply to Jagan TekiAccording to Fig 7-2. TCON Top Block Diagram in User manual.
TCON TOP can have an hierarchy for TCON_LCD0, LCD1 like TCON_TV0, TV1 so, the tcon top would handle the clocks of TCON_LCD0, LCD1 similar like TV0, TV1.
But, the current tcon_top node is using dsi clock name with CLK_DSI_DPHY which is ideally handle via dphy which indeed a separate interface block.
So, use tcon-lcd0 instead of dsi which would refer the CLK_TCON_LCD0 similar like CLK_TCON_TV0 with tcon-tv0.
This way we can refer CLK_TCON_LCD0 from tcon_top clock in tcon_lcd0 node and the actual DSI_DPHY clock node would refer in dphy node.
--- arch/arm/boot/dts/sun8i-r40.dtsi | 6 +++--- drivers/gpu/drm/sun4i/sun8i_tcon_top.c | 6 +++--- include/dt-bindings/clock/sun8i-tcon-top.h | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-)
arch/arm/boot/dts/sun8i-r40.dtsi +3 -3
@@ -591,16 +591,16 @@ <&ccu CLK_TVE0>, <&ccu CLK_TCON_TV1>, <&ccu CLK_TVE1>, - <&ccu CLK_DSI_DPHY>; + <&ccu CLK_TCON_LCD0>; clock-names = "bus", "tcon-tv0", "tve0", "tcon-tv1", "tve1", - "dsi"; + "tcon-lcd0"; clock-output-names = "tcon-top-tv0", "tcon-top-tv1", - "tcon-top-dsi"; + "tcon-top-lcd0"; resets = <&ccu RST_BUS_TCON_TOP>; #clock-cells = <1>;
drivers/gpu/drm/sun4i/sun8i_tcon_top.c +3 -3
@@ -205,11 +205,11 @@ static int sun8i_tcon_top_bind(struct device *dev, struct device *master, CLK_TCON_TOP_TV1);if (quirks->has_dsi) - clk_data->hws[CLK_TCON_TOP_DSI ] = -sun8i_tcon_top_register_gate (dev,"dsi" , regs, + clk_data->hws[CLK_TCON_TOP_LCD0 ] = +sun8i_tcon_top_register_gate (dev,"tcon-lcd0" , regs, &tcon_top->reg_lock,TCON_TOP_TCON_DSI_GATE , -CLK_TCON_TOP_DSI ); +CLK_TCON_TOP_LCD0 );for (i =0 ; i <CLK_NUM ; i++)if (IS_ERR (clk_data->hws[i])) {
include/dt-bindings/clock/sun8i-tcon-top.h +1 -1
@@ -6,6 +6,6 @@#define CLK_TCON_TOP_TV0 0#define CLK_TCON_TOP_TV1 1 -#define CLK_TCON_TOP_DSI 2 +#define CLK_TCON_TOP_LCD0 2#endif /* _DT_BINDINGS_CLOCK_SUN8I_TCON_TOP_H_ */
Signature · 1 line
2.18.0.321.gffc6fa0e3
PATCH 6/9 dt-bindings: sun6i-dsi: Add R40 MIPI-DSI compatible (w/ A64 fallback)
In reply to Jagan TekiThe MIPI DSI controller on Allwinner R40 is similar on the one on A64 like doesn't associate any DSI_SCLK gating.
So, add R40 compatible and append A64 compatible as fallback.
--- Documentation/devicetree/bindings/display/sunxi/sun6i-dsi.txt | 1 + 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/display/sunxi/sun6i-dsi.txt +1 -0
@@ -13,6 +13,7 @@ Required properties: - compatible: value must be one of: * allwinner,sun6i-a31-mipi-dsi * allwinner,sun50i-a64-mipi-dsi + * allwinner,sun8i-r40-mipi-dsi, allwinner,sun50i-a64-mipi-dsi - reg: base address and size of memory-mapped region - interrupts: interrupt associated to this IP - clocks: phandles to the clocks feeding the DSI encoder
Signature · 6 lines
2.18.0.321.gffc6fa0e3 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 7/9 dt-bindings: sun6i-dsi: Add R40 DPHY compatible (w/ A31 fallback)
In reply to Jagan TekiThe MIPI DSI PHY controller on Allwinner R40 is similar on the one on A31.
Add R40 compatible and append A31 compatible as fallback.
--- Documentation/devicetree/bindings/display/sunxi/sun6i-dsi.txt | 1 + 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/display/sunxi/sun6i-dsi.txt +1 -0
@@ -40,6 +40,7 @@ Required properties: - compatible: value must be one of: * allwinner,sun6i-a31-mipi-dphy * allwinner,sun50i-a64-mipi-dphy, allwinner,sun6i-a31-mipi-dphy + * allwinner,sun8i-r40-mipi-dphy, allwinner,sun6i-a31-mipi-dphy - reg: base address and size of memory-mapped region - clocks: phandles to the clocks feeding the DSI encoder * bus: the DSI interface clock
Signature · 1 line
2.18.0.321.gffc6fa0e3
PATCH 8/9 ARM: dts: sun8i: r40: Add MIPI DSI pipeline
In reply to Jagan TekiAdd MIPI DSI pipeline for Allwinner R40.
Unlike conventional Display pipeline in allwinner, R40 have TCON TCOP which would interact various block like muxes, tcon lcd, tcon_tv for better pipeline fitting.
For MIPI DSI pipeline, we have to configure the tcon_lcd0 block which would interact with tcon_top for upper pipeline connections and dsi block for lower pipeline connections.
So, this patch created that pipeline by adding new nodes for tcon_lcd0, dsi, dphy and connet them to make proper pipeline fitting.
--- arch/arm/boot/dts/sun8i-r40.dtsi | 73 ++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+)
arch/arm/boot/dts/sun8i-r40.dtsi +73 -0
@@ -623,6 +623,7 @@ tcon_top_mixer0_out_tcon_lcd0: endpoint@0 { reg = <0>; + remote-endpoint = <&tcon_lcd0_in_tcon_top_mixer0>; }; tcon_top_mixer0_out_tcon_lcd1: endpoint@1 {
@@ -701,6 +702,45 @@ }; }; + tcon_lcd0: lcd-controller@1c71000 { + compatible = "allwinner,sun8i-r40-tcon-lcd"; + reg = <0x01c71000 0x1000>; + interrupts = <GIC_SPI 44 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&ccu CLK_BUS_TCON_LCD0>, <&tcon_top CLK_TCON_TOP_LCD0>; + clock-names = "ahb", "tcon-ch0"; + clock-output-names = "tcon-pixel-clock"; + 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 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + + tcon_lcd0_in_tcon_top_mixer0: endpoint@0 { + reg = <0>; + remote-endpoint = <&tcon_top_mixer0_out_tcon_lcd0>; + }; + }; + + tcon_lcd0_out: port@1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + + tcon_lcd0_out_dsi_out: endpoint@1 { + reg = <1>; + remote-endpoint = <&dsi_in_tcon_lcd0_out>; + }; + }; + }; + }; + tcon_tv0: lcd-controller@1c73000 { compatible = "allwinner,sun8i-r40-tcon-tv"; reg = <0x01c73000 0x1000>;
@@ -798,6 +838,39 @@ interrupts = <GIC_PPI 9 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_HIGH)>; }; + dsi: dsi@1ca0000 { + compatible = "allwinner,sun8i-r40-mipi-dsi", + "allwinner,sun50i-a64-mipi-dsi"; + reg = <0x01ca0000 0x1000>; + interrupts = <GIC_SPI 57 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&ccu CLK_BUS_MIPI_DSI>; + clock-names = "bus"; + resets = <&ccu RST_BUS_MIPI_DSI>; + phys = <&dphy>; + phy-names = "dphy"; + status = "disabled"; + #address-cells = <1>; + #size-cells = <0>; + + port { + dsi_in_tcon_lcd0_out: endpoint { + remote-endpoint = <&tcon_lcd0_out_dsi_out>; + }; + }; + }; + + dphy: d-phy@1ca1000 { + compatible = "allwinner,sun8i-r40-mipi-dphy", + "allwinner,sun6i-a31-mipi-dphy"; + reg = <0x01ca1000 0x1000>; + clocks = <&ccu CLK_BUS_MIPI_DSI>, + <&ccu CLK_DSI_DPHY>; + clock-names = "bus", "mod"; + resets = <&ccu RST_BUS_MIPI_DSI>; + status = "disabled"; + #phy-cells = <0>; + }; + hdmi: hdmi@1ee0000 { compatible = "allwinner,sun8i-r40-dw-hdmi", "allwinner,sun8i-a83t-dw-hdmi";
Signature · 6 lines
2.18.0.321.gffc6fa0e3 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 9/9 ARM: dts: sun8i-r40: bananapi-m2-ultra: Enable Bananapi S070WV20-CT16 DSI panel
In reply to Jagan TekiThis patch add support for Bananapi S070WV20-CT16 DSI panel to BPI-M2U board.
DSI panel connected via board DSI port with,
- DCDC1 as VCC-DSI supply
- PH18 gpio for lcd enable pin
- PD17 gpio for lcd reset pin
- PD16 gpio for backlight enable pin
--- .../boot/dts/sun8i-r40-bananapi-m2-ultra.dts | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+)
arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts +36 -0
@@ -45,6 +45,7 @@ #include "sun8i-r40.dtsi" #include <dt-bindings/gpio/gpio.h> +#include <dt-bindings/pwm/pwm.h> / { model = "Banana Pi BPI-M2-Ultra";
@@ -55,6 +56,14 @@ serial0 = &uart0; }; + backlight: backlight { + compatible = "pwm-backlight"; + pwms = <&pwm 0 50000 PWM_POLARITY_INVERTED>; + brightness-levels = <1 2 4 8 16 32 64 128 255>; + default-brightness-level = <8>; + enable-gpios = <&pio 7 16 GPIO_ACTIVE_HIGH>; /* LCD-BL-EN: PH16 */ + }; + chosen { stdout-path = "serial0:115200n8"; };
@@ -117,6 +126,23 @@ status = "okay"; }; +&dphy { + status = "okay"; +}; + +&dsi { + vcc-dsi-supply = <®_dcdc1>; /* VCC-DSI */ + status = "okay"; + + panel@0 { + compatible = "bananapi,s070wv20-ct16-icn6211"; + reg = <0>; + enable-gpio = <&pio 7 18 GPIO_ACTIVE_HIGH>; /* LCD-PWR-EN: PH18 */ + reset-gpios = <&pio 7 17 GPIO_ACTIVE_HIGH>; /* LCD-RST: PH17 */ + backlight = <&backlight>; + }; +}; + &ehci1 { status = "okay"; };
@@ -203,6 +229,12 @@ pinctrl-0 = <&clk_out_a_pin>; }; +&pwm { + pinctrl-names = "default"; + pinctrl-0 = <&pwm_pins>; + status = "okay"; +}; + ®_aldo2 { regulator-always-on; regulator-min-microvolt = <2500000>;
@@ -290,6 +322,10 @@ regulator-name = "vdd1v2-sata"; }; +&tcon_lcd0 { + status = "okay"; +}; + &tcon_tv0 { status = "okay"; };
Signature · 6 lines
2.18.0.321.gffc6fa0e3 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [linux-sunxi] [PATCH 1/9] dt-bindings: display: Add TCON LCD compatible for R40
In reply to Jagan TekiQuoted 10 lines · Jagan Teki
Like TCON TV0, TV1 allwinner R40 has TCON LCD0, LCD1 which are managed via TCON TOP.
Add tcon lcd compatible R40, the same compatible can handle TCON LCD0, LCD1.
Cc Rob Herring <[email protected]>Cc Mark Rutland <[email protected]>
Re: [linux-sunxi] [PATCH 2/9] drm/sun4i: tcon: Add TCON LCD support for R40
In reply to Jagan TekiQuoted 10 lines · Jagan Teki
TCON LCD0, LCD1 in allwinner R40, are used for managing LCD interfaces like RGB, LVDS and DSI.
Like TCON TV0, TV1 these LCD0, LCD1 are also managed via tcon top.
Add support for it, in tcon driver.
Re: [PATCH 3/9] ARM: dts: sun8i: r40: Use tcon top clock index macros
In reply to Jagan TekiQuoted 10 lines · Jagan Teki
tcon_tv0,tcon_tv1nodes have a clock names of tcon-ch0, tcon-ch1 which are referringtcon_topclocks via index numbers like 0, 1 withCLK_TCON_TV0andCLK_TCON_TV1respectively.Use the macro in place of index numbers, for more code readability.
Re: [PATCH 4/9] drm/sun4i: tcon_top: Use clock name index macros
In reply to Jagan TekiQuoted 11 lines · Jagan Teki
TCON TOP mux blocks in R40 are registering clock using tcon top clock index numbers.
Right now the code is using, real numbers start with 0, but we have proper macros that defined these name index numbers.
Use the existing macros, instead of real numbers for more code readability.
However, you might want to rename the clock first, then switch to using the index macros?
Re: [linux-sunxi] [PATCH 2/9] drm/sun4i: tcon: Add TCON LCD support for R40
In reply to Chen-Yu TsaiQuoted 6 lines · Chen-Yu Tsai
Quoted 4 lines · Jagan Teki
TCON LCD0, LCD1 in allwinner R40, are used for managing LCD interfaces like RGB, LVDS and DSI.
Quoted 8 lines
Quoted 6 lines
Like TCON TV0, TV1 these LCD0, LCD1 are also managed via tcon top.
Add support for it, in tcon driver.
Signed-off-by Jagan Teki <[email protected]>Reviewed-by Chen-Yu Tsai <[email protected]>
I take that back.
The TCON output muxing (which selects whether TCON LCD or TCON TV outputs to the GPIO pins)
is not supported yet. Please at least add TODO notes, or ideally, block RGB output from
being used.
ChenYu
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 5/9] ARM: dts: sun8i: r40: Add TCON TOP LCD clocking
In reply to Jagan TekiQuoted 6 lines · Jagan Teki
According to Fig 7-2. TCON Top Block Diagram in User manual.
TCON TOP can have an hierarchy for
TCON_LCD0, LCD1 likeTCON_TV0, TV1 so, the tcon top would handle the clocks ofTCON_LCD0, LCD1 similar like TV0, TV1.
That is not guaranteed. The diagram shows the pixel data path, not necessarily the clocks. In addition, the LCD TCONs have an internal clock gate for the dot-clock output, which the TV variants do not. That might explain the need for the gates in TCON TOP.
Quoted 10 lines
But, the current
tcon_topnode is using dsi clock name withCLK_DSI_DPHYwhich is ideally handle via dphy which indeed a separate interface block.So, use tcon-lcd0 instead of dsi which would refer the
CLK_TCON_LCD0similar likeCLK_TCON_TV0with tcon-tv0.This way we can refer
CLK_TCON_LCD0fromtcon_topclock intcon_lcd0node and the actualDSI_DPHYclock node would refer in dphy node.
That doesn't make sense. What about TCON_LCD1?
The CCU already has CLK_TCON_LCD0 and CLK_TCON_LCD1. What makes you think that the TCONs don't use them directly?
Or maybe they do go through TCON_TOP, but there's no gate, so we don't know about it.
You need to rethink this. What are you trying to deal with?
Quoted 5 lines
Signed-off-by Jagan Teki <[email protected]>--- arch/arm/boot/dts/sun8i-r40.dtsi | 6 +++--- drivers/gpu/drm/sun4i/sun8i_tcon_top.c | 6 +++--- include/dt-bindings/clock/sun8i-tcon-top.h | 2 +-
This is going to be a pain to merge.
First, you need to split the driver parts from the DT parts.
Second, you might need to revert CLK_DSI_DPHY back to a raw number for now, so that when the patches get merged through different trees, nothing breaks.
Third, you'll come back after everything is merged, and change the raw number to the new macro.
ChenYu
Re: [PATCH 5/9] ARM: dts: sun8i: r40: Add TCON TOP LCD clocking
Quoted 5 lines · Chen-Yu Tsai
Quoted 3 lines · Jagan Teki
According to Fig 7-2. TCON Top Block Diagram in User manual.
Quoted 8 lines
Quoted 3 lines
TCON TOP can have an hierarchy for
TCON_LCD0, LCD1 likeTCON_TV0, TV1 so, the tcon top would handle the clocks ofTCON_LCD0, LCD1 similar like TV0, TV1.That is not guaranteed. The diagram shows the pixel data path, not necessarily the clocks. In addition, the LCD TCONs have an internal clock gate for the dot-clock output, which the TV variants do not. That might explain the need for the gates in TCON TOP.
Correct, the actual idea about explanation here is to mention the clocks definition in tcon top level and internal tv and lcd can handle as you explained.
Quoted 14 lines
Quoted 11 lines
But, the current
tcon_topnode is using dsi clock name withCLK_DSI_DPHYwhich is ideally handle via dphy which indeed a separate interface block.So, use tcon-lcd0 instead of dsi which would refer the
CLK_TCON_LCD0similar likeCLK_TCON_TV0with tcon-tv0.This way we can refer
CLK_TCON_LCD0fromtcon_topclock intcon_lcd0node and the actualDSI_DPHYclock node would refer in dphy node.That doesn't make sense. What about
TCON_LCD1?
Quoted 7 lines
The CCU already has
CLK_TCON_LCD0andCLK_TCON_LCD1. What makes you think that the TCONs don't use them directly?Or maybe they do go through
TCON_TOP, but there's no gate, so we don't know about it.You need to rethink this. What are you trying to deal with?
Yes, I understand what your asking for and indeed this is where I get confused and tried this way initially and attach the dsi reference in dphy something like
tcon_lcd0 {
clocks = <&ccu CLK_BUS_TCON_LCD0>, <&ccu CLK_TCON_LCD0>;
clock-names = "ahb", "tcon-ch0";
};dphy {
clocks = <&ccu CLK_BUS_MIPI_DSI>,
<&tcon_top CLK_TCON_TOP_DSI>;
clock-names = "bus", "mod";
};This would ended-up, phy wont getting the mod clock keep probing for -EPROBE-DEFER since tcon top driver might not be loaded at the time mipi driver. This way we have tv0, tv1 and dsi gates supported as existed. Does it make sense?
Re: [PATCH 5/9] ARM: dts: sun8i: r40: Add TCON TOP LCD clocking
Quoted 57 lines · Jagan Teki
Quoted 5 lines · Chen-Yu Tsai
Quoted 3 lines · Jagan Teki
According to Fig 7-2. TCON Top Block Diagram in User manual.
Quoted 8 lines
Quoted 3 lines
TCON TOP can have an hierarchy for
TCON_LCD0, LCD1 likeTCON_TV0, TV1 so, the tcon top would handle the clocks ofTCON_LCD0, LCD1 similar like TV0, TV1.That is not guaranteed. The diagram shows the pixel data path, not necessarily the clocks. In addition, the LCD TCONs have an internal clock gate for the dot-clock output, which the TV variants do not. That might explain the need for the gates in TCON TOP.
Correct, the actual idea about explanation here is to mention the clocks definition in tcon top level and internal tv and lcd can handle as you explained.
Quoted 14 lines
Quoted 11 lines
But, the current
tcon_topnode is using dsi clock name withCLK_DSI_DPHYwhich is ideally handle via dphy which indeed a separate interface block.So, use tcon-lcd0 instead of dsi which would refer the
CLK_TCON_LCD0similar likeCLK_TCON_TV0with tcon-tv0.This way we can refer
CLK_TCON_LCD0fromtcon_topclock intcon_lcd0node and the actualDSI_DPHYclock node would refer in dphy node.That doesn't make sense. What about
TCON_LCD1?Quoted 7 lines
The CCU already has
CLK_TCON_LCD0andCLK_TCON_LCD1. What makes you think that the TCONs don't use them directly?Or maybe they do go through
TCON_TOP, but there's no gate, so we don't know about it.You need to rethink this. What are you trying to deal with?
Yes, I understand what your asking for and indeed this is where I get confused and tried this way initially and attach the dsi reference in dphy something like
tcon_lcd0 { clocks = <&ccu CLK_BUS_TCON_LCD0>, <&ccu CLK_TCON_LCD0>; clock-names = "ahb", "tcon-ch0"; };dphy { clocks = <&ccu CLK_BUS_MIPI_DSI>, <&tcon_top CLK_TCON_TOP_DSI>; clock-names = "bus", "mod"; };
Quoted 4 lines
This would ended-up, phy wont getting the mod clock keep probing for -EPROBE-DEFER since tcon top driver might not be loaded at the time mipi driver. This way we have tv0, tv1 and dsi gates supported as existed. Does it make sense?
Looks like that happens because the clocks are only registered at the component bind phase, rather than the probe phase. And to bind all the components, the DSI controller wants the DPHY available, which isn't because it's still waiting for the clock.
So you could try moving the bits that register the clocks in the TCON TOP driver to the probe function, and see if that solves the circular dependency issue.
ChenYu
Re: [linux-sunxi] [PATCH 2/9] drm/sun4i: tcon: Add TCON LCD support for R40
In reply to Chen-Yu TsaiQuoted 15 lines · Chen-Yu Tsai
Quoted 13 lines · Chen-Yu Tsai
Quoted 10 lines · Jagan Teki
TCON LCD0, LCD1 in allwinner R40, are used for managing LCD interfaces like RGB, LVDS and DSI.
Like TCON TV0, TV1 these LCD0, LCD1 are also managed via tcon top.
Add support for it, in tcon driver.
Signed-off-by Jagan Teki <[email protected]>
Quoted 7 lines
Quoted 1 line
Reviewed-by Chen-Yu Tsai <[email protected]>I take that back.
The TCON output muxing (which selects whether TCON LCD or TCON TV outputs to the GPIO pins)
is not supported yet. Please at least add TODO notes, or ideally,
Are you referring about port selection? it is support in sun8i_tcon_top_de_config.
_______________________________________________
dri-devel mailing list [email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [linux-sunxi] [PATCH 2/9] drm/sun4i: tcon: Add TCON LCD support for R40
Quoted 19 lines · Jagan Teki
Quoted 17 lines · Chen-Yu Tsai
Quoted 14 lines · Chen-Yu Tsai
Quoted 10 lines · Jagan Teki
TCON LCD0, LCD1 in allwinner R40, are used for managing LCD interfaces like RGB, LVDS and DSI.
Like TCON TV0, TV1 these LCD0, LCD1 are also managed via tcon top.
Add support for it, in tcon driver.
Signed-off-by Jagan Teki <[email protected]>Reviewed-by Chen-Yu Tsai <[email protected]>
Quoted 8 lines
Quoted 5 lines
I take that back.
The TCON output muxing (which selects whether TCON LCD or TCON TV outputs to the GPIO pins)
is not supported yet. Please at least add TODO notes, or ideally,Are you referring about port selection? it is support in
sun8i_tcon_top_de_config.
No. That's supported as you already pointed out. That only selects which mixer outputs to which TCON.
I'm talking about the GPIOD and GPIOH bits, which select which of LCD or TV TCON outputs to the LCD function pins. Keep in mind that the TV TCON's H/V SYNC signals are used in combination with the TV encoder RGB outputs for VGA.
ChenYu
Re: [linux-sunxi] [PATCH 2/9] drm/sun4i: tcon: Add TCON LCD support for R40
Quoted 30 lines · Chen-Yu Tsai
Quoted 19 lines · Jagan Teki
Quoted 17 lines · Chen-Yu Tsai
Quoted 14 lines · Chen-Yu Tsai
Quoted 10 lines · Jagan Teki
TCON LCD0, LCD1 in allwinner R40, are used for managing LCD interfaces like RGB, LVDS and DSI.
Like TCON TV0, TV1 these LCD0, LCD1 are also managed via tcon top.
Add support for it, in tcon driver.
Signed-off-by Jagan Teki <[email protected]>Reviewed-by Chen-Yu Tsai <[email protected]>Quoted 8 lines
Quoted 5 lines
I take that back.
The TCON output muxing (which selects whether TCON LCD or TCON TV outputs to the GPIO pins)
is not supported yet. Please at least add TODO notes, or ideally,Are you referring about port selection? it is support in
sun8i_tcon_top_de_config.
Quoted 7 lines
No. That's supported as you already pointed out. That only selects which mixer outputs to which TCON.
I'm talking about the GPIOD and GPIOH bits, which select which of LCD or TV TCON outputs to the LCD function pins. Keep in mind that the TV TCON's H/V SYNC signals are used in combination with the TV encoder RGB outputs for VGA.
Got it, so do I need to add TODO on sun8i_r40_lcd_quirks struct?