Re: [U-Boot] [PATCH 2/3] usb: omap5-evm: Add ethernet support to the uevm

2013-07-09 Thread Roger Quadros
Hi Dan,

On 07/08/2013 11:59 PM, Dan Murphy wrote:
 Add code to configure the USB EHCI host controller.
 This enumerates an ethernet controller through USB3 using
 the HSIC lines.
 
 Signed-off-by: Dan Murphy dmur...@ti.com
 ---
  arch/arm/cpu/armv7/omap5/hw_data.c  |   15 +++
  arch/arm/include/asm/arch-omap5/clock.h |6 +
  arch/arm/include/asm/arch-omap5/ehci.h  |   44 
 +++
  arch/arm/include/asm/ehci-omap.h|1 +
  board/ti/omap5_uevm/evm.c   |   35 
  board/ti/omap5_uevm/mux_data.h  |4 ++-
  drivers/usb/host/ehci-omap.c|2 +-
  include/configs/omap5_common.h  |2 --
  include/configs/omap5_uevm.h|   23 
  9 files changed, 128 insertions(+), 4 deletions(-)
  create mode 100644 arch/arm/include/asm/arch-omap5/ehci.h
 
 diff --git a/arch/arm/cpu/armv7/omap5/hw_data.c 
 b/arch/arm/cpu/armv7/omap5/hw_data.c
 index 56cf1f8..f3973ee 100644
 --- a/arch/arm/cpu/armv7/omap5/hw_data.c
 +++ b/arch/arm/cpu/armv7/omap5/hw_data.c
 @@ -412,6 +412,8 @@ void enable_basic_clocks(void)
   (*prcm)-cm_l4per_gpio4_clkctrl,
   (*prcm)-cm_l4per_gpio5_clkctrl,
   (*prcm)-cm_l4per_gpio6_clkctrl,
 + (*prcm)-cm_clksel_usb_60mhz,
 + (*prcm)-cm_l3init_hsusbtll_clkctrl,
   0
   };
  
 @@ -423,6 +425,7 @@ void enable_basic_clocks(void)
   (*prcm)-cm_wkup_wdtimer2_clkctrl,
   (*prcm)-cm_l4per_uart3_clkctrl,
   (*prcm)-cm_l4per_i2c1_clkctrl,
 + (*prcm)-cm_l3init_hsusbhost_clkctrl,
   0
   };
  
 @@ -446,6 +449,14 @@ void enable_basic_clocks(void)
   setbits_le32((*prcm)-cm_wkup_gptimer1_clkctrl,
   GPTIMER1_CLKCTRL_CLKSEL_MASK);
  
 + /* Enbale all 3 usb ports enable uhh, utmi and hsic clocks*/
 + setbits_le32((*prcm)-cm_l3init_hsusbhost_clkctrl,
 + USB_HOST_HS_CLKCTRL_MASK);
 +
 + /* Enbale all 3 usb host ports tll clocks*/
 + setbits_le32((*prcm)-cm_l3init_hsusbtll_clkctrl,
 + USB_TLL_HS_CLKCTRL_MASK);
 +

Why enable all 3 port clocks here? uEVM uses only 2 ports.

Did you verify that if you boot the linux kernel without USB support
then the USB_Host and USB_TLL module are back to idle state?

Just checking if we need to add something more in the linux kernel
to make sure that these modules are not stuck in transition state.

If this is taken care of, I really don't mind even if all 3 clocks kept
enabled ;).

   do_enable_clocks(clk_domains_essential,
clk_modules_hw_auto_essential,
clk_modules_explicit_en_essential,
 @@ -480,6 +491,10 @@ void enable_basic_uboot_clocks(void)
   0
   };
  
 + /* Enbale all 3 usb host ports tll clocks*/
 + setbits_le32((*prcm)-cm_l3init_hsusbtll_clkctrl,
 + USB_TLL_HS_CLKCTRL_MASK);
 +
   do_enable_clocks(clk_domains_essential,
clk_modules_hw_auto_essential,
clk_modules_explicit_en_essential,

cheers,
-roger
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 2/3] usb: omap5-evm: Add ethernet support to the uevm

2013-07-08 Thread Dan Murphy
Add code to configure the USB EHCI host controller.
This enumerates an ethernet controller through USB3 using
the HSIC lines.

