From 66fca016057b1c6b697552cc7220ebada9d4f82d Mon Sep 17 00:00:00 2001 From: Thomas Weber Date: Mon, 18 Oct 2010 15:38:15 +0200 Subject: [PATCH 01/18] Devkit8000: Adapt changes to ARM relocation support Fix compilation of Devkit8000 after introduction of ARM relocation support. Signed-off-by: Thomas Weber Adapt to TEXT_BASE => CONFIG_SYS_TEXT_BASE rename. Signed-off-by: Wolfgang Denk --- board/timll/devkit8000/config.mk | 35 -------------------------------- include/configs/devkit8000.h | 5 +++++ 2 files changed, 5 insertions(+), 35 deletions(-) delete mode 100644 board/timll/devkit8000/config.mk diff --git a/board/timll/devkit8000/config.mk b/board/timll/devkit8000/config.mk deleted file mode 100644 index cb2cf8f78..000000000 --- a/board/timll/devkit8000/config.mk +++ /dev/null @@ -1,35 +0,0 @@ -# -# (C) Copyright 2006 -# Texas Instruments, -# -# (C) Copyright 2009 -# Frederik Kriewitz -# -# DevKit8000 uses OMAP3 (ARM-CortexA8) cpu -# see http://www.ti.com/ for more information on Texas Instruments -# -# 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 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., 59 Temple Place, Suite 330, Boston, -# MA 02111-1307 USA -# -# Physical Address: -# 8000'0000 (bank0) -# Linux-Kernel is expected to be at 8000'8000, entry 8000'8000 -# (mem base + reserved) - -# For use with external or internal boots. -CONFIG_SYS_TEXT_BASE = 0x80e80000 diff --git a/include/configs/devkit8000.h b/include/configs/devkit8000.h index 281577153..c47e17c77 100644 --- a/include/configs/devkit8000.h +++ b/include/configs/devkit8000.h @@ -38,6 +38,8 @@ #define CONFIG_OMAP3430 1 /* which is in a 3430 */ #define CONFIG_OMAP3_DEVKIT8000 1 /* working with DevKit8000 */ +#define CONFIG_SYS_TEXT_BASE 0x80008000 + #define CONFIG_SDRC /* The chip has SDRC controller */ #include /* get chip and board defs */ @@ -306,4 +308,7 @@ extern unsigned int boot_flash_sec; extern unsigned int boot_flash_type; #endif +#define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM_1 +#define CONFIG_SYS_INIT_SP_ADDR (LOW_LEVEL_SRAM_STACK - CONFIG_SYS_GBL_DATA_SIZE) + #endif /* __CONFIG_H */ From 33825ec1a48b279a5e825b1df4eda8b5da1fb34a Mon Sep 17 00:00:00 2001 From: Reinhard Meyer Date: Mon, 25 Oct 2010 17:56:23 +0200 Subject: [PATCH 02/18] AT91: add 2nd SPI to 9260/9XE/9G20 Signed-off-by: Reinhard Meyer --- arch/arm/include/asm/arch-at91/hardware.h | 1 + arch/arm/include/asm/arch-at91/memory-map.h | 1 + 2 files changed, 2 insertions(+) diff --git a/arch/arm/include/asm/arch-at91/hardware.h b/arch/arm/include/asm/arch-at91/hardware.h index f5f80e0b1..6b44d6120 100644 --- a/arch/arm/include/asm/arch-at91/hardware.h +++ b/arch/arm/include/asm/arch-at91/hardware.h @@ -23,6 +23,7 @@ #include #define AT91_BASE_MCI AT91SAM9260_BASE_MCI #define AT91_BASE_SPI AT91SAM9260_BASE_SPI0 +#define AT91_BASE_SPI1 AT91SAM9260_BASE_SPI1 #define AT91_ID_UHP AT91SAM9260_ID_UHP #define AT91_PMC_UHP AT91SAM926x_PMC_UHP #elif defined(CONFIG_AT91SAM9261) || defined(CONFIG_AT91SAM9G10) diff --git a/arch/arm/include/asm/arch-at91/memory-map.h b/arch/arm/include/asm/arch-at91/memory-map.h index f605f37fd..d489fa215 100644 --- a/arch/arm/include/asm/arch-at91/memory-map.h +++ b/arch/arm/include/asm/arch-at91/memory-map.h @@ -31,5 +31,6 @@ #define USART2_BASE AT91_USART2 #define USART3_BASE (AT91_BASE_SYS + AT91_DBGU) #define SPI0_BASE AT91_BASE_SPI +#define SPI1_BASE AT91_BASE_SPI1 #endif /* __ASM_ARM_ARCH_MEMORYMAP_H__ */ From 7d44af08b823b9f83e328a4bc2192ab7cbb31e9a Mon Sep 17 00:00:00 2001 From: Reinhard Meyer Date: Mon, 25 Oct 2010 17:56:11 +0200 Subject: [PATCH 03/18] AT91: add header file for the Shutdown Controller and SHDWN address entry in at91sam9260.h Signed-off-by: Reinhard Meyer --- arch/arm/include/asm/arch-at91/at91_shdwn.h | 38 ++++++++++++++++++++ arch/arm/include/asm/arch-at91/at91sam9260.h | 1 + 2 files changed, 39 insertions(+) create mode 100644 arch/arm/include/asm/arch-at91/at91_shdwn.h diff --git a/arch/arm/include/asm/arch-at91/at91_shdwn.h b/arch/arm/include/asm/arch-at91/at91_shdwn.h new file mode 100644 index 000000000..874f98870 --- /dev/null +++ b/arch/arm/include/asm/arch-at91/at91_shdwn.h @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2010 + * Reinhard Meyer, reinhard.meyer@emk-elektronik.de + * + * Shutdown Controller + * Based on AT91SAM9XE datasheet + * + * 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. + */ + +#ifndef AT91_SHDWN_H +#define AT91_SHDWN_H + +#ifndef __ASSEMBLY__ + +struct at91_shdwn { + u32 cr; /* Control Rer. WO */ + u32 mr; /* Mode Register RW 0x00000003 */ + u32 sr; /* Status Register RO 0x00000000 */ +}; + +#endif /* __ASSEMBLY__ */ + +#define AT91_SHDW_CR_KEY 0xa5000000 +#define AT91_SHDW_CR_SHDW 0x00000001 + +#define AT91_SHDW_MR_RTTWKEN 0x00010000 +#define AT91_SHDW_MR_CPTWK0 0x000000f0 +#define AT91_SHDW_MR_WKMODE0H2L 0x00000002 +#define AT91_SHDW_MR_WKMODE0L2H 0x00000001 + +#define AT91_SHDW_SR_RTTWK 0x00010000 +#define AT91_SHDW_SR_WAKEUP0 0x00000001 + +#endif diff --git a/arch/arm/include/asm/arch-at91/at91sam9260.h b/arch/arm/include/asm/arch-at91/at91sam9260.h index cb34a94a3..7fd60b74f 100644 --- a/arch/arm/include/asm/arch-at91/at91sam9260.h +++ b/arch/arm/include/asm/arch-at91/at91sam9260.h @@ -56,6 +56,7 @@ #define AT91_PIO_BASE 0xfffff400 #define AT91_PMC_BASE 0xfffffc00 #define AT91_RSTC_BASE 0xfffffd00 +#define AT91_SHDWN_BASE 0xfffffd10 #define AT91_RTT_BASE 0xfffffd20 #define AT91_PIT_BASE 0xfffffd30 #define AT91_WDT_BASE 0xfffffd40 From a711edfae15cdf91b14bfb81e403230fa06c544d Mon Sep 17 00:00:00 2001 From: Steve Sakoman Date: Thu, 21 Oct 2010 06:11:53 -0700 Subject: [PATCH 04/18] ARMV7: OMAP3: IGEP: Rename TEXT_BASE Commit 14d0a02a "Rename TEXT_BASE into CONFIG_SYS_TEXT_BASE" missed the IGEP boards since they were just added. Signed-off-by: Steve Sakoman Signed-off-by: Sandeep Paulraj --- board/isee/igep0020/config.mk | 2 +- board/isee/igep0030/config.mk | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/board/isee/igep0020/config.mk b/board/isee/igep0020/config.mk index b8812f94a..7964621ac 100644 --- a/board/isee/igep0020/config.mk +++ b/board/isee/igep0020/config.mk @@ -30,4 +30,4 @@ # (mem base + reserved) # For use with external or internal boots. -TEXT_BASE = 0x80008000 +CONFIG_SYS_TEXT_BASE = 0x80008000 diff --git a/board/isee/igep0030/config.mk b/board/isee/igep0030/config.mk index 019f93f20..de6384f93 100644 --- a/board/isee/igep0030/config.mk +++ b/board/isee/igep0030/config.mk @@ -30,4 +30,5 @@ # (mem base + reserved) # For use with external or internal boots. -TEXT_BASE = 0x80008000 +CONFIG_SYS_TEXT_BASE = 0x80008000 + From 8345fb242c952b2bb993ac43ecc53eac0108f80c Mon Sep 17 00:00:00 2001 From: Steve Sakoman Date: Wed, 20 Oct 2010 22:00:00 -0700 Subject: [PATCH 05/18] ARMV7: Fix build for non-OMAP3 boards Commit c3d3a54 uses CONFIG_ARMV7 to determine whether to call the v7_flush_cache_all function. This breaks the build for all non-OMAP3 boards (like Panda and OMAP4430SDP) since there is only a v7_flush_cache_all implementation for OMAP3. This patch uses CONFIG_OMAP3XXX instead of CONFIG_ARMV7 so that only boards with a v7_flush_cache_all will make the call. Tested on Beagle, Overo, Panda, and OMAP4430SDP Signed-off-by: Steve Sakoman Signed-off-by: Sandeep Paulraj --- arch/arm/lib/cache.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/lib/cache.c b/arch/arm/lib/cache.c index 57151689a..30686fe69 100644 --- a/arch/arm/lib/cache.c +++ b/arch/arm/lib/cache.c @@ -38,7 +38,7 @@ void flush_cache (unsigned long dummy1, unsigned long dummy2) /* disable write buffer as well (page 2-22) */ asm("mcr p15, 0, %0, c7, c10, 4" : : "r" (0)); #endif -#ifdef CONFIG_ARMV7 +#ifdef CONFIG_OMAP34XX void v7_flush_cache_all(void); v7_flush_cache_all(); From d64b5b89159dad129e4e07d4267c549b6d473386 Mon Sep 17 00:00:00 2001 From: Steve Sakoman Date: Mon, 20 Sep 2010 08:05:14 -0700 Subject: [PATCH 06/18] ARMV7: OMAP3: Add expansion board detection for Overo Overo expansion boards contain an i2c eeprom to identify themselves. This patch adds code to read and parse the eeprom contents. It prints the expansion board name and revision and modifies environment variables as appropriate. Signed-off-by: Steve Sakoman Signed-off-by: Sandeep Paulraj --- board/overo/overo.c | 115 ++++++++++++++++++++++++++++++++++ board/overo/overo.h | 4 ++ include/configs/omap3_overo.h | 1 + 3 files changed, 120 insertions(+) diff --git a/board/overo/overo.c b/board/overo/overo.c index 9c926938b..f917e402b 100644 --- a/board/overo/overo.c +++ b/board/overo/overo.c @@ -40,6 +40,32 @@ #include #include "overo.h" +#define TWL4030_I2C_BUS 0 +#define EXPANSION_EEPROM_I2C_BUS 2 +#define EXPANSION_EEPROM_I2C_ADDRESS 0x51 + +#define GUMSTIX_SUMMIT 0x01000200 +#define GUMSTIX_TOBI 0x02000200 +#define GUMSTIX_TOBI_DUO 0x03000200 +#define GUMSTIX_PALO35 0x04000200 +#define GUMSTIX_PALO43 0x05000200 +#define GUMSTIX_CHESTNUT43 0x06000200 +#define GUMSTIX_PINTO 0x07000200 +#define GUMSTIX_GALLOP43 0x08000200 + +#define ETTUS_USRP_E 0x01000300 + +#define GUMSTIX_NO_EEPROM 0xffffffff + +static struct { + unsigned int device_vendor; + unsigned char revision; + unsigned char content; + char fab_revision[8]; + char env_var[16]; + char env_setting[64]; +} expansion_config; + #if defined(CONFIG_CMD_NET) static void setup_net_chip(void); #endif @@ -136,6 +162,31 @@ int get_sdio2_config(void) return sdio_direct; } +/* + * Routine: get_expansion_id + * Description: This function checks for expansion board by checking I2C + * bus 2 for the availability of an AT24C01B serial EEPROM. + * returns the device_vendor field from the EEPROM + */ +unsigned int get_expansion_id(void) +{ + i2c_set_bus_num(EXPANSION_EEPROM_I2C_BUS); + + /* return GUMSTIX_NO_EEPROM if eeprom doesn't respond */ + if (i2c_probe(EXPANSION_EEPROM_I2C_ADDRESS) == 1) { + i2c_set_bus_num(TWL4030_I2C_BUS); + return GUMSTIX_NO_EEPROM; + } + + /* read configuration data */ + i2c_read(EXPANSION_EEPROM_I2C_ADDRESS, 0, 1, (u8 *)&expansion_config, + sizeof(expansion_config)); + + i2c_set_bus_num(TWL4030_I2C_BUS); + + return expansion_config.device_vendor; +} + /* * Routine: misc_init_r * Description: Configure board specific parts @@ -164,6 +215,70 @@ int misc_init_r(void) printf("Unable to detect mmc2 connection type\n"); } + switch (get_expansion_id()) { + case GUMSTIX_SUMMIT: + printf("Recognized Summit expansion board (rev %d %s)\n", + expansion_config.revision, + expansion_config.fab_revision); + setenv("defaultdisplay", "dvi"); + break; + case GUMSTIX_TOBI: + printf("Recognized Tobi expansion board (rev %d %s)\n", + expansion_config.revision, + expansion_config.fab_revision); + setenv("defaultdisplay", "dvi"); + break; + case GUMSTIX_TOBI_DUO: + printf("Recognized Tobi Duo expansion board (rev %d %s)\n", + expansion_config.revision, + expansion_config.fab_revision); + break; + case GUMSTIX_PALO35: + printf("Recognized Palo35 expansion board (rev %d %s)\n", + expansion_config.revision, + expansion_config.fab_revision); + setenv("defaultdisplay", "lcd35"); + break; + case GUMSTIX_PALO43: + printf("Recognized Palo43 expansion board (rev %d %s)\n", + expansion_config.revision, + expansion_config.fab_revision); + setenv("defaultdisplay", "lcd43"); + break; + case GUMSTIX_CHESTNUT43: + printf("Recognized Chestnut43 expansion board (rev %d %s)\n", + expansion_config.revision, + expansion_config.fab_revision); + setenv("defaultdisplay", "lcd43"); + break; + case GUMSTIX_PINTO: + printf("Recognized Pinto expansion board (rev %d %s)\n", + expansion_config.revision, + expansion_config.fab_revision); + break; + case GUMSTIX_GALLOP43: + printf("Recognized Gallop43 expansion board (rev %d %s)\n", + expansion_config.revision, + expansion_config.fab_revision); + setenv("defaultdisplay", "lcd43"); + break; + case ETTUS_USRP_E: + printf("Recognized Ettus Research USRP-E (rev %d %s)\n", + expansion_config.revision, + expansion_config.fab_revision); + MUX_USRP_E(); + setenv("defaultdisplay", "dvi"); + break; + case GUMSTIX_NO_EEPROM: + printf("No EEPROM on expansion board\n"); + break; + default: + printf("Unrecognized expansion board\n"); + } + + if (expansion_config.content == 1) + setenv(expansion_config.env_var, expansion_config.env_setting); + dieid_num_r(); return 0; diff --git a/board/overo/overo.h b/board/overo/overo.h index 33a92e4e1..68e1243e9 100644 --- a/board/overo/overo.h +++ b/board/overo/overo.h @@ -419,4 +419,8 @@ const omap3_sysinfo sysinfo = { MUX_VAL(CP(MMC1_DAT6), (IEN | PTU | EN | M4)) /*GPIO_128*/\ MUX_VAL(CP(MMC1_DAT7), (IEN | PTU | EN | M4)) /*GPIO_129*/ +#define MUX_USRP_E() \ + MUX_VAL(CP(MCSPI1_SOMI), (IEN | PTD | DIS | M4)) /*GPIO_173 */\ + MUX_VAL(CP(MCSPI1_CS1), (IDIS | PTD | EN | M4)) /*GPIO_175 */\ + #endif diff --git a/include/configs/omap3_overo.h b/include/configs/omap3_overo.h index 029207874..052d503b3 100644 --- a/include/configs/omap3_overo.h +++ b/include/configs/omap3_overo.h @@ -119,6 +119,7 @@ #define CONFIG_SYS_I2C_SLAVE 1 #define CONFIG_SYS_I2C_BUS 0 #define CONFIG_SYS_I2C_BUS_SELECT 1 +#define CONFIG_I2C_MULTI_BUS 1 #define CONFIG_DRIVER_OMAP34XX_I2C 1 /* From ca5f80ae97cdd211f9e6413369aaadee944f8cb6 Mon Sep 17 00:00:00 2001 From: Koen Kooi Date: Mon, 20 Sep 2010 10:21:33 -0700 Subject: [PATCH 07/18] ARMV7: OMAP3: Add expansion board detection for Beagle Beagle expansion boards contain an i2c eeprom to identify themselves. This patch adds code to read and parse the eeprom contents. It prints the expansion board name and revision and modifies environment variables as appropriate. This patch is based on the Overo expansion board code. Signed-off-by: Koen Kooi Signed-off-by: Steve Sakoman Signed-off-by: Sandeep Paulraj --- board/ti/beagle/beagle.c | 95 ++++++++++++++++++++++++++++++++++ board/ti/beagle/beagle.h | 46 +++++++++++++++- include/configs/omap3_beagle.h | 1 + 3 files changed, 140 insertions(+), 2 deletions(-) diff --git a/board/ti/beagle/beagle.c b/board/ti/beagle/beagle.c index c5d6679f4..d9b6f0116 100644 --- a/board/ti/beagle/beagle.c +++ b/board/ti/beagle/beagle.c @@ -39,6 +39,27 @@ #include #include "beagle.h" +#define TWL4030_I2C_BUS 0 +#define EXPANSION_EEPROM_I2C_BUS 1 +#define EXPANSION_EEPROM_I2C_ADDRESS 0x50 + +#define TINCANTOOLS_ZIPPY 0x01000100 +#define TINCANTOOLS_ZIPPY2 0x02000100 +#define TINCANTOOLS_TRAINER 0x04000100 +#define TINCANTOOLS_SHOWDOG 0x03000100 +#define KBADC_BEAGLEFPGA 0x01000600 + +#define BEAGLE_NO_EEPROM 0xffffffff + +static struct { + unsigned int device_vendor; + unsigned char revision; + unsigned char content; + char fab_revision[8]; + char env_var[16]; + char env_setting[64]; +} expansion_config; + /* * Routine: board_init * Description: Early hardware init. @@ -94,6 +115,31 @@ int get_board_revision(void) return revision; } +/* + * Routine: get_expansion_id + * Description: This function checks for expansion board by checking I2C + * bus 1 for the availability of an AT24C01B serial EEPROM. + * returns the device_vendor field from the EEPROM + */ +unsigned int get_expansion_id(void) +{ + i2c_set_bus_num(EXPANSION_EEPROM_I2C_BUS); + + /* return BEAGLE_NO_EEPROM if eeprom doesn't respond */ + if (i2c_probe(EXPANSION_EEPROM_I2C_ADDRESS) == 1) { + i2c_set_bus_num(TWL4030_I2C_BUS); + return BEAGLE_NO_EEPROM; + } + + /* read configuration data */ + i2c_read(EXPANSION_EEPROM_I2C_ADDRESS, 0, 1, (u8 *)&expansion_config, + sizeof(expansion_config)); + + i2c_set_bus_num(TWL4030_I2C_BUS); + + return expansion_config.device_vendor; +} + /* * Routine: misc_init_r * Description: Configure board specific parts @@ -141,6 +187,55 @@ int misc_init_r(void) printf("Beagle unknown 0x%02x\n", get_board_revision()); } + switch (get_expansion_id()) { + case TINCANTOOLS_ZIPPY: + printf("Recognized Tincantools Zippy board (rev %d %s)\n", + expansion_config.revision, + expansion_config.fab_revision); + MUX_TINCANTOOLS_ZIPPY(); + setenv("buddy", "zippy"); + break; + case TINCANTOOLS_ZIPPY2: + printf("Recognized Tincantools Zippy2 board (rev %d %s)\n", + expansion_config.revision, + expansion_config.fab_revision); + MUX_TINCANTOOLS_ZIPPY(); + setenv("buddy", "zippy2"); + break; + case TINCANTOOLS_TRAINER: + printf("Recognized Tincantools Trainer board (rev %d %s)\n", + expansion_config.revision, + expansion_config.fab_revision); + MUX_TINCANTOOLS_ZIPPY(); + MUX_TINCANTOOLS_TRAINER(); + setenv("buddy", "trainer"); + break; + case TINCANTOOLS_SHOWDOG: + printf("Recognized Tincantools Showdow board (rev %d %s)\n", + expansion_config.revision, + expansion_config.fab_revision); + /* Place holder for DSS2 definition for showdog lcd */ + setenv("defaultdisplay", "showdoglcd"); + setenv("buddy", "showdog"); + break; + case KBADC_BEAGLEFPGA: + printf("Recognized KBADC Beagle FPGA board\n"); + MUX_KBADC_BEAGLEFPGA(); + setenv("buddy", "beaglefpga"); + break; + case BEAGLE_NO_EEPROM: + printf("No EEPROM on expansion board\n"); + setenv("buddy", "none"); + break; + default: + printf("Unrecognized expansion board: %x\n", + expansion_config.device_vendor); + setenv("buddy", "unknown"); + } + + if (expansion_config.content == 1) + setenv(expansion_config.env_var, expansion_config.env_setting); + twl4030_power_init(); twl4030_led_init(TWL4030_LED_LEDEN_LEDAON | TWL4030_LED_LEDEN_LEDBON); diff --git a/board/ti/beagle/beagle.h b/board/ti/beagle/beagle.h index ec0da6d74..b22b65337 100644 --- a/board/ti/beagle/beagle.h +++ b/board/ti/beagle/beagle.h @@ -259,8 +259,8 @@ const omap3_sysinfo sysinfo = { MUX_VAL(CP(HSUSB0_DATA7), (IEN | PTD | DIS | M0)) /*HSUSB0_DATA7*/\ MUX_VAL(CP(I2C1_SCL), (IEN | PTU | EN | M0)) /*I2C1_SCL*/\ MUX_VAL(CP(I2C1_SDA), (IEN | PTU | EN | M0)) /*I2C1_SDA*/\ - MUX_VAL(CP(I2C2_SCL), (IEN | PTU | EN | M4)) /*GPIO_168*/\ - MUX_VAL(CP(I2C2_SDA), (IEN | PTU | EN | M4)) /*GPIO_183*/\ + MUX_VAL(CP(I2C2_SCL), (IEN | PTU | EN | M0)) /*I2C2_SCL*/\ + MUX_VAL(CP(I2C2_SDA), (IEN | PTU | EN | M0)) /*I2C2_SDA*/\ MUX_VAL(CP(I2C3_SCL), (IEN | PTU | EN | M0)) /*I2C3_SCL*/\ MUX_VAL(CP(I2C3_SDA), (IEN | PTU | EN | M0)) /*I2C3_SDA*/\ MUX_VAL(CP(I2C4_SCL), (IEN | PTU | EN | M0)) /*I2C4_SCL*/\ @@ -415,4 +415,46 @@ const omap3_sysinfo sysinfo = { MUX_VAL(CP(SYS_BOOT5), (IDIS | PTD | DIS | M3)) /*DSS_DATA22*/\ MUX_VAL(CP(SYS_BOOT6), (IDIS | PTD | DIS | M3)) /*DSS_DATA23*/ +#define MUX_TINCANTOOLS_ZIPPY() \ + MUX_VAL(CP(MMC2_CLK), (IEN | PTU | EN | M0)) /*MMC2_CLK*/\ + MUX_VAL(CP(MMC2_CMD), (IEN | PTU | EN | M0)) /*MMC2_CMD*/\ + MUX_VAL(CP(MMC2_DAT0), (IEN | PTU | EN | M0)) /*MMC2_DAT0*/\ + MUX_VAL(CP(MMC2_DAT1), (IEN | PTU | EN | M0)) /*MMC2_DAT1*/\ + MUX_VAL(CP(MMC2_DAT2), (IEN | PTU | EN | M0)) /*MMC2_DAT2*/\ + MUX_VAL(CP(MMC2_DAT3), (IEN | PTU | EN | M0)) /*MMC2_DAT3*/\ + MUX_VAL(CP(MMC2_DAT4), (IEN | PTU | EN | M1)) /*MMC2_DIR_DAT0*/\ + MUX_VAL(CP(MMC2_DAT5), (IEN | PTU | EN | M1)) /*MMC2_DIR_DAT1*/\ + MUX_VAL(CP(MMC2_DAT6), (IEN | PTU | EN | M1)) /*MMC2_DIR_CMD*/\ + MUX_VAL(CP(MMC2_DAT7), (IEN | PTU | EN | M1)) /*MMC2_CLKIN*/\ + MUX_VAL(CP(MCBSP1_CLKR), (IEN | PTU | EN | M1)) /*MCSPI4_CLK*/\ + MUX_VAL(CP(MCBSP1_FSR), (IEN | PTU | EN | M4)) /*GPIO_157*/\ + MUX_VAL(CP(MCBSP1_DX), (IEN | PTD | EN | M1)) /*MCSPI4_SIMO*/\ + MUX_VAL(CP(MCBSP1_DR), (IEN | PTD | DIS | M1)) /*MCSPI4_SOMI*/\ + MUX_VAL(CP(MCBSP1_FSX), (IEN | PTD | EN | M1)) /*MCSPI4_CS0*/\ + MUX_VAL(CP(MCBSP1_CLKX), (IEN | PTD | DIS | M4)) /*GPIO_162*/\ + MUX_VAL(CP(MCBSP3_DX), (IEN | PTD | DIS | M4)) /*GPIO_140*/\ + MUX_VAL(CP(MCBSP3_DR), (IEN | PTD | DIS | M4)) /*GPIO_142*/\ + MUX_VAL(CP(MCBSP3_CLKX), (IEN | PTD | DIS | M4)) /*GPIO_141*/ + +#define MUX_TINCANTOOLS_TRAINER() \ + MUX_VAL(CP(MMC2_CLK), (IEN | PTU | EN | M4)) /*GPIO_130*/\ + MUX_VAL(CP(MMC2_CMD), (IEN | PTU | EN | M4)) /*GPIO_131*/\ + MUX_VAL(CP(MMC2_DAT0), (IEN | PTU | EN | M4)) /*GPIO_132*/\ + MUX_VAL(CP(MMC2_DAT1), (IEN | PTU | EN | M4)) /*GPIO_133*/\ + MUX_VAL(CP(MMC2_DAT2), (IEN | PTU | EN | M4)) /*GPIO_134*/\ + MUX_VAL(CP(MMC2_DAT3), (IEN | PTU | EN | M4)) /*GPIO_135*/\ + MUX_VAL(CP(MMC2_DAT4), (IEN | PTU | EN | M4)) /*GPIO_136*/\ + MUX_VAL(CP(MMC2_DAT5), (IEN | PTU | EN | M4)) /*GPIO_137*/\ + MUX_VAL(CP(MMC2_DAT6), (IEN | PTU | EN | M4)) /*GPIO_138*/\ + MUX_VAL(CP(MMC2_DAT7), (IEN | PTU | EN | M4)) /*GPIO_139*/\ + MUX_VAL(CP(MCBSP3_DX), (IEN | PTU | EN | M4)) /*GPIO_140*/\ + MUX_VAL(CP(MCBSP3_CLKX), (IEN | PTU | EN | M4)) /*GPIO_141*/\ + MUX_VAL(CP(MCBSP1_CLKX), (IEN | PTU | EN | M4)) /*GPIO_162*/ + +#define MUX_KBADC_BEAGLEFPGA() \ + MUX_VAL(CP(MCBSP1_CLKR), (IEN | PTU | DIS | M1)) /*MCSPI4_CLK*/\ + MUX_VAL(CP(MCBSP1_DX), (IDIS | PTU | DIS | M1)) /*MCSPI4_SIMO*/\ + MUX_VAL(CP(MCBSP1_DR), (IEN | PTU | EN | M1)) /*MCSPI4_SOMI*/\ + MUX_VAL(CP(MCBSP1_FSX), (IDIS | PTU | DIS | M1)) /*MCSPI4_CS0*/ + #endif diff --git a/include/configs/omap3_beagle.h b/include/configs/omap3_beagle.h index 1c9a0075b..e7d5bd07f 100644 --- a/include/configs/omap3_beagle.h +++ b/include/configs/omap3_beagle.h @@ -152,6 +152,7 @@ #define CONFIG_SYS_I2C_SLAVE 1 #define CONFIG_SYS_I2C_BUS 0 #define CONFIG_SYS_I2C_BUS_SELECT 1 +#define CONFIG_I2C_MULTI_BUS 1 #define CONFIG_DRIVER_OMAP34XX_I2C 1 /* From 31bfcf1c5776df3d90286aa15104c45096d53dc6 Mon Sep 17 00:00:00 2001 From: Steve Sakoman Date: Wed, 27 Oct 2010 05:04:30 -0700 Subject: [PATCH 08/18] ARMV7: OMAP: Fix build after introduction of GENERATED_GBL_DATA_SIZE This patch fixes the issue by defining and using CONFIG_SYS_INIT_RAM_SIZE and CONFIG_SYS_INIT_RAM_ADDR. Based on an email discussion with Wolfgang Denk and Heiko Schocher. Signed-off-by: Steve Sakoman Signed-off-by: Sandeep Paulraj --- include/configs/igep0020.h | 6 +++++- include/configs/igep0030.h | 6 +++++- include/configs/omap3_beagle.h | 7 +++++-- include/configs/omap3_overo.h | 6 +++++- include/configs/omap4_panda.h | 6 +++++- include/configs/omap4_sdp4430.h | 6 +++++- 6 files changed, 30 insertions(+), 7 deletions(-) diff --git a/include/configs/igep0020.h b/include/configs/igep0020.h index 16d92793a..a970ad2ef 100644 --- a/include/configs/igep0020.h +++ b/include/configs/igep0020.h @@ -222,6 +222,10 @@ #endif /* (CONFIG_CMD_NET) */ #define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM_1 -#define CONFIG_SYS_INIT_SP_ADDR (LOW_LEVEL_SRAM_STACK - GENERATED_GBL_DATA_SIZE) +#define CONFIG_SYS_INIT_RAM_ADDR 0x4020f800 +#define CONFIG_SYS_INIT_RAM_SIZE 0x800 +#define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_INIT_RAM_ADDR + \ + CONFIG_SYS_INIT_RAM_SIZE - \ + GENERATED_GBL_DATA_SIZE) #endif /* __CONFIG_H */ diff --git a/include/configs/igep0030.h b/include/configs/igep0030.h index d6fbec7b1..031de35bf 100644 --- a/include/configs/igep0030.h +++ b/include/configs/igep0030.h @@ -209,6 +209,10 @@ #define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + (128 << 10)) #define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM_1 -#define CONFIG_SYS_INIT_SP_ADDR (LOW_LEVEL_SRAM_STACK - GENERATED_GBL_DATA_SIZE) +#define CONFIG_SYS_INIT_RAM_ADDR 0x4020f800 +#define CONFIG_SYS_INIT_RAM_SIZE 0x800 +#define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_INIT_RAM_ADDR + \ + CONFIG_SYS_INIT_RAM_SIZE - \ + GENERATED_GBL_DATA_SIZE) #endif /* __CONFIG_H */ diff --git a/include/configs/omap3_beagle.h b/include/configs/omap3_beagle.h index e7d5bd07f..076dd5a8a 100644 --- a/include/configs/omap3_beagle.h +++ b/include/configs/omap3_beagle.h @@ -346,8 +346,11 @@ extern unsigned int boot_flash_sec; extern unsigned int boot_flash_type; #endif -/* additions for new relocation code, must be added to all boards */ #define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM_1 -#define CONFIG_SYS_INIT_SP_ADDR (LOW_LEVEL_SRAM_STACK - GENERATED_GBL_DATA_SIZE) +#define CONFIG_SYS_INIT_RAM_ADDR 0x4020f800 +#define CONFIG_SYS_INIT_RAM_SIZE 0x800 +#define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_INIT_RAM_ADDR + \ + CONFIG_SYS_INIT_RAM_SIZE - \ + GENERATED_GBL_DATA_SIZE) #endif /* __CONFIG_H */ diff --git a/include/configs/omap3_overo.h b/include/configs/omap3_overo.h index 052d503b3..79a5b855d 100644 --- a/include/configs/omap3_overo.h +++ b/include/configs/omap3_overo.h @@ -325,6 +325,10 @@ extern unsigned int boot_flash_type; #endif /* (CONFIG_CMD_NET) */ #define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM_1 -#define CONFIG_SYS_INIT_SP_ADDR (LOW_LEVEL_SRAM_STACK - GENERATED_GBL_DATA_SIZE) +#define CONFIG_SYS_INIT_RAM_ADDR 0x4020f800 +#define CONFIG_SYS_INIT_RAM_SIZE 0x800 +#define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_INIT_RAM_ADDR + \ + CONFIG_SYS_INIT_RAM_SIZE - \ + GENERATED_GBL_DATA_SIZE) #endif /* __CONFIG_H */ diff --git a/include/configs/omap4_panda.h b/include/configs/omap4_panda.h index 74defabbf..eeab11c85 100644 --- a/include/configs/omap4_panda.h +++ b/include/configs/omap4_panda.h @@ -227,6 +227,10 @@ #define CONFIG_NR_DRAM_BANKS 1 #define CONFIG_SYS_SDRAM_BASE 0x80000000 -#define CONFIG_SYS_INIT_SP_ADDR (LOW_LEVEL_SRAM_STACK - GENERATED_GBL_DATA_SIZE) +#define CONFIG_SYS_INIT_RAM_ADDR 0x4030D800 +#define CONFIG_SYS_INIT_RAM_SIZE 0x800 +#define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_INIT_RAM_ADDR + \ + CONFIG_SYS_INIT_RAM_SIZE - \ + GENERATED_GBL_DATA_SIZE) #endif /* __CONFIG_H */ diff --git a/include/configs/omap4_sdp4430.h b/include/configs/omap4_sdp4430.h index 26c380d3e..ed0bd41f7 100644 --- a/include/configs/omap4_sdp4430.h +++ b/include/configs/omap4_sdp4430.h @@ -232,6 +232,10 @@ #define CONFIG_NR_DRAM_BANKS 1 #define CONFIG_SYS_SDRAM_BASE 0x80000000 -#define CONFIG_SYS_INIT_SP_ADDR (LOW_LEVEL_SRAM_STACK - GENERATED_GBL_DATA_SIZE) +#define CONFIG_SYS_INIT_RAM_ADDR 0x4030D800 +#define CONFIG_SYS_INIT_RAM_SIZE 0x800 +#define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_INIT_RAM_ADDR + \ + CONFIG_SYS_INIT_RAM_SIZE - \ + GENERATED_GBL_DATA_SIZE) #endif /* __CONFIG_H */ From def412b6618f5b887b80fcdad6ab4ee2fee0a110 Mon Sep 17 00:00:00 2001 From: Steve Sakoman Date: Thu, 28 Oct 2010 09:00:26 -0700 Subject: [PATCH 09/18] mmc: Clean up generic mmc driver multi-block write functions The current mmc write implementation is type ulong, but returns int values. Some of the printf's are terminated with /n/r, one has none. This patch fixes these issues and also removes some unnecessary local variables. Signed-off-by: Steve Sakoman Signed-off-by: Sandeep Paulraj --- drivers/mmc/mmc.c | 38 ++++++++++++++------------------------ 1 file changed, 14 insertions(+), 24 deletions(-) diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c index eb7bfb39e..00fe867c6 100644 --- a/drivers/mmc/mmc.c +++ b/drivers/mmc/mmc.c @@ -82,12 +82,9 @@ mmc_write_blocks(struct mmc *mmc, ulong start, lbaint_t blkcnt, const void*src) { struct mmc_cmd cmd; struct mmc_data data; - int blklen, err; - - blklen = mmc->write_bl_len; if ((start + blkcnt) > mmc->block_dev.lba) { - printf("MMC: block number 0x%lx exceeds max(0x%lx)", + printf("MMC: block number 0x%lx exceeds max(0x%lx)\n", start + blkcnt, mmc->block_dev.lba); return 0; } @@ -100,21 +97,19 @@ mmc_write_blocks(struct mmc *mmc, ulong start, lbaint_t blkcnt, const void*src) if (mmc->high_capacity) cmd.cmdarg = start; else - cmd.cmdarg = start * blklen; + cmd.cmdarg = start * mmc->write_bl_len; cmd.resp_type = MMC_RSP_R1; cmd.flags = 0; data.src = src; data.blocks = blkcnt; - data.blocksize = blklen; + data.blocksize = mmc->write_bl_len; data.flags = MMC_DATA_WRITE; - err = mmc_send_cmd(mmc, &cmd, &data); - - if (err) { - printf("mmc write failed\n\r"); - return err; + if (mmc_send_cmd(mmc, &cmd, &data)) { + printf("mmc write failed\n"); + return 0; } if (blkcnt > 1) { @@ -122,10 +117,9 @@ mmc_write_blocks(struct mmc *mmc, ulong start, lbaint_t blkcnt, const void*src) cmd.cmdarg = 0; cmd.resp_type = MMC_RSP_R1b; cmd.flags = 0; - err = mmc_send_cmd(mmc, &cmd, NULL); - if (err) { - printf("mmc fail to send stop cmd\n\r"); - return err; + if (mmc_send_cmd(mmc, &cmd, NULL)) { + printf("mmc fail to send stop cmd\n"); + return 0; } } @@ -135,18 +129,14 @@ mmc_write_blocks(struct mmc *mmc, ulong start, lbaint_t blkcnt, const void*src) static ulong mmc_bwrite(int dev_num, ulong start, lbaint_t blkcnt, const void*src) { - int err; - struct mmc *mmc = find_mmc_device(dev_num); lbaint_t cur, blocks_todo = blkcnt; + struct mmc *mmc = find_mmc_device(dev_num); if (!mmc) - return -1; + return 0; - err = mmc_set_blocklen(mmc, mmc->write_bl_len); - if (err) { - printf("set write bl len failed\n\r"); - return err; - } + if (mmc_set_blocklen(mmc, mmc->write_bl_len)) + return 0; do { /* @@ -155,7 +145,7 @@ mmc_bwrite(int dev_num, ulong start, lbaint_t blkcnt, const void*src) */ cur = (blocks_todo > 65535) ? 65535 : blocks_todo; if(mmc_write_blocks(mmc, start, cur, src) != cur) - return -1; + return 0; blocks_todo -= cur; start += cur; src += cur * mmc->write_bl_len; From 4a1a06bc8b21c6787a22458142e3ca3c06935517 Mon Sep 17 00:00:00 2001 From: Alagu Sankar Date: Mon, 25 Oct 2010 07:23:56 -0700 Subject: [PATCH 10/18] mmc: Add multi-block read support to the generic mmc driver This patch adds multi-block read support for the generic MMC driver. Large reads are broken into chunks of 65535 blocks to ensure that the code works with controllers having a 16 bit block counter. This patch results in a significant performance improvement. Time to read a 45 MB file went from 36 seconds to 9 seconds on Overo Signed-off-by: Steve Sakoman Tested-by: Steve Sakoman Signed-off-by: Sandeep Paulraj --- drivers/mmc/mmc.c | 110 ++++++++++++++++------------------------------ 1 file changed, 39 insertions(+), 71 deletions(-) diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c index 00fe867c6..6805b33f7 100644 --- a/drivers/mmc/mmc.c +++ b/drivers/mmc/mmc.c @@ -154,110 +154,78 @@ mmc_bwrite(int dev_num, ulong start, lbaint_t blkcnt, const void*src) return blkcnt; } -int mmc_read_block(struct mmc *mmc, void *dst, uint blocknum) +int mmc_read_blocks(struct mmc *mmc, void *dst, ulong start, lbaint_t blkcnt) { struct mmc_cmd cmd; struct mmc_data data; - cmd.cmdidx = MMC_CMD_READ_SINGLE_BLOCK; + if (blkcnt > 1) + cmd.cmdidx = MMC_CMD_READ_MULTIPLE_BLOCK; + else + cmd.cmdidx = MMC_CMD_READ_SINGLE_BLOCK; if (mmc->high_capacity) - cmd.cmdarg = blocknum; + cmd.cmdarg = start; else - cmd.cmdarg = blocknum * mmc->read_bl_len; + cmd.cmdarg = start * mmc->read_bl_len; cmd.resp_type = MMC_RSP_R1; cmd.flags = 0; data.dest = dst; - data.blocks = 1; + data.blocks = blkcnt; data.blocksize = mmc->read_bl_len; data.flags = MMC_DATA_READ; - return mmc_send_cmd(mmc, &cmd, &data); -} + if (mmc_send_cmd(mmc, &cmd, &data)) + return 0; -int mmc_read(struct mmc *mmc, u64 src, uchar *dst, int size) -{ - char *buffer; - int i; - int blklen = mmc->read_bl_len; - int startblock = lldiv(src, mmc->read_bl_len); - int endblock = lldiv(src + size - 1, mmc->read_bl_len); - int err = 0; - - /* Make a buffer big enough to hold all the blocks we might read */ - buffer = malloc(blklen); - - if (!buffer) { - printf("Could not allocate buffer for MMC read!\n"); - return -1; + if (blkcnt > 1) { + cmd.cmdidx = MMC_CMD_STOP_TRANSMISSION; + cmd.cmdarg = 0; + cmd.resp_type = MMC_RSP_R1b; + cmd.flags = 0; + if (mmc_send_cmd(mmc, &cmd, NULL)) { + printf("mmc fail to send stop cmd\n"); + return 0; + } } - /* We always do full block reads from the card */ - err = mmc_set_blocklen(mmc, mmc->read_bl_len); - - if (err) - goto free_buffer; - - for (i = startblock; i <= endblock; i++) { - int segment_size; - int offset; - - err = mmc_read_block(mmc, buffer, i); - - if (err) - goto free_buffer; - - /* - * The first block may not be aligned, so we - * copy from the desired point in the block - */ - offset = (src & (blklen - 1)); - segment_size = MIN(blklen - offset, size); - - memcpy(dst, buffer + offset, segment_size); - - dst += segment_size; - src += segment_size; - size -= segment_size; - } - -free_buffer: - free(buffer); - - return err; + return blkcnt; } static ulong mmc_bread(int dev_num, ulong start, lbaint_t blkcnt, void *dst) { - int err; - int i; - struct mmc *mmc = find_mmc_device(dev_num); + lbaint_t cur, blocks_todo = blkcnt; + if (blkcnt == 0) + return 0; + + struct mmc *mmc = find_mmc_device(dev_num); if (!mmc) return 0; if ((start + blkcnt) > mmc->block_dev.lba) { - printf("MMC: block number 0x%lx exceeds max(0x%lx)", + printf("MMC: block number 0x%lx exceeds max(0x%lx)\n", start + blkcnt, mmc->block_dev.lba); return 0; } - /* We always do full block reads from the card */ - err = mmc_set_blocklen(mmc, mmc->read_bl_len); - if (err) { + if (mmc_set_blocklen(mmc, mmc->read_bl_len)) return 0; - } - for (i = start; i < start + blkcnt; i++, dst += mmc->read_bl_len) { - err = mmc_read_block(mmc, dst, i); - - if (err) { - printf("block read failed: %d\n", err); - return i - start; - } - } + do { + /* + * The 65535 constraint comes from some hardware has + * only 16 bit width block number counter + */ + cur = (blocks_todo > 65535) ? 65535 : blocks_todo; + if(mmc_read_blocks(mmc, dst, start, cur) != cur) + return 0; + blocks_todo -= cur; + start += cur; + dst += cur * mmc->read_bl_len; + } while (blocks_todo > 0); return blkcnt; } From f49d7b6cab188e704444736b23bdd7a8b7dc24b4 Mon Sep 17 00:00:00 2001 From: Enric Balletbo i Serra Date: Thu, 4 Nov 2010 15:34:33 -0400 Subject: [PATCH 11/18] ARMV7: OMAP3: Use generic mmc driver on IGEP v2 This patch switches from the legacy mmc driver to the new generic mmc driver Signed-off-by: Enric Balletbo i Serra Signed-off-by: Sandeep Paulraj --- board/isee/igep0020/igep0020.c | 9 +++++++++ include/configs/igep0020.h | 3 ++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/board/isee/igep0020/igep0020.c b/board/isee/igep0020/igep0020.c index 3f7eda1a6..3ba541e21 100644 --- a/board/isee/igep0020/igep0020.c +++ b/board/isee/igep0020/igep0020.c @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include @@ -91,6 +92,14 @@ static void setup_net_chip(void) } #endif +#ifdef CONFIG_GENERIC_MMC +int board_mmc_init(bd_t *bis) +{ + omap_mmc_init(0); + return 0; +} +#endif + /* * Routine: misc_init_r * Description: Configure board specific parts diff --git a/include/configs/igep0020.h b/include/configs/igep0020.h index a970ad2ef..c19ecc0e4 100644 --- a/include/configs/igep0020.h +++ b/include/configs/igep0020.h @@ -73,8 +73,9 @@ #define CONFIG_ENV_OVERWRITE #define CONFIG_BAUDRATE 115200 #define CONFIG_SYS_BAUDRATE_TABLE {4800, 9600, 19200, 38400, 57600, 115200} +#define CONFIG_GENERIC_MMC 1 #define CONFIG_MMC 1 -#define CONFIG_OMAP3_MMC 1 +#define CONFIG_OMAP_HSMMC 1 #define CONFIG_DOS_PARTITION 1 /* DDR */ From ac657c42af6b0bbc52a382667c1ab9fc26123c99 Mon Sep 17 00:00:00 2001 From: Enric Balletbo i Serra Date: Thu, 4 Nov 2010 15:34:37 -0400 Subject: [PATCH 12/18] ARMV7: OMAP3: Use generic mmc driver on OMAP3 IGEP module This patch switches from the legacy mmc driver to the new generic mmc driver Signed-off-by: Enric Balletbo i Serra Signed-off-by: Sandeep Paulraj --- board/isee/igep0030/igep0030.c | 9 +++++++++ include/configs/igep0030.h | 3 ++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/board/isee/igep0030/igep0030.c b/board/isee/igep0030/igep0030.c index 924425911..bb4dc3ba1 100644 --- a/board/isee/igep0030/igep0030.c +++ b/board/isee/igep0030/igep0030.c @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include @@ -46,6 +47,14 @@ int board_init(void) return 0; } +#ifdef CONFIG_GENERIC_MMC +int board_mmc_init(bd_t *bis) +{ + omap_mmc_init(0); + return 0; +} +#endif + /* * Routine: misc_init_r * Description: Configure board specific parts diff --git a/include/configs/igep0030.h b/include/configs/igep0030.h index 031de35bf..d61793c33 100644 --- a/include/configs/igep0030.h +++ b/include/configs/igep0030.h @@ -73,8 +73,9 @@ #define CONFIG_ENV_OVERWRITE #define CONFIG_BAUDRATE 115200 #define CONFIG_SYS_BAUDRATE_TABLE {4800, 9600, 19200, 38400, 57600, 115200} +#define CONFIG_GENERIC_MMC 1 #define CONFIG_MMC 1 -#define CONFIG_OMAP3_MMC 1 +#define CONFIG_OMAP_HSMMC 1 #define CONFIG_DOS_PARTITION 1 /* DDR */ From 6a1e58eb6aa691ad45a36c57f1f241c25940fa0b Mon Sep 17 00:00:00 2001 From: Sanjeev Premi Date: Thu, 4 Nov 2010 16:01:46 -0400 Subject: [PATCH 13/18] omap3evm: Support relocation This patch adds relocation support for omap3evm. Content of the patch is based on changes for Beagleboard. Signed-off-by: Sanjeev Premi Signed-off-by: Sandeep Paulraj --- board/ti/evm/config.mk | 2 +- include/configs/omap3_evm.h | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/board/ti/evm/config.mk b/board/ti/evm/config.mk index b92d3b054..d173eef09 100644 --- a/board/ti/evm/config.mk +++ b/board/ti/evm/config.mk @@ -30,4 +30,4 @@ # (mem base + reserved) # For use with external or internal boots. -CONFIG_SYS_TEXT_BASE = 0x80e80000 +CONFIG_SYS_TEXT_BASE = 0x80008000 diff --git a/include/configs/omap3_evm.h b/include/configs/omap3_evm.h index e925f3bd2..3ff66b57d 100644 --- a/include/configs/omap3_evm.h +++ b/include/configs/omap3_evm.h @@ -344,6 +344,12 @@ extern unsigned int boot_flash_sec; extern unsigned int boot_flash_type; #endif +/* + * Support for relocation + */ +#define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM_1 +#define CONFIG_SYS_INIT_SP_ADDR (LOW_LEVEL_SRAM_STACK - CONFIG_SYS_GBL_DATA_SIZE) + /*---------------------------------------------------------------------------- * SMSC9115 Ethernet from SMSC9118 family *---------------------------------------------------------------------------- From 63f42400e50c7ebede2974b421db765324ad8c8e Mon Sep 17 00:00:00 2001 From: Sanjeev Premi Date: Thu, 4 Nov 2010 16:02:29 -0400 Subject: [PATCH 14/18] omap3evm: Wrap function under CONFIG_USB_OMAP3 The function omap3_evm_need_extvbus() is required only when USB support is configured. Wrapped this function in #ifdef CONFIG_USB_OMAP3. Signed-off-by: Sanjeev Premi Signed-off-by: Sandeep Paulraj --- board/ti/evm/evm.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/board/ti/evm/evm.c b/board/ti/evm/evm.c index 9948b9cd3..73330db15 100644 --- a/board/ti/evm/evm.c +++ b/board/ti/evm/evm.c @@ -64,6 +64,7 @@ static void omap3_evm_get_revision(void) } } +#ifdef CONFIG_USB_OMAP3 /* * MUSB port on OMAP3EVM Rev >= E requires extvbus programming. */ @@ -76,6 +77,7 @@ u8 omap3_evm_need_extvbus(void) return retval; } +#endif /* * Routine: board_init From 76ee9a2c3ba0b642e61ad282386953fcdfc659c7 Mon Sep 17 00:00:00 2001 From: Sanjeev Premi Date: Thu, 4 Nov 2010 16:02:32 -0400 Subject: [PATCH 15/18] omap3evm: Fix mechanism to identify board revision Function omap3_evm_get_revision() - to identify the board revision was called at end of setup_net_chip(). Board revision can be ascertained only by identifying the Ethernet chipset - but combining setup operations with revision detection isn't a good idea. So, moved the function after call to setup_net_chip(). Function setup_net_chip() should be ideally be called only when CONFIG_CMD_NET is defined. But this leaves the board revision "undetected". This patch allows static definition of revision or default fallback to the latest revision. Signed-off-by: Sanjeev Premi Signed-off-by: Sandeep Paulraj --- board/ti/evm/evm.c | 22 +++++++++++++++++++--- board/ti/evm/evm.h | 2 ++ include/configs/omap3_evm.h | 5 +++++ 3 files changed, 26 insertions(+), 3 deletions(-) diff --git a/board/ti/evm/evm.c b/board/ti/evm/evm.c index 73330db15..09d14f7a5 100644 --- a/board/ti/evm/evm.c +++ b/board/ti/evm/evm.c @@ -46,6 +46,11 @@ u8 get_omap3_evm_rev(void) static void omap3_evm_get_revision(void) { +#if defined(CONFIG_CMD_NET) + /* + * Board revision can be ascertained only by identifying + * the Ethernet chipset. + */ unsigned int smsc_id; /* Ethernet PHY ID is stored at ID_REV register */ @@ -62,6 +67,19 @@ static void omap3_evm_get_revision(void) default: omap3_evm_version = OMAP3EVM_BOARD_GEN_2; } +#else +#if defined(CONFIG_STATIC_BOARD_REV) + /* + * Look for static defintion of the board revision + */ + omap3_evm_version = CONFIG_STATIC_BOARD_REV; +#else + /* + * Fallback to the default above. + */ + omap3_evm_version = OMAP3EVM_BOARD_GEN_2; +#endif +#endif /* CONFIG_CMD_NET */ } #ifdef CONFIG_USB_OMAP3 @@ -110,6 +128,7 @@ int misc_init_r(void) #if defined(CONFIG_CMD_NET) setup_net_chip(); #endif + omap3_evm_get_revision(); dieid_num_r(); @@ -163,9 +182,6 @@ static void setup_net_chip(void) writel(GPIO0, &gpio3_base->cleardataout); udelay(1); writel(GPIO0, &gpio3_base->setdataout); - - /* determine omap3evm revision */ - omap3_evm_get_revision(); } int board_eth_init(bd_t *bis) diff --git a/board/ti/evm/evm.h b/board/ti/evm/evm.h index e2581f6bf..a76deb838 100644 --- a/board/ti/evm/evm.h +++ b/board/ti/evm/evm.h @@ -47,7 +47,9 @@ enum { u8 get_omap3_evm_rev(void); +#if defined(CONFIG_CMD_NET) static void setup_net_chip(void); +#endif /* * IEN - Input Enable diff --git a/include/configs/omap3_evm.h b/include/configs/omap3_evm.h index 3ff66b57d..aeb45c6b6 100644 --- a/include/configs/omap3_evm.h +++ b/include/configs/omap3_evm.h @@ -350,6 +350,11 @@ extern unsigned int boot_flash_type; #define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM_1 #define CONFIG_SYS_INIT_SP_ADDR (LOW_LEVEL_SRAM_STACK - CONFIG_SYS_GBL_DATA_SIZE) +/* + * Define the board revision statically + */ +/* #define CONFIG_STATIC_BOARD_REV OMAP3EVM_BOARD_GEN_2 */ + /*---------------------------------------------------------------------------- * SMSC9115 Ethernet from SMSC9118 family *---------------------------------------------------------------------------- From 0fc43a417c4ba5ab63dad6736a18f3bf7008f35f Mon Sep 17 00:00:00 2001 From: Heiko Schocher Date: Thu, 4 Nov 2010 16:05:25 -0400 Subject: [PATCH 16/18] armv7, beagle: Second SDRAM bank don;t work since commit 3667cbeed5e3c4067e624e52a916b1ebb02c8f05 on beagle board the second sdram bank didn;t longer work. Since this patch sdram settings just get copied from bank a, but CMD_NOP, CMD_PRECHARGE, CMD_AUTOREFRESH are not executed and after that mr register is also not updated. This patch adds this for the bank b. Signed-off-by: Heiko Schocher cc: Steve Sakoman cc: Sandeep Paulraj cc: Wolfgang Denk Signed-off-by: Sandeep Paulraj --- arch/arm/cpu/armv7/omap3/sdrc.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/arch/arm/cpu/armv7/omap3/sdrc.c b/arch/arm/cpu/armv7/omap3/sdrc.c index c75aa1d11..a4979ce61 100644 --- a/arch/arm/cpu/armv7/omap3/sdrc.c +++ b/arch/arm/cpu/armv7/omap3/sdrc.c @@ -149,6 +149,13 @@ void do_sdrc_init(u32 cs, u32 early) &sdrc_actim_base1->ctrla); writel(readl(&sdrc_actim_base0->ctrlb), &sdrc_actim_base1->ctrlb); + + writel(CMD_NOP, &sdrc_base->cs[cs].manual); + writel(CMD_PRECHARGE, &sdrc_base->cs[cs].manual); + writel(CMD_AUTOREFRESH, &sdrc_base->cs[cs].manual); + writel(CMD_AUTOREFRESH, &sdrc_base->cs[cs].manual); + writel(readl(&sdrc_base->cs[CS0].mr), + &sdrc_base->cs[CS1].mr); } /* From aaeb0a890a050b58be87fa2b165eec5fa947dc86 Mon Sep 17 00:00:00 2001 From: Albert Aribaud Date: Mon, 15 Nov 2010 21:46:03 +0100 Subject: [PATCH 17/18] ARM: fix linker file for newer ld support older ld emitted all ELF relocations in input sections named .rel.dyn, whereas newer ld uses names of the form .rel*. The linker script only collected .rel.dyn input sections. Rewrite to collect all .rel* input sections. Signed-off-by: Albert Aribaud --- arch/arm/cpu/arm1136/start.S | 16 ----------- arch/arm/cpu/arm1136/u-boot.lds | 38 ++++++++++++------------ arch/arm/cpu/arm1176/u-boot.lds | 37 ++++++++++++------------ arch/arm/cpu/arm926ejs/u-boot.lds | 30 +++++++++++-------- arch/arm/cpu/armv7/start.S | 24 ---------------- arch/arm/cpu/armv7/u-boot.lds | 48 +++++++++++++++++-------------- arch/arm/cpu/pxa/u-boot.lds | 35 +++++++++++++++------- 7 files changed, 106 insertions(+), 122 deletions(-) diff --git a/arch/arm/cpu/arm1136/start.S b/arch/arm/cpu/arm1136/start.S index aecc943c8..eec8bee7e 100644 --- a/arch/arm/cpu/arm1136/start.S +++ b/arch/arm/cpu/arm1136/start.S @@ -104,22 +104,6 @@ _bss_start_ofs: _bss_end_ofs: .word _end - _start -.globl _datarel_start_ofs -_datarel_start_ofs: - .word __datarel_start - _start - -.globl _datarelrolocal_start_ofs -_datarelrolocal_start_ofs: - .word __datarelrolocal_start - _start - -.globl _datarellocal_start_ofs -_datarellocal_start_ofs: - .word __datarellocal_start - _start - -.globl _datarelro_start_ofs -_datarelro_start_ofs: - .word __datarelro_start - _start - #ifdef CONFIG_USE_IRQ /* IRQ stack memory (calculated at run-time) */ .globl IRQ_STACK_START diff --git a/arch/arm/cpu/arm1136/u-boot.lds b/arch/arm/cpu/arm1136/u-boot.lds index 31f43f0e0..253adbe47 100644 --- a/arch/arm/cpu/arm1136/u-boot.lds +++ b/arch/arm/cpu/arm1136/u-boot.lds @@ -20,7 +20,8 @@ * * 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 + * 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 @@ -49,23 +50,9 @@ SECTIONS . = ALIGN(4); .data : { *(.data) - __datarel_start = .; - *(.data.rel) - __datarelrolocal_start = .; - *(.data.rel.ro.local) - __datarellocal_start = .; - *(.data.rel.local) - __datarelro_start = .; - *(.data.rel.ro) } . = ALIGN(4); - __rel_dyn_start = .; - .rel.dyn : { *(.rel.dyn) } - __rel_dyn_end = .; - - __dynsym_start = .; - .dynsym : { *(.dynsym) } . = .; __u_boot_cmd_start = .; @@ -73,9 +60,24 @@ SECTIONS __u_boot_cmd_end = .; . = ALIGN(4); - __bss_start = .; - .bss (NOLOAD) : { *(.bss) . = ALIGN(4); } - _end = .; + + .rel.dyn : { + __rel_dyn_start = .; + *(.rel*) + __rel_dyn_end = .; + } + + .dynsym : { + __dynsym_start = .; + *(.dynsym) + } + + .bss __rel_dyn_start (OVERLAY) : { + __bss_start = .; + *(.bss) + . = ALIGN(4); + _end = .; + } /DISCARD/ : { *(.dynstr*) } /DISCARD/ : { *(.dynamic*) } diff --git a/arch/arm/cpu/arm1176/u-boot.lds b/arch/arm/cpu/arm1176/u-boot.lds index d9ed95405..fe3180053 100644 --- a/arch/arm/cpu/arm1176/u-boot.lds +++ b/arch/arm/cpu/arm1176/u-boot.lds @@ -41,33 +41,32 @@ SECTIONS . = ALIGN(4); .data : { *(.data) - __datarel_start = .; - *(.data.rel) - __datarelrolocal_start = .; - *(.data.rel.ro.local) - __datarellocal_start = .; - *(.data.rel.local) - __datarelro_start = .; - *(.data.rel.ro) } - . = ALIGN(4); - __rel_dyn_start = .; - .rel.dyn : { *(.rel.dyn) } - __rel_dyn_end = .; - - __dynsym_start = .; - .dynsym : { *(.dynsym) } - . = .; __u_boot_cmd_start = .; .u_boot_cmd : { *(.u_boot_cmd) } __u_boot_cmd_end = .; . = ALIGN(4); - __bss_start = .; - .bss (NOLOAD) : { *(.bss) . = ALIGN(4); } - _end = .; + + .rel.dyn : { + __rel_dyn_start = .; + *(.rel*) + __rel_dyn_end = .; + } + + .dynsym : { + __dynsym_start = .; + *(.dynsym) + } + + .bss __rel_dyn_start (OVERLAY) : { + __bss_start = .; + *(.bss) + . = ALIGN(4); + _end = .; + } /DISCARD/ : { *(.dynstr*) } /DISCARD/ : { *(.dynamic*) } diff --git a/arch/arm/cpu/arm926ejs/u-boot.lds b/arch/arm/cpu/arm926ejs/u-boot.lds index 72f45f800..28c91f937 100644 --- a/arch/arm/cpu/arm926ejs/u-boot.lds +++ b/arch/arm/cpu/arm926ejs/u-boot.lds @@ -45,24 +45,30 @@ SECTIONS . = ALIGN(4); - __rel_dyn_start = .; - .rel.dyn : { *(.rel.dyn) } - __rel_dyn_end = .; - - __dynsym_start = .; - .dynsym : { *(.dynsym) } - - . = ALIGN(4); - . = .; __u_boot_cmd_start = .; .u_boot_cmd : { *(.u_boot_cmd) } __u_boot_cmd_end = .; . = ALIGN(4); - __bss_start = .; - .bss (NOLOAD) : { *(.bss) . = ALIGN(4); } - _end = .; + + .rel.dyn : { + __rel_dyn_start = .; + *(.rel*) + __rel_dyn_end = .; + } + + .dynsym : { + __dynsym_start = .; + *(.dynsym) + } + + .bss __rel_dyn_start (OVERLAY) : { + __bss_start = .; + *(.bss) + . = ALIGN(4); + _end = .; + } /DISCARD/ : { *(.dynstr*) } /DISCARD/ : { *(.dynamic*) } diff --git a/arch/arm/cpu/armv7/start.S b/arch/arm/cpu/armv7/start.S index bb3948d40..2dfdafe98 100644 --- a/arch/arm/cpu/armv7/start.S +++ b/arch/arm/cpu/armv7/start.S @@ -98,30 +98,6 @@ FIQ_STACK_START: IRQ_STACK_START_IN: .word 0x0badc0de -.globl _datarel_start_ofs -_datarel_start_ofs: - .word __datarel_start - _start - -.globl _datarelrolocal_start_ofs -_datarelrolocal_start_ofs: - .word __datarelrolocal_start - _start - -.globl _datarellocal_start_ofs -_datarellocal_start_ofs: - .word __datarellocal_start - _start - -.globl _datarelro_start_ofs -_datarelro_start_ofs: - .word __datarelro_start - _start - -.globl _got_start_ofs -_got_start_ofs: - .word __got_start - _start - -.globl _got_end_Ofs -_got_end_ofs: - .word __got_end - _start - /* * the actual reset code */ diff --git a/arch/arm/cpu/armv7/u-boot.lds b/arch/arm/cpu/armv7/u-boot.lds index 88a0fecd8..5725c30c6 100644 --- a/arch/arm/cpu/armv7/u-boot.lds +++ b/arch/arm/cpu/armv7/u-boot.lds @@ -44,34 +44,38 @@ SECTIONS . = ALIGN(4); .data : { *(.data) - __datarel_start = .; - *(.data.rel) - __datarelrolocal_start = .; - *(.data.rel.ro.local) - __datarellocal_start = .; - *(.data.rel.local) - __datarelro_start = .; - *(.data.rel.ro) } + . = ALIGN(4); - __rel_dyn_start = .; - .rel.dyn : { *(.rel.dyn) } - __rel_dyn_end = .; - - __dynsym_start = .; - .dynsym : { *(.dynsym) } - - __got_start = .; - . = ALIGN(4); - .got : { *(.got) } - __got_end = .; + . = .; __u_boot_cmd_start = .; .u_boot_cmd : { *(.u_boot_cmd) } __u_boot_cmd_end = .; . = ALIGN(4); - __bss_start = .; - .bss : { *(.bss) } - _end = .; + + .rel.dyn : { + __rel_dyn_start = .; + *(.rel*) + __rel_dyn_end = .; + } + + .dynsym : { + __dynsym_start = .; + *(.dynsym) + } + + .bss __rel_dyn_start (OVERLAY) : { + __bss_start = .; + *(.bss) + . = ALIGN(4); + _end = .; + } + + /DISCARD/ : { *(.dynstr*) } + /DISCARD/ : { *(.dynamic*) } + /DISCARD/ : { *(.plt*) } + /DISCARD/ : { *(.interp*) } + /DISCARD/ : { *(.gnu*) } } diff --git a/arch/arm/cpu/pxa/u-boot.lds b/arch/arm/cpu/pxa/u-boot.lds index d6643f952..0818d0b6e 100644 --- a/arch/arm/cpu/pxa/u-boot.lds +++ b/arch/arm/cpu/pxa/u-boot.lds @@ -43,14 +43,6 @@ SECTIONS *(.data) } - . = ALIGN(4); - __rel_dyn_start = .; - .rel.dyn : { *(.rel.dyn) } - __rel_dyn_end = .; - - __dynsym_start = .; - .dynsym : { *(.dynsym) } - . = ALIGN(4); . = .; @@ -59,7 +51,28 @@ SECTIONS __u_boot_cmd_end = .; . = ALIGN(4); - __bss_start = .; - .bss (NOLOAD) : { *(.bss) . = ALIGN(4); } - _end = .; + + .rel.dyn : { + __rel_dyn_start = .; + *(.rel*) + __rel_dyn_end = .; + } + + .dynsym : { + __dynsym_start = .; + *(.dynsym) + } + + .bss __rel_dyn_start (OVERLAY) : { + __bss_start = .; + *(.bss) + . = ALIGN(4); + _end = .; + } + + /DISCARD/ : { *(.dynstr*) } + /DISCARD/ : { *(.dynamic*) } + /DISCARD/ : { *(.plt*) } + /DISCARD/ : { *(.interp*) } + /DISCARD/ : { *(.gnu*) } } From 858ecd9ac3434e011e84d5fd9013bd1ee199dbdc Mon Sep 17 00:00:00 2001 From: Albert Aribaud Date: Mon, 15 Nov 2010 21:46:04 +0100 Subject: [PATCH 18/18] tx25: fix linker file for newer ld support older ld emitted all ELF relocations in input sections named .rel.dyn, whereas newer ld uses names of the form .rel*. The linker script only collected .rel.dyn input sections. Rewrite to collect all .rel* input sections. Signed-off-by: Albert Aribaud --- nand_spl/board/karo/tx25/u-boot.lds | 40 ++++++++++++++--------------- 1 file changed, 19 insertions(+), 21 deletions(-) diff --git a/nand_spl/board/karo/tx25/u-boot.lds b/nand_spl/board/karo/tx25/u-boot.lds index 5f95c874f..ff289fb3c 100644 --- a/nand_spl/board/karo/tx25/u-boot.lds +++ b/nand_spl/board/karo/tx25/u-boot.lds @@ -43,35 +43,33 @@ SECTIONS . = ALIGN(4); .data : { *(.data) - __datarel_start = .; - *(.data.rel) - __datarelrolocal_start = .; - *(.data.rel.ro.local) - __datarellocal_start = .; - *(.data.rel.local) - __datarelro_start = .; - *(.data.rel.ro) } . = ALIGN(4); - __rel_dyn_start = .; - __rel_dyn_end = .; - __dynsym_start = .; - - __got_start = .; - . = ALIGN(4); - .got : { *(.got) } - - __got_end = .; - . = .; __u_boot_cmd_start = .; .u_boot_cmd : { *(.u_boot_cmd) } __u_boot_cmd_end = .; . = ALIGN(4); - __bss_start = .; - .bss : { *(.bss) } - _end = .; + + .rel.dyn : { + __rel_dyn_start = .; + *(.rel*) + __rel_dyn_end = .; + } + + .dynsym : { + __dynsym_start = .; + *(.dynsym) + } + + .bss __rel_dyn_start (OVERLAY) : { + __bss_start = .; + *(.bss) + . = ALIGN(4); + _end = .; + } + /DISCARD/ : { *(.bss*) } /DISCARD/ : { *(.dynstr*) } /DISCARD/ : { *(.dynsym*) }