mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 0/9] Add support for booting ArchosG9 from sd-card
@ 2013-03-09 23:19 Vicente Bergas
  2013-03-09 23:19 ` [PATCH 1/9] defaultenv-2: don't load nonexistent file Vicente Bergas
                   ` (9 more replies)
  0 siblings, 10 replies; 22+ messages in thread
From: Vicente Bergas @ 2013-03-09 23:19 UTC (permalink / raw)
  To: barebox; +Cc: Vicente Bergas

 This patch series ends up adding sd-card booting support to archosg9 boards.
 First 8 patches are improvements and minor fixes found during the process.

Vicente Bergas (9):
  defaultenv-2: don't load nonexistent file
  omap4_romusb: rename omap4_usbboot_pdata to omap4_usbboot_data
  omap_uart: rename OMAP3EVM_UARTx to OMAP_UARTx
  omap_uart: add low level port serial initialization
  panda: remove unused configuration items
  omap4_romusb: allow adding usb-serial when not booting from usb
  menu: avoid errors when building submenus
  archos: add atag appender for all features
  archosg9: enable booting from sd-card

 arch/arm/boards/archosg9/archos_features.c         | 414 +++++++++++++++++++--
 arch/arm/boards/archosg9/archos_features.h         |  39 ++
 arch/arm/boards/archosg9/board.c                   |   1 -
 arch/arm/boards/archosg9/env/boot/sd-card-android  |  11 +
 arch/arm/boards/archosg9/env/boot/sd-card-linux    |  17 +
 arch/arm/boards/archosg9/env/boot/usb-android      |  11 +
 arch/arm/boards/archosg9/env/boot/usb-linux        |  17 +
 arch/arm/boards/archosg9/env/config                |   3 -
 arch/arm/boards/archosg9/env/init/automount        |  28 ++
 arch/arm/boards/archosg9/env/init/bootsource       |  11 +
 arch/arm/boards/archosg9/env/init/usbboot          |   6 -
 arch/arm/boards/at91sam9m10ihd/env/boot/android    |   2 +-
 arch/arm/boards/at91sam9m10ihd/env/boot/mmc        |   2 +-
 arch/arm/boards/at91sam9m10ihd/env/boot/net        |   2 +-
 arch/arm/boards/at91sam9m10ihd/env/boot/net-usb    |   2 +-
 arch/arm/boards/beagle/env/boot/mmc                |   2 +-
 arch/arm/boards/beagle/env/boot/nand-ubi           |   2 +-
 arch/arm/boards/beagle/env/boot/nand-ubi-dt        |   2 +-
 arch/arm/boards/beaglebone/env/boot/sd             |   2 +-
 arch/arm/boards/clep7212/env/boot/nor              |   2 +-
 .../boards/crystalfontz-cfa10036/env/boot/mmc-ext3 |   2 +-
 .../boards/efika-mx-smartbook/env/boot/hd-internal |   2 +-
 .../boards/efika-mx-smartbook/env/boot/mmc-left    |   2 +-
 arch/arm/boards/guf-vincell/env/boot/nand-ubi      |   2 +-
 arch/arm/boards/karo-tx25/env/boot/nand-ubi        |   2 +-
 arch/arm/boards/omap3evm/board.c                   |   4 +-
 arch/arm/boards/omap3evm/lowlevel.c                |   4 +-
 arch/arm/boards/panda/env/boot/mmc                 |   2 +-
 arch/arm/boards/pcm037/env/boot/nand-ubi           |   2 +-
 arch/arm/boards/pcm038/env/boot/nand-ubi           |   2 +-
 arch/arm/boards/pcm043/env/boot/nand-ubi           |   2 +-
 arch/arm/boards/pcm051/env/boot/sd                 |   2 +-
 arch/arm/boards/telit-evk-pro3/env/boot/nand-ubi   |   2 +-
 arch/arm/configs/archosg9_defconfig                |  67 ++--
 arch/arm/configs/archosg9_xload_defconfig          |  20 +-
 arch/arm/configs/panda_xload_defconfig             |   3 -
 arch/arm/mach-omap/Kconfig                         |  11 +-
 arch/arm/mach-omap/include/mach/debug_ll.h         |  27 +-
 arch/arm/mach-omap/include/mach/omap4_rom_usb.h    |   3 +
 arch/arm/mach-omap/omap4_rom_usb.c                 |  95 +++--
 defaultenv-2/base/bin/init                         |   2 +-
 defaultenv-2/base/boot/net                         |   2 +-
 defaultenv-2/base/data/boot-template               |   2 +-
 defaultenv-2/menu/menu/boot-entries-collect        |   4 +-
 defaultenv-2/menu/menu/boot-entries-edit           |   2 +-
 defaultenv-2/menu/menu/boot-entries-remove         |   2 +-
 defaultenv-2/menu/menu/boot-menu-add-entry         |   6 +-
 defaultenv-2/menu/menu/mainmenu                    |   2 +-
 drivers/serial/serial_omap4_usbboot.c              |   2 +
 49 files changed, 686 insertions(+), 170 deletions(-)
 create mode 100644 arch/arm/boards/archosg9/env/boot/sd-card-android
 create mode 100644 arch/arm/boards/archosg9/env/boot/sd-card-linux
 create mode 100644 arch/arm/boards/archosg9/env/boot/usb-android
 create mode 100644 arch/arm/boards/archosg9/env/boot/usb-linux
 delete mode 100644 arch/arm/boards/archosg9/env/config
 create mode 100644 arch/arm/boards/archosg9/env/init/automount
 create mode 100644 arch/arm/boards/archosg9/env/init/bootsource
 delete mode 100644 arch/arm/boards/archosg9/env/init/usbboot

-- 
1.8.1.5


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* [PATCH 1/9] defaultenv-2: don't load nonexistent file
  2013-03-09 23:19 [PATCH 0/9] Add support for booting ArchosG9 from sd-card Vicente Bergas
@ 2013-03-09 23:19 ` Vicente Bergas
  2013-03-09 23:19 ` [PATCH 2/9] omap4_romusb: rename omap4_usbboot_pdata to omap4_usbboot_data Vicente Bergas
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 22+ messages in thread
From: Vicente Bergas @ 2013-03-09 23:19 UTC (permalink / raw)
  To: barebox; +Cc: Vicente Bergas


Signed-off-by: Vicente Bergas <vicencb@gmail.com>
---
 defaultenv-2/base/bin/init | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/defaultenv-2/base/bin/init b/defaultenv-2/base/bin/init
index e4a7fee..6a658d1 100644
--- a/defaultenv-2/base/bin/init
+++ b/defaultenv-2/base/bin/init
@@ -13,7 +13,7 @@ global linux.bootargs.dyn.ip
 global linux.bootargs.dyn.root
 global editcmd=sedit
 
-/env/config-board
+[ -e /env/config-board ] && /env/config-board
 /env/config
 
 if [ -e /env/menu ]; then
