All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] OMAP3: TAM3517: update ehci interface
@ 2012-02-04  8:07 Stefano Babic
  2012-02-06 14:55 ` Igor Grinberg
  2012-02-08  9:28 ` [U-Boot] [PATCH V2] " Stefano Babic
  0 siblings, 2 replies; 8+ messages in thread
From: Stefano Babic @ 2012-02-04  8:07 UTC (permalink / raw)
  To: u-boot

Changed the EHCI interface using the ulpi framework.

Signed-off-by: Stefano Babic <sbabic@denx.de>
CC: Tom Rini <tom.rini@gmail.com>
---

This patch is based and tested on top of  Govindraj's patches for EHCI omap:
	http://patchwork.ozlabs.org/patch/139377/

 board/technexion/twister/twister.c |   32 ++++++++++++++++++++++++++++++++
 include/configs/tam3517-common.h   |    2 ++
 2 files changed, 34 insertions(+), 0 deletions(-)

diff --git a/board/technexion/twister/twister.c b/board/technexion/twister/twister.c
index 4d34d24..831fb4c 100644
--- a/board/technexion/twister/twister.c
+++ b/board/technexion/twister/twister.c
@@ -33,6 +33,10 @@
 #include <asm/arch/mmc_host_def.h>
 #include <i2c.h>
 #include <asm/gpio.h>
+#ifdef CONFIG_USB_EHCI
+#include <usb.h>
+#include <asm/ehci-omap.h>
+#endif
 #include "twister.h"
 
 DECLARE_GLOBAL_DATA_PTR;
@@ -56,6 +60,34 @@ static const u32 gpmc_XR16L2751[] = {
 	XR16L2751_GPMC_CONFIG6,
 };
 
