Skip to contentSkip to conversation

Add USB EHCI support for ls1012aqds

PATCH Superseded Rajesh Bhagat 2 participants 8 messages Jun 9, 2016 – Aug 2, 2016

Subsystems (3)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

v2 cover Add USB EHCI support for ls1012aqds

Adds USB EHCI support for ls1012qds by adding the support for NXP ULPI PHY and adding the support it configuration files. Also enables, USB2 IP in ns access defines.

Rajesh Bhagat (3):
drivers: usb: fsl: add USB ULPI init code
config: ls1012aqds: Add USB EHCI support for ls1012aqds
armv8: ls1012a: Added CSU assignment for USB2

 .../include/asm/arch-fsl-layerscape/immap_lsch2.h  |    1 +
 .../include/asm/arch-fsl-layerscape/ns_access.h    |    2 +
 drivers/usb/host/ehci-fsl.c                        |   21 ++++++++++++++++++++
 include/configs/ls1012aqds.h                       |    5 ++++
 include/usb/ehci-ci.h                              |    2 +-
 5 files changed, 30 insertions(+), 1 deletions(-)
Signature · 1 line
1.7.7.4
#1 lore raw

PATCH v2 1/3 drivers: usb: fsl: add USB ULPI init code

This adds the required code to set up a ULPI USB port, for new NXP USB PHY used in QorIQ platforms.

To use this both CONFIG_USB_ULPI and CONFIG_USB_ULPI_VIEWPORT have to be set in the board configuration file.

---
Changes in v2:
- Changes return value from -1 to ulpi_init ret value

 drivers/usb/host/ehci-fsl.c |   21 +++++++++++++++++++++
 1 files changed, 21 insertions(+), 0 deletions(-)
drivers/usb/host/ehci-fsl.c +21 -0
index a43d37d..d166fad 100644
@@ -16,6 +16,9 @@
 #include <hwconfig.h>
 #include <fsl_usb.h>
 #include <fdt_support.h>
+#ifdef CONFIG_USB_ULPI
+#include <usb/ulpi.h>
+#endif
 
 #include "ehci.h"
 
