diff mbox series

[V2,2/2] imx: imx8mm_beacon: Enable USB

Message ID 20220122182734.25580-2-aford173@gmail.com
State Accepted
Commit 2f95456a9a1a4b12454fdd35a77afa14b8549434
Delegated to: Stefano Babic
Headers show
Series [V2,1/2] arm: dts: imx8mm-beacon: Resync dtsi with Kernel 5.17-rc1 | expand

Commit Message

Adam Ford Jan. 22, 2022, 6:27 p.m. UTC
With the updated device tree's having USB support, enable in
U-Boot.  This also requires the addition of the imx8m power
domain, since the USB is gated by the power domain controller.

Signed-off-by: Adam Ford <aford173@gmail.com>
---
V2:  Rebase on master.  Change imx8mm-beacon-kit-u-boot
     to default to host mode, because gadget calls can
     override it.

Comments

Fabio Estevam Jan. 22, 2022, 8:14 p.m. UTC | #1
Hi Adam,

On Sat, Jan 22, 2022 at 3:27 PM Adam Ford <aford173@gmail.com> wrote:
>
> With the updated device tree's having USB support, enable in
> U-Boot.  This also requires the addition of the imx8m power
> domain, since the USB is gated by the power domain controller.
>
> Signed-off-by: Adam Ford <aford173@gmail.com>
> ---
> V2:  Rebase on master.  Change imx8mm-beacon-kit-u-boot
>      to default to host mode, because gadget calls can
>      override it.

I assume this needs your patch below, correct?
[PATCH V3] usb: ehci-mx6: Enable OTG detection on imx8mm and imx8mn

Reviewed-by: Fabio Estevam <festevam@gmail.com>
Adam Ford Jan. 22, 2022, 8:17 p.m. UTC | #2
On Sat, Jan 22, 2022 at 2:14 PM Fabio Estevam <festevam@gmail.com> wrote:
>
> Hi Adam,
>
> On Sat, Jan 22, 2022 at 3:27 PM Adam Ford <aford173@gmail.com> wrote:
> >
> > With the updated device tree's having USB support, enable in
> > U-Boot.  This also requires the addition of the imx8m power
> > domain, since the USB is gated by the power domain controller.
> >
> > Signed-off-by: Adam Ford <aford173@gmail.com>
> > ---
> > V2:  Rebase on master.  Change imx8mm-beacon-kit-u-boot
> >      to default to host mode, because gadget calls can
> >      override it.
>
> I assume this needs your patch below, correct?
> [PATCH V3] usb: ehci-mx6: Enable OTG detection on imx8mm and imx8mn

No, I added the change to imx8mm-beacon-kit-u-boot to avoid the
necessity of the other patch.  They are also not mutually exclusive,
so if the  OTG auto detection gets added we can remove the
customization in imx8mm-beacon-kit-u-boot, but it also shouldn't hurt
anything either.

adam
>
> Reviewed-by: Fabio Estevam <festevam@gmail.com>
Stefano Babic Feb. 5, 2022, 4:39 p.m. UTC | #3
> With the updated device tree's having USB support, enable in
> U-Boot.  This also requires the addition of the imx8m power
> domain, since the USB is gated by the power domain controller.
> Signed-off-by: Adam Ford <aford173@gmail.com>
> Reviewed-by: Fabio Estevam <festevam@gmail.com>
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic
diff mbox series

Patch

diff --git a/arch/arm/dts/imx8mm-beacon-kit-u-boot.dtsi b/arch/arm/dts/imx8mm-beacon-kit-u-boot.dtsi
index 73ddfdade6..e33e10ac12 100644
--- a/arch/arm/dts/imx8mm-beacon-kit-u-boot.dtsi
+++ b/arch/arm/dts/imx8mm-beacon-kit-u-boot.dtsi
@@ -77,6 +77,10 @@ 
 	u-boot,dm-spl;
 };
 
+&usbotg1 {
+	dr_mode="host";
+};
+
 &usdhc2 {
 	u-boot,dm-spl;
 };
diff --git a/configs/imx8mm_beacon_defconfig b/configs/imx8mm_beacon_defconfig
index ba9c9a3ee0..14b34e6516 100644
--- a/configs/imx8mm_beacon_defconfig
+++ b/configs/imx8mm_beacon_defconfig
@@ -45,6 +45,8 @@  CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_PART=y
 CONFIG_CMD_SPI=y
+CONFIG_CMD_USB=y
+CONFIG_CMD_USB_MASS_STORAGE=y
 CONFIG_CMD_DHCP=y
 CONFIG_CMD_MII=y
 CONFIG_CMD_PING=y
@@ -96,6 +98,8 @@  CONFIG_MII=y
 CONFIG_PINCTRL=y
 CONFIG_SPL_PINCTRL=y
 CONFIG_PINCTRL_IMX8M=y
+CONFIG_POWER_DOMAIN=y
+CONFIG_IMX8M_POWER_DOMAIN=y
 CONFIG_DM_PMIC=y
 CONFIG_DM_PMIC_BD71837=y
 CONFIG_SPL_DM_PMIC_BD71837=y
@@ -118,4 +122,13 @@  CONFIG_SPL_SYSRESET=y
 CONFIG_SYSRESET_PSCI=y
 CONFIG_SYSRESET_WATCHDOG=y
 CONFIG_DM_THERMAL=y
+CONFIG_USB=y
+# CONFIG_SPL_DM_USB is not set
+CONFIG_USB_EHCI_HCD=y
+CONFIG_USB_STORAGE=y
+CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_VENDOR_NUM=0x0525
+CONFIG_USB_GADGET_PRODUCT_NUM=0xa4a5
+CONFIG_CI_UDC=y
+CONFIG_USB_GADGET_DOWNLOAD=y
 CONFIG_IMX_WATCHDOG=y