Signed-off-by: Dan Murphy dmur...@ti.com
---
 arch/arm/cpu/armv7/omap5/hw_data.c  |   15 +++
 arch/arm/include/asm/arch-omap5/clock.h |6 +
 arch/arm/include/asm/arch-omap5/ehci.h  |   44 +++
 arch/arm/include/asm/ehci-omap.h|1 +
 board/ti/omap5_uevm/evm.c   |   35 
 board/ti/omap5_uevm/mux_data.h  |4 ++-
 drivers/usb/host/ehci-omap.c|2 +-
 include/configs/omap5_common.h  |2 --
 include/configs/omap5_uevm.h|   23 
 9 files changed, 128 insertions(+), 4 deletions(-)
 create mode 100644 arch/arm/include/asm/arch-omap5/ehci.h

diff --git a/arch/arm/cpu/armv7/omap5/hw_data.c 
b/arch/arm/cpu/armv7/omap5/hw_data.c
index 56cf1f8..f3973ee 100644
--- a/arch/arm/cpu/armv7/omap5/hw_data.c
+++ b/arch/arm/cpu/armv7/omap5/hw_data.c
@@ -412,6 +412,8 @@ void enable_basic_clocks(void)
(*prcm)-cm_l4per_gpio4_clkctrl,
(*prcm)-cm_l4per_gpio5_clkctrl,
(*prcm)-cm_l4per_gpio6_clkctrl,
+   (*prcm)-cm_clksel_usb_60mhz,
+   (*prcm)-cm_l3init_hsusbtll_clkctrl,
0
};
 
@@ -423,6 +425,7 @@ void enable_basic_clocks(void)
(*prcm)-cm_wkup_wdtimer2_clkctrl,
(*prcm)-cm_l4per_uart3_clkctrl,
(*prcm)-cm_l4per_i2c1_clkctrl,
+   (*prcm)-cm_l3init_hsusbhost_clkctrl,
0
};
 
@@ -446,6 +449,14 @@ void enable_basic_clocks(void)
setbits_le32((*prcm)-cm_wkup_gptimer1_clkctrl,
GPTIMER1_CLKCTRL_CLKSEL_MASK);
 
+   /* Enbale all 3 usb ports enable uhh, utmi and hsic clocks*/
+   setbits_le32((*prcm)-cm_l3init_hsusbhost_clkctrl,
+   USB_HOST_HS_CLKCTRL_MASK);
+
+   /* Enbale all 3 usb host ports tll clocks*/
+   setbits_le32((*prcm)-cm_l3init_hsusbtll_clkctrl,
+   USB_TLL_HS_CLKCTRL_MASK);
+
do_enable_clocks(clk_domains_essential,
 clk_modules_hw_auto_essential,
 clk_modules_explicit_en_essential,
@@ -480,6 +491,10 @@ void enable_basic_uboot_clocks(void)
0
};
 
+   /* Enbale all 3 usb host ports tll clocks*/
+   setbits_le32((*prcm)-cm_l3init_hsusbtll_clkctrl,
+   USB_TLL_HS_CLKCTRL_MASK);
+
do_enable_clocks(clk_domains_essential,
 clk_modules_hw_auto_essential,
 clk_modules_explicit_en_essential,
diff --git a/arch/arm/include/asm/arch-omap5/clock.h 
b/arch/arm/include/asm/arch-omap5/clock.h
index 4d2765d..f98fe74 100644
--- a/arch/arm/include/asm/arch-omap5/clock.h
+++ b/arch/arm/include/asm/arch-omap5/clock.h
@@ -165,6 +165,12 @@
 /* CM_L3INIT_USBPHY_CLKCTRL */
 #define USBPHY_CLKCTRL_OPTFCLKEN_PHY_48M_MASK  8
 
+/* CM_L3INIT_USB_HOST_HS_CLKCTRL */
+#define USB_HOST_HS_CLKCTRL_MASK   0x7FC0
+
+/* CM_L3INIT_USB_TLL_HS_CLKCTRL */
+#define USB_TLL_HS_CLKCTRL_MASK0x700
+
 /* CM_MPU_MPU_CLKCTRL */
 #define MPU_CLKCTRL_CLKSEL_EMIF_DIV_MODE_SHIFT 24
 #define MPU_CLKCTRL_CLKSEL_EMIF_DIV_MODE_MASK  (3  24)
diff --git a/arch/arm/include/asm/arch-omap5/ehci.h 
b/arch/arm/include/asm/arch-omap5/ehci.h
new file mode 100644
index 000..49197f2
--- /dev/null
+++ b/arch/arm/include/asm/arch-omap5/ehci.h
@@ -0,0 +1,44 @@
+/*
+ * OMAP EHCI port support
+ * Based on LINUX KERNEL
+ * drivers/usb/host/ehci-omap.c and drivers/mfd/omap-usb-host.c
+ *
+ * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com*
+ * Author: Govindraj R govindraj.r...@ti.com
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2  of
+ * the License as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://www.gnu.org/licenses/.
+ */
+
+#ifndef _EHCI_H
+#define _EHCI_H
+
+#define OMAP_EHCI_BASE (OMAP54XX_L4_CORE_BASE + 
0x64C00)
+#define OMAP_UHH_BASE  (OMAP54XX_L4_CORE_BASE + 
0x64000)
+#define OMAP_USBTLL_BASE   (OMAP54XX_L4_CORE_BASE + 
0x62000)
+
+/* TLL Register Set */
+#define OMAP_USBTLL_SYSCONFIG_SIDLEMODE(1  3)
+#define OMAP_USBTLL_SYSCONFIG_ENAWAKEUP(1  2)
+#define OMAP_USBTLL_SYSCONFIG_SOFTRESET(1  1)
+#define OMAP_USBTLL_SYSCONFIG_CACTIVITY(1  8)