@@ -50,6 +53,10 @@ int ehci_hcd_init(int index, enum usb_init_type init,
 	const char *phy_type = NULL;
 	size_t len;
 	char current_usb_controller[5];
+#ifdef CONFIG_USB_ULPI
+	int ret;
+	struct ulpi_viewport ulpi_vp;
+#endif
 #ifdef CONFIG_SYS_FSL_USB_INTERNAL_UTMI_PHY
 	char usb_phy[5];
 
@@ -126,6 +133,20 @@ int ehci_hcd_init(int index, enum usb_init_type init,
 		udelay(1000); /* delay required for PHY Clk to appear */
 		if (!usb_phy_clk_valid(ehci))
 			return -EINVAL;
+
+#ifdef CONFIG_USB_ULPI
+		ulpi_vp.viewport_addr = (u32)&ehci->ulpi_viewpoint;
+		ulpi_vp.port_num = 0;
+
+		ret = ulpi_init(&ulpi_vp);
+		if (ret) {
+			puts("NXP ULPI viewport init failed\n");
+			return ret;
+		}
+
+		ulpi_set_vbus(&ulpi_vp, 1, 1);
+		ulpi_set_vbus_indicator(&ulpi_vp, 1, 1, 1);
+#endif
 		out_le32(&(*hcor)->or_portsc[0], PORT_PTS_ULPI);
 	}
 
Signature · 1 line
1.7.7.4
#2 lore raw

PATCH v2 2/3 config: ls1012aqds: Add USB EHCI support for ls1012aqds

In reply to Rajesh Bhagat

Add USB EHCI support for ls1012aqds platform

---
Changes in v2:
- None

 .../include/asm/arch-fsl-layerscape/immap_lsch2.h  |    1 +
 include/configs/ls1012aqds.h                       |    5 +++++
 include/usb/ehci-ci.h                              |    2 +-
 3 files changed, 7 insertions(+), 1 deletions(-)
arch/arm/include/asm/arch-fsl-layerscape/immap_lsch2.h +1 -0
index 0c87c2f..b1637da 100644
@@ -34,6 +34,7 @@
 #define CONFIG_SYS_XHCI_USB1_ADDR		(CONFIG_SYS_IMMR + 0x01f00000)
 #define CONFIG_SYS_XHCI_USB2_ADDR		(CONFIG_SYS_IMMR + 0x02000000)
 #define CONFIG_SYS_XHCI_USB3_ADDR		(CONFIG_SYS_IMMR + 0x02100000)
+#define CONFIG_SYS_EHCI_USB1_ADDR		(CONFIG_SYS_IMMR + 0x07600000)
 #define CONFIG_SYS_PCIE1_ADDR			(CONFIG_SYS_IMMR + 0x2400000)
 #define CONFIG_SYS_PCIE2_ADDR			(CONFIG_SYS_IMMR + 0x2500000)
 #define CONFIG_SYS_PCIE3_ADDR			(CONFIG_SYS_IMMR + 0x2600000)
include/configs/ls1012aqds.h +5 -0
index fcf402c..849a0f7 100644
@@ -117,6 +117,8 @@
 #ifdef CONFIG_HAS_FSL_DR_USB
 #define CONFIG_USB_EHCI
 #define CONFIG_USB_EHCI_FSL
+#define CONFIG_USB_ULPI
+#define CONFIG_USB_ULPI_VIEWPORT
 #define CONFIG_EHCI_HCD_INIT_AFTER_RESET
 #endif
 
@@ -127,6 +129,9 @@
 #define CONFIG_USB_XHCI_FSL
 #define CONFIG_USB_MAX_CONTROLLER_COUNT         1
 #define CONFIG_SYS_USB_XHCI_MAX_ROOT_PORTS      2
+#endif
+
+#if defined(CONFIG_HAS_FSL_DR_USB) || defined(CONFIG_HAS_FSL_XHCI_USB)
 #define CONFIG_USB_STORAGE
 #endif
 
include/usb/ehci-ci.h +1 -1
index 882aed4..38d557c 100644
@@ -159,7 +159,7 @@
 #elif defined(CONFIG_MPC512X)
 #define CONFIG_SYS_FSL_USB1_ADDR CONFIG_SYS_MPC512x_USB1_ADDR
 #define CONFIG_SYS_FSL_USB2_ADDR	0
-#elif defined(CONFIG_LS102XA)
+#elif defined(CONFIG_LS102XA) || defined(CONFIG_LS1012A)
 #define CONFIG_SYS_FSL_USB1_ADDR CONFIG_SYS_EHCI_USB1_ADDR
 #define CONFIG_SYS_FSL_USB2_ADDR        0
 #endif
Signature · 1 line
1.7.7.4
#3 lore raw

PATCH v2 3/3 armv8: ls1012a: Added CSU assignment for USB2

In reply to Rajesh Bhagat

Access settings for USB2 IP is added through CSU register.

Added CSU ID for USB2, reg: CSL23_REG[8:0]

---
Changes in v2:
- None

 .../include/asm/arch-fsl-layerscape/ns_access.h    |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
arch/arm/include/asm/arch-fsl-layerscape/ns_access.h +2 -0
index db76066..b7da381 100644
@@ -38,6 +38,7 @@ enum csu_cslx_ind {
 	CSU_CSLX_ESDHC,
 	CSU_CSLX_IFC = 45,
 	CSU_CSLX_I2C1,
+	CSU_CSLX_USB_2,
 	CSU_CSLX_I2C3 = 48,
 	CSU_CSLX_I2C2,
 	CSU_CSLX_DUART2 = 50,
@@ -117,6 +118,7 @@ static struct csu_ns_dev ns_dev[] = {
 	 {CSU_CSLX_ESDHC, CSU_ALL_RW},
 	 {CSU_CSLX_IFC, CSU_ALL_RW},
 	 {CSU_CSLX_I2C1, CSU_ALL_RW},
+	 {CSU_CSLX_USB_2, CSU_ALL_RW},
 	 {CSU_CSLX_I2C3, CSU_ALL_RW},
 	 {CSU_CSLX_I2C2, CSU_ALL_RW},
 	 {CSU_CSLX_DUART2, CSU_ALL_RW},
Signature · 1 line
1.7.7.4
#4 lore raw

v2 cover Add USB EHCI support for ls1012aqds

In reply to Rajesh Bhagat
Quoted 9 lines · Rajesh Bhagat

Adds USB EHCI support for ls1012qds by adding the support for NXP ULPI PHY and adding the support it configuration files. Also enables, USB2 IP in ns access defines.

Rajesh Bhagat (3):
drivers: usb: fsl: add USB ULPI init code
config: ls1012aqds: Add USB EHCI support for ls1012aqds
armv8: ls1012a: Added CSU assignment for USB2

Quoted 7 lines
 .../include/asm/arch-fsl-layerscape/immap_lsch2.h  |    1 +
 .../include/asm/arch-fsl-layerscape/ns_access.h    |    2 +
 drivers/usb/host/ehci-fsl.c                        |   21 ++++++++++++++++++++
 include/configs/ls1012aqds.h                       |    5 ++++
 include/usb/ehci-ci.h                              |    2 +-
 5 files changed, 30 insertions(+), 1 deletions(-)

I wanted to apply these on u-boot-usb/master , but patch 2 fails to apply. Please rebase and repose.

Signature · 2 lines
Best regards,
Marek Vasut
#5 lore raw

v2 cover Add USB EHCI support for ls1012aqds

Quoted 11 lines

-----Original Message-----
From: Marek Vasut [mailto:marex at denx.de]
Sent: Thursday, June 09, 2016 7:12 PM
To: Rajesh Bhagat <[email protected]>; u-boot at lists.denx.de
Cc: Sriram Dash <[email protected]>; albert.u.boot at aribaud.net; prabhakar at freescale.com; york sun <[email protected]>; Rajat Srivastava <[email protected]>
Subject: Re: [PATCH v2 0/3] Add USB EHCI support for ls1012aqds

Quoted 17 lines
Quoted 16 lines · Rajesh Bhagat

Adds USB EHCI support for ls1012qds by adding the support for NXP ULPI PHY and adding the support it configuration files. Also enables, USB2 IP in ns access defines.

Rajesh Bhagat (3):
drivers: usb: fsl: add USB ULPI init code
config: ls1012aqds: Add USB EHCI support for ls1012aqds
armv8: ls1012a: Added CSU assignment for USB2

 .../include/asm/arch-fsl-layerscape/immap_lsch2.h  |    1 +
 .../include/asm/arch-fsl-layerscape/ns_access.h    |    2 +
 drivers/usb/host/ehci-fsl.c                        |   21 ++++++++++++++++++++
 include/configs/ls1012aqds.h                       |    5 ++++
 include/usb/ehci-ci.h                              |    2 +-
 5 files changed, 30 insertions(+), 1 deletions(-)

Hello Marek,

Quoted 3 lines

I wanted to apply these on u-boot-usb/master , but patch 2 fails to apply. Please rebase and repose.

Can you apply below patch for Layerscape USB macro cleanup for various Soc to apply above patch:

https://patchwork.ozlabs.org/patch/631595/

[root at phoenix u-boot-usb]$ pw-am.sh 631595

2016-06-10 09:02:02 URL:https://patchwork.ozlabs.org/patch/631595/mbox/ [6138] -> "pw-am-631595.patch" [1]
Applying: include: usb: Rename USB controller base address mapping
[root at phoenix u-boot-usb]$ pw-am.sh 632644
2016-06-10 09:02:18 URL:https://patchwork.ozlabs.org/patch/632644/mbox/ [2104] -> "pw-am-632644.patch" [1]
Applying: drivers: usb: fsl: add USB ULPI init code
[root at phoenix u-boot-usb]$ pw-am.sh 632646
2016-06-10 09:02:28 URL:https://patchwork.ozlabs.org/patch/632646/mbox/ [2819] -> "pw-am-632646.patch" [1]
Applying: config: ls1012aqds: Add USB EHCI support for ls1012aqds
[root at phoenix u-boot-usb]$ pw-am.sh 632645
2016-06-10 09:02:36 URL:https://patchwork.ozlabs.org/patch/632645/mbox/ [1501] -> "pw-am-632645.patch" [1]

Applying: armv8: ls1012a: Added CSU assignment for USB2

OR

Please share if there is a need to rebase them.

Best Regards,
Rajesh Bhagat

Quoted 3 lines

--
Best regards,
Marek Vasut

#6 lore raw

v2 cover Add USB EHCI support for ls1012aqds

Quoted 31 lines · Rajesh Bhagat
Quoted 11 lines

-----Original Message-----
From: Marek Vasut [mailto:marex at denx.de]
Sent: Thursday, June 09, 2016 7:12 PM
To: Rajesh Bhagat <[email protected]>; u-boot at lists.denx.de
Cc: Sriram Dash <[email protected]>; albert.u.boot at aribaud.net; prabhakar at freescale.com; york sun <[email protected]>; Rajat Srivastava <[email protected]>
Subject: Re: [PATCH v2 0/3] Add USB EHCI support for ls1012aqds

Quoted 17 lines
Quoted 16 lines · Rajesh Bhagat

Adds USB EHCI support for ls1012qds by adding the support for NXP ULPI PHY and adding the support it configuration files. Also enables, USB2 IP in ns access defines.

Rajesh Bhagat (3):
drivers: usb: fsl: add USB ULPI init code
config: ls1012aqds: Add USB EHCI support for ls1012aqds
armv8: ls1012a: Added CSU assignment for USB2

 .../include/asm/arch-fsl-layerscape/immap_lsch2.h  |    1 +
 .../include/asm/arch-fsl-layerscape/ns_access.h    |    2 +
 drivers/usb/host/ehci-fsl.c                        |   21 ++++++++++++++++++++
 include/configs/ls1012aqds.h                       |    5 ++++
 include/usb/ehci-ci.h                              |    2 +-
 5 files changed, 30 insertions(+), 1 deletions(-)

Hello Marek,

Quoted 8 lines
Quoted 3 lines

I wanted to apply these on u-boot-usb/master , but patch 2 fails to apply. Please rebase and repose.

Can you apply below patch for Layerscape USB macro cleanup for various Soc to apply above patch:

https://patchwork.ozlabs.org/patch/631595/

This has to go through soc tree, so I will have to wait for it to be applied. Let me know when it's in, then I can pick these patches.

Quoted 23 lines

[root at phoenix u-boot-usb]$ pw-am.sh 631595

2016-06-10 09:02:02 URL:https://patchwork.ozlabs.org/patch/631595/mbox/ [6138] -> "pw-am-631595.patch" [1]
Applying: include: usb: Rename USB controller base address mapping
[root at phoenix u-boot-usb]$ pw-am.sh 632644
2016-06-10 09:02:18 URL:https://patchwork.ozlabs.org/patch/632644/mbox/ [2104] -> "pw-am-632644.patch" [1]
Applying: drivers: usb: fsl: add USB ULPI init code
[root at phoenix u-boot-usb]$ pw-am.sh 632646
2016-06-10 09:02:28 URL:https://patchwork.ozlabs.org/patch/632646/mbox/ [2819] -> "pw-am-632646.patch" [1]
Applying: config: ls1012aqds: Add USB EHCI support for ls1012aqds
[root at phoenix u-boot-usb]$ pw-am.sh 632645
2016-06-10 09:02:36 URL:https://patchwork.ozlabs.org/patch/632645/mbox/ [1501] -> "pw-am-632645.patch" [1]

Applying: armv8: ls1012a: Added CSU assignment for USB2

OR

Please share if there is a need to rebase them.

Best Regards,
Rajesh Bhagat

Quoted 3 lines

--
Best regards,
Marek Vasut

Signature · 2 lines
Best regards,
Marek Vasut
#7 lore raw

v2 cover Add USB EHCI support for ls1012aqds

Quoted 43 lines
Quoted 43 lines

-----Original Message-----
From: Marek Vasut [mailto:marex at denx.de]
Sent: Friday, June 10, 2016 9:40 AM
To: Rajesh Bhagat <[email protected]>; u-boot at lists.denx.de
Cc: Sriram Dash <[email protected]>; albert.u.boot at aribaud.net; prabhakar at freescale.com; york sun <[email protected]>; Rajat Srivastava <[email protected]>
Subject: Re: [PATCH v2 0/3] Add USB EHCI support for ls1012aqds

Quoted 16 lines · Rajesh Bhagat
Quoted 16 lines

-----Original Message-----
From: Marek Vasut [mailto:marex at denx.de]
Sent: Thursday, June 09, 2016 7:12 PM
To: Rajesh Bhagat <[email protected]>; u-boot at lists.denx.de
Cc: Sriram Dash <[email protected]>; albert.u.boot at aribaud.net; prabhakar at freescale.com; york sun <[email protected]>; Rajat Srivastava <[email protected]>
Subject: Re: [PATCH v2 0/3] Add USB EHCI support for ls1012aqds

Quoted 4 lines · Rajesh Bhagat

Adds USB EHCI support for ls1012qds by adding the support for NXP ULPI PHY and adding the support it configuration files. Also enables, USB2 IP in ns access defines.

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

Rajesh Bhagat (3):
drivers: usb: fsl: add USB ULPI init code
config: ls1012aqds: Add USB EHCI support for ls1012aqds
armv8: ls1012a: Added CSU assignment for USB2

 .../include/asm/arch-fsl-layerscape/immap_lsch2.h  |    1 +
 .../include/asm/arch-fsl-layerscape/ns_access.h    |    2 +
 drivers/usb/host/ehci-fsl.c                        |   21

++++++++++++++++++++

Quoted 7 lines
Quoted 4 lines
Quoted 4 lines
 include/configs/ls1012aqds.h                       |    5 ++++
 include/usb/ehci-ci.h                              |    2 +-
 5 files changed, 30 insertions(+), 1 deletions(-)

Hello Marek,

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 3 lines

I wanted to apply these on u-boot-usb/master , but patch 2 fails to apply. Please rebase and repose.

Can you apply below patch for Layerscape USB macro cleanup for various Soc to apply above patch:

https://patchwork.ozlabs.org/patch/631595/

Hello Marek,

Quoted 4 lines
Quoted 4 lines

This has to go through soc tree, so I will have to wait for it to be applied. Let me know when it's in, then I can pick these patches.

The dependency patch has made it to uboot master, Please apply the EHCI support patches.

Commit: 9729dc9565c9c1812efbb630e1db4d54f580363c
include: usb: Rename USB controller base address mapping

Best Regards,
Rajesh Bhagat

Quoted 36 lines
Quoted 36 lines
Quoted 21 lines

[root at phoenix u-boot-usb]$ pw-am.sh 631595
2016-06-10 09:02:02 URL:https://patchwork.ozlabs.org/patch/631595/mbox/ [6138] -> "pw-am-631595.patch" [1]
Applying: include: usb: Rename USB controller base address mapping [root at phoenix u-boot-usb]$ pw-am.sh 632644
2016-06-10 09:02:18 URL:https://patchwork.ozlabs.org/patch/632644/mbox/ [2104] -> "pw-am-632644.patch" [1]
Applying: drivers: usb: fsl: add USB ULPI init code [root at phoenix u-boot-usb]$ pw-am.sh 632646
2016-06-10 09:02:28 URL:https://patchwork.ozlabs.org/patch/632646/mbox/ [2819] -> "pw-am-632646.patch" [1]
Applying: config: ls1012aqds: Add USB EHCI support for ls1012aqds [root at phoenix u-boot-usb]$ pw-am.sh 632645
2016-06-10 09:02:36 URL:https://patchwork.ozlabs.org/patch/632645/mbox/ [1501] -> "pw-am-632645.patch" [1]
Applying: armv8: ls1012a: Added CSU assignment for USB2

Quoted 10 lines

OR

Please share if there is a need to rebase them.

Best Regards,
Rajesh Bhagat

Quoted 3 lines

--
Best regards,
Marek Vasut

--
Best regards,
Marek Vasut