Skip to contentSkip to conversation

Add support for booting ArchosG9 from sd-card

PATCH In review Vicente Bergas 3 participants 22 messages Mar 9, 2013 – Mar 14, 2013

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

cover Add support for booting ArchosG9 from sd-card

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
Signature · 7 lines
1.8.1.5


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#1 lore raw

PATCH 1/9 defaultenv-2: don't load nonexistent file

---
 defaultenv-2/base/bin/init | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
defaultenv-2/base/bin/init +1 -1
index e4a7fee..6a658d1 100644
@@ -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
Signature · 7 lines
1.8.1.5


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#2 lore raw

PATCH 2/9 omap4_romusb: rename omap4_usbboot_pdata to omap4_usbboot_data

In reply to Vicente Bergas

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

---
 arch/arm/mach-omap/omap4_rom_usb.c | 72 +++++++++++++++++++-------------------
 1 file changed, 36 insertions(+), 36 deletions(-)
arch/arm/mach-omap/omap4_rom_usb.c +36 -36
index 48d6433..38f886b 100644
@@ -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)
Signature · 7 lines
1.8.1.5


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#3 lore raw

PATCH 3/9 omap_uart: rename OMAP3EVM_UARTx to OMAP_UARTx

In reply to Vicente Bergas

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

---
 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(-)
arch/arm/boards/omap3evm/board.c +2 -2
index 7585541..7284f5f 100644
@@ -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;
arch/arm/boards/omap3evm/lowlevel.c +2 -2
index 74e1315..2d9e130 100644
@@ -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));
arch/arm/mach-omap/Kconfig +6 -5
index a87fc4b..42e5f4a 100644
@@ -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.
 
arch/arm/mach-omap/include/mach/debug_ll.h +5 -1
index ed1777b..eea6eb3 100644
@@ -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>
Signature · 7 lines
1.8.1.5


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#4 lore raw

PATCH 4/9 omap_uart: add low level port serial initialization

In reply to Vicente Bergas

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

---
 arch/arm/mach-omap/include/mach/debug_ll.h | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)
arch/arm/mach-omap/include/mach/debug_ll.h +21 -0
index eea6eb3..9740848 100644
@@ -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 */
Signature · 7 lines
1.8.1.5


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#5 lore raw

Re: [PATCH 4/9] omap_uart: add low level port serial initialization

Quoted 17 lines · Vicente Bergas

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

---
 arch/arm/mach-omap/include/mach/debug_ll.h | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)
arch/arm/mach-omap/include/mach/debug_ll.h +1 -0
index eea6eb3..9740848 100644
@@ -45,9 +45,30 @@
 #endif
 
 #define LSR_THRE	0x20	/* Xmit holding register empty */
+#define LCR_BKSE	0x80	/* Bank select enable */
 #define LSR		(5 << 2)

arch/arm/mach-omap/include/mach/debug_ll.h line 59

Quoted 10 lines
arch/arm/mach-omap/include/mach/debug_ll.h +8 -0
 #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?

Quoted 23 lines
arch/arm/mach-omap/include/mach/debug_ll.h +12 -0
+{
+	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 */
Signature · 7 lines
1.8.1.5


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox

author
#6 lore raw

Re: [PATCH 4/9] omap_uart: add low level port serial initialization

Quoted 27 lines · Jean-Christophe PLAGNIOL-VILLARD
Quoted 26 lines · Vicente Bergas

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

---
 arch/arm/mach-omap/include/mach/debug_ll.h | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)
arch/arm/mach-omap/include/mach/debug_ll.h +8 -0
index eea6eb3..9740848 100644
@@ -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)
 
Quoted 2 lines

arch/arm/mach-omap/include/mach/debug_ll.h line 59

Quoted 1 line
arch/arm/mach-omap/include/mach/debug_ll.h +1 -0
+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?

