All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] m28evk: Use GENERATED_GBL_DATA_SIZE
@ 2011-12-29 13:35 Fabio Estevam
  2011-12-29 15:22 ` Marek Vasut
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Fabio Estevam @ 2011-12-29 13:35 UTC (permalink / raw)
  To: u-boot

Use GENERATED_GBL_DATA_SIZE for calculating CONFIG_SYS_INIT_SP_OFFSET.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
 include/configs/m28evk.h |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/include/configs/m28evk.h b/include/configs/m28evk.h
index 39c841f..2b4871e 100644
--- a/include/configs/m28evk.h
+++ b/include/configs/m28evk.h
@@ -92,7 +92,14 @@
 #define	CONFIG_SYS_MEMTEST_END		0x40400000	/* 4 MB RAM test */
 #define	CONFIG_SYS_SDRAM_BASE		PHYS_SDRAM_1
 /* Point initial SP in SRAM so SPL can use it too. */
-#define	CONFIG_SYS_INIT_SP_ADDR		0x00002000
+
+#define CONFIG_SYS_INIT_RAM_ADDR	0x00002000
+#define CONFIG_SYS_INIT_RAM_SIZE	(128 * 1024)
+
+#define CONFIG_SYS_INIT_SP_OFFSET \
+	(CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
+#define CONFIG_SYS_INIT_SP_ADDR \
+	(CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
 /*
  * We need to sacrifice first 4 bytes of RAM here to avoid triggering some
  * strange BUG in ROM corrupting first 4 bytes of RAM when loading U-Boot
-- 
1.7.1

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

* [U-Boot] [PATCH] m28evk: Use GENERATED_GBL_DATA_SIZE
  2011-12-29 13:35 [U-Boot] [PATCH] m28evk: Use GENERATED_GBL_DATA_SIZE Fabio Estevam
@ 2011-12-29 15:22 ` Marek Vasut
  2011-12-29 15:38   ` Fabio Estevam
  2011-12-29 15:47   ` Stefano Babic
  2012-01-04 13:53 ` Stefano Babic
  2012-04-02  4:17 ` Marek Vasut
  2 siblings, 2 replies; 7+ messages in thread
From: Marek Vasut @ 2011-12-29 15:22 UTC (permalink / raw)
  To: u-boot

> Use GENERATED_GBL_DATA_SIZE for calculating CONFIG_SYS_INIT_SP_OFFSET.
> 
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>

Maybe I'd be better to consolidate the i.MX28 config to a common config file and 
have only board specific stuff in the board-specific configs, which would in 
turn include the file?

M