-- 
1.8.1.5


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* [PATCH 2/9] omap4_romusb: rename omap4_usbboot_pdata to omap4_usbboot_data
  2013-03-09 23:19 [PATCH 0/9] Add support for booting ArchosG9 from sd-card Vicente Bergas
  2013-03-09 23:19 ` [PATCH 1/9] defaultenv-2: don't load nonexistent file Vicente Bergas
@ 2013-03-09 23:19 ` Vicente Bergas
  2013-03-09 23:19 ` [PATCH 3/9] omap_uart: rename OMAP3EVM_UARTx to OMAP_UARTx Vicente Bergas
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 22+ messages in thread
From: Vicente Bergas @ 2013-03-09 23:19 UTC (permalink / raw)
  To: barebox; +Cc: Vicente Bergas

 omap4_usbboot_pdata is not a pointer, so remove the "p"

Signed-off-by: Vicente Bergas <vicencb@gmail.com>
---
 arch/arm/mach-omap/omap4_rom_usb.c | 72 +++++++++++++++++++-------------------
 1 file changed, 36 insertions(+), 36 deletions(-)

diff --git a/arch/arm/mach-omap/omap4_rom_usb.c b/arch/arm/mach-omap/omap4_rom_usb.c
index 48d6433..38f886b 100644
--- a/arch/arm/mach-omap/omap4_rom_usb.c
+++ b/arch/arm/mach-omap/omap4_rom_usb.c
@@ -36,7 +36,7 @@
 #include <mach/xload.h>
 #include <init.h>
 
-static struct omap4_usbboot omap4_usbboot_pdata;
+static struct omap4_usbboot omap4_usbboot_data;
 
 static int omap4_usbboot_open(void)
 {
@@ -62,20 +62,20 @@ static int omap4_usbboot_open(void)
 	    (boot->device_type != DEVICE_USBEXT))
 		return -1;
 
-	memset(&omap4_usbboot_pdata, 0, sizeof(omap4_usbboot_pdata));
-	n = rom_get_per_driver(&omap4_usbboot_pdata.io, boot->device_type);
+	memset(&omap4_usbboot_data, 0, sizeof(omap4_usbboot_data));
+	n = rom_get_per_driver(&omap4_usbboot_data.io, boot->device_type);
 	if (n)
 		return n;
 
-	omap4_usbboot_pdata.dread.status = -1;
-	omap4_usbboot_pdata.dread.xfer_mode = boot->xfer_mode;
-	omap4_usbboot_pdata.dread.options = boot->options;
-	omap4_usbboot_pdata.dread.device_type = boot->device_type;
+	omap4_usbboot_data.dread.status = -1;
+	omap4_usbboot_data.dread.xfer_mode = boot->xfer_mode;
+	omap4_usbboot_data.dread.options = boot->options;
+	omap4_usbboot_data.dread.device_type = boot->device_type;
 
-	omap4_usbboot_pdata.dwrite.status = -1;
-	omap4_usbboot_pdata.dwrite.xfer_mode = boot->xfer_mode;
-	omap4_usbboot_pdata.dwrite.options = boot->options;
-	omap4_usbboot_pdata.dwrite.device_type = boot->device_type;
+	omap4_usbboot_data.dwrite.status = -1;
+	omap4_usbboot_data.dwrite.xfer_mode = boot->xfer_mode;
+	omap4_usbboot_data.dwrite.options = boot->options;
+	omap4_usbboot_data.dwrite.device_type = boot->device_type;
 	__asm__ __volatile__ ("cpsie i\n");
 	return 0;
 }
@@ -83,71 +83,71 @@ static int omap4_usbboot_open(void)
 
 static void rom_read_callback(struct per_handle *rh)
 {
-	omap4_usbboot_pdata.dread.status = rh->status;
+	omap4_usbboot_data.dread.status = rh->status;
 	return;
 }
 
 void omap4_usbboot_queue_read(void *data, unsigned len)
 {
 	int n;
-	omap4_usbboot_pdata.dread.data = data;
-	omap4_usbboot_pdata.dread.length = len;
-	omap4_usbboot_pdata.dread.status = STATUS_WAITING;
-	omap4_usbboot_pdata.dread.xfer_mode = 1;
-	omap4_usbboot_pdata.dread.callback = rom_read_callback;
-	n = omap4_usbboot_pdata.io->read(&omap4_usbboot_pdata.dread);
+	omap4_usbboot_data.dread.data = data;
+	omap4_usbboot_data.dread.length = len;
+	omap4_usbboot_data.dread.status = STATUS_WAITING;
+	omap4_usbboot_data.dread.xfer_mode = 1;
+	omap4_usbboot_data.dread.callback = rom_read_callback;
+	n = omap4_usbboot_data.io->read(&omap4_usbboot_data.dread);
 	if (n)
-		omap4_usbboot_pdata.dread.status = n;
+		omap4_usbboot_data.dread.status = n;
 }
 
 int omap4_usbboot_wait_read(void)
 {
 	int ret;
-	while (omap4_usbboot_pdata.dread.status == STATUS_WAITING)
+	while (omap4_usbboot_data.dread.status == STATUS_WAITING)
 		/* cpu_relax(); */
 		barrier();
-	ret = omap4_usbboot_pdata.dread.status;
-	omap4_usbboot_pdata.dread.status = -1;
+	ret = omap4_usbboot_data.dread.status;
+	omap4_usbboot_data.dread.status = -1;
 	return ret;
 }
 int omap4_usbboot_is_read_waiting(void)
 {
 	barrier();
-	return omap4_usbboot_pdata.dread.status == STATUS_WAITING;
+	return omap4_usbboot_data.dread.status == STATUS_WAITING;
 }
 int omap4_usbboot_is_read_ok(void)
 {
 	barrier();
-	return omap4_usbboot_pdata.dread.status == STATUS_OKAY;
+	return omap4_usbboot_data.dread.status == STATUS_OKAY;
 }
 
 static void rom_write_callback(struct per_handle *rh)
 {
-	omap4_usbboot_pdata.dwrite.status = rh->status;
+	omap4_usbboot_data.dwrite.status = rh->status;
 	return;
 }
 
 void omap4_usbboot_queue_write(void *data, unsigned len)
 {
 	int n;
-	omap4_usbboot_pdata.dwrite.data = data;
-	omap4_usbboot_pdata.dwrite.length = len;
-	omap4_usbboot_pdata.dwrite.status = STATUS_WAITING;
-	omap4_usbboot_pdata.dwrite.xfer_mode = 1;
-	omap4_usbboot_pdata.dwrite.callback = rom_write_callback;
-	n = omap4_usbboot_pdata.io->write(&omap4_usbboot_pdata.dwrite);
+	omap4_usbboot_data.dwrite.data = data;
+	omap4_usbboot_data.dwrite.length = len;
+	omap4_usbboot_data.dwrite.status = STATUS_WAITING;
+	omap4_usbboot_data.dwrite.xfer_mode = 1;
+	omap4_usbboot_data.dwrite.callback = rom_write_callback;
+	n = omap4_usbboot_data.io->write(&omap4_usbboot_data.dwrite);
 	if (n)
-		omap4_usbboot_pdata.dwrite.status = n;
+		omap4_usbboot_data.dwrite.status = n;
 }
 
 int omap4_usbboot_wait_write(void)
 {
 	int ret;
-	while (omap4_usbboot_pdata.dwrite.status == STATUS_WAITING)
+	while (omap4_usbboot_data.dwrite.status == STATUS_WAITING)
 		/* cpu_relax(); */
 		barrier();
-	ret = omap4_usbboot_pdata.dwrite.status;
-	omap4_usbboot_pdata.dwrite.status = -1;
+	ret = omap4_usbboot_data.dwrite.status;
+	omap4_usbboot_data.dwrite.status = -1;
 	return ret;
 }
 
@@ -177,7 +177,7 @@ int omap4_usbboot_write(void *data, unsigned len)
 
 void omap4_usbboot_close(void)
 {
-	omap4_usbboot_pdata.io->close(&omap4_usbboot_pdata.dread);
+	omap4_usbboot_data.io->close(&omap4_usbboot_data.dread);
 }
 
 void omap4_usbboot_puts(const char *s)
-- 
1.8.1.5


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* [PATCH 3/9] omap_uart: rename OMAP3EVM_UARTx to OMAP_UARTx
  2013-03-09 23:19 [PATCH 0/9] Add support for booting ArchosG9 from sd-card Vicente Bergas
  2013-03-09 23:19 ` [PATCH 1/9] defaultenv-2: don't load nonexistent file Vicente Bergas
  2013-03-09 23:19 ` [PATCH 2/9] omap4_romusb: rename omap4_usbboot_pdata to omap4_usbboot_data Vicente Bergas
@ 2013-03-09 23:19 ` Vicente Bergas
  2013-03-09 23:19 ` [PATCH 4/9] omap_uart: add low level port serial initialization Vicente Bergas
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 22+ messages in thread
From: Vicente Bergas @ 2013-03-09 23:19 UTC (permalink / raw)
  To: barebox; +Cc: Vicente Bergas

 use a more generic UART selection on OMAP so it can be extended to
other OMAPs

Signed-off-by: Vicente Bergas <vicencb@gmail.com>
---
 arch/arm/boards/omap3evm/board.c           |  4 ++--
 arch/arm/boards/omap3evm/lowlevel.c        |  4 ++--
 arch/arm/mach-omap/Kconfig                 | 11 ++++++-----
 arch/arm/mach-omap/include/mach/debug_ll.h |  6 +++++-
 4 files changed, 15 insertions(+), 10 deletions(-)

diff --git a/arch/arm/boards/omap3evm/board.c b/arch/arm/boards/omap3evm/board.c
index 7585541..7284f5f 100644
--- a/arch/arm/boards/omap3evm/board.c
+++ b/arch/arm/boards/omap3evm/board.c
@@ -62,9 +62,9 @@
  */
 static int omap3evm_init_console(void)
 {
-	if (IS_ENABLED(CONFIG_OMAP3EVM_UART1))
+	if (IS_ENABLED(CONFIG_OMAP_UART1))
 		omap3_add_uart1();
-	if (IS_ENABLED(CONFIG_OMAP3EVM_UART3))
+	if (IS_ENABLED(CONFIG_OMAP_UART3))
 		omap3_add_uart3();
 
 	return 0;
diff --git a/arch/arm/boards/omap3evm/lowlevel.c b/arch/arm/boards/omap3evm/lowlevel.c
index 74e1315..2d9e130 100644
--- a/arch/arm/boards/omap3evm/lowlevel.c
+++ b/arch/arm/boards/omap3evm/lowlevel.c
@@ -122,12 +122,12 @@ static void mux_config(void)
 	/*
 	 * Serial Interface
 	 */
-#if defined(CONFIG_OMAP3EVM_UART1)
+#if defined(CONFIG_OMAP_UART1)
 	MUX_VAL(CP(UART1_TX),		(IDIS | PTD | DIS | M0));
 	MUX_VAL(CP(UART1_RTS),		(IDIS | PTD | DIS | M0));
 	MUX_VAL(CP(UART1_CTS),		(IEN  | PTU | DIS | M0));
 	MUX_VAL(CP(UART1_RX),		(IEN  | PTD | DIS | M0));
-#elif defined(CONFIG_OMAP3EVM_UART3)
+#elif defined(CONFIG_OMAP_UART3)
 	MUX_VAL(CP(UART3_CTS_RCTX),	(IEN  | PTD | EN  | M0));
 	MUX_VAL(CP(UART3_RTS_SD),	(IDIS | PTD | DIS | M0));
 	MUX_VAL(CP(UART3_RX_IRRX),	(IEN  | PTD | DIS | M0));
diff --git a/arch/arm/mach-omap/Kconfig b/arch/arm/mach-omap/Kconfig
index a87fc4b..42e5f4a 100644
--- a/arch/arm/mach-omap/Kconfig
+++ b/arch/arm/mach-omap/Kconfig
@@ -187,20 +187,21 @@ config MACH_PCM051
 
 endchoice
 
-if MACH_OMAP3EVM
+if ARCH_OMAP
 
 choice
 	prompt "Select UART"
+	default OMAP_UART3
 
-	config OMAP3EVM_UART1
+	config OMAP_UART1
 		bool "Use UART1"
-		depends on MACH_OMAP3EVM
+		depends on ARCH_OMAP
 		help
 		  Say Y here if you would like to use UART1 as console.
 
-	config OMAP3EVM_UART3
+	config OMAP_UART3
 		bool "Use UART3"
-		depends on MACH_OMAP3EVM
+		depends on ARCH_OMAP
 		help
 		  Say Y here if you would like to use UART3 as console.
 
diff --git a/arch/arm/mach-omap/include/mach/debug_ll.h b/arch/arm/mach-omap/include/mach/debug_ll.h
index ed1777b..eea6eb3 100644
--- a/arch/arm/mach-omap/include/mach/debug_ll.h
+++ b/arch/arm/mach-omap/include/mach/debug_ll.h
@@ -22,7 +22,7 @@
 #ifdef CONFIG_ARCH_OMAP3
 #include <mach/omap3-silicon.h>
 
-#ifdef CONFIG_OMAP3EVM_UART1
+#ifdef CONFIG_OMAP_UART1
 #define UART_BASE	OMAP3_UART1_BASE
 #else
 #define UART_BASE	OMAP3_UART3_BASE
@@ -32,8 +32,12 @@
 
 #ifdef CONFIG_ARCH_OMAP4
 #include <mach/omap4-silicon.h>
+#ifdef CONFIG_OMAP_UART1
+#define UART_BASE	OMAP44XX_UART1_BASE
+#else
 #define UART_BASE	OMAP44XX_UART3_BASE
 #endif
+#endif
 
 #ifdef CONFIG_ARCH_AM33XX
 #include <mach/am33xx-silicon.h>
-- 
1.8.1.5


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* [PATCH 4/9] omap_uart: add low level port serial initialization
  2013-03-09 23:19 [PATCH 0/9] Add support for booting ArchosG9 from sd-card Vicente Bergas
                   ` (2 preceding siblings ...)
  2013-03-09 23:19 ` [PATCH 3/9] omap_uart: rename OMAP3EVM_UARTx to OMAP_UARTx Vicente Bergas
@ 2013-03-09 23:19 ` Vicente Bergas
  2013-03-10 13:16   ` Jean-Christophe PLAGNIOL-VILLARD
  2013-03-09 23:19 ` [PATCH 5/9] panda: remove unused configuration items Vicente Bergas
                   ` (5 subsequent siblings)
  9 siblings, 1 reply; 22+ messages in thread
From: Vicente Bergas @ 2013-03-09 23:19 UTC (permalink / raw)
  To: barebox; +Cc: Vicente Bergas

 some sort of UART setup has to be done in order to use PUTC_LL

Signed-off-by: Vicente Bergas <vicencb@gmail.com>
---
 arch/arm/mach-omap/include/mach/debug_ll.h | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/arch/arm/mach-omap/include/mach/debug_ll.h b/arch/arm/mach-omap/include/mach/debug_ll.h
index eea6eb3..9740848 100644
--- a/arch/arm/mach-omap/include/mach/debug_ll.h
+++ b/arch/arm/mach-omap/include/mach/debug_ll.h
@@ -45,9 +45,30 @@
 #endif
 
 #define LSR_THRE	0x20	/* Xmit holding register empty */
+#define LCR_BKSE	0x80	/* Bank select enable */
 #define LSR		(5 << 2)
 #define THR		(0 << 2)
+#define DLL		(0 << 2)
+#define IER		(1 << 2)
+#define DLM		(1 << 2)
+#define FCR		(2 << 2)
+#define LCR		(3 << 2)
+#define MCR		(4 << 2)
+#define MDR		(8 << 2)
 
+static inline void INIT_LL(void)
+{
+	writeb(0x00, UART_BASE + LCR);
+	writeb(0x00, UART_BASE + IER);
+	writeb(0x07, UART_BASE + MDR);
+	writeb(LCR_BKSE, UART_BASE + LCR);
+	writeb(26, UART_BASE + DLL); /* 115200 */
+	writeb(0, UART_BASE + DLM);
+	writeb(0x03, UART_BASE + LCR);
+	writeb(0x03, UART_BASE + MCR);
+	writeb(0x07, UART_BASE + FCR);
+	writeb(0x00, UART_BASE + MDR);
+}
 static inline void PUTC_LL(char c)
 {
 	/* Wait until there is space in the FIFO */
-- 
1.8.1.5


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* [PATCH 5/9] panda: remove unused configuration items
  2013-03-09 23:19 [PATCH 0/9] Add support for booting ArchosG9 from sd-card Vicente Bergas
                   ` (3 preceding siblings ...)
  2013-03-09 23:19 ` [PATCH 4/9] omap_uart: add low level port serial initialization Vicente Bergas
@ 2013-03-09 23:19 ` Vicente Bergas
  2013-03-09 23:19 ` [PATCH 6/9] omap4_romusb: allow adding usb-serial when not booting from usb Vicente Bergas
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 22+ messages in thread
From: Vicente Bergas @ 2013-03-09 23:19 UTC (permalink / raw)
  To: barebox; +Cc: Vicente Bergas


Signed-off-by: Vicente Bergas <vicencb@gmail.com>
---
 arch/arm/configs/panda_xload_defconfig | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/arch/arm/configs/panda_xload_defconfig b/arch/arm/configs/panda_xload_defconfig
index 1ed20a1..5cedcff 100644
--- a/arch/arm/configs/panda_xload_defconfig
+++ b/arch/arm/configs/panda_xload_defconfig
@@ -6,9 +6,6 @@ CONFIG_THUMB2_BAREBOX=y
 # CONFIG_CMD_ARM_CPUINFO is not set
 CONFIG_MMU=y
 CONFIG_TEXT_BASE=0x40300000
-CONFIG_MEMORY_LAYOUT_FIXED=y
-CONFIG_STACK_BASE=0x8f000000
-CONFIG_MALLOC_BASE=0x84000000
 CONFIG_MALLOC_SIZE=0x2000000
 CONFIG_PROMPT="barebox> "
 CONFIG_SHELL_NONE=y
-- 
1.8.1.5


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* [PATCH 6/9] omap4_romusb: allow adding usb-serial when not booting from usb
  2013-03-09 23:19 [PATCH 0/9] Add support for booting ArchosG9 from sd-card Vicente Bergas
                   ` (4 preceding siblings ...)
  2013-03-09 23:19 ` [PATCH 5/9] panda: remove unused configuration items Vicente Bergas
@ 2013-03-09 23:19 ` Vicente Bergas
  2013-03-14  7:50   ` Sascha Hauer
  2013-03-09 23:19 ` [PATCH 7/9] menu: avoid errors when building submenus Vicente Bergas
                   ` (3 subsequent siblings)
  9 siblings, 1 reply; 22+ messages in thread
From: Vicente Bergas @ 2013-03-09 23:19 UTC (permalink / raw)
  To: barebox; +Cc: Vicente Bergas


Signed-off-by: Vicente Bergas <vicencb@gmail.com>
---
 arch/arm/mach-omap/include/mach/omap4_rom_usb.h |  3 +++
 arch/arm/mach-omap/omap4_rom_usb.c              | 23 +++++++++++------------
 drivers/serial/serial_omap4_usbboot.c           |  2 ++
 3 files changed, 16 insertions(+), 12 deletions(-)

diff --git a/arch/arm/mach-omap/include/mach/omap4_rom_usb.h b/arch/arm/mach-omap/include/mach/omap4_rom_usb.h
index 50c359f..bf8bd15 100644
--- a/arch/arm/mach-omap/include/mach/omap4_rom_usb.h
+++ b/arch/arm/mach-omap/include/mach/omap4_rom_usb.h
@@ -122,8 +122,11 @@ struct omap4_usbboot {
 	struct per_handle dread;
 	struct per_handle dwrite;
 	struct per_driver *io;
+	int ready;
 };
 
+int omap4_usbboot_open(void);
+int omap4_usbboot_ready(void);
 void omap4_usbboot_close(void);
 
 void omap4_usbboot_queue_read(void *data, unsigned len);
diff --git a/arch/arm/mach-omap/omap4_rom_usb.c b/arch/arm/mach-omap/omap4_rom_usb.c
index 38f886b..de35d61 100644
--- a/arch/arm/mach-omap/omap4_rom_usb.c
+++ b/arch/arm/mach-omap/omap4_rom_usb.c
@@ -38,7 +38,7 @@
 
 static struct omap4_usbboot omap4_usbboot_data;
 
-static int omap4_usbboot_open(void)
+int omap4_usbboot_open(void)
 {
 	int (*rom_get_per_driver)(struct per_driver **io, u32 device_type);
 	int (*rom_get_per_device)(struct per_handle **rh);
@@ -60,7 +60,7 @@ static int omap4_usbboot_open(void)
 
 	if ((boot->device_type != DEVICE_USB) &&
 	    (boot->device_type != DEVICE_USBEXT))
-		return -1;
+		return 0;
 
 	memset(&omap4_usbboot_data, 0, sizeof(omap4_usbboot_data));
 	n = rom_get_per_driver(&omap4_usbboot_data.io, boot->device_type);
@@ -77,9 +77,16 @@ static int omap4_usbboot_open(void)
 	omap4_usbboot_data.dwrite.options = boot->options;
 	omap4_usbboot_data.dwrite.device_type = boot->device_type;
 	__asm__ __volatile__ ("cpsie i\n");
+	omap4_usbboot_data.ready = 1;
+
+	omap4_usbboot_puts("USB communications initialized\n");
 	return 0;
 }
+core_initcall(omap4_usbboot_open);
 
+int omap4_usbboot_ready(void){
+	return omap4_usbboot_data.ready;
+}
 
 static void rom_read_callback(struct per_handle *rh)
 {
@@ -110,11 +117,13 @@ int omap4_usbboot_wait_read(void)
 	omap4_usbboot_data.dread.status = -1;
 	return ret;
 }
+
 int omap4_usbboot_is_read_waiting(void)
 {
 	barrier();
 	return omap4_usbboot_data.dread.status == STATUS_WAITING;
 }
+
 int omap4_usbboot_is_read_ok(void)
 {
 	barrier();
@@ -186,13 +195,3 @@ void omap4_usbboot_puts(const char *s)
 	while ((c = *s++))
 		omap4_usbboot_write(&c, 4);
 }
-
-static int omap4_usbboot_init(void)
-{
-	if (omap4_bootsrc() == OMAP_BOOTSRC_USB1) {
-		omap4_usbboot_open();
-		omap4_usbboot_puts("USB communications initialized\n");
-	}
-	return 0;
-}
-core_initcall(omap4_usbboot_init);
diff --git a/drivers/serial/serial_omap4_usbboot.c b/drivers/serial/serial_omap4_usbboot.c
index f0a2fd1..ee5b19a 100644
--- a/drivers/serial/serial_omap4_usbboot.c
+++ b/drivers/serial/serial_omap4_usbboot.c
@@ -78,6 +78,8 @@ static struct driver_d serial_omap4_usbboot_driver = {
 
 static int serial_omap4_usbboot_init(void)
 {
+	if (!omap4_usbboot_ready())
+		return 0;
 	return platform_driver_register(&serial_omap4_usbboot_driver);
 }
 console_initcall(serial_omap4_usbboot_init);
-- 
1.8.1.5


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* [PATCH 7/9] menu: avoid errors when building submenus
  2013-03-09 23:19 [PATCH 0/9] Add support for booting ArchosG9 from sd-card Vicente Bergas
                   ` (5 preceding siblings ...)
  2013-03-09 23:19 ` [PATCH 6/9] omap4_romusb: allow adding usb-serial when not booting from usb Vicente Bergas
@ 2013-03-09 23:19 ` Vicente Bergas
  2013-03-10 13:16   ` Jean-Christophe PLAGNIOL-VILLARD
  2013-03-09 23:19 ` [PATCH 8/9] archos: add atag appender for all features Vicente Bergas
                   ` (2 subsequent siblings)
  9 siblings, 1 reply; 22+ messages in thread
From: Vicente Bergas @ 2013-03-09 23:19 UTC (permalink / raw)
  To: barebox; +Cc: Vicente Bergas

boot-menu-add-entry should not add menu entries to non-existent menus
to solve the issue a new parameter is passed indicating the current menu

Signed-off-by: Vicente Bergas <vicencb@gmail.com>
---
 arch/arm/boards/at91sam9m10ihd/env/boot/android         | 2 +-
 arch/arm/boards/at91sam9m10ihd/env/boot/mmc             | 2 +-
 arch/arm/boards/at91sam9m10ihd/env/boot/net             | 2 +-
 arch/arm/boards/at91sam9m10ihd/env/boot/net-usb         | 2 +-
 arch/arm/boards/beagle/env/boot/mmc                     | 2 +-
 arch/arm/boards/beagle/env/boot/nand-ubi                | 2 +-
 arch/arm/boards/beagle/env/boot/nand-ubi-dt             | 2 +-
 arch/arm/boards/beaglebone/env/boot/sd                  | 2 +-
 arch/arm/boards/clep7212/env/boot/nor                   | 2 +-
 arch/arm/boards/crystalfontz-cfa10036/env/boot/mmc-ext3 | 2 +-
 arch/arm/boards/efika-mx-smartbook/env/boot/hd-internal | 2 +-
 arch/arm/boards/efika-mx-smartbook/env/boot/mmc-left    | 2 +-
 arch/arm/boards/guf-vincell/env/boot/nand-ubi           | 2 +-
 arch/arm/boards/karo-tx25/env/boot/nand-ubi             | 2 +-
 arch/arm/boards/panda/env/boot/mmc                      | 2 +-
 arch/arm/boards/pcm037/env/boot/nand-ubi                | 2 +-
 arch/arm/boards/pcm038/env/boot/nand-ubi                | 2 +-
 arch/arm/boards/pcm043/env/boot/nand-ubi                | 2 +-
 arch/arm/boards/pcm051/env/boot/sd                      | 2 +-
 arch/arm/boards/telit-evk-pro3/env/boot/nand-ubi        | 2 +-
 defaultenv-2/base/boot/net                              | 2 +-
 defaultenv-2/base/data/boot-template                    | 2 +-
 defaultenv-2/menu/menu/boot-entries-collect             | 4 ++--
 defaultenv-2/menu/menu/boot-entries-edit                | 2 +-
 defaultenv-2/menu/menu/boot-entries-remove              | 2 +-
 defaultenv-2/menu/menu/boot-menu-add-entry              | 6 +++---
 defaultenv-2/menu/menu/mainmenu                         | 2 +-
 27 files changed, 30 insertions(+), 30 deletions(-)

diff --git a/arch/arm/boards/at91sam9m10ihd/env/boot/android b/arch/arm/boards/at91sam9m10ihd/env/boot/android
index e440f18..e7387c5 100644
--- a/arch/arm/boards/at91sam9m10ihd/env/boot/android
+++ b/arch/arm/boards/at91sam9m10ihd/env/boot/android
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 if [ "$1" = menu ]; then
-	boot-menu-add-entry "$0" "android (nand)"
+	boot-menu-add-entry "$0" "android (nand)" "$2"
 	exit
 fi
 
diff --git a/arch/arm/boards/at91sam9m10ihd/env/boot/mmc b/arch/arm/boards/at91sam9m10ihd/env/boot/mmc
index 89c66ee..1ed98e3 100644
--- a/arch/arm/boards/at91sam9m10ihd/env/boot/mmc
+++ b/arch/arm/boards/at91sam9m10ihd/env/boot/mmc
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 if [ "$1" = menu ]; then
-	boot-menu-add-entry "$0" "MMC slot"
+	boot-menu-add-entry "$0" "MMC slot" "$2"
 	exit
 fi
 
diff --git a/arch/arm/boards/at91sam9m10ihd/env/boot/net b/arch/arm/boards/at91sam9m10ihd/env/boot/net
index cdb2520..35f0a54 100644
--- a/arch/arm/boards/at91sam9m10ihd/env/boot/net
+++ b/arch/arm/boards/at91sam9m10ihd/env/boot/net
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 if [ "$1" = menu ]; then
-	boot-menu-add-entry "$0" "network (tftp, nfs) (macb)"
+	boot-menu-add-entry "$0" "network (tftp, nfs) (macb)" "$2"
 	exit
 fi
 
diff --git a/arch/arm/boards/at91sam9m10ihd/env/boot/net-usb b/arch/arm/boards/at91sam9m10ihd/env/boot/net-usb
index 6e341a0..c4c01c3 100644
--- a/arch/arm/boards/at91sam9m10ihd/env/boot/net-usb
+++ b/arch/arm/boards/at91sam9m10ihd/env/boot/net-usb
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 if [ "$1" = menu ]; then
-	boot-menu-add-entry "$0" "network (tftp, nfs) (usb ethernet)"
+	boot-menu-add-entry "$0" "network (tftp, nfs) (usb ethernet)" "$2"
 	exit
 fi
 
diff --git a/arch/arm/boards/beagle/env/boot/mmc b/arch/arm/boards/beagle/env/boot/mmc
index 58bd557..d1a5486 100644
--- a/arch/arm/boards/beagle/env/boot/mmc
+++ b/arch/arm/boards/beagle/env/boot/mmc
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 if [ "$1" = menu ]; then
-	boot-menu-add-entry "$0" "MMC (ext3)"
+	boot-menu-add-entry "$0" "MMC (ext3)" "$2"
 	exit
 fi
 
diff --git a/arch/arm/boards/beagle/env/boot/nand-ubi b/arch/arm/boards/beagle/env/boot/nand-ubi
index 3037fd4..f0e932b 100644
--- a/arch/arm/boards/beagle/env/boot/nand-ubi
+++ b/arch/arm/boards/beagle/env/boot/nand-ubi
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 if [ "$1" = menu ]; then
-	boot-menu-add-entry "$0" "nand (UBI)"
+	boot-menu-add-entry "$0" "nand (UBI)" "$2"
 	exit
 fi
 
diff --git a/arch/arm/boards/beagle/env/boot/nand-ubi-dt b/arch/arm/boards/beagle/env/boot/nand-ubi-dt
index b7a1f19..e7539b8 100644
--- a/arch/arm/boards/beagle/env/boot/nand-ubi-dt
+++ b/arch/arm/boards/beagle/env/boot/nand-ubi-dt
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 if [ "$1" = menu ]; then
-	boot-menu-add-entry "$0" "nand (UBI)"
+	boot-menu-add-entry "$0" "nand (UBI)" "$2"
 	exit
 fi
 
diff --git a/arch/arm/boards/beaglebone/env/boot/sd b/arch/arm/boards/beaglebone/env/boot/sd
index dce0605..6315e08 100644
--- a/arch/arm/boards/beaglebone/env/boot/sd
+++ b/arch/arm/boards/beaglebone/env/boot/sd
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 if [ "$1" = menu ]; then
-	boot-menu-add-entry "$0" "kernel & rootfs on SD card"
+	boot-menu-add-entry "$0" "kernel & rootfs on SD card" "$2"
 	exit
 fi
 
diff --git a/arch/arm/boards/clep7212/env/boot/nor b/arch/arm/boards/clep7212/env/boot/nor
index df8c983..cca2bfa 100644
--- a/arch/arm/boards/clep7212/env/boot/nor
+++ b/arch/arm/boards/clep7212/env/boot/nor
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 if [ "$1" = menu ]; then
-	boot-menu-add-entry "$0" "NOR Flash"
+	boot-menu-add-entry "$0" "NOR Flash" "$2"
 	exit
 fi
 
diff --git a/arch/arm/boards/crystalfontz-cfa10036/env/boot/mmc-ext3 b/arch/arm/boards/crystalfontz-cfa10036/env/boot/mmc-ext3
index 4d830ed..b600a56 100644
--- a/arch/arm/boards/crystalfontz-cfa10036/env/boot/mmc-ext3
+++ b/arch/arm/boards/crystalfontz-cfa10036/env/boot/mmc-ext3
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 if [ "$1" = menu ]; then
-	boot-menu-add-entry "$0" "MMC (ext)"
+	boot-menu-add-entry "$0" "MMC (ext)" "$2"
 	exit
 fi
 
diff --git a/arch/arm/boards/efika-mx-smartbook/env/boot/hd-internal b/arch/arm/boards/efika-mx-smartbook/env/boot/hd-internal
index ccd0f69..564f10e 100644
--- a/arch/arm/boards/efika-mx-smartbook/env/boot/hd-internal
+++ b/arch/arm/boards/efika-mx-smartbook/env/boot/hd-internal
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 if [ "$1" = menu ]; then
-	boot-menu-add-entry "$0" "internal harddisk"
+	boot-menu-add-entry "$0" "internal harddisk" "$2"
 	exit
 fi
 
diff --git a/arch/arm/boards/efika-mx-smartbook/env/boot/mmc-left b/arch/arm/boards/efika-mx-smartbook/env/boot/mmc-left
index 21935c6..6bba754 100644
--- a/arch/arm/boards/efika-mx-smartbook/env/boot/mmc-left
+++ b/arch/arm/boards/efika-mx-smartbook/env/boot/mmc-left
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 if [ "$1" = menu ]; then
-	boot-menu-add-entry "$0" "left MMC slot"
+	boot-menu-add-entry "$0" "left MMC slot" "$2"
 	exit
 fi
 
diff --git a/arch/arm/boards/guf-vincell/env/boot/nand-ubi b/arch/arm/boards/guf-vincell/env/boot/nand-ubi
index a3f748e..1745e58 100644
--- a/arch/arm/boards/guf-vincell/env/boot/nand-ubi
+++ b/arch/arm/boards/guf-vincell/env/boot/nand-ubi
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 if [ "$1" = menu ]; then
-	boot-menu-add-entry "$0" "nand (UBI)"
+	boot-menu-add-entry "$0" "nand (UBI)" "$2"
 	exit
 fi
 
diff --git a/arch/arm/boards/karo-tx25/env/boot/nand-ubi b/arch/arm/boards/karo-tx25/env/boot/nand-ubi
index 67b0cb4..a6f6d7a 100644
--- a/arch/arm/boards/karo-tx25/env/boot/nand-ubi
+++ b/arch/arm/boards/karo-tx25/env/boot/nand-ubi
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 if [ "$1" = menu ]; then
-	boot-menu-add-entry "$0" "nand (UBI)"
+	boot-menu-add-entry "$0" "nand (UBI)" "$2"
 	exit
 fi
 
diff --git a/arch/arm/boards/panda/env/boot/mmc b/arch/arm/boards/panda/env/boot/mmc
index 58bd557..d1a5486 100644
--- a/arch/arm/boards/panda/env/boot/mmc
+++ b/arch/arm/boards/panda/env/boot/mmc
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 if [ "$1" = menu ]; then
-	boot-menu-add-entry "$0" "MMC (ext3)"
+	boot-menu-add-entry "$0" "MMC (ext3)" "$2"
 	exit
 fi
 
diff --git a/arch/arm/boards/pcm037/env/boot/nand-ubi b/arch/arm/boards/pcm037/env/boot/nand-ubi
index 67b0cb4..a6f6d7a 100644
--- a/arch/arm/boards/pcm037/env/boot/nand-ubi
+++ b/arch/arm/boards/pcm037/env/boot/nand-ubi
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 if [ "$1" = menu ]; then
-	boot-menu-add-entry "$0" "nand (UBI)"
+	boot-menu-add-entry "$0" "nand (UBI)" "$2"
 	exit
 fi
 
diff --git a/arch/arm/boards/pcm038/env/boot/nand-ubi b/arch/arm/boards/pcm038/env/boot/nand-ubi
index 67b0cb4..a6f6d7a 100644
--- a/arch/arm/boards/pcm038/env/boot/nand-ubi
+++ b/arch/arm/boards/pcm038/env/boot/nand-ubi
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 if [ "$1" = menu ]; then
-	boot-menu-add-entry "$0" "nand (UBI)"
+	boot-menu-add-entry "$0" "nand (UBI)" "$2"
 	exit
 fi
 
diff --git a/arch/arm/boards/pcm043/env/boot/nand-ubi b/arch/arm/boards/pcm043/env/boot/nand-ubi
index 67b0cb4..a6f6d7a 100644
--- a/arch/arm/boards/pcm043/env/boot/nand-ubi
+++ b/arch/arm/boards/pcm043/env/boot/nand-ubi
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 if [ "$1" = menu ]; then
-	boot-menu-add-entry "$0" "nand (UBI)"
+	boot-menu-add-entry "$0" "nand (UBI)" "$2"
 	exit
 fi
 
diff --git a/arch/arm/boards/pcm051/env/boot/sd b/arch/arm/boards/pcm051/env/boot/sd
index f303c10..9debd73 100644
--- a/arch/arm/boards/pcm051/env/boot/sd
+++ b/arch/arm/boards/pcm051/env/boot/sd
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 if [ "$1" = menu ]; then
-	boot-menu-add-entry "$0" "kernel & rootfs on SD card"
+	boot-menu-add-entry "$0" "kernel & rootfs on SD card" "$2"
 	exit
 fi
 
diff --git a/arch/arm/boards/telit-evk-pro3/env/boot/nand-ubi b/arch/arm/boards/telit-evk-pro3/env/boot/nand-ubi
index 1987492..ffc64f1 100644
--- a/arch/arm/boards/telit-evk-pro3/env/boot/nand-ubi
+++ b/arch/arm/boards/telit-evk-pro3/env/boot/nand-ubi
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 if [ "$1" = menu ]; then
-	boot-menu-add-entry "$0" "nand (UBI)"
+	boot-menu-add-entry "$0" "nand (UBI)" "$2"
 	exit
 fi
 
diff --git a/defaultenv-2/base/boot/net b/defaultenv-2/base/boot/net
index 90c25aa..25d2d12 100644
--- a/defaultenv-2/base/boot/net
+++ b/defaultenv-2/base/boot/net
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 if [ "$1" = menu ]; then
-	boot-menu-add-entry "$0" "network (tftp, nfs)"
+	boot-menu-add-entry "$0" "network (tftp, nfs)" "$2"
 	exit
 fi
 
diff --git a/defaultenv-2/base/data/boot-template b/defaultenv-2/base/data/boot-template
index 9297499..2b3e018 100644
--- a/defaultenv-2/base/data/boot-template
+++ b/defaultenv-2/base/data/boot-template
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 if [ "$1" = menu ]; then
-	boot-menu-add-entry "$0" "<menu text here>"
+	boot-menu-add-entry "$0" "<menu text here>" "$2"
 	exit
 fi
 
diff --git a/defaultenv-2/menu/menu/boot-entries-collect b/defaultenv-2/menu/menu/boot-entries-collect
index c066c93..ba82bf1 100644
--- a/defaultenv-2/menu/menu/boot-entries-collect
+++ b/defaultenv-2/menu/menu/boot-entries-collect
@@ -2,11 +2,11 @@
 
 cd /env/boot
 
-./$global.boot.default menu
+./$global.boot.default menu $1
 
 for i in *; do
 	if [ "$i" != "$global.boot.default" ]; then
-		./$i menu
+		./$i menu $1
 	fi
 done
 
diff --git a/defaultenv-2/menu/menu/boot-entries-edit b/defaultenv-2/menu/menu/boot-entries-edit
index c4e1c3d..16586be 100644
--- a/defaultenv-2/menu/menu/boot-entries-edit
+++ b/defaultenv-2/menu/menu/boot-entries-edit
@@ -5,7 +5,7 @@ export menu_exit=false
 while true; do
 	menu -a -m boot_entries_edit -d "\e[1;36mEdit boot entries\e[0m"
 
-	boot-entries-collect
+	boot-entries-collect boot_entries_edit
 
 	menu -e -a -m boot_entries_edit -c "boot-menu-new-boot-entry" -d "Add a new entry"
 	menu -e -a -m boot_entries_edit -c "boot-entries-remove" -d "Remove an entry"
diff --git a/defaultenv-2/menu/menu/boot-entries-remove b/defaultenv-2/menu/menu/boot-entries-remove
index 566be9d..2fe8265 100644
--- a/defaultenv-2/menu/menu/boot-entries-remove
+++ b/defaultenv-2/menu/menu/boot-entries-remove
@@ -5,7 +5,7 @@ export menu_exit=false
 while true; do
 	menu -a -m boot_entries_remove -d "\e[1;36mRemove Boot entry\e[0m"
 
-	boot-entries-collect
+	boot-entries-collect boot_entries_remove
 
 	menu -e -a -m boot_entries_remove -c "menu_exit=true" -d "back"
 
diff --git a/defaultenv-2/menu/menu/boot-menu-add-entry b/defaultenv-2/menu/menu/boot-menu-add-entry
index f06c524..f634b5c 100644
--- a/defaultenv-2/menu/menu/boot-menu-add-entry
+++ b/defaultenv-2/menu/menu/boot-menu-add-entry
@@ -1,5 +1,5 @@
 #!/bin/sh
 
-menu -e -a -m boot -c "boot -v $1; echo; readline \"press enter to continue\" a " -d "Boot: ${GREEN}$2${NC}"
-menu -e -a -m boot_entries_edit -c "$global.editcmd /env/boot/$1" -d "${GREEN}$2${NC}"
-menu -e -a -m boot_entries_remove -c "rm /env/boot/$1" -d "${GREEN}$2${NC}"
+[ "$3" = boot                ] && menu -e -a -m "$3" -c "boot -v $1; echo; readline \"press enter to continue\" a " -d "Boot: ${GREEN}$2${NC}"
+[ "$3" = boot_entries_edit   ] && menu -e -a -m "$3" -c "$global.editcmd /env/boot/$1" -d "${GREEN}$2${NC}"
+[ "$3" = boot_entries_remove ] && menu -e -a -m "$3" -c "rm /env/boot/$1" -d "${GREEN}$2${NC}"
diff --git a/defaultenv-2/menu/menu/mainmenu b/defaultenv-2/menu/menu/mainmenu
index c74cc9c..aa7626b 100644
--- a/defaultenv-2/menu/menu/mainmenu
+++ b/defaultenv-2/menu/menu/mainmenu
@@ -12,7 +12,7 @@ while true; do
 
 	menu -a -m boot -d "${CYAN}Welcome to Barebox${NC}"
 
-	boot-entries-collect
+	boot-entries-collect boot
 
 	menu -e -a -R -m boot -c "$global.editcmd /env/network/eth0" -d "Network settings"
 	menu -e -a -R -m boot -c "$global.editcmd /env/config" -d "Config settings"
-- 
1.8.1.5


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* [PATCH 8/9] archos: add atag appender for all features
  2013-03-09 23:19 [PATCH 0/9] Add support for booting ArchosG9 from sd-card Vicente Bergas
                   ` (6 preceding siblings ...)
  2013-03-09 23:19 ` [PATCH 7/9] menu: avoid errors when building submenus Vicente Bergas
@ 2013-03-09 23:19 ` Vicente Bergas
  2013-03-11  8:36   ` Sascha Hauer
  2013-03-09 23:19 ` [PATCH 9/9] archosg9: enable booting from sd-card Vicente Bergas
  2013-03-11 21:25 ` [PATCH 0/9] Add support for booting ArchosG9 " Sascha Hauer
  9 siblings, 1 reply; 22+ messages in thread
From: Vicente Bergas @ 2013-03-09 23:19 UTC (permalink / raw)
  To: barebox; +Cc: Vicente Bergas


Signed-off-by: Vicente Bergas <vicencb@gmail.com>
---
 arch/arm/boards/archosg9/archos_features.c | 414 ++++++++++++++++++++++++++---
 arch/arm/boards/archosg9/archos_features.h |  39 +++
 2 files changed, 412 insertions(+), 41 deletions(-)

diff --git a/arch/arm/boards/archosg9/archos_features.c b/arch/arm/boards/archosg9/archos_features.c
index 5d93403..4b0265e 100644
--- a/arch/arm/boards/archosg9/archos_features.c
+++ b/arch/arm/boards/archosg9/archos_features.c
@@ -27,144 +27,448 @@ static void setup_feature_core(void)
 	features->hdr.tag = FTAG_CORE;
 	features->hdr.size = feature_tag_size(feature_tag_core);
 
+	memset(&features->u.core, 0, sizeof(features->u.core));
 	features->u.core.magic = FEATURE_LIST_MAGIC;
 	features->u.core.list_revision = FEATURE_LIST_REV;
-	features->u.core.flags = 0;
 
 	features = feature_tag_next(features);
 }
 static void setup_feature_product_name(void)
 {
+#ifdef INSERT_ATAG_PRODUCT_NAME
 	features->hdr.tag = FTAG_PRODUCT_NAME;
 	features->hdr.size = feature_tag_size(feature_tag_product_name);
 
-	memset(features->u.product_name.name, 0,
-		sizeof(features->u.product_name.name));
+	memset(&features->u.product_name, 0, sizeof(features->u.product_name));
 	sprintf(features->u.product_name.name, "A80S");
 	features->u.product_name.id = 0x13A8;
 
 	features = feature_tag_next(features);
+#endif
 }
 static void setup_feature_product_serial_number(void)
 {
+#ifdef INSERT_ATAG_PRODUCT_SERIAL_NUMBER
 	features->hdr.tag = FTAG_PRODUCT_SERIAL_NUMBER;
 	features->hdr.size = feature_tag_size(feature_tag_product_serial);
 
-	features->u.product_serial.serial[0] = 0;
-	features->u.product_serial.serial[1] = 0;
-	features->u.product_serial.serial[2] = 0;
-	features->u.product_serial.serial[3] = 0;
+	memset(&features->u.product_serial, 0,
+		sizeof(features->u.product_serial));
 
 	features = feature_tag_next(features);
+#endif
 }
 static void setup_feature_product_mac_address(void)
 {
+#ifdef INSERT_ATAG_PRODUCT_MAC_ADDRESS
 	features->hdr.tag = FTAG_PRODUCT_MAC_ADDRESS;
 	features->hdr.size = feature_tag_size(feature_tag_product_mac_address);
 
-	features->u.mac_address.addr[0] = 0;
-	features->u.mac_address.addr[1] = 0;
-	features->u.mac_address.addr[2] = 0;
-	features->u.mac_address.addr[3] = 0;
-	features->u.mac_address.addr[4] = 0;
-	features->u.mac_address.addr[5] = 0;
-	features->u.mac_address.reserved1 = 0;
-	features->u.mac_address.reserved2 = 0;
+	memset(&features->u.mac_address, 0, sizeof(features->u.mac_address));
 
 	features = feature_tag_next(features);
+#endif
 }
 static void setup_feature_board_pcb_revision(void)
 {
+#ifdef INSERT_ATAG_BOARD_PCB_REVISION
 	features->hdr.tag = FTAG_BOARD_PCB_REVISION;
 	features->hdr.size = feature_tag_size(feature_tag_board_revision);
 
+	memset(&features->u.board_revision, 0,
+		sizeof(features->u.board_revision));
 	features->u.board_revision.revision = 5;
 
 	features = feature_tag_next(features);
+#endif
 }
 static void setup_feature_sdram(void)
 {
+#ifdef INSERT_ATAG_SDRAM
 	features->hdr.tag = FTAG_SDRAM;
 	features->hdr.size = feature_tag_size(feature_tag_sdram);
 
-	memset(features->u.sdram.vendor, 0, sizeof(features->u.sdram.vendor));
-	memset(features->u.sdram.product, 0,
-		sizeof(features->u.sdram.product));
+	memset(&features->u.sdram, 0, sizeof(features->u.sdram));
 	sprintf(features->u.sdram.vendor , "elpida");
-	sprintf(features->u.sdram.product, "EDB8064B1PB"/*"EDB4064B2PB"*/);
-	features->u.sdram.type     = 0;
-	features->u.sdram.revision = 0;
-	features->u.sdram.flags    = 0;
+	sprintf(features->u.sdram.product, "EDB8064B1PB");
 	features->u.sdram.clock    = 400;
-	features->u.sdram.param_0  = 0;
-	features->u.sdram.param_1  = 0;
-	features->u.sdram.param_2  = 0;
-	features->u.sdram.param_3  = 0;
-	features->u.sdram.param_4  = 0;
-	features->u.sdram.param_5  = 0;
-	features->u.sdram.param_6  = 0;
-	features->u.sdram.param_7  = 0;
 
 	features = feature_tag_next(features);
+#endif
 }
 static void setup_feature_pmic(void)
 {
+#ifdef INSERT_ATAG_PMIC
 	features->hdr.tag = FTAG_PMIC;
 	features->hdr.size = feature_tag_size(feature_tag_pmic);
 
+	memset(&features->u.pmic, 0, sizeof(features->u.pmic));
 	features->u.pmic.flags = FTAG_PMIC_TPS62361;
 
 	features = feature_tag_next(features);
+#endif
 }
 static void setup_feature_serial_port(void)
 {
+#ifdef INSERT_ATAG_SERIAL_PORT
 	features->hdr.tag = FTAG_SERIAL_PORT;
 	features->hdr.size = feature_tag_size(feature_tag_serial_port);
 
+	memset(&features->u.serial_port, 0, sizeof(features->u.serial_port));
 	features->u.serial_port.uart_id = 1;
 	features->u.serial_port.speed = 115200;
 
 	features = feature_tag_next(features);
+#endif
 }
 static void setup_feature_has_gpio_volume_keys(void)
 {
+#ifdef INSERT_ATAG_HAS_GPIO_VOLUME_KEYS
 	features->hdr.tag = FTAG_HAS_GPIO_VOLUME_KEYS;
 	features->hdr.size = feature_tag_size(feature_tag_gpio_volume_keys);
 
+	memset(&features->u.gpio_volume_keys, 0,
+		sizeof(features->u.gpio_volume_keys));
 	features->u.gpio_volume_keys.gpio_vol_up   = 0x2B;
 	features->u.gpio_volume_keys.gpio_vol_down = 0x2C;
-	features->u.gpio_volume_keys.flags = 0;
 
 	features = feature_tag_next(features);
+#endif
 }
 static void setup_feature_screen(void)
 {
+#ifdef INSERT_ATAG_SCREEN
 	features->hdr.tag = FTAG_SCREEN;
 	features->hdr.size = feature_tag_size(feature_tag_screen);
 
-	memset(features->u.screen.vendor, 0,
-		sizeof(features->u.screen.vendor));
+	memset(&features->u.screen, 0, sizeof(features->u.screen));
 	sprintf(features->u.screen.vendor, "CMI");
-	features->u.screen.type = 0;
-	features->u.screen.revision = 0;
-	features->u.screen.vcom = 0;
 	features->u.screen.backlight = 0xC8;
-	features->u.screen.reserved[0] = 0;
-	features->u.screen.reserved[1] = 0;
-	features->u.screen.reserved[2] = 0;
-	features->u.screen.reserved[3] = 0;
-	features->u.screen.reserved[4] = 0;
 
 	features = feature_tag_next(features);
+#endif
 }
 static void setup_feature_turbo(void)
 {
+#ifdef INSERT_ATAG_TURBO
 	features->hdr.tag = FTAG_TURBO;
 	features->hdr.size = feature_tag_size(feature_tag_turbo);
 
+	memset(&features->u.turbo, 0, sizeof(features->u.turbo));
 	features->u.turbo.flag = 1;
 
 	features = feature_tag_next(features);
+#endif
+}
+static void setup_feature_product_oem(void)
+{
+#ifdef INSERT_ATAG_PRODUCT_OEM
+	features->hdr.tag = FTAG_PRODUCT_OEM;
+	features->hdr.size = feature_tag_size(feature_tag_product_oem);
+
+	memset(&features->u.product_oem, 0, sizeof(features->u.product_oem));
+
+	features = feature_tag_next(features);
+#endif
+}
+static void setup_feature_product_zone(void)
+{
+#ifdef INSERT_ATAG_PRODUCT_ZONE
+	features->hdr.tag = FTAG_PRODUCT_ZONE;
+	features->hdr.size = feature_tag_size(feature_tag_product_zone);
+
+	memset(&features->u.product_zone, 0, sizeof(features->u.product_zone));
+
+	features = feature_tag_next(features);
+#endif
+}
+static void setup_feature_clock(void)
+{
+#ifdef INSERT_ATAG_CLOCK
+	features->hdr.tag = FTAG_CLOCK;
+	features->hdr.size = feature_tag_size(feature_tag_clock);
+
+	memset(&features->u.clock, 0, sizeof(features->u.clock));
+
+	features = feature_tag_next(features);
+#endif
+}
+static void setup_feature_dcin(void)
+{
+#ifdef INSERT_ATAG_DCIN
+	features->hdr.tag = FTAG_HAS_DCIN;
+	features->hdr.size = feature_tag_size(feature_tag_dcin);
+
+	memset(&features->u.dcin, 0, sizeof(features->u.dcin));
+
+	features = feature_tag_next(features);
+#endif
+}
+static void setup_feature_ext_screen(void)
+{
+#ifdef INSERT_ATAG_EXT_SCREEN
+	features->hdr.tag = FTAG_HAS_EXT_SCREEN;
+	features->hdr.size = feature_tag_size(feature_tag_ext_screen);
+
+	memset(&features->u.ext_screen, 0, sizeof(features->u.ext_screen));
+
+	features = feature_tag_next(features);
+#endif
+}
+static void setup_feature_wifi(void)
+{
+#ifdef INSERT_ATAG_WIFI
+	features->hdr.tag = FTAG_HAS_WIFI;
+	features->hdr.size = feature_tag_size(feature_tag_wifi);
+
+	memset(&features->u.wifi, 0, sizeof(features->u.wifi));
+
+	features = feature_tag_next(features);
+#endif
+}
+static void setup_feature_bluetooth(void)
+{
+#ifdef INSERT_ATAG_BLUETOOTH
+	features->hdr.tag = FTAG_HAS_BLUETOOTH;
+	features->hdr.size = feature_tag_size(feature_tag_bluetooth);
+
+	memset(&features->u.bluetooth, 0, sizeof(features->u.bluetooth));
+
+	features = feature_tag_next(features);
+#endif
+}
+static void setup_feature_accelerometer(void)
+{
+#ifdef INSERT_ATAG_ACCELEROMETER
+	features->hdr.tag = FTAG_HAS_ACCELEROMETER;
+	features->hdr.size = feature_tag_size(feature_tag_accelerometer);
+
+	memset(&features->u.accelerometer, 0,
+		sizeof(features->u.accelerometer));
+
+	features = feature_tag_next(features);
+#endif
+}
+static void setup_feature_gps(void)
+{
+#ifdef INSERT_ATAG_GPS
+	features->hdr.tag = FTAG_HAS_GPS;
+	features->hdr.size = feature_tag_size(feature_tag_gps);
+
+	memset(&features->u.gps, 0, sizeof(features->u.gps));
+
+	features = feature_tag_next(features);
+#endif
+}
+static void setup_feature_harddisk_controller(void)
+{
+#ifdef INSERT_ATAG_HARDDISK_CONTROLLER
+	features->hdr.tag = FTAG_HAS_HARDDISK_CONTROLLER;
+	features->hdr.size = feature_tag_size(feature_tag_harddisk_controller);
+
+	memset(&features->u.harddisk_controller, 0,
+		sizeof(features->u.harddisk_controller));
+
+	features = feature_tag_next(features);
+#endif
+}
+static void setup_feature_harddisk(void)
+{
+#ifdef INSERT_ATAG_HARDDISK
+	features->hdr.tag = FTAG_HAS_HARDDISK;
+	features->hdr.size = feature_tag_size(feature_tag_harddisk);
+
+	memset(&features->u.harddisk, 0, sizeof(features->u.harddisk));
+
+	features = feature_tag_next(features);
+#endif
+}
+static void setup_feature_touchscreen(void)
+{
+#ifdef INSERT_ATAG_TOUCHSCREEN
+	features->hdr.tag = FTAG_HAS_TOUCHSCREEN;
+	features->hdr.size = feature_tag_size(feature_tag_touchscreen);
+
+	memset(&features->u.touchscreen, 0, sizeof(features->u.touchscreen));
+
+	features = feature_tag_next(features);
+#endif
+}
+static void setup_feature_mmcsd(void)
+{
+#ifdef INSERT_ATAG_MMCSD
+	features->hdr.tag = FTAG_HAS_EXT_MMCSD_SLOT;
+	features->hdr.size = feature_tag_size(feature_tag_mmcsd);
+
+	memset(&features->u.mmcsd, 0, sizeof(features->u.mmcsd));
+
+	features = feature_tag_next(features);
+#endif
+}
+static void setup_feature_gpio_keys(void)
+{
+#ifdef INSERT_ATAG_GPIO_KEYS
+	features->hdr.tag = FTAG_GPIO_KEYS;
+	features->hdr.size = feature_tag_size(feature_tag_gpio_keys);
+
+	memset(&features->u.gpio_keys, 0, sizeof(features->u.gpio_keys));
+
+	features = feature_tag_next(features);
+#endif
+}
+static void setup_feature_wifi_pa(void)
+{
+#ifdef INSERT_ATAG_WIFI_PA
+	features->hdr.tag = FTAG_WIFI_PA;
+	features->hdr.size = feature_tag_size(feature_tag_wifi_pa);
+
+	memset(&features->u.wifi_pa, 0, sizeof(features->u.wifi_pa));
+
+	features = feature_tag_next(features);
+#endif
+}
+static void setup_feature_speaker(void)
+{
+#ifdef INSERT_ATAG_SPEAKER
+	features->hdr.tag = FTAG_HAS_SPEAKER;
+	features->hdr.size = feature_tag_size(feature_tag_speaker);
+
+	memset(&features->u.speaker, 0, sizeof(features->u.speaker));
+
+	features = feature_tag_next(features);
+#endif
+}
+static void setup_feature_battery(void)
+{
+#ifdef INSERT_ATAG_BATTERY
+	features->hdr.tag = FTAG_BATTERY;
+	features->hdr.size = feature_tag_size(feature_tag_battery);
+
+	memset(&features->u.battery, 0, sizeof(features->u.battery));
+
+	features = feature_tag_next(features);
+#endif
+}
+static void setup_feature_electrical_shortcut(void)
+{
+#ifdef INSERT_ATAG_ELECTRICAL_SHORTCUT
+	features->hdr.tag = FTAG_HAS_ELECTRICAL_SHORTCUT;
+	features->hdr.size = feature_tag_size(feature_tag_generic);
+
+	memset(&features->u.generic, 0, sizeof(features->u.generic));
+
+	features = feature_tag_next(features);
+#endif
+}
+static void setup_feature_gyroscope(void)
+{
+#ifdef INSERT_ATAG_GYROSCOPE
+	features->hdr.tag = FTAG_HAS_GYROSCOPE;
+	features->hdr.size = feature_tag_size(feature_tag_generic);
+
+	memset(&features->u.generic, 0, sizeof(features->u.generic));
+
+	features = feature_tag_next(features);
+#endif
+}
+static void setup_feature_compass(void)
+{
+#ifdef INSERT_ATAG_COMPASS
+	features->hdr.tag = FTAG_HAS_COMPASS;
+	features->hdr.size = feature_tag_size(feature_tag_generic);
+
+	memset(&features->u.generic, 0, sizeof(features->u.generic));
+
+	features = feature_tag_next(features);
+#endif
+}
+static void setup_feature_camera(void)
+{
+#ifdef INSERT_ATAG_CAMERA
+	features->hdr.tag = FTAG_HAS_CAMERA;
+	features->hdr.size = feature_tag_size(feature_tag_generic);
+
+	memset(&features->u.generic, 0, sizeof(features->u.generic));
+
+	features = feature_tag_next(features);
+#endif
+}
+static void setup_feature_microphone(void)
+{
+#ifdef INSERT_ATAG_MICROPHONE
+	features->hdr.tag = FTAG_HAS_MICROPHONE;
+	features->hdr.size = feature_tag_size(feature_tag_generic);
+
+	memset(&features->u.generic, 0, sizeof(features->u.generic));
+
+	features = feature_tag_next(features);
+#endif
+}
+static void setup_feature_ambient_light_sensor(void)
+{
+#ifdef INSERT_ATAG_AMBIENT_LIGHT_SENSOR
+	features->hdr.tag = FTAG_HAS_AMBIENT_LIGHT_SENSOR;
+	features->hdr.size = feature_tag_size(feature_tag_generic);
+
+	memset(&features->u.generic, 0, sizeof(features->u.generic));
+
+	features = feature_tag_next(features);
+#endif
+}
+static void setup_feature_proximity_sensor(void)
+{
+#ifdef INSERT_ATAG_PROXIMITY_SENSOR
+	features->hdr.tag = FTAG_HAS_PROXIMITY_SENSOR;
+	features->hdr.size = feature_tag_size(feature_tag_generic);
+
+	memset(&features->u.generic, 0, sizeof(features->u.generic));
+
+	features = feature_tag_next(features);
+#endif
+}
+static void setup_feature_gsm(void)
+{
+#ifdef INSERT_ATAG_GSM
+	features->hdr.tag = FTAG_HAS_GSM;
+	features->hdr.size = feature_tag_size(feature_tag_generic);
+
+	memset(&features->u.generic, 0, sizeof(features->u.generic));
+
+	features = feature_tag_next(features);
+#endif
+}
+static void setup_feature_dect(void)
+{
+#ifdef INSERT_ATAG_DECT
+	features->hdr.tag = FTAG_HAS_DECT;
+	features->hdr.size = feature_tag_size(feature_tag_generic);
+
+	memset(&features->u.generic, 0, sizeof(features->u.generic));
+
+	features = feature_tag_next(features);
+#endif
+}
+static void setup_feature_hsdpa(void)
+{
+#ifdef INSERT_ATAG_HSDPA
+	features->hdr.tag = FTAG_HAS_HSDPA;
+	features->hdr.size = feature_tag_size(feature_tag_generic);
+
+	memset(&features->u.generic, 0, sizeof(features->u.generic));
+
+	features = feature_tag_next(features);
+#endif
+}
+static void setup_feature_nfc(void)
+{
+#ifdef INSERT_ATAG_NFC
+	features->hdr.tag = FTAG_HAS_NFC;
+	features->hdr.size = feature_tag_size(feature_tag_generic);
+
+	memset(&features->u.generic, 0, sizeof(features->u.generic));
+
+	features = feature_tag_next(features);
+#endif
 }
 static void setup_feature_none(void)
 {
@@ -191,6 +495,34 @@ static struct tag *setup_feature_list(struct tag * params)
 	setup_feature_has_gpio_volume_keys();
 	setup_feature_screen();
 	setup_feature_turbo();
+	setup_feature_product_oem();
+	setup_feature_product_zone();
+	setup_feature_clock();
+	setup_feature_dcin();
+	setup_feature_ext_screen();
+	setup_feature_wifi();
+	setup_feature_bluetooth();
+	setup_feature_accelerometer();
+	setup_feature_gps();
+	setup_feature_harddisk_controller();
+	setup_feature_harddisk();
+	setup_feature_touchscreen();
+	setup_feature_mmcsd();
+	setup_feature_gpio_keys();
+	setup_feature_wifi_pa();
+	setup_feature_speaker();
+	setup_feature_battery();
+	setup_feature_electrical_shortcut();
+	setup_feature_gyroscope();
+	setup_feature_compass();
+	setup_feature_camera();
+	setup_feature_microphone();
+	setup_feature_ambient_light_sensor();
+	setup_feature_proximity_sensor();
+	setup_feature_gsm();
+	setup_feature_dect();
+	setup_feature_hsdpa();
+	setup_feature_nfc();
 	setup_feature_none();
 
 	fl->size = ((u32)features) - ((u32)(fl->data));
diff --git a/arch/arm/boards/archosg9/archos_features.h b/arch/arm/boards/archosg9/archos_features.h
index 5769c6c..a3e1437 100644
--- a/arch/arm/boards/archosg9/archos_features.h
+++ b/arch/arm/boards/archosg9/archos_features.h
@@ -1,6 +1,45 @@
 #ifndef __ARCHOS_FEATURES_H
 #define __ARCHOS_FEATURES_H
 
+#undef  INSERT_ATAG_PRODUCT_NAME
+#undef  INSERT_ATAG_PRODUCT_SERIAL_NUMBER
+#undef  INSERT_ATAG_PRODUCT_MAC_ADDRESS
+#undef  INSERT_ATAG_BOARD_PCB_REVISION
+#define INSERT_ATAG_SDRAM
+#undef  INSERT_ATAG_PMIC
+#define INSERT_ATAG_SERIAL_PORT
+#define INSERT_ATAG_HAS_GPIO_VOLUME_KEYS
+#define INSERT_ATAG_SCREEN
+#define INSERT_ATAG_TURBO
+#undef  INSERT_ATAG_PRODUCT_OEM
+#undef  INSERT_ATAG_PRODUCT_ZONE
+#undef  INSERT_ATAG_CLOCK
+#undef  INSERT_ATAG_DCIN
+#undef  INSERT_ATAG_EXT_SCREEN
+#undef  INSERT_ATAG_WIFI
+#undef  INSERT_ATAG_BLUETOOTH
+#undef  INSERT_ATAG_ACCELEROMETER
+#undef  INSERT_ATAG_GPS
+#undef  INSERT_ATAG_HARDDISK_CONTROLLER
+#undef  INSERT_ATAG_HARDDISK
+#undef  INSERT_ATAG_TOUCHSCREEN
+#undef  INSERT_ATAG_MMCSD
+#undef  INSERT_ATAG_GPIO_KEYS
+#undef  INSERT_ATAG_WIFI_PA
+#undef  INSERT_ATAG_SPEAKER
+#undef  INSERT_ATAG_BATTERY
+#undef  INSERT_ATAG_ELECTRICAL_SHORTCUT
+#undef  INSERT_ATAG_GYROSCOPE
+#undef  INSERT_ATAG_COMPASS
+#undef  INSERT_ATAG_CAMERA
+#undef  INSERT_ATAG_MICROPHONE
+#undef  INSERT_ATAG_AMBIENT_LIGHT_SENSOR
+#undef  INSERT_ATAG_PROXIMITY_SENSOR
+#undef  INSERT_ATAG_GSM
+#undef  INSERT_ATAG_DECT
+#undef  INSERT_ATAG_HSDPA
+#undef  INSERT_ATAG_NFC
+
 /* bootloader version */
 #define ATAG_BOOT_VERSION	0x5441000A
 
-- 
1.8.1.5


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* [PATCH 9/9] archosg9: enable booting from sd-card
  2013-03-09 23:19 [PATCH 0/9] Add support for booting ArchosG9 from sd-card Vicente Bergas
                   ` (7 preceding siblings ...)
  2013-03-09 23:19 ` [PATCH 8/9] archos: add atag appender for all features Vicente Bergas
@ 2013-03-09 23:19 ` Vicente Bergas
  2013-03-11 21:25 ` [PATCH 0/9] Add support for booting ArchosG9 " Sascha Hauer
  9 siblings, 0 replies; 22+ messages in thread
From: Vicente Bergas @ 2013-03-09 23:19 UTC (permalink / raw)
  To: barebox; +Cc: Vicente Bergas


Signed-off-by: Vicente Bergas <vicencb@gmail.com>
---
 arch/arm/boards/archosg9/board.c                  |  1 -
 arch/arm/boards/archosg9/env/boot/sd-card-android | 11 ++++
 arch/arm/boards/archosg9/env/boot/sd-card-linux   | 17 ++++++
 arch/arm/boards/archosg9/env/boot/usb-android     | 11 ++++
 arch/arm/boards/archosg9/env/boot/usb-linux       | 17 ++++++
 arch/arm/boards/archosg9/env/config               |  3 -
 arch/arm/boards/archosg9/env/init/automount       | 28 ++++++++++
 arch/arm/boards/archosg9/env/init/bootsource      | 11 ++++
 arch/arm/boards/archosg9/env/init/usbboot         |  6 --
 arch/arm/configs/archosg9_defconfig               | 67 ++++++++++++++++-------
 arch/arm/configs/archosg9_xload_defconfig         | 20 +++++--
 11 files changed, 155 insertions(+), 37 deletions(-)
 create mode 100644 arch/arm/boards/archosg9/env/boot/sd-card-android
 create mode 100644 arch/arm/boards/archosg9/env/boot/sd-card-linux
 create mode 100644 arch/arm/boards/archosg9/env/boot/usb-android
 create mode 100644 arch/arm/boards/archosg9/env/boot/usb-linux
 delete mode 100644 arch/arm/boards/archosg9/env/config
 create mode 100644 arch/arm/boards/archosg9/env/init/automount
 create mode 100644 arch/arm/boards/archosg9/env/init/bootsource
 delete mode 100644 arch/arm/boards/archosg9/env/init/usbboot

diff --git a/arch/arm/boards/archosg9/board.c b/arch/arm/boards/archosg9/board.c
index 8366cca..bf247de 100644
--- a/arch/arm/boards/archosg9/board.c
+++ b/arch/arm/boards/archosg9/board.c
@@ -49,7 +49,6 @@ static int archosg9_devices_init(void){
 	i2c_register_board_info(0, i2c_devices, ARRAY_SIZE(i2c_devices));
 	omap44xx_add_i2c1(NULL);
 	omap44xx_add_mmc1(NULL);
-	omap44xx_add_mmc2(NULL);
 
 	armlinux_set_bootparams((void *)0x80000100);
 	/*
diff --git a/arch/arm/boards/archosg9/env/boot/sd-card-android b/arch/arm/boards/archosg9/env/boot/sd-card-android
new file mode 100644
index 0000000..dc6f15e
--- /dev/null
+++ b/arch/arm/boards/archosg9/env/boot/sd-card-android
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+if [ "$1" = menu ]; then
+	boot-menu-add-entry "$0" "Android from SD card" "$2"
+	exit
+fi
+
+path=/mnt/sd
+global.bootm.image=${path}/android
+global.bootm.initrd=${path}/initramfs.cpio.lzo
+global.linux.bootargs.base="mem=512M init=/linuxrc debug omapdss.debug=0 omapfb.debug=0 mem=512M@0xa0000000"
diff --git a/arch/arm/boards/archosg9/env/boot/sd-card-linux b/arch/arm/boards/archosg9/env/boot/sd-card-linux
new file mode 100644
index 0000000..1ae7340
--- /dev/null
+++ b/arch/arm/boards/archosg9/env/boot/sd-card-linux
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+if [ "$1" = menu ]; then
+	boot-menu-add-entry "$0" "Linux from SD card" "$2"
+	exit
+fi
+
+path=/mnt/sd
+global.bootm.image=${path}/zImage
+initrd=${path}/initrd
+
+if [ -f ${initrd} ]; then
+	global.bootm.initrd=${initrd}
+	global.linux.bootargs.base="console=ttyO0,115200n8 root=/dev/ram0"
+else
+	global.linux.bootargs.base="console=ttyO0,115200n8 rootwait root=/dev/mmcblk0p2"
+fi
diff --git a/arch/arm/boards/archosg9/env/boot/usb-android b/arch/arm/boards/archosg9/env/boot/usb-android
new file mode 100644
index 0000000..f764681
--- /dev/null
+++ b/arch/arm/boards/archosg9/env/boot/usb-android
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+if [ "$1" = menu ]; then
+	boot-menu-add-entry "$0" "Android from usb" "$2"
+	exit
+fi
+
+path=/mnt/usb
+global.bootm.image=${path}/android
+global.bootm.initrd=${path}/initramfs.cpio.lzo
+global.linux.bootargs.base="mem=512M init=/linuxrc debug omapdss.debug=0 omapfb.debug=0 mem=512M@0xa0000000"
diff --git a/arch/arm/boards/archosg9/env/boot/usb-linux b/arch/arm/boards/archosg9/env/boot/usb-linux
new file mode 100644
index 0000000..1d8e919
--- /dev/null
+++ b/arch/arm/boards/archosg9/env/boot/usb-linux
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+if [ "$1" = menu ]; then
+	boot-menu-add-entry "$0" "Linux from usb" "$2"
+	exit
+fi
+
+path=/mnt/usb
+global.bootm.image=${path}/zImage
+initrd=${path}/initrd
+
+if [ -f ${initrd} ]; then
+	global.bootm.initrd=${initrd}
+	global.linux.bootargs.base="console=ttyO0,115200n8 root=/dev/ram0"
+else
+	global.linux.bootargs.base="console=ttyO0,115200n8"
+fi
diff --git a/arch/arm/boards/archosg9/env/config b/arch/arm/boards/archosg9/env/config
deleted file mode 100644
index 8f3edb0..0000000
--- a/arch/arm/boards/archosg9/env/config
+++ /dev/null
@@ -1,3 +0,0 @@
-global.bootm.image="${TARGET_ROOT}/boot/zImage"
-global.bootm.initrd="${TARGET_ROOT}/boot/initrd"
-global.linux.bootargs.base="console=ttyO0,115200n8 root=/dev/ram0"
diff --git a/arch/arm/boards/archosg9/env/init/automount b/arch/arm/boards/archosg9/env/init/automount
new file mode 100644
index 0000000..700b5e4
--- /dev/null
+++ b/arch/arm/boards/archosg9/env/init/automount
@@ -0,0 +1,28 @@
+#!/bin/sh
+
+if [ "$1" = menu ]; then
+	init-menu-add-entry "$0" "Automountpoints"
+	exit
+fi
+
+# automount tftp server based on $eth0.serverip
+
+mkdir -p /mnt/tftp
+automount /mnt/tftp 'ifup eth0 && mount -t tftp $eth0.serverip /mnt/tftp'
+
+# automount nfs server example
+
+#nfshost=somehost
+#mkdir -p /mnt/${nfshost}
+#automount /mnt/$nfshost "ifup eth0 && mount -t nfs ${nfshost}:/tftpboot /mnt/${nfshost}"
+
+# FAT on usb disk example
+
+#mkdir -p /mnt/fat
+#automount -d /mnt/fat 'usb && [ -e /dev/disk0.0 ] && mount /dev/disk0.0 /mnt/fat'
+
+mkdir -p /mnt/sd
+automount -d /mnt/sd 'mount /dev/disk0.0 /mnt/sd'
+
+mkdir -p /mnt/usb
+automount -d /mnt/usb 'mount -t omap4_usbbootfs omap4_usbboot /mnt/usb'
diff --git a/arch/arm/boards/archosg9/env/init/bootsource b/arch/arm/boards/archosg9/env/init/bootsource
new file mode 100644
index 0000000..b3df447
--- /dev/null
+++ b/arch/arm/boards/archosg9/env/init/bootsource
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+if [ -f /mnt/sd/zImage ]; then
+	global.boot.default=sd-card-linux
+elif [ -f /mnt/sd/android ]; then
+	global.boot.default=sd-card-android
+elif [ -f /mnt/usb/zImage ]; then
+	global.boot.default=usb-linux
+elif [ -f /mnt/usb/android ]; then
+	global.boot.default=usb-android
+fi
diff --git a/arch/arm/boards/archosg9/env/init/usbboot b/arch/arm/boards/archosg9/env/init/usbboot
deleted file mode 100644
index 83dd19a..0000000
--- a/arch/arm/boards/archosg9/env/init/usbboot
+++ /dev/null
@@ -1,6 +0,0 @@
-TARGET_ROOT="/mnt/usb"
-mkdir ${TARGET_ROOT}
-mount -t omap4_usbbootfs omap4_usbboot ${TARGET_ROOT}
-. /env/config
-. ${TARGET_ROOT}/boot/config
-bootm
diff --git a/arch/arm/configs/archosg9_defconfig b/arch/arm/configs/archosg9_defconfig
index 452d2ec..cb0f6b2 100644
--- a/arch/arm/configs/archosg9_defconfig
+++ b/arch/arm/configs/archosg9_defconfig
@@ -1,48 +1,56 @@
-CONFIG_MACH_ARCHOSG9=y
 CONFIG_ARCH_OMAP=y
 CONFIG_ARCH_OMAP4=y
-CONFIG_AEABI=y
+CONFIG_OMAP4_USBBOOT=y
+CONFIG_MACH_ARCHOSG9=y
+CONFIG_THUMB2_BAREBOX=y
+CONFIG_CMD_ARM_MMUINFO=y
+CONFIG_ARM_BOARD_APPEND_ATAG=y
 CONFIG_ARM_OPTIMZED_STRING_FUNCTIONS=y
 CONFIG_ARM_UNWIND=y
 # CONFIG_MMU is not set
-CONFIG_OMAP4_USBBOOT=y
-CONFIG_TEXT_BASE=0xa0000000
-CONFIG_MALLOC_BASE=0x90000000
-CONFIG_MALLOC_SIZE=0x10000000
+CONFIG_TEXT_BASE=0x8f000000
+CONFIG_MALLOC_SIZE=0x2000000
+CONFIG_MALLOC_TLSF=y
 CONFIG_KALLSYMS=y
-CONFIG_ARM_BOARD_APPEND_ATAG=y
 CONFIG_PROMPT="barebox> "
 CONFIG_LONGHELP=y
-CONFIG_GLOB=y
 CONFIG_HUSH_FANCY_PROMPT=y
 CONFIG_CMDLINE_EDITING=y
 CONFIG_AUTO_COMPLETE=y
-# CONFIG_CONSOLE_ACTIVATE_FIRST is not set
-CONFIG_CONSOLE_ACTIVATE_ALL=y
+CONFIG_MENU=y
 # CONFIG_TIMESTAMP is not set
+CONFIG_CONSOLE_ACTIVATE_ALL=y
 CONFIG_DEFAULT_ENVIRONMENT_GENERIC_NEW=y
-CONFIG_DEFAULT_ENVIRONMENT_PATH="defaultenv-2 arch/arm/boards/archosg9/env"
+CONFIG_DEFAULT_ENVIRONMENT_PATH="arch/arm/boards/archosg9/env"
 CONFIG_CMD_EDIT=y
 CONFIG_CMD_SLEEP=y
+CONFIG_CMD_MSLEEP=y
 CONFIG_CMD_SAVEENV=y
 CONFIG_CMD_EXPORT=y
 CONFIG_CMD_PRINTENV=y
 CONFIG_CMD_READLINE=y
+CONFIG_CMD_MENU=y
+CONFIG_CMD_MENU_MANAGEMENT=y
 CONFIG_CMD_TIME=y
+CONFIG_CMD_DIRNAME=y
+CONFIG_CMD_LN=y
+CONFIG_CMD_READLINK=y
+CONFIG_CMD_TFTP=y
 CONFIG_CMD_ECHO_E=y
-CONFIG_CMD_LOADB=y
+CONFIG_CMD_MEMINFO=y
 CONFIG_CMD_IOMEM=y
-CONFIG_CMD_FLASH=y
+CONFIG_CMD_CRC=y
+CONFIG_CMD_CRC_CMP=y
 CONFIG_CMD_MD5SUM=y
-CONFIG_CMD_SHA1SUM=y
-CONFIG_CMD_SHA224SUM=y
-CONFIG_CMD_SHA256SUM=y
+CONFIG_CMD_FLASH=y
 CONFIG_CMD_BOOTM_SHOW_TYPE=y
 CONFIG_CMD_BOOTM_VERBOSE=y
 CONFIG_CMD_BOOTM_INITRD=y
 CONFIG_CMD_BOOTM_OFTREE=y
 CONFIG_CMD_BOOTM_OFTREE_UIMAGE=y
 CONFIG_CMD_BOOTM_AIMAGE=y
+CONFIG_CMD_UIMAGE=y
+# CONFIG_CMD_BOOTU is not set
 CONFIG_CMD_RESET=y
 CONFIG_CMD_GO=y
 CONFIG_CMD_TIMEOUT=y
@@ -52,19 +60,36 @@ CONFIG_CMD_MAGICVAR_HELP=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_UNCOMPRESS=y
 CONFIG_CMD_I2C=y
-CONFIG_DRIVER_SERIAL_OMAP4_USBBOOT=y
+CONFIG_CMD_LED=y
+CONFIG_CMD_LED_TRIGGER=y
+CONFIG_CMD_MIITOOL=y
+CONFIG_NET=y
+CONFIG_NET_DHCP=y
+CONFIG_NET_PING=y
+CONFIG_NET_NETCONSOLE=y
+CONFIG_NET_RESOLV=y
 CONFIG_DRIVER_SERIAL_NS16550=y
 CONFIG_DRIVER_SERIAL_NS16550_OMAP_EXTENSIONS=y
-CONFIG_BAUDRATE=115200
+CONFIG_NET_USB=y
+CONFIG_NET_USB_SMSC95XX=y
+CONFIG_DRIVER_SERIAL_OMAP4_USBBOOT=y
 # CONFIG_SPI is not set
 CONFIG_I2C=y
 CONFIG_I2C_OMAP=y
-CONFIG_MFD_TWLCORE=y
-CONFIG_MFD_TWL6030=y
+CONFIG_USB=y
+CONFIG_USB_EHCI=y
 CONFIG_MCI=y
 CONFIG_MCI_STARTUP=y
 CONFIG_MCI_OMAP_HSMMC=y
+CONFIG_LED=y
+CONFIG_LED_GPIO=y
+CONFIG_LED_TRIGGERS=y
+CONFIG_FS_TFTP=y
+CONFIG_FS_NFS=y
+CONFIG_MFD_TWL6030=y
+CONFIG_FS_OMAP4_USBBOOT=y
 CONFIG_FS_FAT=y
 CONFIG_FS_FAT_WRITE=y
 CONFIG_FS_FAT_LFN=y
-CONFIG_FS_OMAP4_USBBOOT=y
+CONFIG_ZLIB=y
+CONFIG_LZO_DECOMPRESS=y
diff --git a/arch/arm/configs/archosg9_xload_defconfig b/arch/arm/configs/archosg9_xload_defconfig
index 83743fa..24369b2 100644
--- a/arch/arm/configs/archosg9_xload_defconfig
+++ b/arch/arm/configs/archosg9_xload_defconfig
@@ -1,24 +1,32 @@
-CONFIG_MACH_ARCHOSG9=y
 CONFIG_ARCH_OMAP=y
+CONFIG_BAREBOX_MAX_IMAGE_SIZE=0xC000
 CONFIG_ARCH_OMAP4=y
 # CONFIG_OMAP_GPMC is not set
 CONFIG_OMAP_BUILD_IFT=y
-CONFIG_BAREBOX_MAX_IMAGE_SIZE=0xC000
-CONFIG_AEABI=y
 CONFIG_OMAP4_USBBOOT=y
+CONFIG_MACH_ARCHOSG9=y
+CONFIG_THUMB2_BAREBOX=y
 # CONFIG_CMD_ARM_CPUINFO is not set
+# CONFIG_MMU is not set
+# CONFIG_BANNER is not set
+# CONFIG_MEMINFO is not set
 CONFIG_TEXT_BASE=0x40300000
-CONFIG_MEMORY_LAYOUT_FIXED=y
-CONFIG_STACK_BASE=0x8f000000
-CONFIG_MALLOC_BASE=0x84000000
 CONFIG_MALLOC_SIZE=0x2000000
 CONFIG_SHELL_NONE=y
 # CONFIG_ERRNO_MESSAGES is not set
 # CONFIG_TIMESTAMP is not set
 CONFIG_CONSOLE_SIMPLE=y
 # CONFIG_DEFAULT_ENVIRONMENT is not set
+CONFIG_DRIVER_SERIAL_NS16550=y
+CONFIG_DRIVER_SERIAL_NS16550_OMAP_EXTENSIONS=y
 CONFIG_DRIVER_SERIAL_OMAP4_USBBOOT=y
 # CONFIG_SPI is not set
+# CONFIG_DISK_WRITE is not set
+CONFIG_MCI=y
+CONFIG_MCI_STARTUP=y
+# CONFIG_MCI_WRITE is not set
+CONFIG_MCI_OMAP_HSMMC=y
 # CONFIG_FS_RAMFS is not set
 # CONFIG_FS_DEVFS is not set
 CONFIG_FS_OMAP4_USBBOOT=y
+CONFIG_FS_FAT=y
-- 
1.8.1.5


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: [PATCH 4/9] omap_uart: add low level port serial initialization
  2013-03-09 23:19 ` [PATCH 4/9] omap_uart: add low level port serial initialization Vicente Bergas