+#ifdef CONFIG_USB_EHCI
+
+static struct omap_usbhs_board_data usbhs_bdata = {
+	.port_mode[0] = OMAP_EHCI_PORT_MODE_PHY,
+	.port_mode[1] = OMAP_EHCI_PORT_MODE_PHY,
+	.port_mode[2] = OMAP_EHCI_PORT_MODE_PHY,
+};
+
+int ehci_hcd_init(void)
+{
+	int ret;
+
+	ret = omap_ehci_hcd_init(&usbhs_bdata);
+	if (ret < 0)
+		return ret;
+
+	return 0;
+}
+
+int ehci_hcd_stop(void)
+{
+	int ret;
+
+	ret = omap_ehci_hcd_stop();
+	return ret;
+}
+#endif
+
 int board_init(void)
 {
 	gpmc_init(); /* in SRAM or SDRAM, finish GPMC */
diff --git a/include/configs/tam3517-common.h b/include/configs/tam3517-common.h
index 817d468..13eeadb 100644
--- a/include/configs/tam3517-common.h
+++ b/include/configs/tam3517-common.h
@@ -100,6 +100,8 @@
 #define CONFIG_OMAP3_GPIO_5
 #define CONFIG_USB_EHCI
 #define CONFIG_USB_EHCI_OMAP
+#define CONFIG_USB_ULPI
+#define CONFIG_USB_ULPI_VIEWPORT_OMAP
 #define CONFIG_OMAP_EHCI_PHY1_RESET_GPIO	25
 #define CONFIG_SYS_USB_EHCI_MAX_ROOT_PORTS 3
 #define CONFIG_USB_STORAGE
-- 
1.7.5.4

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

* [U-Boot] [PATCH] OMAP3: TAM3517: update ehci interface
  2012-02-04  8:07 [U-Boot] [PATCH] OMAP3: TAM3517: update ehci interface Stefano Babic
@ 2012-02-06 14:55 ` Igor Grinberg
  2012-02-07 15:13   ` Stefano Babic
  2012-02-08  9:28 ` [U-Boot] [PATCH V2] " Stefano Babic
  1 sibling, 1 reply; 8+ messages in thread
From: Igor Grinberg @ 2012-02-06 14:55 UTC (permalink / raw)
  To: u-boot

Hi Stefano,

On 02/04/12 10:07, Stefano Babic wrote:
> Changed the EHCI interface using the ulpi framework.
> 
> Signed-off-by: Stefano Babic <sbabic@denx.de>
> CC: Tom Rini <tom.rini@gmail.com>
> ---
> 
> This patch is based and tested on top of  Govindraj's patches for EHCI omap:
> 	http://patchwork.ozlabs.org/patch/139377/
> 
>  board/technexion/twister/twister.c |   32 ++++++++++++++++++++++++++++++++
>  include/configs/tam3517-common.h   |    2 ++
>  2 files changed, 34 insertions(+), 0 deletions(-)
> 
> diff --git a/board/technexion/twister/twister.c b/board/technexion/twister/twister.c
> index 4d34d24..831fb4c 100644
> --- a/board/technexion/twister/twister.c
> +++ b/board/technexion/twister/twister.c
> @@ -33,6 +33,10 @@
>  #include <asm/arch/mmc_host_def.h>
>  #include <i2c.h>
>  #include <asm/gpio.h>
> +#ifdef CONFIG_USB_EHCI
> +#include <usb.h>
> +#include <asm/ehci-omap.h>
> +#endif
>  #include "twister.h"
>  
>  DECLARE_GLOBAL_DATA_PTR;
> @@ -56,6 +60,34 @@ static const u32 gpmc_XR16L2751[] = {
>  	XR16L2751_GPMC_CONFIG6,
>  };
>  
> +#ifdef CONFIG_USB_EHCI
> +
> +static struct omap_usbhs_board_data usbhs_bdata = {
> +	.port_mode[0] = OMAP_EHCI_PORT_MODE_PHY,
> +	.port_mode[1] = OMAP_EHCI_PORT_MODE_PHY,
> +	.port_mode[2] = OMAP_EHCI_PORT_MODE_PHY,
> +};

OMAP EHCI port3 is TLL only, so the above does not look right...

> +
> +int ehci_hcd_init(void)
> +{
> +	int ret;
> +
> +	ret = omap_ehci_hcd_init(&usbhs_bdata);
> +	if (ret < 0)
> +		return ret;
> +
> +	return 0;
> +}

return omap_ehci_hcd_init(&usbhs_bdata);
?

> +
> +int ehci_hcd_stop(void)
> +{
> +	int ret;
> +
> +	ret = omap_ehci_hcd_stop();
> +	return ret;

return omap_ehci_hcd_stop();
?

> +}
> +#endif
> +
>  int board_init(void)
>  {
>  	gpmc_init(); /* in SRAM or SDRAM, finish GPMC */
> diff --git a/include/configs/tam3517-common.h b/include/configs/tam3517-common.h
> index 817d468..13eeadb 100644
> --- a/include/configs/tam3517-common.h
> +++ b/include/configs/tam3517-common.h
> @@ -100,6 +100,8 @@
>  #define CONFIG_OMAP3_GPIO_5
>  #define CONFIG_USB_EHCI
>  #define CONFIG_USB_EHCI_OMAP
> +#define CONFIG_USB_ULPI
> +#define CONFIG_USB_ULPI_VIEWPORT_OMAP
>  #define CONFIG_OMAP_EHCI_PHY1_RESET_GPIO	25
>  #define CONFIG_SYS_USB_EHCI_MAX_ROOT_PORTS 3
>  #define CONFIG_USB_STORAGE

-- 
Regards,
Igor.

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

* [U-Boot] [PATCH] OMAP3: TAM3517: update ehci interface
  2012-02-06 14:55 ` Igor Grinberg
@ 2012-02-07 15:13   ` Stefano Babic
  2012-02-07 15:33     ` Stefano Babic
  0 siblings, 1 reply; 8+ messages in thread
From: Stefano Babic @ 2012-02-07 15:13 UTC (permalink / raw)
  To: u-boot

On 06/02/2012 15:55, Igor Grinberg wrote:
> Hi Stefano,
> 

Hi Igor,

>> +#ifdef CONFIG_USB_EHCI
>> +
>> +static struct omap_usbhs_board_data usbhs_bdata = {
>> +	.port_mode[0] = OMAP_EHCI_PORT_MODE_PHY,
>> +	.port_mode[1] = OMAP_EHCI_PORT_MODE_PHY,
>> +	.port_mode[2] = OMAP_EHCI_PORT_MODE_PHY,
>> +};
> 
> OMAP EHCI port3 is TLL only, so the above does not look right...

This is a strange effect. I have tested setting OMAP_EHCI_PORT_MODE_PHY
(of course the phy is on another port), and everything works. However,
after setting port_mode[2] to OMAP_USBHS_PORT_MODE_NONE, it does not
work anymore and no storage are detected. I have not an explanation,
maybe some of you can give some hints. Really, the change should have no
effect...

> 
> return omap_ehci_hcd_init(&usbhs_bdata);

Right, I'll fix

> 
> return omap_ehci_hcd_stop();

I fix this, too

Best regards,
Stefano Babic

-- 
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: office at denx.de
=====================================================================

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

* [U-Boot] [PATCH] OMAP3: TAM3517: update ehci interface
  2012-02-07 15:13   ` Stefano Babic
@ 2012-02-07 15:33     ` Stefano Babic
  2012-02-08  6:06       ` Govindraj
  0 siblings, 1 reply; 8+ messages in thread
From: Stefano Babic @ 2012-02-07 15:33 UTC (permalink / raw)
  To: u-boot

On 07/02/2012 16:13, Stefano Babic wrote:
> This is a strange effect. I have tested setting OMAP_EHCI_PORT_MODE_PHY
> (of course the phy is on another port), and everything works. However,
> after setting port_mode[2] to OMAP_USBHS_PORT_MODE_NONE, it does not
> work anymore and no storage are detected. I have not an explanation,
> maybe some of you can give some hints. Really, the change should have no
> effect...

I get the cause in ehci-omap.c:

rev = readl(&uhh->rev);
    if (rev == OMAP_USBHS_REV1) {
      if (is_ehci_phy_mode(usbhs_pdata->port_mode[0]))
                 clrbits_le32(&reg, OMAP_UHH_HOSTCONFIG_ULPI_P1_BYPASS);
      else
                setbits_le32(&reg, OMAP_UHH_HOSTCONFIG_ULPI_P1_BYPASS);

      if (is_ehci_phy_mode(usbhs_pdata->port_mode[1]))
                clrbits_le32(&reg, OMAP_UHH_HOSTCONFIG_ULPI_P2_BYPASS);
      else
                setbits_le32(&reg, OMAP_UHH_HOSTCONFIG_ULPI_P1_BYPASS);

      if (is_ehci_phy_mode(usbhs_pdata->port_mode[2]))
                clrbits_le32(&reg, OMAP_UHH_HOSTCONFIG_ULPI_P3_BYPASS);
      else
                setbits_le32(&reg, OMAP_UHH_HOSTCONFIG_ULPI_P1_BYPASS);
                         ^--but these should be cleared for port 0

So if PORT2 is set to unused, as it should be and discovered by Igor,
omap_ehci_hcd_init sets OMAP_UHH_HOSTCONFIG_ULPI_P1_BYPASS against port 0.

What do you think about ?

Stefano

-- 
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: office at denx.de
=====================================================================

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

* [U-Boot] [PATCH] OMAP3: TAM3517: update ehci interface
  2012-02-07 15:33     ` Stefano Babic
@ 2012-02-08  6:06       ` Govindraj
  2012-02-08  8:03         ` Stefano Babic
  0 siblings, 1 reply; 8+ messages in thread
From: Govindraj @ 2012-02-08  6:06 UTC (permalink / raw)
  To: u-boot

Hi Stefano,

On Tue, Feb 7, 2012 at 9:03 PM, Stefano Babic <sbabic@denx.de> wrote:
> On 07/02/2012 16:13, Stefano Babic wrote:
>> This is a strange effect. I have tested setting OMAP_EHCI_PORT_MODE_PHY
>> (of course the phy is on another port), and everything works. However,
>> after setting port_mode[2] to OMAP_USBHS_PORT_MODE_NONE, it does not
>> work anymore and no storage are detected. I have not an explanation,
>> maybe some of you can give some hints. Really, the change should have no
>> effect...
>
> I get the cause in ehci-omap.c:
>
> rev = readl(&uhh->rev);
> ? ?if (rev == OMAP_USBHS_REV1) {
> ? ? ?if (is_ehci_phy_mode(usbhs_pdata->port_mode[0]))
> ? ? ? ? ? ? ? ? clrbits_le32(&reg, OMAP_UHH_HOSTCONFIG_ULPI_P1_BYPASS);
> ? ? ?else
> ? ? ? ? ? ? ? ?setbits_le32(&reg, OMAP_UHH_HOSTCONFIG_ULPI_P1_BYPASS);
>
> ? ? ?if (is_ehci_phy_mode(usbhs_pdata->port_mode[1]))
> ? ? ? ? ? ? ? ?clrbits_le32(&reg, OMAP_UHH_HOSTCONFIG_ULPI_P2_BYPASS);
> ? ? ?else
> ? ? ? ? ? ? ? ?setbits_le32(&reg, OMAP_UHH_HOSTCONFIG_ULPI_P1_BYPASS);
>
> ? ? ?if (is_ehci_phy_mode(usbhs_pdata->port_mode[2]))
> ? ? ? ? ? ? ? ?clrbits_le32(&reg, OMAP_UHH_HOSTCONFIG_ULPI_P3_BYPASS);
> ? ? ?else
> ? ? ? ? ? ? ? ?setbits_le32(&reg, OMAP_UHH_HOSTCONFIG_ULPI_P1_BYPASS);
> ? ? ? ? ? ? ? ? ? ? ? ? ^--but these should be cleared for port 0
>
> So if PORT2 is set to unused, as it should be and discovered by Igor,
> omap_ehci_hcd_init sets OMAP_UHH_HOSTCONFIG_ULPI_P1_BYPASS against port 0.
>

Looks like this is copy paste error from my side,
(for port2/3 it should have been bypass for port2/3 rather its port1
set in bypass mode)

I will correct this part and repost the patch.

Thanks for catching this.

--
Thanks,
Govindraj.R

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

* [U-Boot] [PATCH] OMAP3: TAM3517: update ehci interface
  2012-02-08  6:06       ` Govindraj
@ 2012-02-08  8:03         ` Stefano Babic
  0 siblings, 0 replies; 8+ messages in thread
From: Stefano Babic @ 2012-02-08  8:03 UTC (permalink / raw)
  To: u-boot

On 08/02/2012 07:06, Govindraj wrote:

>>
> 
> Looks like this is copy paste error from my side,
> (for port2/3 it should have been bypass for port2/3 rather its port1
> set in bypass mode)
> 
> I will correct this part and repost the patch.

Thanks - only for info, I have already tested with these changes and
everything works.

Best regards,
Stefano Babic

-- 
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: office at denx.de
=====================================================================

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

* [U-Boot] [PATCH V2] OMAP3: TAM3517: update ehci interface
  2012-02-04  8:07 [U-Boot] [PATCH] OMAP3: TAM3517: update ehci interface Stefano Babic
  2012-02-06 14:55 ` Igor Grinberg
@ 2012-02-08  9:28 ` Stefano Babic
  2012-02-08 10:08   ` Igor Grinberg
  1 sibling, 1 reply; 8+ messages in thread
From: Stefano Babic @ 2012-02-08  9:28 UTC (permalink / raw)
  To: u-boot

Changed the EHCI interface using the ulpi framework.

Signed-off-by: Stefano Babic <sbabic@denx.de>
CC: Tom Rini <tom.rini@gmail.com>
---
This patch is based and tested on top of  Govindraj's patches for EHCI omap:
	http://patchwork.ozlabs.org/patch/139377/

Changes since V1:
- do not use temporary variable to return values (Igor Grinberg)
- port 2 is TTL, cannot be PHY (Igor Grinberg)

 board/technexion/twister/twister.c |   22 ++++++++++++++++++++++
 include/configs/tam3517-common.h   |    2 ++
 2 files changed, 24 insertions(+), 0 deletions(-)

diff --git a/board/technexion/twister/twister.c b/board/technexion/twister/twister.c
index 4d34d24..b927586 100644
--- a/board/technexion/twister/twister.c
+++ b/board/technexion/twister/twister.c
@@ -33,6 +33,10 @@
 #include <asm/arch/mmc_host_def.h>
 #include <i2c.h>
 #include <asm/gpio.h>
+#ifdef CONFIG_USB_EHCI
+#include <usb.h>
+#include <asm/ehci-omap.h>
+#endif
 #include "twister.h"
 
 DECLARE_GLOBAL_DATA_PTR;
@@ -56,6 +60,24 @@ static const u32 gpmc_XR16L2751[] = {
 	XR16L2751_GPMC_CONFIG6,
 };
 
+#ifdef CONFIG_USB_EHCI
+static struct omap_usbhs_board_data usbhs_bdata = {
+	.port_mode[0] = OMAP_EHCI_PORT_MODE_PHY,
+	.port_mode[1] = OMAP_EHCI_PORT_MODE_PHY,
+	.port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,
+};
+
+int ehci_hcd_init(void)
+{
+	return omap_ehci_hcd_init(&usbhs_bdata);
+}
+
+int ehci_hcd_stop(void)
+{
+	return omap_ehci_hcd_stop();
+}
+#endif
+
 int board_init(void)
 {
 	gpmc_init(); /* in SRAM or SDRAM, finish GPMC */
diff --git a/include/configs/tam3517-common.h b/include/configs/tam3517-common.h
index 817d468..13eeadb 100644
--- a/include/configs/tam3517-common.h
+++ b/include/configs/tam3517-common.h
@@ -100,6 +100,8 @@
 #define CONFIG_OMAP3_GPIO_5
 #define CONFIG_USB_EHCI
 #define CONFIG_USB_EHCI_OMAP
+#define CONFIG_USB_ULPI
+#define CONFIG_USB_ULPI_VIEWPORT_OMAP
 #define CONFIG_OMAP_EHCI_PHY1_RESET_GPIO	25
 #define CONFIG_SYS_USB_EHCI_MAX_ROOT_PORTS 3
 #define CONFIG_USB_STORAGE
-- 
1.7.5.4

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

* [U-Boot] [PATCH V2] OMAP3: TAM3517: update ehci interface
  2012-02-08  9:28 ` [U-Boot] [PATCH V2] " Stefano Babic
@ 2012-02-08 10:08   ` Igor Grinberg
  0 siblings, 0 replies; 8+ messages in thread
From: Igor Grinberg @ 2012-02-08 10:08 UTC (permalink / raw)
  To: u-boot

On 02/08/12 11:28, Stefano Babic wrote:
> Changed the EHCI interface using the ulpi framework.
> 
> Signed-off-by: Stefano Babic <sbabic@denx.de>
> CC: Tom Rini <tom.rini@gmail.com>

Acked-by: Igor Grinberg <grinberg@compulab.co.il>

> ---
> This patch is based and tested on top of  Govindraj's patches for EHCI omap:
> 	http://patchwork.ozlabs.org/patch/139377/
> 
> Changes since V1:
> - do not use temporary variable to return values (Igor Grinberg)
> - port 2 is TTL, cannot be PHY (Igor Grinberg)
> 
>  board/technexion/twister/twister.c |   22 ++++++++++++++++++++++
>  include/configs/tam3517-common.h   |    2 ++
>  2 files changed, 24 insertions(+), 0 deletions(-)
> 
> diff --git a/board/technexion/twister/twister.c b/board/technexion/twister/twister.c
> index 4d34d24..b927586 100644
> --- a/board/technexion/twister/twister.c
> +++ b/board/technexion/twister/twister.c
> @@ -33,6 +33,10 @@
>  #include <asm/arch/mmc_host_def.h>
>  #include <i2c.h>
>  #include <asm/gpio.h>
> +#ifdef CONFIG_USB_EHCI
> +#include <usb.h>
> +#include <asm/ehci-omap.h>
> +#endif
>  #include "twister.h"
>  
>  DECLARE_GLOBAL_DATA_PTR;
> @@ -56,6 +60,24 @@ static const u32 gpmc_XR16L2751[] = {
>  	XR16L2751_GPMC_CONFIG6,
>  };
>  
> +#ifdef CONFIG_USB_EHCI
> +static struct omap_usbhs_board_data usbhs_bdata = {
> +	.port_mode[0] = OMAP_EHCI_PORT_MODE_PHY,
> +	.port_mode[1] = OMAP_EHCI_PORT_MODE_PHY,
> +	.port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,
> +};
> +
> +int ehci_hcd_init(void)
> +{
> +	return omap_ehci_hcd_init(&usbhs_bdata);
> +}
> +
> +int ehci_hcd_stop(void)
> +{
> +	return omap_ehci_hcd_stop();
> +}
> +#endif
> +
>  int board_init(void)
>  {
>  	gpmc_init(); /* in SRAM or SDRAM, finish GPMC */
> diff --git a/include/configs/tam3517-common.h b/include/configs/tam3517-common.h
> index 817d468..13eeadb 100644
> --- a/include/configs/tam3517-common.h
> +++ b/include/configs/tam3517-common.h
> @@ -100,6 +100,8 @@
>  #define CONFIG_OMAP3_GPIO_5
>  #define CONFIG_USB_EHCI
>  #define CONFIG_USB_EHCI_OMAP
> +#define CONFIG_USB_ULPI
> +#define CONFIG_USB_ULPI_VIEWPORT_OMAP
>  #define CONFIG_OMAP_EHCI_PHY1_RESET_GPIO	25
>  #define CONFIG_SYS_USB_EHCI_MAX_ROOT_PORTS 3
>  #define CONFIG_USB_STORAGE

-- 
Regards,
Igor.

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

end of thread, other threads:[~2012-02-08 10:08 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-02-04  8:07 [U-Boot] [PATCH] OMAP3: TAM3517: update ehci interface Stefano Babic
2012-02-06 14:55 ` Igor Grinberg
2012-02-07 15:13   ` Stefano Babic
2012-02-07 15:33     ` Stefano Babic
2012-02-08  6:06       ` Govindraj
2012-02-08  8:03         ` Stefano Babic
2012-02-08  9:28 ` [U-Boot] [PATCH V2] " Stefano Babic
2012-02-08 10:08   ` Igor Grinberg

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.