Skip to contentSkip to conversation

USB: i.MX: Make DT dr_mode & phy_type parameters kernel compatible

PATCH In review Alexander Shiyan 2 participants 3 messages Oct 29, 2013 – Nov 4, 2013

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

PATCH 1/2 USB: i.MX: Make DT dr_mode & phy_type parameters kernel compatible

Since the mainline kernel now has its own dr_mode and phy_type DT-options for setting modes of USB ports, do these kernel parameters compatible by removing "barebox" prefix.

---
 arch/arm/dts/imx6q-gk802.dts            | 6 ++----
 arch/arm/dts/imx6q-tqma6x.dts           | 3 +--
 arch/arm/dts/imx6qdl-dfi-fs700-m60.dtsi | 8 ++++----
 arch/arm/dts/imx6qdl-mba6x.dtsi         | 5 ++---
 drivers/usb/core/of.c                   | 4 ++--
 5 files changed, 11 insertions(+), 15 deletions(-)
arch/arm/dts/imx6q-gk802.dts +2 -4
index 16c0bad..b34a491 100644
@@ -113,18 +113,16 @@
 
 /* External USB-A port (USBOTG) */
 &usbotg {
-	phy-mode = "utmi";
+	phy_type = "utmi";
 	dr_mode = "host";
-	barebox,phy_type = "utmi";
 	disable-over-current;
 	status = "okay";
 };
 
 /* Internal USB port (USBH1), connected to RTL8192CU */
 &usbh1 {
-	phy-mode = "utmi";
+	phy_type = "utmi";
 	dr_mode = "host";
-	barebox,phy_type = "utmi";
 	disable-over-current;
 	status = "okay";
 };
arch/arm/dts/imx6q-tqma6x.dts +1 -2
index 639c181..597388e 100644
@@ -294,8 +294,7 @@
 &usbotg {
 	pinctrl-names = "default";
 	pinctrl-0 = <&pinctrl_usbotg_1>;
-	barebox,phy_type = "utmi";
-	barebox,dr_mode = "peripheral";
+	phy_type = "utmi";
 	dr_mode = "host";
 	disable-over-current;
 	otg_id_pin_select_change;
arch/arm/dts/imx6qdl-dfi-fs700-m60.dtsi +4 -4
index c5c9a48..04bb213 100644
@@ -79,8 +79,8 @@
 };
 
 &usbh1 {
-	barebox,phy_type = "utmi";
-	barebox,dr_mode = "host";
+	phy_type = "utmi";
+	dr_mode = "host";
 	status = "okay";
 };
 
@@ -89,8 +89,8 @@
 	pinctrl-names = "default";
 	pinctrl-0 = <&pinctrl_usbotg_2>;
 	disable-over-current;
-	barebox,phy_type = "utmi";
-	barebox,dr_mode = "host";
+	phy_type = "utmi";
+	dr_mode = "host";
 	status = "okay";
 };
 