Quoted 19 lines
Quoted 19 lines
arch/arm/mach-omap/include/mach/debug_ll.h +12 -1
+{
+     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

Quoted 4 lines
Quoted 4 lines

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox

#7 lore raw

Re: [PATCH 4/9] omap_uart: add low level port serial initialization

Quoted 60 lines · vj
Quoted 27 lines · Jean-Christophe PLAGNIOL-VILLARD
Quoted 26 lines · Vicente Bergas

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

---
 arch/arm/mach-omap/include/mach/debug_ll.h | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)
arch/arm/mach-omap/include/mach/debug_ll.h +8 -0
index eea6eb3..9740848 100644
@@ -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)
 
Quoted 2 lines

arch/arm/mach-omap/include/mach/debug_ll.h line 59

Quoted 1 line
arch/arm/mach-omap/include/mach/debug_ll.h +1 -0
+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++;
	}
}
Quoted 1 line

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

Signature · 9 lines
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
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
author
#8 lore raw

Re: [PATCH 4/9] omap_uart: add low level port serial initialization

Quoted 70 lines · Sascha Hauer
Quoted 60 lines · vj
Quoted 27 lines · Jean-Christophe PLAGNIOL-VILLARD
Quoted 26 lines · Vicente Bergas

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

---
 arch/arm/mach-omap/include/mach/debug_ll.h | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)
arch/arm/mach-omap/include/mach/debug_ll.h +8 -0
index eea6eb3..9740848 100644
@@ -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)
 
Quoted 2 lines

arch/arm/mach-omap/include/mach/debug_ll.h line 59

Quoted 1 line
arch/arm/mach-omap/include/mach/debug_ll.h +1 -0
+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++;
      }
}
Quoted 1 line

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.

Quoted 7 lines

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
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox

#9 lore raw

Re: [PATCH 4/9] omap_uart: add low level port serial initialization

Quoted 16 lines · vj
Quoted 8 lines

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.

Quoted 7 lines

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 |
Quoted 4 lines

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

Signature · 9 lines
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
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
author
#10 lore raw

Re: [PATCH 4/9] omap_uart: add low level port serial initialization

Quoted 38 lines · Sascha Hauer
Quoted 16 lines · vj
Quoted 8 lines

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.

Quoted 7 lines

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 |
Quoted 4 lines

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.

Quoted 7 lines

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
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox

#11 lore raw

PATCH 5/9 panda: remove unused configuration items

In reply to Vicente Bergas
---
 arch/arm/configs/panda_xload_defconfig | 3 ---
 1 file changed, 3 deletions(-)
arch/arm/configs/panda_xload_defconfig +0 -3
index 1ed20a1..5cedcff 100644
@@ -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
Signature · 7 lines
1.8.1.5


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#12 lore raw

PATCH 6/9 omap4_romusb: allow adding usb-serial when not booting from usb

In reply to Vicente Bergas
---
 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(-)
arch/arm/mach-omap/include/mach/omap4_rom_usb.h +3 -0
index 50c359f..bf8bd15 100644
@@ -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);
arch/arm/mach-omap/omap4_rom_usb.c +11 -12
index 38f886b..de35d61 100644
@@ -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);
drivers/serial/serial_omap4_usbboot.c +2 -0
index f0a2fd1..ee5b19a 100644
@@ -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);
Signature · 7 lines
1.8.1.5


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#13 lore raw

Re: [PATCH 6/9] omap4_romusb: allow adding usb-serial when not booting from usb

Hi Vicente,

Quoted 13 lines · Vicente Bergas
---
 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(-)
drivers/serial/serial_omap4_usbboot.c +0 -0
index f0a2fd1..ee5b19a 100644

