All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH V2 1/2] arm: dts: imx8mm-beacon: Resync dtsi with Kernel 5.17-rc1
@ 2022-01-22 18:27 Adam Ford
  2022-01-22 18:27 ` [PATCH V2 2/2] imx: imx8mm_beacon: Enable USB Adam Ford
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Adam Ford @ 2022-01-22 18:27 UTC (permalink / raw)
  To: u-boot; +Cc: sbabic, festevam, uboot-imx, trini, Adam Ford

Resync the SOM and baseboar files with the device trees that will
be included in 5.17-RC1 when it's cut.  This will improve pinmuxing
for USDHC1 and add USB functionality.

Signed-off-by: Adam Ford <aford173@gmail.com>

diff --git a/arch/arm/dts/imx8mm-beacon-baseboard.dtsi b/arch/arm/dts/imx8mm-beacon-baseboard.dtsi
index d6b9dedd16..4097a66163 100644
--- a/arch/arm/dts/imx8mm-beacon-baseboard.dtsi
+++ b/arch/arm/dts/imx8mm-beacon-baseboard.dtsi
@@ -43,6 +43,17 @@
 		enable-active-high;
 	};
 
+	reg_usbotg1: regulator-usbotg1 {
+		compatible = "regulator-fixed";
+		pinctrl-names = "default";
+		pinctrl-0 = <&pinctrl_reg_usb_otg1>;
+		regulator-name = "usb_otg_vbus";
+		regulator-min-microvolt = <5000000>;
+		regulator-max-microvolt = <5000000>;
+		gpio = <&gpio4 29 GPIO_ACTIVE_HIGH>;
+		enable-active-high;
+	};
+
 	reg_usdhc2_vmmc: regulator-usdhc2 {
 		compatible = "regulator-fixed";
 		regulator-name = "VSD_3V3";
@@ -102,7 +113,6 @@
 		compatible = "wlf,wm8962";
 		reg = <0x1a>;
 		clocks = <&clk IMX8MM_CLK_SAI3_ROOT>;
-		clock-names = "xclk";
 		DCVDD-supply = <&reg_audio>;
 		DBVDD-supply = <&reg_audio>;
 		AVDD-supply = <&reg_audio>;
@@ -170,6 +180,24 @@
 	status = "okay";
 };
 
+&usbotg1 {
+	vbus-supply = <&reg_usbotg1>;
+	disable-over-current;
+	dr_mode="otg";
+	status = "okay";
+};
+
+&usbotg2 {
+	pinctrl-names = "default";
+	disable-over-current;
+	dr_mode="host";
+	status = "okay";
+};
+
+&usbphynop2 {
+	reset-gpios = <&pca6416_1 7 GPIO_ACTIVE_HIGH>;
+};
+
 &usdhc2 {
 	pinctrl-names = "default", "state_100mhz", "state_200mhz";
 	pinctrl-0 = <&pinctrl_usdhc2>, <&pinctrl_usdhc2_gpio>;
@@ -216,6 +244,12 @@
 		>;
 	};
 
+	pinctrl_reg_usb_otg1: usbotg1grp {
+		fsl,pins = <
+			MX8MM_IOMUXC_SAI3_RXC_GPIO4_IO29     0x19
+		>;
+	};
+
 	pinctrl_sai3: sai3grp {
 		fsl,pins = <
 			MX8MM_IOMUXC_SAI3_TXFS_SAI3_TX_SYNC     0xd6
diff --git a/arch/arm/dts/imx8mm-beacon-som.dtsi b/arch/arm/dts/imx8mm-beacon-som.dtsi
index d897913537..cf07987ccc 100644
--- a/arch/arm/dts/imx8mm-beacon-som.dtsi
+++ b/arch/arm/dts/imx8mm-beacon-som.dtsi
@@ -91,7 +91,7 @@
 		#size-cells = <1>;
 		compatible = "jedec,spi-nor";
 		spi-max-frequency = <80000000>;
-		spi-tx-bus-width = <4>;
+		spi-tx-bus-width = <1>;
 		spi-rx-bus-width = <4>;
 	};
 };
@@ -256,12 +256,13 @@
 &usdhc1 {
 	#address-cells = <1>;
 	#size-cells = <0>;
-	pinctrl-names = "default";
+	pinctrl-names = "default", "state_100mhz", "state_200mhz";
 	pinctrl-0 = <&pinctrl_usdhc1>;
+	pinctrl-1 = <&pinctrl_usdhc1_100mhz>;
+	pinctrl-2 = <&pinctrl_usdhc1_200mhz>;
 	bus-width = <4>;
 	non-removable;
 	cap-power-off-card;
-	pm-ignore-notify;
 	keep-power-in-suspend;
 	mmc-pwrseq = <&usdhc1_pwrseq>;
 	status = "okay";
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH V2 2/2] imx: imx8mm_beacon: Enable USB
  2022-01-22 18:27 [PATCH V2 1/2] arm: dts: imx8mm-beacon: Resync dtsi with Kernel 5.17-rc1 Adam Ford
@ 2022-01-22 18:27 ` Adam Ford
  2022-01-22 20:14   ` Fabio Estevam
  2022-02-05 16:39   ` sbabic
  2022-01-22 20:12 ` [PATCH V2 1/2] arm: dts: imx8mm-beacon: Resync dtsi with Kernel 5.17-rc1 Fabio Estevam
  2022-02-05 16:39 ` sbabic
  2 siblings, 2 replies; 7+ messages in thread
