mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [RFC 1/2] ARM omap: Add null console
@ 2012-01-11 17:34 Sanjeev Premi
  2012-01-11 17:34 ` [RFC 2/2] ARM omap: Add CONFIG_SILENT Sanjeev Premi
  2012-01-12  9:13 ` [RFC 1/2] ARM omap: Add null console Sascha Hauer
  0 siblings, 2 replies; 8+ messages in thread
From: Sanjeev Premi @ 2012-01-11 17:34 UTC (permalink / raw)
  To: barebox

When using barebox as both 1st and 2nd stage bootloader,
same banner gets printed - date being the only difference.

For the first stage bootloader, prints are definitely
required during initial debug and development phases,
but after that, they can easily be avoided.

And if we don't need prints, then we can do without the
serial driver as well.

With this background, this patch introduces concept of
NULL console. Most Kconfig changes are quite simple.

Separate file console_null.c was created only for ease
of review and maintaining console_simple.c as-is.

In final version, appropriate #ifdefs in console_simple.c
should be used.

Visually, the prompt from barebox.bin comes up is about
a second - and appears to be much faster.

Here is comparison of the size:

   text    data     bss     dec     hex filename
  45801    3300    4024   53125    cf85 barebox  (Before)
  44221    3196    4020   51437    c8ed barebox  (After)

Tested on OMAP3EVM with xload configuration derived from
omap3530_beagle_xload_defconfig.

Signed-off-by: Sanjeev Premi <premi@ti.com>
Cc: Sascha Hauer <s.hauer@pengutronix.de>
Cc: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
---

 Although I have marked the change to be specific to
 ARM+OMAP, it could be generally applicable.

 arch/arm/mach-omap/Kconfig |    4 +-
 common/Kconfig             |   11 +++-
 common/Makefile            |    1 +
 common/console_null.c      |  135 ++++++++++++++++++++++++++++++++++++++++++++
 drivers/serial/Kconfig     |    1 +
 5 files changed, 149 insertions(+), 3 deletions(-)
 create mode 100644 common/console_null.c

diff --git a/arch/arm/mach-omap/Kconfig b/arch/arm/mach-omap/Kconfig
index 72c6850..9edb4a9 100644
--- a/arch/arm/mach-omap/Kconfig
+++ b/arch/arm/mach-omap/Kconfig
@@ -171,13 +171,13 @@ if MACH_OMAP3EVM
 
 	config OMAP3EVM_UART1
 		bool "Use UART1"
-		depends on MACH_OMAP3EVM
+		depends on MACH_OMAP3EVM && !CONSOLE_NULL
 		help
 		  Say Y here if you would like to use UART1 as console.
 
 	config OMAP3EVM_UART3
 		bool "Use UART3"
-		depends on MACH_OMAP3EVM
+		depends on MACH_OMAP3EVM && !CONSOLE_NULL
 		help
 		  Say Y here if you would like to use UART3 as console.
 	endchoice
diff --git a/common/Kconfig b/common/Kconfig
index ca4f099..a664624 100644
--- a/common/Kconfig
+++ b/common/Kconfig
@@ -377,10 +377,19 @@ config CONSOLE_FULL
 	  This option enables full console support capable of
 	  handling multiple consoles.
 
+config CONSOLE_NULL
+	bool
+	depends on !CONSOLE_FULL
+	prompt "Enable null console"
+	help
+	  This option enables null console i.e. there is no real
+	  read/ write operation.
+
 config CONSOLE_SIMPLE
 	bool
 	default y
-	depends on !CONSOLE_FULL
+	depends on !CONSOLE_FULL && !CONSOLE_NULL
+
 
 config CONSOLE_ACTIVATE_FIRST
 	depends on CONSOLE_FULL
diff --git a/common/Makefile b/common/Makefile
index d1132c3..6705257 100644
--- a/common/Makefile
+++ b/common/Makefile
@@ -20,6 +20,7 @@ obj-y += clock.o
 obj-y += version.o
 obj-$(CONFIG_COMMAND_SUPPORT) += command.o
 obj-$(CONFIG_CONSOLE_FULL) += console.o