drivers/serial/serial_omap4_usbboot.c static struct driver_d serial_omap4_usbboot_driver = { · line 85

Quoted 8 lines
drivers/serial/serial_omap4_usbboot.c +2 -0
@@ -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

Signature · 9 lines
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
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#14 lore raw

PATCH 7/9 menu: avoid errors when building submenus

In reply to 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

---
 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(-)
arch/arm/boards/at91sam9m10ihd/env/boot/android +1 -1
index e440f18..e7387c5 100644
@@ -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
 
arch/arm/boards/at91sam9m10ihd/env/boot/mmc +1 -1
index 89c66ee..1ed98e3 100644
@@ -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
 
arch/arm/boards/at91sam9m10ihd/env/boot/net +1 -1
index cdb2520..35f0a54 100644
@@ -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
 
arch/arm/boards/at91sam9m10ihd/env/boot/net-usb +1 -1
index 6e341a0..c4c01c3 100644
@@ -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
 
arch/arm/boards/beagle/env/boot/mmc +1 -1
index 58bd557..d1a5486 100644
@@ -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
 
arch/arm/boards/beagle/env/boot/nand-ubi +1 -1
index 3037fd4..f0e932b 100644
@@ -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
 
arch/arm/boards/beagle/env/boot/nand-ubi-dt +1 -1
index b7a1f19..e7539b8 100644
@@ -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
 
arch/arm/boards/beaglebone/env/boot/sd +1 -1
index dce0605..6315e08 100644
@@ -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
 
arch/arm/boards/clep7212/env/boot/nor +1 -1
index df8c983..cca2bfa 100644
@@ -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
 
arch/arm/boards/crystalfontz-cfa10036/env/boot/mmc-ext3 +1 -1
index 4d830ed..b600a56 100644
@@ -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
 
arch/arm/boards/efika-mx-smartbook/env/boot/hd-internal +1 -1
index ccd0f69..564f10e 100644
@@ -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
 
arch/arm/boards/efika-mx-smartbook/env/boot/mmc-left +1 -1
index 21935c6..6bba754 100644
@@ -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
 
arch/arm/boards/guf-vincell/env/boot/nand-ubi +1 -1
index a3f748e..1745e58 100644
@@ -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
 
arch/arm/boards/karo-tx25/env/boot/nand-ubi +1 -1
index 67b0cb4..a6f6d7a 100644
@@ -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
 
arch/arm/boards/panda/env/boot/mmc +1 -1
index 58bd557..d1a5486 100644
@@ -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
 
arch/arm/boards/pcm037/env/boot/nand-ubi +1 -1
index 67b0cb4..a6f6d7a 100644
@@ -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
 
arch/arm/boards/pcm038/env/boot/nand-ubi +1 -1
index 67b0cb4..a6f6d7a 100644
@@ -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
 
arch/arm/boards/pcm043/env/boot/nand-ubi +1 -1
index 67b0cb4..a6f6d7a 100644
@@ -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
 
arch/arm/boards/pcm051/env/boot/sd +1 -1
index f303c10..9debd73 100644
@@ -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
 
arch/arm/boards/telit-evk-pro3/env/boot/nand-ubi +1 -1
index 1987492..ffc64f1 100644
@@ -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
 
defaultenv-2/base/boot/net +1 -1
index 90c25aa..25d2d12 100644
@@ -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
 
defaultenv-2/base/data/boot-template +1 -1
index 9297499..2b3e018 100644
@@ -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
 
defaultenv-2/menu/menu/boot-entries-collect +2 -2
index c066c93..ba82bf1 100644
@@ -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
 
defaultenv-2/menu/menu/boot-entries-edit +1 -1
index c4e1c3d..16586be 100644
@@ -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"
defaultenv-2/menu/menu/boot-entries-remove +1 -1
index 566be9d..2fe8265 100644
@@ -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"
 
defaultenv-2/menu/menu/boot-menu-add-entry +3 -3
index f06c524..f634b5c 100644
@@ -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}"
defaultenv-2/menu/menu/mainmenu +1 -1
index c74cc9c..aa7626b 100644
@@ -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"
Signature · 7 lines
1.8.1.5


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#15 lore raw

Re: [PATCH 7/9] menu: avoid errors when building submenus

Quoted 2 lines · 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

how this could happend?

Quoted 396 lines
---
 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(-)
arch/arm/boards/at91sam9m10ihd/env/boot/android +1 -1
index e440f18..e7387c5 100644
@@ -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
 
arch/arm/boards/at91sam9m10ihd/env/boot/mmc +1 -1
index 89c66ee..1ed98e3 100644
@@ -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
 
