Skip to contentSkip to conversation

imx93-phyboard-segin: Add USB support.

PATCH In review Mathieu Othacehe 4 participants 11 messages Mar 21, 2024 – Mar 26, 2024

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

v3 cover imx93-phyboard-segin: Add USB support.

Hello,

This series adds USB support to imx93-phyboard-segin, in the same way as it has been done for imx93_var_som here:

https://lists.denx.de/pipermail/u-boot/2024-February/546301.html

Thanks,

Mathieu

Changelog:

v1: https://lists.denx.de/pipermail/u-boot/2024-March/548613.html

Mathieu Othacehe (3):
arm: dts: imx93-phyboard-segin: Add USB support
configs: imx93-phyboard-segin: Add USB support
configs: imx93-phyboard-segin: Add fastboot support

 arch/arm/dts/imx93-phyboard-segin-u-boot.dtsi | 15 +++++++++++++++
 configs/imx93-phyboard-segin_defconfig        | 14 ++++++++++++++
 2 files changed, 29 insertions(+)
Signature · 1 line
2.41.0
#10 lore raw

PATCH v3 3/3 configs: imx93-phyboard-segin: Add fastboot support

Enable the fastboot command.

---
 configs/imx93-phyboard-segin_defconfig | 6 ++++++
 1 file changed, 6 insertions(+)
configs/imx93-phyboard-segin_defconfig +6 -0
index 0345e7deeab..54215c51c08 100644
@@ -94,6 +94,12 @@ CONFIG_SPL_CLK_IMX93=y
 CONFIG_CLK_IMX93=y
 CONFIG_DFU_MMC=y
 CONFIG_DFU_RAM=y
+CONFIG_USB_FUNCTION_FASTBOOT=y
+CONFIG_FASTBOOT_BUF_ADDR=0x82800000
+CONFIG_FASTBOOT_BUF_SIZE=0x20000000
+CONFIG_FASTBOOT_FLASH=y
+CONFIG_FASTBOOT_UUU_SUPPORT=y
+CONFIG_FASTBOOT_FLASH_MMC_DEV=0
 CONFIG_GPIO_HOG=y
 CONFIG_IMX_RGPIO2P=y
 CONFIG_DM_I2C=y
Signature · 1 line
2.41.0
#1 lore raw

PATCH v3 1/3 arm: dts: imx93-phyboard-segin: Add USB support

In reply to Mathieu Othacehe

Enable both usbotg1 and usbotg2 ports. Disable over-current as OC pins are not connected to the SoC.

This is temporary, until USB support is added to imx93-phyboard-segin.dts in Linux.

---
 arch/arm/dts/imx93-phyboard-segin-u-boot.dtsi | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
arch/arm/dts/imx93-phyboard-segin-u-boot.dtsi +15 -0
index 8bf28c2de87..6897c91f4d9 100644
@@ -121,6 +121,21 @@
 	bootph-some-ram;
 };
 