arch/arm/dts/imx6qdl-mba6x.dtsi +2 -3
index 4621112..ec002c6 100644
@@ -166,15 +166,14 @@
 
 &usbh1 {
 	status = "okay";
-	barebox,phy_type = "utmi";
+	phy_type = "utmi";
 	disable-over-current;
 };
 
 &usbotg {
 	pinctrl-names = "default";
 	pinctrl-0 = <&pinctrl_usbotg_1>;
-	barebox,phy_type = "utmi";
-	barebox,dr_mode = "peripheral";
+	phy_type = "utmi";
 	dr_mode = "host";
 	disable-over-current;
 	otg_id_pin_select_change;
drivers/usb/core/of.c +2 -2
index 222b760..1ddbdaa 100644
@@ -39,7 +39,7 @@ enum usb_dr_mode of_usb_get_dr_mode(struct device_node *np,
 	int err, i;
 
 	if (!propname)
-		propname = "barebox,dr_mode";
+		propname = "dr_mode";
 
 	err = of_property_read_string(np, propname, &dr_mode);
 	if (err < 0)
@@ -76,7 +76,7 @@ enum usb_phy_interface of_usb_get_phy_mode(struct device_node *np,
 	int err, i;
 
 	if (!propname)
-		propname = "barebox,phy_type";
+		propname = "phy_type";
 
 	err = of_property_read_string(np, propname, &phy_type);
 	if (err < 0)
Signature · 7 lines
1.8.1.5


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#1 lore raw

PATCH 2/2 USB: i.MX5x: Remove usage of MXC_EHCI_INTERNAL_PHY for OTG port

i.MX5x OTG port is hardwired to the internal UTMI PHY, so having this configurable makes no sense and helps using this port with DT.

---
 arch/arm/boards/ccxmx51/ccxmx51.c | 3 +--
 drivers/usb/imx/imx-usb-misc.c    | 3 ---
 2 files changed, 1 insertion(+), 5 deletions(-)
arch/arm/boards/ccxmx51/ccxmx51.c +1 -2
index 6b5acb2..6d2606e 100644
@@ -220,8 +220,7 @@ static const struct spi_board_info ccxmx51_spi_board_info[] = {
 };
 
 static struct imxusb_platformdata ccxmx51_otg_pdata = {
-	.flags	= MXC_EHCI_MODE_UTMI_16_BIT | MXC_EHCI_INTERNAL_PHY |
-		  MXC_EHCI_POWER_PINS_ENABLED,
+	.flags	= MXC_EHCI_MODE_UTMI_16_BIT | MXC_EHCI_POWER_PINS_ENABLED,
 	.mode	= IMX_USB_MODE_HOST,
 };
 
drivers/usb/imx/imx-usb-misc.c +0 -3
index 51d549c..68c8c4b 100644
@@ -279,9 +279,6 @@ static __maybe_unused int mx5_initialize_usb_hw(void __iomem *base, int port,
 
 	switch (port) {
 	case 0:	/* OTG port */
-		if (!(flags & MXC_EHCI_INTERNAL_PHY))
-			return 0;
-
 		/* Adjust UTMI PHY frequency to 24MHz */
 		v = readl(base + MX5_UTMI_PHY_CTRL_1);
 		v = (v & ~0x3) | 0x01;
Signature · 7 lines
1.8.1.5


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
maintainer
#2 lore raw
In reply to Alexander Shiyan
Quoted 5 lines · Alexander Shiyan

Since the mainline kernel now has its own dr_mode and phy_type DT-options for setting modes of USB ports, do these kernel parameters compatible by removing "barebox" prefix.

Applied these two btw.

I still haven't tested 2/2 on my efikasb, but will do this this evening.

Sascha

Quoted 126 lines
---
 arch/arm/dts/imx6q-gk802.dts            | 6 ++----
 arch/arm/dts/imx6q-tqma6x.dts           | 3 +--
 arch/arm/dts/imx6qdl-dfi-fs700-m60.dtsi | 8 ++++----
 arch/arm/dts/imx6qdl-mba6x.dtsi         | 5 ++---
 drivers/usb/core/of.c                   | 4 ++--
 5 files changed, 11 insertions(+), 15 deletions(-)
arch/arm/dts/imx6q-gk802.dts +2 -4
index 16c0bad..b34a491 100644
@@ -113,18 +113,16 @@
 
 /* External USB-A port (USBOTG) */
 &usbotg {
-	phy-mode = "utmi";
+	phy_type = "utmi";
 	dr_mode = "host";
-	barebox,phy_type = "utmi";
 	disable-over-current;
 	status = "okay";
 };
 
 /* Internal USB port (USBH1), connected to RTL8192CU */
 &usbh1 {
-	phy-mode = "utmi";
+	phy_type = "utmi";
 	dr_mode = "host";
-	barebox,phy_type = "utmi";
 	disable-over-current;
 	status = "okay";
 };
arch/arm/dts/imx6q-tqma6x.dts +1 -2
index 639c181..597388e 100644
@@ -294,8 +294,7 @@
 &usbotg {
 	pinctrl-names = "default";
 	pinctrl-0 = <&pinctrl_usbotg_1>;
-	barebox,phy_type = "utmi";
-	barebox,dr_mode = "peripheral";
+	phy_type = "utmi";
 	dr_mode = "host";
 	disable-over-current;
 	otg_id_pin_select_change;
arch/arm/dts/imx6qdl-dfi-fs700-m60.dtsi +4 -4
index c5c9a48..04bb213 100644
@@ -79,8 +79,8 @@
 };
 
 &usbh1 {
-	barebox,phy_type = "utmi";
-	barebox,dr_mode = "host";
+	phy_type = "utmi";
+	dr_mode = "host";
 	status = "okay";
 };
 
@@ -89,8 +89,8 @@
 	pinctrl-names = "default";
 	pinctrl-0 = <&pinctrl_usbotg_2>;
 	disable-over-current;
-	barebox,phy_type = "utmi";
-	barebox,dr_mode = "host";
+	phy_type = "utmi";
+	dr_mode = "host";
 	status = "okay";
 };
 
arch/arm/dts/imx6qdl-mba6x.dtsi +2 -3
index 4621112..ec002c6 100644
@@ -166,15 +166,14 @@
 
 &usbh1 {
 	status = "okay";
-	barebox,phy_type = "utmi";
+	phy_type = "utmi";
 	disable-over-current;
 };
 
 &usbotg {
 	pinctrl-names = "default";
 	pinctrl-0 = <&pinctrl_usbotg_1>;
-	barebox,phy_type = "utmi";
-	barebox,dr_mode = "peripheral";
+	phy_type = "utmi";
 	dr_mode = "host";
 	disable-over-current;
 	otg_id_pin_select_change;
drivers/usb/core/of.c +2 -2
index 222b760..1ddbdaa 100644
@@ -39,7 +39,7 @@ enum usb_dr_mode of_usb_get_dr_mode(struct device_node *np,
 	int err, i;
 
 	if (!propname)
-		propname = "barebox,dr_mode";
+		propname = "dr_mode";
 
 	err = of_property_read_string(np, propname, &dr_mode);
 	if (err < 0)
@@ -76,7 +76,7 @@ enum usb_phy_interface of_usb_get_phy_mode(struct device_node *np,
 	int err, i;
 
 	if (!propname)
-		propname = "barebox,phy_type";
+		propname = "phy_type";
 
 	err = of_property_read_string(np, propname, &phy_type);
 	if (err < 0)
Signature · 7 lines
1.8.1.5


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
Signature · 9 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox