From a711edfae15cdf91b14bfb81e403230fa06c544d Mon Sep 17 00:00:00 2001 From: Steve Sakoman Date: Thu, 21 Oct 2010 06:11:53 -0700 Subject: 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(-) (limited to 'board') 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 + -- cgit v1.2.3 From d64b5b89159dad129e4e07d4267c549b6d473386 Mon Sep 17 00:00:00 2001 From: Steve Sakoman Date: Mon, 20 Sep 2010 08:05:14 -0700 Subject: 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 ++ 2 files changed, 119 insertions(+) (limited to 'board') 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 -- cgit v1.2.3 From ca5f80ae97cdd211f9e6413369aaadee944f8cb6 Mon Sep 17 00:00:00 2001 From: Koen Kooi Date: Mon, 20 Sep 2010 10:21:33 -0700 Subject: 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 ++++++++++++++++++++++- 2 files changed, 139 insertions(+), 2 deletions(-) (limited to 'board') 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 -- cgit v1.2.3 From f49d7b6cab188e704444736b23bdd7a8b7dc24b4 Mon Sep 17 00:00:00 2001 From: Enric Balletbo i Serra Date: Thu, 4 Nov 2010 15:34:33 -0400 Subject: 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 +++++++++ 1 file changed, 9 insertions(+) (limited to 'board') 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 -- cgit v1.2.3 From ac657c42af6b0bbc52a382667c1ab9fc26123c99 Mon Sep 17 00:00:00 2001 From: Enric Balletbo i Serra Date: Thu, 4 Nov 2010 15:34:37 -0400 Subject: 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 +++++++++ 1 file changed, 9 insertions(+) (limited to 'board') 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 -- cgit v1.2.3 From 6a1e58eb6aa691ad45a36c57f1f241c25940fa0b Mon Sep 17 00:00:00 2001 From: Sanjeev Premi Date: Thu, 4 Nov 2010 16:01:46 -0400 Subject: 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 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'board') 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 -- cgit v1.2.3 From 63f42400e50c7ebede2974b421db765324ad8c8e Mon Sep 17 00:00:00 2001 From: Sanjeev Premi Date: Thu, 4 Nov 2010 16:02:29 -0400 Subject: 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(+) (limited to 'board') 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 -- cgit v1.2.3 From 76ee9a2c3ba0b642e61ad282386953fcdfc659c7 Mon Sep 17 00:00:00 2001 From: Sanjeev Premi Date: Thu, 4 Nov 2010 16:02:32 -0400 Subject: 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 ++ 2 files changed, 21 insertions(+), 3 deletions(-) (limited to 'board') 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 -- cgit v1.2.3