+/*
+ * Remove once USB support is added to imx93-phyboard-segin.dts upstream.
+ */
+&usbotg1 {
+	disable-over-current;
+	dr_mode = "otg";
+	status = "okay";
+};
+
+&usbotg2 {
+	disable-over-current;
+	dr_mode = "host";
+	status = "okay";
+};
+
 &usdhc1 {
 	bootph-pre-ram;
 	bootph-some-ram;
Signature · 1 line
2.41.0
#5 lore raw

PATCH v3 2/3 configs: imx93-phyboard-segin: Add USB support

In reply to Mathieu Othacehe

Add USB support by enabling usb command and required USB drivers.

---
 configs/imx93-phyboard-segin_defconfig | 8 ++++++++
 1 file changed, 8 insertions(+)
configs/imx93-phyboard-segin_defconfig +8 -0
index 24f9bd553aa..0345e7deeab 100644
@@ -67,6 +67,7 @@ CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_POWEROFF=y
+CONFIG_CMD_USB=y
 CONFIG_CMD_SNTP=y
 CONFIG_CMD_CACHE=y
 CONFIG_CMD_EFIDEBUG=y
@@ -132,6 +133,13 @@ CONFIG_SPL_SYSRESET=y
 CONFIG_SYSRESET_WATCHDOG=y
 CONFIG_DM_THERMAL=y
 CONFIG_IMX_TMU=y
+CONFIG_USB=y
+CONFIG_USB_EHCI_HCD=y
+CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="PHYTEC"
+CONFIG_USB_GADGET_VENDOR_NUM=0x1fc9
+CONFIG_USB_GADGET_PRODUCT_NUM=0x0152
+CONFIG_CI_UDC=y
 CONFIG_ULP_WATCHDOG=y
 CONFIG_LZO=y
 CONFIG_BZIP2=y
Signature · 1 line
2.41.0
reviewer Reviewed-by on v3 1/3
#2 lore raw

Re: [PATCH v3 1/3] arm: dts: imx93-phyboard-segin: Add USB support

In reply to Mathieu Othacehe

Hi Mathieu,

Quoted 8 lines · Mathieu Othacehe

Enable both usbotg1 and usbotg2 ports. Disable over-current as OC pins are not connected to the SoC.

This is temporary, until USB support is added to imx93-phyboard-segin.dts in Linux.

Thanks, this looks better:

Reviewed-by on v3 1/3
#3 lore raw

Re: [PATCH v3 1/3] arm: dts: imx93-phyboard-segin: Add USB support

In reply to Mathieu Othacehe
Quoted 4 lines · Mathieu Othacehe

Enable both usbotg1 and usbotg2 ports. Disable over-current as OC pins are not connected to the SoC.

This

"This addition to ...-u-boot.dtsi is temporary, ..." would be clearer.

Quoted 4 lines

is temporary, until USB support is added to imx93-phyboard-segin.dts in Linux.

#6 lore raw

Re: [PATCH v3 2/3] configs: imx93-phyboard-segin: Add USB support

In reply to Mathieu Othacehe
Quoted 20 lines · Mathieu Othacehe

Add USB support by enabling usb command and required USB drivers.

---
  configs/imx93-phyboard-segin_defconfig | 8 ++++++++
  1 file changed, 8 insertions(+)
configs/imx93-phyboard-segin_defconfig +1 -0
index 24f9bd553aa..0345e7deeab 100644
@@ -67,6 +67,7 @@ CONFIG_CMD_GPIO=y
  CONFIG_CMD_I2C=y
  CONFIG_CMD_MMC=y
  CONFIG_CMD_POWEROFF=y
+CONFIG_CMD_USB=y
  CONFIG_CMD_SNTP=y
  CONFIG_CMD_CACHE=y
  CONFIG_CMD_EFIDEBUG=y

configs/imx93-phyboard-segin_defconfig CONFIG_SPL_SYSRESET=y · line 139

Quoted 7 lines
configs/imx93-phyboard-segin_defconfig +4 -0
@@ -132,6 +133,13 @@ CONFIG_SPL_SYSRESET=y
  CONFIG_SYSRESET_WATCHDOG=y
  CONFIG_DM_THERMAL=y
  CONFIG_IMX_TMU=y
+CONFIG_USB=y
+CONFIG_USB_EHCI_HCD=y
+CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="PHYTEC"
$ git grep -i usb.*phytec configs
configs/phycore_pcl063_defconfig:CONFIG_USB_GADGET_MANUFACTURER="Phytec"
configs/phycore_pcl063_ull_defconfig:CONFIG_USB_GADGET_MANUFACTURER="Phytec"

It would be good to be consistent.

Also, what is the vendor/product number those two boards use ?

Also, it would be good to fix the extra leading zero in those board boards vendor number, this, in both configs:

CONFIG_USB_GADGET_VENDOR_NUM=0x01b67

reviewer
#4 lore raw

Re: [PATCH v3 1/3] arm: dts: imx93-phyboard-segin: Add USB support

In reply to Marek Vasut
Quoted 8 lines · Marek Vasut
Quoted 4 lines · Mathieu Othacehe

Enable both usbotg1 and usbotg2 ports. Disable over-current as OC pins are not connected to the SoC.

This

"This addition to ...-u-boot.dtsi is temporary, ..." would be clearer.

I fixed as Marek's suggestion and applied it to u-boot-imx/next, thanks.

reviewer
#7 lore raw

Re: [PATCH v3 2/3] configs: imx93-phyboard-segin: Add USB support

In reply to Marek Vasut
Quoted 7 lines · Marek Vasut
$ git grep -i usb.*phytec configs
configs/phycore_pcl063_defconfig:CONFIG_USB_GADGET_MANUFACTURER="Phytec"
configs/phycore_pcl063_ull_defconfig:CONFIG_USB_GADGET_MANUFACTURER="Phytec"

It would be good to be consistent.

Also, what is the vendor/product number those two boards use ?

They both use:

CONFIG_USB_GADGET_VENDOR_NUM=0x01b67
CONFIG_USB_GADGET_PRODUCT_NUM=0x4fff

configs/phycore-imx8mp_defconfig has:

CONFIG_USB_GADGET_MANUFACTURER="FSL"
CONFIG_USB_GADGET_VENDOR_NUM=0x0525
CONFIG_USB_GADGET_PRODUCT_NUM=0xa4a5

I agree we should make this consistent.

To not block this series, I applied it, but it would be great if Phytec could submit
a separate series making it consistent across their boards.

Thanks

#8 lore raw

Re: [PATCH v3 2/3] configs: imx93-phyboard-segin: Add USB support

Quoted 6 lines · Fabio Estevam
Quoted 4 lines · Marek Vasut
$ git grep -i usb.*phytec configs
configs/phycore_pcl063_defconfig:CONFIG_USB_GADGET_MANUFACTURER="Phytec"
configs/phycore_pcl063_ull_defconfig:CONFIG_USB_GADGET_MANUFACTURER="Phytec"
Quoted 7 lines
Quoted 3 lines

It would be good to be consistent.

Also, what is the vendor/product number those two boards use ?

They both use:

CONFIG_USB_GADGET_VENDOR_NUM=0x01b67

USB VID is 16bit number, the nubmer above is 20bit , drop the leading zero while at it.

#9 lore raw

Re: [PATCH v3 2/3] configs: imx93-phyboard-segin: Add USB support

In reply to Fabio Estevam

Hi Fabio, hi Marek,

Quoted 21 lines · Fabio Estevam
Quoted 7 lines · Marek Vasut
$ git grep -i usb.*phytec configs
configs/phycore_pcl063_defconfig:CONFIG_USB_GADGET_MANUFACTURER="Phytec"
configs/phycore_pcl063_ull_defconfig:CONFIG_USB_GADGET_MANUFACTURER="Phytec"

It would be good to be consistent.

Also, what is the vendor/product number those two boards use ?

They both use:

CONFIG_USB_GADGET_VENDOR_NUM=0x01b67
CONFIG_USB_GADGET_PRODUCT_NUM=0x4fff

configs/phycore-imx8mp_defconfig has:

CONFIG_USB_GADGET_MANUFACTURER="FSL"
CONFIG_USB_GADGET_VENDOR_NUM=0x0525
CONFIG_USB_GADGET_PRODUCT_NUM=0xa4a5

Quoted 7 lines

I agree we should make this consistent.

To not block this series, I applied it, but it would be great if

Phytec could submit
a separate series making it consistent across their boards.

We'll take care of that. Thank you for the feedback.

Yannic

Quoted 2 lines

Thanks