[U-Boot] [PATCH v2 0/3] 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(-)

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.
Signed-off-by: Rajesh Bhagat rajesh.bhagat@nxp.com --- 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(-)
diff --git a/drivers/usb/host/ehci-fsl.c b/drivers/usb/host/ehci-fsl.c index a43d37d..d166fad 100644 --- a/drivers/usb/host/ehci-fsl.c +++ b/drivers/usb/host/ehci-fsl.c @@ -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); }

Add USB EHCI support for ls1012aqds platform
Signed-off-by: Rajat Srivastava rajat.srivastava@nxp.com Signed-off-by: Rajesh Bhagat rajesh.bhagat@nxp.com --- 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(-)
diff --git a/arch/arm/include/asm/arch-fsl-layerscape/immap_lsch2.h b/arch/arm/include/asm/arch-fsl-layerscape/immap_lsch2.h index 0c87c2f..b1637da 100644 --- a/arch/arm/include/asm/arch-fsl-layerscape/immap_lsch2.h +++ b/arch/arm/include/asm/arch-fsl-layerscape/immap_lsch2.h @@ -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) diff --git a/include/configs/ls1012aqds.h b/include/configs/ls1012aqds.h index fcf402c..849a0f7 100644 --- a/include/configs/ls1012aqds.h +++ b/include/configs/ls1012aqds.h @@ -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
diff --git a/include/usb/ehci-ci.h b/include/usb/ehci-ci.h index 882aed4..38d557c 100644 --- a/include/usb/ehci-ci.h +++ b/include/usb/ehci-ci.h @@ -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

Access settings for USB2 IP is added through CSU register.
Added CSU ID for USB2, reg: CSL23_REG[8:0]
Signed-off-by: Rajesh Bhagat rajesh.bhagat@nxp.com --- Changes in v2: - None
.../include/asm/arch-fsl-layerscape/ns_access.h | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/arch/arm/include/asm/arch-fsl-layerscape/ns_access.h b/arch/arm/include/asm/arch-fsl-layerscape/ns_access.h index db76066..b7da381 100644 --- a/arch/arm/include/asm/arch-fsl-layerscape/ns_access.h +++ b/arch/arm/include/asm/arch-fsl-layerscape/ns_access.h @@ -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},

On 06/09/2016 08:57 AM, Rajesh Bhagat wrote:
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(-)
I wanted to apply these on u-boot-usb/master , but patch 2 fails to apply. Please rebase and repose.

-----Original Message----- From: Marek Vasut [mailto:marex@denx.de] Sent: Thursday, June 09, 2016 7:12 PM To: Rajesh Bhagat rajesh.bhagat@nxp.com; u-boot@lists.denx.de Cc: Sriram Dash sriram.dash@nxp.com; albert.u.boot@aribaud.net; prabhakar@freescale.com; york sun york.sun@nxp.com; Rajat Srivastava rajat.srivastava@nxp.com Subject: Re: [PATCH v2 0/3] Add USB EHCI support for ls1012aqds
On 06/09/2016 08:57 AM, Rajesh Bhagat wrote:
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,
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@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@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@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@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
-- Best regards, Marek Vasut

On 06/10/2016 05:41 AM, Rajesh Bhagat wrote:
-----Original Message----- From: Marek Vasut [mailto:marex@denx.de] Sent: Thursday, June 09, 2016 7:12 PM To: Rajesh Bhagat rajesh.bhagat@nxp.com; u-boot@lists.denx.de Cc: Sriram Dash sriram.dash@nxp.com; albert.u.boot@aribaud.net; prabhakar@freescale.com; york sun york.sun@nxp.com; Rajat Srivastava rajat.srivastava@nxp.com Subject: Re: [PATCH v2 0/3] Add USB EHCI support for ls1012aqds
On 06/09/2016 08:57 AM, Rajesh Bhagat wrote:
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,
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:
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.
[root@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@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@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@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
-- Best regards, Marek Vasut

-----Original Message----- From: Marek Vasut [mailto:marex@denx.de] Sent: Friday, June 10, 2016 9:40 AM To: Rajesh Bhagat rajesh.bhagat@nxp.com; u-boot@lists.denx.de Cc: Sriram Dash sriram.dash@nxp.com; albert.u.boot@aribaud.net; prabhakar@freescale.com; york sun york.sun@nxp.com; Rajat Srivastava rajat.srivastava@nxp.com Subject: Re: [PATCH v2 0/3] Add USB EHCI support for ls1012aqds
On 06/10/2016 05:41 AM, Rajesh Bhagat wrote:
-----Original Message----- From: Marek Vasut [mailto:marex@denx.de] Sent: Thursday, June 09, 2016 7:12 PM To: Rajesh Bhagat rajesh.bhagat@nxp.com; u-boot@lists.denx.de Cc: Sriram Dash sriram.dash@nxp.com; albert.u.boot@aribaud.net; prabhakar@freescale.com; york sun york.sun@nxp.com; Rajat Srivastava rajat.srivastava@nxp.com Subject: Re: [PATCH v2 0/3] Add USB EHCI support for ls1012aqds
On 06/09/2016 08:57 AM, Rajesh Bhagat wrote:
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,
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:
Hello Marek,
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
[root@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@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@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@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
-- Best regards, Marek Vasut
-- Best regards, Marek Vasut
participants (2)
-
Marek Vasut
-
Rajesh Bhagat