+obj-$(CONFIG_CONSOLE_NULL) += console_null.o
 obj-$(CONFIG_CONSOLE_SIMPLE) += console_simple.o
 obj-$(CONFIG_DIGEST) += digest.o
 obj-$(CONFIG_ENVIRONMENT_VARIABLES) += env.o
diff --git a/common/console_null.c b/common/console_null.c
new file mode 100644
index 0000000..7b2db37
--- /dev/null
+++ b/common/console_null.c
@@ -0,0 +1,135 @@
+#include <config.h>
+#include <common.h>
+#include <fs.h>
+#include <errno.h>
+
+int printf (const char *fmt, ...)
+{
+	va_list args;
+	uint i;
+	char printbuffer[CFG_PBSIZE];
+
+	va_start (args, fmt);
+
+	/* For this to work, printbuffer must be larger than
+	 * anything we ever want to print.
+	 */
+	i = vsprintf (printbuffer, fmt, args);
+	va_end (args);
+
+	/* Don't put off callers who check for return value */
+	return i;
+}
+EXPORT_SYMBOL(printf);
+
+int vprintf (const char *fmt, va_list args)
+{
+	uint i;
+	char printbuffer[CFG_PBSIZE];
+
+	/* For this to work, printbuffer must be larger than
+	 * anything we ever want to print.
+	 */
+	i = vsprintf (printbuffer, fmt, args);
+
+	/* Don't put off callers who check for return value */
+	return i;
+}
+EXPORT_SYMBOL(vprintf);
+
+int fprintf(int file, const char *fmt, ...)
+{
+	va_list args;
+	uint i;
+	char printbuffer[CFG_PBSIZE];
+
+	va_start (args, fmt);
+
+	/* For this to work, printbuffer must be larger than
+	 * anything we ever want to print.
+	 */
+	i = vsprintf (printbuffer, fmt, args);
+	va_end (args);
+
+	/* Don't put off callers who check for return value */
+	return i;
+}
+EXPORT_SYMBOL(fprintf);
+
+int console_puts(unsigned int ch, const char *str)
+{
+	const char *s = str;
+	int i = 0;
+
+	while (*s)
+		i++;
+
+	/* Don't put off callers who check for return value */
+	return i;
+}
+EXPORT_SYMBOL(console_puts);
+
+void console_putc(unsigned int ch, char c)
+{
+}
+EXPORT_SYMBOL(console_putc);
+
+int fputc(int fd, char c)
+{
+	if (fd == 1)
+		putchar(c);
+	else if (fd == 2)
+		eputc(c);
+	else
+		return write(fd, &c, 1);
+	return 0;
+}
+EXPORT_SYMBOL(fputc);
+
+int fputs(int fd, const char *s)
+{
+	if (fd == 1)
+		puts(s);
+	else if (fd == 2)
+		eputs(s);
+	else
+		return write(fd, s, strlen(s));
+	return 0;
+}
+EXPORT_SYMBOL(fputs);
+
+int tstc(void)
+{
+	return 0;
+}
+EXPORT_SYMBOL(tstc);
+
+int getc(void)
+{
+	return -EINVAL;
+}
+EXPORT_SYMBOL(getc);
+
+void console_flush(void)
+{
+}
+EXPORT_SYMBOL(console_flush);
+
+#ifndef ARCH_HAS_CTRLC
+/* test if ctrl-c was pressed */
+int ctrlc (void)
+{
+	return 0;
+}
+EXPORT_SYMBOL(ctrlc);
+#endif /* ARCH_HAS_CTRC */
+
+int console_register(struct console_device *newcdev)
+{
+	return 0;
+}
+
+int console_unregister(struct console_device *cdev)
+{
+	return -EBUSY;
+}
diff --git a/drivers/serial/Kconfig b/drivers/serial/Kconfig
index 186b596..cc0e583 100644
--- a/drivers/serial/Kconfig
+++ b/drivers/serial/Kconfig
@@ -56,6 +56,7 @@ config DRIVER_SERIAL_ALTERA_JTAG
 config DRIVER_SERIAL_NS16550
 	default n
 	bool "NS16550 serial driver"
+	depends on !CONSOLE_NULL
 	help
 	  Enable this to get support for NS16550 based serial devices
 
-- 
1.7.0.4


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

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

