From 71c4ae3f6db39b888497923573bff215b64a36bd Mon Sep 17 00:00:00 2001 From: Michael Jones Date: Thu, 7 Feb 2013 23:53:36 +0000 Subject: omap3: mvblx: select fpgafilename according to orientation Rather than load the FPGA file from the FAT partition, look at entry in system EEPROM to decide which file to retrieve directly from the EXT3 partition. Signed-off-by: Michael Jones --- board/matrix_vision/mvblx/sys_eeprom.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'board/matrix_vision') 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; } -- cgit v1.1 From bb4d46455c017e40e2c5d78ad78465a270565f9e Mon Sep 17 00:00:00 2001 From: Michael Jones Date: Thu, 7 Feb 2013 23:53:37 +0000 Subject: omap3: mvblx: pass FPGA version to the kernel Extract FPGA version from the .rbf and pass this info to the kernel. Signed-off-by: Michael Jones --- board/matrix_vision/mvblx/fpga.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'board/matrix_vision') 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 #include #include +#include #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__); -- cgit v1.1 From e874d5b001e9d7ea0fc7596ef0fe6dd520ed8ec6 Mon Sep 17 00:00:00 2001 From: Nikita Kiryanov Date: Mon, 3 Dec 2012 02:19:44 +0000 Subject: omap_hsmmc: implement driver check for card detection Implement driver check for card detection. Signed-off-by: Nikita Kiryanov Signed-off-by: Igor Grinberg --- board/matrix_vision/mvblx/mvblx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'board/matrix_vision') diff --git a/board/matrix_vision/mvblx/mvblx.c b/board/matrix_vision/mvblx/mvblx.c index f68f312..cb1e0c8 100644 --- a/board/matrix_vision/mvblx/mvblx.c +++ b/board/matrix_vision/mvblx/mvblx.c @@ -106,8 +106,8 @@ void set_muxconf_regs(void) #ifdef CONFIG_GENERIC_MMC int board_mmc_init(bd_t *bis) { - omap_mmc_init(0, 0, 0); - omap_mmc_init(1, 0, 0); + omap_mmc_init(0, 0, 0, -1); + omap_mmc_init(1, 0, 0, -1); return 0; } #endif -- cgit v1.1 From e3913f56a26dbb49758370320dac477ab0324631 Mon Sep 17 00:00:00 2001 From: Nikita Kiryanov Date: Mon, 3 Dec 2012 02:19:47 +0000 Subject: omap_hsmmc: add driver check for write protection Add check for write protection in omap mmc driver. Signed-off-by: Nikita Kiryanov Signed-off-by: Igor Grinberg Reviewed-by: Tom Rini --- board/matrix_vision/mvblx/mvblx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'board/matrix_vision') diff --git a/board/matrix_vision/mvblx/mvblx.c b/board/matrix_vision/mvblx/mvblx.c index cb1e0c8..49af384 100644 --- a/board/matrix_vision/mvblx/mvblx.c +++ b/board/matrix_vision/mvblx/mvblx.c @@ -106,8 +106,8 @@ void set_muxconf_regs(void) #ifdef CONFIG_GENERIC_MMC int board_mmc_init(bd_t *bis) { - omap_mmc_init(0, 0, 0, -1); - omap_mmc_init(1, 0, 0, -1); + omap_mmc_init(0, 0, 0, -1, -1); + omap_mmc_init(1, 0, 0, -1, -1); return 0; } #endif -- cgit v1.1 From ef123c525370463254a6f8e67563fdb0b0b46412 Mon Sep 17 00:00:00 2001 From: Albert ARIBAUD Date: Mon, 25 Feb 2013 00:59:00 +0000 Subject: Refactor linker-generated arrays Refactor linker-generated array code so that symbols which were previously linker-generated are now compiler- generated. This causes relocation records of type R_ARM_ABS32 to become R_ARM_RELATIVE, which makes code which uses LGA able to run before relocation as well as after. Note: this affects more than ARM targets, as linker- lists span possibly all target architectures, notably PowerPC. Conflicts: arch/arm/cpu/arm926ejs/mxs/u-boot-spl.lds arch/arm/cpu/arm926ejs/spear/u-boot-spl.lds arch/arm/cpu/armv7/omap-common/u-boot-spl.lds board/ait/cam_enc_4xx/u-boot-spl.lds board/davinci/da8xxevm/u-boot-spl-da850evm.lds board/davinci/da8xxevm/u-boot-spl-hawk.lds board/vpac270/u-boot-spl.lds Signed-off-by: Albert ARIBAUD --- board/matrix_vision/mvsmr/u-boot.lds | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'board/matrix_vision') diff --git a/board/matrix_vision/mvsmr/u-boot.lds b/board/matrix_vision/mvsmr/u-boot.lds index 5a3a9ea..5707770 100644 --- a/board/matrix_vision/mvsmr/u-boot.lds +++ b/board/matrix_vision/mvsmr/u-boot.lds @@ -77,7 +77,7 @@ SECTIONS . = ALIGN(4); .u_boot_list : { - #include + KEEP(*(SORT(.u_boot_list*))); } -- cgit v1.1