Skip to contentSkip to conversation

omap3: mvblx: small changes

PATCH New Michael Jones 3 participants 6 messages Feb 8, 2013 – Feb 19, 2013

lore
Share & tools
lore
#0 lore raw

cover 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(-)
Signature · 6 lines
1.7.4.1


MATRIX VISION GmbH, Talstrasse 16, DE-71570 Oppenweiler
Registergericht: Amtsgericht Stuttgart, HRB 271090
Geschaeftsfuehrer: Gerhard Thullner, Werner Armingeon, Uwe Furtner, Erhard Meier
#1 lore raw

PATCH 1/3 omap3: mvblx: change console to ttyO0 and make silent by default.

From: Howard Gray <[email protected]>

Also, change bootdelay to 0 but allow pressing 'S' to stop at U-Boot prompt.

---
 include/configs/omap3_mvblx.h |   18 +++++++++++++-----
 1 files changed, 13 insertions(+), 5 deletions(-)
include/configs/omap3_mvblx.h +13 -5
index 07de565..99f0d4b 100644
@@ -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 at 60\0" \
Signature · 6 lines
1.7.4.1


MATRIX VISION GmbH, Talstrasse 16, DE-71570 Oppenweiler
Registergericht: Amtsgericht Stuttgart, HRB 271090
Geschaeftsfuehrer: Gerhard Thullner, Werner Armingeon, Uwe Furtner, Erhard Meier
#2 lore raw

PATCH 1/3 omap3: mvblx: change console to ttyO0 and make silent by default.

Quoted 5 lines · Michael Jones

From: Howard Gray <[email protected]>

Also, change bootdelay to 0 but allow pressing 'S' to stop at U-Boot prompt.

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 <[email protected]>

Also, change bootdelay to 0 but allow pressing 'S' to stop at U-Boot prompt.

Thanks,
Stefan

#3 lore raw

PATCH 1/3 omap3: mvblx: change console to ttyO0 and make silent by default.

In reply to Michael Jones
Quoted 7 lines · Michael Jones

From: Howard Gray <[email protected]>

Also, change bootdelay to 0 but allow pressing 'S' to stop at U-Boot prompt.

This along with the rest of the series have been applied to u-boot-ti/msater, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20130219/430f6079/attachment.pgp>
#4 lore raw

PATCH 2/3 omap3: mvblx: select fpgafilename according to orientation

In reply to Michael Jones

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.

---
 board/matrix_vision/mvblx/sys_eeprom.c |   24 ++++++++++++++++++++++++
 include/configs/omap3_mvblx.h          |    6 +++---
 2 files changed, 27 insertions(+), 3 deletions(-)
board/matrix_vision/mvblx/sys_eeprom.c +24 -0
index 945a36d..15269c6 100644
@@ -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;
 }
include/configs/omap3_mvblx.h +3 -3
index 99f0d4b..7bb05ca 100644
@@ -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" \
Signature · 6 lines
1.7.4.1


MATRIX VISION GmbH, Talstrasse 16, DE-71570 Oppenweiler
Registergericht: Amtsgericht Stuttgart, HRB 271090
Geschaeftsfuehrer: Gerhard Thullner, Werner Armingeon, Uwe Furtner, Erhard Meier
#5 lore raw

PATCH 3/3 omap3: mvblx: pass FPGA version to the kernel

In reply to Michael Jones

Extract FPGA version from the .rbf and pass this info to the kernel.

---
 board/matrix_vision/mvblx/fpga.c |   14 +++++++++++++-
 include/configs/omap3_mvblx.h    |    1 +
 2 files changed, 14 insertions(+), 1 deletions(-)
board/matrix_vision/mvblx/fpga.c +13 -1
index dacc138..3fcf968 100644
@@ -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__);
 
include/configs/omap3_mvblx.h +1 -0
index 7bb05ca..376a3d0 100644
@@ -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 ...; " \
Signature · 6 lines
1.7.4.1


MATRIX VISION GmbH, Talstrasse 16, DE-71570 Oppenweiler
Registergericht: Amtsgericht Stuttgart, HRB 271090
Geschaeftsfuehrer: Gerhard Thullner, Werner Armingeon, Uwe Furtner, Erhard Meier