@ 2013-03-10 13:16   ` Jean-Christophe PLAGNIOL-VILLARD
  2013-03-10 22:16     ` vj
  0 siblings, 1 reply; 22+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2013-03-10 13:16 UTC (permalink / raw)
  To: Vicente Bergas; +Cc: barebox

On 00:19 Sun 10 Mar     , Vicente Bergas wrote:
>  some sort of UART setup has to be done in order to use PUTC_LL
> 
> Signed-off-by: Vicente Bergas <vicencb@gmail.com>
> ---
>  arch/arm/mach-omap/include/mach/debug_ll.h | 21 +++++++++++++++++++++
>  1 file changed, 21 insertions(+)
> 
> diff --git a/arch/arm/mach-omap/include/mach/debug_ll.h b/arch/arm/mach-omap/include/mach/debug_ll.h
> index eea6eb3..9740848 100644
> --- a/arch/arm/mach-omap/include/mach/debug_ll.h
> +++ b/arch/arm/mach-omap/include/mach/debug_ll.h
> @@ -45,9 +45,30 @@
>  #endif
>  
>  #define LSR_THRE	0x20	/* Xmit holding register empty */
> +#define LCR_BKSE	0x80	/* Bank select enable */
>  #define LSR		(5 << 2)
>  #define THR		(0 << 2)
> +#define DLL		(0 << 2)
> +#define IER		(1 << 2)
> +#define DLM		(1 << 2)
> +#define FCR		(2 << 2)
> +#define LCR		(3 << 2)
> +#define MCR		(4 << 2)
> +#define MDR		(8 << 2)
>  
> +static inline void INIT_LL(void)
where this come from?
> +{
> +	writeb(0x00, UART_BASE + LCR);
> +	writeb(0x00, UART_BASE + IER);
> +	writeb(0x07, UART_BASE + MDR);
> +	writeb(LCR_BKSE, UART_BASE + LCR);
> +	writeb(26, UART_BASE + DLL); /* 115200 */
> +	writeb(0, UART_BASE + DLM);
> +	writeb(0x03, UART_BASE + LCR);
> +	writeb(0x03, UART_BASE + MCR);
> +	writeb(0x07, UART_BASE + FCR);
> +	writeb(0x00, UART_BASE + MDR);
> +}
>  static inline void PUTC_LL(char c)
>  {
>  	/* Wait until there is space in the FIFO */
> -- 
> 1.8.1.5
> 
> 
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: [PATCH 7/9] menu: avoid errors when building submenus
  2013-03-09 23:19 ` [PATCH 7/9] menu: avoid errors when building submenus Vicente Bergas
@ 2013-03-10 13:16   ` Jean-Christophe PLAGNIOL-VILLARD
  2013-03-10 22:29     ` vj
  0 siblings, 1 reply; 22+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2013-03-10 13:16 UTC (permalink / raw)
  To: Vicente Bergas; +Cc: barebox

On 00:19 Sun 10 Mar     , Vicente Bergas wrote:
> boot-menu-add-entry should not add menu entries to non-existent menus
> to solve the issue a new parameter is passed indicating the current menu
how this could happend?


> 
> Signed-off-by: Vicente Bergas <vicencb@gmail.com>
> ---
>  arch/arm/boards/at91sam9m10ihd/env/boot/android         | 2 +-
>  arch/arm/boards/at91sam9m10ihd/env/boot/mmc             | 2 +-
>  arch/arm/boards/at91sam9m10ihd/env/boot/net             | 2 +-
>  arch/arm/boards/at91sam9m10ihd/env/boot/net-usb         | 2 +-
>  arch/arm/boards/beagle/env/boot/mmc                     | 2 +-
>  arch/arm/boards/beagle/env/boot/nand-ubi                | 2 +-
>  arch/arm/boards/beagle/env/boot/nand-ubi-dt             | 2 +-
>  arch/arm/boards/beaglebone/env/boot/sd                  | 2 +-
>  arch/arm/boards/clep7212/env/boot/nor                   | 2 +-
>  arch/arm/boards/crystalfontz-cfa10036/env/boot/mmc-ext3 | 2 +-
>  arch/arm/boards/efika-mx-smartbook/env/boot/hd-internal | 2 +-
>  arch/arm/boards/efika-mx-smartbook/env/boot/mmc-left    | 2 +-
>  arch/arm/boards/guf-vincell/env/boot/nand-ubi           | 2 +-
>  arch/arm/boards/karo-tx25/env/boot/nand-ubi             | 2 +-
>  arch/arm/boards/panda/env/boot/mmc                      | 2 +-
>  arch/arm/boards/pcm037/env/boot/nand-ubi                | 2 +-
>  arch/arm/boards/pcm038/env/boot/nand-ubi                | 2 +-
>  arch/arm/boards/pcm043/env/boot/nand-ubi                | 2 +-
>  arch/arm/boards/pcm051/env/boot/sd                      | 2 +-
>  arch/arm/boards/telit-evk-pro3/env/boot/nand-ubi        | 2 +-
>  defaultenv-2/base/boot/net                              | 2 +-
>  defaultenv-2/base/data/boot-template                    | 2 +-
>  defaultenv-2/menu/menu/boot-entries-collect             | 4 ++--
>  defaultenv-2/menu/menu/boot-entries-edit                | 2 +-
>  defaultenv-2/menu/menu/boot-entries-remove              | 2 +-
>  defaultenv-2/menu/menu/boot-menu-add-entry              | 6 +++---
>  defaultenv-2/menu/menu/mainmenu                         | 2 +-
>  27 files changed, 30 insertions(+), 30 deletions(-)
> 
> diff --git a/arch/arm/boards/at91sam9m10ihd/env/boot/android b/arch/arm/boards/at91sam9m10ihd/env/boot/android
> index e440f18..e7387c5 100644
> --- a/arch/arm/boards/at91sam9m10ihd/env/boot/android
> +++ b/arch/arm/boards/at91sam9m10ihd/env/boot/android
> @@ -1,7 +1,7 @@
>  #!/bin/sh
>  
>  if [ "$1" = menu ]; then
> -	boot-menu-add-entry "$0" "android (nand)"
> +	boot-menu-add-entry "$0" "android (nand)" "$2"
>  	exit
>  fi
>  
> diff --git a/arch/arm/boards/at91sam9m10ihd/env/boot/mmc b/arch/arm/boards/at91sam9m10ihd/env/boot/mmc
> index 89c66ee..1ed98e3 100644
> --- a/arch/arm/boards/at91sam9m10ihd/env/boot/mmc
> +++ b/arch/arm/boards/at91sam9m10ihd/env/boot/mmc
> @@ -1,7 +1,7 @@
>  #!/bin/sh
>  
>  if [ "$1" = menu ]; then
> -	boot-menu-add-entry "$0" "MMC slot"
> +	boot-menu-add-entry "$0" "MMC slot" "$2"
>  	exit
>  fi
>  
> diff --git a/arch/arm/boards/at91sam9m10ihd/env/boot/net b/arch/arm/boards/at91sam9m10ihd/env/boot/net
> index cdb2520..35f0a54 100644
> --- a/arch/arm/boards/at91sam9m10ihd/env/boot/net
> +++ b/arch/arm/boards/at91sam9m10ihd/env/boot/net
> @@ -1,7 +1,7 @@
>  #!/bin/sh
>  
>  if [ "$1" = menu ]; then
> -	boot-menu-add-entry "$0" "network (tftp, nfs) (macb)"
> +	boot-menu-add-entry "$0" "network (tftp, nfs) (macb)" "$2"
>  	exit
>  fi
>  
> diff --git a/arch/arm/boards/at91sam9m10ihd/env/boot/net-usb b/arch/arm/boards/at91sam9m10ihd/env/boot/net-usb
> index 6e341a0..c4c01c3 100644
> --- a/arch/arm/boards/at91sam9m10ihd/env/boot/net-usb
> +++ b/arch/arm/boards/at91sam9m10ihd/env/boot/net-usb
> @@ -1,7 +1,7 @@
>  #!/bin/sh
>  
>  if [ "$1" = menu ]; then
> -	boot-menu-add-entry "$0" "network (tftp, nfs) (usb ethernet)"
> +	boot-menu-add-entry "$0" "network (tftp, nfs) (usb ethernet)" "$2"
>  	exit
>  fi
>  
> diff --git a/arch/arm/boards/beagle/env/boot/mmc b/arch/arm/boards/beagle/env/boot/mmc
> index 58bd557..d1a5486 100644
> --- a/arch/arm/boards/beagle/env/boot/mmc
> +++ b/arch/arm/boards/beagle/env/boot/mmc
> @@ -1,7 +1,7 @@
>  #!/bin/sh
>  
>  if [ "$1" = menu ]; then
> -	boot-menu-add-entry "$0" "MMC (ext3)"
> +	boot-menu-add-entry "$0" "MMC (ext3)" "$2"
>  	exit
>  fi
>  
> diff --git a/arch/arm/boards/beagle/env/boot/nand-ubi b/arch/arm/boards/beagle/env/boot/nand-ubi
> index 3037fd4..f0e932b 100644
> --- a/arch/arm/boards/beagle/env/boot/nand-ubi
> +++ b/arch/arm/boards/beagle/env/boot/nand-ubi
> @@ -1,7 +1,7 @@
>  #!/bin/sh
>  
>  if [ "$1" = menu ]; then
> -	boot-menu-add-entry "$0" "nand (UBI)"
> +	boot-menu-add-entry "$0" "nand (UBI)" "$2"
>  	exit
>  fi
>  
> diff --git a/arch/arm/boards/beagle/env/boot/nand-ubi-dt b/arch/arm/boards/beagle/env/boot/nand-ubi-dt
> index b7a1f19..e7539b8 100644
> --- a/arch/arm/boards/beagle/env/boot/nand-ubi-dt
> +++ b/arch/arm/boards/beagle/env/boot/nand-ubi-dt
> @@ -1,7 +1,7 @@
>  #!/bin/sh
>  
>  if [ "$1" = menu ]; then
> -	boot-menu-add-entry "$0" "nand (UBI)"
> +	boot-menu-add-entry "$0" "nand (UBI)" "$2"
>  	exit
>  fi
>  
> diff --git a/arch/arm/boards/beaglebone/env/boot/sd b/arch/arm/boards/beaglebone/env/boot/sd
> index dce0605..6315e08 100644
> --- a/arch/arm/boards/beaglebone/env/boot/sd
> +++ b/arch/arm/boards/beaglebone/env/boot/sd
> @@ -1,7 +1,7 @@
>  #!/bin/sh
>  
>  if [ "$1" = menu ]; then
> -	boot-menu-add-entry "$0" "kernel & rootfs on SD card"
> +	boot-menu-add-entry "$0" "kernel & rootfs on SD card" "$2"
>  	exit
>  fi
>  
> diff --git a/arch/arm/boards/clep7212/env/boot/nor b/arch/arm/boards/clep7212/env/boot/nor
> index df8c983..cca2bfa 100644
> --- a/arch/arm/boards/clep7212/env/boot/nor
> +++ b/arch/arm/boards/clep7212/env/boot/nor
> @@ -1,7 +1,7 @@
>  #!/bin/sh
>  
>  if [ "$1" = menu ]; then
> -	boot-menu-add-entry "$0" "NOR Flash"
> +	boot-menu-add-entry "$0" "NOR Flash" "$2"
>  	exit
>  fi
>  
> diff --git a/arch/arm/boards/crystalfontz-cfa10036/env/boot/mmc-ext3 b/arch/arm/boards/crystalfontz-cfa10036/env/boot/mmc-ext3
> index 4d830ed..b600a56 100644
> --- a/arch/arm/boards/crystalfontz-cfa10036/env/boot/mmc-ext3
> +++ b/arch/arm/boards/crystalfontz-cfa10036/env/boot/mmc-ext3
> @@ -1,7 +1,7 @@
>  #!/bin/sh
>  
>  if [ "$1" = menu ]; then
> -	boot-menu-add-entry "$0" "MMC (ext)"
> +	boot-menu-add-entry "$0" "MMC (ext)" "$2"
>  	exit
>  fi
>  
> diff --git a/arch/arm/boards/efika-mx-smartbook/env/boot/hd-internal b/arch/arm/boards/efika-mx-smartbook/env/boot/hd-internal
> index ccd0f69..564f10e 100644
> --- a/arch/arm/boards/efika-mx-smartbook/env/boot/hd-internal
> +++ b/arch/arm/boards/efika-mx-smartbook/env/boot/hd-internal
> @@ -1,7 +1,7 @@
>  #!/bin/sh
>  
>  if [ "$1" = menu ]; then
> -	boot-menu-add-entry "$0" "internal harddisk"
> +	boot-menu-add-entry "$0" "internal harddisk" "$2"
>  	exit
>  fi
>  
> diff --git a/arch/arm/boards/efika-mx-smartbook/env/boot/mmc-left b/arch/arm/boards/efika-mx-smartbook/env/boot/mmc-left
> index 21935c6..6bba754 100644
> --- a/arch/arm/boards/efika-mx-smartbook/env/boot/mmc-left
> +++ b/arch/arm/boards/efika-mx-smartbook/env/boot/mmc-left
> @@ -1,7 +1,7 @@
>  #!/bin/sh
>  
>  if [ "$1" = menu ]; then
> -	boot-menu-add-entry "$0" "left MMC slot"
> +	boot-menu-add-entry "$0" "left MMC slot" "$2"
>  	exit
>  fi
>  
> diff --git a/arch/arm/boards/guf-vincell/env/boot/nand-ubi b/arch/arm/boards/guf-vincell/env/boot/nand-ubi
> index a3f748e..1745e58 100644
> --- a/arch/arm/boards/guf-vincell/env/boot/nand-ubi
> +++ b/arch/arm/boards/guf-vincell/env/boot/nand-ubi
> @@ -1,7 +1,7 @@
>  #!/bin/sh
>  
>  if [ "$1" = menu ]; then
> -	boot-menu-add-entry "$0" "nand (UBI)"
> +	boot-menu-add-entry "$0" "nand (UBI)" "$2"
>  	exit
>  fi
>  
> diff --git a/arch/arm/boards/karo-tx25/env/boot/nand-ubi b/arch/arm/boards/karo-tx25/env/boot/nand-ubi
> index 67b0cb4..a6f6d7a 100644
> --- a/arch/arm/boards/karo-tx25/env/boot/nand-ubi
> +++ b/arch/arm/boards/karo-tx25/env/boot/nand-ubi
> @@ -1,7 +1,7 @@
>  #!/bin/sh
>  
>  if [ "$1" = menu ]; then
> -	boot-menu-add-entry "$0" "nand (UBI)"
> +	boot-menu-add-entry "$0" "nand (UBI)" "$2"
>  	exit
>  fi
>  
> diff --git a/arch/arm/boards/panda/env/boot/mmc b/arch/arm/boards/panda/env/boot/mmc
> index 58bd557..d1a5486 100644
> --- a/arch/arm/boards/panda/env/boot/mmc
> +++ b/arch/arm/boards/panda/env/boot/mmc
> @@ -1,7 +1,7 @@
>  #!/bin/sh
>  
>  if [ "$1" = menu ]; then
> -	boot-menu-add-entry "$0" "MMC (ext3)"
> +	boot-menu-add-entry "$0" "MMC (ext3)" "$2"
>  	exit
>  fi
>  
> diff --git a/arch/arm/boards/pcm037/env/boot/nand-ubi b/arch/arm/boards/pcm037/env/boot/nand-ubi
> index 67b0cb4..a6f6d7a 100644
> --- a/arch/arm/boards/pcm037/env/boot/nand-ubi
> +++ b/arch/arm/boards/pcm037/env/boot/nand-ubi
> @@ -1,7 +1,7 @@
>  #!/bin/sh
>  
>  if [ "$1" = menu ]; then
> -	boot-menu-add-entry "$0" "nand (UBI)"
> +	boot-menu-add-entry "$0" "nand (UBI)" "$2"
>  	exit
>  fi
>  
> diff --git a/arch/arm/boards/pcm038/env/boot/nand-ubi b/arch/arm/boards/pcm038/env/boot/nand-ubi
> index 67b0cb4..a6f6d7a 100644
> --- a/arch/arm/boards/pcm038/env/boot/nand-ubi
> +++ b/arch/arm/boards/pcm038/env/boot/nand-ubi
> @@ -1,7 +1,7 @@
>  #!/bin/sh
>  
>  if [ "$1" = menu ]; then
> -	boot-menu-add-entry "$0" "nand (UBI)"
> +	boot-menu-add-entry "$0" "nand (UBI)" "$2"
>  	exit
>  fi
>  
> diff --git a/arch/arm/boards/pcm043/env/boot/nand-ubi b/arch/arm/boards/pcm043/env/boot/nand-ubi
> index 67b0cb4..a6f6d7a 100644
> --- a/arch/arm/boards/pcm043/env/boot/nand-ubi
> +++ b/arch/arm/boards/pcm043/env/boot/nand-ubi
> @@ -1,7 +1,7 @@
>  #!/bin/sh
>  
>  if [ "$1" = menu ]; then
> -	boot-menu-add-entry "$0" "nand (UBI)"
> +	boot-menu-add-entry "$0" "nand (UBI)" "$2"
>  	exit
>  fi
>  
> diff --git a/arch/arm/boards/pcm051/env/boot/sd b/arch/arm/boards/pcm051/env/boot/sd
> index f303c10..9debd73 100644
> --- a/arch/arm/boards/pcm051/env/boot/sd
> +++ b/arch/arm/boards/pcm051/env/boot/sd
> @@ -1,7 +1,7 @@
>  #!/bin/sh
>  
>  if [ "$1" = menu ]; then
> -	boot-menu-add-entry "$0" "kernel & rootfs on SD card"
> +	boot-menu-add-entry "$0" "kernel & rootfs on SD card" "$2"
>  	exit
>  fi
>  
> diff --git a/arch/arm/boards/telit-evk-pro3/env/boot/nand-ubi b/arch/arm/boards/telit-evk-pro3/env/boot/nand-ubi
> index 1987492..ffc64f1 100644
> --- a/arch/arm/boards/telit-evk-pro3/env/boot/nand-ubi
> +++ b/arch/arm/boards/telit-evk-pro3/env/boot/nand-ubi
> @@ -1,7 +1,7 @@
>  #!/bin/sh
>  
>  if [ "$1" = menu ]; then
> -	boot-menu-add-entry "$0" "nand (UBI)"
> +	boot-menu-add-entry "$0" "nand (UBI)" "$2"
>  	exit
>  fi
>  
> diff --git a/defaultenv-2/base/boot/net b/defaultenv-2/base/boot/net
> index 90c25aa..25d2d12 100644
> --- a/defaultenv-2/base/boot/net
> +++ b/defaultenv-2/base/boot/net
> @@ -1,7 +1,7 @@
>  #!/bin/sh
>  
>  if [ "$1" = menu ]; then
> -	boot-menu-add-entry "$0" "network (tftp, nfs)"
> +	boot-menu-add-entry "$0" "network (tftp, nfs)" "$2"
>  	exit
>  fi
>  
> diff --git a/defaultenv-2/base/data/boot-template b/defaultenv-2/base/data/boot-template
> index 9297499..2b3e018 100644
> --- a/defaultenv-2/base/data/boot-template
> +++ b/defaultenv-2/base/data/boot-template
> @@ -1,7 +1,7 @@
>  #!/bin/sh
>  
>  if [ "$1" = menu ]; then
> -	boot-menu-add-entry "$0" "<menu text here>"
> +	boot-menu-add-entry "$0" "<menu text here>" "$2"
>  	exit
>  fi
>  
> diff --git a/defaultenv-2/menu/menu/boot-entries-collect b/defaultenv-2/menu/menu/boot-entries-collect
> index c066c93..ba82bf1 100644
> --- a/defaultenv-2/menu/menu/boot-entries-collect
> +++ b/defaultenv-2/menu/menu/boot-entries-collect
> @@ -2,11 +2,11 @@
>  
>  cd /env/boot
>  
> -./$global.boot.default menu
> +./$global.boot.default menu $1
>  
>  for i in *; do
>  	if [ "$i" != "$global.boot.default" ]; then
> -		./$i menu
> +		./$i menu $1
>  	fi
>  done
>  
> diff --git a/defaultenv-2/menu/menu/boot-entries-edit b/defaultenv-2/menu/menu/boot-entries-edit
> index c4e1c3d..16586be 100644
> --- a/defaultenv-2/menu/menu/boot-entries-edit
> +++ b/defaultenv-2/menu/menu/boot-entries-edit
> @@ -5,7 +5,7 @@ export menu_exit=false
>  while true; do
>  	menu -a -m boot_entries_edit -d "\e[1;36mEdit boot entries\e[0m"
>  
> -	boot-entries-collect
> +	boot-entries-collect boot_entries_edit
>  
>  	menu -e -a -m boot_entries_edit -c "boot-menu-new-boot-entry" -d "Add a new entry"
>  	menu -e -a -m boot_entries_edit -c "boot-entries-remove" -d "Remove an entry"
> diff --git a/defaultenv-2/menu/menu/boot-entries-remove b/defaultenv-2/menu/menu/boot-entries-remove
> index 566be9d..2fe8265 100644
> --- a/defaultenv-2/menu/menu/boot-entries-remove
> +++ b/defaultenv-2/menu/menu/boot-entries-remove
> @@ -5,7 +5,7 @@ export menu_exit=false
>  while true; do
>  	menu -a -m boot_entries_remove -d "\e[1;36mRemove Boot entry\e[0m"
>  
> -	boot-entries-collect
> +	boot-entries-collect boot_entries_remove
>  
>  	menu -e -a -m boot_entries_remove -c "menu_exit=true" -d "back"
>  
> diff --git a/defaultenv-2/menu/menu/boot-menu-add-entry b/defaultenv-2/menu/menu/boot-menu-add-entry
> index f06c524..f634b5c 100644
> --- a/defaultenv-2/menu/menu/boot-menu-add-entry
> +++ b/defaultenv-2/menu/menu/boot-menu-add-entry
> @@ -1,5 +1,5 @@
>  #!/bin/sh
>  
> -menu -e -a -m boot -c "boot -v $1; echo; readline \"press enter to continue\" a " -d "Boot: ${GREEN}$2${NC}"
> -menu -e -a -m boot_entries_edit -c "$global.editcmd /env/boot/$1" -d "${GREEN}$2${NC}"
> -menu -e -a -m boot_entries_remove -c "rm /env/boot/$1" -d "${GREEN}$2${NC}"
> +[ "$3" = boot                ] && menu -e -a -m "$3" -c "boot -v $1; echo; readline \"press enter to continue\" a " -d "Boot: ${GREEN}$2${NC}"
> +[ "$3" = boot_entries_edit   ] && menu -e -a -m "$3" -c "$global.editcmd /env/boot/$1" -d "${GREEN}$2${NC}"
> +[ "$3" = boot_entries_remove ] && menu -e -a -m "$3" -c "rm /env/boot/$1" -d "${GREEN}$2${NC}"
> diff --git a/defaultenv-2/menu/menu/mainmenu b/defaultenv-2/menu/menu/mainmenu
> index c74cc9c..aa7626b 100644
> --- a/defaultenv-2/menu/menu/mainmenu
> +++ b/defaultenv-2/menu/menu/mainmenu
> @@ -12,7 +12,7 @@ while true; do
>  
>  	menu -a -m boot -d "${CYAN}Welcome to Barebox${NC}"
>  
> -	boot-entries-collect
> +	boot-entries-collect boot
>  
>  	menu -e -a -R -m boot -c "$global.editcmd /env/network/eth0" -d "Network settings"
>  	menu -e -a -R -m boot -c "$global.editcmd /env/config" -d "Config settings"
> -- 
> 1.8.1.5
> 
> 
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: [PATCH 4/9] omap_uart: add low level port serial initialization
  2013-03-10 13:16   ` Jean-Christophe PLAGNIOL-VILLARD
@ 2013-03-10 22:16     ` vj
  2013-03-10 22:35       ` Sascha Hauer
  0 siblings, 1 reply; 22+ messages in thread
From: vj @ 2013-03-10 22:16 UTC (permalink / raw)
  To: Jean-Christophe PLAGNIOL-VILLARD; +Cc: barebox

On Sun, Mar 10, 2013 at 2:16 PM, Jean-Christophe PLAGNIOL-VILLARD
<plagnioj@jcrosoft.com> wrote:
> On 00:19 Sun 10 Mar     , Vicente Bergas wrote:
>>  some sort of UART setup has to be done in order to use PUTC_LL
>>
>> Signed-off-by: Vicente Bergas <vicencb@gmail.com>
>> ---
>>  arch/arm/mach-omap/include/mach/debug_ll.h | 21 +++++++++++++++++++++
>>  1 file changed, 21 insertions(+)
>>
>> diff --git a/arch/arm/mach-omap/include/mach/debug_ll.h b/arch/arm/mach-omap/include/mach/debug_ll.h
>> index eea6eb3..9740848 100644
>> --- a/arch/arm/mach-omap/include/mach/debug_ll.h
>> +++ b/arch/arm/mach-omap/include/mach/debug_ll.h
>> @@ -45,9 +45,30 @@
>>  #endif
>>
>>  #define LSR_THRE     0x20    /* Xmit holding register empty */
>> +#define LCR_BKSE     0x80    /* Bank select enable */
>>  #define LSR          (5 << 2)
>>  #define THR          (0 << 2)
>> +#define DLL          (0 << 2)
>> +#define IER          (1 << 2)
>> +#define DLM          (1 << 2)
>> +#define FCR          (2 << 2)
>> +#define LCR          (3 << 2)
>> +#define MCR          (4 << 2)
>> +#define MDR          (8 << 2)
>>
>> +static inline void INIT_LL(void)
> where this come from?

This comes from drivers/serial/serial_ns16550.c: ns16550_serial_init_port
ns16550_serial_init_port call other functions and has local variables,
so a stack is required
INIT_LL instead is an extremly simple inline function without local
variables, so it can be called at the very beginning

from include/debug_ll.h:
"Note that several SoCs expect the UART to be initialized by a
debugger or a first stage bootloader."
INIT_LL implements the second option.

I have a question regarding code executed at the very beginning, that
is, when the stack may not be available or the binary is not at it's
link address
What are the things that can't be done in such scenario?
For example, from include/debug_ll.h:
"Be careful with PUTS_LL, it only works if the binary is running at
the link address which often is not the case during early startup."
static __inline__ void PUTS_LL(const char * str)
{
	while (*str) {
		if (*str == '\n') {
			PUTC_LL('\r');
		}
		PUTC_LL(*str);
		str++;
	}
}
What does PUTS_LL do that can't be done?


>> +{
>> +     writeb(0x00, UART_BASE + LCR);
>> +     writeb(0x00, UART_BASE + IER);
>> +     writeb(0x07, UART_BASE + MDR);
>> +     writeb(LCR_BKSE, UART_BASE + LCR);
>> +     writeb(26, UART_BASE + DLL); /* 115200 */
>> +     writeb(0, UART_BASE + DLM);
>> +     writeb(0x03, UART_BASE + LCR);
>> +     writeb(0x03, UART_BASE + MCR);
>> +     writeb(0x07, UART_BASE + FCR);
>> +     writeb(0x00, UART_BASE + MDR);
>> +}
>>  static inline void PUTC_LL(char c)
>>  {
>>       /* Wait until there is space in the FIFO */
>> --
>> 1.8.1.5
>>
>>
>> _______________________________________________
>> barebox mailing list
>> barebox@lists.infradead.org
>> http://lists.infradead.org/mailman/listinfo/barebox

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: [PATCH 7/9] menu: avoid errors when building submenus
  2013-03-10 13:16   ` Jean-Christophe PLAGNIOL-VILLARD
@ 2013-03-10 22:29     ` vj
  2013-03-11  8:50       ` Sascha Hauer
  0 siblings, 1 reply; 22+ messages in thread
From: vj @ 2013-03-10 22:29 UTC (permalink / raw)
  To: Jean-Christophe PLAGNIOL-VILLARD; +Cc: barebox

On Sun, Mar 10, 2013 at 2:16 PM, Jean-Christophe PLAGNIOL-VILLARD
<plagnioj@jcrosoft.com> wrote:
> On 00:19 Sun 10 Mar     , Vicente Bergas wrote:
>> boot-menu-add-entry should not add menu entries to non-existent menus
>> to solve the issue a new parameter is passed indicating the current menu
> how this could happend?

This happens always a menu with "Boot: " entries is created.
"Boot: " entries are created calling "boot-menu-add-entry" as
"boot-template" suggests.
All boot entries are expected to be editable or deleted, so, when the
user requests, a new menu is build with all the entries to be edited
or deleted.
What happens is that "boot-menu-add-entry" adds all three entries at
once, one for the boot menu, another for the still non-existent edit
menu and a third one for the still non-existent delete menu.
When the user selects the edit menu then "boot-menu-add-entry" adds
again three entries, this time the non-existent menus are the boot and
delete ones.
Idem for the delete menu...
When an item is added to a non-existent menu an error is reported, but
it's not critical and the menu being created is shown correctly.
This patch addresses that.

Regards,
  Vicente.

>
>
>>
>> Signed-off-by: Vicente Bergas <vicencb@gmail.com>
>> ---
>>  arch/arm/boards/at91sam9m10ihd/env/boot/android         | 2 +-
>>  arch/arm/boards/at91sam9m10ihd/env/boot/mmc             | 2 +-
>>  arch/arm/boards/at91sam9m10ihd/env/boot/net             | 2 +-
>>  arch/arm/boards/at91sam9m10ihd/env/boot/net-usb         | 2 +-
>>  arch/arm/boards/beagle/env/boot/mmc                     | 2 +-
>>  arch/arm/boards/beagle/env/boot/nand-ubi                | 2 +-
>>  arch/arm/boards/beagle/env/boot/nand-ubi-dt             | 2 +-
>>  arch/arm/boards/beaglebone/env/boot/sd                  | 2 +-
>>  arch/arm/boards/clep7212/env/boot/nor                   | 2 +-
>>  arch/arm/boards/crystalfontz-cfa10036/env/boot/mmc-ext3 | 2 +-
>>  arch/arm/boards/efika-mx-smartbook/env/boot/hd-internal | 2 +-
>>  arch/arm/boards/efika-mx-smartbook/env/boot/mmc-left    | 2 +-
>>  arch/arm/boards/guf-vincell/env/boot/nand-ubi           | 2 +-
>>  arch/arm/boards/karo-tx25/env/boot/nand-ubi             | 2 +-
>>  arch/arm/boards/panda/env/boot/mmc                      | 2 +-
>>  arch/arm/boards/pcm037/env/boot/nand-ubi                | 2 +-
>>  arch/arm/boards/pcm038/env/boot/nand-ubi                | 2 +-
>>  arch/arm/boards/pcm043/env/boot/nand-ubi                | 2 +-
>>  arch/arm/boards/pcm051/env/boot/sd                      | 2 +-
>>  arch/arm/boards/telit-evk-pro3/env/boot/nand-ubi        | 2 +-
>>  defaultenv-2/base/boot/net                              | 2 +-
>>  defaultenv-2/base/data/boot-template                    | 2 +-
>>  defaultenv-2/menu/menu/boot-entries-collect             | 4 ++--
>>  defaultenv-2/menu/menu/boot-entries-edit                | 2 +-
>>  defaultenv-2/menu/menu/boot-entries-remove              | 2 +-
>>  defaultenv-2/menu/menu/boot-menu-add-entry              | 6 +++---
>>  defaultenv-2/menu/menu/mainmenu                         | 2 +-
>>  27 files changed, 30 insertions(+), 30 deletions(-)
>>
>> diff --git a/arch/arm/boards/at91sam9m10ihd/env/boot/android b/arch/arm/boards/at91sam9m10ihd/env/boot/android
>> index e440f18..e7387c5 100644
>> --- a/arch/arm/boards/at91sam9m10ihd/env/boot/android
>> +++ b/arch/arm/boards/at91sam9m10ihd/env/boot/android
>> @@ -1,7 +1,7 @@
>>  #!/bin/sh
>>
>>  if [ "$1" = menu ]; then
>> -     boot-menu-add-entry "$0" "android (nand)"
>> +     boot-menu-add-entry "$0" "android (nand)" "$2"
>>       exit
>>  fi
>>
>> diff --git a/arch/arm/boards/at91sam9m10ihd/env/boot/mmc b/arch/arm/boards/at91sam9m10ihd/env/boot/mmc
>> index 89c66ee..1ed98e3 100644
>> --- a/arch/arm/boards/at91sam9m10ihd/env/boot/mmc
>> +++ b/arch/arm/boards/at91sam9m10ihd/env/boot/mmc
>> @@ -1,7 +1,7 @@
>>  #!/bin/sh
>>
>>  if [ "$1" = menu ]; then
>> -     boot-menu-add-entry "$0" "MMC slot"
>> +     boot-menu-add-entry "$0" "MMC slot" "$2"
>>       exit
>>  fi
>>
>> diff --git a/arch/arm/boards/at91sam9m10ihd/env/boot/net b/arch/arm/boards/at91sam9m10ihd/env/boot/net
>> index cdb2520..35f0a54 100644
>> --- a/arch/arm/boards/at91sam9m10ihd/env/boot/net
>> +++ b/arch/arm/boards/at91sam9m10ihd/env/boot/net
>> @@ -1,7 +1,7 @@
>>  #!/bin/sh
>>
>>  if [ "$1" = menu ]; then
>> -     boot-menu-add-entry "$0" "network (tftp, nfs) (macb)"
>> +     boot-menu-add-entry "$0" "network (tftp, nfs) (macb)" "$2"
>>       exit
>>  fi
>>
>> diff --git a/arch/arm/boards/at91sam9m10ihd/env/boot/net-usb b/arch/arm/boards/at91sam9m10ihd/env/boot/net-usb
>> index 6e341a0..c4c01c3 100644
>> --- a/arch/arm/boards/at91sam9m10ihd/env/boot/net-usb
>> +++ b/arch/arm/boards/at91sam9m10ihd/env/boot/net-usb
>> @@ -1,7 +1,7 @@
>>  #!/bin/sh
>>
>>  if [ "$1" = menu ]; then
>> -     boot-menu-add-entry "$0" "network (tftp, nfs) (usb ethernet)"
>> +     boot-menu-add-entry "$0" "network (tftp, nfs) (usb ethernet)" "$2"
>>       exit
>>  fi
>>
>> diff --git a/arch/arm/boards/beagle/env/boot/mmc b/arch/arm/boards/beagle/env/boot/mmc
>> index 58bd557..d1a5486 100644
>> --- a/arch/arm/boards/beagle/env/boot/mmc
>> +++ b/arch/arm/boards/beagle/env/boot/mmc
>> @@ -1,7 +1,7 @@
>>  #!/bin/sh
>>
>>  if [ "$1" = menu ]; then
>> -     boot-menu-add-entry "$0" "MMC (ext3)"
>> +     boot-menu-add-entry "$0" "MMC (ext3)" "$2"
>>       exit
>>  fi
>>
>> diff --git a/arch/arm/boards/beagle/env/boot/nand-ubi b/arch/arm/boards/beagle/env/boot/nand-ubi
>> index 3037fd4..f0e932b 100644
>> --- a/arch/arm/boards/beagle/env/boot/nand-ubi
>> +++ b/arch/arm/boards/beagle/env/boot/nand-ubi
>> @@ -1,7 +1,7 @@
>>  #!/bin/sh
>>
>>  if [ "$1" = menu ]; then
>> -     boot-menu-add-entry "$0" "nand (UBI)"
>> +     boot-menu-add-entry "$0" "nand (UBI)" "$2"
>>       exit
>>  fi
>>
>> diff --git a/arch/arm/boards/beagle/env/boot/nand-ubi-dt b/arch/arm/boards/beagle/env/boot/nand-ubi-dt
>> index b7a1f19..e7539b8 100644
>> --- a/arch/arm/boards/beagle/env/boot/nand-ubi-dt
>> +++ b/arch/arm/boards/beagle/env/boot/nand-ubi-dt
>> @@ -1,7 +1,7 @@
>>  #!/bin/sh
>>
>>  if [ "$1" = menu ]; then
>> -     boot-menu-add-entry "$0" "nand (UBI)"
>> +     boot-menu-add-entry "$0" "nand (UBI)" "$2"
>>       exit
>>  fi
>>
>> diff --git a/arch/arm/boards/beaglebone/env/boot/sd b/arch/arm/boards/beaglebone/env/boot/sd
>> index dce0605..6315e08 100644
>> --- a/arch/arm/boards/beaglebone/env/boot/sd
>> +++ b/arch/arm/boards/beaglebone/env/boot/sd
>> @@ -1,7 +1,7 @@
>>  #!/bin/sh
>>
>>  if [ "$1" = menu ]; then
>> -     boot-menu-add-entry "$0" "kernel & rootfs on SD card"
>> +     boot-menu-add-entry "$0" "kernel & rootfs on SD card" "$2"
>>       exit
>>  fi
>>
>> diff --git a/arch/arm/boards/clep7212/env/boot/nor b/arch/arm/boards/clep7212/env/boot/nor
>> index df8c983..cca2bfa 100644
>> --- a/arch/arm/boards/clep7212/env/boot/nor
>> +++ b/arch/arm/boards/clep7212/env/boot/nor
>> @@ -1,7 +1,7 @@
>>  #!/bin/sh
>>
>>  if [ "$1" = menu ]; then
>> -     boot-menu-add-entry "$0" "NOR Flash"
>> +     boot-menu-add-entry "$0" "NOR Flash" "$2"
>>       exit
>>  fi
>>
>> diff --git a/arch/arm/boards/crystalfontz-cfa10036/env/boot/mmc-ext3 b/arch/arm/boards/crystalfontz-cfa10036/env/boot/mmc-ext3
>> index 4d830ed..b600a56 100644
>> --- a/arch/arm/boards/crystalfontz-cfa10036/env/boot/mmc-ext3
>> +++ b/arch/arm/boards/crystalfontz-cfa10036/env/boot/mmc-ext3
>> @@ -1,7 +1,7 @@
>>  #!/bin/sh
>>
>>  if [ "$1" = menu ]; then
>> -     boot-menu-add-entry "$0" "MMC (ext)"
>> +     boot-menu-add-entry "$0" "MMC (ext)" "$2"
>>       exit
>>  fi
>>
>> diff --git a/arch/arm/boards/efika-mx-smartbook/env/boot/hd-internal b/arch/arm/boards/efika-mx-smartbook/env/boot/hd-internal
>> index ccd0f69..564f10e 100644
>> --- a/arch/arm/boards/efika-mx-smartbook/env/boot/hd-internal
>> +++ b/arch/arm/boards/efika-mx-smartbook/env/boot/hd-internal
>> @@ -1,7 +1,7 @@
>>  #!/bin/sh
>>
>>  if [ "$1" = menu ]; then
>> -     boot-menu-add-entry "$0" "internal harddisk"
>> +     boot-menu-add-entry "$0" "internal harddisk" "$2"
>>       exit
>>  fi
>>
>> diff --git a/arch/arm/boards/efika-mx-smartbook/env/boot/mmc-left b/arch/arm/boards/efika-mx-smartbook/env/boot/mmc-left
>> index 21935c6..6bba754 100644
>> --- a/arch/arm/boards/efika-mx-smartbook/env/boot/mmc-left
>> +++ b/arch/arm/boards/efika-mx-smartbook/env/boot/mmc-left
>> @@ -1,7 +1,7 @@
>>  #!/bin/sh
>>
>>  if [ "$1" = menu ]; then
>> -     boot-menu-add-entry "$0" "left MMC slot"
>> +     boot-menu-add-entry "$0" "left MMC slot" "$2"
>>       exit
>>  fi
>>
>> diff --git a/arch/arm/boards/guf-vincell/env/boot/nand-ubi b/arch/arm/boards/guf-vincell/env/boot/nand-ubi
>> index a3f748e..1745e58 100644
>> --- a/arch/arm/boards/guf-vincell/env/boot/nand-ubi
>> +++ b/arch/arm/boards/guf-vincell/env/boot/nand-ubi
>> @@ -1,7 +1,7 @@
>>  #!/bin/sh
>>
>>  if [ "$1" = menu ]; then
>> -     boot-menu-add-entry "$0" "nand (UBI)"
>> +     boot-menu-add-entry "$0" "nand (UBI)" "$2"
>>       exit
>>  fi
>>
>> diff --git a/arch/arm/boards/karo-tx25/env/boot/nand-ubi b/arch/arm/boards/karo-tx25/env/boot/nand-ubi
>> index 67b0cb4..a6f6d7a 100644
>> --- a/arch/arm/boards/karo-tx25/env/boot/nand-ubi
>> +++ b/arch/arm/boards/karo-tx25/env/boot/nand-ubi
>> @@ -1,7 +1,7 @@
>>  #!/bin/sh
>>
>>  if [ "$1" = menu ]; then
>> -     boot-menu-add-entry "$0" "nand (UBI)"
>> +     boot-menu-add-entry "$0" "nand (UBI)" "$2"
>>       exit
>>  fi
>>
>> diff --git a/arch/arm/boards/panda/env/boot/mmc b/arch/arm/boards/panda/env/boot/mmc
>> index 58bd557..d1a5486 100644
>> --- a/arch/arm/boards/panda/env/boot/mmc
>> +++ b/arch/arm/boards/panda/env/boot/mmc
>> @@ -1,7 +1,7 @@
>>  #!/bin/sh
>>
>>  if [ "$1" = menu ]; then
>> -     boot-menu-add-entry "$0" "MMC (ext3)"
>> +     boot-menu-add-entry "$0" "MMC (ext3)" "$2"
>>       exit
>>  fi
>>
>> diff --git a/arch/arm/boards/pcm037/env/boot/nand-ubi b/arch/arm/boards/pcm037/env/boot/nand-ubi
>> index 67b0cb4..a6f6d7a 100644
>> --- a/arch/arm/boards/pcm037/env/boot/nand-ubi
>> +++ b/arch/arm/boards/pcm037/env/boot/nand-ubi
>> @@ -1,7 +1,7 @@
>>  #!/bin/sh
>>
>>  if [ "$1" = menu ]; then
>> -     boot-menu-add-entry "$0" "nand (UBI)"
>> +     boot-menu-add-entry "$0" "nand (UBI)" "$2"
>>       exit
>>  fi
>>
>> diff --git a/arch/arm/boards/pcm038/env/boot/nand-ubi b/arch/arm/boards/pcm038/env/boot/nand-ubi
>> index 67b0cb4..a6f6d7a 100644
>> --- a/arch/arm/boards/pcm038/env/boot/nand-ubi
>> +++ b/arch/arm/boards/pcm038/env/boot/nand-ubi
>> @@ -1,7 +1,7 @@
>>  #!/bin/sh
>>
>>  if [ "$1" = menu ]; then
>> -     boot-menu-add-entry "$0" "nand (UBI)"
>> +     boot-menu-add-entry "$0" "nand (UBI)" "$2"
>>       exit
>>  fi
>>
>> diff --git a/arch/arm/boards/pcm043/env/boot/nand-ubi b/arch/arm/boards/pcm043/env/boot/nand-ubi
>> index 67b0cb4..a6f6d7a 100644
>> --- a/arch/arm/boards/pcm043/env/boot/nand-ubi
>> +++ b/arch/arm/boards/pcm043/env/boot/nand-ubi
>> @@ -1,7 +1,7 @@
>>  #!/bin/sh
>>
>>  if [ "$1" = menu ]; then
>> -     boot-menu-add-entry "$0" "nand (UBI)"
>> +     boot-menu-add-entry "$0" "nand (UBI)" "$2"
>>       exit
>>  fi
>>
>> diff --git a/arch/arm/boards/pcm051/env/boot/sd b/arch/arm/boards/pcm051/env/boot/sd
>> index f303c10..9debd73 100644
>> --- a/arch/arm/boards/pcm051/env/boot/sd
>> +++ b/arch/arm/boards/pcm051/env/boot/sd
>> @@ -1,7 +1,7 @@
>>  #!/bin/sh
>>
>>  if [ "$1" = menu ]; then
>> -     boot-menu-add-entry "$0" "kernel & rootfs on SD card"
>> +     boot-menu-add-entry "$0" "kernel & rootfs on SD card" "$2"
>>       exit
>>  fi
>>
>> diff --git a/arch/arm/boards/telit-evk-pro3/env/boot/nand-ubi b/arch/arm/boards/telit-evk-pro3/env/boot/nand-ubi
>> index 1987492..ffc64f1 100644
>> --- a/arch/arm/boards/telit-evk-pro3/env/boot/nand-ubi
>> +++ b/arch/arm/boards/telit-evk-pro3/env/boot/nand-ubi
>> @@ -1,7 +1,7 @@
>>  #!/bin/sh
>>
>>  if [ "$1" = menu ]; then
>> -     boot-menu-add-entry "$0" "nand (UBI)"
>> +     boot-menu-add-entry "$0" "nand (UBI)" "$2"
>>       exit
>>  fi
>>
>> diff --git a/defaultenv-2/base/boot/net b/defaultenv-2/base/boot/net
>> index 90c25aa..25d2d12 100644
>> --- a/defaultenv-2/base/boot/net
>> +++ b/defaultenv-2/base/boot/net
>> @@ -1,7 +1,7 @@
>>  #!/bin/sh
>>
>>  if [ "$1" = menu ]; then
>> -     boot-menu-add-entry "$0" "network (tftp, nfs)"
>> +     boot-menu-add-entry "$0" "network (tftp, nfs)" "$2"
>>       exit
>>  fi
>>
>> diff --git a/defaultenv-2/base/data/boot-template b/defaultenv-2/base/data/boot-template
>> index 9297499..2b3e018 100644
>> --- a/defaultenv-2/base/data/boot-template
>> +++ b/defaultenv-2/base/data/boot-template
>> @@ -1,7 +1,7 @@
>>  #!/bin/sh
>>
>>  if [ "$1" = menu ]; then
>> -     boot-menu-add-entry "$0" "<menu text here>"
>> +     boot-menu-add-entry "$0" "<menu text here>" "$2"
>>       exit
>>  fi
>>
>> diff --git a/defaultenv-2/menu/menu/boot-entries-collect b/defaultenv-2/menu/menu/boot-entries-collect
>> index c066c93..ba82bf1 100644
>> --- a/defaultenv-2/menu/menu/boot-entries-collect
>> +++ b/defaultenv-2/menu/menu/boot-entries-collect
>> @@ -2,11 +2,11 @@
>>
>>  cd /env/boot
>>
>> -./$global.boot.default menu
>> +./$global.boot.default menu $1
>>
>>  for i in *; do
>>       if [ "$i" != "$global.boot.default" ]; then
>> -             ./$i menu
>> +             ./$i menu $1
>>       fi
>>  done
>>
>> diff --git a/defaultenv-2/menu/menu/boot-entries-edit b/defaultenv-2/menu/menu/boot-entries-edit
>> index c4e1c3d..16586be 100644
>> --- a/defaultenv-2/menu/menu/boot-entries-edit
>> +++ b/defaultenv-2/menu/menu/boot-entries-edit
>> @@ -5,7 +5,7 @@ export menu_exit=false
>>  while true; do
>>       menu -a -m boot_entries_edit -d "\e[1;36mEdit boot entries\e[0m"
>>
>> -     boot-entries-collect
>> +     boot-entries-collect boot_entries_edit
>>
>>       menu -e -a -m boot_entries_edit -c "boot-menu-new-boot-entry" -d "Add a new entry"
>>       menu -e -a -m boot_entries_edit -c "boot-entries-remove" -d "Remove an entry"
>> diff --git a/defaultenv-2/menu/menu/boot-entries-remove b/defaultenv-2/menu/menu/boot-entries-remove
>> index 566be9d..2fe8265 100644
>> --- a/defaultenv-2/menu/menu/boot-entries-remove
>> +++ b/defaultenv-2/menu/menu/boot-entries-remove
>> @@ -5,7 +5,7 @@ export menu_exit=false
>>  while true; do
>>       menu -a -m boot_entries_remove -d "\e[1;36mRemove Boot entry\e[0m"
>>
>> -     boot-entries-collect
>> +     boot-entries-collect boot_entries_remove
>>
>>       menu -e -a -m boot_entries_remove -c "menu_exit=true" -d "back"
>>
>> diff --git a/defaultenv-2/menu/menu/boot-menu-add-entry b/defaultenv-2/menu/menu/boot-menu-add-entry
>> index f06c524..f634b5c 100644
>> --- a/defaultenv-2/menu/menu/boot-menu-add-entry
>> +++ b/defaultenv-2/menu/menu/boot-menu-add-entry
>> @@ -1,5 +1,5 @@
>>  #!/bin/sh
>>
>> -menu -e -a -m boot -c "boot -v $1; echo; readline \"press enter to continue\" a " -d "Boot: ${GREEN}$2${NC}"
>> -menu -e -a -m boot_entries_edit -c "$global.editcmd /env/boot/$1" -d "${GREEN}$2${NC}"
>> -menu -e -a -m boot_entries_remove -c "rm /env/boot/$1" -d "${GREEN}$2${NC}"
>> +[ "$3" = boot                ] && menu -e -a -m "$3" -c "boot -v $1; echo; readline \"press enter to continue\" a " -d "Boot: ${GREEN}$2${NC}"
>> +[ "$3" = boot_entries_edit   ] && menu -e -a -m "$3" -c "$global.editcmd /env/boot/$1" -d "${GREEN}$2${NC}"
>> +[ "$3" = boot_entries_remove ] && menu -e -a -m "$3" -c "rm /env/boot/$1" -d "${GREEN}$2${NC}"
>> diff --git a/defaultenv-2/menu/menu/mainmenu b/defaultenv-2/menu/menu/mainmenu
>> index c74cc9c..aa7626b 100644
>> --- a/defaultenv-2/menu/menu/mainmenu
>> +++ b/defaultenv-2/menu/menu/mainmenu
>> @@ -12,7 +12,7 @@ while true; do
>>
>>       menu -a -m boot -d "${CYAN}Welcome to Barebox${NC}"
>>
>> -     boot-entries-collect
>> +     boot-entries-collect boot
>>
>>       menu -e -a -R -m boot -c "$global.editcmd /env/network/eth0" -d "Network settings"
>>       menu -e -a -R -m boot -c "$global.editcmd /env/config" -d "Config settings"
>> --
>> 1.8.1.5
>>
>>
>> _______________________________________________
>> barebox mailing list
>> barebox@lists.infradead.org
>> http://lists.infradead.org/mailman/listinfo/barebox

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: [PATCH 4/9] omap_uart: add low level port serial initialization
  2013-03-10 22:16     ` vj
@ 2013-03-10 22:35       ` Sascha Hauer
  2013-03-10 22:44         ` vj
  0 siblings, 1 reply; 22+ messages in thread
From: Sascha Hauer @ 2013-03-10 22:35 UTC (permalink / raw)
  To: vj; +Cc: barebox

On Sun, Mar 10, 2013 at 11:16:00PM +0100, vj wrote:
> On Sun, Mar 10, 2013 at 2:16 PM, Jean-Christophe PLAGNIOL-VILLARD
> <plagnioj@jcrosoft.com> wrote:
> > On 00:19 Sun 10 Mar     , Vicente Bergas wrote:
> >>  some sort of UART setup has to be done in order to use PUTC_LL
> >>
> >> Signed-off-by: Vicente Bergas <vicencb@gmail.com>
> >> ---
> >>  arch/arm/mach-omap/include/mach/debug_ll.h | 21 +++++++++++++++++++++
> >>  1 file changed, 21 insertions(+)
> >>
> >> diff --git a/arch/arm/mach-omap/include/mach/debug_ll.h b/arch/arm/mach-omap/include/mach/debug_ll.h
> >> index eea6eb3..9740848 100644
> >> --- a/arch/arm/mach-omap/include/mach/debug_ll.h
> >> +++ b/arch/arm/mach-omap/include/mach/debug_ll.h
> >> @@ -45,9 +45,30 @@
> >>  #endif
> >>
> >>  #define LSR_THRE     0x20    /* Xmit holding register empty */
> >> +#define LCR_BKSE     0x80    /* Bank select enable */
> >>  #define LSR          (5 << 2)
> >>  #define THR          (0 << 2)
> >> +#define DLL          (0 << 2)
> >> +#define IER          (1 << 2)
> >> +#define DLM          (1 << 2)
> >> +#define FCR          (2 << 2)
> >> +#define LCR          (3 << 2)
> >> +#define MCR          (4 << 2)
> >> +#define MDR          (8 << 2)
> >>
> >> +static inline void INIT_LL(void)
> > where this come from?
> 
> This comes from drivers/serial/serial_ns16550.c: ns16550_serial_init_port
> ns16550_serial_init_port call other functions and has local variables,
> so a stack is required
> INIT_LL instead is an extremly simple inline function without local
> variables, so it can be called at the very beginning
> 
> from include/debug_ll.h:
> "Note that several SoCs expect the UART to be initialized by a
> debugger or a first stage bootloader."
> INIT_LL implements the second option.
> 
> I have a question regarding code executed at the very beginning, that
> is, when the stack may not be available or the binary is not at it's
> link address
> What are the things that can't be done in such scenario?
> For example, from include/debug_ll.h:
> "Be careful with PUTS_LL, it only works if the binary is running at
> the link address which often is not the case during early startup."
> static __inline__ void PUTS_LL(const char * str)
> {
> 	while (*str) {
> 		if (*str == '\n') {
> 			PUTC_LL('\r');
> 		}
> 		PUTC_LL(*str);
> 		str++;
> 	}
> }
> What does PUTS_LL do that can't be done?

You can't access global variables at that state. They are
addressed with their absolute address which will not be correct
when you are not running at the linked address. You can simply
verify that by doing a PUTHEX_LL("somestring"); You will see
the address the string is located when running from the correct
address.

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: [PATCH 4/9] omap_uart: add low level port serial initialization
  2013-03-10 22:35       ` Sascha Hauer
@ 2013-03-10 22:44         ` vj
  2013-03-10 23:01           ` Sascha Hauer
  0 siblings, 1 reply; 22+ messages in thread
From: vj @ 2013-03-10 22:44 UTC (permalink / raw)
  To: Sascha Hauer; +Cc: barebox

On Sun, Mar 10, 2013 at 11:35 PM, Sascha Hauer <s.hauer@pengutronix.de> wrote:
> On Sun, Mar 10, 2013 at 11:16:00PM +0100, vj wrote:
>> On Sun, Mar 10, 2013 at 2:16 PM, Jean-Christophe PLAGNIOL-VILLARD
>> <plagnioj@jcrosoft.com> wrote:
>> > On 00:19 Sun 10 Mar     , Vicente Bergas wrote:
>> >>  some sort of UART setup has to be done in order to use PUTC_LL
>> >>
>> >> Signed-off-by: Vicente Bergas <vicencb@gmail.com>
>> >> ---
>> >>  arch/arm/mach-omap/include/mach/debug_ll.h | 21 +++++++++++++++++++++
>> >>  1 file changed, 21 insertions(+)
>> >>
>> >> diff --git a/arch/arm/mach-omap/include/mach/debug_ll.h b/arch/arm/mach-omap/include/mach/debug_ll.h
>> >> index eea6eb3..9740848 100644
>> >> --- a/arch/arm/mach-omap/include/mach/debug_ll.h
>> >> +++ b/arch/arm/mach-omap/include/mach/debug_ll.h
>> >> @@ -45,9 +45,30 @@
>> >>  #endif
>> >>
>> >>  #define LSR_THRE     0x20    /* Xmit holding register empty */
>> >> +#define LCR_BKSE     0x80    /* Bank select enable */
>> >>  #define LSR          (5 << 2)
>> >>  #define THR          (0 << 2)
>> >> +#define DLL          (0 << 2)
>> >> +#define IER          (1 << 2)
>> >> +#define DLM          (1 << 2)
>> >> +#define FCR          (2 << 2)
>> >> +#define LCR          (3 << 2)
>> >> +#define MCR          (4 << 2)
>> >> +#define MDR          (8 << 2)
>> >>
>> >> +static inline void INIT_LL(void)
>> > where this come from?
>>
>> This comes from drivers/serial/serial_ns16550.c: ns16550_serial_init_port
>> ns16550_serial_init_port call other functions and has local variables,
>> so a stack is required
>> INIT_LL instead is an extremly simple inline function without local
>> variables, so it can be called at the very beginning
>>
>> from include/debug_ll.h:
>> "Note that several SoCs expect the UART to be initialized by a
>> debugger or a first stage bootloader."
>> INIT_LL implements the second option.
>>
>> I have a question regarding code executed at the very beginning, that
>> is, when the stack may not be available or the binary is not at it's
>> link address
>> What are the things that can't be done in such scenario?
>> For example, from include/debug_ll.h:
>> "Be careful with PUTS_LL, it only works if the binary is running at
>> the link address which often is not the case during early startup."
>> static __inline__ void PUTS_LL(const char * str)
>> {
>>       while (*str) {
>>               if (*str == '\n') {
>>                       PUTC_LL('\r');
>>               }
>>               PUTC_LL(*str);
>>               str++;
>>       }
>> }
>> What does PUTS_LL do that can't be done?
>
> You can't access global variables at that state. They are
> addressed with their absolute address which will not be correct
> when you are not running at the linked address. You can simply
> verify that by doing a PUTHEX_LL("somestring"); You will see
> the address the string is located when running from the correct
> address.
>
> Sascha
>
> --
> Pengutronix e.K.                           |                             |
> Industrial Linux Solutions                 | http://www.pengutronix.de/  |
> Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
> Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

So the problem is not with PUTS_LL, it's with who calls it that should
modify the string pointer accordingly.
And what are the limitations of not having stack? local variables,
calling non-inline functions, more?

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: [PATCH 4/9] omap_uart: add low level port serial initialization
  2013-03-10 22:44         ` vj
@ 2013-03-10 23:01           ` Sascha Hauer
  2013-03-10 23:09             ` vj
  0 siblings, 1 reply; 22+ messages in thread
From: Sascha Hauer @ 2013-03-10 23:01 UTC (permalink / raw)
  To: vj; +Cc: barebox

On Sun, Mar 10, 2013 at 11:44:31PM +0100, vj wrote:
> >
> > You can't access global variables at that state. They are
> > addressed with their absolute address which will not be correct
> > when you are not running at the linked address. You can simply
> > verify that by doing a PUTHEX_LL("somestring"); You will see
> > the address the string is located when running from the correct
> > address.
> >
> > Sascha
> >
> > --
> > Pengutronix e.K.                           |                             |
> > Industrial Linux Solutions                 | http://www.pengutronix.de/  |
> > Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
> > Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
> 
> So the problem is not with PUTS_LL, it's with who calls it that should
> modify the string pointer accordingly.
> And what are the limitations of not having stack? local variables,
> calling non-inline functions, more?

Local variables work fine.
Without stack you can only use __naked functions. With these the
compiler does not save the registers to the stack and you can't return
from them. This means a function should always end with a call to
another function. Normally you should only setup a stack here and call
a function which then can use it.

Another limitation is that you can only pass three arguments to a
function, more arguments would be pushed on the stack.

Also functions must not become too complex, because otherwise the
compiler would make use of the stack inside the function.

The typical register write stuff you normally do in such lowlevel
init work fine.

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: [PATCH 4/9] omap_uart: add low level port serial initialization
  2013-03-10 23:01           ` Sascha Hauer
@ 2013-03-10 23:09             ` vj
  0 siblings, 0 replies; 22+ messages in thread
From: vj @ 2013-03-10 23:09 UTC (permalink / raw)
  To: Sascha Hauer; +Cc: barebox

On Mon, Mar 11, 2013 at 12:01 AM, Sascha Hauer <s.hauer@pengutronix.de> wrote:
> On Sun, Mar 10, 2013 at 11:44:31PM +0100, vj wrote:
>> >
>> > You can't access global variables at that state. They are
>> > addressed with their absolute address which will not be correct
>> > when you are not running at the linked address. You can simply
>> > verify that by doing a PUTHEX_LL("somestring"); You will see
>> > the address the string is located when running from the correct
>> > address.
>> >
>> > Sascha
>> >
>> > --
>> > Pengutronix e.K.                           |                             |
>> > Industrial Linux Solutions                 | http://www.pengutronix.de/  |
>> > Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
>> > Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
>>
>> So the problem is not with PUTS_LL, it's with who calls it that should
>> modify the string pointer accordingly.
>> And what are the limitations of not having stack? local variables,
>> calling non-inline functions, more?
>
> Local variables work fine.
> Without stack you can only use __naked functions. With these the
> compiler does not save the registers to the stack and you can't return
> from them. This means a function should always end with a call to
> another function. Normally you should only setup a stack here and call
> a function which then can use it.
>
> Another limitation is that you can only pass three arguments to a
> function, more arguments would be pushed on the stack.
>
> Also functions must not become too complex, because otherwise the
> compiler would make use of the stack inside the function.
>
> The typical register write stuff you normally do in such lowlevel
> init work fine.
>
> Sascha
>
> --
> Pengutronix e.K.                           |                             |
> Industrial Linux Solutions                 | http://www.pengutronix.de/  |
> Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
> Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

Thanks for the explanation!

Regards,
  Vicente.

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: [PATCH 8/9] archos: add atag appender for all features
  2013-03-09 23:19 ` [PATCH 8/9] archos: add atag appender for all features Vicente Bergas
@ 2013-03-11  8:36   ` Sascha Hauer
  0 siblings, 0 replies; 22+ messages in thread
From: Sascha Hauer @ 2013-03-11  8:36 UTC (permalink / raw)
  To: Vicente Bergas; +Cc: barebox

On Sun, Mar 10, 2013 at 12:19:41AM +0100, Vicente Bergas wrote:
> 
> Signed-off-by: Vicente Bergas <vicencb@gmail.com>
> ---
>  arch/arm/boards/archosg9/archos_features.c | 414 ++++++++++++++++++++++++++---
>  arch/arm/boards/archosg9/archos_features.h |  39 +++
>  2 files changed, 412 insertions(+), 41 deletions(-)
> 
> diff --git a/arch/arm/boards/archosg9/archos_features.c b/arch/arm/boards/archosg9/archos_features.c

[...]

> +#ifdef INSERT_ATAG_HSDPA
> +	features->hdr.tag = FTAG_HAS_HSDPA;
> +	features->hdr.size = feature_tag_size(feature_tag_generic);
> +
> +	memset(&features->u.generic, 0, sizeof(features->u.generic));
> +
> +	features = feature_tag_next(features);
> +#endif
> +}
> +static void setup_feature_nfc(void)
> +{
> +#ifdef INSERT_ATAG_NFC
> +	features->hdr.tag = FTAG_HAS_NFC;
> +	features->hdr.size = feature_tag_size(feature_tag_generic);
> +
> +	memset(&features->u.generic, 0, sizeof(features->u.generic));
> +
> +	features = feature_tag_next(features);
> +#endif

So all features get an additional ifdef,...

>  }
>  static void setup_feature_none(void)
>  {
> @@ -191,6 +495,34 @@ static struct tag *setup_feature_list(struct tag * params)
>  	setup_feature_has_gpio_volume_keys();
>  	setup_feature_screen();
>  	setup_feature_turbo();
> +	setup_feature_product_oem();
> +	setup_feature_product_zone();
> +	setup_feature_clock();
> +	setup_feature_dcin();
> +	setup_feature_ext_screen();
> +	setup_feature_wifi();
> +	setup_feature_bluetooth();
> +	setup_feature_accelerometer();
> +	setup_feature_gps();
> +	setup_feature_harddisk_controller();
> +	setup_feature_harddisk();
> +	setup_feature_touchscreen();
> +	setup_feature_mmcsd();
> +	setup_feature_gpio_keys();
> +	setup_feature_wifi_pa();
> +	setup_feature_speaker();
> +	setup_feature_battery();
> +	setup_feature_electrical_shortcut();
> +	setup_feature_gyroscope();
> +	setup_feature_compass();
> +	setup_feature_camera();
> +	setup_feature_microphone();
> +	setup_feature_ambient_light_sensor();
> +	setup_feature_proximity_sensor();
> +	setup_feature_gsm();
> +	setup_feature_dect();
> +	setup_feature_hsdpa();
> +	setup_feature_nfc();

... they are all called unconditionally, many of them end up being
no-ops ...

>  	setup_feature_none();
>  
>  	fl->size = ((u32)features) - ((u32)(fl->data));
> diff --git a/arch/arm/boards/archosg9/archos_features.h b/arch/arm/boards/archosg9/archos_features.h
> index 5769c6c..a3e1437 100644
> --- a/arch/arm/boards/archosg9/archos_features.h
> +++ b/arch/arm/boards/archosg9/archos_features.h
> @@ -1,6 +1,45 @@
>  #ifndef __ARCHOS_FEATURES_H
>  #define __ARCHOS_FEATURES_H
>  
> +#undef  INSERT_ATAG_PRODUCT_NAME
> +#undef  INSERT_ATAG_PRODUCT_SERIAL_NUMBER
> +#undef  INSERT_ATAG_PRODUCT_MAC_ADDRESS
> +#undef  INSERT_ATAG_BOARD_PCB_REVISION
> +#define INSERT_ATAG_SDRAM
> +#undef  INSERT_ATAG_PMIC
> +#define INSERT_ATAG_SERIAL_PORT
> +#define INSERT_ATAG_HAS_GPIO_VOLUME_KEYS
> +#define INSERT_ATAG_SCREEN
> +#define INSERT_ATAG_TURBO

And then you use a header file to configure this.

I don't see a point in obfuscating this so much. Please call only call
the features you want to have setup in the first place. For your own
debugging purposes it makes no difference whether you edit the C file
above or this header file. For different tablets with different features
you need to find another solution anyway.

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: [PATCH 7/9] menu: avoid errors when building submenus
  2013-03-10 22:29     ` vj
@ 2013-03-11  8:50       ` Sascha Hauer
  0 siblings, 0 replies; 22+ messages in thread
From: Sascha Hauer @ 2013-03-11  8:50 UTC (permalink / raw)
  To: vj; +Cc: barebox

On Sun, Mar 10, 2013 at 11:29:17PM +0100, vj wrote:
> On Sun, Mar 10, 2013 at 2:16 PM, Jean-Christophe PLAGNIOL-VILLARD
> <plagnioj@jcrosoft.com> wrote:
> > On 00:19 Sun 10 Mar     , Vicente Bergas wrote:
> >> boot-menu-add-entry should not add menu entries to non-existent menus
> >> to solve the issue a new parameter is passed indicating the current menu
> > how this could happend?
> 
> This happens always a menu with "Boot: " entries is created.
> "Boot: " entries are created calling "boot-menu-add-entry" as
> "boot-template" suggests.
> All boot entries are expected to be editable or deleted, so, when the
> user requests, a new menu is build with all the entries to be edited
> or deleted.
> What happens is that "boot-menu-add-entry" adds all three entries at
> once, one for the boot menu, another for the still non-existent edit
> menu and a third one for the still non-existent delete menu.
> When the user selects the edit menu then "boot-menu-add-entry" adds
> again three entries, this time the non-existent menus are the boot and
> delete ones.
> Idem for the delete menu...
> When an item is added to a non-existent menu an error is reported, but
> it's not critical and the menu being created is shown correctly.
> This patch addresses that.

I see the problem, but I think we should either live with it or find a
better solution to the problem. I don't really want to increase the
complexity of the menu scripts. I had a hard time implementing it with
halfway correct behaviour. If now we have to add more complexity it
IMO shows we should rethink it.

Sascha


-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: [PATCH 0/9] Add support for booting ArchosG9 from sd-card
  2013-03-09 23:19 [PATCH 0/9] Add support for booting ArchosG9 from sd-card Vicente Bergas
                   ` (8 preceding siblings ...)
  2013-03-09 23:19 ` [PATCH 9/9] archosg9: enable booting from sd-card Vicente Bergas
@ 2013-03-11 21:25 ` Sascha Hauer
  9 siblings, 0 replies; 22+ messages in thread
From: Sascha Hauer @ 2013-03-11 21:25 UTC (permalink / raw)
  To: Vicente Bergas; +Cc: barebox

Hi Vicente,

On Sun, Mar 10, 2013 at 12:19:33AM +0100, Vicente Bergas wrote:
>  This patch series ends up adding sd-card booting support to archosg9 boards.
>  First 8 patches are improvements and minor fixes found during the process.

I applied most patches from thsi series, the rest needs some updates.

Thanks
 Sascha

> 
> Vicente Bergas (9):
>   defaultenv-2: don't load nonexistent file
>   omap4_romusb: rename omap4_usbboot_pdata to omap4_usbboot_data
>   omap_uart: rename OMAP3EVM_UARTx to OMAP_UARTx
>   omap_uart: add low level port serial initialization
>   panda: remove unused configuration items
>   omap4_romusb: allow adding usb-serial when not booting from usb
>   menu: avoid errors when building submenus
>   archos: add atag appender for all features
>   archosg9: enable booting from sd-card
> 
>  arch/arm/boards/archosg9/archos_features.c         | 414 +++++++++++++++++++--
>  arch/arm/boards/archosg9/archos_features.h         |  39 ++
>  arch/arm/boards/archosg9/board.c                   |   1 -
>  arch/arm/boards/archosg9/env/boot/sd-card-android  |  11 +
>  arch/arm/boards/archosg9/env/boot/sd-card-linux    |  17 +
>  arch/arm/boards/archosg9/env/boot/usb-android      |  11 +
>  arch/arm/boards/archosg9/env/boot/usb-linux        |  17 +
>  arch/arm/boards/archosg9/env/config                |   3 -
>  arch/arm/boards/archosg9/env/init/automount        |  28 ++
>  arch/arm/boards/archosg9/env/init/bootsource       |  11 +
>  arch/arm/boards/archosg9/env/init/usbboot          |   6 -
>  arch/arm/boards/at91sam9m10ihd/env/boot/android    |   2 +-
>  arch/arm/boards/at91sam9m10ihd/env/boot/mmc        |   2 +-
>  arch/arm/boards/at91sam9m10ihd/env/boot/net        |   2 +-
>  arch/arm/boards/at91sam9m10ihd/env/boot/net-usb    |   2 +-
>  arch/arm/boards/beagle/env/boot/mmc                |   2 +-
>  arch/arm/boards/beagle/env/boot/nand-ubi           |   2 +-
>  arch/arm/boards/beagle/env/boot/nand-ubi-dt        |   2 +-
>  arch/arm/boards/beaglebone/env/boot/sd             |   2 +-
>  arch/arm/boards/clep7212/env/boot/nor              |   2 +-
>  .../boards/crystalfontz-cfa10036/env/boot/mmc-ext3 |   2 +-
>  .../boards/efika-mx-smartbook/env/boot/hd-internal |   2 +-
>  .../boards/efika-mx-smartbook/env/boot/mmc-left    |   2 +-
>  arch/arm/boards/guf-vincell/env/boot/nand-ubi      |   2 +-
>  arch/arm/boards/karo-tx25/env/boot/nand-ubi        |   2 +-
>  arch/arm/boards/omap3evm/board.c                   |   4 +-
>  arch/arm/boards/omap3evm/lowlevel.c                |   4 +-
>  arch/arm/boards/panda/env/boot/mmc                 |   2 +-
>  arch/arm/boards/pcm037/env/boot/nand-ubi           |   2 +-
>  arch/arm/boards/pcm038/env/boot/nand-ubi           |   2 +-
>  arch/arm/boards/pcm043/env/boot/nand-ubi           |   2 +-
>  arch/arm/boards/pcm051/env/boot/sd                 |   2 +-
>  arch/arm/boards/telit-evk-pro3/env/boot/nand-ubi   |   2 +-
>  arch/arm/configs/archosg9_defconfig                |  67 ++--
>  arch/arm/configs/archosg9_xload_defconfig          |  20 +-
>  arch/arm/configs/panda_xload_defconfig             |   3 -
>  arch/arm/mach-omap/Kconfig                         |  11 +-
>  arch/arm/mach-omap/include/mach/debug_ll.h         |  27 +-
>  arch/arm/mach-omap/include/mach/omap4_rom_usb.h    |   3 +
>  arch/arm/mach-omap/omap4_rom_usb.c                 |  95 +++--
>  defaultenv-2/base/bin/init                         |   2 +-
>  defaultenv-2/base/boot/net                         |   2 +-
>  defaultenv-2/base/data/boot-template               |   2 +-
>  defaultenv-2/menu/menu/boot-entries-collect        |   4 +-
>  defaultenv-2/menu/menu/boot-entries-edit           |   2 +-
>  defaultenv-2/menu/menu/boot-entries-remove         |   2 +-
>  defaultenv-2/menu/menu/boot-menu-add-entry         |   6 +-
>  defaultenv-2/menu/menu/mainmenu                    |   2 +-
>  drivers/serial/serial_omap4_usbboot.c              |   2 +
>  49 files changed, 686 insertions(+), 170 deletions(-)
>  create mode 100644 arch/arm/boards/archosg9/env/boot/sd-card-android
>  create mode 100644 arch/arm/boards/archosg9/env/boot/sd-card-linux
>  create mode 100644 arch/arm/boards/archosg9/env/boot/usb-android
>  create mode 100644 arch/arm/boards/archosg9/env/boot/usb-linux
>  delete mode 100644 arch/arm/boards/archosg9/env/config
>  create mode 100644 arch/arm/boards/archosg9/env/init/automount
>  create mode 100644 arch/arm/boards/archosg9/env/init/bootsource
>  delete mode 100644 arch/arm/boards/archosg9/env/init/usbboot
> 
> -- 
> 1.8.1.5
> 
> 
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
> 

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: [PATCH 6/9] omap4_romusb: allow adding usb-serial when not booting from usb
  2013-03-09 23:19 ` [PATCH 6/9] omap4_romusb: allow adding usb-serial when not booting from usb Vicente Bergas
@ 2013-03-14  7:50   ` Sascha Hauer
  0 siblings, 0 replies; 22+ messages in thread
From: Sascha Hauer @ 2013-03-14  7:50 UTC (permalink / raw)
  To: Vicente Bergas; +Cc: barebox

Hi Vicente,

On Sun, Mar 10, 2013 at 12:19:39AM +0100, Vicente Bergas wrote:
> 
> Signed-off-by: Vicente Bergas <vicencb@gmail.com>
> ---
>  arch/arm/mach-omap/include/mach/omap4_rom_usb.h |  3 +++
>  arch/arm/mach-omap/omap4_rom_usb.c              | 23 +++++++++++------------
>  drivers/serial/serial_omap4_usbboot.c           |  2 ++
>  3 files changed, 16 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/serial/serial_omap4_usbboot.c b/drivers/serial/serial_omap4_usbboot.c
> index f0a2fd1..ee5b19a 100644
> --- a/drivers/serial/serial_omap4_usbboot.c
> +++ b/drivers/serial/serial_omap4_usbboot.c
> @@ -78,6 +78,8 @@ static struct driver_d serial_omap4_usbboot_driver = {
>  
>  static int serial_omap4_usbboot_init(void)
>  {
> +	if (!omap4_usbboot_ready())
> +		return 0;
>  	return platform_driver_register(&serial_omap4_usbboot_driver);
>  }
>  console_initcall(serial_omap4_usbboot_init);

Here you register the driver only when usb boot is ready. It would be
better your register the device only when usb boot is ready. Are you
fine with this? Could you send a follow up patch?

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

end of thread, other threads:[~2013-03-14  7:50 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-09 23:19 [PATCH 0/9] Add support for booting ArchosG9 from sd-card Vicente Bergas
2013-03-09 23:19 ` [PATCH 1/9] defaultenv-2: don't load nonexistent file Vicente Bergas
2013-03-09 23:19 ` [PATCH 2/9] omap4_romusb: rename omap4_usbboot_pdata to omap4_usbboot_data Vicente Bergas
2013-03-09 23:19 ` [PATCH 3/9] omap_uart: rename OMAP3EVM_UARTx to OMAP_UARTx Vicente Bergas
2013-03-09 23:19 ` [PATCH 4/9] omap_uart: add low level port serial initialization Vicente Bergas
2013-03-10 13:16   ` Jean-Christophe PLAGNIOL-VILLARD
2013-03-10 22:16     ` vj
2013-03-10 22:35       ` Sascha Hauer
2013-03-10 22:44         ` vj
2013-03-10 23:01           ` Sascha Hauer
2013-03-10 23:09             ` vj
2013-03-09 23:19 ` [PATCH 5/9] panda: remove unused configuration items Vicente Bergas
2013-03-09 23:19 ` [PATCH 6/9] omap4_romusb: allow adding usb-serial when not booting from usb Vicente Bergas
2013-03-14  7:50   ` Sascha Hauer
2013-03-09 23:19 ` [PATCH 7/9] menu: avoid errors when building submenus Vicente Bergas
2013-03-10 13:16   ` Jean-Christophe PLAGNIOL-VILLARD
2013-03-10 22:29     ` vj
2013-03-11  8:50       ` Sascha Hauer
2013-03-09 23:19 ` [PATCH 8/9] archos: add atag appender for all features Vicente Bergas
2013-03-11  8:36   ` Sascha Hauer
2013-03-09 23:19 ` [PATCH 9/9] archosg9: enable booting from sd-card Vicente Bergas
2013-03-11 21:25 ` [PATCH 0/9] Add support for booting ArchosG9 " Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox