diff options
Diffstat (limited to 'board')
-rw-r--r-- | board/isee/igep00x0/igep00x0.h | 7 | ||||
-rw-r--r-- | board/matrix_vision/mvblx/fpga.c | 14 | ||||
-rw-r--r-- | board/matrix_vision/mvblx/sys_eeprom.c | 24 | ||||
-rw-r--r-- | board/phytec/pcm051/mux.c | 1 | ||||
-rw-r--r-- | board/ti/am335x/board.c | 38 | ||||
-rw-r--r-- | board/ti/beagle/beagle.c | 14 |
6 files changed, 77 insertions, 21 deletions
diff --git a/board/isee/igep00x0/igep00x0.h b/board/isee/igep00x0/igep00x0.h index ea1e9ac..5ef22ae 100644 --- a/board/isee/igep00x0/igep00x0.h +++ b/board/isee/igep00x0/igep00x0.h @@ -34,10 +34,13 @@ const omap3_sysinfo sysinfo = { DDR_STACKED, #if (CONFIG_MACH_TYPE == MACH_TYPE_IGEP0020) - "OMAP3 IGEP v2 board", + "IGEPv2", #endif #if (CONFIG_MACH_TYPE == MACH_TYPE_IGEP0030) - "OMAP3 IGEP COM Module", + "IGEP COM MODULE/ELECTRON", +#endif +#if (CONFIG_MACH_TYPE == MACH_TYPE_IGEP0032) + "IGEP COM PROTON", #endif #if defined(CONFIG_ENV_IS_IN_ONENAND) "ONENAND", diff --git a/board/matrix_vision/mvblx/fpga.c b/board/matrix_vision/mvblx/fpga.c index dacc138..3fcf968 100644 --- a/board/matrix_vision/mvblx/fpga.c +++ b/board/matrix_vision/mvblx/fpga.c @@ -31,6 +31,7 @@ #include <ACEX1K.h> #include <command.h> #include <asm/gpio.h> +#include <linux/byteorder/generic.h> #include "fpga.h" #ifdef FPGA_DEBUG @@ -209,9 +210,20 @@ int fpga_wr_fn(const void *buf, size_t len, int flush, int cookie) { unsigned char *data = (unsigned char *) buf; int i; + int headerlen = len - cyclone2.size; + + if (headerlen < 0) + return FPGA_FAIL; + else if (headerlen == sizeof(uint32_t)) { + const unsigned int fpgavers_len = 11; /* '0x' + 8 hex digits + \0 */ + char fpgavers_str[fpgavers_len]; + snprintf(fpgavers_str, fpgavers_len, "0x%08x", + be32_to_cpup((uint32_t*)data)); + setenv("fpgavers", fpgavers_str); + } fpga_debug("fpga_wr: buf %p / size %d\n", buf, len); - for (i = 0; i < len; i++) + for (i = headerlen; i < len; i++) _write_fpga(data[i]); fpga_debug("-%s\n", __func__); diff --git a/board/matrix_vision/mvblx/sys_eeprom.c b/board/matrix_vision/mvblx/sys_eeprom.c index 945a36d..15269c6 100644 --- a/board/matrix_vision/mvblx/sys_eeprom.c +++ b/board/matrix_vision/mvblx/sys_eeprom.c @@ -326,10 +326,28 @@ int do_mac(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) return 0; } +static inline int is_portrait(void) +{ + int i; + unsigned int orient_index = 0; /* idx of char which determines orientation */ + + for (i = sizeof(e.id)/sizeof(*e.id) - 1; i>=0; i--) { + if (e.id[i] == '-') { + orient_index = i+1; + break; + } + } + + return (orient_index && + (e.id[orient_index] >= '5') && (e.id[orient_index] <= '8')); +} + int mac_read_from_eeprom(void) { u32 crc, crc_offset = offsetof(struct eeprom, crc); u32 *crcp; /* Pointer to the CRC in the data read from the EEPROM */ +#define FILENAME_LANDSCAPE "mvBlueLynx_X.rbf" +#define FILENAME_PORTRAIT "mvBlueLynx_X_sensor_cd.rbf" if (read_eeprom()) { printf("EEPROM Read failed.\n"); @@ -374,6 +392,12 @@ int mac_read_from_eeprom(void) setenv("serial#", serial_num); } + /* decide which fpga file to load depending on orientation */ + if (is_portrait()) + setenv("fpgafilename", FILENAME_PORTRAIT); + else + setenv("fpgafilename", FILENAME_LANDSCAPE); + /* TODO should I calculate CRC here? */ return 0; } diff --git a/board/phytec/pcm051/mux.c b/board/phytec/pcm051/mux.c index 4d3a1d5..6e9c3d2 100644 --- a/board/phytec/pcm051/mux.c +++ b/board/phytec/pcm051/mux.c @@ -35,7 +35,6 @@ static struct module_pin_mux mmc0_pin_mux[] = { {OFFSET(mmc0_dat0), (MODE(0) | RXACTIVE | PULLUP_EN)}, /* MMC0_DAT0 */ {OFFSET(mmc0_clk), (MODE(0) | RXACTIVE | PULLUP_EN)}, /* MMC0_CLK */ {OFFSET(mmc0_cmd), (MODE(0) | RXACTIVE | PULLUP_EN)}, /* MMC0_CMD */ - {OFFSET(mcasp0_aclkr), (MODE(4) | RXACTIVE)}, /* MMC0_WP */ {OFFSET(spi0_cs1), (MODE(5) | RXACTIVE | PULLUP_EN)}, /* MMC0_CD */ {-1}, }; diff --git a/board/ti/am335x/board.c b/board/ti/am335x/board.c index 48e6896..441758f 100644 --- a/board/ti/am335x/board.c +++ b/board/ti/am335x/board.c @@ -389,7 +389,8 @@ int board_late_init(void) } #endif -#ifdef CONFIG_DRIVER_TI_CPSW +#if (defined(CONFIG_DRIVER_TI_CPSW) && !defined(CONFIG_SPL_BUILD)) || \ + (defined(CONFIG_SPL_ETH_SUPPORT) && defined(CONFIG_SPL_BUILD)) static void cpsw_control(int enabled) { /* VTP can be added here */ @@ -434,26 +435,26 @@ static struct cpsw_platform_data cpsw_data = { int board_eth_init(bd_t *bis) { int rv, n = 0; -#ifdef CONFIG_DRIVER_TI_CPSW uint8_t mac_addr[6]; uint32_t mac_hi, mac_lo; - if (!eth_getenv_enetaddr("ethaddr", mac_addr)) { - printf("<ethaddr> not set. Reading from E-fuse\n"); - /* try reading mac address from efuse */ - mac_lo = readl(&cdev->macid0l); - mac_hi = readl(&cdev->macid0h); - mac_addr[0] = mac_hi & 0xFF; - mac_addr[1] = (mac_hi & 0xFF00) >> 8; - mac_addr[2] = (mac_hi & 0xFF0000) >> 16; - mac_addr[3] = (mac_hi & 0xFF000000) >> 24; - mac_addr[4] = mac_lo & 0xFF; - mac_addr[5] = (mac_lo & 0xFF00) >> 8; + /* try reading mac address from efuse */ + mac_lo = readl(&cdev->macid0l); + mac_hi = readl(&cdev->macid0h); + mac_addr[0] = mac_hi & 0xFF; + mac_addr[1] = (mac_hi & 0xFF00) >> 8; + mac_addr[2] = (mac_hi & 0xFF0000) >> 16; + mac_addr[3] = (mac_hi & 0xFF000000) >> 24; + mac_addr[4] = mac_lo & 0xFF; + mac_addr[5] = (mac_lo & 0xFF00) >> 8; + +#if (defined(CONFIG_DRIVER_TI_CPSW) && !defined(CONFIG_SPL_BUILD)) || \ + (defined(CONFIG_SPL_ETH_SUPPORT) && defined(CONFIG_SPL_BUILD)) + if (!getenv("ethaddr")) { + printf("<ethaddr> not set. Validating first E-fuse MAC\n"); if (is_valid_ether_addr(mac_addr)) eth_setenv_enetaddr("ethaddr", mac_addr); - else - goto try_usbether; } if (board_is_bone() || board_is_bone_lt() || board_is_idk()) { @@ -494,8 +495,11 @@ int board_eth_init(bd_t *bis) AR8051_RGMII_TX_CLK_DLY); } #endif -try_usbether: -#if defined(CONFIG_USB_ETHER) && !defined(CONFIG_SPL_BUILD) +#if defined(CONFIG_USB_ETHER) && \ + (!defined(CONFIG_SPL_BUILD) || defined(CONFIG_SPL_USBETH_SUPPORT)) + if (is_valid_ether_addr(mac_addr)) + eth_setenv_enetaddr("usbnet_devaddr", mac_addr); + rv = usb_eth_initialize(bis); if (rv < 0) printf("Error %d registering USB_ETHER\n", rv); diff --git a/board/ti/beagle/beagle.c b/board/ti/beagle/beagle.c index b829a79..58bd556 100644 --- a/board/ti/beagle/beagle.c +++ b/board/ti/beagle/beagle.c @@ -72,6 +72,7 @@ #define BBTOYS_LCD 0x03000B00 #define BCT_BRETTL3 0x01000F00 #define BCT_BRETTL4 0x02000F00 +#define LSR_COM6L_ADPT 0x01001300 #define BEAGLE_NO_EEPROM 0xffffffff DECLARE_GLOBAL_DATA_PTR; @@ -227,6 +228,14 @@ static unsigned int get_expansion_id(void) i2c_read(EXPANSION_EEPROM_I2C_ADDRESS, 0, 1, (u8 *)&expansion_config, sizeof(expansion_config)); + /* retry reading configuration data with 16bit addressing */ + if ((expansion_config.device_vendor == 0xFFFFFF00) || + (expansion_config.device_vendor == 0xFFFFFFFF)) { + printf("EEPROM is blank or 8bit addressing failed: retrying with 16bit:\n"); + i2c_read(EXPANSION_EEPROM_I2C_ADDRESS, 0, 2, (u8 *)&expansion_config, + sizeof(expansion_config)); + } + i2c_set_bus_num(TWL4030_I2C_BUS); return expansion_config.device_vendor; @@ -454,6 +463,11 @@ int misc_init_r(void) case BCT_BRETTL4: printf("Recognized bct electronic GmbH brettl4 board\n"); break; + case LSR_COM6L_ADPT: + printf("Recognized LSR COM6L Adapter Board\n"); + MUX_BBTOYS_WIFI() + setenv("buddy", "lsr-com6l-adpt"); + break; case BEAGLE_NO_EEPROM: printf("No EEPROM on expansion board\n"); setenv("buddy", "none"); |