Re: [U-Boot] [PATCH 2/3] usb: omap5-evm: Add ethernet support to the uevm

2013-07-08 Thread Nishanth Menon

On 07/08/2013 03:59 PM, Dan Murphy wrote:

Add code to configure the USB EHCI host controller.
This enumerates an ethernet controller through USB3 using
the HSIC lines.

Code says:
 + * OMAP EHCI port support
 + * Based on LINUX KERNEL
 + * drivers/usb/host/ehci-omap.c and drivers/mfd/omap-usb-host.c
which kernel?



Signed-off-by: Dan Murphy dmur...@ti.com
---
  arch/arm/cpu/armv7/omap5/hw_data.c  |   15 +++
  arch/arm/include/asm/arch-omap5/clock.h |6 +
  arch/arm/include/asm/arch-omap5/ehci.h  |   44 +++
  arch/arm/include/asm/ehci-omap.h|1 +
  board/ti/omap5_uevm/evm.c   |   35 
  board/ti/omap5_uevm/mux_data.h  |4 ++-
  drivers/usb/host/ehci-omap.c|2 +-
  include/configs/omap5_common.h  |2 --
  include/configs/omap5_uevm.h|   23 


Is it possible to split this into stuff that is OMAP5 specific and stuff 
that is uEVM specific?



  9 files changed, 128 insertions(+), 4 deletions(-)
  create mode 100644 arch/arm/include/asm/arch-omap5/ehci.h

diff --git a/arch/arm/cpu/armv7/omap5/hw_data.c 
b/arch/arm/cpu/armv7/omap5/hw_data.c
index 56cf1f8..f3973ee 100644
--- a/arch/arm/cpu/armv7/omap5/hw_data.c
+++ b/arch/arm/cpu/armv7/omap5/hw_data.c
@@ -412,6 +412,8 @@ void enable_basic_clocks(void)
(*prcm)-cm_l4per_gpio4_clkctrl,
(*prcm)-cm_l4per_gpio5_clkctrl,
(*prcm)-cm_l4per_gpio6_clkctrl,
+   (*prcm)-cm_clksel_usb_60mhz,
+   (*prcm)-cm_l3init_hsusbtll_clkctrl,
0
};

@@ -423,6 +425,7 @@ void enable_basic_clocks(void)
(*prcm)-cm_wkup_wdtimer2_clkctrl,
(*prcm)-cm_l4per_uart3_clkctrl,
(*prcm)-cm_l4per_i2c1_clkctrl,
+   (*prcm)-cm_l3init_hsusbhost_clkctrl,
0
};

@@ -446,6 +449,14 @@ void enable_basic_clocks(void)
setbits_le32((*prcm)-cm_wkup_gptimer1_clkctrl,
GPTIMER1_CLKCTRL_CLKSEL_MASK);

+   /* Enbale all 3 usb ports enable uhh, utmi and hsic clocks*/

here

+   setbits_le32((*prcm)-cm_l3init_hsusbhost_clkctrl,
+   USB_HOST_HS_CLKCTRL_MASK);
+
+   /* Enbale all 3 usb host ports tll clocks*/

here

+   setbits_le32((*prcm)-cm_l3init_hsusbtll_clkctrl,
+   USB_TLL_HS_CLKCTRL_MASK);
+


Who disables these when control is given to kernel?


