All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] powerpc: Add cpu_secondary_init_r to allow for initialization post env setup
@ 2011-02-02 18:21 Kumar Gala
  2011-02-03 15:27 ` Kumar Gala
  2011-02-10  5:22 ` Kumar Gala
  0 siblings, 2 replies; 5+ messages in thread
From: Kumar Gala @ 2011-02-02 18:21 UTC (permalink / raw)
  To: u-boot

We can simplify some cpu/SoC level initialization by moving it to be
after the environment and non-volatile storage is setup as there might
be dependancies on such things in various boot configurations.

For example for FSL SoC's with QE if we boot from NAND we need it setup
to extra the ucode image to initialize the QE.  If we always do this
after environment & non-volatile storage is working we can have the code
be the same regardless of NOR, NAND, SPI, MMC boot.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
---
* This is really second version of the cpu_late_init_r patch
  - changed where we call cpu_secondary_init_r to be right after env_relocate

 arch/powerpc/cpu/mpc85xx/cpu_init.c |   15 +++++++++------
 arch/powerpc/lib/board.c            |   14 ++++++++++++++
 2 files changed, 23 insertions(+), 6 deletions(-)

diff --git a/arch/powerpc/cpu/mpc85xx/cpu_init.c b/arch/powerpc/cpu/mpc85xx/cpu_init.c
index 8ece970..215b7b3 100644
--- a/arch/powerpc/cpu/mpc85xx/cpu_init.c
+++ b/arch/powerpc/cpu/mpc85xx/cpu_init.c
@@ -384,12 +384,6 @@ int cpu_init_r(void)
 
 	enable_cpc();
 
-#ifdef CONFIG_QE
-	uint qe_base = CONFIG_SYS_IMMR + 0x00080000; /* QE immr base */
-	qe_init(qe_base);
-	qe_reset();
-#endif
-
 	/* needs to be in ram since code uses global static vars */
 	fsl_serdes_init();
 
@@ -449,3 +443,12 @@ int sata_initialize(void)
 	return 1;
 }
 #endif
+
+void cpu_secondary_init_r(void)
+{
+#ifdef CONFIG_QE
+	uint qe_base = CONFIG_SYS_IMMR + 0x00080000; /* QE immr base */
+	qe_init(qe_base);
+	qe_reset();
+#endif
+}
diff --git a/arch/powerpc/lib/board.c b/arch/powerpc/lib/board.c
index b88cf6b..38ca1f8 100644
--- a/arch/powerpc/lib/board.c
+++ b/arch/powerpc/lib/board.c
@@ -186,6 +186,12 @@ int __board_flash_wp_on(void)
 }
 int board_flash_wp_on(void) __attribute__((weak, alias("__board_flash_wp_on")));
 
