diff options
Diffstat (limited to 'board/ti')
-rw-r--r-- | board/ti/beagle/beagle.c | 95 | ||||
-rw-r--r-- | board/ti/beagle/beagle.h | 46 | ||||
-rw-r--r-- | board/ti/evm/config.mk | 2 | ||||
-rw-r--r-- | board/ti/evm/evm.c | 24 | ||||
-rw-r--r-- | board/ti/evm/evm.h | 2 |
5 files changed, 163 insertions, 6 deletions
diff --git a/board/ti/beagle/beagle.c b/board/ti/beagle/beagle.c index c5d6679..d9b6f01 100644 --- a/board/ti/beagle/beagle.c +++ b/board/ti/beagle/beagle.c @@ -39,6 +39,27 @@ #include <asm/mach-types.h> #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. @@ -95,6 +116,31 @@ int get_board_revision(void) } /* + * 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 ec0da6d..b22b653 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/board/ti/evm/config.mk b/board/ti/evm/config.mk index b92d3b0..d173eef 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/board/ti/evm/evm.c b/board/ti/evm/evm.c index 9948b9c..09d14f7 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,8 +67,22 @@ 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 /* * MUSB port on OMAP3EVM Rev >= E requires extvbus programming. */ @@ -76,6 +95,7 @@ u8 omap3_evm_need_extvbus(void) return retval; } +#endif /* * Routine: board_init @@ -108,6 +128,7 @@ int misc_init_r(void) #if defined(CONFIG_CMD_NET) setup_net_chip(); #endif + omap3_evm_get_revision(); dieid_num_r(); @@ -161,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 e2581f6..a76deb8 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 |