Skip to contentSkip to conversation

ARMV7: Enhance support for OMAP4

PATCH Superseded Steve Sakoman 3 participants 13 messages Jul 24, 2010 – Aug 3, 2010

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

v2 cover ARMV7: Enhance support for OMAP4

This is version 2 of the patch set. It incorporates all feedback to date.

This patch series adds support for:
- pad mux initialization
- OMAP4 TWL6030 companion chip initialization
- usb driver and gadget support

It also fixes issues in the udelay implementation and the OMAP I2C driver as well as tweaks the default environment.

These patches were tested on Panda and OMAP4430 SDP as well as on the Gumstix Overo to verify that there were no regressions on OMAP3.

Steve Sakoman (8):
ARMV7: Add pad mux support for OMAP4
ARMV7: Fix udelay for OMAP4
ARMV7: Modify i2c driver for more reliable operation on OMAP4
ARMV7: Add support for the TWL6030 I2C power chip used in OMAP4
systems
ARMV7: Restructure omap3 musb driver to allow code sharing between
OMAP3 and OMAP4
ARMV7: Enable musb driver and usbtty on OMAP4430 SDP
ARMV7: Enable musb driver and usbtty on OMAP4 Panda
ARMV7: Update default environment for OMAP4 boards

 arch/arm/cpu/armv7/omap-common/timer.c      |    9 -
 arch/arm/cpu/armv7/omap4/board.c            |   11 +
 arch/arm/include/asm/arch-omap3/cpu.h       |    3 +
 arch/arm/include/asm/arch-omap3/i2c.h       |    4 +-
 arch/arm/include/asm/arch-omap4/cpu.h       |    3 +
 arch/arm/include/asm/arch-omap4/mux_omap4.h |  344 +++++++++++++++++++++++++++
 arch/arm/include/asm/arch-omap4/omap4.h     |    2 +
 arch/arm/include/asm/arch-omap4/sys_proto.h |    1 +
 board/ti/panda/panda.c                      |   26 ++
 board/ti/panda/panda.h                      |  265 +++++++++++++++++++++
 board/ti/sdp4430/sdp.c                      |   26 ++
 board/ti/sdp4430/sdp.h                      |  265 +++++++++++++++++++++
 drivers/i2c/omap24xx_i2c.c                  |   31 ++-
 drivers/i2c/omap24xx_i2c.h                  |    4 +
 drivers/power/Makefile                      |    1 +
 drivers/power/twl6030.c                     |   77 ++++++
 drivers/usb/musb/omap3.c                    |   16 ++
 drivers/usb/musb/omap3.h                    |    3 +-
 include/configs/omap4_panda.h               |   28 ++-
 include/configs/omap4_sdp4430.h             |   28 ++-
 include/twl6030.h                           |   90 +++++++
 21 files changed, 1210 insertions(+), 27 deletions(-)
 create mode 100644 arch/arm/include/asm/arch-omap4/mux_omap4.h
 create mode 100644 board/ti/panda/panda.h
 create mode 100644 board/ti/sdp4430/sdp.h
 create mode 100644 drivers/power/twl6030.c
 create mode 100644 include/twl6030.h
#1 lore raw

PATCH v2 1/8 ARMV7: Add pad mux support for OMAP4

Add functional multiplexing support for OMAP4 pads. Configure all the pads for the OMAP4430 SDP and OMAP4 Panda boards

---
 arch/arm/cpu/armv7/omap4/board.c            |   11 +
 arch/arm/include/asm/arch-omap4/mux_omap4.h |  344 +++++++++++++++++++++++++++
 arch/arm/include/asm/arch-omap4/omap4.h     |    2 +
 arch/arm/include/asm/arch-omap4/sys_proto.h |    1 +
 board/ti/panda/panda.c                      |   26 ++
 board/ti/panda/panda.h                      |  265 +++++++++++++++++++++
 board/ti/sdp4430/sdp.c                      |   26 ++
 board/ti/sdp4430/sdp.h                      |  265 +++++++++++++++++++++
 include/configs/omap4_panda.h               |    1 +
 include/configs/omap4_sdp4430.h             |    1 +
 10 files changed, 942 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/include/asm/arch-omap4/mux_omap4.h
 create mode 100644 board/ti/panda/panda.h
 create mode 100644 board/ti/sdp4430/sdp.h
arch/arm/cpu/armv7/omap4/board.c +11 -0
index 5bf7173..2e80d1f 100644
@@ -88,3 +88,14 @@ int checkboard(void)
 	return 0;
 }
 
+/*
+* This function is called by start_armboot. You can reliably use static
+* data. Any boot-time function that require static data should be
+* called from here
+*/
+int arch_cpu_init(void)
+{
+	set_muxconf_regs();
+	return 0;
+}
+
arch/arm/include/asm/arch-omap4/mux_omap4.h new file +344 -0

