Skip to contentSkip to conversation

ARM: sun8i: a23: Enable display pipeline

PATCH Applied Chen-Yu Tsai 3 participants 14 messages Jan 25, 2019 – Jan 28, 2019

Subsystems (6)
lore
Share & tools
lore
#0 lore raw

cover ARM: sun8i: a23: Enable display pipeline

Hi everyone,

This series enables the display pipeline on the Allwinner A23 SoC. A few fixes are included for corner cases when the frontend isn't enabled.

The A23 display pipeline is very much the same as the A33, except that the A23 does not have the SAT IP block embedded within the display backend.

MIPI DSI is not covered as I do not have a device that uses it.

Patch 1 fixes the pll-mipi clock on the A23.

Patch 2 adds compatible strings for the various hardware blocks of the A23 display pipeline.

Patch 3 through 5 fix some issues in our DRM plane support, namely declaring support for formats when we shouldn't.

Patch 6 adds support for the A23 display pipeline to the driver.

Patch 7 is a small cleanup before moving the display pipeline device nodes.

Patch 8 moves the display nodes from the A33-specific dtsi file to the A23-A33 shared dtsi file. Note that the MIPI DSI device nodes are not moved.

Patch 9 adds compatible strings to the display nodes in the A23-specific dtsi file.

Patch 10 enables the display pipeline for the shared A23/A33 Q8 tablet dtsi file. The compatible string should be filled in by the tablet dts files.

Patch 11 fills in the compatible string for the standard A23 Q8 tablet. Note the compatible string is not for the specific model used in the tablet, as it varies between production runs. Rather it is just one that works.

Please have a look. Patch 3 might be worth applying as a fix, but might not be worth the trouble. It could just as easily be applied for -next and then backported.

Also, the fixes tags are no longer line wrapped, unlike patches I've sent in the past.

Regards
ChenYu

Chen-Yu Tsai (11):
clk: sunxi-ng: sun8i-a23: Enable PLL-MIPI LDOs when ungating it
dt-bindings: display: sun4i-drm: Add compatible strings for A23
display
drm/sun4i: backend: Remove BGRX8888 from list of supported formats drm/sun4i: layer: Assign backend pointer before calling DRM helpers drm/sun4i: layer: support just backend formats when frontend is
unavailable
drm/sun4i: Add support for A23 display pipeline
ARM: dts: sun8i-a23-a33: Move NAND controller device node to sort by
address
ARM: dts: sun8i-a33: Move display pipeline nodes to a23/a33 common
dtsi
ARM: dts: sun8i-a23: Add compatible strings to display pipeline device
nodes
ARM: dts: sun8i-q8-common: Enable display pipeline with RGB LCD panel
ARM: dts: sun8i-a23-q8: Set compatible string for LCD panel

 .../bindings/display/sunxi/sun4i-drm.txt      |   5 +
 arch/arm/boot/dts/sun8i-a23-a33.dtsi          | 175 ++++++++++++++--
 arch/arm/boot/dts/sun8i-a23-q8-tablet.dts     |   4 +
 arch/arm/boot/dts/sun8i-a23.dtsi              |  20 ++
 arch/arm/boot/dts/sun8i-a33.dtsi              | 194 ++++--------------
 arch/arm/boot/dts/sun8i-q8-common.dtsi        |  37 ++++
 drivers/clk/sunxi-ng/ccu-sun8i-a23.c          |   2 +-
 drivers/gpu/drm/sun4i/sun4i_backend.c         |   5 +-
 drivers/gpu/drm/sun4i/sun4i_drv.c             |   2 +
 drivers/gpu/drm/sun4i/sun4i_frontend.c        |   4 +
 drivers/gpu/drm/sun4i/sun4i_layer.c           |  37 +++-
 drivers/gpu/drm/sun4i/sun4i_tcon.c            |   1 +
 drivers/gpu/drm/sun4i/sun6i_drc.c             |   1 +
 13 files changed, 310 insertions(+), 177 deletions(-)
Signature · 1 line
2.20.1
#1 lore raw

PATCH 1/11 clk: sunxi-ng: sun8i-a23: Enable PLL-MIPI LDOs when ungating it

