[U-Boot] [PATCH 0/3] omap3: mvblx: small changes

A few minor changes to mvblx
Howard Gray (1): omap3: mvblx: change console to ttyO0 and make silent by default.
Michael Jones (2): omap3: mvblx: select fpgafilename according to orientation omap3: mvblx: pass FPGA version to the kernel
board/matrix_vision/mvblx/fpga.c | 14 +++++++++++++- board/matrix_vision/mvblx/sys_eeprom.c | 24 ++++++++++++++++++++++++ include/configs/omap3_mvblx.h | 25 +++++++++++++++++-------- 3 files changed, 54 insertions(+), 9 deletions(-)

From: Howard Gray howard.gray@matrix-vision.de
Also, change bootdelay to 0 but allow pressing 'S' to stop at U-Boot prompt.
Signed-off-by: Michael Jones michael.jones@matrix-vision.de --- include/configs/omap3_mvblx.h | 18 +++++++++++++----- 1 files changed, 13 insertions(+), 5 deletions(-)
diff --git a/include/configs/omap3_mvblx.h b/include/configs/omap3_mvblx.h index 07de565..99f0d4b 100644 --- a/include/configs/omap3_mvblx.h +++ b/include/configs/omap3_mvblx.h @@ -90,9 +90,9 @@ /* * select serial console configuration */ -#define CONFIG_CONS_INDEX 3 -#define CONFIG_SYS_NS16550_COM3 OMAP34XX_UART3 -#define CONFIG_SERIAL3 3 /* UART3 */ +#define CONFIG_CONS_INDEX 1 +#define CONFIG_SYS_NS16550_COM1 OMAP34XX_UART1 +#define CONFIG_SERIAL1 1 /* UART1 */
#define CONFIG_BAUDRATE 115200 #define CONFIG_SYS_BAUDRATE_TABLE {4800, 9600, 19200, 38400, 57600,\ @@ -102,6 +102,10 @@ #define CONFIG_OMAP_HSMMC 1 #define CONFIG_DOS_PARTITION 1
+/* silent console by default */ +#define CONFIG_SYS_DEVICE_NULLDEV 1 +#define CONFIG_SILENT_CONSOLE 1 + /* USB */ #define CONFIG_MUSB_UDC 1 #define CONFIG_USB_OMAP3 1 @@ -152,12 +156,16 @@
/* Environment information */ #undef CONFIG_ENV_OVERWRITE /* disallow overwriting serial# and ethaddr */ -#define CONFIG_BOOTDELAY 3 +#define CONFIG_BOOTDELAY 0 +#define CONFIG_ZERO_BOOTDELAY_CHECK +#define CONFIG_AUTOBOOT_KEYED +#define CONFIG_AUTOBOOT_STOP_STR "S"
#define CONFIG_EXTRA_ENV_SETTINGS \ + "silent=true\0" \ "loadaddr=0x82000000\0" \ "usbtty=cdc_acm\0" \ - "console=ttyO2,115200n8\0" \ + "console=ttyO0,115200n8\0" \ "mpurate=600\0" \ "vram=12M\0" \ "dvimode=1024x768-24@60\0" \

On 02/08/2013 10:53 AM, Michael Jones wrote:
From: Howard Gray howard.gray@matrix-vision.de
Also, change bootdelay to 0 but allow pressing 'S' to stop at U-Boot prompt.
Signed-off-by: Michael Jones michael.jones@matrix-vision.de
Michael, you should to add a s-o-b from the original author here too. Best placed before yours. So this should be:
From: Howard Gray howard.gray@matrix-vision.de
Also, change bootdelay to 0 but allow pressing 'S' to stop at U-Boot prompt.
Signed-off-by: Howard Gray howard.gray@matrix-vision.de Signed-off-by: Michael Jones michael.jones@matrix-vision.de
Thanks, Stefan

On Thu, Feb 07, 2013 at 11:53:35PM -0000, Michael Jones wrote:
From: Howard Gray howard.gray@matrix-vision.de
Also, change bootdelay to 0 but allow pressing 'S' to stop at U-Boot prompt.
Signed-off-by: Michael Jones michael.jones@matrix-vision.de Signed-off-by: Howard Gray howard.gray@matrix-vision.de Signed-off-by: Michael Jones michael.jones@matrix-vision.de
This along with the rest of the series have been applied to u-boot-ti/msater, thanks!

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 michael.jones@matrix-vision.de --- board/matrix_vision/mvblx/sys_eeprom.c | 24 ++++++++++++++++++++++++ include/configs/omap3_mvblx.h | 6 +++--- 2 files changed, 27 insertions(+), 3 deletions(-)
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/include/configs/omap3_mvblx.h b/include/configs/omap3_mvblx.h index 99f0d4b..7bb05ca 100644 --- a/include/configs/omap3_mvblx.h +++ b/include/configs/omap3_mvblx.h @@ -170,9 +170,9 @@ "vram=12M\0" \ "dvimode=1024x768-24@60\0" \ "defaultdisplay=dvi\0" \ - "fpgafilename=mvbluelynx_x.rbf\0" \ - "loadfpga=if fatload mmc ${mmcdev} ${loadaddr} ${fpgafilename}; then " \ - "fpga load 0 ${loadaddr} ${filesize}; " \ + "loadfpga=if ext2load mmc ${mmcdev}:2 ${loadaddr} "\ + "/lib/firmware/mvblx/${fpgafilename}; then " \ + "fpga load 0 ${loadaddr} ${filesize}; " \ "fi;\0" \ "mmcdev=0\0" \ "mmcroot=/dev/mmcblk0p2 rw\0" \

Extract FPGA version from the .rbf and pass this info to the kernel.
Signed-off-by: Michael Jones michael.jones@matrix-vision.de --- board/matrix_vision/mvblx/fpga.c | 14 +++++++++++++- include/configs/omap3_mvblx.h | 1 + 2 files changed, 14 insertions(+), 1 deletions(-)
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/include/configs/omap3_mvblx.h b/include/configs/omap3_mvblx.h index 7bb05ca..376a3d0 100644 --- a/include/configs/omap3_mvblx.h +++ b/include/configs/omap3_mvblx.h @@ -185,6 +185,7 @@ "omapdss.def_disp=${defaultdisplay} " \ "root=${mmcroot} " \ "rootfstype=${mmcrootfstype} " \ + "mvfw.fpgavers=${fpgavers} " \ "${cmdline_suffix}\0" \ "loadbootenv=fatload mmc ${mmcdev} ${loadaddr} uEnv.txt\0" \ "importbootenv=echo Importing environment from mmc ...; " \
participants (3)
-
Michael Jones
-
Stefan Roese
-
Tom Rini