Add peripheral support to imx8mq-nitrogen board
Subsystems (2)
v3 cover Add peripheral support to imx8mq-nitrogen board
Hi,
this patch set aims is to add support of multiple peripheral of the Boundary8M board:
- USB Host;
- USB device;
- DB_DSIHD sub board for MIPI-DSI to HDMI output (via lt8912b chip).
Updates in v2:
- Use a GPIO hog to handle the USB HOST reset line;
- Remove useless GPIO hog for lt8912b.
Update in v3:
- Fix bad squash in git commits.
Thanks,
Adrien Grassein (4):
arm64: dts: imx8mq-nitrogen: add USB OTG support
arm64: dts: imx8mq-nitrogen: add USB HOST support
arm64: dts: imx8mq-nitrogen: add lt8912 MIPI-DSI to HDMI
arm64: defconfig: Enable LT8912B DRM bridge driver
.../boot/dts/freescale/imx8mq-nitrogen.dts | 185 ++++++++++++++++++ arch/arm64/configs/defconfig | 1 + 2 files changed, 186 insertions(+)
Signature · 1 line
2.25.1
PATCH v3 1/4 arm64: dts: imx8mq-nitrogen: add USB OTG support
Add the description for the USB OTG port.
The OTG port uses a dedicated regulator for vbus.
--- .../boot/dts/freescale/imx8mq-nitrogen.dts | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+)
arch/arm64/boot/dts/freescale/imx8mq-nitrogen.dts +35 -0
@@ -34,6 +34,17 @@ power { }; }; + reg_usb_otg_vbus: regulator-usb-otg-vbus { + compatible = "regulator-fixed"; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_reg_usbotg_vbus>; + regulator-name = "usb_otg_vbus"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + gpio = <&gpio1 12 GPIO_ACTIVE_HIGH>; + enable-active-high; + }; + reg_vref_0v9: regulator-vref-0v9 { compatible = "regulator-fixed"; regulator-name = "vref-0v9";
@@ -190,6 +201,18 @@ &uart2 { status = "okay"; }; +&usb_dwc3_0 { + dr_mode = "otg"; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_usb3_0>; + status = "okay"; +}; + +&usb3_phy0 { + vbus-supply = <®_usb_otg_vbus>; + status = "okay"; +}; + &usdhc1 { assigned-clocks = <&clk IMX8MQ_CLK_USDHC1>; assigned-clock-rates = <400000000>;
@@ -339,6 +362,12 @@ MX8MQ_IOMUXC_SD2_WP_GPIO2_IO20 0x16 >; }; + pinctrl_reg_usbotg_vbus: reg-usbotg-vbusgrp { + fsl,pins = < + MX8MQ_IOMUXC_GPIO1_IO12_GPIO1_IO12 0x16 + >; + }; + pinctrl_uart1: uart1grp { fsl,pins = < MX8MQ_IOMUXC_UART1_RXD_UART1_DCE_RX 0x45
@@ -353,6 +382,12 @@ MX8MQ_IOMUXC_UART2_TXD_UART2_DCE_TX 0x45 >; }; + pinctrl_usb3_0: usb3-0grp { + fsl,pins = < + MX8MQ_IOMUXC_GPIO1_IO13_USB1_OTG_OC 0x16 + >; + }; + pinctrl_usdhc1: usdhc1grp { fsl,pins = < MX8MQ_IOMUXC_SD1_CLK_USDHC1_CLK 0x83
Signature · 1 line
2.25.1
PATCH v3 2/4 arm64: dts: imx8mq-nitrogen: add USB HOST support
In reply to Adrien GrasseinAdd the description for the USB host port. This port is linked to a resettable USB HUB so handle this reset signal with a GPIO hog.
--- .../boot/dts/freescale/imx8mq-nitrogen.dts | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+)
arch/arm64/boot/dts/freescale/imx8mq-nitrogen.dts +30 -0
@@ -102,6 +102,14 @@ ethphy0: ethernet-phy@4 { }; }; +&gpio1 { + usb-host-reset-hog { + gpio-hog; + gpios = <14 GPIO_ACTIVE_HIGH>; + output-high; + }; +}; + &i2c1 { clock-frequency = <400000>; pinctrl-names = "default";
@@ -213,6 +221,22 @@ &usb3_phy0 { status = "okay"; }; +&usb_dwc3_1 { + dr_mode = "host"; + status = "okay"; +}; + +/* + * On this board, USB host is connected to a resettable hub. + * The reset signal is connected to the GPIO <&gpio1 14 GPIO_ACTIVE_LOW>. + * You need to activate it in the bootloader or in the userspace. + */ +&usb3_phy1 { + status = "okay"; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_usb3_1>; +}; + &usdhc1 { assigned-clocks = <&clk IMX8MQ_CLK_USDHC1>; assigned-clock-rates = <400000000>;
@@ -388,6 +412,12 @@ MX8MQ_IOMUXC_GPIO1_IO13_USB1_OTG_OC 0x16 >; }; + pinctrl_usb3_1: usb3-1grp { + fsl,pins = < + MX8MQ_IOMUXC_GPIO1_IO14_GPIO1_IO14 0x16 + >; + }; + pinctrl_usdhc1: usdhc1grp { fsl,pins = < MX8MQ_IOMUXC_SD1_CLK_USDHC1_CLK 0x83
Signature · 1 line
2.25.1
Re: [PATCH v3 2/4] arm64: dts: imx8mq-nitrogen: add USB HOST support
Quoted 34 lines · Adrien Grassein
Add the description for the USB host port. This port is linked to a resettable USB HUB so handle this reset signal with a GPIO hog.
Signed-off-by Adrien Grassein <[email protected]>--- .../boot/dts/freescale/imx8mq-nitrogen.dts | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+)arch/arm64/boot/dts/freescale/imx8mq-nitrogen.dts +10
-0@@ -102,6 +102,14 @@ ethphy0: ethernet-phy@4 { }; }; +&gpio1 { + usb-host-reset-hog { + gpio-hog; + gpios = <14 GPIO_ACTIVE_HIGH>; + output-high; + }; +}; + &i2c1 { clock-frequency = <400000>; pinctrl-names = "default";@@ -213,6 +221,22 @@ &usb3_phy0 { status = "okay"; }; +&usb_dwc3_1 { + dr_mode = "host";
arch/arm64/boot/dts/freescale/imx8mq-nitrogen.dts &usb3_phy0 { · line 235
Quoted 10 lines
arch/arm64/boot/dts/freescale/imx8mq-nitrogen.dts +10
-0+ status = "okay"; +}; + +/* + * On this board, USB host is connected to a resettable hub. + * The reset signal is connected to the GPIO <&gpio1 14 GPIO_ACTIVE_LOW>. + * You need to activate it in the bootloader or in the userspace. + */ +&usb3_phy1 { + status = "okay";
We usually end property list with 'status'.
Shawn
Quoted 23 lines
arch/arm64/boot/dts/freescale/imx8mq-nitrogen.dts +10
-0+ pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_usb3_1>; +}; + &usdhc1 { assigned-clocks = <&clk IMX8MQ_CLK_USDHC1>; assigned-clock-rates = <400000000>;@@ -388,6 +412,12 @@ MX8MQ_IOMUXC_GPIO1_IO13_USB1_OTG_OC 0x16 >; }; + pinctrl_usb3_1: usb3-1grp { + fsl,pins = < + MX8MQ_IOMUXC_GPIO1_IO14_GPIO1_IO14 0x16 + >; + }; + pinctrl_usdhc1: usdhc1grp { fsl,pins = < MX8MQ_IOMUXC_SD1_CLK_USDHC1_CLK 0x83Signature · 1 line
2.25.1
PATCH v3 3/4 arm64: dts: imx8mq-nitrogen: add lt8912 MIPI-DSI to HDMI
In reply to Adrien GrasseinAdd support of the lt8912b in the DTB.
This adds the support of the DB_DSIHD daugther board from Boundary Devices.
--- .../boot/dts/freescale/imx8mq-nitrogen.dts | 120 ++++++++++++++++++ 1 file changed, 120 insertions(+)
arch/arm64/boot/dts/freescale/imx8mq-nitrogen.dts +120 -0
@@ -34,6 +34,19 @@ power { }; }; + hdmi-connector { + compatible = "hdmi-connector"; + ddc-i2c-bus = <&ddc_i2c_bus>; + label = "hdmi"; + type = "a"; + + port { + hdmi_connector_in: endpoint { + remote-endpoint = <<8912_out>; + }; + }; + }; + reg_usb_otg_vbus: regulator-usb-otg-vbus { compatible = "regulator-fixed"; pinctrl-names = "default";
@@ -81,6 +94,9 @@ reg_vref_5v: regulator-vref-5v { }; }; +&dphy { + status = "okay"; +}; &fec1 { pinctrl-names = "default";
@@ -193,6 +209,97 @@ rtc@68 { }; }; +&i2c4 { + clock-frequency = <100000>; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_i2c4>; + status = "okay"; + + pca9546: i2cmux9546@70 { + compatible = "nxp,pca9546"; + reg = <0x70>; + #address-cells = <1>; + #size-cells = <0>; + + i2c4@0 { + reg = <0>; + #address-cells = <1>; + #size-cells = <0>; + clock-frequency = <100000>; + + hdmi-bridge@48 { + compatible = "lontium,lt8912b"; + reg = <0x48> ; + reset-gpios = <&max7323 0 GPIO_ACTIVE_LOW>; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + + hdmi_out_in: endpoint { + data-lanes = <1 2 3 4>; + remote-endpoint = <&mipi_dsi_out>; + }; + }; + + port@1 { + reg = <1>; + + lt8912_out: endpoint { + remote-endpoint = <&hdmi_connector_in>; + }; + }; + }; + }; + }; + + ddc_i2c_bus: i2c4@1 { + reg = <1>; + #address-cells = <1>; + #size-cells = <0>; + clock-frequency = <100000>; + }; + + i2c4@3 { + reg = <3>; + #address-cells = <1>; + #size-cells = <0>; + clock-frequency = <100000>; + + max7323: max7323@68 { + compatible = "maxim,max7323"; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_max7323>; + gpio-controller; + reg = <0x68>; + #gpio-cells = <2>; + }; + }; + }; +}; + +&lcdif { + status = "okay"; +}; + +&mipi_dsi { + status = "okay"; + #address-cells = <1>; + #size-cells = <0>; + + ports { + port@1 { + reg = <1>; + mipi_dsi_out: endpoint { + remote-endpoint = <&hdmi_out_in>; + }; + }; + }; +}; + &uart1 { /* console */ pinctrl-names = "default"; pinctrl-0 = <&pinctrl_uart1>;
@@ -368,6 +475,19 @@ MX8MQ_IOMUXC_GPIO1_IO06_GPIO1_IO6 0x49 >; }; + pinctrl_i2c4: i2c4grp { + fsl,pins = < + MX8MQ_IOMUXC_I2C4_SCL_I2C4_SCL 0x4000007f + MX8MQ_IOMUXC_I2C4_SDA_I2C4_SDA 0x4000007f + >; + }; + + pinctrl_max7323: max7323grp { + fsl,pins = < + MX8MQ_IOMUXC_NAND_RE_B_GPIO3_IO15 0x19 + >; + }; + pinctrl_reg_arm_dram: reg-arm-dramgrp { fsl,pins = < MX8MQ_IOMUXC_SAI5_RXD3_GPIO3_IO24 0x16
Signature · 1 line
2.25.1
Re: [PATCH v3 3/4] arm64: dts: imx8mq-nitrogen: add lt8912 MIPI-DSI to HDMI
Quoted 44 lines · Adrien Grassein
Add support of the lt8912b in the DTB.
This adds the support of theDB_DSIHDdaugther board from Boundary Devices.Signed-off-by Adrien Grassein <[email protected]>--- .../boot/dts/freescale/imx8mq-nitrogen.dts | 120 ++++++++++++++++++ 1 file changed, 120 insertions(+)arch/arm64/boot/dts/freescale/imx8mq-nitrogen.dts +16
-0@@ -34,6 +34,19 @@ power { }; }; + hdmi-connector { + compatible = "hdmi-connector"; + ddc-i2c-bus = <&ddc_i2c_bus>; + label = "hdmi"; + type = "a"; + + port { + hdmi_connector_in: endpoint { + remote-endpoint = <<8912_out>; + }; + }; + }; + reg_usb_otg_vbus: regulator-usb-otg-vbus { compatible = "regulator-fixed"; pinctrl-names = "default";@@ -81,6 +94,9 @@ reg_vref_5v: regulator-vref-5v { }; }; +&dphy { + status = "okay"; +}; &fec1 { pinctrl-names = "default";
arch/arm64/boot/dts/freescale/imx8mq-nitrogen.dts rtc@68 { · line 218
Quoted 10 lines
arch/arm64/boot/dts/freescale/imx8mq-nitrogen.dts +7
-0@@ -193,6 +209,97 @@ rtc@68 { }; }; +&i2c4 { + clock-frequency = <100000>; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_i2c4>; + status = "okay"; + + pca9546: i2cmux9546@70 {
Node name should be generic, so 9546 should be dropped from there?
arch/arm64/boot/dts/freescale/imx8mq-nitrogen.dts rtc@68 { · line 224
Quoted 6 lines
arch/arm64/boot/dts/freescale/imx8mq-nitrogen.dts +6
-0+ compatible = "nxp,pca9546"; + reg = <0x70>; + #address-cells = <1>; + #size-cells = <0>; + + i2c4@0 {
Is number 4 really needed in node name?
Quoted 38 lines
arch/arm64/boot/dts/freescale/imx8mq-nitrogen.dts +38
-0+ reg = <0>; + #address-cells = <1>; + #size-cells = <0>; + clock-frequency = <100000>; + + hdmi-bridge@48 { + compatible = "lontium,lt8912b"; + reg = <0x48> ; + reset-gpios = <&max7323 0 GPIO_ACTIVE_LOW>; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + + hdmi_out_in: endpoint { + data-lanes = <1 2 3 4>; + remote-endpoint = <&mipi_dsi_out>; + }; + }; + + port@1 { + reg = <1>; + + lt8912_out: endpoint { + remote-endpoint = <&hdmi_connector_in>; + }; + }; + }; + }; + }; + + ddc_i2c_bus: i2c4@1 { + reg = <1>; + #address-cells = <1>; + #size-cells = <0>;
arch/arm64/boot/dts/freescale/imx8mq-nitrogen.dts rtc@68 { · line 272
Quoted 10 lines
arch/arm64/boot/dts/freescale/imx8mq-nitrogen.dts +10
-0+ clock-frequency = <100000>; + }; + + i2c4@3 { + reg = <3>; + #address-cells = <1>; + #size-cells = <0>; + clock-frequency = <100000>; + + max7323: max7323@68 {
Can we have a generic node name for this device?
Quoted 7 lines
arch/arm64/boot/dts/freescale/imx8mq-nitrogen.dts +7
-0+ compatible = "maxim,max7323"; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_max7323>; + gpio-controller; + reg = <0x68>; + #gpio-cells = <2>; + };
arch/arm64/boot/dts/freescale/imx8mq-nitrogen.dts rtc@68 { · line 289
Quoted 10 lines
arch/arm64/boot/dts/freescale/imx8mq-nitrogen.dts +10
-0+ }; + }; +}; + +&lcdif { + status = "okay"; +}; + +&mipi_dsi { + status = "okay";
Move it to end of property list.
arch/arm64/boot/dts/freescale/imx8mq-nitrogen.dts rtc@68 { · line 249
Quoted 6 lines
arch/arm64/boot/dts/freescale/imx8mq-nitrogen.dts +6
-0+ #address-cells = <1>; + #size-cells = <0>; + + ports { + port@1 { + reg = <1>;
Newline between property and child node.
Shawn
Quoted 33 lines
arch/arm64/boot/dts/freescale/imx8mq-nitrogen.dts +20
-0+ mipi_dsi_out: endpoint { + remote-endpoint = <&hdmi_out_in>; + }; + }; + }; +}; + &uart1 { /* console */ pinctrl-names = "default"; pinctrl-0 = <&pinctrl_uart1>;@@ -368,6 +475,19 @@ MX8MQ_IOMUXC_GPIO1_IO06_GPIO1_IO6 0x49 >; }; + pinctrl_i2c4: i2c4grp { + fsl,pins = < + MX8MQ_IOMUXC_I2C4_SCL_I2C4_SCL 0x4000007f + MX8MQ_IOMUXC_I2C4_SDA_I2C4_SDA 0x4000007f + >; + }; + + pinctrl_max7323: max7323grp { + fsl,pins = < + MX8MQ_IOMUXC_NAND_RE_B_GPIO3_IO15 0x19 + >; + }; + pinctrl_reg_arm_dram: reg-arm-dramgrp { fsl,pins = < MX8MQ_IOMUXC_SAI5_RXD3_GPIO3_IO24 0x16Signature · 1 line
2.25.1
Re: [PATCH v3 3/4] arm64: dts: imx8mq-nitrogen: add lt8912 MIPI-DSI to HDMI
Hi Shawn,
Thanks for your review.
Quoted 59 lines · Shawn Guo
Quoted 44 lines · Adrien Grassein
Add support of the lt8912b in the DTB.
This adds the support of theDB_DSIHDdaugther board from Boundary Devices.Signed-off-by Adrien Grassein <[email protected]>--- .../boot/dts/freescale/imx8mq-nitrogen.dts | 120 ++++++++++++++++++ 1 file changed, 120 insertions(+)arch/arm64/boot/dts/freescale/imx8mq-nitrogen.dts +16
-0@@ -34,6 +34,19 @@ power { }; }; + hdmi-connector { + compatible = "hdmi-connector"; + ddc-i2c-bus = <&ddc_i2c_bus>; + label = "hdmi"; + type = "a"; + + port { + hdmi_connector_in: endpoint { + remote-endpoint = <<8912_out>; + }; + }; + }; + reg_usb_otg_vbus: regulator-usb-otg-vbus { compatible = "regulator-fixed"; pinctrl-names = "default";@@ -81,6 +94,9 @@ reg_vref_5v: regulator-vref-5v { }; }; +&dphy { + status = "okay"; +}; &fec1 { pinctrl-names = "default";arch/arm64/boot/dts/freescale/imx8mq-nitrogen.dts rtc@68 { · line 218
Quoted 10 lines
arch/arm64/boot/dts/freescale/imx8mq-nitrogen.dts +7
-0@@ -193,6 +209,97 @@ rtc@68 { }; }; +&i2c4 { + clock-frequency = <100000>; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_i2c4>; + status = "okay"; + + pca9546: i2cmux9546@70 {Node name should be generic, so 9546 should be dropped from there?
Quoted 9 lines
arch/arm64/boot/dts/freescale/imx8mq-nitrogen.dts rtc@68 { · line 224
Quoted 6 lines
arch/arm64/boot/dts/freescale/imx8mq-nitrogen.dts +6
-0+ compatible = "nxp,pca9546"; + reg = <0x70>; + #address-cells = <1>; + #size-cells = <0>; + + i2c4@0 {Is number 4 really needed in node name?
I add 4 to keep it coherent with the DTS file (i2c1@0 for example).
Quoted 107 lines
Quoted 38 lines
arch/arm64/boot/dts/freescale/imx8mq-nitrogen.dts +38
-0+ reg = <0>; + #address-cells = <1>; + #size-cells = <0>; + clock-frequency = <100000>; + + hdmi-bridge@48 { + compatible = "lontium,lt8912b"; + reg = <0x48> ; + reset-gpios = <&max7323 0 GPIO_ACTIVE_LOW>; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + + hdmi_out_in: endpoint { + data-lanes = <1 2 3 4>; + remote-endpoint = <&mipi_dsi_out>; + }; + }; + + port@1 { + reg = <1>; + + lt8912_out: endpoint { + remote-endpoint = <&hdmi_connector_in>; + }; + }; + }; + }; + }; + + ddc_i2c_bus: i2c4@1 { + reg = <1>; + #address-cells = <1>; + #size-cells = <0>;arch/arm64/boot/dts/freescale/imx8mq-nitrogen.dts rtc@68 { · line 272
Quoted 10 lines
arch/arm64/boot/dts/freescale/imx8mq-nitrogen.dts +10
-0+ clock-frequency = <100000>; + }; + + i2c4@3 { + reg = <3>; + #address-cells = <1>; + #size-cells = <0>; + clock-frequency = <100000>; + + max7323: max7323@68 {Can we have a generic node name for this device?
Quoted 7 lines
arch/arm64/boot/dts/freescale/imx8mq-nitrogen.dts +7
-0+ compatible = "maxim,max7323"; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_max7323>; + gpio-controller; + reg = <0x68>; + #gpio-cells = <2>; + };arch/arm64/boot/dts/freescale/imx8mq-nitrogen.dts rtc@68 { · line 289
Quoted 10 lines
arch/arm64/boot/dts/freescale/imx8mq-nitrogen.dts +10
-0+ }; + }; +}; + +&lcdif { + status = "okay"; +}; + +&mipi_dsi { + status = "okay";Move it to end of property list.
arch/arm64/boot/dts/freescale/imx8mq-nitrogen.dts rtc@68 { · line 249
Quoted 6 lines
arch/arm64/boot/dts/freescale/imx8mq-nitrogen.dts +6
-0+ #address-cells = <1>; + #size-cells = <0>; + + ports { + port@1 { + reg = <1>;Newline between property and child node.
Shawn
Quoted 25 lines
arch/arm64/boot/dts/freescale/imx8mq-nitrogen.dts +18
-0+ mipi_dsi_out: endpoint { + remote-endpoint = <&hdmi_out_in>; + }; + }; + }; +}; + &uart1 { /* console */ pinctrl-names = "default"; pinctrl-0 = <&pinctrl_uart1>;@@ -368,6 +475,19 @@ MX8MQ_IOMUXC_GPIO1_IO06_GPIO1_IO6 0x49 >; }; + pinctrl_i2c4: i2c4grp { + fsl,pins = < + MX8MQ_IOMUXC_I2C4_SCL_I2C4_SCL 0x4000007f + MX8MQ_IOMUXC_I2C4_SDA_I2C4_SDA 0x4000007f + >; + }; + + pinctrl_max7323: max7323grp { + fsl,pins = < + MX8MQ_IOMUXC_NAND_RE_B_GPIO3_IO15 0x19 + >;
Quoted 8 lines
Quoted 8 lines
arch/arm64/boot/dts/freescale/imx8mq-nitrogen.dts +2
-1+ }; + pinctrl_reg_arm_dram: reg-arm-dramgrp { fsl,pins = < MX8MQ_IOMUXC_SAI5_RXD3_GPIO3_IO24 0x16 --2.25.1
The other comments are OK.
I will send you an updated patch set.
Thanks again,
PATCH v3 4/4 arm64: defconfig: Enable LT8912B DRM bridge driver
In reply to Adrien GrasseinThis driver is used by the Nitrogen8 SBC.
--- arch/arm64/configs/defconfig | 1 + 1 file changed, 1 insertion(+)
arch/arm64/configs/defconfig +1 -0
@@ -690,6 +690,7 @@ CONFIG_DRM_PANEL_RAYDIUM_RM67191=m CONFIG_DRM_PANEL_SITRONIX_ST7703=m CONFIG_DRM_PANEL_TRULY_NT35597_WQXGA=m CONFIG_DRM_DISPLAY_CONNECTOR=m +CONFIG_DRM_LONTIUM_LT8912B=m CONFIG_DRM_NWL_MIPI_DSI=m CONFIG_DRM_LONTIUM_LT9611=m CONFIG_DRM_SII902X=m
Signature · 1 line
2.25.1