The PLL-MIPI clock is somewhat special as it has its own LDOs which need to be turned on for this PLL to actually work and output a clock signal.

Add the 2 LDO enable bits to the gate bits.

Fixes 5690879d93e8 ("clk: sunxi-ng: Add A23 CCU")
---
 drivers/clk/sunxi-ng/ccu-sun8i-a23.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clk/sunxi-ng/ccu-sun8i-a23.c +1 -1
index a4fa2945f230..4b5f8f4e4ab8 100644
@@ -144,7 +144,7 @@ static SUNXI_CCU_NKM_WITH_GATE_LOCK(pll_mipi_clk, "pll-mipi",
 				    8, 4,		/* N */
 				    4, 2,		/* K */
 				    0, 4,		/* M */
-				    BIT(31),		/* gate */
+				    BIT(31) | BIT(23) | BIT(22), /* gate */
 				    BIT(28),		/* lock */
 				    CLK_SET_RATE_UNGATE);
 
Signature · 1 line
2.20.1
#3 lore raw

PATCH 2/11 dt-bindings: display: sun4i-drm: Add compatible strings for A23 display

In reply to Chen-Yu Tsai

The A23's display pipeline is similar to the A33. Differences include:

- Display backend supports larger layers, 8192x8192 instead of 2048x2048

- TCON has DMA input

- There is no SAT module packed in the display backend

Add compatible strings for the display pipeline and its components.

As the MIPI DSI output device is not officially documented, and there are no A23 reference devices to test it, it is not covered by this patch.

---
 .../devicetree/bindings/display/sunxi/sun4i-drm.txt          | 5 +++++
 1 file changed, 5 insertions(+)
Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt +5 -0
index f426bdb42f18..31ab72cba3d4 100644
@@ -156,6 +156,7 @@ Required properties:
    * allwinner,sun6i-a31-tcon
    * allwinner,sun6i-a31s-tcon
    * allwinner,sun7i-a20-tcon
+   * allwinner,sun8i-a23-tcon
    * allwinner,sun8i-a33-tcon
    * allwinner,sun8i-a83t-tcon-lcd
    * allwinner,sun8i-a83t-tcon-tv
@@ -276,6 +277,7 @@ Required properties:
   - compatible: value must be one of:
     * allwinner,sun6i-a31-drc
     * allwinner,sun6i-a31s-drc
+    * allwinner,sun8i-a23-drc
     * allwinner,sun8i-a33-drc
     * allwinner,sun9i-a80-drc
   - reg: base address and size of the memory-mapped region.
@@ -303,6 +305,7 @@ Required properties:
     * allwinner,sun5i-a13-display-backend
     * allwinner,sun6i-a31-display-backend
     * allwinner,sun7i-a20-display-backend
+    * allwinner,sun8i-a23-display-backend
     * allwinner,sun8i-a33-display-backend
     * allwinner,sun9i-a80-display-backend
   - reg: base address and size of the memory-mapped region.
@@ -360,6 +363,7 @@ Required properties:
     * allwinner,sun5i-a13-display-frontend
     * allwinner,sun6i-a31-display-frontend
     * allwinner,sun7i-a20-display-frontend
+    * allwinner,sun8i-a23-display-frontend
     * allwinner,sun8i-a33-display-frontend
     * allwinner,sun9i-a80-display-frontend
   - reg: base address and size of the memory-mapped region.
@@ -419,6 +423,7 @@ Required properties:
     * allwinner,sun6i-a31-display-engine
     * allwinner,sun6i-a31s-display-engine
     * allwinner,sun7i-a20-display-engine
+    * allwinner,sun8i-a23-display-engine
     * allwinner,sun8i-a33-display-engine
     * allwinner,sun8i-a83t-display-engine
     * allwinner,sun8i-h3-display-engine
Signature · 1 line
2.20.1
#4 lore raw

PATCH 3/11 drm/sun4i: backend: Remove BGRX8888 from list of supported formats

In reply to Chen-Yu Tsai

The display backend does not support BGRX8888. There is also no trace of this in the original list of supported formats before the commit b636d3f97d04 ("drm/sun4i: frontend: Add support for the BGRX8888 input format"). Nor do the backend configuration helpers handle this format.

Remove BGRX8888 from list of supported formats by the backend.

