PATCH V6 2021-11-10 20:43:33:
- changed CONFIG_DRM_INGENIC_DW_HDMI to "m" (by [email protected])
- made ingenic-dw-hdmi an independent platform driver which can be compiled as module
and removed error patch fixes for IPU (suggested by [email protected])
- moved assigned-clocks from jz4780.dtsi to ci20.dts (suggested by [email protected])
- fixed reg property in jz4780.dtsi to cover all registers incl. gamma and vee (by [email protected])
- added a base patch to calculate regmap size from DTS reg property (requested by [email protected])
- restored resetting all bits except one in LCDOSDC (requested by [email protected])
- clarified setting of cpos (suggested by [email protected])
- moved bindings definition for ddc-i2c-bus (suggested by [email protected])
- simplified mask definitions for JZ_LCD_DESSIZE (requested by [email protected])
- removed setting alpha premultiplication (suggested by [email protected])
- removed some comments (suggested by [email protected])
PATCH V5 2021-10-05 14:28:44:
- dropped mode_fixup and timings support in dw-hdmi as it is no longer needed in this V5 (by [email protected])
- dropped "drm/ingenic: add some jz4780 specific features" (stimulated by [email protected])
- fixed typo in commit subject: "synopsis" -> "synopsys" (by [email protected])
- swapped clocks in jz4780.dtsi to match synopsys,dw-hdmi.yaml (by [email protected])
- improved, simplified, fixed, dtbschecked ingenic-jz4780-hdmi.yaml and made dependent of bridge/synopsys,dw-hdmi.yaml (based on suggestions by [email protected])
- fixed binding vs. driver&DTS use of hdmi-5v regulator (suggested by [email protected])
- dropped "drm/bridge: synopsis: Fix to properly handle HPD" - was a no longer needed workaround for a previous version
(suggested by [email protected])
PATCH V4 2021-09-27 18:44:38:
- fix setting output_port = 1 (issue found by [email protected])
- ci20.dts: convert to use hdmi-connector (by [email protected])
- add a hdmi-regulator to control +5V power (by [email protected])
- added a fix to dw-hdmi to call drm_kms_helper_hotplug_event on plugin event detection (by [email protected])
- always allocate extended descriptor but initialize only for jz4780 (by [email protected])
- updated to work on top of "[PATCH v3 0/6] drm/ingenic: Various improvements v3" (by [email protected])
- rebased to v5.13-rc3
PATCH V3 2021-08-08 07:10:50:
This series adds HDMI support for JZ4780 and CI20 board (and fixes one IPU related issue in registration error path)
- [patch 1/8] switched from mode_fixup to atomic_check (suggested by [email protected])
- the call to the dw-hdmi specialization is still called mode_fixup
- [patch 3/8] diverse fixes for ingenic-drm-drv (suggested by [email protected])
- factor out some non-HDMI features of the jz4780 into a separate patch
- multiple fixes around max height
- do not change regmap config but a copy on stack
- define some constants
- factor out fixing of drm_init error path for IPU into separate patch
- use FIELD_PREP()
- [patch 8/8] conversion to component framework dropped (suggested by [email protected] and [email protected])
PATCH V2 2021-08-05 16:08:05:
- code and commit messages revisited for checkpatch warnings
- rebased on v5.14-rc4
- include (failed, hence RFC 8/8) attempt to convert to component framework
(was suggested by Paul Cercueil <[email protected]> a while ago)
This series adds HDMI support for JZ4780 and CI20 board
H. Nikolaus Schaller (3):
drm/ingenic: prepare ingenic drm for later addition of JZ4780
MIPS: defconfig: CI20: configure for DRM_DW_HDMI_JZ4780
[RFC] MIPS: DTS: Ingenic: adjust register size to available registers
Paul Boddie (4):
drm/ingenic: Add support for JZ4780 and HDMI output
drm/ingenic: Add dw-hdmi driver for jz4780
MIPS: DTS: jz4780: Account for Synopsys HDMI driver and LCD
controllers
MIPS: DTS: CI20: Add DT nodes for HDMI setup
Sam Ravnborg (1):
dt-bindings: display: Add ingenic,jz4780-dw-hdmi DT Schema
.../display/bridge/synopsys,dw-hdmi.yaml | 3 +
.../bindings/display/ingenic-jz4780-hdmi.yaml | 76 +++++++++++
arch/mips/boot/dts/ingenic/ci20.dts | 73 +++++++++-
arch/mips/boot/dts/ingenic/jz4725b.dtsi | 2 +-
arch/mips/boot/dts/ingenic/jz4740.dtsi | 2 +-
arch/mips/boot/dts/ingenic/jz4770.dtsi | 2 +-
arch/mips/boot/dts/ingenic/jz4780.dtsi | 40 ++++++
arch/mips/configs/ci20_defconfig | 6 +
drivers/gpu/drm/ingenic/Kconfig | 9 ++
drivers/gpu/drm/ingenic/Makefile | 1 +
drivers/gpu/drm/ingenic/ingenic-drm-drv.c | 62 ++++++++-
drivers/gpu/drm/ingenic/ingenic-drm.h | 38 ++++++
drivers/gpu/drm/ingenic/ingenic-dw-hdmi.c | 129 ++++++++++++++++++
13 files changed, 434 insertions(+), 9 deletions(-)
create mode 100644 Documentation/devicetree/bindings/display/ingenic-jz4780-hdmi.yaml
create mode 100644 drivers/gpu/drm/ingenic/ingenic-dw-hdmi.c
--
2.33.0
From: Paul Boddie <[email protected]>
We need to hook up
* HDMI connector
* HDMI power regulator
* JZ4780_CLK_HDMI @ 27 MHz
* DDC pinmux
* HDMI and LCDC endpoint connections
Signed-off-by: Paul Boddie <[email protected]>
Signed-off-by: H. Nikolaus Schaller <[email protected]>
---
arch/mips/boot/dts/ingenic/ci20.dts | 73 +++++++++++++++++++++++++++--
1 file changed, 70 insertions(+), 3 deletions(-)
diff --git a/arch/mips/boot/dts/ingenic/ci20.dts b/arch/mips/boot/dts/ingenic/ci20.dts
index a688809beebca..a62557bede565 100644
--- a/arch/mips/boot/dts/ingenic/ci20.dts
+++ b/arch/mips/boot/dts/ingenic/ci20.dts
@@ -78,6 +78,18 @@ eth0_power: fixedregulator@0 {
enable-active-high;
};
+ hdmi_out: connector {
+ compatible = "hdmi-connector";
+ label = "HDMI OUT";
+ type = "a";
+
+ port {
+ hdmi_con: endpoint {
+ remote-endpoint = <&dw_hdmi_out>;
+ };
+ };
+ };
+
ir: ir {
compatible = "gpio-ir-receiver";
gpios = <&gpe 3 GPIO_ACTIVE_LOW>;
@@ -102,6 +114,17 @@ otg_power: fixedregulator@2 {
gpio = <&gpf 14 GPIO_ACTIVE_LOW>;
enable-active-high;
};
+
+ hdmi_power: fixedregulator@3 {
+ compatible = "regulator-fixed";
+
+ regulator-name = "hdmi_power";
+ regulator-min-microvolt = <5000000>;
+ regulator-max-microvolt = <5000000>;
+
+ gpio = <&gpa 25 GPIO_ACTIVE_LOW>;
+ enable-active-high;
+ };
};
&ext {
@@ -113,9 +136,9 @@ &cgu {
* Use the 32.768 kHz oscillator as the parent of the RTC for a higher
* precision.
*/
- assigned-clocks = <&cgu JZ4780_CLK_OTGPHY>, <&cgu JZ4780_CLK_RTC>;
- assigned-clock-parents = <0>, <&cgu JZ4780_CLK_RTCLK>;
- assigned-clock-rates = <48000000>;
+ assigned-clocks = <&cgu JZ4780_CLK_OTGPHY>, <&cgu JZ4780_CLK_RTC>, <&cgu JZ4780_CLK_HDMI>;
+ assigned-clock-parents = <0>, <&cgu JZ4780_CLK_RTCLK>, <0>;
+ assigned-clock-rates = <48000000>, <0>, <27000000>;
};
&tcu {
@@ -506,6 +529,12 @@ pins_i2c4: i2c4 {
bias-disable;
};
+ pins_hdmi_ddc: hdmi_ddc {
+ function = "hdmi-ddc";
+ groups = "hdmi-ddc";
+ bias-disable;
+ };
+
pins_nemc: nemc {
function = "nemc";
groups = "nemc-data", "nemc-cle-ale", "nemc-rd-we", "nemc-frd-fwe";
@@ -536,3 +565,41 @@ pins_mmc1: mmc1 {
bias-disable;
};
};
+
+&hdmi {
+ status = "okay";
+
+ pinctrl-names = "default";
+ pinctrl-0 = <&pins_hdmi_ddc>;
+
+ hdmi-5v-supply = <&hdmi_power>;
+
+ ports {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ port@0 {
+ reg = <0>;
+ dw_hdmi_in: endpoint {
+ remote-endpoint = <&lcd_out>;
+ };
+ };
+
+ port@1 {
+ reg = <1>;
+ dw_hdmi_out: endpoint {
+ remote-endpoint = <&hdmi_con>;
+ };
+ };
+ };
+};
+
+&lcdc0 {
+ status = "okay";
+
+ port {
+ lcd_out: endpoint {
+ remote-endpoint = <&dw_hdmi_in>;
+ };
+ };
+};
--
2.33.0
From: Paul Boddie <[email protected]>
A specialisation of the generic Synopsys HDMI driver is employed for JZ4780
HDMI support. This requires a new driver, plus device tree and configuration
modifications.
Signed-off-by: Paul Boddie <[email protected]>
Signed-off-by: H. Nikolaus Schaller <[email protected]>
---
arch/mips/boot/dts/ingenic/jz4780.dtsi | 40 ++++++++++++++++++++++++++
1 file changed, 40 insertions(+)
diff --git a/arch/mips/boot/dts/ingenic/jz4780.dtsi b/arch/mips/boot/dts/ingenic/jz4780.dtsi
index 9e34f433b9b58..98cc3360bbbb9 100644
--- a/arch/mips/boot/dts/ingenic/jz4780.dtsi
+++ b/arch/mips/boot/dts/ingenic/jz4780.dtsi
@@ -424,6 +424,46 @@ i2c4: i2c@10054000 {
status = "disabled";
};
+ hdmi: hdmi@10180000 {
+ compatible = "ingenic,jz4780-dw-hdmi";
+ reg = <0x10180000 0x8000>;
+ reg-io-width = <4>;
+
+ clocks = <&cgu JZ4780_CLK_AHB0>, <&cgu JZ4780_CLK_HDMI>;
+ clock-names = "iahb", "isfr";
+
+ interrupt-parent = <&intc>;
+ interrupts = <3>;
+
+ status = "disabled";
+ };
+
+ lcdc0: lcdc0@13050000 {
+ compatible = "ingenic,jz4780-lcd";
+ reg = <0x13050000 0x1800>;
+
+ clocks = <&cgu JZ4780_CLK_TVE>, <&cgu JZ4780_CLK_LCD0PIXCLK>;
+ clock-names = "lcd", "lcd_pclk";
+
+ interrupt-parent = <&intc>;
+ interrupts = <31>;
+
+ status = "disabled";
+ };
+
+ lcdc1: lcdc1@130a0000 {
+ compatible = "ingenic,jz4780-lcd";
+ reg = <0x130a0000 0x1800>;
+
+ clocks = <&cgu JZ4780_CLK_TVE>, <&cgu JZ4780_CLK_LCD1PIXCLK>;
+ clock-names = "lcd", "lcd_pclk";
+
+ interrupt-parent = <&intc>;
+ interrupts = <31>;
+
+ status = "disabled";
+ };
+
nemc: nemc@13410000 {
compatible = "ingenic,jz4780-nemc", "simple-mfd";
reg = <0x13410000 0x10000>;
--
2.33.0
Enable CONFIG options as modules.
Signed-off-by: Ezequiel Garcia <[email protected]>
Signed-off-by: H. Nikolaus Schaller <[email protected]>
---
arch/mips/configs/ci20_defconfig | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/arch/mips/configs/ci20_defconfig b/arch/mips/configs/ci20_defconfig
index ab7ebb0668340..cc69b215854ea 100644
--- a/arch/mips/configs/ci20_defconfig
+++ b/arch/mips/configs/ci20_defconfig
@@ -98,7 +98,13 @@ CONFIG_RC_DEVICES=y
CONFIG_IR_GPIO_CIR=m
CONFIG_IR_GPIO_TX=m
CONFIG_MEDIA_SUPPORT=m
+CONFIG_DRM=m
+CONFIG_DRM_INGENIC=m
+CONFIG_DRM_INGENIC_DW_HDMI=m
+CONFIG_DRM_DISPLAY_CONNECTOR=m
# CONFIG_VGA_CONSOLE is not set
+CONFIG_FB=y
+CONFIG_FRAMEBUFFER_CONSOLE=y
# CONFIG_HID is not set
CONFIG_USB=y
CONFIG_USB_STORAGE=y
--
2.33.0
After getting the regmap size from the device tree we should
reduce the ranges to the really available registers. This
allows to read only existing registers from the debug fs
and makes the regmap check out-of-bounds access.
For the jz4780 we have done this already.
Suggested-for: Paul Cercueil <[email protected]>
Signed-off-by: H. Nikolaus Schaller <[email protected]>
---
arch/mips/boot/dts/ingenic/jz4725b.dtsi | 2 +-
arch/mips/boot/dts/ingenic/jz4740.dtsi | 2 +-
arch/mips/boot/dts/ingenic/jz4770.dtsi | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/mips/boot/dts/ingenic/jz4725b.dtsi b/arch/mips/boot/dts/ingenic/jz4725b.dtsi
index a1f0b71c92237..7f6cbde43f89e 100644
--- a/arch/mips/boot/dts/ingenic/jz4725b.dtsi
+++ b/arch/mips/boot/dts/ingenic/jz4725b.dtsi
@@ -321,7 +321,7 @@ udc: usb@13040000 {
lcd: lcd-controller@13050000 {
compatible = "ingenic,jz4725b-lcd";
- reg = <0x13050000 0x1000>;
+ reg = <0x13050000 0x130>; /* tbc */
interrupt-parent = <&intc>;
interrupts = <31>;
diff --git a/arch/mips/boot/dts/ingenic/jz4740.dtsi b/arch/mips/boot/dts/ingenic/jz4740.dtsi
index c1afdfdaa8a38..0126e4cf19507 100644
--- a/arch/mips/boot/dts/ingenic/jz4740.dtsi
+++ b/arch/mips/boot/dts/ingenic/jz4740.dtsi
@@ -323,7 +323,7 @@ udc: usb@13040000 {
lcd: lcd-controller@13050000 {
compatible = "ingenic,jz4740-lcd";
- reg = <0x13050000 0x1000>;
+ reg = <0x13050000 0x60>; /* LCDCMD1+4 */
interrupt-parent = <&intc>;
interrupts = <30>;
diff --git a/arch/mips/boot/dts/ingenic/jz4770.dtsi b/arch/mips/boot/dts/ingenic/jz4770.dtsi
index 05c00b93088e9..4f85abab68d50 100644
--- a/arch/mips/boot/dts/ingenic/jz4770.dtsi
+++ b/arch/mips/boot/dts/ingenic/jz4770.dtsi
@@ -399,7 +399,7 @@ gpu: gpu@13040000 {
lcd: lcd-controller@13050000 {
compatible = "ingenic,jz4770-lcd";
- reg = <0x13050000 0x300>;
+ reg = <0x13050000 0x130>; /* tbc */
interrupt-parent = <&intc>;
interrupts = <31>;
--
2.33.0
Hi Nikolaus, Thomas,
Le mer., nov. 10 2021 at 20:43:31 +0100, H. Nikolaus Schaller
<[email protected]> a ?crit :
> From: Paul Boddie <[email protected]>
>
> We need to hook up
> * HDMI connector
> * HDMI power regulator
> * JZ4780_CLK_HDMI @ 27 MHz
> * DDC pinmux
> * HDMI and LCDC endpoint connections
>
> Signed-off-by: Paul Boddie <[email protected]>
> Signed-off-by: H. Nikolaus Schaller <[email protected]>
> ---
> arch/mips/boot/dts/ingenic/ci20.dts | 73
> +++++++++++++++++++++++++++--
> 1 file changed, 70 insertions(+), 3 deletions(-)
>
> diff --git a/arch/mips/boot/dts/ingenic/ci20.dts
> b/arch/mips/boot/dts/ingenic/ci20.dts
> index a688809beebca..a62557bede565 100644
> --- a/arch/mips/boot/dts/ingenic/ci20.dts
> +++ b/arch/mips/boot/dts/ingenic/ci20.dts
> @@ -78,6 +78,18 @@ eth0_power: fixedregulator@0 {
> enable-active-high;
> };
>
> + hdmi_out: connector {
> + compatible = "hdmi-connector";
> + label = "HDMI OUT";
> + type = "a";
> +
> + port {
> + hdmi_con: endpoint {
> + remote-endpoint = <&dw_hdmi_out>;
> + };
> + };
> + };
> +
> ir: ir {
> compatible = "gpio-ir-receiver";
> gpios = <&gpe 3 GPIO_ACTIVE_LOW>;
> @@ -102,6 +114,17 @@ otg_power: fixedregulator@2 {
> gpio = <&gpf 14 GPIO_ACTIVE_LOW>;
> enable-active-high;
> };
> +
> + hdmi_power: fixedregulator@3 {
> + compatible = "regulator-fixed";
> +
> + regulator-name = "hdmi_power";
> + regulator-min-microvolt = <5000000>;
> + regulator-max-microvolt = <5000000>;
> +
> + gpio = <&gpa 25 GPIO_ACTIVE_LOW>;
Just use 0 instead of GPIO_ACTIVE_LOW, since the flag is simply ignored
(I know the other regulators do use it, but I'll clean that up soon).
> + enable-active-high;
> + };
> };
>
> &ext {
> @@ -113,9 +136,9 @@ &cgu {
> * Use the 32.768 kHz oscillator as the parent of the RTC for a
> higher
> * precision.
> */
> - assigned-clocks = <&cgu JZ4780_CLK_OTGPHY>, <&cgu JZ4780_CLK_RTC>;
> - assigned-clock-parents = <0>, <&cgu JZ4780_CLK_RTCLK>;
> - assigned-clock-rates = <48000000>;
> + assigned-clocks = <&cgu JZ4780_CLK_OTGPHY>, <&cgu JZ4780_CLK_RTC>,
> <&cgu JZ4780_CLK_HDMI>;
> + assigned-clock-parents = <0>, <&cgu JZ4780_CLK_RTCLK>, <0>;
> + assigned-clock-rates = <48000000>, <0>, <27000000>;
So drm-misc-next is based on a slightly older version (not v5.16-rc1
yet), and these lines changed in linux master.
I think it would make sense to merge the DT changes (+ doc) into the
MIPS tree, and the driver changes into drm-misc-next.
@Thomas: Is that OK for you?
Cheers,
-Paul
> };
>
> &tcu {
> @@ -506,6 +529,12 @@ pins_i2c4: i2c4 {
> bias-disable;
> };
>
> + pins_hdmi_ddc: hdmi_ddc {
> + function = "hdmi-ddc";
> + groups = "hdmi-ddc";
> + bias-disable;
> + };
> +
> pins_nemc: nemc {
> function = "nemc";
> groups = "nemc-data", "nemc-cle-ale", "nemc-rd-we", "nemc-frd-fwe";
> @@ -536,3 +565,41 @@ pins_mmc1: mmc1 {
> bias-disable;
> };
> };
> +
> +&hdmi {
> + status = "okay";
> +
> + pinctrl-names = "default";
> + pinctrl-0 = <&pins_hdmi_ddc>;
> +
> + hdmi-5v-supply = <&hdmi_power>;
> +
> + ports {
> + #address-cells = <1>;
> + #size-cells = <0>;
> +
> + port@0 {
> + reg = <0>;
> + dw_hdmi_in: endpoint {
> + remote-endpoint = <&lcd_out>;
> + };
> + };
> +
> + port@1 {
> + reg = <1>;
> + dw_hdmi_out: endpoint {
> + remote-endpoint = <&hdmi_con>;
> + };
> + };
> + };
> +};
> +
> +&lcdc0 {
> + status = "okay";
> +
> + port {
> + lcd_out: endpoint {
> + remote-endpoint = <&dw_hdmi_in>;
> + };
> + };
> +};
> --
> 2.33.0
>
Hi Nikolaus,
Le mer., nov. 10 2021 at 20:43:30 +0100, H. Nikolaus Schaller
<[email protected]> a ?crit :
> From: Paul Boddie <[email protected]>
>
> A specialisation of the generic Synopsys HDMI driver is employed for
> JZ4780
> HDMI support. This requires a new driver, plus device tree and
> configuration
> modifications.
>
> Signed-off-by: Paul Boddie <[email protected]>
> Signed-off-by: H. Nikolaus Schaller <[email protected]>
> ---
> arch/mips/boot/dts/ingenic/jz4780.dtsi | 40
> ++++++++++++++++++++++++++
> 1 file changed, 40 insertions(+)
>
> diff --git a/arch/mips/boot/dts/ingenic/jz4780.dtsi
> b/arch/mips/boot/dts/ingenic/jz4780.dtsi
> index 9e34f433b9b58..98cc3360bbbb9 100644
> --- a/arch/mips/boot/dts/ingenic/jz4780.dtsi
> +++ b/arch/mips/boot/dts/ingenic/jz4780.dtsi
> @@ -424,6 +424,46 @@ i2c4: i2c@10054000 {
> status = "disabled";
> };
>
> + hdmi: hdmi@10180000 {
> + compatible = "ingenic,jz4780-dw-hdmi";
> + reg = <0x10180000 0x8000>;
> + reg-io-width = <4>;
> +
> + clocks = <&cgu JZ4780_CLK_AHB0>, <&cgu JZ4780_CLK_HDMI>;
> + clock-names = "iahb", "isfr";
> +
> + interrupt-parent = <&intc>;
> + interrupts = <3>;
> +
> + status = "disabled";
> + };
> +
> + lcdc0: lcdc0@13050000 {
> + compatible = "ingenic,jz4780-lcd";
> + reg = <0x13050000 0x1800>;
> +
> + clocks = <&cgu JZ4780_CLK_TVE>, <&cgu JZ4780_CLK_LCD0PIXCLK>;
> + clock-names = "lcd", "lcd_pclk";
> +
> + interrupt-parent = <&intc>;
> + interrupts = <31>;
> +
> + status = "disabled";
> + };
> +
> + lcdc1: lcdc1@130a0000 {
> + compatible = "ingenic,jz4780-lcd";
> + reg = <0x130a0000 0x1800>;
> +
> + clocks = <&cgu JZ4780_CLK_TVE>, <&cgu JZ4780_CLK_LCD1PIXCLK>;
> + clock-names = "lcd", "lcd_pclk";
> +
> + interrupt-parent = <&intc>;
> + interrupts = <31>;
You have the two LCD controllers wired to the same interrupt, that
can't be right.
From what I can read in the PM the LCD1 IRQ is number 23.
Cheers,
-Paul
> +
> + status = "disabled";
> + };
> +
> nemc: nemc@13410000 {
> compatible = "ingenic,jz4780-nemc", "simple-mfd";
> reg = <0x13410000 0x10000>;
> --
> 2.33.0
>