> ---
>  include/configs/m28evk.h |    9 ++++++++-
>  1 files changed, 8 insertions(+), 1 deletions(-)
> 
> diff --git a/include/configs/m28evk.h b/include/configs/m28evk.h
> index 39c841f..2b4871e 100644
> --- a/include/configs/m28evk.h
> +++ b/include/configs/m28evk.h
> @@ -92,7 +92,14 @@
>  #define	CONFIG_SYS_MEMTEST_END		0x40400000	/* 4 MB RAM test 
*/
>  #define	CONFIG_SYS_SDRAM_BASE		PHYS_SDRAM_1
>  /* Point initial SP in SRAM so SPL can use it too. */
> -#define	CONFIG_SYS_INIT_SP_ADDR		0x00002000
> +
> +#define CONFIG_SYS_INIT_RAM_ADDR	0x00002000
> +#define CONFIG_SYS_INIT_RAM_SIZE	(128 * 1024)
> +
> +#define CONFIG_SYS_INIT_SP_OFFSET \
> +	(CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
> +#define CONFIG_SYS_INIT_SP_ADDR \
> +	(CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
>  /*
>   * We need to sacrifice first 4 bytes of RAM here to avoid triggering some
>   * strange BUG in ROM corrupting first 4 bytes of RAM when loading U-Boot

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

* [U-Boot] [PATCH] m28evk: Use GENERATED_GBL_DATA_SIZE
  2011-12-29 15:22 ` Marek Vasut
@ 2011-12-29 15:38   ` Fabio Estevam
  2011-12-29 15:47   ` Stefano Babic
  1 sibling, 0 replies; 7+ messages in thread
From: Fabio Estevam @ 2011-12-29 15:38 UTC (permalink / raw)
  To: u-boot

On Thu, Dec 29, 2011 at 1:22 PM, Marek Vasut <marek.vasut@gmail.com> wrote:

> Maybe I'd be better to consolidate the i.MX28 config to a common config file and
> have only board specific stuff in the board-specific configs, which would in
> turn include the file?

Sounds like a good idea.

Regards,

Fabio Estevam

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

* [U-Boot] [PATCH] m28evk: Use GENERATED_GBL_DATA_SIZE
  2011-12-29 15:22 ` Marek Vasut
  2011-12-29 15:38   ` Fabio Estevam
@ 2011-12-29 15:47   ` Stefano Babic
  2011-12-29 18:22     ` Marek Vasut
  1 sibling, 1 reply; 7+ messages in thread
From: Stefano Babic @ 2011-12-29 15:47 UTC (permalink / raw)
  To: u-boot

On 29/12/2011 16:22, Marek Vasut wrote:
>> Use GENERATED_GBL_DATA_SIZE for calculating CONFIG_SYS_INIT_SP_OFFSET.
>>
>> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
> 
> Maybe I'd be better to consolidate the i.MX28 config to a common config file and 
> have only board specific stuff in the board-specific configs, which would in 
> turn include the file?

But this issue is not strictly related only to MX28. The same is for any
SOC in u-boot, and most of CONFIG_ are duplicated in the configuration
files for boards having the same SOC.

At the moment, we do this only for slightly different boards (imx27lite
and magnesium, for example) or for boards having the same SOM.

Agree we can rationalize better, but it should be discussed if we plan
to introduce some hierarchy in the configuration files - the board
configuration file can include a SOC configuration file, that can
include a ARCH configuration file....

Apart of that, I think it is not bad to merge this Fabio's patch - it
makes the board consistent with the other ones.

Best regards,
Stefano Babic

-- 
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: office at denx.de
=====================================================================

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

* [U-Boot] [PATCH] m28evk: Use GENERATED_GBL_DATA_SIZE
  2011-12-29 15:47   ` Stefano Babic
@ 2011-12-29 18:22     ` Marek Vasut
  0 siblings, 0 replies; 7+ messages in thread
From: Marek Vasut @ 2011-12-29 18:22 UTC (permalink / raw)
  To: u-boot

> On 29/12/2011 16:22, Marek Vasut wrote:
> >> Use GENERATED_GBL_DATA_SIZE for calculating CONFIG_SYS_INIT_SP_OFFSET.
> >> 
> >> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
> > 
> > Maybe I'd be better to consolidate the i.MX28 config to a common config
> > file and have only board specific stuff in the board-specific configs,
> > which would in turn include the file?
> 
> But this issue is not strictly related only to MX28. The same is for any
> SOC in u-boot, and most of CONFIG_ are duplicated in the configuration
> files for boards having the same SOC.
> 
> At the moment, we do this only for slightly different boards (imx27lite
> and magnesium, for example) or for boards having the same SOM.
> 
> Agree we can rationalize better, but it should be discussed if we plan
> to introduce some hierarchy in the configuration files - the board
> configuration file can include a SOC configuration file, that can
> include a ARCH configuration file....
> 
> Apart of that, I think it is not bad to merge this Fabio's patch - it
> makes the board consistent with the other ones.

Fine by me, but I can't test it.

M

> 
> Best regards,
> Stefano Babic

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

* [U-Boot] [PATCH] m28evk: Use GENERATED_GBL_DATA_SIZE
  2011-12-29 13:35 [U-Boot] [PATCH] m28evk: Use GENERATED_GBL_DATA_SIZE Fabio Estevam
  2011-12-29 15:22 ` Marek Vasut
@ 2012-01-04 13:53 ` Stefano Babic
  2012-04-02  4:17 ` Marek Vasut
  2 siblings, 0 replies; 7+ messages in thread
From: Stefano Babic @ 2012-01-04 13:53 UTC (permalink / raw)
  To: u-boot

On 29/12/2011 14:35, Fabio Estevam wrote:
> Use GENERATED_GBL_DATA_SIZE for calculating CONFIG_SYS_INIT_SP_OFFSET.
> 
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
> ---

Applied to u-boot-imx, thanks.

Best regards,
Stefano Babic

-- 
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: office at denx.de
=====================================================================

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

* [U-Boot] [PATCH] m28evk: Use GENERATED_GBL_DATA_SIZE
  2011-12-29 13:35 [U-Boot] [PATCH] m28evk: Use GENERATED_GBL_DATA_SIZE Fabio Estevam
  2011-12-29 15:22 ` Marek Vasut
  2012-01-04 13:53 ` Stefano Babic
@ 2012-04-02  4:17 ` Marek Vasut
  2 siblings, 0 replies; 7+ messages in thread
From: Marek Vasut @ 2012-04-02  4:17 UTC (permalink / raw)
  To: u-boot

Dear Fabio Estevam,

I think this patch is wrong ... did I ack this one?

> Use GENERATED_GBL_DATA_SIZE for calculating CONFIG_SYS_INIT_SP_OFFSET.
> 
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
> ---
>  include/configs/m28evk.h |    9 ++++++++-
>  1 files changed, 8 insertions(+), 1 deletions(-)
> 
> diff --git a/include/configs/m28evk.h b/include/configs/m28evk.h
> index 39c841f..2b4871e 100644
> --- a/include/configs/m28evk.h
> +++ b/include/configs/m28evk.h
> @@ -92,7 +92,14 @@
>  #define	CONFIG_SYS_MEMTEST_END		0x40400000	/* 4 MB RAM test 
*/
>  #define	CONFIG_SYS_SDRAM_BASE		PHYS_SDRAM_1
>  /* Point initial SP in SRAM so SPL can use it too. */
> -#define	CONFIG_SYS_INIT_SP_ADDR		0x00002000
> +
> +#define CONFIG_SYS_INIT_RAM_ADDR	0x00002000

This 0x2000 is wrong, it should be 0x0. Otherwise your maths below overflow and 
SP is located at 0x21f80.

> +#define CONFIG_SYS_INIT_RAM_SIZE	(128 * 1024)
> +
> +#define CONFIG_SYS_INIT_SP_OFFSET \
> +	(CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
> +#define CONFIG_SYS_INIT_SP_ADDR \
> +	(CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
>  /*
>   * We need to sacrifice first 4 bytes of RAM here to avoid triggering some
>   * strange BUG in ROM corrupting first 4 bytes of RAM when loading U-Boot

Best regards,
Marek Vasut

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

end of thread, other threads:[~2012-04-02  4:17 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-12-29 13:35 [U-Boot] [PATCH] m28evk: Use GENERATED_GBL_DATA_SIZE Fabio Estevam
2011-12-29 15:22 ` Marek Vasut
2011-12-29 15:38   ` Fabio Estevam
2011-12-29 15:47   ` Stefano Babic
2011-12-29 18:22     ` Marek Vasut
2012-01-04 13:53 ` Stefano Babic
2012-04-02  4:17 ` Marek Vasut

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.