Skip to contentSkip to conversation

omap: miscellaneous fixes and improvements

PATCH New Aneesh V 3 participants 16 messages Nov 22, 2011 – Nov 29, 2011 Arm (32-bit)

lore
Share & tools
lore

Aneesh V

author
#0 lore raw

cover omap: miscellaneous fixes and improvements

Aneesh V (9):
omap: Improve PLL parameter calculation tool
omap4: ttyO2 instead of ttyS2 in default bootargs
omap: fix cache line size for omap3/omap4 boards
omap4460: fix TPS initialization
omap: remove I2C from SPL
omap4: emif: fix error in driver
omap4460: add ES1.1 identification
omap4+: streamline CONFIG_SYS_TEXT_BASE and other SDRAM addresses
omap4: fix IO setting

 arch/arm/cpu/armv7/omap-common/clocks-common.c |    8 -
 arch/arm/cpu/armv7/omap-common/emif-common.c   |    4 +-
 arch/arm/cpu/armv7/omap-common/spl.c           |    1 -
 arch/arm/cpu/armv7/omap4/hwinit.c              |   17 ++-
 arch/arm/include/asm/arch-omap4/omap.h         |    2 +
 arch/arm/include/asm/omap_common.h             |    1 +
 board/ti/panda/panda_mux_data.h                |    2 +-
 board/ti/sdp4430/sdp.c                         |    7 +
 board/ti/sdp4430/sdp4430_mux_data.h            |    6 +-
 include/configs/omap3_beagle.h                 |    2 +
 include/configs/omap3_evm.h                    |    1 +
 include/configs/omap3_evm_common.h             |    2 +
 include/configs/omap3_mvblx.h                  |    2 +
 include/configs/omap3_overo.h                  |    2 +
 include/configs/omap3_pandora.h                |    2 +
 include/configs/omap3_sdp3430.h                |    2 +
 include/configs/omap3_zoom1.h                  |    2 +
 include/configs/omap3_zoom2.h                  |    2 +
 include/configs/omap4_common.h                 |   20 ++-
 include/configs/omap5_evm.h                    |   19 ++-
 tools/omap/clocks_get_m_n.c                    |  187 ++++++++++++------------
 21 files changed, 169 insertions(+), 122 deletions(-)
author
#1 lore raw

PATCH 1/9 omap: Improve PLL parameter calculation tool

Improve the tool that finds multiplier and divider for PLLs:
The previous algorithm could get stuck on local maxima and required the user to specify the tolerance. Improve the algorithm to go through the entire search space and find the optimal solution.

---
 tools/omap/clocks_get_m_n.c |  187 ++++++++++++++++++++++---------------------
 1 files changed, 96 insertions(+), 91 deletions(-)
tools/omap/clocks_get_m_n.c +96 -91
index cfc1760..c27577b 100644
@@ -63,45 +63,41 @@ typedef unsigned int u32;
  *	$ gcc clocks_get_m_n.c
  *	$ ./a.out
  */