* [RFC 2/2] ARM omap: Add CONFIG_SILENT
  2012-01-11 17:34 [RFC 1/2] ARM omap: Add null console Sanjeev Premi
@ 2012-01-11 17:34 ` Sanjeev Premi
  2012-01-12  9:28   ` Sascha Hauer
  2012-01-12  9:13 ` [RFC 1/2] ARM omap: Add null console Sascha Hauer
  1 sibling, 1 reply; 8+ messages in thread
From: Sanjeev Premi @ 2012-01-11 17:34 UTC (permalink / raw)
  To: barebox

Don't display any verbose message on the console.

Signed-off-by: Sanjeev Premi <premi@ti.com>
Cc: Sascha Hauer <s.hauer@pengutronix.de>
Cc: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
---

 This config option is kept separate, as user may
 want console features, but avoid initial messages.

 Although I have marked the change to be specific to
 ARM+OMAP, it is generally applicable. Will change
 the subject in actual based on review comments to
 this RFC.

 common/Kconfig   |    4 ++++
 common/startup.c |    2 ++
 common/version.c |    3 ++-
 3 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/common/Kconfig b/common/Kconfig
index a664624..cf09034 100644
--- a/common/Kconfig
+++ b/common/Kconfig
@@ -369,6 +369,10 @@ config TIMESTAMP
 	  commands like bootm or iminfo. This option is
 	  automatically enabled when you select CFG_CMD_DATE .
 
+config SILENT
+	bool
+	prompt "Don't display any messages on console"
+
 config CONSOLE_FULL
 	bool
 	default y
diff --git a/common/startup.c b/common/startup.c
index 180fdc3..976c0d3 100644
--- a/common/startup.c
+++ b/common/startup.c
@@ -52,6 +52,7 @@ static void display_meminfo(void)
 
 	debug("barebox code: 0x%p -> 0x%p\n", _stext, _etext);
 	debug("bss segment:  0x%p -> 0x%p\n", __bss_start, __bss_stop);
+#ifndef CONFIG_SILENT
 	printf("Malloc space: 0x%08lx -> 0x%08lx (size %s)\n",
 		mstart, mend, size_human_readable(msize));
 #ifdef CONFIG_ARM
@@ -59,6 +60,7 @@ static void display_meminfo(void)
 		STACK_BASE, STACK_BASE + STACK_SIZE,
 		size_human_readable(STACK_SIZE));
 #endif
+#endif /* CONFIG_SILENT */
 }
 
 #ifdef CONFIG_DEFAULT_ENVIRONMENT
diff --git a/common/version.c b/common/version.c
index 0af8ec1..6d26ef8 100644
--- a/common/version.c
+++ b/common/version.c
@@ -6,7 +6,8 @@ const char version_string[] =
 
 void barebox_banner (void)
 {
+#ifndef CONFIG_SILENT
 	printf("\n\n%s\n\n", version_string);
 	printf("Board: " CONFIG_BOARDINFO "\n");
+#endif
 }
-
-- 
1.7.0.4


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

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

* Re: [RFC 1/2] ARM omap: Add null console
  2012-01-11 17:34 [RFC 1/2] ARM omap: Add null console Sanjeev Premi
  2012-01-11 17:34 ` [RFC 2/2] ARM omap: Add CONFIG_SILENT Sanjeev Premi
