ARM: Add "verbose" parameter for start_linux procedure
PATCH 3/3 mfd: syscon: Replace dev_info with dev_dbg for print used region
In reply to Alexander Shiyan--- drivers/mfd/syscon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mfd/syscon.c +1 -1
@@ -65,7 +65,7 @@ static int syscon_probe(struct device_d *dev) syscon->base = (void __iomem *)res->start; dev->priv = syscon; -dev_info (dev,"map 0x%x-0x%x registered\n" , res->start, res->end); +dev_dbg (dev,"map 0x%x-0x%x registered\n" , res->start, res->end);return 0 ; }
Signature · 7 lines
1.8.1.5 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH 1/3 ARM: Add "verbose" parameter for start_linux procedure
This patch will make a normal booting more silent.
--- arch/arm/include/asm/armlinux.h | 2 +- arch/arm/lib/armlinux.c | 16 +++++++++------- arch/arm/lib/bootm.c | 3 ++- arch/arm/lib/bootu.c | 2 +- arch/arm/lib/bootz.c | 2 +- 5 files changed, 14 insertions(+), 11 deletions(-)
arch/arm/include/asm/armlinux.h +1 -1
@@ -38,6 +38,6 @@ static inline void armlinux_set_atag_appender(struct tag *(*func)(struct tag *))struct image_data ;void start_linux (void *adr,int swap,unsigned long initrd_address, -unsigned long initrd_size,void *oftree); +unsigned long initrd_size,void *oftree,int verbose);#endif /* __ARCH_ARMLINUX_H */
arch/arm/lib/armlinux.c +9 -7
@@ -227,8 +227,8 @@ static void setup_end_tag (void) params->hdr.size =0 ; } -static void setup_tags (unsigned long initrd_address, -unsigned long initrd_size,int swap) +static void setup_tags (unsigned long initrd_address,unsigned long initrd_size, +int swap,int verbose) {const char *commandline =linux_bootargs_get ();
@@ -247,8 +247,9 @@ static void setup_tags(unsigned long initrd_address,#endif setup_end_tag (); -printf ("commandline: %s\n" -"arch_number: %d\n" , commandline,armlinux_get_architecture ()); +if (verbose) +printf ("commandline: %s\narch_number: %d\n" , + commandline,armlinux_get_architecture ()); }
@@ -258,17 +259,18 @@ void armlinux_set_bootparams(void *params) }void start_linux (void *adr,int swap,unsigned long initrd_address, -unsigned long initrd_size,void *oftree) +unsigned long initrd_size,void *oftree,int verbose) {void (*kernel)(int zero,int arch,void *params) = adr;void *params =NULL ;int architecture;if (oftree) { -printf ("booting Linux kernel with devicetree\n" ); +if (verbose) +printf ("booting Linux kernel with devicetree\n" ); params = oftree; }else { -setup_tags (initrd_address, initrd_size, swap); +setup_tags (initrd_address, initrd_size, swap, verbose); params = armlinux_bootparams; } architecture =armlinux_get_architecture ();
arch/arm/lib/bootm.c +2 -1
@@ -106,7 +106,8 @@ static int __do_bootm_linux(struct image_data *data, int swap)printf ("...\n" ); } -start_linux ((void *)kernel, swap, initrd_start, initrd_size, data->oftree); +start_linux ((void *)kernel, swap, initrd_start, initrd_size, + data->oftree,bootm_verbose (data));reset_cpu (0 );
arch/arm/lib/bootu.c +1 -1
@@ -26,7 +26,7 @@ static int do_bootu(int argc, char *argv[]) oftree =of_get_fixed_tree (NULL );#endif -start_linux (kernel,0 ,0 ,0 , oftree); +start_linux (kernel,0 ,0 ,0 , oftree,1 );return 1 ; }
arch/arm/lib/bootz.c +1 -1
@@ -112,7 +112,7 @@ static int do_bootz(int argc, char *argv[]) oftree =of_get_fixed_tree (NULL );#endif -start_linux (zimage, swap,0 ,0 , oftree); +start_linux (zimage, swap,0 ,0 , oftree,1 );return 0 ;
Signature · 7 lines
1.8.1.5 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH 2/3 ARM: Use armlinux_bootparams address for DTB
In some cases, the address of the devicetree, which is obtained dynamically, may be located in the kernel text area, which leads to overwrite devicetree by kernel. The patch uses the address for devicetree, provided by board, if it possible.
--- arch/arm/lib/armlinux.c | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-)
arch/arm/lib/armlinux.c +14 -8
@@ -262,17 +262,23 @@ void start_linux(void *adr, int swap, unsigned long initrd_address, unsigned long initrd_size, void *oftree, int verbose) { void (*kernel)(int zero, int arch, void *params) = adr; -void *params =NULL ;int architecture;if (oftree) { +if (armlinux_bootparams) { +struct fdt_header *header = oftree; + +memcpy (armlinux_bootparams, oftree, +fdt32_to_cpu (header->totalsize)); + }else + armlinux_bootparams = oftree; +if (verbose) -printf ("booting Linux kernel with devicetree\n" ); - params = oftree; - }else { +printf ("booting Linux kernel with devicetree at 0x%p\n" , + armlinux_bootparams); + }else setup_tags (initrd_address, initrd_size, swap, verbose); - params = armlinux_bootparams; - } + architecture =armlinux_get_architecture ();shutdown_barebox ();
@@ -290,10 +296,10 @@ void start_linux(void *adr, int swap, unsigned long initrd_address, "mov r2, %1\n" "bx %2\n" : - : "r" (architecture), "r" (params), "r" (kernel) + : "r" (architecture), "r" (armlinux_bootparams), "r" (kernel) : "r0", "r1", "r2" );#else -kernel (0 , architecture, params); +kernel (0 , architecture, armlinux_bootparams);#endif }
Signature · 7 lines
1.8.1.5 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
Quoted 1 line · Alexander Shiyan
This patch will make a normal booting more silent.
Why? Booting the kernel is the most important task for barebox. Why shouldn't we see a few lines about what is actually happening here by default.
If you really want no output then introduce a 'quiet' option.
Michael
Quoted 119 lines
Signed-off-by Alexander Shiyan <[email protected]>--- arch/arm/include/asm/armlinux.h | 2 +- arch/arm/lib/armlinux.c | 16 +++++++++------- arch/arm/lib/bootm.c | 3 ++- arch/arm/lib/bootu.c | 2 +- arch/arm/lib/bootz.c | 2 +- 5 files changed, 14 insertions(+), 11 deletions(-)arch/arm/include/asm/armlinux.h +1
-1@@ -38,6 +38,6 @@ static inline void armlinux_set_atag_appender(struct tag *(*func)(struct tag *))struct image_data ;void start_linux (void *adr,int swap,unsigned long initrd_address, -unsigned long initrd_size,void *oftree); +unsigned long initrd_size,void *oftree,int verbose);#endif /* __ARCH_ARMLINUX_H */ arch/arm/lib/armlinux.c +9
-7@@ -227,8 +227,8 @@ static void setup_end_tag (void) params->hdr.size =0 ; } -static void setup_tags (unsigned long initrd_address, -unsigned long initrd_size,int swap) +static void setup_tags (unsigned long initrd_address,unsigned long initrd_size, +int swap,int verbose) {const char *commandline =linux_bootargs_get ();@@ -247,8 +247,9 @@ static void setup_tags(unsigned long initrd_address,#endif setup_end_tag (); -printf ("commandline: %s\n" -"arch_number: %d\n" , commandline,armlinux_get_architecture ()); +if (verbose) +printf ("commandline: %s\narch_number: %d\n" , + commandline,armlinux_get_architecture ()); }@@ -258,17 +259,18 @@ void armlinux_set_bootparams(void *params) }void start_linux (void *adr,int swap,unsigned long initrd_address, -unsigned long initrd_size,void *oftree) +unsigned long initrd_size,void *oftree,int verbose) {void (*kernel)(int zero,int arch,void *params) = adr;void *params =NULL ;int architecture;if (oftree) { -printf ("booting Linux kernel with devicetree\n" ); +if (verbose) +printf ("booting Linux kernel with devicetree\n" ); params = oftree; }else { -setup_tags (initrd_address, initrd_size, swap); +setup_tags (initrd_address, initrd_size, swap, verbose); params = armlinux_bootparams; } architecture =armlinux_get_architecture ();arch/arm/lib/bootm.c +2
-1@@ -106,7 +106,8 @@ static int __do_bootm_linux(struct image_data *data, int swap)printf ("...\n" ); } -start_linux ((void *)kernel, swap, initrd_start, initrd_size, data->oftree); +start_linux ((void *)kernel, swap, initrd_start, initrd_size, + data->oftree,bootm_verbose (data));reset_cpu (0 );arch/arm/lib/bootu.c +1
-1@@ -26,7 +26,7 @@ static int do_bootu(int argc, char *argv[]) oftree =of_get_fixed_tree (NULL );#endif -start_linux (kernel,0 ,0 ,0 , oftree); +start_linux (kernel,0 ,0 ,0 , oftree,1 );return 1 ; }arch/arm/lib/bootz.c +1
-1@@ -112,7 +112,7 @@ static int do_bootz(int argc, char *argv[]) oftree =of_get_fixed_tree (NULL );#endif -start_linux (zimage, swap,0 ,0 , oftree); +start_linux (zimage, swap,0 ,0 , oftree,1 );return 0 ;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
Quoted 8 lines · Michael Olbrich
Quoted 1 line · Alexander Shiyan
This patch will make a normal booting more silent.
Why? Booting the kernel is the most important task for barebox. Why shouldn't we see a few lines about what is actually happening here by default.
If you really want no output then introduce a 'quiet' option.
I think we really need different verbosity levels. standard would be
- print commandline
- print which kernel image is started
- print which devicetree (if any) is used
There's more I'd like to output optionally, but it's also interesting to output less in some cases.
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
Quoted 10 lines · Michael Olbrich
Quoted 8 lines · Alexander Shiyan
Quoted 1 line
This patch will make a normal booting more silent.
Why? Booting the kernel is the most important task for barebox. Why shouldn't we see a few lines about what is actually happening here by default.
If you really want no output then introduce a 'quiet' option.
Quoted 8 lines
I think we really need different verbosity levels. standard would be
- print commandline
- print which kernel image is started
- print which devicetree (if any) is usedThere's more I'd like to output optionally, but it's also interesting to output less in some cases.
How many people have so many opinions.
What we do with patch then?
---
_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
Quoted 16 lines · Alexander Shiyan
Quoted 16 lines · Michael Olbrich
Quoted 8 lines · Alexander Shiyan
Quoted 1 line
This patch will make a normal booting more silent.
Why? Booting the kernel is the most important task for barebox. Why shouldn't we see a few lines about what is actually happening here by default.
If you really want no output then introduce a 'quiet' option.
I think we really need different verbosity levels. standard would be
- print commandline
- print which kernel image is started
- print which devicetree (if any) is used
Quoted 5 lines
Quoted 2 lines
There's more I'd like to output optionally, but it's also interesting to output less in some cases.
How many people have so many opinions.
What we do with patch then?
For now I applied the following. This doesn't change anything in the verbosity but should solve your actual problem.
The verbosity stuff needs a bit more thinking. Michael wants to be more verbose by standard, because he is the one who has to guess what's going wrong at our customers. I want to be more quiet optionally because less console output means less boot time.
We could convert the meaning of the verbosity parameter could be one of KERN_* with the standard to KERN_INFO. Then we could implement everytging from quiet to chatty.
Sascha
8<--------------------------------------------------------
From 0e93a686675e89aa95bbfb68e1b7a2cc59c09aeb Mon Sep 17 00:00:00 2001
From: Alexander Shiyan <[email protected]>
Date: Wed, 10 Jul 2013 11:00:40 +0400
Subject: [PATCH] ARM: Use armlinux_bootparams address for DTB
In some cases, the address of the devicetree, which is obtained dynamically, may be located in the kernel text area, which leads to overwrite devicetree by kernel. The patch uses the address for devicetree, provided by board, if it possible.
--- arch/arm/lib/armlinux.c | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-)
arch/arm/lib/armlinux.c +15 -6
@@ -265,12 +265,21 @@ void start_linux(void *adr, int swap, unsigned long initrd_address,int architecture;if (oftree) { -printf ("booting Linux kernel with devicetree\n" ); - params = oftree; +if (armlinux_bootparams) { +struct fdt_header *header = oftree; + +memcpy (armlinux_bootparams, oftree, +fdt32_to_cpu (header->totalsize)); + }else { + armlinux_bootparams = oftree; + } + +printf ("booting Linux kernel with devicetree at 0x%p\n" , + armlinux_bootparams); }else { -setup_tags (initrd_address, initrd_size, swap); - params = armlinux_bootparams; +setup_tags (initrd_address, initrd_size, swap, verbose); } + architecture =armlinux_get_architecture ();shutdown_barebox ();
@@ -288,10 +297,10 @@ void start_linux(void *adr, int swap, unsigned long initrd_address, "mov r2, %1\n" "bx %2\n" : - : "r" (architecture), "r" (params), "r" (kernel) + : "r" (architecture), "r" (armlinux_bootparams), "r" (kernel) : "r0", "r1", "r2" );#else -kernel (0 , architecture, params); +kernel (0 , architecture, armlinux_bootparams);#endif }
Signature · 12 lines
1.8.3.2 -- 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
Quoted 26 lines · Alexander Shiyan
Quoted 16 lines
Quoted 16 lines · Michael Olbrich
Quoted 8 lines · Alexander Shiyan
Quoted 1 line
This patch will make a normal booting more silent.
Why? Booting the kernel is the most important task for barebox. Why shouldn't we see a few lines about what is actually happening here by default.
If you really want no output then introduce a 'quiet' option.
I think we really need different verbosity levels. standard would be
- print commandline
- print which kernel image is started
- print which devicetree (if any) is usedQuoted 5 lines
Quoted 2 lines
There's more I'd like to output optionally, but it's also interesting to output less in some cases.
How many people have so many opinions.
What we do with patch then?For now I applied the following. This doesn't change anything in the verbosity but should solve your actual problem.
Quoted 8 lines
The verbosity stuff needs a bit more thinking. Michael wants to be more verbose by standard, because he is the one who has to guess what's going wrong at our customers. I want to be more quiet optionally because less console output means less boot time.
We could convert the meaning of the verbosity parameter could be one of KERN_* with the standard to
KERN_INFO. Then we could implement everytging from quiet to chatty.
OK, thanks.
To be more detailed about problem, in my case devicetree is formed at address 0xc0400000, and decompressed kernel placed at address 0xc0028000, which erases devicetree.
(kernel .text : 0xc0028000 - 0xc0430cc4 (4132 kB))
---
_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox