[PATCH v3 0/3] 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(+)

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.
Signed-off-by: Mathieu Othacehe othacehe@gnu.org --- arch/arm/dts/imx93-phyboard-segin-u-boot.dtsi | 15 +++++++++++++++ 1 file changed, 15 insertions(+)
diff --git a/arch/arm/dts/imx93-phyboard-segin-u-boot.dtsi b/arch/arm/dts/imx93-phyboard-segin-u-boot.dtsi index 8bf28c2de87..6897c91f4d9 100644 --- a/arch/arm/dts/imx93-phyboard-segin-u-boot.dtsi +++ b/arch/arm/dts/imx93-phyboard-segin-u-boot.dtsi @@ -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;

Hi Mathieu,
On Thu, Mar 21, 2024 at 11:46 AM Mathieu Othacehe othacehe@gnu.org wrote:
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.
Signed-off-by: Mathieu Othacehe othacehe@gnu.org
Thanks, this looks better:
Reviewed-by: Fabio Estevam festevam@gmail.com

On 3/21/24 3:45 PM, Mathieu Othacehe wrote:
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.
is temporary, until USB support is added to imx93-phyboard-segin.dts in Linux.
Signed-off-by: Mathieu Othacehe othacehe@gnu.org
Reviewed-by: Marek Vasut marex@denx.de

On Thu, Mar 21, 2024 at 4:17 PM Marek Vasut marex@denx.de wrote:
On 3/21/24 3:45 PM, Mathieu Othacehe wrote:
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.

Add USB support by enabling `usb` command and required USB drivers.
Signed-off-by: Mathieu Othacehe othacehe@gnu.org --- configs/imx93-phyboard-segin_defconfig | 8 ++++++++ 1 file changed, 8 insertions(+)
diff --git a/configs/imx93-phyboard-segin_defconfig b/configs/imx93-phyboard-segin_defconfig index 24f9bd553aa..0345e7deeab 100644 --- a/configs/imx93-phyboard-segin_defconfig +++ b/configs/imx93-phyboard-segin_defconfig @@ -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

On 3/21/24 3:45 PM, Mathieu Othacehe wrote:
Add USB support by enabling `usb` command and required USB drivers.
Signed-off-by: Mathieu Othacehe othacehe@gnu.org
configs/imx93-phyboard-segin_defconfig | 8 ++++++++ 1 file changed, 8 insertions(+)
diff --git a/configs/imx93-phyboard-segin_defconfig b/configs/imx93-phyboard-segin_defconfig index 24f9bd553aa..0345e7deeab 100644 --- a/configs/imx93-phyboard-segin_defconfig +++ b/configs/imx93-phyboard-segin_defconfig @@ -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"
$ 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

On Thu, Mar 21, 2024 at 4:17 PM Marek Vasut marex@denx.de wrote:
$ 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

On 3/24/24 7:00 PM, Fabio Estevam wrote:
On Thu, Mar 21, 2024 at 4:17 PM Marek Vasut marex@denx.de wrote:
$ 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
USB VID is 16bit number, the nubmer above is 20bit , drop the leading zero while at it.

Hi Fabio, hi Marek,
On Sun, 2024-03-24 at 15:00 -0300, Fabio Estevam wrote:
On Thu, Mar 21, 2024 at 4:17 PM Marek Vasut marex@denx.de wrote:
$ 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.
We'll take care of that. Thank you for the feedback.
Yannic
Thanks

Enable the `fastboot` command.
Reviewed-by: Marek Vasut marex@denx.de Signed-off-by: Mathieu Othacehe othacehe@gnu.org --- configs/imx93-phyboard-segin_defconfig | 6 ++++++ 1 file changed, 6 insertions(+)
diff --git a/configs/imx93-phyboard-segin_defconfig b/configs/imx93-phyboard-segin_defconfig index 0345e7deeab..54215c51c08 100644 --- a/configs/imx93-phyboard-segin_defconfig +++ b/configs/imx93-phyboard-segin_defconfig @@ -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
participants (4)
-
Fabio Estevam
-
Marek Vasut
-
Mathieu Othacehe
-
Yannic Moog