@ 2012-01-12  9:13 ` Sascha Hauer
  1 sibling, 0 replies; 8+ messages in thread
From: Sascha Hauer @ 2012-01-12  9:13 UTC (permalink / raw)
  To: Sanjeev Premi; +Cc: barebox

On Wed, Jan 11, 2012 at 11:04:43PM +0530, Sanjeev Premi wrote:
> When using barebox as both 1st and 2nd stage bootloader,
> same banner gets printed - date being the only difference.
> 
> For the first stage bootloader, prints are definitely
> required during initial debug and development phases,
> but after that, they can easily be avoided.
> 
> And if we don't need prints, then we can do without the
> serial driver as well.
> 
> With this background, this patch introduces concept of
> NULL console. Most Kconfig changes are quite simple.
> 
> Separate file console_null.c was created only for ease
> of review and maintaining console_simple.c as-is.
> 
> In final version, appropriate #ifdefs in console_simple.c
> should be used.
> 
> Visually, the prompt from barebox.bin comes up is about
> a second - and appears to be much faster.
> 
> Here is comparison of the size:
> 
>    text    data     bss     dec     hex filename
>   45801    3300    4024   53125    cf85 barebox  (Before)
>   44221    3196    4020   51437    c8ed barebox  (After)
> 
> Tested on OMAP3EVM with xload configuration derived from
> omap3530_beagle_xload_defconfig.
> 
> Signed-off-by: Sanjeev Premi <premi@ti.com>
> Cc: Sascha Hauer <s.hauer@pengutronix.de>
> Cc: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
> ---
> 
>  Although I have marked the change to be specific to
>  ARM+OMAP, it could be generally applicable.
> 
>  arch/arm/mach-omap/Kconfig |    4 +-
>  common/Kconfig             |   11 +++-
>  common/Makefile            |    1 +
>  common/console_null.c      |  135 ++++++++++++++++++++++++++++++++++++++++++++
>  drivers/serial/Kconfig     |    1 +
>  5 files changed, 149 insertions(+), 3 deletions(-)
>  create mode 100644 common/console_null.c
> 
> diff --git a/arch/arm/mach-omap/Kconfig b/arch/arm/mach-omap/Kconfig
> index 72c6850..9edb4a9 100644
> --- a/arch/arm/mach-omap/Kconfig
> +++ b/arch/arm/mach-omap/Kconfig
> @@ -171,13 +171,13 @@ if MACH_OMAP3EVM
>  
>  	config OMAP3EVM_UART1
>  		bool "Use UART1"
> -		depends on MACH_OMAP3EVM
> +		depends on MACH_OMAP3EVM && !CONSOLE_NULL

Right now CONFIG_OMAP3EVM_UART1 and CONFIG_OMAP3EVM_UART3 are
exclusive options and I see no reason why they should be. To make
this a bit simpler we could do this:

#ifndef CONSOLE_NULL
	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));
	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));
	MUX_VAL(CP(UART3_TX_IRTX),	(IDIS | PTD | DIS | M0));
#endif

#ifdef CONFIG_OMAP3EVM_UART1
	add_ns16550_device(...)
#endif
#ifdef CONFIG_OMAP3EVM_UART3
	add_ns16550_device(...)
#endif

> diff --git a/drivers/serial/Kconfig b/drivers/serial/Kconfig
> index 186b596..cc0e583 100644
> --- a/drivers/serial/Kconfig
> +++ b/drivers/serial/Kconfig
> @@ -56,6 +56,7 @@ config DRIVER_SERIAL_ALTERA_JTAG
>  config DRIVER_SERIAL_NS16550
>  	default n
>  	bool "NS16550 serial driver"
> +	depends on !CONSOLE_NULL

No, we don't want to add this 'depends on' to every serial driver.
Instead we should turn the serial driver menu to a menuconfig
depending on !CONSOLE_NULL.

Please split the omap specific part and the generic part into two
patches next time you send this.

Sascha


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

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

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

* Re: [RFC 2/2] ARM omap: Add CONFIG_SILENT
  2012-01-11 17:34 ` [RFC 2/2] ARM omap: Add CONFIG_SILENT Sanjeev Premi
@ 2012-01-12  9:28   ` Sascha Hauer
  2012-01-12 10:54     ` Jean-Christophe PLAGNIOL-VILLARD
                       ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Sascha Hauer @ 2012-01-12  9:28 UTC (permalink / raw)
  To: Sanjeev Premi; +Cc: barebox

On Wed, Jan 11, 2012 at 11:04:44PM +0530, Sanjeev Premi wrote:
> Don't display any verbose message on the console.

We already have pr_info and friends which right now all fall
back to printf. Instead of adding an ifdef for each conditional
printf how about making pr_* configurable? Something like this:

#if (CONFIG_LOGLEVEL > 6)
#define pr_info(fmt, arg...) printf(fmt, ##arg)
#else
#define pr_info(fmt, arg...)	do {} while(0)
#endif
#if (CONFIG_LOGLEVEL > 5)
#define pr_notice(fmt, arg...)	printf(fmt, ##arg)
#else
#define pr_notice(fmt, arg...)    do {} while(0)
#endif