344 lines not on this page · raw message

arch/arm/include/asm/arch-omap4/omap4.h +2 -0
index 5243ea8..79ff22c 100644
@@ -44,6 +44,8 @@
 
 /* CONTROL */
 #define CTRL_BASE		(OMAP44XX_L4_CORE_BASE + 0x2000)
+#define CONTROL_PADCONF_CORE	(OMAP44XX_L4_CORE_BASE + 0x100000)
+#define CONTROL_PADCONF_WKUP	(OMAP44XX_L4_CORE_BASE + 0x31E000)
 
 /* UART */
 #define UART1_BASE		(OMAP44XX_L4_PER_BASE + 0x6a000)
arch/arm/include/asm/arch-omap4/sys_proto.h +1 -0
index c6fab00..ad0c640 100644
@@ -32,6 +32,7 @@ void gpmc_init(void);
 void watchdog_init(void);
 u32 get_device_type(void);
 void invalidate_dcache(u32);
+void set_muxconf_regs(void);
 
 extern const struct omap_sysinfo sysinfo;
 
board/ti/panda/panda.c +26 -0
index 917bbec..1b8153b 100644
@@ -24,6 +24,8 @@
 #include <common.h>
 #include <asm/arch/sys_proto.h>
 
+#include "panda.h"
+
 DECLARE_GLOBAL_DATA_PTR;
 
 const struct omap_sysinfo sysinfo = {
@@ -61,3 +63,27 @@ int misc_init_r(void)
 {
 	return 0;
 }
+
+void do_set_mux(u32 base, struct pad_conf_entry const *array, int size)
+{
+	int i;
+	struct pad_conf_entry *pad = (struct pad_conf_entry *) array;
+
+	for (i = 0; i < size; i++, pad++)
+		writew(pad->val, base + pad->offset);
+}
+
+/**
+ * @brief set_muxconf_regs Setting up the configuration Mux registers
+ * specific to the board.
+ */
+void set_muxconf_regs(void)
+{
+	do_set_mux(CONTROL_PADCONF_CORE, core_padconf_array,
+		   sizeof(core_padconf_array) /
+		   sizeof(struct pad_conf_entry));
+
+	do_set_mux(CONTROL_PADCONF_WKUP, wkup_padconf_array,
+		   sizeof(wkup_padconf_array) /
+		   sizeof(struct pad_conf_entry));
+}
board/ti/panda/panda.h new file +265 -0

265 lines not on this page · raw message

board/ti/sdp4430/sdp.c +26 -0
index 8ed7873..7039bd5 100644
@@ -25,6 +25,8 @@
 #include <common.h>
 #include <asm/arch/sys_proto.h>
 
+#include "sdp.h"
+
 DECLARE_GLOBAL_DATA_PTR;
 
 const struct omap_sysinfo sysinfo = {
@@ -62,3 +64,27 @@ int misc_init_r(void)
 {
 	return 0;
 }
+
+void do_set_mux(u32 base, struct pad_conf_entry const *array, int size)
+{
+	int i;
+	struct pad_conf_entry *pad = (struct pad_conf_entry *) array;
+
+	for (i = 0; i < size; i++, pad++)
+		writew(pad->val, base + pad->offset);
+}
+
+/**
+ * @brief set_muxconf_regs Setting up the configuration Mux registers
+ * specific to the board.
+ */
+void set_muxconf_regs(void)
+{
+	do_set_mux(CONTROL_PADCONF_CORE, core_padconf_array,
+		   sizeof(core_padconf_array) /
+		   sizeof(struct pad_conf_entry));
+
+	do_set_mux(CONTROL_PADCONF_WKUP, wkup_padconf_array,
+		   sizeof(wkup_padconf_array) /
+		   sizeof(struct pad_conf_entry));
+}
board/ti/sdp4430/sdp.h new file +265 -0

265 lines not on this page · raw message

include/configs/omap4_panda.h +1 -0
index b1e40a3..0c5ef7b 100644
@@ -35,6 +35,7 @@
 #define CONFIG_OMAP44XX		1	/* which is a 44XX */
 #define CONFIG_OMAP4430		1	/* which is in a 4430 */
 #define CONFIG_PANDA		1	/* working with Panda */
+#define CONFIG_ARCH_CPU_INIT
 
 /* Get CPU defs */
 #include <asm/arch/cpu.h>
include/configs/omap4_sdp4430.h +1 -0
index 8121554..ede7691 100644
@@ -36,6 +36,7 @@
 #define CONFIG_OMAP44XX		1	/* which is a 44XX */
 #define CONFIG_OMAP4430		1	/* which is in a 4430 */
 #define CONFIG_4430SDP		1	/* working with SDP */
+#define CONFIG_ARCH_CPU_INIT
 
 /* Get CPU defs */
 #include <asm/arch/cpu.h>
Signature · 1 line
1.7.0.4
#2 lore raw

PATCH v2 2/8 ARMV7: Fix udelay for OMAP4

In reply to Steve Sakoman

The OMAP4 x-load code sets gptimer1 clock source to 32Khz. This isn't acceptable for udelay. This patch changes from gptimer1 to gptimer2, which uses sys_clk at 38.4 Mhz.

---
 arch/arm/cpu/armv7/omap-common/timer.c |    9 ---------
 include/configs/omap4_panda.h          |    2 +-
 include/configs/omap4_sdp4430.h        |    2 +-
 3 files changed, 2 insertions(+), 11 deletions(-)
arch/arm/cpu/armv7/omap-common/timer.c +0 -9
index 69e285f..6b8cf7b 100644
@@ -41,12 +41,8 @@ static struct gptimer *timer_base = (struct gptimer *)CONFIG_SYS_TIMERBASE;
 
 /*
  * Nothing really to do with interrupts, just starts up a counter.
- * We run the counter with 13MHz, divided by 8, resulting in timer
- * frequency of 1.625MHz. With 32bit counter register, counter
- * overflows in ~44min
  */
 
-/* 13MHz / 8 = 1.625MHz */
 #define TIMER_CLOCK	(V_SCLK / (2 << CONFIG_SYS_PTV))
 #define TIMER_LOAD_VAL	0xffffffff
 
@@ -84,11 +80,6 @@ void set_timer(ulong t)
 /* delay x useconds */
 void __udelay(unsigned long usec)
 {
-#if defined(CONFIG_OMAP44XX)
-	/* TODO temporary hack until OMAP4 clock setup routines are present */
-	if (usec > 1000)
-		usec = usec/1000;
-#endif
 	long tmo = usec * (TIMER_CLOCK / 1000) / 1000;
 	unsigned long now, last = readl(&timer_base->tcrr);
 
include/configs/omap4_panda.h +1 -1
index 0c5ef7b..0fb1ad3 100644
@@ -196,7 +196,7 @@
 #define CONFIG_SYS_LOAD_ADDR		0x80000000
 
 /* Use General purpose timer 1 */
-#define CONFIG_SYS_TIMERBASE		GPT1_BASE
+#define CONFIG_SYS_TIMERBASE		GPT2_BASE
 #define CONFIG_SYS_PTV			2	/* Divisor: 2^(PTV+1) => 8 */
 #define CONFIG_SYS_HZ			1000
 
include/configs/omap4_sdp4430.h +1 -1
index ede7691..ef5272b 100644
@@ -197,7 +197,7 @@
 #define CONFIG_SYS_LOAD_ADDR		0x80000000
 
 /* Use General purpose timer 1 */
-#define CONFIG_SYS_TIMERBASE		GPT1_BASE
+#define CONFIG_SYS_TIMERBASE		GPT2_BASE
 #define CONFIG_SYS_PTV			2	/* Divisor: 2^(PTV+1) => 8 */
 #define CONFIG_SYS_HZ			1000
 
Signature · 1 line
1.7.0.4
#3 lore raw

PATCH v2 3/8 ARMV7: Modify i2c driver for more reliable operation on OMAP4

In reply to Steve Sakoman

This patch modifies the init routine to follow the TRM recommendations. It also modifies the i2c_read_byte function to reflect subtle differences between the i2c controller in OMAP3 and OMAP4.

---
 arch/arm/include/asm/arch-omap3/i2c.h |    4 +++-
 drivers/i2c/omap24xx_i2c.c            |   31 +++++++++++++++++++++----------
 drivers/i2c/omap24xx_i2c.h            |    4 ++++
 3 files changed, 28 insertions(+), 11 deletions(-)
arch/arm/include/asm/arch-omap3/i2c.h +3 -1
index 7a4a73a..d2e7488 100644
@@ -34,7 +34,9 @@ struct i2c {
 	unsigned short stat;	/* 0x08 */
 	unsigned short res3;
 	unsigned short iv;	/* 0x0C */
-	unsigned short res4[3];
+	unsigned short res4;
+	unsigned short syss;	/* 0x10 */
+	unsigned short res4a;
 	unsigned short buf;	/* 0x14 */
 	unsigned short res5;
 	unsigned short cnt;	/* 0x18 */
drivers/i2c/omap24xx_i2c.c +21 -10
index 3256133..7c98f15 100644
@@ -27,6 +27,8 @@
 
 #include "omap24xx_i2c.h"
 
+#define I2C_TIMEOUT	10
+
 static void wait_for_bb (void);
 static u16 wait_for_pin (void);
 static void flush_fifo(void);
@@ -41,6 +43,7 @@ void i2c_init (int speed, int slaveadd)
 	int psc, fsscll, fssclh;
 	int hsscll = 0, hssclh = 0;
 	u32 scll, sclh;
+	int timeout = I2C_TIMEOUT;
 
 	/* Only handle standard, fast and high speeds */
 	if ((speed != OMAP_I2C_STANDARD) &&
@@ -102,15 +105,24 @@ void i2c_init (int speed, int slaveadd)
 		sclh = (unsigned int)fssclh;
 	}
 
-	writew(0x2, &i2c_base->sysc); /* for ES2 after soft reset */
-	udelay(1000);
-	writew(0x0, &i2c_base->sysc); /* will probably self clear but */
-
 	if (readw (&i2c_base->con) & I2C_CON_EN) {
 		writew (0, &i2c_base->con);
 		udelay (50000);
 	}
 
+	writew(0x2, &i2c_base->sysc); /* for ES2 after soft reset */
+	udelay(1000);
+
+	writew(I2C_CON_EN, &i2c_base->con);
+	while (!(readw(&i2c_base->syss) & I2C_SYSS_RDONE) && timeout--) {
+		if (timeout <= 0) {
+			printf("ERROR: Timeout in soft-reset\n");
+			return;
+		}
+		udelay(1000);
+	}
+
+	writew(0, &i2c_base->con);
 	writew(psc, &i2c_base->psc);
 	writew(scll, &i2c_base->scll);
 	writew(sclh, &i2c_base->sclh);
@@ -159,15 +171,14 @@ static int i2c_read_byte (u8 devaddr, u8 regoffset, u8 * value)
 	}
 
 	if (!i2c_error) {
-		/* free bus, otherwise we can't use a combined transction */
-		writew (0, &i2c_base->con);
-		while (readw (&i2c_base->stat) || (readw (&i2c_base->con) & I2C_CON_MST)) {
+		writew (I2C_CON_EN, &i2c_base->con);
+		while (readw(&i2c_base->stat) &
+			(I2C_STAT_XRDY | I2C_STAT_ARDY)) {
 			udelay (10000);
 			/* Have to clear pending interrupt to clear I2C_STAT */
 			writew (0xFFFF, &i2c_base->stat);
 		}
 
-		wait_for_bb ();
 		/* set slave address */
 		writew (devaddr, &i2c_base->sa);
 		/* read one byte from slave */
@@ -191,8 +202,8 @@ static int i2c_read_byte (u8 devaddr, u8 regoffset, u8 * value)
 
 		if (!i2c_error) {
 			writew (I2C_CON_EN, &i2c_base->con);
-			while (readw (&i2c_base->stat)
-			       || (readw (&i2c_base->con) & I2C_CON_MST)) {
+			while (readw (&i2c_base->stat) &
+				(I2C_STAT_RRDY | I2C_STAT_ARDY)) {
 				udelay (10000);
 				writew (0xFFFF, &i2c_base->stat);
 			}
drivers/i2c/omap24xx_i2c.h +4 -0
index 92a3416..650e33a 100644
@@ -85,6 +85,10 @@
 #define I2C_SYSTEST_SDA_I	(1 << 1)  /* SDA line sense input value */
 #define I2C_SYSTEST_SDA_O	(1 << 0)  /* SDA line drive output value */
 
+/* I2C System Status Register (I2C_SYSS): */
+
+#define I2C_SYSS_RDONE          (1 << 0)  /* Internel reset monitoring */
+
 #define I2C_SCLL_SCLL		0
 #define I2C_SCLL_SCLL_M		0xFF
 #define I2C_SCLL_HSSCLL		8
Signature · 1 line
1.7.0.4
#4 lore raw

PATCH v2 3/8 ARMV7: Modify i2c driver for more reliable operation on OMAP4

Hello Steve,

Quoted 5 lines · Steve Sakoman

This patch modifies the init routine to follow the TRM recommendations. It also modifies the i2c_read_byte function to reflect subtle differences between the i2c controller in OMAP3 and OMAP4.

Quoted 7 lines
---
 arch/arm/include/asm/arch-omap3/i2c.h |    4 +++-
 drivers/i2c/omap24xx_i2c.c            |   31 +++++++++++++++++++++----------
 drivers/i2c/omap24xx_i2c.h            |    4 ++++
 3 files changed, 28 insertions(+), 11 deletions(-)

bye,
Heiko

Signature · 2 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
#5 lore raw

PATCH v2 4/8 ARMV7: Add support for the TWL6030 I2C power chip used in OMAP4 systems

In reply to Steve Sakoman

This patch add the basic infrastructure for the TWL6030 driver and enables support in the two existing OMAP4 boards, Panda and OMAP4430 SDP

---
 drivers/power/Makefile          |    1 +
 drivers/power/twl6030.c         |   77 +++++++++++++++++++++++++++++++++
 include/configs/omap4_panda.h   |    3 +
 include/configs/omap4_sdp4430.h |    3 +
 include/twl6030.h               |   90 +++++++++++++++++++++++++++++++++++++++
 5 files changed, 174 insertions(+), 0 deletions(-)
 create mode 100644 drivers/power/twl6030.c
 create mode 100644 include/twl6030.h
drivers/power/Makefile +1 -0
index dd06514..db53173 100644
@@ -26,6 +26,7 @@ include $(TOPDIR)/config.mk
 LIB 	:= $(obj)libpower.a
 
 COBJS-$(CONFIG_TWL4030_POWER)	+= twl4030.o
+COBJS-$(CONFIG_TWL6030_POWER)	+= twl6030.o
 
 COBJS	:= $(COBJS-y)
 SRCS 	:= $(COBJS:.o=.c)
drivers/power/twl6030.c new file +77 -0

77 lines not on this page · raw message

include/configs/omap4_panda.h +3 -0
index 0fb1ad3..4bec00b 100644
@@ -103,6 +103,9 @@
 #define CONFIG_DRIVER_OMAP34XX_I2C	1
 #define CONFIG_I2C_MULTI_BUS		1
 
+/* TWL6030 */
+#define CONFIG_TWL6030_POWER		1
+
 /* MMC */
 #define CONFIG_MMC			1
 #define CONFIG_OMAP3_MMC		1
include/configs/omap4_sdp4430.h +3 -0
index ef5272b..c18e71a 100644
@@ -104,6 +104,9 @@
 #define CONFIG_DRIVER_OMAP34XX_I2C	1
 #define CONFIG_I2C_MULTI_BUS		1
 
+/* TWL6030 */
+#define CONFIG_TWL6030_POWER		1
+
 /* MMC */
 #define CONFIG_MMC			1
 #define CONFIG_OMAP3_MMC		1
include/twl6030.h new file +90 -0

90 lines not on this page · raw message

Signature · 1 line
1.7.0.4
#6 lore raw

PATCH v2 4/8 ARMV7: Add support for the TWL6030 I2C power chip used in OMAP4 systems

Dear Steve Sakoman,

Quoted 32 lines · In message <[email protected]> you wrote:

This patch add the basic infrastructure for the TWL6030 driver and enables support in the two existing OMAP4 boards, Panda and OMAP4430 SDP

---
 drivers/power/Makefile          |    1 +
 drivers/power/twl6030.c         |   77 +++++++++++++++++++++++++++++++++
 include/configs/omap4_panda.h   |    3 +
 include/configs/omap4_sdp4430.h |    3 +
 include/twl6030.h               |   90 +++++++++++++++++++++++++++++++++++++++
 5 files changed, 174 insertions(+), 0 deletions(-)
 create mode 100644 drivers/power/twl6030.c
 create mode 100644 include/twl6030.h
drivers/power/Makefile +1 -0
index dd06514..db53173 100644
@@ -26,6 +26,7 @@ include $(TOPDIR)/config.mk
 LIB 	:= $(obj)libpower.a
 
 COBJS-$(CONFIG_TWL4030_POWER)	+= twl4030.o
+COBJS-$(CONFIG_TWL6030_POWER)	+= twl6030.o
 
 COBJS	:= $(COBJS-y)
 SRCS 	:= $(COBJS:.o=.c)
drivers/power/twl6030.c new file +0 -0
new file mode 100644
index 0000000..b47992b

drivers/power/twl6030.c line 10

Quoted 10 lines
drivers/power/twl6030.c new file +10 -0
@@ -0,0 +1,77 @@
+/*
+ * (C) Copyright 2010
+ * Texas Instruments, <www.ti.com>
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * version 2 as published by the Free Software Foundation.

NAK.

We require the "or (at your option) any later version" clause.

Best regards,

Wolfgang Denk

Signature · 3 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
#7 lore raw

PATCH v3 4/8 ARMV7: Add support for the TWL6030 I2C power chip used in OMAP4 systems

This patch add the basic infrastructure for the TWL6030 driver and enables support in the two existing OMAP4 boards, Panda and OMAP4430 SDP

---

This version adds the GPL "or (at your option) any later version" clause per Wolfgang's request

 drivers/power/Makefile          |    1 +
 drivers/power/twl6030.c         |   78 +++++++++++++++++++++++++++++++++
 include/configs/omap4_panda.h   |    3 +
 include/configs/omap4_sdp4430.h |    3 +
 include/twl6030.h               |   91 +++++++++++++++++++++++++++++++++++++++
 5 files changed, 176 insertions(+), 0 deletions(-)
 create mode 100644 drivers/power/twl6030.c
 create mode 100644 include/twl6030.h
drivers/power/Makefile +1 -0
index dd06514..db53173 100644
@@ -26,6 +26,7 @@ include $(TOPDIR)/config.mk
 LIB 	:= $(obj)libpower.a
 
 COBJS-$(CONFIG_TWL4030_POWER)	+= twl4030.o
+COBJS-$(CONFIG_TWL6030_POWER)	+= twl6030.o
 
 COBJS	:= $(COBJS-y)
 SRCS 	:= $(COBJS:.o=.c)
drivers/power/twl6030.c new file +78 -0

78 lines not on this page · raw message

include/configs/omap4_panda.h +3 -0
index 0fb1ad3..4bec00b 100644
@@ -103,6 +103,9 @@
 #define CONFIG_DRIVER_OMAP34XX_I2C	1
 #define CONFIG_I2C_MULTI_BUS		1
 
+/* TWL6030 */
+#define CONFIG_TWL6030_POWER		1
+
 /* MMC */
 #define CONFIG_MMC			1
 #define CONFIG_OMAP3_MMC		1
include/configs/omap4_sdp4430.h +3 -0
index ef5272b..c18e71a 100644
@@ -104,6 +104,9 @@
 #define CONFIG_DRIVER_OMAP34XX_I2C	1
 #define CONFIG_I2C_MULTI_BUS		1
 
+/* TWL6030 */
+#define CONFIG_TWL6030_POWER		1
+
 /* MMC */
 #define CONFIG_MMC			1
 #define CONFIG_OMAP3_MMC		1
include/twl6030.h new file +91 -0

91 lines not on this page · raw message

Signature · 1 line
1.7.0.4
#8 lore raw

PATCH v2 5/8 ARMV7: Restructure omap3 musb driver to allow code sharing between OMAP3 and OMAP4

In reply to Steve Sakoman
---
 arch/arm/include/asm/arch-omap3/cpu.h |    3 +++
 arch/arm/include/asm/arch-omap4/cpu.h |    3 +++
 drivers/usb/musb/omap3.c              |   16 ++++++++++++++++
 drivers/usb/musb/omap3.h              |    3 ++-
 4 files changed, 24 insertions(+), 1 deletions(-)
arch/arm/include/asm/arch-omap3/cpu.h +3 -0
index c072c27..390b007 100644
@@ -483,4 +483,7 @@ struct pm {
 #define I2C_BASE2		(OMAP34XX_CORE_L4_IO_BASE + 0x72000)
 #define I2C_BASE3		(OMAP34XX_CORE_L4_IO_BASE + 0x60000)
 
+/* MUSB base */
+#define MUSB_BASE		(OMAP34XX_CORE_L4_IO_BASE + 0xAB000)
+
 #endif /* _CPU_H */
arch/arm/include/asm/arch-omap4/cpu.h +3 -0
index c056b95..7d5748a 100644
@@ -139,4 +139,7 @@ struct watchdog {
 #define I2C_BASE2		(OMAP44XX_L4_PER_BASE + 0x72000)
 #define I2C_BASE3		(OMAP44XX_L4_PER_BASE + 0x60000)
 
+/* MUSB base */
+#define MUSB_BASE		(OMAP44XX_L4_CORE_BASE + 0xAB000)
+
 #endif /* _CPU_H */
drivers/usb/musb/omap3.c +16 -0
index a983552..c7876ed 100644
@@ -31,6 +31,7 @@
  */
 
 #include <twl4030.h>
+#include <twl6030.h>
 #include "omap3.h"
 
 static int platform_needs_initialization = 1;
@@ -65,7 +66,12 @@ static struct omap3_otg_regs *otg;
 
 #define OMAP3_OTG_SYSSTATUS_RESETDONE			0x0001
 
+/* OMAP4430 has an internal PHY, use it */
+#ifdef CONFIG_OMAP4430
+#define OMAP3_OTG_INTERFSEL_OMAP			0x0000
+#else
 #define OMAP3_OTG_INTERFSEL_OMAP			0x0001
+#endif
 
 #define OMAP3_OTG_FORCESTDBY_STANDBY			0x0001
 
@@ -105,6 +111,11 @@ int musb_platform_init(void)
 			goto end;
 		}
 #endif
+
+#ifdef CONFIG_TWL6030_POWER
+		twl6030_usb_device_settings();
+#endif
+
 		otg = (struct omap3_otg_regs *)OMAP3_OTG_BASE;
 
 		/* Set OTG to always be on */
@@ -122,6 +133,11 @@ int musb_platform_init(void)
 #ifdef CONFIG_OMAP3_EVM
 		musb_cfg.extvbus = omap3_evm_need_extvbus();
 #endif
+
+#ifdef CONFIG_OMAP4430
+		u32 *usbotghs_control = (u32 *)(CTRL_BASE + 0x33C);
+		*usbotghs_control = 0x15;
+#endif
 		platform_needs_initialization = 0;
 	}
 
drivers/usb/musb/omap3.h +2 -1
index c934e0c..ea00fed 100644
@@ -31,10 +31,11 @@
 #ifndef _MUSB_OMAP3_H_
 #define _MUSB_OMAP3_H_
 
+#include <asm/arch/cpu.h>
 #include "musb_core.h"
 
 /* Base address of MUSB registers */
-#define MENTOR_USB0_BASE (OMAP34XX_CORE_L4_IO_BASE + 0xAB000)
+#define MENTOR_USB0_BASE MUSB_BASE
 
 /* Base address of OTG registers */
 #define OMAP3_OTG_BASE (MENTOR_USB0_BASE + 0x400)
Signature · 1 line
1.7.0.4
#9 lore raw

PATCH v2 6/8 ARMV7: Enable musb driver and usbtty on OMAP4430 SDP

In reply to Steve Sakoman
---
 include/configs/omap4_sdp4430.h |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)
include/configs/omap4_sdp4430.h +15 -0
index c18e71a..e9909f9 100644
@@ -113,6 +113,20 @@
 #define CONFIG_SYS_MMC_SET_DEV		1
 #define CONFIG_DOS_PARTITION		1
 
+/* USB */
+#define CONFIG_MUSB_UDC			1
+#define CONFIG_USB_OMAP3		1
+
+/* 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	"SDP4430"
+
 /* Flash */
 #define CONFIG_SYS_NO_FLASH	1
 
@@ -146,6 +160,7 @@
 #define CONFIG_EXTRA_ENV_SETTINGS \
 	"loadaddr=0x82000000\0" \
 	"console=ttyS2,115200n8\0" \
+	"usbtty=cdc_acm\0" \
 	"mmcdev=1\0" \
 	"mmcroot=/dev/mmcblk0p2 rw\0" \
 	"mmcrootfstype=ext3 rootwait\0" \
Signature · 1 line
1.7.0.4
#10 lore raw

PATCH v2 7/8 ARMV7: Enable musb driver and usbtty on OMAP4 Panda

In reply to Steve Sakoman
---
 include/configs/omap4_panda.h |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)
include/configs/omap4_panda.h +15 -0
index 4bec00b..1d76467 100644
@@ -112,6 +112,20 @@
 #define CONFIG_SYS_MMC_SET_DEV		1
 #define CONFIG_DOS_PARTITION		1
 
+/* USB */
+#define CONFIG_MUSB_UDC			1
+#define CONFIG_USB_OMAP3		1
+
+/* 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	"OMAP4 Panda"
+
 /* Flash */
 #define CONFIG_SYS_NO_FLASH	1
 
@@ -145,6 +159,7 @@
 #define CONFIG_EXTRA_ENV_SETTINGS \
 	"loadaddr=0x82000000\0" \
 	"console=ttyS2,115200n8\0" \
+	"usbtty=cdc_acm\0" \
 	"mmcdev=1\0" \
 	"mmcroot=/dev/mmcblk0p2 rw\0" \
 	"mmcrootfstype=ext3 rootwait\0" \
Signature · 1 line
1.7.0.4
#11 lore raw

PATCH v2 8/8 ARMV7: Update default environment for OMAP4 boards

In reply to Steve Sakoman

Specify vram on command line, remove erroneous call to nandboot in the boot script, add CONFIG_BOOTDELAY

---
 include/configs/omap4_panda.h   |    5 ++++-
 include/configs/omap4_sdp4430.h |    5 ++++-
 2 files changed, 8 insertions(+), 2 deletions(-)
include/configs/omap4_panda.h +4 -1
index 1d76467..a0d27a4 100644
@@ -153,6 +153,8 @@
  * Environment setup
  */
 
+#define CONFIG_BOOTDELAY	3
+
 /* allow overwriting serial config and ethaddr */
 #define CONFIG_ENV_OVERWRITE
 
@@ -160,10 +162,12 @@
 	"loadaddr=0x82000000\0" \
 	"console=ttyS2,115200n8\0" \
 	"usbtty=cdc_acm\0" \
+	"vram=16M\0" \
 	"mmcdev=1\0" \
 	"mmcroot=/dev/mmcblk0p2 rw\0" \
 	"mmcrootfstype=ext3 rootwait\0" \
 	"mmcargs=setenv bootargs console=${console} " \
+		"vram=${vram} " \
 		"root=${mmcroot} " \
 		"rootfstype=${mmcrootfstype}\0" \
 	"loadbootscript=fatload mmc ${mmcdev} ${loadaddr} boot.scr\0" \
@@ -181,7 +185,6 @@
 		"else " \
 			"if run loaduimage; then " \
 				"run mmcboot; " \
-			"else run nandboot; " \
 			"fi; " \
 		"fi; " \
 	"fi"
include/configs/omap4_sdp4430.h +4 -1
index e9909f9..d5439f9 100644
@@ -154,6 +154,8 @@
  * Environment setup
  */
 
+#define CONFIG_BOOTDELAY	3
+
 /* allow overwriting serial config and ethaddr */
 #define CONFIG_ENV_OVERWRITE
 
@@ -161,10 +163,12 @@
 	"loadaddr=0x82000000\0" \
 	"console=ttyS2,115200n8\0" \
 	"usbtty=cdc_acm\0" \
+	"vram=16M\0" \
 	"mmcdev=1\0" \
 	"mmcroot=/dev/mmcblk0p2 rw\0" \
 	"mmcrootfstype=ext3 rootwait\0" \
 	"mmcargs=setenv bootargs console=${console} " \
+		"vram=${vram} " \
 		"root=${mmcroot} " \
 		"rootfstype=${mmcrootfstype}\0" \
 	"loadbootscript=fatload mmc ${mmcdev} ${loadaddr} boot.scr\0" \
@@ -182,7 +186,6 @@
 		"else " \
 			"if run loaduimage; then " \
 				"run mmcboot; " \
-			"else run nandboot; " \
 			"fi; " \
 		"fi; " \
 	"fi"
Signature · 1 line
1.7.0.4
#12 lore raw

v2 cover ARMV7: Enhance support for OMAP4

In reply to Steve Sakoman
Quoted 6 lines · Steve Sakoman

This is version 2 of the patch set. It incorporates all feedback to date.

This patch series adds support for:
- pad mux initialization
- OMAP4 TWL6030 companion chip initialization
- usb driver and gadget support

These patches are also available in my omap4-next-upstream branch:

http://www.sakoman.com/cgi-bin/gitweb.cgi?p=u-boot.git;a=shortlog;h=refs/heads/omap4-next-upstream

Regards,

Steve

Quoted 46 lines

It also fixes issues in the udelay implementation and the OMAP I2C driver as well as tweaks the default environment.

These patches were tested on Panda and OMAP4430 SDP as well as on the Gumstix Overo to verify that there were no regressions on OMAP3.

Steve Sakoman (8):
ARMV7: Add pad mux support for OMAP4
ARMV7: Fix udelay for OMAP4
ARMV7: Modify i2c driver for more reliable operation on OMAP4
ARMV7: Add support for the TWL6030 I2C power chip used in OMAP4
systems
ARMV7: Restructure omap3 musb driver to allow code sharing between
OMAP3 and OMAP4
ARMV7: Enable musb driver and usbtty on OMAP4430 SDP
ARMV7: Enable musb driver and usbtty on OMAP4 Panda
ARMV7: Update default environment for OMAP4 boards

 arch/arm/cpu/armv7/omap-common/timer.c      |    9 -
 arch/arm/cpu/armv7/omap4/board.c            |   11 +
 arch/arm/include/asm/arch-omap3/cpu.h       |    3 +
 arch/arm/include/asm/arch-omap3/i2c.h       |    4 +-
 arch/arm/include/asm/arch-omap4/cpu.h       |    3 +
 arch/arm/include/asm/arch-omap4/mux_omap4.h |  344 +++++++++++++++++++++++++++
 arch/arm/include/asm/arch-omap4/omap4.h     |    2 +
 arch/arm/include/asm/arch-omap4/sys_proto.h |    1 +
 board/ti/panda/panda.c                      |   26 ++
 board/ti/panda/panda.h                      |  265 +++++++++++++++++++++
 board/ti/sdp4430/sdp.c                      |   26 ++
 board/ti/sdp4430/sdp.h                      |  265 +++++++++++++++++++++
 drivers/i2c/omap24xx_i2c.c                  |   31 ++-
 drivers/i2c/omap24xx_i2c.h                  |    4 +
 drivers/power/Makefile                      |    1 +
 drivers/power/twl6030.c                     |   77 ++++++
 drivers/usb/musb/omap3.c                    |   16 ++
 drivers/usb/musb/omap3.h                    |    3 +-
 include/configs/omap4_panda.h               |   28 ++-
 include/configs/omap4_sdp4430.h             |   28 ++-
 include/twl6030.h                           |   90 +++++++
 21 files changed, 1210 insertions(+), 27 deletions(-)
 create mode 100644 arch/arm/include/asm/arch-omap4/mux_omap4.h
 create mode 100644 board/ti/panda/panda.h
 create mode 100644 board/ti/sdp4430/sdp.h
 create mode 100644 drivers/power/twl6030.c
 create mode 100644 include/twl6030.h