MIPS: JZ4780 and CI20 HDMI
Subsystems (6)
v6 cover MIPS: JZ4780 and CI20 HDMI
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
Signature · 1 line
2.33.0
PATCH v6 1/8 drm/ingenic: prepare ingenic drm for later addition of JZ4780
This changes the way the regmap is allocated to prepare for the later addition of the JZ4780 which has more registers and bits than the others.
Therefore we make the regmap as big as the reg property in the device tree tells.
--- drivers/gpu/drm/ingenic/ingenic-drm-drv.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
drivers/gpu/drm/ingenic/ingenic-drm-drv.c +6 -3
@@ -173,7 +173,6 @@ static const struct regmap_config ingenic_drm_regmap_config = { .val_bits = 32, .reg_stride = 4, - .max_register = JZ_REG_LCD_SIZE1, .writeable_reg = ingenic_drm_writeable_reg, };
@@ -1011,6 +1010,8 @@ static int ingenic_drm_bind(struct device *dev, bool has_components)struct ingenic_drm_bridge *ib;struct drm_device *drm;void __iomem *base; +struct resource *res; +struct regmap_config regmap_config;long parent_rate;unsigned int i, clone_mask =0 ;int ret, irq;
@@ -1056,14 +1057,16 @@ static int ingenic_drm_bind(struct device *dev, bool has_components) drm->mode_config.funcs = &ingenic_drm_mode_config_funcs; drm->mode_config.helper_private = &ingenic_drm_mode_config_helpers; - base =devm_platform_ioremap_resource (pdev,0 ); + base =devm_platform_get_and_ioremap_resource (pdev,0 , &res);if (IS_ERR (base)) {dev_err (dev,"Failed to get memory resource\n" );return PTR_ERR (base); } + regmap_config = ingenic_drm_regmap_config; + regmap_config.max_register = res->end - res->start -4 ; priv->map =devm_regmap_init_mmio (dev, base, - &ingenic_drm_regmap_config); + ®map_config);if (IS_ERR (priv->map)) {dev_err (dev,"Failed to create regmap\n" );return PTR_ERR (priv->map);
Signature · 1 line
2.33.0
Paul Cercueil
maintainerRe: [PATCH v6 1/8] drm/ingenic: prepare ingenic drm for later addition of JZ4780
Hi Nikolaus,
I will look at the patches in depth in the coming days.
Quoted 40 lines · H. Nikolaus Schaller
This changes the way the regmap is allocated to prepare for the later addition of the JZ4780 which has more registers and bits than the others.
Therefore we make the regmap as big as the reg property in the device tree tells.
Suggested-by Paul Cercueil <[email protected]>Signed-off-by H. Nikolaus Schaller <[email protected]>--- drivers/gpu/drm/ingenic/ingenic-drm-drv.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)drivers/gpu/drm/ingenic/ingenic-drm-drv.c +2
-1@@ -173,7 +173,6 @@ static const struct regmap_config ingenic_drm_regmap_config = { .val_bits = 32, .reg_stride = 4, - .max_register = JZ_REG_LCD_SIZE1, .writeable_reg = ingenic_drm_writeable_reg, };@@ -1011,6 +1010,8 @@ static int ingenic_drm_bind(struct device *dev, bool has_components)struct ingenic_drm_bridge *ib;struct drm_device *drm;void __iomem *base; +struct resource *res; +struct regmap_config regmap_config;long parent_rate;unsigned int i, clone_mask =0 ;drivers/gpu/drm/ingenic/ingenic-drm-drv.c +0
-0int ret, irq;@@ -1056,14 +1057,16 @@ static int ingenic_drm_bind(struct device *dev, bool has_components) drm->mode_config.funcs = &ingenic_drm_mode_config_funcs; drm->mode_config.helper_private = &ingenic_drm_mode_config_helpers;
drivers/gpu/drm/ingenic/ingenic-drm-drv.c static int ingenic_drm_bind(struct device · line 1068
Quoted 10 lines
drivers/gpu/drm/ingenic/ingenic-drm-drv.c +3
-1- base =devm_platform_ioremap_resource (pdev,0 ); + base =devm_platform_get_and_ioremap_resource (pdev,0 , &res);if (IS_ERR (base)) {dev_err (dev,"Failed to get memory resource\n" );return PTR_ERR (base); } + regmap_config = ingenic_drm_regmap_config; + regmap_config.max_register = res->end - res->start -4 ;
Just a quick feedback here: I just tested and it's actually just (res->end - res->start), otherwise the last register of the memory area set in DT is inaccessible.
Cheers,
-Paul
Quoted 9 lines
drivers/gpu/drm/ingenic/ingenic-drm-drv.c +1
-1priv->map =devm_regmap_init_mmio (dev, base, - &ingenic_drm_regmap_config); + ®map_config);if (IS_ERR (priv->map)) {dev_err (dev,"Failed to create regmap\n" );return
PTR_ERR(priv->map);
--
2.33.0
PATCH v6 2/8 drm/ingenic: Add support for JZ4780 and HDMI output
In reply to H. Nikolaus SchallerFrom: Paul Boddie <[email protected]>
Add support for the LCD controller present on JZ4780 SoCs. This SoC uses 8-byte descriptors which extend the current 4-byte descriptors used for other Ingenic SoCs.
Tested on MIPS Creator CI20 board.
--- drivers/gpu/drm/ingenic/ingenic-drm-drv.c | 53 +++++++++++++++++++++++ drivers/gpu/drm/ingenic/ingenic-drm.h | 38 ++++++++++++++++ 2 files changed, 91 insertions(+)
drivers/gpu/drm/ingenic/ingenic-drm-drv.c +53 -0
@@ -6,6 +6,7 @@#include "ingenic-drm.h" +#include <linux/bitfield.h> #include <linux/component.h> #include <linux/clk.h> #include <linux/dma-mapping.h>
@@ -49,6 +50,11 @@ struct ingenic_dma_hwdesc {u32 addr;u32 id;u32 cmd; +/* extended hw descriptor for jz4780 */ +u32 offsize; +u32 pagewidth; +u32 cpos; +u32 dessize; }__aligned(16) ;struct ingenic_dma_hwdescs {
@@ -60,6 +66,7 @@ struct jz_soc_info {bool needs_dev_clk;bool has_osd;bool map_noncoherent; +bool use_extended_hwdesc;unsigned int max_width, max_height;const u32 *formats_f0, *formats_f1;unsigned int num_formats_f0, num_formats_f1;
@@ -446,6 +453,9 @@ static int ingenic_drm_plane_atomic_check(struct drm_plane *plane,if (!crtc)return 0 ; +if (plane == &priv->f0) +return -EINVAL ; + crtc_state =drm_atomic_get_existing_crtc_state (state, crtc);if (WARN_ON (!crtc_state))
@@ -662,6 +672,33 @@ static void ingenic_drm_plane_atomic_update(struct drm_plane *plane, hwdesc->cmd =JZ_LCD_CMD_EOF_IRQ | (width * height * cpp /4 ); hwdesc->next =dma_hwdesc_addr (priv, next_id); +if (priv->soc_info->use_extended_hwdesc) { + hwdesc->cmd |=JZ_LCD_CMD_FRM_ENABLE ; + +/* Extended 8-byte descriptor */ + hwdesc->cpos =0 ; + hwdesc->offsize =0 ; + hwdesc->pagewidth =0 ; + +switch (newstate->fb->format->format) { +case DRM_FORMAT_XRGB1555 : + hwdesc->cpos |=JZ_LCD_CPOS_RGB555 ; + fallthrough; +case DRM_FORMAT_RGB565 : + hwdesc->cpos |=JZ_LCD_CPOS_BPP_15_16 ; +break ; +case DRM_FORMAT_XRGB8888 : + hwdesc->cpos |=JZ_LCD_CPOS_BPP_18_24 ; +break ; + } + hwdesc->cpos |= (JZ_LCD_CPOS_COEFFICIENT_1 << +JZ_LCD_CPOS_COEFFICIENT_OFFSET ); + hwdesc->dessize = + (0xff <<JZ_LCD_DESSIZE_ALPHA_OFFSET ) | +FIELD_PREP (JZ_LCD_DESSIZE_HEIGHT_MASK , height -1 ) | +FIELD_PREP (JZ_LCD_DESSIZE_WIDTH_MASK , width -1 ); + } +if (drm_atomic_crtc_needs_modeset (crtc_state)) { fourcc = newstate->fb->format->format;
@@ -693,6 +730,9 @@ static void ingenic_drm_encoder_atomic_mode_set(struct drm_encoder *encoder, | JZ_LCD_CFG_SPL_DISABLE | JZ_LCD_CFG_REV_DISABLE; } +if (priv->soc_info->use_extended_hwdesc) + cfg |=JZ_LCD_CFG_DESCRIPTOR_8 ; +if (mode->flags &DRM_MODE_FLAG_NHSYNC ) cfg |=JZ_LCD_CFG_HSYNC_ACTIVE_LOW ;if (mode->flags &DRM_MODE_FLAG_NVSYNC )
@@ -1468,10 +1508,23 @@ static const struct jz_soc_info jz4770_soc_info = { .num_formats_f0 = ARRAY_SIZE(jz4770_formats_f0), }; +static const struct jz_soc_info jz4780_soc_info = { + .needs_dev_clk = true, + .has_osd = true, + .use_extended_hwdesc = true, + .max_width =4096 , + .max_height =2048 , + .formats_f1 = jz4770_formats_f1, + .num_formats_f1 =ARRAY_SIZE (jz4770_formats_f1), + .formats_f0 = jz4770_formats_f0, + .num_formats_f0 =ARRAY_SIZE (jz4770_formats_f0), +}; +static const struct of_device_id ingenic_drm_of_match[] = { { .compatible ="ingenic,jz4740-lcd" , .data = &jz4740_soc_info }, { .compatible ="ingenic,jz4725b-lcd" , .data = &jz4725b_soc_info }, { .compatible ="ingenic,jz4770-lcd" , .data = &jz4770_soc_info }, + { .compatible ="ingenic,jz4780-lcd" , .data = &jz4780_soc_info }, {/* sentinel */ }, };MODULE_DEVICE_TABLE (of, ingenic_drm_of_match);
drivers/gpu/drm/ingenic/ingenic-drm.h +38 -0
@@ -44,8 +44,11 @@#define JZ_REG_LCD_XYP1 0x124#define JZ_REG_LCD_SIZE0 0x128#define JZ_REG_LCD_SIZE1 0x12c +#define JZ_REG_LCD_PCFG 0x2c0#define JZ_LCD_CFG_SLCD BIT(31) +#define JZ_LCD_CFG_DESCRIPTOR_8 BIT(28) +#define JZ_LCD_CFG_RECOVER_FIFO_UNDERRUN BIT(25)#define JZ_LCD_CFG_PS_DISABLE BIT(23)#define JZ_LCD_CFG_CLS_DISABLE BIT(22)#define JZ_LCD_CFG_SPL_DISABLE BIT(21)
@@ -63,6 +66,7 @@#define JZ_LCD_CFG_DE_ACTIVE_LOW BIT(9)#define JZ_LCD_CFG_VSYNC_ACTIVE_LOW BIT(8)#define JZ_LCD_CFG_18_BIT BIT(7) +#define JZ_LCD_CFG_24_BIT BIT(6)#define JZ_LCD_CFG_PDW (BIT(5) | BIT(4))#define JZ_LCD_CFG_MODE_GENERIC_16BIT 0
@@ -132,6 +136,7 @@#define JZ_LCD_CMD_SOF_IRQ BIT(31)#define JZ_LCD_CMD_EOF_IRQ BIT(30)#define JZ_LCD_CMD_ENABLE_PAL BIT(28) +#define JZ_LCD_CMD_FRM_ENABLE BIT(26)#define JZ_LCD_SYNC_MASK 0x3ff
@@ -153,6 +158,7 @@#define JZ_LCD_RGBC_EVEN_BGR (0x5 << 0)#define JZ_LCD_OSDC_OSDEN BIT(0) +#define JZ_LCD_OSDC_ALPHAEN BIT(2)#define JZ_LCD_OSDC_F0EN BIT(3)#define JZ_LCD_OSDC_F1EN BIT(4)
@@ -176,6 +182,38 @@#define JZ_LCD_SIZE01_WIDTH_LSB 0#define JZ_LCD_SIZE01_HEIGHT_LSB 16 +#define JZ_LCD_DESSIZE_ALPHA_OFFSET 24 +#define JZ_LCD_DESSIZE_HEIGHT_MASK GENMASK(23, 12) +#define JZ_LCD_DESSIZE_WIDTH_MASK GENMASK(11, 0) + +#define JZ_LCD_CPOS_BPP_15_16 (4 << 27) +#define JZ_LCD_CPOS_BPP_18_24 (5 << 27) +#define JZ_LCD_CPOS_BPP_30 (7 << 27) +#define JZ_LCD_CPOS_RGB555 BIT(30) +#define JZ_LCD_CPOS_PREMULTIPLY_LCD BIT(26) +#define JZ_LCD_CPOS_COEFFICIENT_OFFSET 24 +#define JZ_LCD_CPOS_COEFFICIENT_0 0 +#define JZ_LCD_CPOS_COEFFICIENT_1 1 +#define JZ_LCD_CPOS_COEFFICIENT_ALPHA1 2 +#define JZ_LCD_CPOS_COEFFICIENT_1_ALPHA1 3 + +#define JZ_LCD_RGBC_RGB_PADDING BIT(15) +#define JZ_LCD_RGBC_RGB_PADDING_FIRST BIT(14) +#define JZ_LCD_RGBC_422 BIT(8) +#define JZ_LCD_RGBC_RGB_FORMAT_ENABLE BIT(7) + +#define JZ_LCD_PCFG_PRI_MODE BIT(31) +#define JZ_LCD_PCFG_HP_BST_4 (0 << 28) +#define JZ_LCD_PCFG_HP_BST_8 (1 << 28) +#define JZ_LCD_PCFG_HP_BST_16 (2 << 28) +#define JZ_LCD_PCFG_HP_BST_32 (3 << 28) +#define JZ_LCD_PCFG_HP_BST_64 (4 << 28) +#define JZ_LCD_PCFG_HP_BST_16_CONT (5 << 28) +#define JZ_LCD_PCFG_HP_BST_DISABLE (7 << 28) +#define JZ_LCD_PCFG_THRESHOLD2_OFFSET 18 +#define JZ_LCD_PCFG_THRESHOLD1_OFFSET 9 +#define JZ_LCD_PCFG_THRESHOLD0_OFFSET 0 +struct device ;struct drm_plane ;struct drm_plane_state ;
Signature · 1 line
2.33.0
PATCH v6 3/8 dt-bindings: display: Add ingenic,jz4780-dw-hdmi DT Schema
In reply to H. Nikolaus SchallerFrom: Sam Ravnborg <[email protected]>
Add DT bindings for the hdmi driver for the Ingenic JZ4780 SoC. Based on .txt binding from Zubair Lutfullah Kakakhel
We also add add generic ddc-i2c-bus to synopsys,dw-hdmi.yaml
--- .../display/bridge/synopsys,dw-hdmi.yaml | 3 + .../bindings/display/ingenic-jz4780-hdmi.yaml | 76 +++++++++++++++++++ 2 files changed, 79 insertions(+) create mode 100644 Documentation/devicetree/bindings/display/ingenic-jz4780-hdmi.yaml
Documentation/devicetree/bindings/display/bridge/synopsys,dw-hdmi.yaml +3 -0
@@ -50,6 +50,9 @@ properties: interrupts: maxItems: 1 + ddc-i2c-bus: + description: An I2C interface if the internal DDC I2C driver is not to be used + additionalProperties: true ...
Documentation/devicetree/bindings/display/ingenic-jz4780-hdmi.yaml new file +76 -0
76 lines not on this page · raw message
Signature · 1 line
2.33.0
Rob Herring
maintainerRe: [PATCH v6 3/8] dt-bindings: display: Add ingenic,jz4780-dw-hdmi DT Schema
Quoted 11 lines · H. Nikolaus Schaller
From: Sam Ravnborg <[email protected]>
Add DT bindings for the hdmi driver for the Ingenic JZ4780 SoC. Based on .txt binding from Zubair Lutfullah Kakakhel
We also add add generic ddc-i2c-bus to synopsys,dw-hdmi.yaml
Signed-off-by Sam Ravnborg <[email protected]>Signed-off-by H. Nikolaus Schaller <[email protected]>Cc Rob Herring <[email protected]>
Quoted 6 lines
--- .../display/bridge/synopsys,dw-hdmi.yaml | 3 + .../bindings/display/ingenic-jz4780-hdmi.yaml | 76 +++++++++++++++++++ 2 files changed, 79 insertions(+) create mode 100644 Documentation/devicetree/bindings/display/ingenic-jz4780-hdmi.yaml
My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check' on your patch (DT_CHECKER_FLAGS is new in v5.13):
yamllint warnings/errors:./Documentation/devicetree/bindings/display/ingenic-jz4780-hdmi.yaml:36:5: [warning] wrong indentation: expected 2 but found 4 (indentation)
dtschema/dtc warnings/errors:
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/display/ingenic-jz4780-hdmi.example.dt.yaml: hdmi@10180000: 'clock-names', 'ddc-i2c-bus', 'interrupt-parent', 'interrupts', 'reg' do not match any of the regexes: 'pinctrl-[0-9]+'
From schema: /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/display/ingenic-jz4780-hdmi.yaml
doc reference errors (make refcheckdocs):
See https://patchwork.ozlabs.org/patch/1553577
This check can fail if there are any dependencies. The base for a patch series is generally the most recent rc1.
If you already ran 'make dt_binding_check' and didn't see the above error(s), then make sure 'yamllint' is installed and dt-schema is up to date:
pip3 install dtschema --upgrade
Please check and re-submit.
Rob Herring
maintainerRe: [PATCH v6 3/8] dt-bindings: display: Add ingenic,jz4780-dw-hdmi DT Schema
Quoted 8 lines · Rob Herring
Quoted 7 lines · H. Nikolaus Schaller
From: Sam Ravnborg <[email protected]>
Add DT bindings for the hdmi driver for the Ingenic JZ4780 SoC. Based on .txt binding from Zubair Lutfullah Kakakhel
We also add add generic ddc-i2c-bus to synopsys,dw-hdmi.yaml
Quoted 7 lines
Quoted 7 lines
Signed-off-by Sam Ravnborg <[email protected]>Signed-off-by H. Nikolaus Schaller <[email protected]>Cc Rob Herring <[email protected]>--- .../display/bridge/synopsys,dw-hdmi.yaml | 3 + .../bindings/display/ingenic-jz4780-hdmi.yaml | 76 +++++++++++++++++++
This goes in display/bridge/. And use compatible string for the file
name: ingenic,jz4780-hdmi.yaml
Quoted 7 lines
Quoted 3 lines
2 files changed, 79 insertions(+) create mode 100644 Documentation/devicetree/bindings/display/ingenic-jz4780-hdmi.yamlMy bot found errors running 'make DT_CHECKER_FLAGS=-m
dt_binding_check' on your patch (DT_CHECKER_FLAGSis new in v5.13):
Quoted 6 lines
yamllint warnings/errors:
./Documentation/devicetree/bindings/display/ingenic-jz4780-hdmi.yaml:36:5: [warning] wrong indentation: expected 2 but found 4 (indentation)dtschema/dtc warnings/errors:
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/display/ingenic-jz4780-hdmi.example.dt.yaml: hdmi@10180000: 'clock-names', 'ddc-i2c-bus', 'interrupt-parent', 'interrupts', 'reg' do not match any of the regexes: 'pinctrl-[0-9]+'
From schema: /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/display/ingenic-jz4780-hdmi.yaml
I think you need to use 'unevaluatedPropertes' instead of 'additionalProperties' if you are getting these properties from synopsys,dw-hdmi.yaml.
Rob
PATCH v6 4/8 drm/ingenic: Add dw-hdmi driver for jz4780
In reply to H. Nikolaus SchallerFrom: 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.
--- drivers/gpu/drm/ingenic/Kconfig | 9 ++ drivers/gpu/drm/ingenic/Makefile | 1 + drivers/gpu/drm/ingenic/ingenic-dw-hdmi.c | 129 ++++++++++++++++++++++ 3 files changed, 139 insertions(+) create mode 100644 drivers/gpu/drm/ingenic/ingenic-dw-hdmi.c
drivers/gpu/drm/ingenic/Kconfig +9 -0
@@ -25,4 +25,13 @@ config DRM_INGENIC_IPU The Image Processing Unit (IPU) will appear as a second primary plane. +config DRM_INGENIC_DW_HDMI + tristate "Ingenic specific support for Synopsys DW HDMI" + depends on MACH_JZ4780 + select DRM_DW_HDMI + help + Choose this option to enable Synopsys DesignWare HDMI based driver. + If you want to enable HDMI on Ingenic JZ4780 based SoC, you should + select this option.. + endif
drivers/gpu/drm/ingenic/Makefile +1 -0
@@ -1,3 +1,4 @@ obj-$(CONFIG_DRM_INGENIC) += ingenic-drm.o ingenic-drm-y = ingenic-drm-drv.o ingenic-drm-$(CONFIG_DRM_INGENIC_IPU) += ingenic-ipu.o +obj-$(CONFIG_DRM_INGENIC_DW_HDMI) += ingenic-dw-hdmi.o
drivers/gpu/drm/ingenic/ingenic-dw-hdmi.c new file +129 -0
129 lines not on this page · raw message
Signature · 1 line
2.33.0
PATCH v6 5/8 MIPS: DTS: jz4780: Account for Synopsys HDMI driver and LCD controllers
In reply to H. Nikolaus SchallerFrom: 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.
--- arch/mips/boot/dts/ingenic/jz4780.dtsi | 40 ++++++++++++++++++++++++++ 1 file changed, 40 insertions(+)
arch/mips/boot/dts/ingenic/jz4780.dtsi +40 -0
@@ -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>;
Signature · 1 line
2.33.0
Paul Cercueil
maintainerRe: [PATCH v6 5/8] MIPS: DTS: jz4780: Account for Synopsys HDMI driver and LCD controllers
Hi Nikolaus,
Quoted 47 lines · H. Nikolaus Schaller
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(+)arch/mips/boot/dts/ingenic/jz4780.dtsi +26
-0@@ -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"; + };
arch/mips/boot/dts/ingenic/jz4780.dtsi i2c4: i2c@10054000 { · line 462
Quoted 10 lines
arch/mips/boot/dts/ingenic/jz4780.dtsi +10
-0+ + 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
Quoted 10 lines
arch/mips/boot/dts/ingenic/jz4780.dtsi +4
-1+ + status = "disabled"; + }; + nemc: nemc@13410000 { compatible = "ingenic,jz4780-nemc", "simple-mfd"; reg = <0x13410000 0x10000>; --2.33.0
PATCH v6 6/8 MIPS: DTS: CI20: Add DT nodes for HDMI setup
In reply to H. Nikolaus SchallerFrom: 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
--- arch/mips/boot/dts/ingenic/ci20.dts | 73 +++++++++++++++++++++++++++-- 1 file changed, 70 insertions(+), 3 deletions(-)
arch/mips/boot/dts/ingenic/ci20.dts +70 -3
@@ -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>; + }; + }; +};
Signature · 1 line
2.33.0
Paul Cercueil
maintainerRe: [PATCH v6 6/8] MIPS: DTS: CI20: Add DT nodes for HDMI setup
Hi Nikolaus, Thomas,
Quoted 42 lines · H. Nikolaus Schaller
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 connectionsSigned-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(-)arch/mips/boot/dts/ingenic/ci20.dts +12
-0@@ -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;
arch/mips/boot/dts/ingenic/ci20.dts otg_power: fixedregulator@2 { · line 125
Quoted 10 lines
arch/mips/boot/dts/ingenic/ci20.dts +9
-0}; + + 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).
Quoted 15 lines
arch/mips/boot/dts/ingenic/ci20.dts +2
-0+ enable-active-high; + }; }; &ext {@@ -113,9 +136,9 @@ &cgu { * Use the 32.768 kHz oscillator as the parent of the RTC for ahigher
arch/mips/boot/dts/ingenic/ci20.dts +1
-3* 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>;
arch/mips/boot/dts/ingenic/ci20.dts &cgu { · line 141
Quoted 2 lines
arch/mips/boot/dts/ingenic/ci20.dts +2
-0+ 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
Quoted 61 lines
};
&tcu {
arch/mips/boot/dts/ingenic/ci20.dts +44
-1@@ -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
PATCH v6 7/8 MIPS: defconfig: CI20: configure for DRM_DW_HDMI_JZ4780
In reply to H. Nikolaus SchallerEnable CONFIG options as modules.
--- arch/mips/configs/ci20_defconfig | 6 ++++++ 1 file changed, 6 insertions(+)
arch/mips/configs/ci20_defconfig +6 -0
@@ -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
Signature · 1 line
2.33.0
RFC PATCH v6 8/8 MIPS: DTS: Ingenic: adjust register size to available registers
In reply to H. Nikolaus SchallerAfter 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]>
--- 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(-)
arch/mips/boot/dts/ingenic/jz4725b.dtsi +1 -1
@@ -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>;
arch/mips/boot/dts/ingenic/jz4740.dtsi +1 -1
@@ -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>;
arch/mips/boot/dts/ingenic/jz4770.dtsi +1 -1
@@ -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>;
Signature · 1 line
2.33.0