BTW you seem to be very concerned about the codesize in the xloader
environments, which I can understand. How about giving my thumb2 patches
a try?

panda_xload_defconfig:
-rwxr-xr-x 1 sha ptx 41272 Jan 12 10:25 barebox.bin

panda_xload_defconfig in thumb2 mode:
-rwxr-xr-x 1 sha ptx 30348 Jan 12 10:25 barebox.bin

To merge these I'm currently waiting for Jean-Christophes OK on

ARM: move exception vectors away from start of binary

Sascha

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

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

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

* Re: [RFC 2/2] ARM omap: Add CONFIG_SILENT
  2012-01-12  9:28   ` Sascha Hauer
@ 2012-01-12 10:54     ` Jean-Christophe PLAGNIOL-VILLARD
  2012-01-12 12:26     ` Premi, Sanjeev
  2012-01-12 15:51     ` Premi, Sanjeev
  2 siblings, 0 replies; 8+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2012-01-12 10:54 UTC (permalink / raw)
  To: Sascha Hauer; +Cc: barebox

On 10:28 Thu 12 Jan     , Sascha Hauer wrote:
> On Wed, Jan 11, 2012 at 11:04:44PM +0530, Sanjeev Premi wrote:
> > Don't display any verbose message on the console.
> 
> We already have pr_info and friends which right now all fall
> back to printf. Instead of adding an ifdef for each conditional
> printf how about making pr_* configurable? Something like this:
> 
> #if (CONFIG_LOGLEVEL > 6)
> #define pr_info(fmt, arg...) printf(fmt, ##arg)
> #else
> #define pr_info(fmt, arg...)	do {} while(0)
> #endif
> #if (CONFIG_LOGLEVEL > 5)
> #define pr_notice(fmt, arg...)	printf(fmt, ##arg)
> #else
> #define pr_notice(fmt, arg...)    do {} while(0)
> #endif
> 
> BTW you seem to be very concerned about the codesize in the xloader
> environments, which I can understand. How about giving my thumb2 patches
> a try?
> 
> panda_xload_defconfig:
> -rwxr-xr-x 1 sha ptx 41272 Jan 12 10:25 barebox.bin
> 
> panda_xload_defconfig in thumb2 mode:
> -rwxr-xr-x 1 sha ptx 30348 Jan 12 10:25 barebox.bin
> 
> To merge these I'm currently waiting for Jean-Christophes OK on
> 
> ARM: move exception vectors away from start of binary
does not work on at91 yet

I'm working on the modification to make it work


I'll send a first version of the at91 bootstrap soon without this modifcation
and then fix it

Best Regards,
J.

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

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

* RE: [RFC 2/2] ARM omap: Add CONFIG_SILENT
  2012-01-12  9:28   ` Sascha Hauer
  2012-01-12 10:54     ` Jean-Christophe PLAGNIOL-VILLARD
@ 2012-01-12 12:26     ` Premi, Sanjeev
  2012-01-12 15:51     ` Premi, Sanjeev
  2 siblings, 0 replies; 8+ messages in thread
From: Premi, Sanjeev @ 2012-01-12 12:26 UTC (permalink / raw)
  To: Sascha Hauer; +Cc: barebox

> -----Original Message-----
> From: Sascha Hauer [mailto:s.hauer@pengutronix.de] 
> Sent: Thursday, January 12, 2012 2:59 PM
> To: Premi, Sanjeev
> Cc: barebox@lists.infradead.org; Jean-Christophe PLAGNIOL-VILLARD
> Subject: Re: [RFC 2/2] ARM omap: Add CONFIG_SILENT
> 
> On Wed, Jan 11, 2012 at 11:04:44PM +0530, Sanjeev Premi wrote:
> > Don't display any verbose message on the console.
> 
> We already have pr_info and friends which right now all fall
> back to printf. Instead of adding an ifdef for each conditional
> printf how about making pr_* configurable? Something like this:
> 
> #if (CONFIG_LOGLEVEL > 6)
> #define pr_info(fmt, arg...) printf(fmt, ##arg)
> #else
> #define pr_info(fmt, arg...)	do {} while(0)
> #endif
> #if (CONFIG_LOGLEVEL > 5)
> #define pr_notice(fmt, arg...)	printf(fmt, ##arg)
> #else
> #define pr_notice(fmt, arg...)    do {} while(0)
> #endif
> 
> BTW you seem to be very concerned about the codesize in the xloader