+void __cpu_secondary_init_r(void)
+{
+}
+void cpu_secondary_init_r(void)
+__attribute__((weak, alias("__cpu_secondary_init_r")));
+
 static int init_func_ram (void)
 {
 #ifdef	CONFIG_BOARD_TYPES
@@ -798,6 +804,14 @@ void board_init_r (gd_t *id, ulong dest_addr)
 	env_relocate ();
 
 	/*
+	 * after non-volatile devices & environment is setup and cpu code have
+	 * another round to deal with any initialization that might require
+	 * full access to the environment or loading of some image (firmware)
+	 * from a non-volatile device
+	 */
+	cpu_secondary_init_r();
+
+	/*
 	 * Fill in missing fields of bd_info.
 	 * We do this here, where we have "normal" access to the
 	 * environment; we used to do this still running from ROM,
-- 
1.6.0.6

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

* [U-Boot] [PATCH] powerpc: Add cpu_secondary_init_r to allow for initialization post env setup
  2011-02-02 18:21 [U-Boot] [PATCH] powerpc: Add cpu_secondary_init_r to allow for initialization post env setup Kumar Gala
@ 2011-02-03 15:27 ` Kumar Gala
  2011-02-03 19:15   ` Wolfgang Denk
  2011-02-10  5:22 ` Kumar Gala
  1 sibling, 1 reply; 5+ messages in thread
From: Kumar Gala @ 2011-02-03 15:27 UTC (permalink / raw)
  To: u-boot


On Feb 2, 2011, at 12:21 PM, Kumar Gala wrote:

> We can simplify some cpu/SoC level initialization by moving it to be
> after the environment and non-volatile storage is setup as there might
> be dependancies on such things in various boot configurations.
> 
> For example for FSL SoC's with QE if we boot from NAND we need it setup
> to extra the ucode image to initialize the QE.  If we always do this
> after environment & non-volatile storage is working we can have the code
> be the same regardless of NOR, NAND, SPI, MMC boot.
> 
> Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
> ---
> * This is really second version of the cpu_late_init_r patch
>  - changed where we call cpu_secondary_init_r to be right after env_relocate
> 
> arch/powerpc/cpu/mpc85xx/cpu_init.c |   15 +++++++++------
> arch/powerpc/lib/board.c            |   14 ++++++++++++++
> 2 files changed, 23 insertions(+), 6 deletions(-)
> 
> diff --git a/arch/powerpc/cpu/mpc85xx/cpu_init.c b/arch/powerpc/cpu/mpc85xx/cpu_init.c
> index 8ece970..215b7b3 100644
> --- a/arch/powerpc/cpu/mpc85xx/cpu_init.c
> +++ b/arch/powerpc/cpu/mpc85xx/cpu_init.c
> @@ -384,12 +384,6 @@ int cpu_init_r(void)
> 
> 	enable_cpc();
> 
> -#ifdef CONFIG_QE
> -	uint qe_base = CONFIG_SYS_IMMR + 0x00080000; /* QE immr base */
> -	qe_init(qe_base);
> -	qe_reset();
> -#endif
> -
> 	/* needs to be in ram since code uses global static vars */
> 	fsl_serdes_init();
> 
> @@ -449,3 +443,12 @@ int sata_initialize(void)
> 	return 1;
> }
> #endif
> +
> +void cpu_secondary_init_r(void)
> +{
> +#ifdef CONFIG_QE
> +	uint qe_base = CONFIG_SYS_IMMR + 0x00080000; /* QE immr base */
> +	qe_init(qe_base);
> +	qe_reset();
> +#endif
> +}
> diff --git a/arch/powerpc/lib/board.c b/arch/powerpc/lib/board.c
> index b88cf6b..38ca1f8 100644
> --- a/arch/powerpc/lib/board.c
> +++ b/arch/powerpc/lib/board.c
> @@ -186,6 +186,12 @@ int __board_flash_wp_on(void)
> }
> int board_flash_wp_on(void) __attribute__((weak, alias("__board_flash_wp_on")));
> 
> +void __cpu_secondary_init_r(void)
> +{
> +}
> +void cpu_secondary_init_r(void)
> +__attribute__((weak, alias("__cpu_secondary_init_r")));
> +
> static int init_func_ram (void)
> {
> #ifdef	CONFIG_BOARD_TYPES
> @@ -798,6 +804,14 @@ void board_init_r (gd_t *id, ulong dest_addr)
> 	env_relocate ();
> 
> 	/*
> +	 * after non-volatile devices & environment is setup and cpu code have
> +	 * another round to deal with any initialization that might require
> +	 * full access to the environment or loading of some image (firmware)
> +	 * from a non-volatile device
> +	 */
> +	cpu_secondary_init_r();
> +
> +	/*
> 	 * Fill in missing fields of bd_info.
> 	 * We do this here, where we have "normal" access to the
> 	 * environment; we used to do this still running from ROM,
> -- 
> 1.6.0.6

Wolfgang,

Any comments on this, based on the discussion here:

http://lists.denx.de/pipermail/u-boot/2011-January/086567.html
http://lists.denx.de/pipermail/u-boot/2011-February/086711.html

- k

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

* [U-Boot] [PATCH] powerpc: Add cpu_secondary_init_r to allow for initialization post env setup
  2011-02-03 15:27 ` Kumar Gala
@ 2011-02-03 19:15   ` Wolfgang Denk
  2011-02-03 19:34     ` Kumar Gala
  0 siblings, 1 reply; 5+ messages in thread
From: Wolfgang Denk @ 2011-02-03 19:15 UTC (permalink / raw)
  To: u-boot

Dear Kumar Gala,

In message <1E454B65-B8DC-4276-B6DD-7D4A3F5229CD@kernel.crashing.org> you wrote:
> 
> Any comments on this, based on the discussion here:

Not really.  I mean, I don't object.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
>  Is there a way to determine Yesterday's date using Unix utilities?
         echo "what is yesterday's date?" | /bin/mail root
         -- Randal L. Schwartz in <ukbuh2y982.fsf@julie.teleport.com>

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

* [U-Boot] [PATCH] powerpc: Add cpu_secondary_init_r to allow for initialization post env setup
  2011-02-03 19:15   ` Wolfgang Denk
@ 2011-02-03 19:34     ` Kumar Gala
  0 siblings, 0 replies; 5+ messages in thread
From: Kumar Gala @ 2011-02-03 19:34 UTC (permalink / raw)
  To: u-boot


On Feb 3, 2011, at 1:15 PM, Wolfgang Denk wrote:

> Dear Kumar Gala,
> 
> In message <1E454B65-B8DC-4276-B6DD-7D4A3F5229CD@kernel.crashing.org> you wrote:
>> 
>> Any comments on this, based on the discussion here:
> 
> Not really.  I mean, I don't object.

Ok, thanks.  I'll pull this into my 'next' tree.

- k

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

* [U-Boot] [PATCH] powerpc: Add cpu_secondary_init_r to allow for initialization post env setup
  2011-02-02 18:21 [U-Boot] [PATCH] powerpc: Add cpu_secondary_init_r to allow for initialization post env setup Kumar Gala
  2011-02-03 15:27 ` Kumar Gala
@ 2011-02-10  5:22 ` Kumar Gala
  1 sibling, 0 replies; 5+ messages in thread
From: Kumar Gala @ 2011-02-10  5:22 UTC (permalink / raw)
  To: u-boot


On Feb 2, 2011, at 12:21 PM, Kumar Gala wrote:

> We can simplify some cpu/SoC level initialization by moving it to be
> after the environment and non-volatile storage is setup as there might
> be dependancies on such things in various boot configurations.
> 
> For example for FSL SoC's with QE if we boot from NAND we need it setup
> to extra the ucode image to initialize the QE.  If we always do this
> after environment & non-volatile storage is working we can have the code
> be the same regardless of NOR, NAND, SPI, MMC boot.
> 
> Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
> ---
> * This is really second version of the cpu_late_init_r patch
>  - changed where we call cpu_secondary_init_r to be right after env_relocate
> 
> arch/powerpc/cpu/mpc85xx/cpu_init.c |   15 +++++++++------
> arch/powerpc/lib/board.c            |   14 ++++++++++++++
> 2 files changed, 23 insertions(+), 6 deletions(-)

applied to 85xx next

- k

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

end of thread, other threads:[~2011-02-10  5:22 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-02 18:21 [U-Boot] [PATCH] powerpc: Add cpu_secondary_init_r to allow for initialization post env setup Kumar Gala
2011-02-03 15:27 ` Kumar Gala
2011-02-03 19:15   ` Wolfgang Denk
2011-02-03 19:34     ` Kumar Gala
2011-02-10  5:22 ` Kumar Gala

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.