From: Adam Ford @ 2022-01-22 18:27 UTC (permalink / raw)
  To: u-boot; +Cc: sbabic, festevam, uboot-imx, trini, Adam Ford

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.

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
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH V2 1/2] arm: dts: imx8mm-beacon: Resync dtsi with Kernel 5.17-rc1
  2022-01-22 18:27 [PATCH V2 1/2] arm: dts: imx8mm-beacon: Resync dtsi with Kernel 5.17-rc1 Adam Ford
  2022-01-22 18:27 ` [PATCH V2 2/2] imx: imx8mm_beacon: Enable USB Adam Ford
@ 2022-01-22 20:12 ` Fabio Estevam
  2022-02-05 16:39 ` sbabic
  2 siblings, 0 replies; 7+ messages in thread
From: Fabio Estevam @ 2022-01-22 20:12 UTC (permalink / raw)
  To: Adam Ford; +Cc: U-Boot-Denx, Stefano Babic, dl-uboot-imx, Tom Rini

On Sat, Jan 22, 2022 at 3:27 PM Adam Ford <aford173@gmail.com> wrote:
>
> Resync the SOM and baseboar files with the device trees that will
> be included in 5.17-RC1 when it's cut.  This will improve pinmuxing
> for USDHC1 and add USB functionality.
>
> Signed-off-by: Adam Ford <aford173@gmail.com>

Reviewed-by: Fabio Estevam <festevam@gmail.com>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH V2 2/2] imx: imx8mm_beacon: Enable USB
  2022-01-22 18:27 ` [PATCH V2 2/2] imx: imx8mm_beacon: Enable USB Adam Ford
@ 2022-01-22 20:14   ` Fabio Estevam
  2022-01-22 20:17     ` Adam Ford
  2022-02-05 16:39   ` sbabic
  1 sibling, 1 reply; 7+ messages in thread
From: Fabio Estevam @ 2022-01-22 20:14 UTC (permalink / raw)
  To: Adam Ford; +Cc: U-Boot-Denx, Stefano Babic, dl-uboot-imx, Tom Rini

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>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH V2 2/2] imx: imx8mm_beacon: Enable USB
  2022-01-22 20:14   ` Fabio Estevam
@ 2022-01-22 20:17     ` Adam Ford
  0 siblings, 0 replies; 7+ messages in thread
From: Adam Ford @ 2022-01-22 20:17 UTC (permalink / raw)
  To: Fabio Estevam; +Cc: U-Boot-Denx, Stefano Babic, dl-uboot-imx, Tom Rini

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>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH V2 2/2] imx: imx8mm_beacon: Enable USB
  2022-01-22 18:27 ` [PATCH V2 2/2] imx: imx8mm_beacon: Enable USB Adam Ford
  2022-01-22 20:14   ` Fabio Estevam
@ 2022-02-05 16:39   ` sbabic
  1 sibling, 0 replies; 7+ messages in thread
From: sbabic @ 2022-02-05 16:39 UTC (permalink / raw)
  To: Adam Ford, u-boot

> 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

-- 
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic@denx.de
=====================================================================

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH V2 1/2] arm: dts: imx8mm-beacon: Resync dtsi with Kernel 5.17-rc1
  2022-01-22 18:27 [PATCH V2 1/2] arm: dts: imx8mm-beacon: Resync dtsi with Kernel 5.17-rc1 Adam Ford
  2022-01-22 18:27 ` [PATCH V2 2/2] imx: imx8mm_beacon: Enable USB Adam Ford
  2022-01-22 20:12 ` [PATCH V2 1/2] arm: dts: imx8mm-beacon: Resync dtsi with Kernel 5.17-rc1 Fabio Estevam
@ 2022-02-05 16:39 ` sbabic
  2 siblings, 0 replies; 7+ messages in thread
From: sbabic @ 2022-02-05 16:39 UTC (permalink / raw)
  To: Adam Ford, u-boot

> Resync the SOM and baseboar files with the device trees that will
> be included in 5.17-RC1 when it's cut.  This will improve pinmuxing
> for USDHC1 and add USB functionality.
> Signed-off-by: Adam Ford <aford173@gmail.com>
> Reviewed-by: Fabio Estevam <festevam@gmail.com>
> diff --git a/arch/arm/dts/imx8mm-beacon-baseboard.dtsi b/arch/arm/dts/imx8mm-beacon-baseboard.dtsi
> index d6b9dedd16..4097a66163 100644
> --- a/arch/arm/dts/imx8mm-beacon-baseboard.dtsi
> +++ b/arch/arm/dts/imx8mm-beacon-baseboard.dtsi
> @@ -43,6 +43,17 @@
>  		enable-active-high;
>  	};
>  
> +	reg_usbotg1: regulator-usbotg1 {
> +		compatible = "regulator-fixed";
> +		pinctrl-names = "default";
> +		pinctrl-0 = <&pinctrl_reg_usb_otg1>;
> +		regulator-name = "usb_otg_vbus";
> +		regulator-min-microvolt = <5000000>;
> +		regulator-max-microvolt = <5000000>;
> +		gpio = <&gpio4 29 GPIO_ACTIVE_HIGH>;
> +		enable-active-high;
> +	};
> +
>  	reg_usdhc2_vmmc: regulator-usdhc2 {
>  		compatible = "regulator-fixed";
>  		regulator-name = "VSD_3V3";
> @@ -102,7 +113,6 @@
>  		compatible = "wlf,wm8962";
>  		reg = <0x1a>;
>  		clocks = <&clk IMX8MM_CLK_SAI3_ROOT>;
> -		clock-names = "xclk";
>  		DCVDD-supply = <&reg_audio>;
>  		DBVDD-supply = <&reg_audio>;
>  		AVDD-supply = <&reg_audio>;
> @@ -170,6 +180,24 @@
>  	status = "okay";
>  };
>  
> +&usbotg1 {
> +	vbus-supply = <&reg_usbotg1>;
> +	disable-over-current;
> +	dr_mode="otg";
> +	status = "okay";
> +};
> +
> +&usbotg2 {
> +	pinctrl-names = "default";
> +	disable-over-current;
> +	dr_mode="host";
> +	status = "okay";
> +};
> +
> +&usbphynop2 {
> +	reset-gpios = <&pca6416_1 7 GPIO_ACTIVE_HIGH>;
> +};
> +
>  &usdhc2 {
>  	pinctrl-names = "default", "state_100mhz", "state_200mhz";
>  	pinctrl-0 = <&pinctrl_usdhc2>, <&pinctrl_usdhc2_gpio>;
> @@ -216,6 +244,12 @@
>  		>;
>  	};
>  
> +	pinctrl_reg_usb_otg1: usbotg1grp {
> +		fsl,pins = <
> +			MX8MM_IOMUXC_SAI3_RXC_GPIO4_IO29     0x19
> +		>;
> +	};
> +
>  	pinctrl_sai3: sai3grp {
>  		fsl,pins = <
>  			MX8MM_IOMUXC_SAI3_TXFS_SAI3_TX_SYNC     0xd6
> diff --git a/arch/arm/dts/imx8mm-beacon-som.dtsi b/arch/arm/dts/imx8mm-beacon-som.dtsi
> index d897913537..cf07987ccc 100644
> --- a/arch/arm/dts/imx8mm-beacon-som.dtsi
> +++ b/arch/arm/dts/imx8mm-beacon-som.dtsi
> @@ -91,7 +91,7 @@
>  		#size-cells = <1>;
>  		compatible = "jedec,spi-nor";
>  		spi-max-frequency = <80000000>;
> -		spi-tx-bus-width = <4>;
> +		spi-tx-bus-width = <1>;
>  		spi-rx-bus-width = <4>;
>  	};
>  };
> @@ -256,12 +256,13 @@
>  &usdhc1 {
>  	#address-cells = <1>;
>  	#size-cells = <0>;
> -	pinctrl-names = "default";
> +	pinctrl-names = "default", "state_100mhz", "state_200mhz";
>  	pinctrl-0 = <&pinctrl_usdhc1>;
> +	pinctrl-1 = <&pinctrl_usdhc1_100mhz>;
> +	pinctrl-2 = <&pinctrl_usdhc1_200mhz>;
>  	bus-width = <4>;
>  	non-removable;
>  	cap-power-off-card;
> -	pm-ignore-notify;
>  	keep-power-in-suspend;
>  	mmc-pwrseq = <&usdhc1_pwrseq>;
>  	status = "okay";
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic@denx.de
=====================================================================

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-02-05 16:41 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-22 18:27 [PATCH V2 1/2] arm: dts: imx8mm-beacon: Resync dtsi with Kernel 5.17-rc1 Adam Ford
2022-01-22 18:27 ` [PATCH V2 2/2] imx: imx8mm_beacon: Enable USB Adam Ford
2022-01-22 20:14   ` Fabio Estevam
2022-01-22 20:17     ` Adam Ford
2022-02-05 16:39   ` sbabic
2022-01-22 20:12 ` [PATCH V2 1/2] arm: dts: imx8mm-beacon: Resync dtsi with Kernel 5.17-rc1 Fabio Estevam
2022-02-05 16:39 ` sbabic

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.