Patchwork [U-Boot,v3,1/5] arm bootm: Allow to pass board specified atags

login
register
mail settings
Submitter Pali Rohár
Date Oct. 13, 2012, 7:31 p.m.
Message ID <1350156720-13387-2-git-send-email-pali.rohar@gmail.com>
Download mbox | patch
Permalink /patch/191307/
State Changes Requested
Delegated to: Marek Vasut
Headers show

Comments

Pali Rohár - Oct. 13, 2012, 7:31 p.m.
Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
---
 arch/arm/include/asm/setup.h |    5 +++++
 arch/arm/lib/bootm.c         |    5 +++++
 2 files changed, 10 insertions(+)
Marek Vasut - Oct. 13, 2012, 11:43 p.m.
Dear Pali Rohár,

... missing commit message ...

> Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
> ---
>  arch/arm/include/asm/setup.h |    5 +++++
>  arch/arm/lib/bootm.c         |    5 +++++
>  2 files changed, 10 insertions(+)

... missing changelog ...

> diff --git a/arch/arm/include/asm/setup.h b/arch/arm/include/asm/setup.h
> index 89df4dc..78a7fac 100644
> --- a/arch/arm/include/asm/setup.h
> +++ b/arch/arm/include/asm/setup.h
> @@ -267,3 +267,8 @@ struct meminfo {
>  extern struct meminfo meminfo;
> 
>  #endif
> +
> +/*
> + * Board specified tags
> + */

What's this ?

> +void setup_board_tags(struct tag **in_params);
> diff --git a/arch/arm/lib/bootm.c b/arch/arm/lib/bootm.c
> index a9070d5..c092bfa 100644
> --- a/arch/arm/lib/bootm.c
> +++ b/arch/arm/lib/bootm.c
> @@ -266,6 +266,10 @@ static int create_fdt(bootm_headers_t *images)
>  }
>  #endif
> 
> +void __setup_board_tags(void) {}
> +void setup_board_tags(struct tag **in_params)
> +	__attribute__((weak, alias("__setup_board_tags")));

__weak void setup...(...) {} works just fine. Include linux/compiler.h

