All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 0/4] AM35X: Add musb support
@ 2010-07-07 11:57 Ajay Kumar Gupta
  2010-07-07 11:57 ` [U-Boot] [PATCH 1/4] AM35x: Adding SCM general register definitions Ajay Kumar Gupta
  0 siblings, 1 reply; 11+ messages in thread
From: Ajay Kumar Gupta @ 2010-07-07 11:57 UTC (permalink / raw)
  To: u-boot

Remy,

These patches add support for musb in AM35x.

Regards,
Ajay

Ajay Kumar Gupta (4):
  AM35x: Adding SCM general register definitions
  musb: MSC host support for AM35x
  musb: am35x: Workaround for fifo read issue
  AM3517EVM: musb: add usb config

 arch/arm/include/asm/arch-omap3/cpu.h |   20 +++++
 drivers/usb/musb/Makefile             |    1 +
 drivers/usb/musb/am35x.c              |  150 +++++++++++++++++++++++++++++++++
 drivers/usb/musb/am35x.h              |   94 ++++++++++++++++++++
 drivers/usb/musb/musb_core.c          |    6 ++
 drivers/usb/musb/musb_udc.c           |    2 +
 include/configs/am3517_evm.h          |   38 ++++++++
 include/usb.h                         |    2 +-
 8 files changed, 312 insertions(+), 1 deletions(-)
 create mode 100644 drivers/usb/musb/am35x.c
 create mode 100644 drivers/usb/musb/am35x.h

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

* [U-Boot] [PATCH 1/4] AM35x: Adding SCM general register definitions
  2010-07-07 11:57 [U-Boot] [PATCH 0/4] AM35X: Add musb support Ajay Kumar Gupta
@ 2010-07-07 11:57 ` Ajay Kumar Gupta
  2010-07-07 11:57   ` [U-Boot] [PATCH 2/4] musb: MSC host support for AM35x Ajay Kumar Gupta
  2010-07-07 13:17   ` [U-Boot] [PATCH 1/4] AM35x: Adding SCM general register definitions Paulraj, Sandeep
  0 siblings, 2 replies; 11+ messages in thread
From: Ajay Kumar Gupta @ 2010-07-07 11:57 UTC (permalink / raw)
  To: u-boot

Adding general register structure of system control module (SCM)
of AM35x. This would be required to access devconf2 and ip_sw_reset
register in musb module.

Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
---
 arch/arm/include/asm/arch-omap3/cpu.h |   20 ++++++++++++++++++++
 1 files changed, 20 insertions(+), 0 deletions(-)