Fixes 3d4265f89d06 ("drm/sun4i: backend: Add a helper and a list for supported formats")
---
 drivers/gpu/drm/sun4i/sun4i_backend.c | 1 -
 1 file changed, 1 deletion(-)
drivers/gpu/drm/sun4i/sun4i_backend.c +0 -1
index c17ec850b614..85e64d02fb5f 100644
@@ -141,7 +141,6 @@ static const uint32_t sun4i_backend_formats[] = {
 	DRM_FORMAT_ARGB1555,
 	DRM_FORMAT_ARGB4444,
 	DRM_FORMAT_ARGB8888,
-	DRM_FORMAT_BGRX8888,
 	DRM_FORMAT_RGB565,
 	DRM_FORMAT_RGB888,
 	DRM_FORMAT_RGBA4444,
Signature · 1 line
2.20.1
#5 lore raw

PATCH 4/11 drm/sun4i: layer: Assign backend pointer before calling DRM helpers

In reply to Chen-Yu Tsai

We might want to use the backend pointer from DRM callbacks that get called within drm_universal_plane_init(), such as the .format_mod_supported callback.

Move the assignment of the layer's backend pointer to right after the structure is allocated.

---
 drivers/gpu/drm/sun4i/sun4i_layer.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/sun4i/sun4i_layer.c +2 -1
index c5a999ca1d72..95d4aaa51a5c 100644
@@ -182,6 +182,8 @@ static struct sun4i_layer *sun4i_layer_init_one(struct drm_device *drm,
 	if (!layer)
 		return ERR_PTR(-ENOMEM);
 
+	layer->backend = backend;
+
 	/* possible crtcs are set later */
 	ret = drm_universal_plane_init(drm, &layer->plane, 0,
 				       &sun4i_backend_layer_funcs,
@@ -195,7 +197,6 @@ static struct sun4i_layer *sun4i_layer_init_one(struct drm_device *drm,
 
 	drm_plane_helper_add(&layer->plane,
 			     &sun4i_backend_layer_helper_funcs);
-	layer->backend = backend;
 
 	drm_plane_create_alpha_property(&layer->plane);
 	drm_plane_create_zpos_property(&layer->plane, 0, 0,
Signature · 1 line
2.20.1
#6 lore raw

PATCH 5/11 drm/sun4i: layer: support just backend formats when frontend is unavailable

In reply to Chen-Yu Tsai

In some cases, such as running a new kernel with an old device tree that has the frontend disabled, the backend's matching frontend might be unavailable.

When this happens, the layers should only declare support for formats that the backend support. This partially reverts commit 1c29d263f624 ("drm/sun4i: Rename sun4i_backend_layer_formats to sun4i_layer_formats") by bringing back sun4i_backend_layer_formats, and passing it to drm_universal_plane_init, while also dropping the modifiers list, in the event no frontend is available.

Fixes b636d3f97d04 ("drm/sun4i: frontend: Add support for the BGRX8888 input format")
Fixes 9afe52d54bb0 ("drm/sun4i: frontend: Add support for semi-planar YUV input formats")
Fixes 8c8152bf4db6 ("drm/sun4i: frontend: Add support for planar YUV input formats")
Fixes b2ddf277ab5e ("drm/sun4i: layer: Add tiled modifier support and helper")
---
 drivers/gpu/drm/sun4i/sun4i_layer.c | 34 ++++++++++++++++++++++++++---
 1 file changed, 31 insertions(+), 3 deletions(-)
drivers/gpu/drm/sun4i/sun4i_layer.c +31 -3
index 95d4aaa51a5c..a514fe88d441 100644
@@ -117,6 +117,11 @@ static void sun4i_backend_layer_atomic_update(struct drm_plane *plane,
 static bool sun4i_layer_format_mod_supported(struct drm_plane *plane,
 					     uint32_t format, uint64_t modifier)
 {
+	struct sun4i_layer *layer = plane_to_sun4i_layer(plane);
+
+	if (IS_ERR_OR_NULL(layer->backend->frontend))
+		sun4i_backend_format_is_supported(format, modifier);
+
 	return sun4i_backend_format_is_supported(format, modifier) ||
 	       sun4i_frontend_format_is_supported(format, modifier);
 }
@@ -165,6 +170,21 @@ static const uint32_t sun4i_layer_formats[] = {
 	DRM_FORMAT_YVYU,
 };
 
+static const uint32_t sun4i_backend_layer_formats[] = {
+	DRM_FORMAT_ARGB8888,
+	DRM_FORMAT_ARGB4444,
+	DRM_FORMAT_ARGB1555,
+	DRM_FORMAT_RGBA5551,
+	DRM_FORMAT_RGBA4444,
+	DRM_FORMAT_RGB888,
+	DRM_FORMAT_RGB565,
+	DRM_FORMAT_UYVY,
+	DRM_FORMAT_VYUY,
+	DRM_FORMAT_XRGB8888,
+	DRM_FORMAT_YUYV,
+	DRM_FORMAT_YVYU,
+};
+
 static const uint64_t sun4i_layer_modifiers[] = {
 	DRM_FORMAT_MOD_LINEAR,
 	DRM_FORMAT_MOD_ALLWINNER_TILED,
@@ -175,6 +195,9 @@ static struct sun4i_layer *sun4i_layer_init_one(struct drm_device *drm,
 						struct sun4i_backend *backend,
 						enum drm_plane_type type)
 {
+	const uint64_t *modifiers = sun4i_layer_modifiers;
+	const uint32_t *formats = sun4i_layer_formats;
+	unsigned int formats_len = ARRAY_SIZE(sun4i_layer_formats);
 	struct sun4i_layer *layer;
 	int ret;
 
@@ -184,12 +207,17 @@ static struct sun4i_layer *sun4i_layer_init_one(struct drm_device *drm,
 
 	layer->backend = backend;
 
+	if (IS_ERR_OR_NULL(backend->frontend)) {
+		formats = sun4i_backend_layer_formats;
+		formats_len = ARRAY_SIZE(sun4i_backend_layer_formats);
+		modifiers = NULL;
+	}
+
 	/* possible crtcs are set later */
 	ret = drm_universal_plane_init(drm, &layer->plane, 0,
 				       &sun4i_backend_layer_funcs,
-				       sun4i_layer_formats,
-				       ARRAY_SIZE(sun4i_layer_formats),
-				       sun4i_layer_modifiers, type, NULL);
+				       formats, formats_len,
+				       modifiers, type, NULL);
 	if (ret) {
 		dev_err(drm->dev, "Couldn't initialize layer\n");
 		return ERR_PTR(ret);
Signature · 1 line
2.20.1
#7 lore raw

PATCH 6/11 drm/sun4i: Add support for A23 display pipeline

In reply to Chen-Yu Tsai

The A23's display pipeline is similar to the A33. Differences include:

- Display backend supports larger layers, 8192x8192 instead of 2048x2048

- TCON has DMA input

- There is no SAT module packed in the display backend

Add support for the display pipeline and its components.

As the MIPI DSI output device is not officially documented, and there are no A23 reference devices to test it, it is not covered by this patch.

---
 drivers/gpu/drm/sun4i/sun4i_backend.c  | 4 ++++
 drivers/gpu/drm/sun4i/sun4i_drv.c      | 2 ++
 drivers/gpu/drm/sun4i/sun4i_frontend.c | 4 ++++
 drivers/gpu/drm/sun4i/sun4i_tcon.c     | 1 +
 drivers/gpu/drm/sun4i/sun6i_drc.c      | 1 +
 5 files changed, 12 insertions(+)
drivers/gpu/drm/sun4i/sun4i_backend.c +4 -0
index 85e64d02fb5f..2ada915a877e 100644
@@ -1012,6 +1012,10 @@ static const struct of_device_id sun4i_backend_of_table[] = {
 		.compatible = "allwinner,sun7i-a20-display-backend",
 		.data = &sun7i_backend_quirks,
 	},
+	{
+		.compatible = "allwinner,sun8i-a23-display-backend",
+		.data = &sun8i_a33_backend_quirks,
+	},
 	{
 		.compatible = "allwinner,sun8i-a33-display-backend",
 		.data = &sun8i_a33_backend_quirks,
drivers/gpu/drm/sun4i/sun4i_drv.c +2 -0
index 93da837194cf..477957a865fb 100644
@@ -165,6 +165,7 @@ 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-a23-display-frontend") ||
 		of_device_is_compatible(node, "allwinner,sun8i-a33-display-frontend") ||
 		of_device_is_compatible(node, "allwinner,sun9i-a80-display-frontend");
 }
@@ -404,6 +405,7 @@ static const struct of_device_id sun4i_drv_of_table[] = {
 	{ .compatible = "allwinner,sun6i-a31-display-engine" },
 	{ .compatible = "allwinner,sun6i-a31s-display-engine" },
 	{ .compatible = "allwinner,sun7i-a20-display-engine" },
+	{ .compatible = "allwinner,sun8i-a23-display-engine" },
 	{ .compatible = "allwinner,sun8i-a33-display-engine" },
 	{ .compatible = "allwinner,sun8i-a83t-display-engine" },
 	{ .compatible = "allwinner,sun8i-h3-display-engine" },
drivers/gpu/drm/sun4i/sun4i_frontend.c +4 -0
index e8239d4d4dd5..346c8071bd38 100644
@@ -719,6 +719,10 @@ const struct of_device_id sun4i_frontend_of_table[] = {
 		.compatible = "allwinner,sun7i-a20-display-frontend",
 		.data = &sun4i_a10_frontend
 	},
+	{
+		.compatible = "allwinner,sun8i-a23-display-frontend",
+		.data = &sun8i_a33_frontend
+	},
 	{
 		.compatible = "allwinner,sun8i-a33-display-frontend",
 		.data = &sun8i_a33_frontend
drivers/gpu/drm/sun4i/sun4i_tcon.c +1 -0
index 0420f5c978b9..565955a46b0b 100644
@@ -1494,6 +1494,7 @@ const struct of_device_id sun4i_tcon_of_table[] = {
 	{ .compatible = "allwinner,sun6i-a31-tcon", .data = &sun6i_a31_quirks },
 	{ .compatible = "allwinner,sun6i-a31s-tcon", .data = &sun6i_a31s_quirks },
 	{ .compatible = "allwinner,sun7i-a20-tcon", .data = &sun7i_a20_quirks },
+	{ .compatible = "allwinner,sun8i-a23-tcon", .data = &sun8i_a33_quirks },
 	{ .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 },
drivers/gpu/drm/sun4i/sun6i_drc.c +1 -0
index 88eb268fdf73..442094a4af7a 100644
@@ -101,6 +101,7 @@ static int sun6i_drc_remove(struct platform_device *pdev)
 static const struct of_device_id sun6i_drc_of_table[] = {
 	{ .compatible = "allwinner,sun6i-a31-drc" },
 	{ .compatible = "allwinner,sun6i-a31s-drc" },
+	{ .compatible = "allwinner,sun8i-a23-drc" },
 	{ .compatible = "allwinner,sun8i-a33-drc" },
 	{ .compatible = "allwinner,sun9i-a80-drc" },
 	{ }
Signature · 1 line
2.20.1
#8 lore raw

PATCH 7/11 ARM: dts: sun8i-a23-a33: Move NAND controller device node to sort by address

In reply to Chen-Yu Tsai

The NAND controller device node was inserted into the wrong position, probably due to a rebase or merge, as the file's structure does not provide enough context for git to accurately match the previous device node block.

Fixes d7b843df13ea ("ARM: dts: sun8i: add NAND controller node for A23/A33")
---
 arch/arm/boot/dts/sun8i-a23-a33.dtsi | 28 +++++++++++++---------------
 1 file changed, 13 insertions(+), 15 deletions(-)
arch/arm/boot/dts/sun8i-a23-a33.dtsi +13 -15
index a9c123de5d2c..97ec8b8cec09 100644
@@ -155,6 +155,19 @@
 			#dma-cells = <1>;
 		};
 
+		nfc: nand@1c03000 {
+			compatible = "allwinner,sun4i-a10-nand";
+			reg = <0x01c03000 0x1000>;
+			interrupts = <GIC_SPI 70 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&ccu CLK_BUS_NAND>, <&ccu CLK_NAND>;
+			clock-names = "ahb", "mod";
+			resets = <&ccu RST_BUS_NAND>;
+			reset-names = "ahb";
+			status = "disabled";
+			#address-cells = <1>;
+			#size-cells = <0>;
+		};
+
 		mmc0: mmc@1c0f000 {
 			compatible = "allwinner,sun7i-a20-mmc";
 			reg = <0x01c0f000 0x1000>;
@@ -214,21 +227,6 @@
 			#size-cells = <0>;
 		};
 
-		nfc: nand@1c03000 {
-			compatible = "allwinner,sun4i-a10-nand";
-			reg = <0x01c03000 0x1000>;
-			interrupts = <GIC_SPI 70 IRQ_TYPE_LEVEL_HIGH>;
-			clocks = <&ccu CLK_BUS_NAND>, <&ccu CLK_NAND>;
-			clock-names = "ahb", "mod";
-			resets = <&ccu RST_BUS_NAND>;
-			reset-names = "ahb";
-			pinctrl-names = "default";
-			pinctrl-0 = <&nand_pins &nand_pins_cs0 &nand_pins_rb0>;
-			status = "disabled";
-			#address-cells = <1>;
-			#size-cells = <0>;
-		};
-
 		usb_otg: usb@1c19000 {
 			/* compatible gets set in SoC specific dtsi file */
 			reg = <0x01c19000 0x0400>;
Signature · 1 line
2.20.1
#9 lore raw

PATCH 8/11 ARM: dts: sun8i-a33: Move display pipeline nodes to a23/a33 common dtsi

In reply to Chen-Yu Tsai

The display pipeline has the same structure, resources and connections on both the A23 and A33. The differences include:

- compatible strings
- extra clock, reset control, and IO region for SAT in the backend only found on the A33
- missing ch1 clock for the TCON

However, while the A23 has the TCON ch1 clock defined in the CCU, and the channel 1 registers are available, it does not have any means to use channel 1 due to a lack of downstream encoders, and the enable bit for channel 1 is hard-wired to 0 (off).

As the MIPI DSI output device is not officially documented, and there are no A23 reference devices to test it, it is not covered by this patch.

---
 arch/arm/boot/dts/sun8i-a23-a33.dtsi | 147 ++++++++++++++++++++
 arch/arm/boot/dts/sun8i-a33.dtsi     | 194 ++++++---------------------
 2 files changed, 185 insertions(+), 156 deletions(-)
arch/arm/boot/dts/sun8i-a23-a33.dtsi +147 -0
index 97ec8b8cec09..43fe215e83ea 100644
@@ -68,6 +68,12 @@
 		};
 	};
 
+	de: display-engine {
+		/* compatible gets set in SoC specific dtsi file */
+		allwinner,pipelines = <&fe0>;
+		status = "disabled";
+	};
+
 	timer {
 		compatible = "arm,armv7-timer";
 		interrupts = <GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
@@ -168,6 +174,42 @@
 			#size-cells = <0>;
 		};
 
+		tcon0: lcd-controller@1c0c000 {
+			/* compatible gets set in SoC specific dtsi file */
+			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>;
+				};
+			};
+		};
+
 		mmc0: mmc@1c0f000 {
 			compatible = "allwinner,sun7i-a20-mmc";
 			reg = <0x01c0f000 0x1000>;
@@ -570,6 +612,111 @@
 			interrupts = <GIC_PPI 9 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_HIGH)>;
 		};
 
+		fe0: display-frontend@1e00000 {
+			/* compatible gets set in SoC specific dtsi file */
+			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>;
+
+			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@1e60000 {
+			/* compatible gets set in SoC specific dtsi file */
+			reg = <0x01e60000 0x10000>;
+			interrupts = <GIC_SPI 95 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&ccu CLK_BUS_DE_BE>, <&ccu CLK_DE_BE>,
+				 <&ccu CLK_DRAM_DE_BE>;
+			clock-names = "ahb", "mod",
+				      "ram";
+			resets = <&ccu RST_BUS_DE_BE>;
+
+			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@1e70000 {
+			/* compatible gets set in SoC specific dtsi file */
+			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>;
+					};
+				};
+			};
+		};
+
 		rtc: rtc@1f00000 {
 			compatible = "allwinner,sun8i-a23-rtc";
 			reg = <0x01f00000 0x400>;
arch/arm/boot/dts/sun8i-a33.dtsi +38 -156

228 lines not on this page · raw message

Signature · 1 line
2.20.1
#10 lore raw

PATCH 9/11 ARM: dts: sun8i-a23: Add compatible strings to display pipeline device nodes

In reply to Chen-Yu Tsai

Now that the compatible strings for the display pipeline on the A23 have been added to the bindings, add the corresponding compatibles to the device nodes already in the A23/A33 shared dtsi.

While the A23 has the TCON ch1 clock defined in the CCU, and the channel 1 registers are available, it does not have any means to use channel 1 due to a lack of downstream encoders, and the enable bit for channel 1 is hard-wired to 0 (off). Hence the ch1 clock is left out.

As the MIPI DSI output device is not officially documented, and there are no reference devices to test it, it is not covered by this patch.

---
 arch/arm/boot/dts/sun8i-a23.dtsi | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
arch/arm/boot/dts/sun8i-a23.dtsi +20 -0
index d00055e9eef5..a5e884a8b2ae 100644
@@ -62,10 +62,26 @@
 	};
 };
 
+&be0 {
+	compatible = "allwinner,sun8i-a23-display-backend";
+};
+
 &ccu {
 	compatible = "allwinner,sun8i-a23-ccu";
 };
 
+&de {
+	compatible = "allwinner,sun8i-a23-display-engine";
+};
+
+&drc0 {
+	compatible = "allwinner,sun8i-a23-drc";
+};
+
+&fe0 {
+	compatible = "allwinner,sun8i-a23-display-frontend";
+};
+
 &pio {
 	compatible = "allwinner,sun8i-a23-pinctrl";
 	interrupts = <GIC_SPI 11 IRQ_TYPE_LEVEL_HIGH>,
@@ -73,6 +89,10 @@
 		     <GIC_SPI 17 IRQ_TYPE_LEVEL_HIGH>;
 };
 
+&tcon0 {
+	compatible = "allwinner,sun8i-a23-tcon";
+};
+
 &usb_otg {
 	compatible = "allwinner,sun6i-a31-musb";
 };
Signature · 1 line
2.20.1
#11 lore raw

PATCH 10/11 ARM: dts: sun8i-q8-common: Enable display pipeline with RGB LCD panel

In reply to Chen-Yu Tsai

The Q8 design for A23/A33 tablets have an 18-bit RGB LCD panel connected to the LCD interface on the SoC, the DC1SW output on the PMIC providing power for the LCD, and PH7 toggling the reset pin for the panel.

This patch adds a device node for the panel, describing the above, and enables the display pipeline.

The actual model or compatible string for the panel should be added in the tablet device tree file.

---
 arch/arm/boot/dts/sun8i-q8-common.dtsi | 37 ++++++++++++++++++++++++++
 1 file changed, 37 insertions(+)
arch/arm/boot/dts/sun8i-q8-common.dtsi +37 -0
index 719ad769b837..53104f4ccacc 100644
@@ -49,6 +49,26 @@
 		ethernet0 = &sdio_wifi;
 	};
 
+	panel: panel {
+		/* Tablet dts should provide panel compatible */
+		backlight = <&backlight>;
+		enable-gpios = <&pio 7 7 GPIO_ACTIVE_HIGH>; /* PH7 */
+		power-supply = <&reg_dc1sw>;
+		#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_lcd>;
+			};
+		};
+	};
+
 	wifi_pwrseq: wifi_pwrseq {
 		compatible = "mmc-pwrseq-simple";
 		/*
@@ -64,6 +84,10 @@
 	};
 };
 
+&de {
+	status = "okay";
+};
+
 &ehci0 {
 	status  = "okay";
 };
@@ -90,6 +114,19 @@
 	};
 };
 
+&tcon0 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&lcd_rgb666_pins>;
+	status = "okay";
+};
+
+&tcon0_out {
+	tcon0_out_lcd: endpoint@0 {
+		reg = <0>;
+		remote-endpoint = <&panel_input>;
+	};
+};
+
 &usbphy {
 	usb1_vbus-supply = <&reg_dldo1>;
 };
Signature · 1 line
2.20.1
#12 lore raw

PATCH 11/11 ARM: dts: sun8i-a23-q8: Set compatible string for LCD panel

In reply to Chen-Yu Tsai

The Q8 tablets follow the A23/A33 tablet reference design, and normally use a "generic" 800x480 LCD panel. The actual panel may vary between production runs, and there are no visible markings denoting its model. This patch uses a panel that has the same dimensions and timings that are close to what was provided in the vendor fex files.

Since there are also A33 Q8 tablets with 1024x600 panels, this patch only sets the compatible string for A23 Q8 tablets.

---
 arch/arm/boot/dts/sun8i-a23-q8-tablet.dts | 4 ++++
 1 file changed, 4 insertions(+)
arch/arm/boot/dts/sun8i-a23-q8-tablet.dts +4 -0
index b6958e8f2f01..d4dab7c28398 100644
@@ -61,3 +61,7 @@
 		"Headset Mic", "HBIAS";
 	status = "okay";
 };
+
+&panel {
+	compatible = "bananapi,s070wv20-ct16", "simple-panel";
+};
Signature · 1 line
2.20.1
#13 lore raw
In reply to Chen-Yu Tsai
Quoted 41 lines · Chen-Yu Tsai

Hi everyone,

This series enables the display pipeline on the Allwinner A23 SoC. A few fixes are included for corner cases when the frontend isn't enabled.

The A23 display pipeline is very much the same as the A33, except that the A23 does not have the SAT IP block embedded within the display backend.

MIPI DSI is not covered as I do not have a device that uses it.

Patch 1 fixes the pll-mipi clock on the A23.

Patch 2 adds compatible strings for the various hardware blocks of the A23 display pipeline.

Patch 3 through 5 fix some issues in our DRM plane support, namely declaring support for formats when we shouldn't.

Patch 6 adds support for the A23 display pipeline to the driver.

Patch 7 is a small cleanup before moving the display pipeline device nodes.

Patch 8 moves the display nodes from the A33-specific dtsi file to the A23-A33 shared dtsi file. Note that the MIPI DSI device nodes are not moved.

Patch 9 adds compatible strings to the display nodes in the A23-specific dtsi file.

Patch 10 enables the display pipeline for the shared A23/A33 Q8 tablet dtsi file. The compatible string should be filled in by the tablet dts files.

Patch 11 fills in the compatible string for the standard A23 Q8 tablet. Note the compatible string is not for the specific model used in the tablet, as it varies between production runs. Rather it is just one that works.

Quoted 6 lines

Please have a look. Patch 3 might be worth applying as a fix, but might not be worth the trouble. It could just as easily be applied for -next and then backported.

Also, the fixes tags are no longer line wrapped, unlike patches I've sent in the past.

Applied all, thanks!
Maxime

Signature · 3 lines
Maxime Ripard, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
Reviewed-by on v1 1/11
#2 lore raw

Re: [PATCH 01/11] clk: sunxi-ng: sun8i-a23: Enable PLL-MIPI LDOs when ungating it

In reply to Chen-Yu Tsai
Quoted 18 lines · Chen-Yu Tsai

The PLL-MIPI clock is somewhat special as it has its own LDOs which need to be turned on for this PLL to actually work and output a clock signal.

Add the 2 LDO enable bits to the gate bits.

Fixes 5690879d93e8 ("clk: sunxi-ng: Add A23 CCU")
---
 drivers/clk/sunxi-ng/ccu-sun8i-a23.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clk/sunxi-ng/ccu-sun8i-a23.c +0 -0
index a4fa2945f230..4b5f8f4e4ab8 100644

drivers/clk/sunxi-ng/ccu-sun8i-a23.c static SUNXI_CCU_NKM_WITH_GATE_LOCK(pll_mipi_clk, "pll-mipi", · line 147

Quoted 5 lines
drivers/clk/sunxi-ng/ccu-sun8i-a23.c +1 -1
@@ -144,7 +144,7 @@ static SUNXI_CCU_NKM_WITH_GATE_LOCK(pll_mipi_clk, "pll-mipi",
                                    8, 4,               /* N */
                                    4, 2,               /* K */
                                    0, 4,               /* M */
-                                   BIT(31),            /* gate */
+                                   BIT(31) | BIT(23) | BIT(22), /* gate */