>  /* Subcommand: PREP */
>  static void boot_prep_linux(bootm_headers_t *images)
>  {
> @@ -307,6 +311,7 @@ static void boot_prep_linux(bootm_headers_t *images)
>  			setup_initrd_tag(gd->bd, images->rd_start,
>  			images->rd_end);
>  #endif
> +		setup_board_tags(&params);
>  		setup_end_tag(gd->bd);
>  #else /* all tags */
>  		printf("FDT and ATAGS support not compiled in - hanging\n");

Best regards,
Marek Vasut
Pali Rohár - Oct. 14, 2012, 12:02 a.m.
On Sunday 14 October 2012 01:43:25 Marek Vasut wrote:
> Dear Pali Rohár,
> 
> ... missing commit message ...
> 

Is not subject enought?

> > Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
> > ---
> > 
> >  arch/arm/include/asm/setup.h |    5 +++++
> >  arch/arm/lib/bootm.c         |    5 +++++
> >  2 files changed, 10 insertions(+)
> 
> ... missing changelog ...
> 

There is no changelog. This patch is new in v3. I wrote it in 
mail [PATCH v3 0/5].

> > diff --git a/arch/arm/include/asm/setup.h
> > b/arch/arm/include/asm/setup.h index 89df4dc..78a7fac 100644
> > --- a/arch/arm/include/asm/setup.h
> > +++ b/arch/arm/include/asm/setup.h
> > @@ -267,3 +267,8 @@ struct meminfo {
> > 
> >  extern struct meminfo meminfo;
> >  
> >  #endif
> > 
> > +
> > +/*
> > + * Board specified tags
> > + */
> 
> What's this ?
> 

Function which allow to pass board specified (non standard) 
atags. It is what you suggested:
http://www.mail-archive.com/u-boot@lists.denx.de/msg82803.html

> > +void setup_board_tags(struct tag **in_params);
> > diff --git a/arch/arm/lib/bootm.c b/arch/arm/lib/bootm.c
> > index a9070d5..c092bfa 100644
> > --- a/arch/arm/lib/bootm.c
> > +++ b/arch/arm/lib/bootm.c
> > @@ -266,6 +266,10 @@ static int create_fdt(bootm_headers_t
> > *images)> 
> >  }
> >  #endif
> > 
> > +void __setup_board_tags(void) {}
> > +void setup_board_tags(struct tag **in_params)
> > +	__attribute__((weak, alias("__setup_board_tags")));
> 
> __weak void setup...(...) {} works just fine. Include
> linux/compiler.h

I did not know about __weak. I will change it.
Marek Vasut - Oct. 14, 2012, 12:18 a.m.
Dear Pali Rohár,

> On Sunday 14 October 2012 01:43:25 Marek Vasut wrote:
> > Dear Pali Rohár,
> > 
> > ... missing commit message ...
> 
> Is not subject enought?

Sorry, but no.

> > > Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
> > > ---
> > > 
> > >  arch/arm/include/asm/setup.h |    5 +++++
> > >  arch/arm/lib/bootm.c         |    5 +++++
> > >  2 files changed, 10 insertions(+)
> > 
> > ... missing changelog ...
> 
> There is no changelog. This patch is new in v3. I wrote it in
> mail [PATCH v3 0/5].

Good

> > > diff --git a/arch/arm/include/asm/setup.h
> > > b/arch/arm/include/asm/setup.h index 89df4dc..78a7fac 100644
> > > --- a/arch/arm/include/asm/setup.h
> > > +++ b/arch/arm/include/asm/setup.h
> > > @@ -267,3 +267,8 @@ struct meminfo {
> > > 
> > >  extern struct meminfo meminfo;
> > >  
> > >  #endif
> > > 
> > > +
> > > +/*
> > > + * Board specified tags
> > > + */
> > 
> > What's this ?
> 
> Function which allow to pass board specified (non standard)
> atags.It is what you suggested:
> http://www.mail-archive.com/u-boot@lists.denx.de/msg82803.html

Oh, there's one more line below. OK.

> > > +void setup_board_tags(struct tag **in_params);
> > > diff --git a/arch/arm/lib/bootm.c b/arch/arm/lib/bootm.c
> > > index a9070d5..c092bfa 100644
> > > --- a/arch/arm/lib/bootm.c
> > > +++ b/arch/arm/lib/bootm.c
> > > @@ -266,6 +266,10 @@ static int create_fdt(bootm_headers_t
> > > *images)>
> > > 
> > >  }
> > >  #endif
> > > 
> > > +void __setup_board_tags(void) {}
> > > +void setup_board_tags(struct tag **in_params)
> > > +	__attribute__((weak, alias("__setup_board_tags")));
> > 
> > __weak void setup...(...) {} works just fine. Include
> > linux/compiler.h
> 
> I did not know about __weak. I will change it.

Best regards,
Marek Vasut
Pali Rohár - Oct. 14, 2012, 1:12 a.m.
On Sunday 14 October 2012 02:18:02 Marek Vasut wrote:
> Dear Pali Rohár,
> 
> > On Sunday 14 October 2012 01:43:25 Marek Vasut wrote:
> > > Dear Pali Rohár,
> > > 
> > > ... missing commit message ...
> > 
> > Is not subject enought?
> 
> Sorry, but no.
> 

Commit message: With this patch is possible to pass board 
specified atags. Board can implement function setup_board_tags 
which could append or change atags before booting kernel.

Patch

diff --git a/arch/arm/include/asm/setup.h b/arch/arm/include/asm/setup.h
index 89df4dc..78a7fac 100644
--- a/arch/arm/include/asm/setup.h
+++ b/arch/arm/include/asm/setup.h
@@ -267,3 +267,8 @@  struct meminfo {
 extern struct meminfo meminfo;
 
 #endif
+
+/*
+ * Board specified tags
+ */
+void setup_board_tags(struct tag **in_params);
diff --git a/arch/arm/lib/bootm.c b/arch/arm/lib/bootm.c
index a9070d5..c092bfa 100644
--- a/arch/arm/lib/bootm.c
+++ b/arch/arm/lib/bootm.c
@@ -266,6 +266,10 @@  static int create_fdt(bootm_headers_t *images)
 }
 #endif
 
+void __setup_board_tags(void) {}
+void setup_board_tags(struct tag **in_params)
+	__attribute__((weak, alias("__setup_board_tags")));
+
 /* Subcommand: PREP */
 static void boot_prep_linux(bootm_headers_t *images)
 {
@@ -307,6 +311,7 @@  static void boot_prep_linux(bootm_headers_t *images)
 			setup_initrd_tag(gd->bd, images->rd_start,
 			images->rd_end);
 #endif
+		setup_board_tags(&params);
 		setup_end_tag(gd->bd);
 #else /* all tags */
 		printf("FDT and ATAGS support not compiled in - hanging\n");