diff --git a/arch/arm/include/asm/arch-omap3/cpu.h b/arch/arm/include/asm/arch-omap3/cpu.h
index c072c27..773ea0c 100644
--- a/arch/arm/include/asm/arch-omap3/cpu.h
+++ b/arch/arm/include/asm/arch-omap3/cpu.h
@@ -483,4 +483,24 @@ struct pm {
 #define I2C_BASE2		(OMAP34XX_CORE_L4_IO_BASE + 0x72000)
 #define I2C_BASE3		(OMAP34XX_CORE_L4_IO_BASE + 0x60000)
 
+/* AM35x specific */
+#ifndef __KERNEL_STRICT_NAMES
+#ifndef __ASSEMBLY__
+#define AM35X_SCM_GEN_BASE	0x48002270
+/* General register mappings of system control module */
+struct am35x_scm_general {
+	u32 res1[0xC4];		/* 0x000 - 0x30C */
+	u32 devconf2;		/* 0x310 */
+	u32 devconf3;		/* 0x314 */
+	u32 res2[0x2];		/* 0x318 - 0x31C */
+	u32 cba_priority;	/* 0x320 */
+	u32 lvl_intr_clr;	/* 0x324 */
+	u32 ip_sw_reset;	/* 0x328 */
+	u32 ipss_clk_ctrl;	/* 0x32C */
+};
+#define am35x_scm_general_regs ((struct am35x_scm_general *)AM35X_SCM_GEN_BASE)
+
+#endif /*__ASSEMBLY__ */
+#endif /* __KERNEL_STRICT_NAMES */
+
 #endif /* _CPU_H */
-- 
1.6.2.4

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

* [U-Boot] [PATCH 2/4] musb: MSC host support for AM35x
  2010-07-07 11:57 ` [U-Boot] [PATCH 1/4] AM35x: Adding SCM general register definitions Ajay Kumar Gupta
@ 2010-07-07 11:57   ` Ajay Kumar Gupta
  2010-07-07 11:57     ` [U-Boot] [PATCH 3/4] musb: am35x: Workaround for fifo read issue Ajay Kumar Gupta
  2010-07-07 13:17   ` [U-Boot] [PATCH 1/4] AM35x: Adding SCM general register definitions Paulraj, Sandeep
  1 sibling, 1 reply; 11+ messages in thread
From: Ajay Kumar Gupta @ 2010-07-07 11:57 UTC (permalink / raw)
  To: u-boot

Tested MSC Host on AM3517EVM.

Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
---
 drivers/usb/musb/Makefile   |    1 +
 drivers/usb/musb/am35x.c    |  118 +++++++++++++++++++++++++++++++++++++++++++
 drivers/usb/musb/am35x.h    |   94 ++++++++++++++++++++++++++++++++++
 drivers/usb/musb/musb_udc.c |    2 +
 include/usb.h               |    2 +-
 5 files changed, 216 insertions(+), 1 deletions(-)
 create mode 100644 drivers/usb/musb/am35x.c
 create mode 100644 drivers/usb/musb/am35x.h

diff --git a/drivers/usb/musb/Makefile b/drivers/usb/musb/Makefile
index 397f5fe..7d23e06 100644
--- a/drivers/usb/musb/Makefile
+++ b/drivers/usb/musb/Makefile
@@ -31,6 +31,7 @@ COBJS-$(CONFIG_USB_BLACKFIN) += blackfin_usb.o
 COBJS-$(CONFIG_USB_DAVINCI) += davinci.o
 COBJS-$(CONFIG_USB_OMAP3) += omap3.o
 COBJS-$(CONFIG_USB_DA8XX) += da8xx.o
+COBJS-$(CONFIG_USB_AM35X) += am35x.o
 
 COBJS	:= $(COBJS-y)
 SRCS	:= $(COBJS:.o=.c)
diff --git a/drivers/usb/musb/am35x.c b/drivers/usb/musb/am35x.c
new file mode 100644
index 0000000..2024940
--- /dev/null
+++ b/drivers/usb/musb/am35x.c
@@ -0,0 +1,118 @@
+/*
+ * am35x.c - TI's AM35x platform specific usb wrapper functions.
+ *
+ * Author: Ajay Kumar Gupta <ajay.gupta@ti.com>
+ *
+ * Based on drivers/usb/musb/da8xx.c
+ *
+ * Copyright (c) 2010 Texas Instruments Incorporated
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * 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, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+#include <common.h>
+
+#include "am35x.h"
+
+/* MUSB platform configuration */
+struct musb_config musb_cfg = {
+	.regs		= (struct musb_regs *)AM35X_USB_OTG_CORE_BASE,
+	.timeout	= AM35X_USB_OTG_TIMEOUT,
+	.musb_speed	= 0,
+};
+
+/*
+ * Enable the USB phy
+ */
+static u8 phy_on(void)
+{
+	u32 devconf2;
+	u32 timeout;
+
+	devconf2 = readl(&am35x_scm_general_regs->devconf2);
+
+	devconf2 &= ~(DEVCONF2_RESET | DEVCONF2_PHYPWRDN | DEVCONF2_OTGPWRDN |
+		      DEVCONF2_OTGMODE | DEVCONF2_REFFREQ |
+		      DEVCONF2_PHY_GPIOMODE);
+	devconf2 |= DEVCONF2_SESENDEN | DEVCONF2_VBDTCTEN | DEVCONF2_PHY_PLLON |
+		    DEVCONF2_REFFREQ_13MHZ | DEVCONF2_DATPOL;
+
+	writel(devconf2, &am35x_scm_general_regs->devconf2);
+
+	/* wait until the USB phy is turned on */
+	timeout = musb_cfg.timeout;
+	while (timeout--)
+		if (readl(&am35x_scm_general_regs->devconf2) & DEVCONF2_PHYCKGD)
+			return 1;
+
+	/* USB phy was not turned on */
+	return 0;
+}
+
+/*
+ * Disable the USB phy
+ */
+static void phy_off(void)
+{
+	u32 devconf2;
+
+	/*
+	 * Power down the on-chip PHY.
+	 */
+	devconf2 = readl(&am35x_scm_general_regs->devconf2);
+
+	devconf2 &= ~DEVCONF2_PHY_PLLON;
+	devconf2 |= DEVCONF2_PHYPWRDN | DEVCONF2_OTGPWRDN;
+	writel(devconf2, &am35x_scm_general_regs->devconf2);
+}
+
+/*
+ * This function performs platform specific initialization for usb0.
+ */
+int musb_platform_init(void)
+{
+	u32 revision;
+	u32 sw_reset;
+
+	/* global usb reset */
+	sw_reset = readl(&am35x_scm_general_regs->ip_sw_reset);
+	sw_reset |= (1 << 0);
+	writel(sw_reset, &am35x_scm_general_regs->ip_sw_reset);
+	sw_reset &= ~(1 << 0);
+	writel(sw_reset, &am35x_scm_general_regs->ip_sw_reset);
+
+	/* reset the controller */
+	writel(0x1, &am35x_usb_regs->control);
+	udelay(5000);
+
+	/* start the on-chip usb phy and its pll */
+	if (phy_on() == 0)
+		return -1;
+
+	/* Returns zero if e.g. not clocked */
+	revision = readl(&am35x_usb_regs->revision);
+	if (revision == 0)
+		return -1;
+
+	return 0;
+}
+
+/*
+ * This function performs platform specific deinitialization for usb0.
+ */
+void musb_platform_deinit(void)
+{
+	/* Turn off the phy */
+	phy_off();
+}
diff --git a/drivers/usb/musb/am35x.h b/drivers/usb/musb/am35x.h
new file mode 100644
index 0000000..fac06e7
--- /dev/null
+++ b/drivers/usb/musb/am35x.h
@@ -0,0 +1,94 @@
+/*
+ * am35x.h - TI's AM35x platform specific usb wrapper definitions.
+ *
+ * Author: Ajay Kumar Gupta <ajay.gupta@ti.com>
+ *
+ * Based on drivers/usb/musb/da8xx.h
+ *
+ * Copyright (c) 2010 Texas Instruments Incorporated
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * 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, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#ifndef __AM35X_USB_H__
+#define __AM35X_USB_H__
+
+#include <asm/arch/cpu.h>
+#include "musb_core.h"
+
+/* Base address of musb wrapper */
+#define AM35X_USB_OTG_BASE	0x5C040000
+
+/* Base address of musb core */
+#define AM35X_USB_OTG_CORE_BASE	(AM35X_USB_OTG_BASE + 0x400)
+
+/* Timeout for AM35x usb module */
+#define AM35X_USB_OTG_TIMEOUT	0x3FFFFFF
+
+/*
+ * AM35x platform USB wrapper register overlay.
+ */
+struct am35x_usb_regs {
+	u32	revision;
+	u32	control;
+	u32	status;
+	u32	emulation;
+	u32	reserved0[1];
+	u32	autoreq;
+	u32	srpfixtime;
+	u32	ep_intsrc;
+	u32	ep_intsrcset;
+	u32	ep_intsrcclr;
+	u32	ep_intmsk;
+	u32	ep_intmskset;
+	u32	ep_intmskclr;
+	u32	ep_intsrcmsked;
+	u32	reserved1[1];
+	u32	core_intsrc;
+	u32	core_intsrcset;
+	u32	core_intsrcclr;
+	u32	core_intmsk;
+	u32	core_intmskset;
+	u32	core_intmskclr;
+	u32	core_intsrcmsked;
+	u32	reserved2[1];
+	u32	eoi;
+	u32	mop_sop_en;
+	u32	reserved3[2];
+	u32	txmode;
+	u32	rxmode;
+	u32	epcount_mode;
+};
+
+#define am35x_usb_regs ((struct am35x_usb_regs *)AM35X_USB_OTG_BASE)
+
+/* USB 2.0 PHY Control */
+#define DEVCONF2_PHY_GPIOMODE	(1 << 23)
+#define DEVCONF2_OTGMODE	(3 << 14)
+#define DEVCONF2_SESENDEN	(1 << 13)       /* Vsess_end comparator */
+#define DEVCONF2_VBDTCTEN	(1 << 12)       /* Vbus comparator */
+#define DEVCONF2_REFFREQ_24MHZ	(2 << 8)
+#define DEVCONF2_REFFREQ_26MHZ	(7 << 8)
+#define DEVCONF2_REFFREQ_13MHZ	(6 << 8)
+#define DEVCONF2_REFFREQ	(0xf << 8)
+#define DEVCONF2_PHYCKGD	(1 << 7)
+#define DEVCONF2_VBUSSENSE	(1 << 6)
+#define DEVCONF2_PHY_PLLON	(1 << 5)        /* override PLL suspend */
+#define DEVCONF2_RESET		(1 << 4)
+#define DEVCONF2_PHYPWRDN	(1 << 3)
+#define DEVCONF2_OTGPWRDN	(1 << 2)
+#define DEVCONF2_DATPOL		(1 << 1)
+
+#endif	/* __AM35X_USB_H__ */
diff --git a/drivers/usb/musb/musb_udc.c b/drivers/usb/musb/musb_udc.c
index fc43cf4..6f6ed61 100644
--- a/drivers/usb/musb/musb_udc.c
+++ b/drivers/usb/musb/musb_udc.c
@@ -57,6 +57,8 @@
 #include "musb_core.h"
 #if defined(CONFIG_USB_OMAP3)
 #include "omap3.h"
+#elif defined(CONFIG_USB_AM35X)
+#include "am35x.h"
 #elif defined(CONFIG_USB_DAVINCI)
 #include "davinci.h"
 #endif
diff --git a/include/usb.h b/include/usb.h
index bc4ccfe..afd65e3 100644
--- a/include/usb.h
+++ b/include/usb.h
@@ -133,7 +133,7 @@ struct usb_device {
 	defined(CONFIG_USB_SL811HS) || defined(CONFIG_USB_ISP116X_HCD) || \
 	defined(CONFIG_USB_R8A66597_HCD) || defined(CONFIG_USB_DAVINCI) || \
 	defined(CONFIG_USB_OMAP3) || defined(CONFIG_USB_DA8XX) || \
-	defined(CONFIG_USB_BLACKFIN)
+	defined(CONFIG_USB_BLACKFIN) || defined(CONFIG_USB_AM35X)
 
 int usb_lowlevel_init(void);
 int usb_lowlevel_stop(void);
-- 
1.6.2.4

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

* [U-Boot] [PATCH 3/4] musb: am35x: Workaround for fifo read issue
  2010-07-07 11:57   ` [U-Boot] [PATCH 2/4] musb: MSC host support for AM35x Ajay Kumar Gupta
@ 2010-07-07 11:57     ` Ajay Kumar Gupta
  2010-07-07 11:57       ` [U-Boot] [PATCH 4/4] AM3517EVM: musb: add usb config Ajay Kumar Gupta
  0 siblings, 1 reply; 11+ messages in thread
From: Ajay Kumar Gupta @ 2010-07-07 11:57 UTC (permalink / raw)
  To: u-boot

AM35x supports only 32bit read operations so we need to have
workaround for 8bit and 16bit read operations.

Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
---
 drivers/usb/musb/am35x.c     |   32 ++++++++++++++++++++++++++++++++
 drivers/usb/musb/musb_core.c |    6 ++++++
 2 files changed, 38 insertions(+), 0 deletions(-)

diff --git a/drivers/usb/musb/am35x.c b/drivers/usb/musb/am35x.c
index 2024940..1706c13 100644
--- a/drivers/usb/musb/am35x.c
+++ b/drivers/usb/musb/am35x.c
@@ -116,3 +116,35 @@ void musb_platform_deinit(void)
 	/* Turn off the phy */
 	phy_off();
 }
+
+/*
+ * This function reads data from endpoint fifo for AM35x
+ * which supports only 32bit read operation.
+ *
+ * ep           - endpoint number
+ * length       - number of bytes to read from FIFO
+ * fifo_data    - pointer to data buffer into which data is read
+ */
+__attribute__((weak))
+void read_fifo(u8 ep, u32 length, void *fifo_data)
+{
+	u8  *data = (u8 *)fifo_data;
+	u32 val;
+	int i;
+
+	/* select the endpoint index */
+	writeb(ep, &musbr->index);
+
+	if (length > 4) {
+		for (i = 0; i < (length >> 2); i++) {
+			val = readl(&musbr->fifox[ep]);
+			memcpy(data, &val, 4);
+			data += 4;
+		}
+		length %= 4;
+	}
+	if (length > 0) {
+		val = readl(&musbr->fifox[ep]);
+		memcpy(data, &val, length);
+	}
+}
diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c
index dc740cf..6fe2c39 100644
--- a/drivers/usb/musb/musb_core.c
+++ b/drivers/usb/musb/musb_core.c
@@ -142,6 +142,11 @@ void write_fifo(u8 ep, u32 length, void *fifo_data)
 }
 
 /*
+ * AM35x supports only 32bit read operations so
+ * use seperate read_fifo() function for it.
+ */
+#ifndef CONFIG_USB_AM35X
+/*
  * This function reads data from endpoint fifo
  *
  * ep           - endpoint number
@@ -160,3 +165,4 @@ void read_fifo(u8 ep, u32 length, void *fifo_data)
 	while (length--)
 		*data++ = readb(&musbr->fifox[ep]);
 }
+#endif /* CONFIG_USB_AM35X */
-- 
1.6.2.4

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

* [U-Boot] [PATCH 4/4] AM3517EVM: musb: add usb config
  2010-07-07 11:57     ` [U-Boot] [PATCH 3/4] musb: am35x: Workaround for fifo read issue Ajay Kumar Gupta
@ 2010-07-07 11:57       ` Ajay Kumar Gupta
  0 siblings, 0 replies; 11+ messages in thread
From: Ajay Kumar Gupta @ 2010-07-07 11:57 UTC (permalink / raw)
  To: u-boot

Enabling USB HOST in defconfig.

Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
---
 include/configs/am3517_evm.h |   38 ++++++++++++++++++++++++++++++++++++++
 1 files changed, 38 insertions(+), 0 deletions(-)

diff --git a/include/configs/am3517_evm.h b/include/configs/am3517_evm.h
index 513d005..c197ac8 100644
--- a/include/configs/am3517_evm.h
+++ b/include/configs/am3517_evm.h
@@ -99,6 +99,44 @@
 #define CONFIG_OMAP3_MMC		1
 #define CONFIG_DOS_PARTITION		1
 
+/*
+ * USB configuration
+ * Enable CONFIG_MUSB_HCD for Host functionalities MSC, keyboard
+ * Enable CONFIG_MUSB_UDC for Device functionalities.
+ */
+#define CONFIG_USB_AM35X		1
+#define CONFIG_MUSB_HCD			1
+
+#ifdef CONFIG_USB_AM35X
+
+#ifdef CONFIG_MUSB_HCD
+#define CONFIG_CMD_USB
+
+#define CONFIG_USB_STORAGE
+#define CONGIG_CMD_STORAGE
+#define CONFIG_CMD_FAT
+
+#ifdef CONFIG_USB_KEYBOARD
+#define CONFIG_SYS_USB_EVENT_POLL
+#define CONFIG_PREBOOT "usb start"
+#endif /* CONFIG_USB_KEYBOARD */
+
+#endif /* CONFIG_MUSB_HCD */
+
+#ifdef CONFIG_MUSB_UDC
+/* USB device configuration */
+#define CONFIG_USB_DEVICE		1
+#define CONFIG_USB_TTY			1
+#define CONFIG_SYS_CONSOLE_IS_IN_ENV	1
+/* Change these to suit your needs */
+#define CONFIG_USBD_VENDORID		0x0451
+#define CONFIG_USBD_PRODUCTID		0x5678
+#define CONFIG_USBD_MANUFACTURER	"Texas Instruments"
+#define CONFIG_USBD_PRODUCT_NAME	"AM3517EVM"
+#endif /* CONFIG_MUSB_UDC */
+
+#endif /* CONFIG_USB_AM35X */
+
 /* commands to include */
 #include <config_cmd_default.h>
 
-- 
1.6.2.4

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

* [U-Boot] [PATCH 1/4] AM35x: Adding SCM general register definitions
  2010-07-07 11:57 ` [U-Boot] [PATCH 1/4] AM35x: Adding SCM general register definitions Ajay Kumar Gupta
  2010-07-07 11:57   ` [U-Boot] [PATCH 2/4] musb: MSC host support for AM35x Ajay Kumar Gupta
@ 2010-07-07 13:17   ` Paulraj, Sandeep
  2010-07-07 13:25     ` Gupta, Ajay Kumar
  1 sibling, 1 reply; 11+ messages in thread
From: Paulraj, Sandeep @ 2010-07-07 13:17 UTC (permalink / raw)
  To: u-boot



> Adding general register structure of system control module (SCM)
> of AM35x. This would be required to access devconf2 and ip_sw_reset
> register in musb module.
> 
> Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
> ---
>  arch/arm/include/asm/arch-omap3/cpu.h |   20 ++++++++++++++++++++
>  1 files changed, 20 insertions(+), 0 deletions(-)
> 
> diff --git a/arch/arm/include/asm/arch-omap3/cpu.h
> b/arch/arm/include/asm/arch-omap3/cpu.h
> index c072c27..773ea0c 100644
> --- a/arch/arm/include/asm/arch-omap3/cpu.h
> +++ b/arch/arm/include/asm/arch-omap3/cpu.h
> @@ -483,4 +483,24 @@ struct pm {
>  #define I2C_BASE2		(OMAP34XX_CORE_L4_IO_BASE + 0x72000)
>  #define I2C_BASE3		(OMAP34XX_CORE_L4_IO_BASE + 0x60000)
> 
> +/* AM35x specific */
> +#ifndef __KERNEL_STRICT_NAMES
> +#ifndef __ASSEMBLY__
> +#define AM35X_SCM_GEN_BASE	0x48002270
> +/* General register mappings of system control module */
> +struct am35x_scm_general {
> +	u32 res1[0xC4];		/* 0x000 - 0x30C */
> +	u32 devconf2;		/* 0x310 */
> +	u32 devconf3;		/* 0x314 */
> +	u32 res2[0x2];		/* 0x318 - 0x31C */
> +	u32 cba_priority;	/* 0x320 */
> +	u32 lvl_intr_clr;	/* 0x324 */
> +	u32 ip_sw_reset;	/* 0x328 */
> +	u32 ipss_clk_ctrl;	/* 0x32C */
> +};

Shouldn't this structure be in a am35 specific header?


> +#define am35x_scm_general_regs ((struct am35x_scm_general
> *)AM35X_SCM_GEN_BASE)
> +
> +#endif /*__ASSEMBLY__ */
> +#endif /* __KERNEL_STRICT_NAMES */
> +
>  #endif /* _CPU_H */
> --

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

* [U-Boot] [PATCH 1/4] AM35x: Adding SCM general register definitions
  2010-07-07 13:17   ` [U-Boot] [PATCH 1/4] AM35x: Adding SCM general register definitions Paulraj, Sandeep
@ 2010-07-07 13:25     ` Gupta, Ajay Kumar
  2010-07-07 13:31       ` Paulraj, Sandeep
  0 siblings, 1 reply; 11+ messages in thread
From: Gupta, Ajay Kumar @ 2010-07-07 13:25 UTC (permalink / raw)
  To: u-boot

Hi,
> > Adding general register structure of system control module (SCM)
> > of AM35x. This would be required to access devconf2 and ip_sw_reset
> > register in musb module.
> >
> > Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
> > ---
> >  arch/arm/include/asm/arch-omap3/cpu.h |   20 ++++++++++++++++++++
> >  1 files changed, 20 insertions(+), 0 deletions(-)
> >
> > diff --git a/arch/arm/include/asm/arch-omap3/cpu.h
> > b/arch/arm/include/asm/arch-omap3/cpu.h
> > index c072c27..773ea0c 100644
> > --- a/arch/arm/include/asm/arch-omap3/cpu.h
> > +++ b/arch/arm/include/asm/arch-omap3/cpu.h
> > @@ -483,4 +483,24 @@ struct pm {
> >  #define I2C_BASE2		(OMAP34XX_CORE_L4_IO_BASE + 0x72000)
> >  #define I2C_BASE3		(OMAP34XX_CORE_L4_IO_BASE + 0x60000)
> >
> > +/* AM35x specific */
> > +#ifndef __KERNEL_STRICT_NAMES
> > +#ifndef __ASSEMBLY__
> > +#define AM35X_SCM_GEN_BASE	0x48002270
> > +/* General register mappings of system control module */
> > +struct am35x_scm_general {
> > +	u32 res1[0xC4];		/* 0x000 - 0x30C */
> > +	u32 devconf2;		/* 0x310 */
> > +	u32 devconf3;		/* 0x314 */
> > +	u32 res2[0x2];		/* 0x318 - 0x31C */
> > +	u32 cba_priority;	/* 0x320 */
> > +	u32 lvl_intr_clr;	/* 0x324 */
> > +	u32 ip_sw_reset;	/* 0x328 */
> > +	u32 ipss_clk_ctrl;	/* 0x32C */
> > +};
> 
> Shouldn't this structure be in a am35 specific header?

AM35x is based on OMAP3x and moreover there is no AM35x specific
File so I added them here. Do you want me to add a header for
AM35x as arch/arm/include/asm/arch-omap3/am35x.h ?

Thanks,
Ajay
> 
> 
> > +#define am35x_scm_general_regs ((struct am35x_scm_general
> > *)AM35X_SCM_GEN_BASE)
> > +
> > +#endif /*__ASSEMBLY__ */
> > +#endif /* __KERNEL_STRICT_NAMES */
> > +
> >  #endif /* _CPU_H */
> > --

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

* [U-Boot] [PATCH 1/4] AM35x: Adding SCM general register definitions
  2010-07-07 13:25     ` Gupta, Ajay Kumar
@ 2010-07-07 13:31       ` Paulraj, Sandeep
  2010-07-07 13:39         ` Gupta, Ajay Kumar
  0 siblings, 1 reply; 11+ messages in thread
From: Paulraj, Sandeep @ 2010-07-07 13:31 UTC (permalink / raw)
  To: u-boot


> 
> Hi,
> > > Adding general register structure of system control module (SCM)
> > > of AM35x. This would be required to access devconf2 and ip_sw_reset
> > > register in musb module.
> > >
> > > Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
> > > ---
> > >  arch/arm/include/asm/arch-omap3/cpu.h |   20 ++++++++++++++++++++
> > >  1 files changed, 20 insertions(+), 0 deletions(-)
> > >
> > > diff --git a/arch/arm/include/asm/arch-omap3/cpu.h
> > > b/arch/arm/include/asm/arch-omap3/cpu.h
> > > index c072c27..773ea0c 100644
> > > --- a/arch/arm/include/asm/arch-omap3/cpu.h
> > > +++ b/arch/arm/include/asm/arch-omap3/cpu.h
> > > @@ -483,4 +483,24 @@ struct pm {
> > >  #define I2C_BASE2		(OMAP34XX_CORE_L4_IO_BASE + 0x72000)
> > >  #define I2C_BASE3		(OMAP34XX_CORE_L4_IO_BASE + 0x60000)
> > >
> > > +/* AM35x specific */
> > > +#ifndef __KERNEL_STRICT_NAMES
> > > +#ifndef __ASSEMBLY__
> > > +#define AM35X_SCM_GEN_BASE	0x48002270
> > > +/* General register mappings of system control module */
> > > +struct am35x_scm_general {
> > > +	u32 res1[0xC4];		/* 0x000 - 0x30C */
> > > +	u32 devconf2;		/* 0x310 */
> > > +	u32 devconf3;		/* 0x314 */
> > > +	u32 res2[0x2];		/* 0x318 - 0x31C */
> > > +	u32 cba_priority;	/* 0x320 */
> > > +	u32 lvl_intr_clr;	/* 0x324 */
> > > +	u32 ip_sw_reset;	/* 0x328 */
> > > +	u32 ipss_clk_ctrl;	/* 0x32C */
> > > +};
> >
> > Shouldn't this structure be in a am35 specific header?
> 
> AM35x is based on OMAP3x and moreover there is no AM35x specific
understood
> File so I added them here. Do you want me to add a header for
> AM35x as arch/arm/include/asm/arch-omap3/am35x.h ?
> 
> Thanks,
> Ajay
> > > --

What about 
drivers/usb/musb/am35x.h
which you just created in your patch set


Thanks,
Sandeep

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

* [U-Boot] [PATCH 1/4] AM35x: Adding SCM general register definitions
  2010-07-07 13:31       ` Paulraj, Sandeep
@ 2010-07-07 13:39         ` Gupta, Ajay Kumar
  2010-07-07 13:50           ` Paulraj, Sandeep
  0 siblings, 1 reply; 11+ messages in thread
From: Gupta, Ajay Kumar @ 2010-07-07 13:39 UTC (permalink / raw)
  To: u-boot

Hi
> > > > Adding general register structure of system control module (SCM)
> > > > of AM35x. This would be required to access devconf2 and ip_sw_reset
> > > > register in musb module.
> > > >
> > > > Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
> > > > ---
> > > >  arch/arm/include/asm/arch-omap3/cpu.h |   20 ++++++++++++++++++++
> > > >  1 files changed, 20 insertions(+), 0 deletions(-)
> > > >
> > > > diff --git a/arch/arm/include/asm/arch-omap3/cpu.h
> > > > b/arch/arm/include/asm/arch-omap3/cpu.h
> > > > index c072c27..773ea0c 100644
> > > > --- a/arch/arm/include/asm/arch-omap3/cpu.h
> > > > +++ b/arch/arm/include/asm/arch-omap3/cpu.h
> > > > @@ -483,4 +483,24 @@ struct pm {
> > > >  #define I2C_BASE2		(OMAP34XX_CORE_L4_IO_BASE + 0x72000)
> > > >  #define I2C_BASE3		(OMAP34XX_CORE_L4_IO_BASE + 0x60000)
> > > >
> > > > +/* AM35x specific */
> > > > +#ifndef __KERNEL_STRICT_NAMES
> > > > +#ifndef __ASSEMBLY__
> > > > +#define AM35X_SCM_GEN_BASE	0x48002270
> > > > +/* General register mappings of system control module */
> > > > +struct am35x_scm_general {
> > > > +	u32 res1[0xC4];		/* 0x000 - 0x30C */
> > > > +	u32 devconf2;		/* 0x310 */
> > > > +	u32 devconf3;		/* 0x314 */
> > > > +	u32 res2[0x2];		/* 0x318 - 0x31C */
> > > > +	u32 cba_priority;	/* 0x320 */
> > > > +	u32 lvl_intr_clr;	/* 0x324 */
> > > > +	u32 ip_sw_reset;	/* 0x328 */
> > > > +	u32 ipss_clk_ctrl;	/* 0x32C */
> > > > +};
> > >
> > > Shouldn't this structure be in a am35 specific header?
> >
> > AM35x is based on OMAP3x and moreover there is no AM35x specific
> understood
> > File so I added them here. Do you want me to add a header for
> > AM35x as arch/arm/include/asm/arch-omap3/am35x.h ?
> >
> > Thanks,
> > Ajay
> > > > --
> 
> What about
> drivers/usb/musb/am35x.h
> which you just created in your patch set

am35x_scm_general is a system register sets and can be used by non usb
modules as well so I think drivers/usb/musb/am35x.h would not be a right
place.

Are you concerned of same name file instead? If so then we can have
Different names for these files.

Thanks,
Ajay
> 
> 
> Thanks,
> Sandeep

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

* [U-Boot] [PATCH 1/4] AM35x: Adding SCM general register definitions
  2010-07-07 13:39         ` Gupta, Ajay Kumar
@ 2010-07-07 13:50           ` Paulraj, Sandeep
  0 siblings, 0 replies; 11+ messages in thread
From: Paulraj, Sandeep @ 2010-07-07 13:50 UTC (permalink / raw)
  To: u-boot


> > > > >
> > > > > diff --git a/arch/arm/include/asm/arch-omap3/cpu.h
> > > > > b/arch/arm/include/asm/arch-omap3/cpu.h
> > > > > index c072c27..773ea0c 100644
> > > > > --- a/arch/arm/include/asm/arch-omap3/cpu.h
> > > > > +++ b/arch/arm/include/asm/arch-omap3/cpu.h
> > > > > @@ -483,4 +483,24 @@ struct pm {
> > > > >  #define I2C_BASE2		(OMAP34XX_CORE_L4_IO_BASE + 0x72000)
> > > > >  #define I2C_BASE3		(OMAP34XX_CORE_L4_IO_BASE + 0x60000)
> > > > >
> > > > > +/* AM35x specific */
> > > > > +#ifndef __KERNEL_STRICT_NAMES
> > > > > +#ifndef __ASSEMBLY__
> > > > > +#define AM35X_SCM_GEN_BASE	0x48002270
> > > > > +/* General register mappings of system control module */
> > > > > +struct am35x_scm_general {
> > > > > +	u32 res1[0xC4];		/* 0x000 - 0x30C */
> > > > > +	u32 devconf2;		/* 0x310 */
> > > > > +	u32 devconf3;		/* 0x314 */
> > > > > +	u32 res2[0x2];		/* 0x318 - 0x31C */
> > > > > +	u32 cba_priority;	/* 0x320 */
> > > > > +	u32 lvl_intr_clr;	/* 0x324 */
> > > > > +	u32 ip_sw_reset;	/* 0x328 */
> > > > > +	u32 ipss_clk_ctrl;	/* 0x32C */
> > > > > +};
> > > >
> > > > Shouldn't this structure be in a am35 specific header?
> > >
> > > AM35x is based on OMAP3x and moreover there is no AM35x specific
> > understood
> > > File so I added them here. Do you want me to add a header for
> > > AM35x as arch/arm/include/asm/arch-omap3/am35x.h ?
> > >
> > > Thanks,
> > > Ajay
> > > > > --
> >
> > What about
> > drivers/usb/musb/am35x.h
> > which you just created in your patch set
> 
> am35x_scm_general is a system register sets and can be used by non usb
> modules as well so I think drivers/usb/musb/am35x.h would not be a right
> place.


Agree.
Then in that case it is better in my opinion to have  
arch/arm/include/asm/arch-omap3/am35x.h as you mention above rather than clutter cpu.h

> Are you concerned of same name file instead? If so then we can have
> Different names for these files.
> 


I will also urge you to wait just a little because I have just sent Wolfgang a pull request with lots of changes OMAP3 and OMAP4. I would urge you to wait till he accepts the pull request.

Or you can make patches against u-boot-ti

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

* [U-Boot] [PATCH 4/4] AM3517EVM: musb: add usb config
  2010-07-09  6:13     ` [U-Boot] [PATCH 3/4 v2] musb: am35x: Workaround for fifo read issue Ajay Kumar Gupta
@ 2010-07-09  6:13       ` Ajay Kumar Gupta
  0 siblings, 0 replies; 11+ messages in thread
From: Ajay Kumar Gupta @ 2010-07-09  6:13 UTC (permalink / raw)
  To: u-boot

Enabling USB HOST in defconfig.

Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
---
 include/configs/am3517_evm.h |   38 ++++++++++++++++++++++++++++++++++++++
 1 files changed, 38 insertions(+), 0 deletions(-)

diff --git a/include/configs/am3517_evm.h b/include/configs/am3517_evm.h
index 10af21b..a9045d8 100644
--- a/include/configs/am3517_evm.h
+++ b/include/configs/am3517_evm.h
@@ -99,6 +99,44 @@
 #define CONFIG_OMAP3_MMC		1
 #define CONFIG_DOS_PARTITION		1
 
+/*
+ * USB configuration
+ * Enable CONFIG_MUSB_HCD for Host functionalities MSC, keyboard
+ * Enable CONFIG_MUSB_UDC for Device functionalities.
+ */
+#define CONFIG_USB_AM35X		1
+#define CONFIG_MUSB_HCD			1
+
+#ifdef CONFIG_USB_AM35X
+
+#ifdef CONFIG_MUSB_HCD
+#define CONFIG_CMD_USB
+
+#define CONFIG_USB_STORAGE
+#define CONGIG_CMD_STORAGE
+#define CONFIG_CMD_FAT
+
+#ifdef CONFIG_USB_KEYBOARD
+#define CONFIG_SYS_USB_EVENT_POLL
+#define CONFIG_PREBOOT "usb start"
+#endif /* CONFIG_USB_KEYBOARD */
+
+#endif /* CONFIG_MUSB_HCD */
+
+#ifdef CONFIG_MUSB_UDC
+/* USB device configuration */
+#define CONFIG_USB_DEVICE		1
+#define CONFIG_USB_TTY			1
+#define CONFIG_SYS_CONSOLE_IS_IN_ENV	1
+/* Change these to suit your needs */
+#define CONFIG_USBD_VENDORID		0x0451
+#define CONFIG_USBD_PRODUCTID		0x5678
+#define CONFIG_USBD_MANUFACTURER	"Texas Instruments"
+#define CONFIG_USBD_PRODUCT_NAME	"AM3517EVM"
+#endif /* CONFIG_MUSB_UDC */
+
+#endif /* CONFIG_USB_AM35X */
+
 /* commands to include */
 #include <config_cmd_default.h>
 
-- 
1.6.2.4

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

end of thread, other threads:[~2010-07-09  6:13 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-07-07 11:57 [U-Boot] [PATCH 0/4] AM35X: Add musb support Ajay Kumar Gupta
2010-07-07 11:57 ` [U-Boot] [PATCH 1/4] AM35x: Adding SCM general register definitions Ajay Kumar Gupta
2010-07-07 11:57   ` [U-Boot] [PATCH 2/4] musb: MSC host support for AM35x Ajay Kumar Gupta
2010-07-07 11:57     ` [U-Boot] [PATCH 3/4] musb: am35x: Workaround for fifo read issue Ajay Kumar Gupta
2010-07-07 11:57       ` [U-Boot] [PATCH 4/4] AM3517EVM: musb: add usb config Ajay Kumar Gupta
2010-07-07 13:17   ` [U-Boot] [PATCH 1/4] AM35x: Adding SCM general register definitions Paulraj, Sandeep
2010-07-07 13:25     ` Gupta, Ajay Kumar
2010-07-07 13:31       ` Paulraj, Sandeep
2010-07-07 13:39         ` Gupta, Ajay Kumar
2010-07-07 13:50           ` Paulraj, Sandeep
2010-07-09  6:13 [U-Boot] [PATCH 0/4 v2] AM35X: Add musb support Ajay Kumar Gupta
2010-07-09  6:13 ` [U-Boot] [PATCH 1/4 v2] AM35x: Adding SCM general register definitions Ajay Kumar Gupta
2010-07-09  6:13   ` [U-Boot] [PATCH 2/4 v2] musb: MSC host support for AM35x Ajay Kumar Gupta
2010-07-09  6:13     ` [U-Boot] [PATCH 3/4 v2] musb: am35x: Workaround for fifo read issue Ajay Kumar Gupta
2010-07-09  6:13       ` [U-Boot] [PATCH 4/4] AM3517EVM: musb: add usb config Ajay Kumar Gupta

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.