-int get_m_n_optimized(u32 target_freq_khz, u32 ref_freq_khz, u32 *m, u32 *n,
-			u32 tolerance_khz)
+int get_m_n_optimized(u32 target_freq_khz, u32 ref_freq_khz, u32 *M, u32 *N)
 {
-	u32 min_freq = target_freq_khz - tolerance_khz;
-	u32 max_freq = target_freq_khz;
-	u32 freq, freq_old;
-	*n = 1;
+	u32 freq = target_freq_khz;
+	u32 m_optimal, n_optimal, freq_optimal = 0, freq_old;
+	u32 m, n;
+	n = 1;
 	while (1) {
-		*m = min_freq / ref_freq_khz / 2 * (*n) ;
+		m = target_freq_khz / ref_freq_khz / 2 * n;
 		freq_old = 0;
 		while (1) {
-			freq = ref_freq_khz * 2 * (*m) / (*n);
-			if (abs(target_freq_khz - freq_old) <=
-				abs(target_freq_khz - freq)) {
+			freq = ref_freq_khz * 2 * m / n;
+			if (freq > target_freq_khz) {
 				freq = freq_old;
-				(*m)--;
+				m--;
 				break;
 			}
-			(*m)++;
+			m++;
 			freq_old = freq;
 		}
-		if (freq >= min_freq && freq <= max_freq)
+		if (freq > freq_optimal) {
+			freq_optimal = freq;
+			m_optimal = m;
+			n_optimal = n;
+		}
+		n++;
+		if ((freq_optimal == target_freq_khz) ||
+			((ref_freq_khz / n) < 1000)) {
 			break;
-		(*n)++;
-		if ((*n) > MAX_N + 1) {
-			printf("ref %d m %d n %d target %d : ",
-				ref_freq_khz, *m, *n, target_freq_khz);
-			printf("can not find m & n - please consider"
-				" increasing tolerance\n");
-			return -1;
 		}
 	}
-	(*n)--;
-	printf("ref %d m %d n %d target %d locked %d\n",
-		ref_freq_khz, *m, *n, target_freq_khz, freq);
-	if ((ref_freq_khz / (*n + 1)) < 1000) {
-		printf("\tREFCLK - CLKINP/(N+1) is less than 1 MHz - less than"
-			" ideal, locking time will be high!\n");
-	}
+	n--;
+	*M = m_optimal;
+	*N = n_optimal - 1;
+	printf("ref %d m %d n %d target %d locked %d\n", ref_freq_khz,
+		m_optimal, n_optimal - 1, target_freq_khz, freq_optimal);
 	return 0;
 }
 
@@ -109,89 +105,98 @@ void main(void)
 {
 	u32 m, n;
 	printf("\nMPU - 2000000\n");
-	get_m_n_optimized(2000000, 12000, &m, &n, 0);
-	get_m_n_optimized(2000000, 13000, &m, &n, 0);
-	get_m_n_optimized(2000000, 16800, &m, &n, 800);
-	get_m_n_optimized(2000000, 19200, &m, &n, 0);
-	get_m_n_optimized(2000000, 26000, &m, &n, 0);
-	get_m_n_optimized(2000000, 27000, &m, &n, 0);
-	get_m_n_optimized(2000000, 38400, &m, &n, 0);
+	get_m_n_optimized(2000000, 12000, &m, &n);
+	get_m_n_optimized(2000000, 13000, &m, &n);
+	get_m_n_optimized(2000000, 16800, &m, &n);
+	get_m_n_optimized(2000000, 19200, &m, &n);
+	get_m_n_optimized(2000000, 26000, &m, &n);
+	get_m_n_optimized(2000000, 27000, &m, &n);
+	get_m_n_optimized(2000000, 38400, &m, &n);
 
 	printf("\nMPU - 1200000\n");
-	get_m_n_optimized(1200000, 12000, &m, &n, 0);
-	get_m_n_optimized(1200000, 13000, &m, &n, 0);
-	get_m_n_optimized(1200000, 16800, &m, &n, 800);
-	get_m_n_optimized(1200000, 19200, &m, &n, 0);
-	get_m_n_optimized(1200000, 26000, &m, &n, 0);
-	get_m_n_optimized(1200000, 27000, &m, &n, 0);
-	get_m_n_optimized(1200000, 38400, &m, &n, 0);
+	get_m_n_optimized(1200000, 12000, &m, &n);
+	get_m_n_optimized(1200000, 13000, &m, &n);
+	get_m_n_optimized(1200000, 16800, &m, &n);
+	get_m_n_optimized(1200000, 19200, &m, &n);
+	get_m_n_optimized(1200000, 26000, &m, &n);
+	get_m_n_optimized(1200000, 27000, &m, &n);
+	get_m_n_optimized(1200000, 38400, &m, &n);
 
 	printf("\nMPU - 1584000\n");
-	get_m_n_optimized(1584000, 12000, &m, &n, 0);
-	get_m_n_optimized(1584000, 13000, &m, &n, 0);
-	get_m_n_optimized(1584000, 16800, &m, &n, 400);
-	get_m_n_optimized(1584000, 19200, &m, &n, 0);
-	get_m_n_optimized(1584000, 26000, &m, &n, 0);
-	get_m_n_optimized(1584000, 27000, &m, &n, 0);
-	get_m_n_optimized(1584000, 38400, &m, &n, 0);
+	get_m_n_optimized(1584000, 12000, &m, &n);
+	get_m_n_optimized(1584000, 13000, &m, &n);
+	get_m_n_optimized(1584000, 16800, &m, &n);
+	get_m_n_optimized(1584000, 19200, &m, &n);
+	get_m_n_optimized(1584000, 26000, &m, &n);
+	get_m_n_optimized(1584000, 27000, &m, &n);
+	get_m_n_optimized(1584000, 38400, &m, &n);
 
 	printf("\nCore 1600000\n");
-	get_m_n_optimized(1600000, 12000, &m, &n, 0);
-	get_m_n_optimized(1600000, 13000, &m, &n, 0);
-	get_m_n_optimized(1600000, 16800, &m, &n, 200);
-	get_m_n_optimized(1600000, 19200, &m, &n, 0);
-	get_m_n_optimized(1600000, 26000, &m, &n, 0);
-	get_m_n_optimized(1600000, 27000, &m, &n, 0);
-	get_m_n_optimized(1600000, 38400, &m, &n, 0);
+	get_m_n_optimized(1600000, 12000, &m, &n);
+	get_m_n_optimized(1600000, 13000, &m, &n);
+	get_m_n_optimized(1600000, 16800, &m, &n);
+	get_m_n_optimized(1600000, 19200, &m, &n);
+	get_m_n_optimized(1600000, 26000, &m, &n);
+	get_m_n_optimized(1600000, 27000, &m, &n);
+	get_m_n_optimized(1600000, 38400, &m, &n);
 
 	printf("\nPER 1536000\n");
-	get_m_n_optimized(1536000, 12000, &m, &n, 0);
-	get_m_n_optimized(1536000, 13000, &m, &n, 0);
-	get_m_n_optimized(1536000, 16800, &m, &n, 0);
-	get_m_n_optimized(1536000, 19200, &m, &n, 0);
-	get_m_n_optimized(1536000, 26000, &m, &n, 0);
-	get_m_n_optimized(1536000, 27000, &m, &n, 0);
-	get_m_n_optimized(1536000, 38400, &m, &n, 0);
+	get_m_n_optimized(1536000, 12000, &m, &n);
+	get_m_n_optimized(1536000, 13000, &m, &n);
+	get_m_n_optimized(1536000, 16800, &m, &n);
+	get_m_n_optimized(1536000, 19200, &m, &n);
+	get_m_n_optimized(1536000, 26000, &m, &n);
+	get_m_n_optimized(1536000, 27000, &m, &n);
+	get_m_n_optimized(1536000, 38400, &m, &n);
 
 	printf("\nIVA 1862000\n");
-	get_m_n_optimized(1862000, 12000, &m, &n, 0);
-	get_m_n_optimized(1862000, 13000, &m, &n, 0);
-	get_m_n_optimized(1862000, 16800, &m, &n, 0);
-	get_m_n_optimized(1862000, 19200, &m, &n, 900);
-	get_m_n_optimized(1862000, 26000, &m, &n, 0);
-	get_m_n_optimized(1862000, 27000, &m, &n, 0);
-	get_m_n_optimized(1862000, 38400, &m, &n, 800);
+	get_m_n_optimized(1862000, 12000, &m, &n);
+	get_m_n_optimized(1862000, 13000, &m, &n);
+	get_m_n_optimized(1862000, 16800, &m, &n);
+	get_m_n_optimized(1862000, 19200, &m, &n);
+	get_m_n_optimized(1862000, 26000, &m, &n);
+	get_m_n_optimized(1862000, 27000, &m, &n);
+	get_m_n_optimized(1862000, 38400, &m, &n);
+
+	printf("\nIVA Nitro - 1290000\n");
+	get_m_n_optimized(1290000, 12000, &m, &n);
+	get_m_n_optimized(1290000, 13000, &m, &n);
+	get_m_n_optimized(1290000, 16800, &m, &n);
+	get_m_n_optimized(1290000, 19200, &m, &n);
+	get_m_n_optimized(1290000, 26000, &m, &n);
+	get_m_n_optimized(1290000, 27000, &m, &n);
+	get_m_n_optimized(1290000, 38400, &m, &n);
 
 	printf("\nABE 196608 sys clk\n");
-	get_m_n_optimized(196608, 12000, &m, &n, 700);
-	get_m_n_optimized(196608, 13000, &m, &n, 200);
-	get_m_n_optimized(196608, 16800, &m, &n, 700);
-	get_m_n_optimized(196608, 19200, &m, &n, 400);
-	get_m_n_optimized(196608, 26000, &m, &n, 200);
-	get_m_n_optimized(196608, 27000, &m, &n, 900);
-	get_m_n_optimized(196608, 38400, &m, &n, 0);
+	get_m_n_optimized(196608, 12000, &m, &n);
+	get_m_n_optimized(196608, 13000, &m, &n);
+	get_m_n_optimized(196608, 16800, &m, &n);
+	get_m_n_optimized(196608, 19200, &m, &n);
+	get_m_n_optimized(196608, 26000, &m, &n);
+	get_m_n_optimized(196608, 27000, &m, &n);
+	get_m_n_optimized(196608, 38400, &m, &n);
 
 	printf("\nABE 196608 32K\n");
-	get_m_n_optimized(196608000/4, 32768, &m, &n, 0);
+	get_m_n_optimized(196608000/4, 32768, &m, &n);
 
 	printf("\nUSB 1920000\n");
-	get_m_n_optimized(1920000, 12000, &m, &n, 0);
-	get_m_n_optimized(1920000, 13000, &m, &n, 0);
-	get_m_n_optimized(1920000, 16800, &m, &n, 0);
-	get_m_n_optimized(1920000, 19200, &m, &n, 0);
-	get_m_n_optimized(1920000, 26000, &m, &n, 0);
-	get_m_n_optimized(1920000, 27000, &m, &n, 0);
-	get_m_n_optimized(1920000, 38400, &m, &n, 0);
+	get_m_n_optimized(1920000, 12000, &m, &n);
+	get_m_n_optimized(1920000, 13000, &m, &n);
+	get_m_n_optimized(1920000, 16800, &m, &n);
+	get_m_n_optimized(1920000, 19200, &m, &n);
+	get_m_n_optimized(1920000, 26000, &m, &n);
+	get_m_n_optimized(1920000, 27000, &m, &n);
+	get_m_n_optimized(1920000, 38400, &m, &n);
 
 	printf("\nCore ES1 1523712\n");
-	get_m_n_optimized(1524000, 12000, &m, &n, 100);
-	get_m_n_optimized(1524000, 13000, &m, &n, 0);
-	get_m_n_optimized(1524000, 16800, &m, &n, 0);
-	get_m_n_optimized(1524000, 19200, &m, &n, 0);
-	get_m_n_optimized(1524000, 26000, &m, &n, 0);
-	get_m_n_optimized(1524000, 27000, &m, &n, 0);
+	get_m_n_optimized(1524000, 12000, &m, &n);
+	get_m_n_optimized(1524000, 13000, &m, &n);
+	get_m_n_optimized(1524000, 16800, &m, &n);
+	get_m_n_optimized(1524000, 19200, &m, &n);
+	get_m_n_optimized(1524000, 26000, &m, &n);
+	get_m_n_optimized(1524000, 27000, &m, &n);
 
 	/* exact recommendation for SDPs */
-	get_m_n_optimized(1523712, 38400, &m, &n, 0);
+	get_m_n_optimized(1523712, 38400, &m, &n);
 
 }
Signature · 1 line
1.7.1
author
#2 lore raw

PATCH 2/9 omap4: ttyO2 instead of ttyS2 in default bootargs

In reply to Aneesh V

Set console=ttyO2 instead of ttyS2 in default bootargs according to latest kernel config

---
 include/configs/omap4_common.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
include/configs/omap4_common.h +1 -1
index 42a8f10..a058700 100644
@@ -150,7 +150,7 @@
 
 #define CONFIG_EXTRA_ENV_SETTINGS \
 	"loadaddr=0x82000000\0" \
-	"console=ttyS2,115200n8\0" \
+	"console=ttyO2,115200n8\0" \
 	"usbtty=cdc_acm\0" \
 	"vram=16M\0" \
 	"mmcdev=0\0" \
Signature · 1 line
1.7.1
author
#3 lore raw

PATCH 3/9 omap: fix cache line size for omap3/omap4 boards

In reply to Aneesh V
---
 include/configs/omap3_beagle.h     |    2 ++
 include/configs/omap3_evm.h        |    1 +
 include/configs/omap3_evm_common.h |    2 ++
 include/configs/omap3_mvblx.h      |    2 ++
 include/configs/omap3_overo.h      |    2 ++
 include/configs/omap3_pandora.h    |    2 ++
 include/configs/omap3_sdp3430.h    |    2 ++
 include/configs/omap3_zoom1.h      |    2 ++
 include/configs/omap3_zoom2.h      |    2 ++
 include/configs/omap4_common.h     |    1 +
 10 files changed, 18 insertions(+), 0 deletions(-)
include/configs/omap3_beagle.h +2 -0
index 15e40c5..a73c8af 100644
@@ -390,4 +390,6 @@
 
 #define CONFIG_OMAP3_SPI
 
+#define CONFIG_SYS_CACHELINE_SIZE	64
+
 #endif /* __CONFIG_H */
include/configs/omap3_evm.h +1 -0
index 47ec39f..218d806 100644
@@ -141,4 +141,5 @@
 		"fi; " \
 	"else run nandboot; fi"
 
+
 #endif /* __OMAP3EVM_CONFIG_H */
include/configs/omap3_evm_common.h +2 -0
index 54aa7a7..e6921c5 100644
@@ -289,4 +289,6 @@
 /* Uncomment to define the board revision statically */
 /* #define CONFIG_STATIC_BOARD_REV	OMAP3EVM_BOARD_GEN_2 */
 
+#define CONFIG_SYS_CACHELINE_SIZE	64
+
 #endif /* __OMAP3_EVM_COMMON_H */
include/configs/omap3_mvblx.h +2 -0
index a0252a2..7df75f5 100644
@@ -310,4 +310,6 @@
 
 #define CONFIG_OMAP3_SPI
 
+#define CONFIG_SYS_CACHELINE_SIZE	64
+
 #endif /* __CONFIG_H */
include/configs/omap3_overo.h +2 -0
index afdefd9..b628fef 100644
@@ -307,4 +307,6 @@
 					 CONFIG_SYS_INIT_RAM_SIZE - \
 					 GENERATED_GBL_DATA_SIZE)
 
+#define CONFIG_SYS_CACHELINE_SIZE	64
+
 #endif				/* __CONFIG_H */
include/configs/omap3_pandora.h +2 -0
index 3c2793e..af2bf80 100644
@@ -278,4 +278,6 @@
 #define CONFIG_ENV_OFFSET		SMNAND_ENV_OFFSET
 #define CONFIG_ENV_ADDR			SMNAND_ENV_OFFSET
 
+#define CONFIG_SYS_CACHELINE_SIZE	64
+
 #endif				/* __CONFIG_H */
include/configs/omap3_sdp3430.h +2 -0
index 35472bb..8e9ac53 100644
@@ -358,4 +358,6 @@
  *  - rest for filesystem
  */
 
+#define CONFIG_SYS_CACHELINE_SIZE	64
+
 #endif				/* __CONFIG_H */
include/configs/omap3_zoom1.h +2 -0
index fbac222..a01dc74 100644
@@ -303,4 +303,6 @@
 #define CONFIG_ENV_OFFSET		SMNAND_ENV_OFFSET
 #define CONFIG_ENV_ADDR			SMNAND_ENV_OFFSET
 
+#define CONFIG_SYS_CACHELINE_SIZE	64
+
 #endif				/* __CONFIG_H */
include/configs/omap3_zoom2.h +2 -0
index 8de3d31..c4b6552 100644
@@ -269,4 +269,6 @@
 #define CONFIG_ENV_OFFSET		SMNAND_ENV_OFFSET
 #define CONFIG_ENV_ADDR			SMNAND_ENV_OFFSET
 
+#define CONFIG_SYS_CACHELINE_SIZE	64
+
 #endif /* __CONFIG_H */
include/configs/omap4_common.h +1 -0
index a058700..613aef2 100644
@@ -239,6 +239,7 @@
 #define CONFIG_SYS_L2_PL310		1
 #define CONFIG_SYS_PL310_BASE	0x48242000
 #endif
+#define CONFIG_SYS_CACHELINE_SIZE	32
 
 /* Defines for SDRAM init */
 #define CONFIG_SYS_EMIF_PRECALCULATED_TIMING_REGS
Signature · 1 line
1.7.1
#6 lore raw

PATCH 3/9 omap: fix cache line size for omap3/omap4 boards

Quoted 10 lines · Aneesh V
Quoted 7 lines · Tom Rini
Quoted 3 lines · Aneesh V

Except for adding whitespace to include/configs/omap3_evm.h,

Will fix it.

To be clear, since there wasn't a v2 and it's just dropping a change, I'll do that as I push this into u-boot-ti.

Signature · 1 line
Tom
author
#7 lore raw

PATCH 4/9 omap4460: fix TPS initialization

In reply to Aneesh V

TPS power IC is controlled using a GPIO (gpio_wk7). This GPIO should be maintained at logic 1 always. As such an internal pull-up on this pin will do the job, driving the GPIO outuput is not needed. This will avoid the need of using GPIO library in SPL and also may save some power.

---
 arch/arm/cpu/armv7/omap-common/clocks-common.c |    8 --------
 board/ti/panda/panda_mux_data.h                |    2 +-
 board/ti/sdp4430/sdp.c                         |    7 +++++++
 board/ti/sdp4430/sdp4430_mux_data.h            |    6 +++++-
 4 files changed, 13 insertions(+), 10 deletions(-)
arch/arm/cpu/armv7/omap-common/clocks-common.c +0 -8
index f64a10b..1e7e20e 100644
@@ -359,14 +359,6 @@ void do_scale_tps62361(u32 reg, u32 volt_mv)
 	step = volt_mv - TPS62361_BASE_VOLT_MV;
 	step /= 10;
 
-	/*
-	 * Select SET1 in TPS62361:
-	 * VSEL1 is grounded on board. So the following selects
-	 * VSEL1 = 0 and VSEL0 = 1
-	 */
-	gpio_direction_output(TPS62361_VSEL0_GPIO, 0);
-	gpio_set_value(TPS62361_VSEL0_GPIO, 1);
-
 	temp = TPS62361_I2C_SLAVE_ADDR |
 	    (reg << PRM_VC_VAL_BYPASS_REGADDR_SHIFT) |
 	    (step << PRM_VC_VAL_BYPASS_DATA_SHIFT) |
board/ti/panda/panda_mux_data.h +1 -1
index c05170e..2970ccd 100644
@@ -76,7 +76,7 @@ const struct pad_conf_entry wkup_padconf_array_essential[] = {
 
 const struct pad_conf_entry wkup_padconf_array_essential_4460[] = {
 
-{PAD1_FREF_CLK4_REQ, (M3)},	 /* gpio_wk7, TPS */
+{PAD1_FREF_CLK4_REQ, (PTU | M7)}, /* gpio_wk7 for TPS: safe mode + pull up */
 
 };
 
board/ti/sdp4430/sdp.c +7 -0
index e1b853c..9ae9e2c 100644
@@ -96,6 +96,13 @@ void set_muxconf_regs_non_essential(void)
 	do_set_mux(CONTROL_PADCONF_WKUP, wkup_padconf_array_non_essential,
 		   sizeof(wkup_padconf_array_non_essential) /
 		   sizeof(struct pad_conf_entry));
+
+	if (omap_revision() < OMAP4460_ES1_0) {
+		do_set_mux(CONTROL_PADCONF_WKUP,
+			wkup_padconf_array_non_essential_4430,
+			sizeof(wkup_padconf_array_non_essential_4430) /
+			sizeof(struct pad_conf_entry));
+	}
 }
 
 #if !defined(CONFIG_SPL_BUILD) && defined(CONFIG_GENERIC_MMC)
board/ti/sdp4430/sdp4430_mux_data.h +5 -1
index 1c6e0ee..0a20968 100644
@@ -67,7 +67,7 @@ const struct pad_conf_entry wkup_padconf_array_essential[] = {
 
 const struct pad_conf_entry wkup_padconf_array_essential_4460[] = {
 
-{PAD1_FREF_CLK4_REQ, (M3)},	 /* gpio_wk7, TPS */
+{PAD1_FREF_CLK4_REQ, (PTU | M7)}, /* gpio_wk7 for TPS: safe mode + pull up */
 
 };
 
@@ -275,4 +275,8 @@ const struct pad_conf_entry wkup_padconf_array_non_essential[] = {
 	{PAD1_SYS_BOOT7, (IEN | M3)},		/* gpio_wk10 */
 };
 
+const struct pad_conf_entry wkup_padconf_array_non_essential_4430[] = {
+	{PAD1_FREF_CLK4_REQ, (M3)}	/* gpio_wk7 - Debug led-2 */
+};
+
 #endif /* _SDP4430_MUX_DATA_H */
Signature · 1 line
1.7.1
author
#8 lore raw

PATCH 5/9 omap: remove I2C from SPL

In reply to Aneesh V

Due to some recent changes I2C is no longer required in SPL. Remove the i2c_init() call to save some space

---
 arch/arm/cpu/armv7/omap-common/spl.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)
arch/arm/cpu/armv7/omap-common/spl.c +0 -1
index d6d7d65..f72d389 100644
@@ -115,7 +115,6 @@ void board_init_r(gd_t *id, ulong dummy)
 			CONFIG_SYS_SPL_MALLOC_SIZE);
 
 	timer_init();