arch/arm/boards/at91sam9m10ihd/env/boot/net +1 -1
index cdb2520..35f0a54 100644
@@ -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
 
arch/arm/boards/at91sam9m10ihd/env/boot/net-usb +1 -1
index 6e341a0..c4c01c3 100644
@@ -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
 
arch/arm/boards/beagle/env/boot/mmc +1 -1
index 58bd557..d1a5486 100644
@@ -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
 
arch/arm/boards/beagle/env/boot/nand-ubi +1 -1
index 3037fd4..f0e932b 100644
@@ -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
 
arch/arm/boards/beagle/env/boot/nand-ubi-dt +1 -1
index b7a1f19..e7539b8 100644
@@ -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
 
arch/arm/boards/beaglebone/env/boot/sd +1 -1
index dce0605..6315e08 100644
@@ -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
 
arch/arm/boards/clep7212/env/boot/nor +1 -1
index df8c983..cca2bfa 100644
@@ -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
 
arch/arm/boards/crystalfontz-cfa10036/env/boot/mmc-ext3 +1 -1
index 4d830ed..b600a56 100644
@@ -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
 
arch/arm/boards/efika-mx-smartbook/env/boot/hd-internal +1 -1
index ccd0f69..564f10e 100644
@@ -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
 
arch/arm/boards/efika-mx-smartbook/env/boot/mmc-left +1 -1
index 21935c6..6bba754 100644
@@ -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
 
arch/arm/boards/guf-vincell/env/boot/nand-ubi +1 -1
index a3f748e..1745e58 100644
@@ -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
 
arch/arm/boards/karo-tx25/env/boot/nand-ubi +1 -1
index 67b0cb4..a6f6d7a 100644
@@ -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
 
arch/arm/boards/panda/env/boot/mmc +1 -1
index 58bd557..d1a5486 100644
@@ -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
 
arch/arm/boards/pcm037/env/boot/nand-ubi +1 -1
index 67b0cb4..a6f6d7a 100644
@@ -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
 
arch/arm/boards/pcm038/env/boot/nand-ubi +1 -1
index 67b0cb4..a6f6d7a 100644
@@ -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
 
arch/arm/boards/pcm043/env/boot/nand-ubi +1 -1
index 67b0cb4..a6f6d7a 100644
@@ -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
 
arch/arm/boards/pcm051/env/boot/sd +1 -1
index f303c10..9debd73 100644
@@ -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
 
arch/arm/boards/telit-evk-pro3/env/boot/nand-ubi +1 -1
index 1987492..ffc64f1 100644
@@ -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
 
defaultenv-2/base/boot/net +1 -1
index 90c25aa..25d2d12 100644
@@ -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
 
defaultenv-2/base/data/boot-template +1 -1
index 9297499..2b3e018 100644
@@ -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
 
defaultenv-2/menu/menu/boot-entries-collect +2 -2
index c066c93..ba82bf1 100644
@@ -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
 
defaultenv-2/menu/menu/boot-entries-edit +1 -1
index c4e1c3d..16586be 100644
@@ -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"
defaultenv-2/menu/menu/boot-entries-remove +1 -1
index 566be9d..2fe8265 100644
@@ -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"
 
defaultenv-2/menu/menu/boot-menu-add-entry +3 -3
index f06c524..f634b5c 100644
@@ -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}"
defaultenv-2/menu/menu/mainmenu +1 -1
index c74cc9c..aa7626b 100644
@@ -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"
Signature · 7 lines
1.8.1.5


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox

author
#16 lore raw

Re: [PATCH 7/9] menu: avoid errors when building submenus

Quoted 4 lines · Jean-Christophe PLAGNIOL-VILLARD
Quoted 2 lines · 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

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.

Quoted 394 lines
Quoted 394 lines
---
 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(-)
arch/arm/boards/at91sam9m10ihd/env/boot/android +1 -1
index e440f18..e7387c5 100644
@@ -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
 
arch/arm/boards/at91sam9m10ihd/env/boot/mmc +1 -1
index 89c66ee..1ed98e3 100644
@@ -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
 