do_enable_clocks(clk_domains_essential,
 clk_modules_hw_auto_essential,
 clk_modules_explicit_en_essential,
@@ -480,6 +491,10 @@ void enable_basic_uboot_clocks(void)
0
};

+   /* Enbale all 3 usb host ports tll clocks*/

Enbale - spell check. and a space after clocks

+   setbits_le32((*prcm)-cm_l3init_hsusbtll_clkctrl,
+   USB_TLL_HS_CLKCTRL_MASK);
+
do_enable_clocks(clk_domains_essential,
 clk_modules_hw_auto_essential,
 clk_modules_explicit_en_essential,
diff --git a/arch/arm/include/asm/arch-omap5/clock.h 
b/arch/arm/include/asm/arch-omap5/clock.h
index 4d2765d..f98fe74 100644
--- a/arch/arm/include/asm/arch-omap5/clock.h
+++ b/arch/arm/include/asm/arch-omap5/clock.h
@@ -165,6 +165,12 @@
  /* CM_L3INIT_USBPHY_CLKCTRL */
  #define USBPHY_CLKCTRL_OPTFCLKEN_PHY_48M_MASK 8

+/* CM_L3INIT_USB_HOST_HS_CLKCTRL */
+#define USB_HOST_HS_CLKCTRL_MASK   0x7FC0
+
+/* CM_L3INIT_USB_TLL_HS_CLKCTRL */
+#define USB_TLL_HS_CLKCTRL_MASK0x700
+
  /* CM_MPU_MPU_CLKCTRL */
  #define MPU_CLKCTRL_CLKSEL_EMIF_DIV_MODE_SHIFT24
  #define MPU_CLKCTRL_CLKSEL_EMIF_DIV_MODE_MASK (3  24)
diff --git a/arch/arm/include/asm/arch-omap5/ehci.h 
b/arch/arm/include/asm/arch-omap5/ehci.h
new file mode 100644
index 000..49197f2
--- /dev/null
+++ b/arch/arm/include/asm/arch-omap5/ehci.h
@@ -0,0 +1,44 @@
+/*
+ * OMAP EHCI port support
+ * Based on LINUX KERNEL
+ * drivers/usb/host/ehci-omap.c and drivers/mfd/omap-usb-host.c
+ *
+ * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com*
+ * Author: Govindraj R govindraj.r...@ti.com

2013?

+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2  of
+ * the License as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://www.gnu.org/licenses/.
+ */
+
+#ifndef _EHCI_H
+#define _EHCI_H
+
+#define OMAP_EHCI_BASE (OMAP54XX_L4_CORE_BASE + 
0x64C00)
+#define 

Re: [U-Boot] [PATCH 2/3] usb: omap5-evm: Add ethernet support to the uevm

2013-07-08 Thread Lokesh Vutla
Hi Dan,
On Tuesday 09 July 2013 02:29 AM, Dan Murphy wrote:
 Add code to configure the USB EHCI host controller.
 This enumerates an ethernet controller through USB3 using
 the HSIC lines.
 
 Signed-off-by: Dan Murphy dmur...@ti.com
 ---
  arch/arm/cpu/armv7/omap5/hw_data.c  |   15 +++
  arch/arm/include/asm/arch-omap5/clock.h |6 +
  arch/arm/include/asm/arch-omap5/ehci.h  |   44 
 +++
  arch/arm/include/asm/ehci-omap.h|1 +
  board/ti/omap5_uevm/evm.c   |   35 
  board/ti/omap5_uevm/mux_data.h  |4 ++-
  drivers/usb/host/ehci-omap.c|2 +-
  include/configs/omap5_common.h  |2 --
  include/configs/omap5_uevm.h|   23 
  9 files changed, 128 insertions(+), 4 deletions(-)
  create mode 100644 arch/arm/include/asm/arch-omap5/ehci.h
I see a other patch from you which adds the same file.
Is the previous patch sent by mistake?
 
 diff --git a/arch/arm/cpu/armv7/omap5/hw_data.c 
 b/arch/arm/cpu/armv7/omap5/hw_data.c
 index 56cf1f8..f3973ee 100644
 --- a/arch/arm/cpu/armv7/omap5/hw_data.c
 +++ b/arch/arm/cpu/armv7/omap5/hw_data.c
 @@ -412,6 +412,8 @@ void enable_basic_clocks(void)
   (*prcm)-cm_l4per_gpio4_clkctrl,
   (*prcm)-cm_l4per_gpio5_clkctrl,
   (*prcm)-cm_l4per_gpio6_clkctrl,
 + (*prcm)-cm_clksel_usb_60mhz,
 + (*prcm)-cm_l3init_hsusbtll_clkctrl,
   0
   };
  
 @@ -423,6 +425,7 @@ void enable_basic_clocks(void)
   (*prcm)-cm_wkup_wdtimer2_clkctrl,
   (*prcm)-cm_l4per_uart3_clkctrl,
   (*prcm)-cm_l4per_i2c1_clkctrl,
 + (*prcm)-cm_l3init_hsusbhost_clkctrl,
   0
   };
  
 @@ -446,6 +449,14 @@ void enable_basic_clocks(void)
   setbits_le32((*prcm)-cm_wkup_gptimer1_clkctrl,
   GPTIMER1_CLKCTRL_CLKSEL_MASK);
  
 + /* Enbale all 3 usb ports enable uhh, utmi and hsic clocks*/
 + setbits_le32((*prcm)-cm_l3init_hsusbhost_clkctrl,
 + USB_HOST_HS_CLKCTRL_MASK);
 +
 + /* Enbale all 3 usb host ports tll clocks*/
 + setbits_le32((*prcm)-cm_l3init_hsusbtll_clkctrl,
 + USB_TLL_HS_CLKCTRL_MASK);
Please keep this under a macro.
 +
   do_enable_clocks(clk_domains_essential,
clk_modules_hw_auto_essential,
clk_modules_explicit_en_essential,
 @@ -480,6 +491,10 @@ void enable_basic_uboot_clocks(void)
   0
   };
  
 + /* Enbale all 3 usb host ports tll clocks*/
 + setbits_le32((*prcm)-cm_l3init_hsusbtll_clkctrl,
 + USB_TLL_HS_CLKCTRL_MASK);
 +
   do_enable_clocks(clk_domains_essential,
clk_modules_hw_auto_essential,
clk_modules_explicit_en_essential,
 diff --git a/arch/arm/include/asm/arch-omap5/clock.h 
 b/arch/arm/include/asm/arch-omap5/clock.h
 index 4d2765d..f98fe74 100644
 --- a/arch/arm/include/asm/arch-omap5/clock.h
 +++ b/arch/arm/include/asm/arch-omap5/clock.h
 @@ -165,6 +165,12 @@
  /* CM_L3INIT_USBPHY_CLKCTRL */
  #define USBPHY_CLKCTRL_OPTFCLKEN_PHY_48M_MASK8
  
 +/* CM_L3INIT_USB_HOST_HS_CLKCTRL */
 +#define USB_HOST_HS_CLKCTRL_MASK 0x7FC0
 +
 +/* CM_L3INIT_USB_TLL_HS_CLKCTRL */
 +#define USB_TLL_HS_CLKCTRL_MASK  0x700
 +
  /* CM_MPU_MPU_CLKCTRL */
  #define MPU_CLKCTRL_CLKSEL_EMIF_DIV_MODE_SHIFT   24
  #define MPU_CLKCTRL_CLKSEL_EMIF_DIV_MODE_MASK(3  24)
 diff --git a/arch/arm/include/asm/arch-omap5/ehci.h 
 b/arch/arm/include/asm/arch-omap5/ehci.h
 new file mode 100644
 index 000..49197f2
 --- /dev/null
 +++ b/arch/arm/include/asm/arch-omap5/ehci.h
 @@ -0,0 +1,44 @@
 +/*
 + * OMAP EHCI port support
 + * Based on LINUX KERNEL
 + * drivers/usb/host/ehci-omap.c and drivers/mfd/omap-usb-host.c
 + *
 + * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com*
2013...:)

Thanks 
Lokesh
 + * Author: Govindraj R govindraj.r...@ti.com
 + *
 + * This program is free software: you can redistribute it and/or modify
 + * it under the terms of the GNU General Public License version 2  of
 + * the License as published by the Free Software Foundation.
 + *
 + * This program is distributed in the hope that it will be useful,
 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 + * GNU General Public License for more details.
 + *
 + * You should have received a copy of the GNU General Public License
 + * along with this program. If not, see http://www.gnu.org/licenses/.
 + */
 +
 +#ifndef _EHCI_H
 +#define _EHCI_H
 +
 +#define OMAP_EHCI_BASE   (OMAP54XX_L4_CORE_BASE 
 + 0x64C00)
 +#define OMAP_UHH_BASE(OMAP54XX_L4_CORE_BASE 
 + 0x64000)
 +#define OMAP_USBTLL_BASE (OMAP54XX_L4_CORE_BASE