All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 0/3] omap3: mvblx: small changes
@ 2013-02-08  9:53 Michael Jones
  2013-02-08  9:53 ` [U-Boot] [PATCH 1/3] omap3: mvblx: change console to ttyO0 and make silent by default Michael Jones
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Michael Jones @ 2013-02-08  9:53 UTC (permalink / raw)
  To: u-boot

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(-)

-- 
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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot] [PATCH 1/3] omap3: mvblx: change console to ttyO0 and make silent by default.
  2013-02-08  9:53 [U-Boot] [PATCH 0/3] omap3: mvblx: small changes Michael Jones
@ 2013-02-08  9:53 ` Michael Jones
  2013-02-08 10:26   ` Stefan Roese
  2013-02-19 16:18   ` [U-Boot] [U-Boot, " Tom Rini
  2013-02-08  9:53 ` [U-Boot] [PATCH 2/3] omap3: mvblx: select fpgafilename according to orientation Michael Jones
  2013-02-08  9:53 ` [U-Boot] [PATCH 3/3] omap3: mvblx: pass FPGA version to the kernel Michael Jones
  2 siblings, 2 replies; 6+ messages in thread
From: Michael Jones @ 2013-02-08  9:53 UTC (permalink / raw)
  To: u-boot

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 at 60\0" \
-- 
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

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [U-Boot] [PATCH 2/3] omap3: mvblx: select fpgafilename according to orientation
  2013-02-08  9:53 [U-Boot] [PATCH 0/3] omap3: mvblx: small changes Michael Jones
  2013-02-08  9:53 ` [U-Boot] [PATCH 1/3] omap3: mvblx: change console to ttyO0 and make silent by default Michael Jones
@ 2013-02-08  9:53 ` Michael Jones
  2013-02-08  9:53 ` [U-Boot] [PATCH 3/3] omap3: mvblx: pass FPGA version to the kernel Michael Jones
  2 siblings, 0 replies; 6+ messages in thread
From: Michael Jones @ 2013-02-08  9:53 UTC (permalink / raw)
  To: u-boot

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" \
-- 
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

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [U-Boot] [PATCH 3/3] omap3: mvblx: pass FPGA version to the kernel
  2013-02-08  9:53 [U-Boot] [PATCH 0/3] omap3: mvblx: small changes Michael Jones
  2013-02-08  9:53 ` [U-Boot] [PATCH 1/3] omap3: mvblx: change console to ttyO0 and make silent by default Michael Jones
  2013-02-08  9:53 ` [U-Boot] [PATCH 2/3] omap3: mvblx: select fpgafilename according to orientation Michael Jones
@ 2013-02-08  9:53 ` Michael Jones
  2 siblings, 0 replies; 6+ messages in thread
From: Michael Jones @ 2013-02-08  9:53 UTC (permalink / raw)
  To: u-boot

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 ...; " \
-- 
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

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [U-Boot] [PATCH 1/3] omap3: mvblx: change console to ttyO0 and make silent by default.
  2013-02-08  9:53 ` [U-Boot] [PATCH 1/3] omap3: mvblx: change console to ttyO0 and make silent by default Michael Jones
@ 2013-02-08 10:26   ` Stefan Roese
  2013-02-19 16:18   ` [U-Boot] [U-Boot, " Tom Rini
  1 sibling, 0 replies; 6+ messages in thread
From: Stefan Roese @ 2013-02-08 10:26 UTC (permalink / raw)
  To: u-boot

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot] [U-Boot, 1/3] omap3: mvblx: change console to ttyO0 and make silent by default.
  2013-02-08  9:53 ` [U-Boot] [PATCH 1/3] omap3: mvblx: change console to ttyO0 and make silent by default Michael Jones
  2013-02-08 10:26   ` Stefan Roese
@ 2013-02-19 16:18   ` Tom Rini
  1 sibling, 0 replies; 6+ messages in thread
From: Tom Rini @ 2013-02-19 16:18 UTC (permalink / raw)
  To: u-boot

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!

-- 
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>

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-02-19 16:18 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-08  9:53 [U-Boot] [PATCH 0/3] omap3: mvblx: small changes Michael Jones
2013-02-08  9:53 ` [U-Boot] [PATCH 1/3] omap3: mvblx: change console to ttyO0 and make silent by default Michael Jones
2013-02-08 10:26   ` Stefan Roese
2013-02-19 16:18   ` [U-Boot] [U-Boot, " Tom Rini
2013-02-08  9:53 ` [U-Boot] [PATCH 2/3] omap3: mvblx: select fpgafilename according to orientation Michael Jones
2013-02-08  9:53 ` [U-Boot] [PATCH 3/3] omap3: mvblx: pass FPGA version to the kernel Michael Jones

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.