arch/arm/boards/at91sam9m10ihd/env/boot/net +1 -1
index cdb2520..35f0a54 100644
@@ -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
 
arch/arm/boards/at91sam9m10ihd/env/boot/net-usb +1 -1
index 6e341a0..c4c01c3 100644
@@ -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
 
arch/arm/boards/beagle/env/boot/mmc +1 -1
index 58bd557..d1a5486 100644
@@ -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
 
arch/arm/boards/beagle/env/boot/nand-ubi +1 -1
index 3037fd4..f0e932b 100644
@@ -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
 
arch/arm/boards/beagle/env/boot/nand-ubi-dt +1 -1
index b7a1f19..e7539b8 100644
@@ -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
 
arch/arm/boards/beaglebone/env/boot/sd +1 -1
index dce0605..6315e08 100644
@@ -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
 
arch/arm/boards/clep7212/env/boot/nor +1 -1
index df8c983..cca2bfa 100644
@@ -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
 
arch/arm/boards/crystalfontz-cfa10036/env/boot/mmc-ext3 +1 -1
index 4d830ed..b600a56 100644
@@ -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
 
arch/arm/boards/efika-mx-smartbook/env/boot/hd-internal +1 -1
index ccd0f69..564f10e 100644
@@ -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
 
arch/arm/boards/efika-mx-smartbook/env/boot/mmc-left +1 -1
index 21935c6..6bba754 100644
@@ -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
 
arch/arm/boards/guf-vincell/env/boot/nand-ubi +1 -1
index a3f748e..1745e58 100644
@@ -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
 
arch/arm/boards/karo-tx25/env/boot/nand-ubi +1 -1
index 67b0cb4..a6f6d7a 100644
@@ -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
 
arch/arm/boards/panda/env/boot/mmc +1 -1
index 58bd557..d1a5486 100644
@@ -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
 
arch/arm/boards/pcm037/env/boot/nand-ubi +1 -1
index 67b0cb4..a6f6d7a 100644
@@ -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
 
arch/arm/boards/pcm038/env/boot/nand-ubi +1 -1
index 67b0cb4..a6f6d7a 100644
@@ -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
 
arch/arm/boards/pcm043/env/boot/nand-ubi +1 -1
index 67b0cb4..a6f6d7a 100644
@@ -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
 
arch/arm/boards/pcm051/env/boot/sd +1 -1
index f303c10..9debd73 100644
@@ -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
 
arch/arm/boards/telit-evk-pro3/env/boot/nand-ubi +1 -1
index 1987492..ffc64f1 100644
@@ -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
 
defaultenv-2/base/boot/net +1 -1
index 90c25aa..25d2d12 100644
@@ -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
 
defaultenv-2/base/data/boot-template +1 -1
index 9297499..2b3e018 100644
@@ -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
 
defaultenv-2/menu/menu/boot-entries-collect +2 -2
index c066c93..ba82bf1 100644
@@ -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
 
defaultenv-2/menu/menu/boot-entries-edit +1 -1
index c4e1c3d..16586be 100644
@@ -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"
defaultenv-2/menu/menu/boot-entries-remove +1 -1
index 566be9d..2fe8265 100644
@@ -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"
 
defaultenv-2/menu/menu/boot-menu-add-entry +3 -3
index f06c524..f634b5c 100644
@@ -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}"
defaultenv-2/menu/menu/mainmenu +1 -2
index c74cc9c..aa7626b 100644
@@ -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

Quoted 4 lines
Quoted 4 lines

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox

#17 lore raw

Re: [PATCH 7/9] menu: avoid errors when building submenus

Quoted 7 lines · vj
Quoted 4 lines · Jean-Christophe PLAGNIOL-VILLARD
Quoted 2 lines · 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

how this could happend?

Quoted 16 lines

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

Signature · 9 lines
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
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#18 lore raw

PATCH 8/9 archos: add atag appender for all features

In reply to Vicente Bergas
---
 arch/arm/boards/archosg9/archos_features.c | 414 ++++++++++++++++++++++++++---
 arch/arm/boards/archosg9/archos_features.h |  39 +++
 2 files changed, 412 insertions(+), 41 deletions(-)