Yes. Esp. what makes the code "big" when compared to the original
x-loader for omap3. Idea was to identify portions of code that
isn't getting used - at all (or most of the time).

> environments, which I can understand. How about giving my 
> thumb2 patches
> a try?

I will. Just located the patches in my mailbox.

I return to OMAP3 and barebox in my free time - which isn't too
often; but I should be able to try these patches by end of this
week.

In fact, the code changes for this RFC were done in NOV - just
couldn't post because I couldn't write detailed changelong
explaining the motivation.

~sanjeev

> 
> panda_xload_defconfig:
> -rwxr-xr-x 1 sha ptx 41272 Jan 12 10:25 barebox.bin
> 
> panda_xload_defconfig in thumb2 mode:
> -rwxr-xr-x 1 sha ptx 30348 Jan 12 10:25 barebox.bin
> 
> To merge these I'm currently waiting for Jean-Christophes OK on
> 
> ARM: move exception vectors away from start of binary
> 
> Sascha
> 
> -- 
> Pengutronix e.K.                           |                  
>            |
> Industrial Linux Solutions                 | 
> http://www.pengutronix.de/  |
> Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: 
> +49-5121-206917-0    |
> Amtsgericht Hildesheim, HRA 2686           | Fax:   
> +49-5121-206917-5555 |
> 
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* RE: [RFC 2/2] ARM omap: Add CONFIG_SILENT
  2012-01-12  9:28   ` Sascha Hauer
  2012-01-12 10:54     ` Jean-Christophe PLAGNIOL-VILLARD
  2012-01-12 12:26     ` Premi, Sanjeev
@ 2012-01-12 15:51     ` Premi, Sanjeev
  2012-01-13 11:43       ` Sascha Hauer
  2 siblings, 1 reply; 8+ messages in thread
From: Premi, Sanjeev @ 2012-01-12 15:51 UTC (permalink / raw)
  To: Sascha Hauer; +Cc: barebox

> -----Original Message-----
> From: Sascha Hauer [mailto:s.hauer@pengutronix.de] 
> Sent: Thursday, January 12, 2012 2:59 PM
> To: Premi, Sanjeev
> Cc: barebox@lists.infradead.org; Jean-Christophe PLAGNIOL-VILLARD
> Subject: Re: [RFC 2/2] ARM omap: Add CONFIG_SILENT
> 

[snip]

> BTW you seem to be very concerned about the codesize in the xloader
> environments, which I can understand. How about giving my 
> thumb2 patches
> a try?

I tried pulling these patches on the latest master, but git am failed.
Manual patching reports previously applied patches. (I was able to find
few patches in the series already in master)

Some hunks don't apply cleanly. For example:

diff --git a/arch/arm/lib/armlinux.c b/arch/arm/lib/armlinux.c
index bd9b72a..3fafb4b 100644
--- a/arch/arm/lib/armlinux.c
+++ b/arch/arm/lib/armlinux.c
@@ -253,6 +253,8 @@ void start_linux(void *adr, int swap, struct image_data *data)
 {
 	void (*kernel)(int zero, int arch, void *params) = adr;
 	void *params = NULL;
+	int architecture = armlinux_get_architecture();
+
 #ifdef CONFIG_OFTREE
 	params = of_get_fixed_tree();
 	if (params)

I did quick fix-ups at few places to make compiler happy, but got
stuck with this:

  AS      arch/arm/mach-omap/omap3_core.o
arch/arm/mach-omap/omap3_core.S: Assembler messages:
arch/arm/mach-omap/omap3_core.S:116: Error: shift must be constant -- `orr r11,r10,r9,lsl r5'
arch/arm/mach-omap/omap3_core.S:117: Error: shift must be constant -- `orr r11,r11,r7,lsl r2'
make[1]: *** [arch/arm/mach-omap/omap3_core.o] Error 1
make: *** [arch/arm/mach-omap] Error 2

Will look at this later in the week.
Do you have updated patches agaist latest master that I can try?

~sanjeev

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

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

* Re: [RFC 2/2] ARM omap: Add CONFIG_SILENT
  2012-01-12 15:51     ` Premi, Sanjeev
@ 2012-01-13 11:43       ` Sascha Hauer
  0 siblings, 0 replies; 8+ messages in thread
From: Sascha Hauer @ 2012-01-13 11:43 UTC (permalink / raw)
  To: Premi, Sanjeev; +Cc: barebox

On Thu, Jan 12, 2012 at 03:51:49PM +0000, Premi, Sanjeev wrote:
> > -----Original Message-----
> > From: Sascha Hauer [mailto:s.hauer@pengutronix.de] 
> > Sent: Thursday, January 12, 2012 2:59 PM
> > To: Premi, Sanjeev
> > Cc: barebox@lists.infradead.org; Jean-Christophe PLAGNIOL-VILLARD
> > Subject: Re: [RFC 2/2] ARM omap: Add CONFIG_SILENT
> > 
> 
> [snip]
> 
> > BTW you seem to be very concerned about the codesize in the xloader
> > environments, which I can understand. How about giving my 
> > thumb2 patches
> > a try?
> 
> I tried pulling these patches on the latest master, but git am failed.
> Manual patching reports previously applied patches. (I was able to find
> few patches in the series already in master)
> 
> Some hunks don't apply cleanly. For example:
> 
> diff --git a/arch/arm/lib/armlinux.c b/arch/arm/lib/armlinux.c
> index bd9b72a..3fafb4b 100644
> --- a/arch/arm/lib/armlinux.c
> +++ b/arch/arm/lib/armlinux.c
> @@ -253,6 +253,8 @@ void start_linux(void *adr, int swap, struct image_data *data)
>  {
>  	void (*kernel)(int zero, int arch, void *params) = adr;
>  	void *params = NULL;
> +	int architecture = armlinux_get_architecture();
> +
>  #ifdef CONFIG_OFTREE
>  	params = of_get_fixed_tree();
>  	if (params)
> 
> I did quick fix-ups at few places to make compiler happy, but got
> stuck with this:
> 
>   AS      arch/arm/mach-omap/omap3_core.o
> arch/arm/mach-omap/omap3_core.S: Assembler messages:
> arch/arm/mach-omap/omap3_core.S:116: Error: shift must be constant -- `orr r11,r10,r9,lsl r5'
> arch/arm/mach-omap/omap3_core.S:117: Error: shift must be constant -- `orr r11,r11,r7,lsl r2'

This can be fixed with the following:

ARM(	orr	r11, r10, r9, lsl r5	) /* factor way and cache number into r11 */
ARM(	orr	r11, r11, r7, lsl r2	) /* factor index number into r11 */
THUMB(	lsl	r6, r9, r5		)
THUMB(	orr	r11, r10, r6		) /* factor way and cache number into r11 */
THUMB(	lsl	r6, r7, r2		)
THUMB(	orr	r11, r11, r6		) /* factor index number into r11 */

Just how it is done in arch/arm/cpu/cache-armv7.S. Anyway, this is
only the top of the iceberg. All Assembly code must be carefully
reviewed in thumb mode and omap3 has quite a lot of it. I managed
to start a second stage barebox (compiled with xloader defconfig +
THUMB) in which I commented out arch_init_lowlevel() and
board_init_lowlevel().

I see if I can sort some of this stuff out on the weekend.

Sascha


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

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

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

end of thread, other threads:[~2012-01-13 11:44 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-01-11 17:34 [RFC 1/2] ARM omap: Add null console Sanjeev Premi
2012-01-11 17:34 ` [RFC 2/2] ARM omap: Add CONFIG_SILENT Sanjeev Premi
2012-01-12  9:28   ` Sascha Hauer
2012-01-12 10:54     ` Jean-Christophe PLAGNIOL-VILLARD
2012-01-12 12:26     ` Premi, Sanjeev
2012-01-12 15:51     ` Premi, Sanjeev
2012-01-13 11:43       ` Sascha Hauer
2012-01-12  9:13 ` [RFC 1/2] ARM omap: Add null console Sascha Hauer

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