Hi everyone,
This serie introduces the support in the sun4i-drm driver for the A33.
Beside the new IPs and special cases for the A33 new IPs, there's nothing really outstanding, and is now at feature parity with the A13.
This serie is based on my A33 CCU patches posted earlier today here: http://lists.infradead.org/pipermail/linux-arm-kernel/2016-September/453208....
Let me know what you think, Maxime
Changes from v1: - Changed the TCON pins label - Changed the TCON compatible as it's different from A23's - Merged the SAT into the backend, as it really is part of the same block in hardware. - Reworded the DRC bindings description - Added the backend interrupt to the DT - Changed the name of the LCD panel to the actual brand and model found on the ribbon
Maxime Ripard (9): drm/sun4i: support TCONs without channel 1 drm/sun4i: support A33 tcon drm/sun4i: backend: Handle the SAT drm/sun4i: Add a DRC driver of: Add vendor prefix for Netron DY drm/panel: Add Netron DY E231732 ARM: sun8i: a33: Add display pipeline ARM: sun8i: a23/a33: Add RGB666 pins ARM: sun8i: sina33: Enable display
.../bindings/display/sunxi/sun4i-drm.txt | 39 +++++- .../devicetree/bindings/vendor-prefixes.txt | 1 + arch/arm/boot/dts/sun8i-a23-a33.dtsi | 10 ++ arch/arm/boot/dts/sun8i-a33-sinlinx-sina33.dts | 34 +++++ arch/arm/boot/dts/sun8i-a33.dtsi | 152 +++++++++++++++++++++ drivers/gpu/drm/panel/panel-simple.c | 26 ++++ drivers/gpu/drm/sun4i/Makefile | 2 +- drivers/gpu/drm/sun4i/sun4i_backend.c | 61 +++++++++ drivers/gpu/drm/sun4i/sun4i_backend.h | 3 + drivers/gpu/drm/sun4i/sun4i_drv.c | 8 +- drivers/gpu/drm/sun4i/sun4i_tcon.c | 42 ++++-- drivers/gpu/drm/sun4i/sun4i_tcon.h | 2 + drivers/gpu/drm/sun4i/sun6i_drc.c | 118 ++++++++++++++++ 13 files changed, 479 insertions(+), 19 deletions(-) create mode 100644 drivers/gpu/drm/sun4i/sun6i_drc.c
Some Allwinner SoCs, such as the A33, have a variation of the TCON that doesn't have a second channel (or it is not wired to anything).
Make sure we can handle that case.
Signed-off-by: Maxime Ripard maxime.ripard@free-electrons.com Acked-by: Chen-Yu Tsai wens@csie.org --- drivers/gpu/drm/sun4i/sun4i_tcon.c | 34 +++++++++++++++++++++------------- drivers/gpu/drm/sun4i/sun4i_tcon.h | 2 ++ 2 files changed, 23 insertions(+), 13 deletions(-)
diff --git a/drivers/gpu/drm/sun4i/sun4i_tcon.c b/drivers/gpu/drm/sun4i/sun4i_tcon.c index 9180e7e7b551..fde6af1230d2 100644 --- a/drivers/gpu/drm/sun4i/sun4i_tcon.c +++ b/drivers/gpu/drm/sun4i/sun4i_tcon.c @@ -59,11 +59,13 @@ void sun4i_tcon_channel_disable(struct sun4i_tcon *tcon, int channel) regmap_update_bits(tcon->regs, SUN4I_TCON0_CTL_REG, SUN4I_TCON0_CTL_TCON_ENABLE, 0); clk_disable_unprepare(tcon->dclk); - } else if (channel == 1) { - regmap_update_bits(tcon->regs, SUN4I_TCON1_CTL_REG, - SUN4I_TCON1_CTL_TCON_ENABLE, 0); - clk_disable_unprepare(tcon->sclk1); + return; } + + WARN_ON(!tcon->has_channel_1); + regmap_update_bits(tcon->regs, SUN4I_TCON1_CTL_REG, + SUN4I_TCON1_CTL_TCON_ENABLE, 0); + clk_disable_unprepare(tcon->sclk1); } EXPORT_SYMBOL(sun4i_tcon_channel_disable);
@@ -75,12 +77,14 @@ void sun4i_tcon_channel_enable(struct sun4i_tcon *tcon, int channel) SUN4I_TCON0_CTL_TCON_ENABLE, SUN4I_TCON0_CTL_TCON_ENABLE); clk_prepare_enable(tcon->dclk); - } else if (channel == 1) { - regmap_update_bits(tcon->regs, SUN4I_TCON1_CTL_REG, - SUN4I_TCON1_CTL_TCON_ENABLE, - SUN4I_TCON1_CTL_TCON_ENABLE); - clk_prepare_enable(tcon->sclk1); + return; } + + WARN_ON(!tcon->has_channel_1); + regmap_update_bits(tcon->regs, SUN4I_TCON1_CTL_REG, + SUN4I_TCON1_CTL_TCON_ENABLE, + SUN4I_TCON1_CTL_TCON_ENABLE); + clk_prepare_enable(tcon->sclk1); } EXPORT_SYMBOL(sun4i_tcon_channel_enable);
@@ -198,6 +202,8 @@ void sun4i_tcon1_mode_set(struct sun4i_tcon *tcon, u8 clk_delay; u32 val;
+ WARN_ON(!tcon->has_channel_1); + /* Adjust clock delay */ clk_delay = sun4i_tcon_get_clk_delay(mode, 1); regmap_update_bits(tcon->regs, SUN4I_TCON1_CTL_REG, @@ -321,10 +327,12 @@ static int sun4i_tcon_init_clocks(struct device *dev, return PTR_ERR(tcon->sclk0); }
- tcon->sclk1 = devm_clk_get(dev, "tcon-ch1"); - if (IS_ERR(tcon->sclk1)) { - dev_err(dev, "Couldn't get the TCON channel 1 clock\n"); - return PTR_ERR(tcon->sclk1); + if (tcon->has_channel_1) { + tcon->sclk1 = devm_clk_get(dev, "tcon-ch1"); + if (IS_ERR(tcon->sclk1)) { + dev_err(dev, "Couldn't get the TCON channel 1 clock\n"); + return PTR_ERR(tcon->sclk1); + } }
return sun4i_dclk_create(dev, tcon); diff --git a/drivers/gpu/drm/sun4i/sun4i_tcon.h b/drivers/gpu/drm/sun4i/sun4i_tcon.h index 100bfa093277..12bd48925f4d 100644 --- a/drivers/gpu/drm/sun4i/sun4i_tcon.h +++ b/drivers/gpu/drm/sun4i/sun4i_tcon.h @@ -164,6 +164,8 @@ struct sun4i_tcon { bool has_mux;
struct drm_panel *panel; + + bool has_channel_1; };
struct drm_bridge *sun4i_tcon_find_bridge(struct device_node *node);
The A33 has a significantly different pipeline, with components that differ too.
Make sure we had compatible for them.
Signed-off-by: Maxime Ripard maxime.ripard@free-electrons.com --- Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt | 7 ++++++- drivers/gpu/drm/sun4i/sun4i_backend.c | 1 + drivers/gpu/drm/sun4i/sun4i_drv.c | 8 +++++--- drivers/gpu/drm/sun4i/sun4i_tcon.c | 8 +++++++- 4 files changed, 19 insertions(+), 5 deletions(-)
diff --git a/Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt b/Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt index df8f4aeefe4c..bd3136a5cba5 100644 --- a/Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt +++ b/Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt @@ -26,7 +26,9 @@ TCON The TCON acts as a timing controller for RGB, LVDS and TV interfaces.
Required properties: - - compatible: value should be "allwinner,sun5i-a13-tcon". + - compatible: value must be either: + * allwinner,sun5i-a13-tcon + * allwinner,sun8i-a33-tcon - reg: base address and size of memory-mapped region - interrupts: interrupt associated to this IP - clocks: phandles to the clocks feeding the TCON. Three are needed: @@ -59,6 +61,7 @@ system. Required properties: - compatible: value must be one of: * allwinner,sun5i-a13-display-backend + * allwinner,sun8i-a33-display-backend - reg: base address and size of the memory-mapped region. - clocks: phandles to the clocks feeding the frontend and backend * ahb: the backend interface clock @@ -80,6 +83,7 @@ deinterlacing and color space conversion. Required properties: - compatible: value must be one of: * allwinner,sun5i-a13-display-frontend + * allwinner,sun8i-a33-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 @@ -104,6 +108,7 @@ extra node. Required properties: - compatible: value must be one of: * allwinner,sun5i-a13-display-engine + * allwinner,sun8i-a33-display-engine
- allwinner,pipelines: list of phandle to the display engine frontends available. diff --git a/drivers/gpu/drm/sun4i/sun4i_backend.c b/drivers/gpu/drm/sun4i/sun4i_backend.c index 3ab560450a82..9bfd2e45fceb 100644 --- a/drivers/gpu/drm/sun4i/sun4i_backend.c +++ b/drivers/gpu/drm/sun4i/sun4i_backend.c @@ -345,6 +345,7 @@ static int sun4i_backend_remove(struct platform_device *pdev)
static const struct of_device_id sun4i_backend_of_table[] = { { .compatible = "allwinner,sun5i-a13-display-backend" }, + { .compatible = "allwinner,sun8i-a33-display-backend" }, { } }; MODULE_DEVICE_TABLE(of, sun4i_backend_of_table); diff --git a/drivers/gpu/drm/sun4i/sun4i_drv.c b/drivers/gpu/drm/sun4i/sun4i_drv.c index 942f62e2441c..c4d03c1b6db8 100644 --- a/drivers/gpu/drm/sun4i/sun4i_drv.c +++ b/drivers/gpu/drm/sun4i/sun4i_drv.c @@ -199,13 +199,14 @@ static const struct component_master_ops sun4i_drv_master_ops = {
static bool sun4i_drv_node_is_frontend(struct device_node *node) { - return of_device_is_compatible(node, - "allwinner,sun5i-a13-display-frontend"); + return of_device_is_compatible(node, "allwinner,sun5i-a13-display-frontend") || + of_device_is_compatible(node, "allwinner,sun8i-a33-display-frontend"); }
static bool sun4i_drv_node_is_tcon(struct device_node *node) { - return of_device_is_compatible(node, "allwinner,sun5i-a13-tcon"); + return of_device_is_compatible(node, "allwinner,sun5i-a13-tcon") || + of_device_is_compatible(node, "allwinner,sun8i-a33-tcon"); }
static int compare_of(struct device *dev, void *data) @@ -320,6 +321,7 @@ static int sun4i_drv_remove(struct platform_device *pdev)
static const struct of_device_id sun4i_drv_of_table[] = { { .compatible = "allwinner,sun5i-a13-display-engine" }, + { .compatible = "allwinner,sun8i-a33-display-engine" }, { } }; MODULE_DEVICE_TABLE(of, sun4i_drv_of_table); diff --git a/drivers/gpu/drm/sun4i/sun4i_tcon.c b/drivers/gpu/drm/sun4i/sun4i_tcon.c index fde6af1230d2..cadacb517f95 100644 --- a/drivers/gpu/drm/sun4i/sun4i_tcon.c +++ b/drivers/gpu/drm/sun4i/sun4i_tcon.c @@ -488,8 +488,13 @@ static int sun4i_tcon_bind(struct device *dev, struct device *master, tcon->drm = drm; tcon->dev = dev;
- if (of_device_is_compatible(dev->of_node, "allwinner,sun5i-a13-tcon")) + if (of_device_is_compatible(dev->of_node, "allwinner,sun5i-a13-tcon")) { tcon->has_mux = true; + tcon->has_channel_1 = true; + } else { + tcon->has_mux = false; + tcon->has_channel_1 = false; + }
tcon->lcd_rst = devm_reset_control_get(dev, "lcd"); if (IS_ERR(tcon->lcd_rst)) { @@ -585,6 +590,7 @@ static int sun4i_tcon_remove(struct platform_device *pdev)
static const struct of_device_id sun4i_tcon_of_table[] = { { .compatible = "allwinner,sun5i-a13-tcon" }, + { .compatible = "allwinner,sun8i-a33-tcon" }, { } }; MODULE_DEVICE_TABLE(of, sun4i_tcon_of_table);
On Tue, Sep 6, 2016 at 10:46 PM, Maxime Ripard maxime.ripard@free-electrons.com wrote:
The A33 has a significantly different pipeline, with components that differ too.
Make sure we had compatible for them.
Signed-off-by: Maxime Ripard maxime.ripard@free-electrons.com
Acked-by: Chen-Yu Tsai wens@csie.org
Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt | 7 ++++++- drivers/gpu/drm/sun4i/sun4i_backend.c | 1 + drivers/gpu/drm/sun4i/sun4i_drv.c | 8 +++++--- drivers/gpu/drm/sun4i/sun4i_tcon.c | 8 +++++++- 4 files changed, 19 insertions(+), 5 deletions(-)
diff --git a/Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt b/Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt index df8f4aeefe4c..bd3136a5cba5 100644 --- a/Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt +++ b/Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt @@ -26,7 +26,9 @@ TCON The TCON acts as a timing controller for RGB, LVDS and TV interfaces.
Required properties:
- compatible: value should be "allwinner,sun5i-a13-tcon".
- compatible: value must be either:
- allwinner,sun5i-a13-tcon
- allwinner,sun8i-a33-tcon
- reg: base address and size of memory-mapped region
- interrupts: interrupt associated to this IP
- clocks: phandles to the clocks feeding the TCON. Three are needed:
@@ -59,6 +61,7 @@ system. Required properties:
- compatible: value must be one of:
- allwinner,sun5i-a13-display-backend
- allwinner,sun8i-a33-display-backend
- reg: base address and size of the memory-mapped region.
- clocks: phandles to the clocks feeding the frontend and backend
- ahb: the backend interface clock
@@ -80,6 +83,7 @@ deinterlacing and color space conversion. Required properties:
- compatible: value must be one of:
- allwinner,sun5i-a13-display-frontend
- allwinner,sun8i-a33-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
@@ -104,6 +108,7 @@ extra node. Required properties:
- compatible: value must be one of:
- allwinner,sun5i-a13-display-engine
- allwinner,sun8i-a33-display-engine
- allwinner,pipelines: list of phandle to the display engine
frontends available.
diff --git a/drivers/gpu/drm/sun4i/sun4i_backend.c b/drivers/gpu/drm/sun4i/sun4i_backend.c index 3ab560450a82..9bfd2e45fceb 100644 --- a/drivers/gpu/drm/sun4i/sun4i_backend.c +++ b/drivers/gpu/drm/sun4i/sun4i_backend.c @@ -345,6 +345,7 @@ static int sun4i_backend_remove(struct platform_device *pdev)
static const struct of_device_id sun4i_backend_of_table[] = { { .compatible = "allwinner,sun5i-a13-display-backend" },
{ .compatible = "allwinner,sun8i-a33-display-backend" }, { }
}; MODULE_DEVICE_TABLE(of, sun4i_backend_of_table); diff --git a/drivers/gpu/drm/sun4i/sun4i_drv.c b/drivers/gpu/drm/sun4i/sun4i_drv.c index 942f62e2441c..c4d03c1b6db8 100644 --- a/drivers/gpu/drm/sun4i/sun4i_drv.c +++ b/drivers/gpu/drm/sun4i/sun4i_drv.c @@ -199,13 +199,14 @@ static const struct component_master_ops sun4i_drv_master_ops = {
static bool sun4i_drv_node_is_frontend(struct device_node *node) {
return of_device_is_compatible(node,
"allwinner,sun5i-a13-display-frontend");
return of_device_is_compatible(node, "allwinner,sun5i-a13-display-frontend") ||
of_device_is_compatible(node, "allwinner,sun8i-a33-display-frontend");
}
static bool sun4i_drv_node_is_tcon(struct device_node *node) {
return of_device_is_compatible(node, "allwinner,sun5i-a13-tcon");
return of_device_is_compatible(node, "allwinner,sun5i-a13-tcon") ||
of_device_is_compatible(node, "allwinner,sun8i-a33-tcon");
}
The list is going to grow to about 6 entries or so... I wonder if there is a better way. :(
static int compare_of(struct device *dev, void *data) @@ -320,6 +321,7 @@ static int sun4i_drv_remove(struct platform_device *pdev)
static const struct of_device_id sun4i_drv_of_table[] = { { .compatible = "allwinner,sun5i-a13-display-engine" },
{ .compatible = "allwinner,sun8i-a33-display-engine" }, { }
}; MODULE_DEVICE_TABLE(of, sun4i_drv_of_table); diff --git a/drivers/gpu/drm/sun4i/sun4i_tcon.c b/drivers/gpu/drm/sun4i/sun4i_tcon.c index fde6af1230d2..cadacb517f95 100644 --- a/drivers/gpu/drm/sun4i/sun4i_tcon.c +++ b/drivers/gpu/drm/sun4i/sun4i_tcon.c @@ -488,8 +488,13 @@ static int sun4i_tcon_bind(struct device *dev, struct device *master, tcon->drm = drm; tcon->dev = dev;
if (of_device_is_compatible(dev->of_node, "allwinner,sun5i-a13-tcon"))
if (of_device_is_compatible(dev->of_node, "allwinner,sun5i-a13-tcon")) { tcon->has_mux = true;
tcon->has_channel_1 = true;
} else {
tcon->has_mux = false;
tcon->has_channel_1 = false;
} tcon->lcd_rst = devm_reset_control_get(dev, "lcd"); if (IS_ERR(tcon->lcd_rst)) {
@@ -585,6 +590,7 @@ static int sun4i_tcon_remove(struct platform_device *pdev)
static const struct of_device_id sun4i_tcon_of_table[] = { { .compatible = "allwinner,sun5i-a13-tcon" },
{ .compatible = "allwinner,sun8i-a33-tcon" }, { }
}; MODULE_DEVICE_TABLE(of, sun4i_tcon_of_table); -- 2.9.3
On Tue, Sep 6, 2016 at 10:46 PM, Maxime Ripard maxime.ripard@free-electrons.com wrote:
The A33 has a significantly different pipeline, with components that differ too.
Make sure we had compatible for them.
Signed-off-by: Maxime Ripard maxime.ripard@free-electrons.com
Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt | 7 ++++++- drivers/gpu/drm/sun4i/sun4i_backend.c | 1 + drivers/gpu/drm/sun4i/sun4i_drv.c | 8 +++++--- drivers/gpu/drm/sun4i/sun4i_tcon.c | 8 +++++++- 4 files changed, 19 insertions(+), 5 deletions(-)
diff --git a/Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt b/Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt index df8f4aeefe4c..bd3136a5cba5 100644 --- a/Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt +++ b/Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt @@ -26,7 +26,9 @@ TCON The TCON acts as a timing controller for RGB, LVDS and TV interfaces.
Required properties:
- compatible: value should be "allwinner,sun5i-a13-tcon".
- compatible: value must be either:
- allwinner,sun5i-a13-tcon
- allwinner,sun8i-a33-tcon
- reg: base address and size of memory-mapped region
- interrupts: interrupt associated to this IP
- clocks: phandles to the clocks feeding the TCON. Three are needed:
You should probably put a note saying the A33 only needs 2 clocks. You can keep my ack after fixing it.
ChenYu
On Tue, Sep 06, 2016 at 11:16:33PM +0800, Chen-Yu Tsai wrote:
On Tue, Sep 6, 2016 at 10:46 PM, Maxime Ripard maxime.ripard@free-electrons.com wrote:
The A33 has a significantly different pipeline, with components that differ too.
Make sure we had compatible for them.
Signed-off-by: Maxime Ripard maxime.ripard@free-electrons.com
Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt | 7 ++++++- drivers/gpu/drm/sun4i/sun4i_backend.c | 1 + drivers/gpu/drm/sun4i/sun4i_drv.c | 8 +++++--- drivers/gpu/drm/sun4i/sun4i_tcon.c | 8 +++++++- 4 files changed, 19 insertions(+), 5 deletions(-)
diff --git a/Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt b/Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt index df8f4aeefe4c..bd3136a5cba5 100644 --- a/Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt +++ b/Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt @@ -26,7 +26,9 @@ TCON The TCON acts as a timing controller for RGB, LVDS and TV interfaces.
Required properties:
- compatible: value should be "allwinner,sun5i-a13-tcon".
- compatible: value must be either:
- allwinner,sun5i-a13-tcon
- allwinner,sun8i-a33-tcon
- reg: base address and size of memory-mapped region
- interrupts: interrupt associated to this IP
- clocks: phandles to the clocks feeding the TCON. Three are needed:
You should probably put a note saying the A33 only needs 2 clocks. You can keep my ack after fixing it.
I did while applying, thanks! Maxime
Hi,
On Tue, Sep 6, 2016 at 10:46 PM, Maxime Ripard maxime.ripard@free-electrons.com wrote:
The A33 has a significantly different pipeline, with components that differ too.
Make sure we had compatible for them.
Signed-off-by: Maxime Ripard maxime.ripard@free-electrons.com
Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt | 7 ++++++- drivers/gpu/drm/sun4i/sun4i_backend.c | 1 + drivers/gpu/drm/sun4i/sun4i_drv.c | 8 +++++--- drivers/gpu/drm/sun4i/sun4i_tcon.c | 8 +++++++- 4 files changed, 19 insertions(+), 5 deletions(-)
diff --git a/Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt b/Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt index df8f4aeefe4c..bd3136a5cba5 100644 --- a/Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt +++ b/Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt @@ -26,7 +26,9 @@ TCON The TCON acts as a timing controller for RGB, LVDS and TV interfaces.
Required properties:
- compatible: value should be "allwinner,sun5i-a13-tcon".
- compatible: value must be either:
- allwinner,sun5i-a13-tcon
- allwinner,sun8i-a33-tcon
- reg: base address and size of memory-mapped region
- interrupts: interrupt associated to this IP
- clocks: phandles to the clocks feeding the TCON. Three are needed:
@@ -59,6 +61,7 @@ system. Required properties:
- compatible: value must be one of:
- allwinner,sun5i-a13-display-backend
- allwinner,sun8i-a33-display-backend
- reg: base address and size of the memory-mapped region.
- clocks: phandles to the clocks feeding the frontend and backend
- ahb: the backend interface clock
@@ -80,6 +83,7 @@ deinterlacing and color space conversion. Required properties:
- compatible: value must be one of:
- allwinner,sun5i-a13-display-frontend
- allwinner,sun8i-a33-display-frontend
I just looked at the A23. It seems it's the same display frontend as the A33. Should we change the compatible string to a23 while it's still in RC?
The backend is probably different. The A33 only claims to support 2048x2048 layers, while the A23 claims to support 8192x8192 layers.
Regards ChenYu
- 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
@@ -104,6 +108,7 @@ extra node. Required properties:
- compatible: value must be one of:
- allwinner,sun5i-a13-display-engine
- allwinner,sun8i-a33-display-engine
- allwinner,pipelines: list of phandle to the display engine
frontends available.
diff --git a/drivers/gpu/drm/sun4i/sun4i_backend.c b/drivers/gpu/drm/sun4i/sun4i_backend.c index 3ab560450a82..9bfd2e45fceb 100644 --- a/drivers/gpu/drm/sun4i/sun4i_backend.c +++ b/drivers/gpu/drm/sun4i/sun4i_backend.c @@ -345,6 +345,7 @@ static int sun4i_backend_remove(struct platform_device *pdev)
static const struct of_device_id sun4i_backend_of_table[] = { { .compatible = "allwinner,sun5i-a13-display-backend" },
{ .compatible = "allwinner,sun8i-a33-display-backend" }, { }
}; MODULE_DEVICE_TABLE(of, sun4i_backend_of_table); diff --git a/drivers/gpu/drm/sun4i/sun4i_drv.c b/drivers/gpu/drm/sun4i/sun4i_drv.c index 942f62e2441c..c4d03c1b6db8 100644 --- a/drivers/gpu/drm/sun4i/sun4i_drv.c +++ b/drivers/gpu/drm/sun4i/sun4i_drv.c @@ -199,13 +199,14 @@ static const struct component_master_ops sun4i_drv_master_ops = {
static bool sun4i_drv_node_is_frontend(struct device_node *node) {
return of_device_is_compatible(node,
"allwinner,sun5i-a13-display-frontend");
return of_device_is_compatible(node, "allwinner,sun5i-a13-display-frontend") ||
of_device_is_compatible(node, "allwinner,sun8i-a33-display-frontend");
}
static bool sun4i_drv_node_is_tcon(struct device_node *node) {
return of_device_is_compatible(node, "allwinner,sun5i-a13-tcon");
return of_device_is_compatible(node, "allwinner,sun5i-a13-tcon") ||
of_device_is_compatible(node, "allwinner,sun8i-a33-tcon");
}
static int compare_of(struct device *dev, void *data) @@ -320,6 +321,7 @@ static int sun4i_drv_remove(struct platform_device *pdev)
static const struct of_device_id sun4i_drv_of_table[] = { { .compatible = "allwinner,sun5i-a13-display-engine" },
{ .compatible = "allwinner,sun8i-a33-display-engine" }, { }
}; MODULE_DEVICE_TABLE(of, sun4i_drv_of_table); diff --git a/drivers/gpu/drm/sun4i/sun4i_tcon.c b/drivers/gpu/drm/sun4i/sun4i_tcon.c index fde6af1230d2..cadacb517f95 100644 --- a/drivers/gpu/drm/sun4i/sun4i_tcon.c +++ b/drivers/gpu/drm/sun4i/sun4i_tcon.c @@ -488,8 +488,13 @@ static int sun4i_tcon_bind(struct device *dev, struct device *master, tcon->drm = drm; tcon->dev = dev;
if (of_device_is_compatible(dev->of_node, "allwinner,sun5i-a13-tcon"))
if (of_device_is_compatible(dev->of_node, "allwinner,sun5i-a13-tcon")) { tcon->has_mux = true;
tcon->has_channel_1 = true;
} else {
tcon->has_mux = false;
tcon->has_channel_1 = false;
} tcon->lcd_rst = devm_reset_control_get(dev, "lcd"); if (IS_ERR(tcon->lcd_rst)) {
@@ -585,6 +590,7 @@ static int sun4i_tcon_remove(struct platform_device *pdev)
static const struct of_device_id sun4i_tcon_of_table[] = { { .compatible = "allwinner,sun5i-a13-tcon" },
{ .compatible = "allwinner,sun8i-a33-tcon" }, { }
}; MODULE_DEVICE_TABLE(of, sun4i_tcon_of_table); -- 2.9.3
On Sat, Nov 05, 2016 at 11:54:28PM +0800, Chen-Yu Tsai wrote:
Hi,
On Tue, Sep 6, 2016 at 10:46 PM, Maxime Ripard maxime.ripard@free-electrons.com wrote:
The A33 has a significantly different pipeline, with components that differ too.
Make sure we had compatible for them.
Signed-off-by: Maxime Ripard maxime.ripard@free-electrons.com
Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt | 7 ++++++- drivers/gpu/drm/sun4i/sun4i_backend.c | 1 + drivers/gpu/drm/sun4i/sun4i_drv.c | 8 +++++--- drivers/gpu/drm/sun4i/sun4i_tcon.c | 8 +++++++- 4 files changed, 19 insertions(+), 5 deletions(-)
diff --git a/Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt b/Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt index df8f4aeefe4c..bd3136a5cba5 100644 --- a/Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt +++ b/Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt @@ -26,7 +26,9 @@ TCON The TCON acts as a timing controller for RGB, LVDS and TV interfaces.
Required properties:
- compatible: value should be "allwinner,sun5i-a13-tcon".
- compatible: value must be either:
- allwinner,sun5i-a13-tcon
- allwinner,sun8i-a33-tcon
- reg: base address and size of memory-mapped region
- interrupts: interrupt associated to this IP
- clocks: phandles to the clocks feeding the TCON. Three are needed:
@@ -59,6 +61,7 @@ system. Required properties:
- compatible: value must be one of:
- allwinner,sun5i-a13-display-backend
- allwinner,sun8i-a33-display-backend
- reg: base address and size of the memory-mapped region.
- clocks: phandles to the clocks feeding the frontend and backend
- ahb: the backend interface clock
@@ -80,6 +83,7 @@ deinterlacing and color space conversion. Required properties:
- compatible: value must be one of:
- allwinner,sun5i-a13-display-frontend
- allwinner,sun8i-a33-display-frontend
I just looked at the A23. It seems it's the same display frontend as the A33. Should we change the compatible string to a23 while it's still in RC?
The backend is probably different. The A33 only claims to support 2048x2048 layers, while the A23 claims to support 8192x8192 layers.
I think we can still keep it. Especially if we're not sure, we might need to make use of it in the future.
Maxime
The A33 has an block called SAT that is part of the backend that needs to be clocked and out of reset to be able for the backend to operate properly.
Extend the binding to have the SAT resources listed, and claim them when the backend probes.
Signed-off-by: Maxime Ripard maxime.ripard@free-electrons.com --- .../bindings/display/sunxi/sun4i-drm.txt | 8 +++ drivers/gpu/drm/sun4i/sun4i_backend.c | 60 ++++++++++++++++++++++ drivers/gpu/drm/sun4i/sun4i_backend.h | 3 ++ 3 files changed, 71 insertions(+)
diff --git a/Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt b/Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt index bd3136a5cba5..d3529f72ca91 100644 --- a/Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt +++ b/Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt @@ -74,6 +74,14 @@ Required properties: Documentation/devicetree/bindings/media/video-interfaces.txt. The first port should be the input endpoints, the second one the output
+On the A33, some additional properties are required: + - reg needs to have an additional region corresponding to the SAT + - reg-names need to be set, with "be" and "sat" + - clocks and clock-names need to have a phandle to the SAT bus + clocks, whose name will be "sat" + - resets and reset-names need to have a phandle to the SAT bus + resets, whose name will be "sat" + Display Engine Frontend -----------------------
diff --git a/drivers/gpu/drm/sun4i/sun4i_backend.c b/drivers/gpu/drm/sun4i/sun4i_backend.c index 9bfd2e45fceb..91a702225ded 100644 --- a/drivers/gpu/drm/sun4i/sun4i_backend.c +++ b/drivers/gpu/drm/sun4i/sun4i_backend.c @@ -217,6 +217,51 @@ int sun4i_backend_update_layer_buffer(struct sun4i_backend *backend, } EXPORT_SYMBOL(sun4i_backend_update_layer_buffer);
+static int sun4i_backend_init_sat(struct device *dev) { + struct sun4i_backend *backend = dev_get_drvdata(dev); + int ret; + + backend->sat_reset = devm_reset_control_get(dev, "sat"); + if (IS_ERR(backend->sat_reset)) { + dev_err(dev, "Couldn't get the SAT reset line\n"); + return PTR_ERR(backend->sat_reset); + } + + ret = reset_control_deassert(backend->sat_reset); + if (ret) { + dev_err(dev, "Couldn't deassert the SAT reset line\n"); + return ret; + } + + backend->sat_clk = devm_clk_get(dev, "sat"); + if (IS_ERR(backend->sat_clk)) { + dev_err(dev, "Couldn't get our SAT clock\n"); + ret = PTR_ERR(backend->sat_clk); + goto err_assert_reset; + } + + ret = clk_prepare_enable(backend->sat_clk); + if (ret) { + dev_err(dev, "Couldn't enable the SAT clock\n"); + return ret; + } + + return 0; + +err_assert_reset: + reset_control_assert(backend->sat_reset); + return ret; +} + +static int sun4i_backend_free_sat(struct device *dev) { + struct sun4i_backend *backend = dev_get_drvdata(dev); + + clk_disable_unprepare(backend->sat_clk); + reset_control_assert(backend->sat_reset); + + return 0; +} + static struct regmap_config sun4i_backend_regmap_config = { .reg_bits = 32, .val_bits = 32, @@ -291,6 +336,15 @@ static int sun4i_backend_bind(struct device *dev, struct device *master, } clk_prepare_enable(backend->ram_clk);
+ if (of_device_is_compatible(dev->of_node, + "allwinner,sun8i-a33-display-backend")) { + ret = sun4i_backend_init_sat(dev); + if (ret) { + dev_err(dev, "Couldn't init SAT resources\n"); + goto err_disable_ram_clk; + } + } + /* Reset the registers */ for (i = 0x800; i < 0x1000; i += 4) regmap_write(backend->regs, i, 0); @@ -306,6 +360,8 @@ static int sun4i_backend_bind(struct device *dev, struct device *master,
return 0;
+err_disable_ram_clk: + clk_disable_unprepare(backend->ram_clk); err_disable_mod_clk: clk_disable_unprepare(backend->mod_clk); err_disable_bus_clk: @@ -320,6 +376,10 @@ static void sun4i_backend_unbind(struct device *dev, struct device *master, { struct sun4i_backend *backend = dev_get_drvdata(dev);
+ if (of_device_is_compatible(dev->of_node, + "allwinner,sun8i-a33-display-backend")) + sun4i_backend_free_sat(dev); + clk_disable_unprepare(backend->ram_clk); clk_disable_unprepare(backend->mod_clk); clk_disable_unprepare(backend->bus_clk); diff --git a/drivers/gpu/drm/sun4i/sun4i_backend.h b/drivers/gpu/drm/sun4i/sun4i_backend.h index 7070bb3434e5..e00718627748 100644 --- a/drivers/gpu/drm/sun4i/sun4i_backend.h +++ b/drivers/gpu/drm/sun4i/sun4i_backend.h @@ -146,6 +146,9 @@ struct sun4i_backend { struct clk *bus_clk; struct clk *mod_clk; struct clk *ram_clk; + + struct clk *sat_clk; + struct reset_control *sat_reset; };
void sun4i_backend_apply_color_correction(struct sun4i_backend *backend);
On Tue, Sep 6, 2016 at 10:46 PM, Maxime Ripard maxime.ripard@free-electrons.com wrote:
The A33 has an block called SAT that is part of the backend that needs to be clocked and out of reset to be able for the backend to operate properly.
Extend the binding to have the SAT resources listed, and claim them when the backend probes.
Signed-off-by: Maxime Ripard maxime.ripard@free-electrons.com
Acked-by: Chen-Yu Tsai wens@csie.org
The A33 pipeline also has a component called DRC. Even though its exact features and programming model is not known (or documented), it needs to be clocked for the pipeline to carry the video signal all the way.
Add a minimal driver for it that just claim the needed resources for the pipeline to operate properly.
Signed-off-by: Maxime Ripard maxime.ripard@free-electrons.com --- .../bindings/display/sunxi/sun4i-drm.txt | 24 +++++ drivers/gpu/drm/sun4i/Makefile | 2 +- drivers/gpu/drm/sun4i/sun6i_drc.c | 118 +++++++++++++++++++++ 3 files changed, 143 insertions(+), 1 deletion(-) create mode 100644 drivers/gpu/drm/sun4i/sun6i_drc.c
diff --git a/Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt b/Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt index d3529f72ca91..2b8a216790cb 100644 --- a/Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt +++ b/Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt @@ -51,6 +51,30 @@ Required properties: second the block connected to the TCON channel 1 (usually the TV encoder)
+DRC +--- + +The DRC (Dynamic Range Controller), found in the latest Allwinner SoCs +(A31, A23, A33), allows to dynamically adjust pixel +brightness/contrast based on histogram measurements for LCD content +adaptive backlight control. + + +Required properties: + - compatible: value must be one of: + * allwinner,sun8i-a33-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 + * ahb: the DRC interface clock + * mod: the DRC module clock + * ram: the DRC DRAM clock + - clock-names: the clock names mentioned above + - resets: phandles to the reset line driving the DRC + +- 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 Backend ---------------------- diff --git a/drivers/gpu/drm/sun4i/Makefile b/drivers/gpu/drm/sun4i/Makefile index 58cd55149827..d625a82a6e5f 100644 --- a/drivers/gpu/drm/sun4i/Makefile +++ b/drivers/gpu/drm/sun4i/Makefile @@ -9,5 +9,5 @@ sun4i-tcon-y += sun4i_dotclock.o
obj-$(CONFIG_DRM_SUN4I) += sun4i-drm.o sun4i-tcon.o obj-$(CONFIG_DRM_SUN4I) += sun4i_backend.o - +obj-$(CONFIG_DRM_SUN4I) += sun6i_drc.o obj-$(CONFIG_DRM_SUN4I) += sun4i_tv.o diff --git a/drivers/gpu/drm/sun4i/sun6i_drc.c b/drivers/gpu/drm/sun4i/sun6i_drc.c new file mode 100644 index 000000000000..bf6d846d8132 --- /dev/null +++ b/drivers/gpu/drm/sun4i/sun6i_drc.c @@ -0,0 +1,118 @@ +/* + * Copyright (C) 2016 Free Electrons + * + * Maxime Ripard maxime.ripard@free-electrons.com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + */ + +#include <linux/clk.h> +#include <linux/component.h> +#include <linux/module.h> +#include <linux/platform_device.h> +#include <linux/regmap.h> +#include <linux/reset.h> + +struct sun6i_drc { + struct clk *bus_clk; + struct clk *mod_clk; + struct reset_control *reset; +}; + +static int sun6i_drc_bind(struct device *dev, struct device *master, + void *data) +{ + struct sun6i_drc *drc; + int ret; + + drc = devm_kzalloc(dev, sizeof(*drc), GFP_KERNEL); + if (!drc) + return -ENOMEM; + dev_set_drvdata(dev, drc); + + drc->reset = devm_reset_control_get(dev, NULL); + if (IS_ERR(drc->reset)) { + dev_err(dev, "Couldn't get our reset line\n"); + return PTR_ERR(drc->reset); + } + + ret = reset_control_deassert(drc->reset); + if (ret) { + dev_err(dev, "Couldn't deassert our reset line\n"); + return ret; + } + + drc->bus_clk = devm_clk_get(dev, "ahb"); + if (IS_ERR(drc->bus_clk)) { + dev_err(dev, "Couldn't get our bus clock\n"); + ret = PTR_ERR(drc->bus_clk); + goto err_assert_reset; + } + clk_prepare_enable(drc->bus_clk); + + drc->mod_clk = devm_clk_get(dev, "mod"); + if (IS_ERR(drc->mod_clk)) { + dev_err(dev, "Couldn't get our mod clock\n"); + ret = PTR_ERR(drc->mod_clk); + goto err_disable_bus_clk; + } + clk_prepare_enable(drc->mod_clk); + + return 0; + +err_disable_bus_clk: + clk_disable_unprepare(drc->bus_clk); +err_assert_reset: + reset_control_assert(drc->reset); + return ret; +} + +static void sun6i_drc_unbind(struct device *dev, struct device *master, + void *data) +{ + struct sun6i_drc *drc = dev_get_drvdata(dev); + + clk_disable_unprepare(drc->mod_clk); + clk_disable_unprepare(drc->bus_clk); + reset_control_assert(drc->reset); +} + +static struct component_ops sun6i_drc_ops = { + .bind = sun6i_drc_bind, + .unbind = sun6i_drc_unbind, +}; + +static int sun6i_drc_probe(struct platform_device *pdev) +{ + return component_add(&pdev->dev, &sun6i_drc_ops); +} + +static int sun6i_drc_remove(struct platform_device *pdev) +{ + component_del(&pdev->dev, &sun6i_drc_ops); + + return 0; +} + +static const struct of_device_id sun6i_drc_of_table[] = { + { .compatible = "allwinner,sun8i-a33-drc" }, + { } +}; +MODULE_DEVICE_TABLE(of, sun6i_drc_of_table); + +static struct platform_driver sun6i_drc_platform_driver = { + .probe = sun6i_drc_probe, + .remove = sun6i_drc_remove, + .driver = { + .name = "sun6i-drc", + .of_match_table = sun6i_drc_of_table, + }, +}; +module_platform_driver(sun6i_drc_platform_driver); + +MODULE_AUTHOR("Maxime Ripard maxime.ripard@free-electrons.com"); +MODULE_DESCRIPTION("Allwinner A31 Dynamic Range Control (DRC) Driver"); +MODULE_LICENSE("GPL");
On Tue, Sep 6, 2016 at 10:46 PM, Maxime Ripard maxime.ripard@free-electrons.com wrote:
The A33 pipeline also has a component called DRC. Even though its exact features and programming model is not known (or documented), it needs to be clocked for the pipeline to carry the video signal all the way.
Add a minimal driver for it that just claim the needed resources for the pipeline to operate properly.
Signed-off-by: Maxime Ripard maxime.ripard@free-electrons.com
Acked-by: Chen-Yu Tsai wens@csie.org
"Maxime" == Maxime Ripard maxime.ripard@free-electrons.com writes:
The A33 pipeline also has a component called DRC. Even though its exact features and programming model is not known (or documented), it needs to be clocked for the pipeline to carry the video signal all the way.
Add a minimal driver for it that just claim the needed resources for the pipeline to operate properly.
Signed-off-by: Maxime Ripard maxime.ripard@free-electrons.com
Acked-by: Peter Korsgaard peter@korsgaard.com
Netron DY is a brand of LCD panels found on SBCs and tablets.
Signed-off-by: Maxime Ripard maxime.ripard@free-electrons.com --- Documentation/devicetree/bindings/vendor-prefixes.txt | 1 + 1 file changed, 1 insertion(+)
diff --git a/Documentation/devicetree/bindings/vendor-prefixes.txt b/Documentation/devicetree/bindings/vendor-prefixes.txt index 1992aa97d45a..9c1ab3c1132b 100644 --- a/Documentation/devicetree/bindings/vendor-prefixes.txt +++ b/Documentation/devicetree/bindings/vendor-prefixes.txt @@ -176,6 +176,7 @@ nec NEC LCD Technologies, Ltd. neonode Neonode Inc. netgear NETGEAR netlogic Broadcom Corporation (formerly NetLogic Microsystems) +netron-dy Netron DY netxeon Shenzhen Netxeon Technology CO., LTD newhaven Newhaven Display International nintendo Nintendo
On Tue, Sep 06, 2016 at 04:46:16PM +0200, Maxime Ripard wrote:
Netron DY is a brand of LCD panels found on SBCs and tablets.
Signed-off-by: Maxime Ripard maxime.ripard@free-electrons.com
Documentation/devicetree/bindings/vendor-prefixes.txt | 1 + 1 file changed, 1 insertion(+)
Hi Rob,
care to give this your Acked-by?
Thanks, Thierry
diff --git a/Documentation/devicetree/bindings/vendor-prefixes.txt b/Documentation/devicetree/bindings/vendor-prefixes.txt index 1992aa97d45a..9c1ab3c1132b 100644 --- a/Documentation/devicetree/bindings/vendor-prefixes.txt +++ b/Documentation/devicetree/bindings/vendor-prefixes.txt @@ -176,6 +176,7 @@ nec NEC LCD Technologies, Ltd. neonode Neonode Inc. netgear NETGEAR netlogic Broadcom Corporation (formerly NetLogic Microsystems) +netron-dy Netron DY netxeon Shenzhen Netxeon Technology CO., LTD newhaven Newhaven Display International nintendo Nintendo -- 2.9.3
On Wed, Oct 19, 2016 at 7:39 AM, Thierry Reding thierry.reding@gmail.com wrote:
On Tue, Sep 06, 2016 at 04:46:16PM +0200, Maxime Ripard wrote:
Netron DY is a brand of LCD panels found on SBCs and tablets.
Signed-off-by: Maxime Ripard maxime.ripard@free-electrons.com
Documentation/devicetree/bindings/vendor-prefixes.txt | 1 + 1 file changed, 1 insertion(+)
Hi Rob,
care to give this your Acked-by?
It helps to send to the DT list.
Acked-by: Rob Herring robh@kernel.org
Thanks, Thierry
diff --git a/Documentation/devicetree/bindings/vendor-prefixes.txt b/Documentation/devicetree/bindings/vendor-prefixes.txt index 1992aa97d45a..9c1ab3c1132b 100644 --- a/Documentation/devicetree/bindings/vendor-prefixes.txt +++ b/Documentation/devicetree/bindings/vendor-prefixes.txt @@ -176,6 +176,7 @@ nec NEC LCD Technologies, Ltd. neonode Neonode Inc. netgear NETGEAR netlogic Broadcom Corporation (formerly NetLogic Microsystems) +netron-dy Netron DY netxeon Shenzhen Netxeon Technology CO., LTD newhaven Newhaven Display International nintendo Nintendo -- 2.9.3
On Tue, Sep 06, 2016 at 04:46:16PM +0200, Maxime Ripard wrote:
Netron DY is a brand of LCD panels found on SBCs and tablets.
Signed-off-by: Maxime Ripard maxime.ripard@free-electrons.com
Documentation/devicetree/bindings/vendor-prefixes.txt | 1 + 1 file changed, 1 insertion(+)
Applied, thanks.
Thierry
The E231732 is a 7" panel with a resolution of 800x480.
Signed-off-by: Maxime Ripard maxime.ripard@free-electrons.com --- drivers/gpu/drm/panel/panel-simple.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+)
diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c index 85143d1b9b31..85e988b51fbe 100644 --- a/drivers/gpu/drm/panel/panel-simple.c +++ b/drivers/gpu/drm/panel/panel-simple.c @@ -1136,6 +1136,29 @@ static const struct panel_desc nec_nl4827hc19_05b = { .bus_flags = DRM_BUS_FLAG_PIXDATA_POSEDGE, };
+static const struct drm_display_mode netron_dy_e231732_mode = { + .clock = 66000, + .hdisplay = 1024, + .hsync_start = 1024 + 160, + .hsync_end = 1024 + 160 + 70, + .htotal = 1024 + 160 + 70 + 90, + .vdisplay = 600, + .vsync_start = 600 + 127, + .vsync_end = 600 + 127 + 20, + .vtotal = 600 + 127 + 20 + 3, + .vrefresh = 60, +}; + +static const struct panel_desc netron_dy_e231732 = { + .modes = &netron_dy_e231732_mode, + .num_modes = 1, + .size = { + .width = 154, + .height = 87, + }, + .bus_format = MEDIA_BUS_FMT_RGB666_1X18, +}; + static const struct display_timing okaya_rs800480t_7x0gp_timing = { .pixelclock = { 30000000, 30000000, 40000000 }, .hactive = { 800, 800, 800 }, @@ -1644,6 +1667,9 @@ static const struct of_device_id platform_of_match[] = { .compatible = "shelly,sca07010-bfn-lnn", .data = &shelly_sca07010_bfn_lnn, }, { + .compatible = "netron-dy,e231732", + .data = &netron_dy_e231732, + }, { .compatible = "starry,kr122ea0sra", .data = &starry_kr122ea0sra, }, {
Hi,
On Tue, Sep 6, 2016 at 10:46 PM, Maxime Ripard maxime.ripard@free-electrons.com wrote:
The E231732 is a 7" panel with a resolution of 800x480.
From what I could make out of an archived version of Netron's website
(it's unreachable from my place), they are a manufacturer of printed ribbon cables, not LCD panels. This is probably a no-go.
On the side, my A23 tablet's LCD ribbon cable only had a model name, which led me to multiple Aliexpress entries.
ChenYu
Signed-off-by: Maxime Ripard maxime.ripard@free-electrons.com
drivers/gpu/drm/panel/panel-simple.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+)
diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c index 85143d1b9b31..85e988b51fbe 100644 --- a/drivers/gpu/drm/panel/panel-simple.c +++ b/drivers/gpu/drm/panel/panel-simple.c @@ -1136,6 +1136,29 @@ static const struct panel_desc nec_nl4827hc19_05b = { .bus_flags = DRM_BUS_FLAG_PIXDATA_POSEDGE, };
+static const struct drm_display_mode netron_dy_e231732_mode = {
.clock = 66000,
.hdisplay = 1024,
.hsync_start = 1024 + 160,
.hsync_end = 1024 + 160 + 70,
.htotal = 1024 + 160 + 70 + 90,
.vdisplay = 600,
.vsync_start = 600 + 127,
.vsync_end = 600 + 127 + 20,
.vtotal = 600 + 127 + 20 + 3,
.vrefresh = 60,
+};
+static const struct panel_desc netron_dy_e231732 = {
.modes = &netron_dy_e231732_mode,
.num_modes = 1,
.size = {
.width = 154,
.height = 87,
},
.bus_format = MEDIA_BUS_FMT_RGB666_1X18,
+};
static const struct display_timing okaya_rs800480t_7x0gp_timing = { .pixelclock = { 30000000, 30000000, 40000000 }, .hactive = { 800, 800, 800 }, @@ -1644,6 +1667,9 @@ static const struct of_device_id platform_of_match[] = { .compatible = "shelly,sca07010-bfn-lnn", .data = &shelly_sca07010_bfn_lnn, }, {
.compatible = "netron-dy,e231732",
.data = &netron_dy_e231732,
}, { .compatible = "starry,kr122ea0sra", .data = &starry_kr122ea0sra, }, {
-- 2.9.3
On Wed, Sep 07, 2016 at 12:01:56AM +0800, Chen-Yu Tsai wrote:
Hi,
On Tue, Sep 6, 2016 at 10:46 PM, Maxime Ripard maxime.ripard@free-electrons.com wrote:
The E231732 is a 7" panel with a resolution of 800x480.
From what I could make out of an archived version of Netron's website (it's unreachable from my place), they are a manufacturer of printed ribbon cables, not LCD panels. This is probably a no-go.
I don't know. I haven't been able to find any website for Netron DY, however, googling the part number I used find numerous matches on ebay and alibaba.
Maxime
Hi,
Le vendredi 09 septembre 2016 à 16:35 +0200, Maxime Ripard a écrit :
On Wed, Sep 07, 2016 at 12:01:56AM +0800, Chen-Yu Tsai wrote:
Hi,
On Tue, Sep 6, 2016 at 10:46 PM, Maxime Ripard maxime.ripard@free-electrons.com wrote:
The E231732 is a 7" panel with a resolution of 800x480.
From what I could make out of an archived version of Netron's website (it's unreachable from my place), they are a manufacturer of printed ribbon cables, not LCD panels. This is probably a no-go.
I don't know. I haven't been able to find any website for Netron DY, however, googling the part number I used find numerous matches on ebay and alibaba.
While starting a port for the A13-based TZX-Q8-713B7 tablet, it appears that my LCD cable also has the Netron-DY E231732 marking, but is definitely different from the one on the SinA33. So I think Chen-Yu's comment was founded and "Netron DY E231732" does not reflect the panel name.
Here are some details regarding the LCD cable on both devices:
The SinA33 has a 1024x600 panel with the following markings: 7300101463 E231732 NETRON-DY <> 1 94V-0\1310
The TZX-Q8-713B7 has a 800x480 panel with the following markings: 7300101448 E231732 NETRON-DY <> 2 94V-0\1249
So it seems that the distinctive part of the name is 7300101463/7300101448.
Also, it seems that various online shops list the panels with a name like "E231732 7300101463". So maybe we could change the bindings to have:
- netron-dy,e231732-7300101463 - netron-dy,e231732-7300101448
What do you think? Does that make sense?
We should probably also fallback netron-dy,e231732 to the sina33's panel in order to avoid breaking the ABI.
Cheers,
Hi,
On Wed, May 02, 2018 at 09:20:30AM +0200, Paul Kocialkowski wrote:
Le vendredi 09 septembre 2016 à 16:35 +0200, Maxime Ripard a écrit :
On Wed, Sep 07, 2016 at 12:01:56AM +0800, Chen-Yu Tsai wrote:
Hi,
On Tue, Sep 6, 2016 at 10:46 PM, Maxime Ripard maxime.ripard@free-electrons.com wrote:
The E231732 is a 7" panel with a resolution of 800x480.
From what I could make out of an archived version of Netron's website (it's unreachable from my place), they are a manufacturer of printed ribbon cables, not LCD panels. This is probably a no-go.
I don't know. I haven't been able to find any website for Netron DY, however, googling the part number I used find numerous matches on ebay and alibaba.
While starting a port for the A13-based TZX-Q8-713B7 tablet, it appears that my LCD cable also has the Netron-DY E231732 marking, but is definitely different from the one on the SinA33. So I think Chen-Yu's comment was founded and "Netron DY E231732" does not reflect the panel name.
Here are some details regarding the LCD cable on both devices:
The SinA33 has a 1024x600 panel with the following markings: 7300101463 E231732 NETRON-DY <> 1 94V-0\1310
The TZX-Q8-713B7 has a 800x480 panel with the following markings: 7300101448 E231732 NETRON-DY <> 2 94V-0\1249
So it seems that the distinctive part of the name is 7300101463/7300101448.
Also, it seems that various online shops list the panels with a name like "E231732 7300101463". So maybe we could change the bindings to have:
- netron-dy,e231732-7300101463
- netron-dy,e231732-7300101448
What do you think? Does that make sense?
We should probably also fallback netron-dy,e231732 to the sina33's panel in order to avoid breaking the ABI.
That's kind of unfortunate, and maybe the netron part is just the vendor of the flex cable.
In your case, I guess the best work around this would be to call it TZX-Q8-713B7-panel, if it's shipped with a single resolution.
Maxime
On Tue, Sep 06, 2016 at 04:46:17PM +0200, Maxime Ripard wrote:
The E231732 is a 7" panel with a resolution of 800x480.
Signed-off-by: Maxime Ripard maxime.ripard@free-electrons.com
drivers/gpu/drm/panel/panel-simple.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+)
This is missing a device tree binding, but since this is a simple one I added it. The commit message also says the resolution is 800x480, which conflicts with what's in the display mode definition, so I've also fixed that up while at it.
Thanks, Thierry
On Thu, Jan 26, 2017 at 10:54:56AM +0100, Thierry Reding wrote:
On Tue, Sep 06, 2016 at 04:46:17PM +0200, Maxime Ripard wrote:
The E231732 is a 7" panel with a resolution of 800x480.
Signed-off-by: Maxime Ripard maxime.ripard@free-electrons.com
drivers/gpu/drm/panel/panel-simple.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+)
This is missing a device tree binding, but since this is a simple one I added it. The commit message also says the resolution is 800x480, which conflicts with what's in the display mode definition, so I've also fixed that up while at it.
Sorry for that :/
Thanks a lot, Maxime
Add all the needed blocks to the A33 DTSI.
Signed-off-by: Maxime Ripard maxime.ripard@free-electrons.com --- arch/arm/boot/dts/sun8i-a33.dtsi | 152 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 152 insertions(+)
diff --git a/arch/arm/boot/dts/sun8i-a33.dtsi b/arch/arm/boot/dts/sun8i-a33.dtsi index f3d91d2c96ef..1d21d488cb3e 100644 --- a/arch/arm/boot/dts/sun8i-a33.dtsi +++ b/arch/arm/boot/dts/sun8i-a33.dtsi @@ -59,11 +59,53 @@ }; };
+ de: display-engine { + compatible = "allwinner,sun8i-a33-display-engine"; + allwinner,pipelines = <&fe0>; + status = "disabled"; + }; + memory { reg = <0x40000000 0x80000000>; };
soc@01c00000 { + tcon0: lcd-controller@01c0c000 { + compatible = "allwinner,sun8i-a33-tcon"; + reg = <0x01c0c000 0x1000>; + interrupts = <GIC_SPI 86 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&ccu CLK_BUS_LCD>, + <&ccu CLK_LCD_CH0>; + clock-names = "ahb", + "tcon-ch0"; + clock-output-names = "tcon-pixel-clock"; + resets = <&ccu RST_BUS_LCD>; + reset-names = "lcd"; + status = "disabled"; + + 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>; + }; + }; + }; + crypto: crypto-engine@01c15000 { compatible = "allwinner,sun4i-a10-crypto"; reg = <0x01c15000 0x1000>; @@ -104,6 +146,116 @@ status = "disabled"; #phy-cells = <1>; }; + + fe0: display-frontend@01e00000 { + compatible = "allwinner,sun8i-a33-display-frontend"; + reg = <0x01e00000 0x20000>; + interrupts = <GIC_SPI 93 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&ccu CLK_BUS_DE_FE>, <&ccu CLK_DE_FE>, + <&ccu CLK_DRAM_DE_FE>; + clock-names = "ahb", "mod", + "ram"; + resets = <&ccu RST_BUS_DE_FE>; + status = "disabled"; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + fe0_out: port@1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + + fe0_out_be0: endpoint@0 { + reg = <0>; + remote-endpoint = <&be0_in_fe0>; + }; + }; + }; + }; + + be0: display-backend@01e60000 { + compatible = "allwinner,sun8i-a33-display-backend"; + reg = <0x01e60000 0x10000>, <0x01e80000 0x1000>; + reg-names = "be", "sat"; + interrupts = <GIC_SPI 95 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&ccu CLK_BUS_DE_BE>, <&ccu CLK_DE_BE>, + <&ccu CLK_DRAM_DE_BE>, <&ccu CLK_BUS_SAT>; + clock-names = "ahb", "mod", + "ram", "sat"; + resets = <&ccu RST_BUS_DE_BE>, <&ccu RST_BUS_SAT>; + reset-names = "be", "sat"; + assigned-clocks = <&ccu CLK_DE_BE>; + assigned-clock-rates = <300000000>; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + be0_in: port@0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + + be0_in_fe0: endpoint@0 { + reg = <0>; + remote-endpoint = <&fe0_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>; + }; + }; + }; + }; + + drc0: drc@01e70000 { + compatible = "allwinner,sun8i-a33-drc"; + reg = <0x01e70000 0x10000>; + interrupts = <GIC_SPI 91 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&ccu CLK_BUS_DRC>, <&ccu CLK_DRC>, + <&ccu CLK_DRAM_DRC>; + clock-names = "ahb", "mod", "ram"; + resets = <&ccu RST_BUS_DRC>; + + assigned-clocks = <&ccu CLK_DRC>; + assigned-clock-rates = <300000000>; + + 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>; + }; + }; + }; + }; }; };
On Tue, Sep 6, 2016 at 10:46 PM, Maxime Ripard maxime.ripard@free-electrons.com wrote:
Add all the needed blocks to the A33 DTSI.
Signed-off-by: Maxime Ripard maxime.ripard@free-electrons.com
Acked-by: Chen-Yu Tsai wens@csie.org
The LCD output needs to be muxed. Add the proper pinctrl node.
Signed-off-by: Maxime Ripard maxime.ripard@free-electrons.com Acked-by: Chen-Yu Tsai wens@csie.org --- arch/arm/boot/dts/sun8i-a23-a33.dtsi | 10 ++++++++++ 1 file changed, 10 insertions(+)
diff --git a/arch/arm/boot/dts/sun8i-a23-a33.dtsi b/arch/arm/boot/dts/sun8i-a23-a33.dtsi index 7246663bacdd..7ea6de12040e 100644 --- a/arch/arm/boot/dts/sun8i-a23-a33.dtsi +++ b/arch/arm/boot/dts/sun8i-a23-a33.dtsi @@ -302,6 +302,16 @@ allwinner,drive = <SUN4I_PINCTRL_10_MA>; allwinner,pull = <SUN4I_PINCTRL_NO_PULL>; }; + + lcd_rgb666_pins: lcd-rgb666@0 { + allwinner,pins = "PD2", "PD3", "PD4", "PD5", "PD6", "PD7", + "PD10", "PD11", "PD12", "PD13", "PD14", "PD15", + "PD18", "PD19", "PD20", "PD21", "PD22", "PD23", + "PD24", "PD25", "PD26", "PD27"; + allwinner,function = "lcd0"; + allwinner,drive = <SUN4I_PINCTRL_10_MA>; + allwinner,pull = <SUN4I_PINCTRL_NO_PULL>; + }; };
timer@01c20c00 {
Enable the display pipeline with the associated 7" panel sold with the SinA33.
Signed-off-by: Maxime Ripard maxime.ripard@free-electrons.com --- arch/arm/boot/dts/sun8i-a33-sinlinx-sina33.dts | 34 ++++++++++++++++++++++++++ 1 file changed, 34 insertions(+)
diff --git a/arch/arm/boot/dts/sun8i-a33-sinlinx-sina33.dts b/arch/arm/boot/dts/sun8i-a33-sinlinx-sina33.dts index fef6abc0a703..fa8024072025 100644 --- a/arch/arm/boot/dts/sun8i-a33-sinlinx-sina33.dts +++ b/arch/arm/boot/dts/sun8i-a33-sinlinx-sina33.dts @@ -61,6 +61,27 @@ chosen { stdout-path = "serial0:115200n8"; }; + + panel { + compatible = "netron-dy,e231732"; + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + #address-cells = <1>; + #size-cells = <0>; + + panel_input: endpoint@0 { + reg = <0>; + remote-endpoint = <&tcon0_out_panel>; + }; + }; + }; +}; + +&de { + status = "okay"; };
&ehci0 { @@ -207,6 +228,19 @@ regulator-name = "vcc-rtc"; };
+&tcon0 { + pinctrl-names = "default"; + pinctrl-0 = <&lcd_rgb666_pins>; + status = "okay"; +}; + +&tcon0_out { + tcon0_out_panel: endpoint@0 { + reg = <0>; + remote-endpoint = <&panel_input>; + }; +}; + &uart0 { pinctrl-names = "default"; pinctrl-0 = <&uart0_pins_b>;
On Tue, Sep 06, 2016 at 04:46:20PM +0200, Maxime Ripard wrote:
Enable the display pipeline with the associated 7" panel sold with the SinA33.
Signed-off-by: Maxime Ripard maxime.ripard@free-electrons.com
Applied, Maxime
On Tue, Sep 06, 2016 at 04:46:11PM +0200, Maxime Ripard wrote:
Hi everyone,
This serie introduces the support in the sun4i-drm driver for the A33.
Beside the new IPs and special cases for the A33 new IPs, there's nothing really outstanding, and is now at feature parity with the A13.
This serie is based on my A33 CCU patches posted earlier today here: http://lists.infradead.org/pipermail/linux-arm-kernel/2016-September/453208....
Let me know what you think, Maxime
Merged the patches 1-4.
Maxime
On Tue, Sep 06, 2016 at 04:46:11PM +0200, Maxime Ripard wrote:
Hi everyone,
This serie introduces the support in the sun4i-drm driver for the A33.
Beside the new IPs and special cases for the A33 new IPs, there's nothing really outstanding, and is now at feature parity with the A13.
This serie is based on my A33 CCU patches posted earlier today here: http://lists.infradead.org/pipermail/linux-arm-kernel/2016-September/453208....
Let me know what you think, Maxime
And I applied the patches 7 and 8.
We'll figure the panel stuff later.
Maxime
dri-devel@lists.freedesktop.org