-	i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
 
 	boot_device = omap_boot_device();
 	debug("boot device - %d\n", boot_device);
Signature · 1 line
1.7.1
#9 lore raw

PATCH 5/9 omap: remove I2C from SPL

Quoted 2 lines · Aneesh V

Due to some recent changes I2C is no longer required in SPL. Remove the i2c_init() call to save some space

Which changes? We might need to bring this back for am335x stuff, once we have i2c support ready to post to mainline (on these boards we identify board/rev in the EEPROM)

Signature · 1 line
Tom
author
#10 lore raw

PATCH 5/9 omap: remove I2C from SPL

Quoted 8 lines · Tom Rini
Quoted 2 lines · Aneesh V

Due to some recent changes I2C is no longer required in SPL. Remove the i2c_init() call to save some space

Which changes? We might need to bring this back for am335x stuff, once we have i2c support ready to post to mainline (on these boards we identify board/rev in the EEPROM)

Apparently this one:

14fa2dd00f4f996c9583c8fba63bfa03f5025ec3

Looks like this is what has helped:

/* TWL6030 */
+#ifndef CONFIG_SPL_BUILD
#define CONFIG_TWL6030_POWER 1
+#endif

On a closer look, it looks like this may not be the case for OMAP3. CONFIG_TWL4030_POWER seems to be defined even for SPL. So, I think we need to do something like this:

#if defined(CONFIG_TWL6030_POWER) || defined(CONFIG_TWL4030_POWER) || defined(CONFIG_EEPROM)

i2c_init();

#endif

If you agree, I will do this change in v2.

BTW, I think you can also remove CONFIG_TWL4030_POWER from SPL. As we continue to boot from the same media where ROM code picked up SPL from, the regulators should be in proper condition.

br,
Aneesh

#11 lore raw

PATCH 5/9 omap: remove I2C from SPL

Quoted 32 lines · Aneesh V
Quoted 10 lines · Tom Rini
Quoted 3 lines · On Tue, Nov 22, 2011 at 2:39 AM, Aneesh V<[email protected]> ?wrote:

Due to some recent changes I2C is no longer required in SPL. Remove the i2c_init() call to save some space

Which changes? ?We might need to bring this back for am335x stuff, once we have i2c support ready to post to mainline (on these boards we identify board/rev in the EEPROM)

Apparently this one:

14fa2dd00f4f996c9583c8fba63bfa03f5025ec3

Looks like this is what has helped:

?/* TWL6030 */
+#ifndef CONFIG_SPL_BUILD
?#define CONFIG_TWL6030_POWER ? ? ? ? ? 1
+#endif

On a closer look, it looks like this may not be the case for OMAP3. CONFIG_TWL4030_POWER seems to be defined even for SPL. So, I think we need to do something like this:

#if defined(CONFIG_TWL6030_POWER) || defined(CONFIG_TWL4030_POWER) || defined(CONFIG_EEPROM)

i2c_init();

Quoted 7 lines

#endif

If you agree, I will do this change in v2.

BTW, I think you can also remove CONFIG_TWL4030_POWER from SPL. As we continue to boot from the same media where ROM code picked up SPL from, the regulators should be in proper condition.

Hmm, I think what we need is spl_board_init where we can put things like i2c_init();. I'll grab that from the am335x tree and post it today.

Signature · 1 line
Tom
author
#12 lore raw

PATCH 6/9 omap4: emif: fix error in driver

In reply to Aneesh V

There was a typo in the EMIF driver. It went un-noticed because it affected only when automatic detection is enabled and even then half the memory was configured and identified properly.

---
 arch/arm/cpu/armv7/omap-common/emif-common.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
arch/arm/cpu/armv7/omap-common/emif-common.c +2 -2
index ce03b5c..62678ff 100644
@@ -903,9 +903,9 @@ static void do_sdram_init(u32 base)
 	 */
 	struct lpddr2_device_details cs0_dev_details, cs1_dev_details;
 	emif_reset_phy(base);
-	dev_details.cs0_device_details = emif_get_device_details(base, CS0,
+	dev_details.cs0_device_details = emif_get_device_details(emif_nr, CS0,
 						&cs0_dev_details);
-	dev_details.cs1_device_details = emif_get_device_details(base, CS1,
+	dev_details.cs1_device_details = emif_get_device_details(emif_nr, CS1,
 						&cs1_dev_details);
 	emif_reset_phy(base);
 
Signature · 1 line
1.7.1
author
#13 lore raw

PATCH 7/9 omap4460: add ES1.1 identification

In reply to Aneesh V
---
 arch/arm/cpu/armv7/omap4/hwinit.c      |   10 +++++++++-
 arch/arm/include/asm/arch-omap4/omap.h |    2 ++
 arch/arm/include/asm/omap_common.h     |    1 +
 3 files changed, 12 insertions(+), 1 deletions(-)
arch/arm/cpu/armv7/omap4/hwinit.c +9 -1
index 52c9b19..cd1451a 100644
@@ -146,7 +146,15 @@ void init_omap_revision(void)
 		*omap4_revision = OMAP4430_ES2_3;
 		break;
 	case MIDR_CORTEX_A9_R2P10:
-		*omap4_revision = OMAP4460_ES1_0;
+		switch (readl(CONTROL_ID_CODE)) {
+		case OMAP4460_CONTROL_ID_CODE_ES1_1:
+			*omap4_revision = OMAP4460_ES1_1;
+			break;
+		case OMAP4460_CONTROL_ID_CODE_ES1_0:
+		default:
+			*omap4_revision = OMAP4460_ES1_0;
+			break;
+		}
 		break;
 	default:
 		*omap4_revision = OMAP4430_SILICON_ID_INVALID;
arch/arm/include/asm/arch-omap4/omap.h +2 -0
index e994257..4d8c89f 100644
@@ -63,6 +63,8 @@
 #define OMAP4_CONTROL_ID_CODE_ES2_1	0x3B95C02F
 #define OMAP4_CONTROL_ID_CODE_ES2_2	0x4B95C02F
 #define OMAP4_CONTROL_ID_CODE_ES2_3	0x6B95C02F
+#define OMAP4460_CONTROL_ID_CODE_ES1_0	0x0B94E02F
+#define OMAP4460_CONTROL_ID_CODE_ES1_1	0x2B94E02F
 
 /* UART */
 #define UART1_BASE		(OMAP44XX_L4_PER_BASE + 0x6a000)
arch/arm/include/asm/omap_common.h +1 -0
index f1562ea..913231b 100644
@@ -108,6 +108,7 @@ void spl_mmc_load_image(void);
 #define OMAP4430_ES2_2	0x44300220
 #define OMAP4430_ES2_3	0x44300230
 #define OMAP4460_ES1_0	0x44600100
+#define OMAP4460_ES1_1	0x44600110
 
 /* omap5 */
 #define OMAP5430_SILICON_ID_INVALID	0
Signature · 1 line
1.7.1
author
#14 lore raw

PATCH 8/9 omap4+: streamline CONFIG_SYS_TEXT_BASE and other SDRAM addresses

In reply to Aneesh V

Change the CONFIG_SYS_TEXT_BASE and the addresses of SDRAM buffers used by SPL(heap and BSS) keeping in mind the following requirements:

1. Make sure that SPL's heap and BSS doesn't come in the way of Linux kernel, which is typically loaded at 0x80008000. This will be important when SPL directly loads kernel.

2. Align the CONFIG_SYS_TEXT_BASE between TI internal U-Boot and mainline U-Boot. This avoids a lot of confusion and allows for the inter-operability of x-loader, SPL, internal U-Boot, mainline U-Boot etc. The internal U-Boot's address can not be changed to that of mainline U-Boot as internal U-Boot doesn't have relocation and 0x80100000 used by mainline U-Boot will clash with kernel

3. Assume only a minimum amount of memory that may be available on any practical OMAP4/5 board in future too. We are assuming a minimum of 128 MB of memory

---
 include/configs/omap4_common.h |   17 ++++++++++-------
 include/configs/omap5_evm.h    |   19 +++++++++++--------
 2 files changed, 21 insertions(+), 15 deletions(-)
include/configs/omap4_common.h +10 -7
index 613aef2..a989721 100644
@@ -255,18 +255,21 @@
 #define CONFIG_SPL_MAX_SIZE		(38 * 1024)
 #define CONFIG_SPL_STACK		LOW_LEVEL_SRAM_STACK
 
-#define CONFIG_SPL_BSS_START_ADDR	0x80000000
-#define CONFIG_SPL_BSS_MAX_SIZE		0x80000		/* 512 KB */
 /*
- * 1MB into the SDRAM to allow for SPL's bss at the beginning of SDRAM
  * 64 bytes before this address should be set aside for u-boot.img's
- * header. That is 0x800FFFC0--0x80100000 should not be used for any
+ * header. That is 80E7FFC0--0x80E80000 should not be used for any
  * other needs.
  */
-#define CONFIG_SYS_TEXT_BASE		0x80100000
-#define CONFIG_SYS_SPL_MALLOC_START	0x80200000
-#define CONFIG_SYS_SPL_MALLOC_SIZE	0x100000	/* 1 MB */
+#define CONFIG_SYS_TEXT_BASE		0x80E80000
 
+/*
+ * BSS and malloc area 64MB into memory to allow enough
+ * space for the kernel at the beginning of memory
+ */
+#define CONFIG_SPL_BSS_START_ADDR	0x84000000
+#define CONFIG_SPL_BSS_MAX_SIZE		0x100000	/* 1 MB */
+#define CONFIG_SYS_SPL_MALLOC_START	0x84100000
+#define CONFIG_SYS_SPL_MALLOC_SIZE	0x100000	/* 1 MB */
 
 #define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR	0x300 /* address 0x60000 */
 #define CONFIG_SYS_U_BOOT_MAX_SIZE_SECTORS	0x200 /* 256 KB */
include/configs/omap5_evm.h +11 -8
index b763f01..d3d5263 100644
@@ -254,9 +254,6 @@
 #define CONFIG_SPL_MAX_SIZE		0x1E000	/* 120K */
 #define CONFIG_SPL_STACK		LOW_LEVEL_SRAM_STACK
 
-#define CONFIG_SPL_BSS_START_ADDR	0x80000000
-#define CONFIG_SPL_BSS_MAX_SIZE		0x80000		/* 512 KB */
-
 #define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR	0x300 /* address 0x60000 */
 #define CONFIG_SYS_U_BOOT_MAX_SIZE_SECTORS	0x200 /* 256 KB */
 #define CONFIG_SYS_MMC_SD_FAT_BOOT_PARTITION	1
@@ -272,13 +269,19 @@
 #define CONFIG_SPL_LDSCRIPT "arch/arm/cpu/armv7/omap-common/u-boot-spl.lds"
 
 /*
- * 1MB into the SDRAM to allow for SPL's bss at the beginning of SDRAM
  * 64 bytes before this address should be set aside for u-boot.img's
- * header. That is 0x800FFFC0--0x80100000 should not be used for any
+ * header. That is 80E7FFC0--0x80E80000 should not be used for any
  * other needs.
  */
-#define CONFIG_SYS_TEXT_BASE		0x80100000
-#define CONFIG_SYS_SPL_MALLOC_START     0x80200000
-#define CONFIG_SYS_SPL_MALLOC_SIZE      0x100000        /* 1 MB */
+#define CONFIG_SYS_TEXT_BASE		0x80E80000
+
+/*
+ * BSS and malloc area 64MB into memory to allow enough
+ * space for the kernel at the beginning of memory
+ */
+#define CONFIG_SPL_BSS_START_ADDR	0x84000000
+#define CONFIG_SPL_BSS_MAX_SIZE		0x100000	/* 1 MB */
+#define CONFIG_SYS_SPL_MALLOC_START	0x84100000
+#define CONFIG_SYS_SPL_MALLOC_SIZE	0x100000	/* 1 MB */
 
 #endif /* __CONFIG_H */
Signature · 1 line
1.7.1
author
#15 lore raw

PATCH 9/9 omap4: fix IO setting

In reply to Aneesh V

The value from TRIM is not working for some 4430 silicons. So, override with hw team recommended value. However, for 4460 TRIM value shall be used as long as the part is trimmed

This fixes boot problem on some OMAP4430 ES2.0 Panda boards out there.

Cc Steve Sakoman <[email protected]>
---
 arch/arm/cpu/armv7/omap4/hwinit.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
arch/arm/cpu/armv7/omap4/hwinit.c +6 -1
index cd1451a..37a86b4 100644
@@ -105,7 +105,12 @@ void do_io_settings(void)
 			&ctrl->control_ldosram_core_voltage_ctrl);
 	}
 
-	if (!readl(&ctrl->control_efuse_1))
+	/*
+	 * Over-ride the register
+	 *	i. unconditionally for all 4430
+	 *	ii. only if un-trimmed for 4460
+	 */
+	if ((omap4_rev < OMAP4460_ES1_0) || !readl(&ctrl->control_efuse_1))
 		writel(CONTROL_EFUSE_1_OVERRIDE, &ctrl->control_efuse_1);
 
 	if (!readl(&ctrl->control_efuse_2))
Signature · 1 line
1.7.1