arch/arm/boards/archosg9/archos_features.c +373 -41
index 5d93403..4b0265e 100644
@@ -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));
arch/arm/boards/archosg9/archos_features.h +39 -0
index 5769c6c..a3e1437 100644
@@ -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
 
Signature · 7 lines
1.8.1.5


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#19 lore raw

Re: [PATCH 8/9] archos: add atag appender for all features

Quoted 8 lines · Vicente Bergas
---
 arch/arm/boards/archosg9/archos_features.c | 414 ++++++++++++++++++++++++++---
 arch/arm/boards/archosg9/archos_features.h |  39 +++
 2 files changed, 412 insertions(+), 41 deletions(-)
arch/arm/boards/archosg9/archos_features.c +0 -0

[...]

Quoted 9 lines
arch/arm/boards/archosg9/archos_features.c +9 -0
+#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
+}

arch/arm/boards/archosg9/archos_features.c static void setup_feature_core(void) · line 471

Quoted 10 lines
arch/arm/boards/archosg9/archos_features.c +10 -0
+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,...

Quoted 25 lines

}
static void setup_feature_none(void)
{

arch/arm/boards/archosg9/archos_features.c +18 -0
@@ -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();

arch/arm/boards/archosg9/archos_features.c static struct tag *setup_feature_list(struct tag * params) · line 525

Quoted 10 lines
arch/arm/boards/archosg9/archos_features.c +10 -0
+	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 ...

Quoted 11 lines
arch/arm/boards/archosg9/archos_features.c +0 -0
 	setup_feature_none();
 
 	fl->size = ((u32)features) - ((u32)(fl->data));
arch/arm/boards/archosg9/archos_features.h +0 -0
index 5769c6c..a3e1437 100644
@@ -1,6 +1,45 @@
 #ifndef __ARCHOS_FEATURES_H
 #define __ARCHOS_FEATURES_H
 

arch/arm/boards/archosg9/archos_features.h line 13

Quoted 10 lines
arch/arm/boards/archosg9/archos_features.h +10 -0
+#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

Signature · 9 lines
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
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#20 lore raw

PATCH 9/9 archosg9: enable booting from sd-card

In reply to Vicente Bergas
---
 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
arch/arm/boards/archosg9/board.c +0 -1
index 8366cca..bf247de 100644
@@ -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);
 	/*
arch/arm/boards/archosg9/env/boot/sd-card-android new file +11 -0
new file mode 100644
index 0000000..dc6f15e
@@ -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"
arch/arm/boards/archosg9/env/boot/sd-card-linux new file +17 -0
new file mode 100644
index 0000000..1ae7340
@@ -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
arch/arm/boards/archosg9/env/boot/usb-android new file +11 -0
new file mode 100644
index 0000000..f764681
@@ -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"
arch/arm/boards/archosg9/env/boot/usb-linux new file +17 -0
new file mode 100644
index 0000000..1d8e919
@@ -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
arch/arm/boards/archosg9/env/config deleted +0 -3
deleted file mode 100644
index 8f3edb0..0000000
@@ -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"
arch/arm/boards/archosg9/env/init/automount new file +28 -0
new file mode 100644
index 0000000..700b5e4
@@ -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'
arch/arm/boards/archosg9/env/init/bootsource new file +11 -0
new file mode 100644
index 0000000..b3df447
@@ -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
arch/arm/boards/archosg9/env/init/usbboot deleted +0 -6
deleted file mode 100644
index 83dd19a..0000000
@@ -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
arch/arm/configs/archosg9_defconfig +46 -21

113 lines not on this page · raw message

arch/arm/configs/archosg9_xload_defconfig +14 -6
index 83743fa..24369b2 100644
@@ -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
Signature · 7 lines
1.8.1.5


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#21 lore raw
In reply to Vicente Bergas

Hi Vicente,

Quoted 2 lines · 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.

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

Thanks
Sascha

Quoted 80 lines

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
Signature · 7 lines
1.8.1.5


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
Signature · 9 lines
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
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox