* [U-Boot] [PATCH v2] mx51evk: support new relocation scheme
@ 2010-10-27 10:12 Shawn Guo
2010-10-27 11:28 ` Stefano Babic
` (3 more replies)
0 siblings, 4 replies; 15+ messages in thread
From: Shawn Guo @ 2010-10-27 10:12 UTC (permalink / raw)
To: u-boot
This patch is to fix build breakage and support new relocatoin
scheme for mx51evk.
- Correct IRAM base address and add size definition
The IRAM starts from 0x1FFE0000 on final revsion i.mx51 than
0x1FFE8000 which is for older revision.
- Include imx-regs.h in mx51evk.h
Definitions like CSD0_BASE_ADDR and IRAM_BASE_ADDR can be
referred to.
- Define CONFIG_SYS_INIT_RAM_ADDR and CONFIG_SYS_INIT_RAM_SIZE
This is something suggested by Wolfgang, and for automatic
calculation of macros like CONFIG_SYS_GBL_DATA_SIZE (done) and
CONFIG_SYS_INIT_SP_ADDR (later).
- Remove comment for CONFIG_SYS_GBL_DATA_SIZE which has been
buried by Wolfgang's commit below
25ddd1fb: Replace CONFIG_SYS_GBL_DATA_SIZE by auto-generated value
Signed-off-by: Shawn Guo <shawn.gsc@gmail.com>
---
Changes for v2:
- Combine two patches before into one, as the separation is not
so logical.
- Define init stack at the end of init RAM to address comments
from Stefano, Heiko and Wolfgang.
arch/arm/include/asm/arch-mx5/imx-regs.h | 3 ++-
board/freescale/mx51evk/mx51evk.c | 6 +++---
include/configs/mx51evk.h | 9 +++++++--
3 files changed, 12 insertions(+), 6 deletions(-)
diff --git a/arch/arm/include/asm/arch-mx5/imx-regs.h b/arch/arm/include/asm/arch-mx5/imx-regs.h
index 3ddda40..0b6249a 100644
--- a/arch/arm/include/asm/arch-mx5/imx-regs.h
+++ b/arch/arm/include/asm/arch-mx5/imx-regs.h
@@ -26,7 +26,8 @@
/*
* IRAM
*/
-#define IRAM_BASE_ADDR 0x1FFE8000 /* internal ram */
+#define IRAM_BASE_ADDR 0x1FFE0000 /* internal ram */
+#define IRAM_SIZE 0x00020000 /* 128 KB */
/*
* Graphics Memory of GPU
*/
diff --git a/board/freescale/mx51evk/mx51evk.c b/board/freescale/mx51evk/mx51evk.c
index c8d7d39..8820698 100644
--- a/board/freescale/mx51evk/mx51evk.c
+++ b/board/freescale/mx51evk/mx51evk.c
@@ -52,9 +52,9 @@ u32 get_board_rev(void)
int dram_init(void)
{
- gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
- gd->bd->bi_dram[0].size = get_ram_size((long *)PHYS_SDRAM_1,
- PHYS_SDRAM_1_SIZE);
+ /* dram_init must store complete ramsize in gd->ram_size */
+ gd->ram_size = get_ram_size((volatile void *)CONFIG_SYS_SDRAM_BASE,
+ PHYS_SDRAM_1_SIZE);
return 0;
}
diff --git a/include/configs/mx51evk.h b/include/configs/mx51evk.h
index f31fc4e..6dc1ffc 100644
--- a/include/configs/mx51evk.h
+++ b/include/configs/mx51evk.h
@@ -24,11 +24,11 @@
#ifndef __CONFIG_H
#define __CONFIG_H
+#include <asm/arch/imx-regs.h>
/* High Level Configuration Options */
#define CONFIG_MX51 /* in a mx51 */
-#define CONFIG_SKIP_RELOCATE_UBOOT
#define CONFIG_SYS_MX5_HCLK 24000000
#define CONFIG_SYS_MX5_CLK32 32768
@@ -51,7 +51,6 @@
* Size of malloc() pool
*/
#define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + 2 * 1024 * 1024)
-/* size in bytes reserved for initial data */
#define BOARD_LATE_INIT
@@ -174,6 +173,12 @@
#define PHYS_SDRAM_1 CSD0_BASE_ADDR
#define PHYS_SDRAM_1_SIZE (512 * 1024 * 1024)
+#define CONFIG_SYS_SDRAM_BASE (PHYS_SDRAM_1)
+#define CONFIG_SYS_INIT_RAM_ADDR (IRAM_BASE_ADDR)
+#define CONFIG_SYS_INIT_RAM_SIZE (IRAM_SIZE)
+#define CONFIG_SYS_INIT_SP_ADDR \
+ (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_RAM_SIZE)
+
#define CONFIG_SYS_DDR_CLKSEL 0
#define CONFIG_SYS_CLKTL_CBCDR 0x59E35100
--
1.7.1
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [U-Boot] [PATCH v2] mx51evk: support new relocation scheme
2010-10-27 10:12 [U-Boot] [PATCH v2] mx51evk: support new relocation scheme Shawn Guo
@ 2010-10-27 11:28 ` Stefano Babic
2010-10-27 11:29 ` Jason Liu
` (2 subsequent siblings)
3 siblings, 0 replies; 15+ messages in thread
From: Stefano Babic @ 2010-10-27 11:28 UTC (permalink / raw)
To: u-boot
On 10/27/2010 12:12 PM, Shawn Guo wrote:
> This patch is to fix build breakage and support new relocatoin
> scheme for mx51evk.
>
> - Correct IRAM base address and add size definition
>
> The IRAM starts from 0x1FFE0000 on final revsion i.mx51 than
> 0x1FFE8000 which is for older revision.
>
> - Include imx-regs.h in mx51evk.h
>
> Definitions like CSD0_BASE_ADDR and IRAM_BASE_ADDR can be
> referred to.
>
> - Define CONFIG_SYS_INIT_RAM_ADDR and CONFIG_SYS_INIT_RAM_SIZE
>
> This is something suggested by Wolfgang, and for automatic
> calculation of macros like CONFIG_SYS_GBL_DATA_SIZE (done) and
> CONFIG_SYS_INIT_SP_ADDR (later).
>
> - Remove comment for CONFIG_SYS_GBL_DATA_SIZE which has been
> buried by Wolfgang's commit below
>
> 25ddd1fb: Replace CONFIG_SYS_GBL_DATA_SIZE by auto-generated value
>
> Signed-off-by: Shawn Guo <shawn.gsc@gmail.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] 15+ messages in thread
* [U-Boot] [PATCH v2] mx51evk: support new relocation scheme
2010-10-27 10:12 [U-Boot] [PATCH v2] mx51evk: support new relocation scheme Shawn Guo
2010-10-27 11:28 ` Stefano Babic
@ 2010-10-27 11:29 ` Jason Liu
2010-10-27 11:37 ` Shawn Guo
2010-10-27 11:46 ` Wolfgang Denk
2010-10-28 2:13 ` [U-Boot] [PATCH v3] " Shawn.Guo at freescale.com
3 siblings, 1 reply; 15+ messages in thread
From: Jason Liu @ 2010-10-27 11:29 UTC (permalink / raw)
To: u-boot
2010/10/27 Shawn Guo <shawn.gsc@gmail.com>:
> This patch is to fix build breakage and support new relocatoin
> scheme for mx51evk.
What's change is for the build breakage fix? Please state it clearly.
>
> - Correct IRAM base address and add size definition
>
> ?The IRAM starts from 0x1FFE0000 on final revsion i.mx51 than
> ?0x1FFE8000 which is for older revision.
>
> - Include imx-regs.h in mx51evk.h
>
> ?Definitions like CSD0_BASE_ADDR and IRAM_BASE_ADDR can be
> ?referred to.
>
> - Define CONFIG_SYS_INIT_RAM_ADDR and CONFIG_SYS_INIT_RAM_SIZE
>
> ?This is something suggested by Wolfgang, and for automatic
> ?calculation of macros like CONFIG_SYS_GBL_DATA_SIZE (done) and
> ?CONFIG_SYS_INIT_SP_ADDR (later).
>
> - Remove comment for CONFIG_SYS_GBL_DATA_SIZE which has been
> ?buried by Wolfgang's commit below
>
> ?25ddd1fb: Replace CONFIG_SYS_GBL_DATA_SIZE by auto-generated value
>
> Signed-off-by: Shawn Guo <shawn.gsc@gmail.com>
> ---
> Changes for v2:
> ?- Combine two patches before into one, as the separation is not
> ? so logical.
> ?- Define init stack at the end of init RAM to address comments
> ? from Stefano, Heiko and Wolfgang.
>
> ?arch/arm/include/asm/arch-mx5/imx-regs.h | ? ?3 ++-
> ?board/freescale/mx51evk/mx51evk.c ? ? ? ?| ? ?6 +++---
> ?include/configs/mx51evk.h ? ? ? ? ? ? ? ?| ? ?9 +++++++--
> ?3 files changed, 12 insertions(+), 6 deletions(-)
>
> diff --git a/arch/arm/include/asm/arch-mx5/imx-regs.h b/arch/arm/include/asm/arch-mx5/imx-regs.h
> index 3ddda40..0b6249a 100644
> --- a/arch/arm/include/asm/arch-mx5/imx-regs.h
> +++ b/arch/arm/include/asm/arch-mx5/imx-regs.h
> @@ -26,7 +26,8 @@
> ?/*
> ?* IRAM
> ?*/
> -#define IRAM_BASE_ADDR ? ? ? ? 0x1FFE8000 ? ? ?/* internal ram */
> +#define IRAM_BASE_ADDR ? ? ? ? 0x1FFE0000 ? ? ?/* internal ram */
> +#define IRAM_SIZE ? ? ? ? ? ? ?0x00020000 ? ? ?/* 128 KB */
> ?/*
> ?* Graphics Memory of GPU
> ?*/
> diff --git a/board/freescale/mx51evk/mx51evk.c b/board/freescale/mx51evk/mx51evk.c
> index c8d7d39..8820698 100644
> --- a/board/freescale/mx51evk/mx51evk.c
> +++ b/board/freescale/mx51evk/mx51evk.c
> @@ -52,9 +52,9 @@ u32 get_board_rev(void)
>
> ?int dram_init(void)
> ?{
> - ? ? ? gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
> - ? ? ? gd->bd->bi_dram[0].size = get_ram_size((long *)PHYS_SDRAM_1,
> - ? ? ? ? ? ? ? ? ? ? ? PHYS_SDRAM_1_SIZE);
> + ? ? ? /* dram_init must store complete ramsize in gd->ram_size */
> + ? ? ? gd->ram_size = get_ram_size((volatile void *)CONFIG_SYS_SDRAM_BASE,
> + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? PHYS_SDRAM_1_SIZE);
> ? ? ? ?return 0;
> ?}
>
> diff --git a/include/configs/mx51evk.h b/include/configs/mx51evk.h
> index f31fc4e..6dc1ffc 100644
> --- a/include/configs/mx51evk.h
> +++ b/include/configs/mx51evk.h
> @@ -24,11 +24,11 @@
> ?#ifndef __CONFIG_H
> ?#define __CONFIG_H
>
> +#include <asm/arch/imx-regs.h>
>
> ?/* High Level Configuration Options */
>
> ?#define CONFIG_MX51 ? ?/* in a mx51 */
> -#define CONFIG_SKIP_RELOCATE_UBOOT
>
> ?#define CONFIG_SYS_MX5_HCLK ? ?24000000
> ?#define CONFIG_SYS_MX5_CLK32 ? ? ? ? ? 32768
> @@ -51,7 +51,6 @@
> ?* Size of malloc() pool
> ?*/
> ?#define CONFIG_SYS_MALLOC_LEN ? ? ? ? ?(CONFIG_ENV_SIZE + 2 * 1024 * 1024)
> -/* size in bytes reserved for initial data */
>
> ?#define BOARD_LATE_INIT
>
> @@ -174,6 +173,12 @@
> ?#define PHYS_SDRAM_1 ? ? ? ? ? CSD0_BASE_ADDR
> ?#define PHYS_SDRAM_1_SIZE ? ? ?(512 * 1024 * 1024)
>
> +#define CONFIG_SYS_SDRAM_BASE ? ? ? ? ?(PHYS_SDRAM_1)
> +#define CONFIG_SYS_INIT_RAM_ADDR ? ? ? (IRAM_BASE_ADDR)
> +#define CONFIG_SYS_INIT_RAM_SIZE ? ? ? (IRAM_SIZE)
> +#define CONFIG_SYS_INIT_SP_ADDR ? ? ? ?\
> + ? ? ? (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_RAM_SIZE)
> +
> ?#define CONFIG_SYS_DDR_CLKSEL ?0
> ?#define CONFIG_SYS_CLKTL_CBCDR 0x59E35100
>
> --
> 1.7.1
>
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
>
^ permalink raw reply [flat|nested] 15+ messages in thread
* [U-Boot] [PATCH v2] mx51evk: support new relocation scheme
2010-10-27 11:29 ` Jason Liu
@ 2010-10-27 11:37 ` Shawn Guo
2010-10-27 11:44 ` Jason Liu
0 siblings, 1 reply; 15+ messages in thread
From: Shawn Guo @ 2010-10-27 11:37 UTC (permalink / raw)
To: u-boot
On Wed, Oct 27, 2010 at 7:29 PM, Jason Liu <liu.h.jason@gmail.com> wrote:
> 2010/10/27 Shawn Guo <shawn.gsc@gmail.com>:
>> This patch is to fix build breakage and support new relocatoin
>> scheme for mx51evk.
>
> What's change is for the build breakage fix? Please state it clearly.
>
The new relocation scheme requires the definition of
CONFIG_SYS_INIT_SP_ADDR and CONFIG_SYS_SDRAM_BASE. It's the reason
that build on master has been in failure for some time.
--
Regards,
Shawn
^ permalink raw reply [flat|nested] 15+ messages in thread
* [U-Boot] [PATCH v2] mx51evk: support new relocation scheme
2010-10-27 11:37 ` Shawn Guo
@ 2010-10-27 11:44 ` Jason Liu
0 siblings, 0 replies; 15+ messages in thread
From: Jason Liu @ 2010-10-27 11:44 UTC (permalink / raw)
To: u-boot
2010/10/27 Shawn Guo <shawn.gsc@gmail.com>:
> On Wed, Oct 27, 2010 at 7:29 PM, Jason Liu <liu.h.jason@gmail.com> wrote:
>> 2010/10/27 Shawn Guo <shawn.gsc@gmail.com>:
>>> This patch is to fix build breakage and support new relocatoin
>>> scheme for mx51evk.
>>
>> What's change is for the build breakage fix? Please state it clearly.
>>
> The new relocation scheme requires the definition of
> CONFIG_SYS_INIT_SP_ADDR and CONFIG_SYS_SDRAM_BASE. It's the reason
> that build on master has been in failure for some time.
Okay, I noticed that Stefano has already sent out patch before to fix
relocation and I have applied his patch on my local tree, so I don't
find build break.
>
> --
> Regards,
> Shawn
>
^ permalink raw reply [flat|nested] 15+ messages in thread
* [U-Boot] [PATCH v2] mx51evk: support new relocation scheme
2010-10-27 10:12 [U-Boot] [PATCH v2] mx51evk: support new relocation scheme Shawn Guo
2010-10-27 11:28 ` Stefano Babic
2010-10-27 11:29 ` Jason Liu
@ 2010-10-27 11:46 ` Wolfgang Denk
2010-10-27 11:54 ` Shawn Guo
2010-10-27 15:32 ` Shawn Guo
2010-10-28 2:13 ` [U-Boot] [PATCH v3] " Shawn.Guo at freescale.com
3 siblings, 2 replies; 15+ messages in thread
From: Wolfgang Denk @ 2010-10-27 11:46 UTC (permalink / raw)
To: u-boot
Dear Shawn Guo,
In message <1288174358-14896-1-git-send-email-shawn.gsc@gmail.com> you wrote:
> This patch is to fix build breakage and support new relocatoin
> scheme for mx51evk.
>
> - Correct IRAM base address and add size definition
>
> The IRAM starts from 0x1FFE0000 on final revsion i.mx51 than
> 0x1FFE8000 which is for older revision.
>
> - Include imx-regs.h in mx51evk.h
>
> Definitions like CSD0_BASE_ADDR and IRAM_BASE_ADDR can be
> referred to.
>
> - Define CONFIG_SYS_INIT_RAM_ADDR and CONFIG_SYS_INIT_RAM_SIZE
>
> This is something suggested by Wolfgang, and for automatic
> calculation of macros like CONFIG_SYS_GBL_DATA_SIZE (done) and
> CONFIG_SYS_INIT_SP_ADDR (later).
Um... this is NOT what we discussed.
> +#define CONFIG_SYS_SDRAM_BASE (PHYS_SDRAM_1)
> +#define CONFIG_SYS_INIT_RAM_ADDR (IRAM_BASE_ADDR)
> +#define CONFIG_SYS_INIT_RAM_SIZE (IRAM_SIZE)
> +#define CONFIG_SYS_INIT_SP_ADDR \
> + (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_RAM_SIZE)
> +
No. This is not what I want to se.
Memory allocation in the inital ram has the global data at the top.
Please use something like
#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)
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
"Whoever undertakes to set himself up as a judge of Truth and Know-
ledge is shipwrecked by the laughter of the gods." - Albert Einstein
^ permalink raw reply [flat|nested] 15+ messages in thread
* [U-Boot] [PATCH v2] mx51evk: support new relocation scheme
2010-10-27 11:46 ` Wolfgang Denk
@ 2010-10-27 11:54 ` Shawn Guo
2010-10-27 12:17 ` Stefano Babic
2010-10-27 12:23 ` Wolfgang Denk
2010-10-27 15:32 ` Shawn Guo
1 sibling, 2 replies; 15+ messages in thread
From: Shawn Guo @ 2010-10-27 11:54 UTC (permalink / raw)
To: u-boot
On Wed, Oct 27, 2010 at 7:46 PM, Wolfgang Denk <wd@denx.de> wrote:
> Dear Shawn Guo,
>
> In message <1288174358-14896-1-git-send-email-shawn.gsc@gmail.com> you wrote:
>> This patch is to fix build breakage and support new relocatoin
>> scheme for mx51evk.
>>
>> - Correct IRAM base address and add size definition
>>
>> ? The IRAM starts from 0x1FFE0000 on final revsion i.mx51 than
>> ? 0x1FFE8000 which is for older revision.
>>
>> - Include imx-regs.h in mx51evk.h
>>
>> ? Definitions like CSD0_BASE_ADDR and IRAM_BASE_ADDR can be
>> ? referred to.
>>
>> - Define CONFIG_SYS_INIT_RAM_ADDR and CONFIG_SYS_INIT_RAM_SIZE
>>
>> ? This is something suggested by Wolfgang, and for automatic
>> ? calculation of macros like CONFIG_SYS_GBL_DATA_SIZE (done) and
>> ? CONFIG_SYS_INIT_SP_ADDR (later).
>
> Um... this is NOT what we discussed.
>
Are you saying that automatic calculation of CONFIG_SYS_INIT_SP_ADDR
will not happen?
>
> No. ?This is not what I want to se.
>
> Memory allocation in the inital ram has the global data at the top.
>
> Please use something like
>
> #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)
>
If the automatic calculation of CONFIG_SYS_INIT_SP_ADDR will not
happen, I can send another patch to fix it, since it's been applied by
Stefano already.
--
Regards,
Shawn
^ permalink raw reply [flat|nested] 15+ messages in thread
* [U-Boot] [PATCH v2] mx51evk: support new relocation scheme
2010-10-27 11:54 ` Shawn Guo
@ 2010-10-27 12:17 ` Stefano Babic
2010-10-27 12:23 ` Wolfgang Denk
1 sibling, 0 replies; 15+ messages in thread
From: Stefano Babic @ 2010-10-27 12:17 UTC (permalink / raw)
To: u-boot
On 10/27/2010 01:54 PM, Shawn Guo wrote:
> On Wed, Oct 27, 2010 at 7:46 PM, Wolfgang Denk <wd@denx.de> wrote:
>> Dear Shawn Guo,
>>
>> In message <1288174358-14896-1-git-send-email-shawn.gsc@gmail.com> you wrote:
>>> This patch is to fix build breakage and support new relocatoin
>>> scheme for mx51evk.
>>>
>>> - Correct IRAM base address and add size definition
>>>
>>> The IRAM starts from 0x1FFE0000 on final revsion i.mx51 than
>>> 0x1FFE8000 which is for older revision.
>>>
>>> - Include imx-regs.h in mx51evk.h
>>>
>>> Definitions like CSD0_BASE_ADDR and IRAM_BASE_ADDR can be
>>> referred to.
>>>
>>> - Define CONFIG_SYS_INIT_RAM_ADDR and CONFIG_SYS_INIT_RAM_SIZE
>>>
>>> This is something suggested by Wolfgang, and for automatic
>>> calculation of macros like CONFIG_SYS_GBL_DATA_SIZE (done) and
>>> CONFIG_SYS_INIT_SP_ADDR (later).
>>
>> Um... this is NOT what we discussed.
>>
> Are you saying that automatic calculation of CONFIG_SYS_INIT_SP_ADDR
> will not happen?
>
>>
>> No. This is not what I want to se.
>>
>> Memory allocation in the inital ram has the global data at the top.
>>
>> Please use something like
>>
>> #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)
>>
> If the automatic calculation of CONFIG_SYS_INIT_SP_ADDR will not
> happen, I can send another patch to fix it, since it's been applied by
> Stefano already.
Sorry for that. I was too fast and I have not read the patch with
attention. I revert the patch after I see Wolfgang's comment. You can
send V3 version of this patch and you can forget the "applied" message.
Stefano
--
=====================================================================
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] 15+ messages in thread
* [U-Boot] [PATCH v2] mx51evk: support new relocation scheme
2010-10-27 11:54 ` Shawn Guo
2010-10-27 12:17 ` Stefano Babic
@ 2010-10-27 12:23 ` Wolfgang Denk
2010-10-27 12:28 ` Shawn Guo
1 sibling, 1 reply; 15+ messages in thread
From: Wolfgang Denk @ 2010-10-27 12:23 UTC (permalink / raw)
To: u-boot
Dear Shawn Guo,
In message <AANLkTi=7r4mcSFxpSsdU3bUr_CNMyZey3MLUO2t0-MVm@mail.gmail.com> you wrote:
>
> > Please use something like
> >
> > #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)
> >
> If the automatic calculation of CONFIG_SYS_INIT_SP_ADDR will not
> happen, I can send another patch to fix it, since it's been applied by
> Stefano already.
Yes, it will.
But the stack pointer will not start at the end of the initial ram
area, but below the global data area which lies at the end.
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
Always leave room to add an explanation if it doesn't work out.
^ permalink raw reply [flat|nested] 15+ messages in thread
* [U-Boot] [PATCH v2] mx51evk: support new relocation scheme
2010-10-27 12:23 ` Wolfgang Denk
@ 2010-10-27 12:28 ` Shawn Guo
2010-10-27 12:45 ` Wolfgang Denk
0 siblings, 1 reply; 15+ messages in thread
From: Shawn Guo @ 2010-10-27 12:28 UTC (permalink / raw)
To: u-boot
On Wed, Oct 27, 2010 at 8:23 PM, Wolfgang Denk <wd@denx.de> wrote:
> Dear Shawn Guo,
>
> In message <AANLkTi=7r4mcSFxpSsdU3bUr_CNMyZey3MLUO2t0-MVm@mail.gmail.com> you wrote:
>>
>> > Please use something like
>> >
>> > #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)
>> >
>> If the automatic calculation of CONFIG_SYS_INIT_SP_ADDR will not
>> happen, I can send another patch to fix it, since it's been applied by
>> Stefano already.
>
> Yes, it will.
>
> But the stack pointer will not start at the end of the initial ram
> area, but below the global data area which lies at the end.
>
I thought the manual definition of CONFIG_SYS_INIT_SP_ADDR is the near
term solution, since it will be replaced by automatic calculation. So
I did not put much attention to reflect the layout you want to see.
Anyway, v3 is coming soon.
--
Regards,
Shawn
^ permalink raw reply [flat|nested] 15+ messages in thread
* [U-Boot] [PATCH v2] mx51evk: support new relocation scheme
2010-10-27 12:28 ` Shawn Guo
@ 2010-10-27 12:45 ` Wolfgang Denk
0 siblings, 0 replies; 15+ messages in thread
From: Wolfgang Denk @ 2010-10-27 12:45 UTC (permalink / raw)
To: u-boot
Dear Shawn Guo,
In message <AANLkTinAMZbqGKiTt=bBPhqxNWvsHcV2=CcKHZYctkOs@mail.gmail.com> you wrote:
>
> > But the stack pointer will not start at the end of the initial ram
> > area, but below the global data area which lies at the end.
> >
> I thought the manual definition of CONFIG_SYS_INIT_SP_ADDR is the near
> term solution, since it will be replaced by automatic calculation. So
> I did not put much attention to reflect the layout you want to see.
Well, we can only calculate this automatically if all boards us the
same layout of the internal RAM area. That's why this is needed.
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
The more we disagree, the more chance there is that at least one of
us is right.
^ permalink raw reply [flat|nested] 15+ messages in thread
* [U-Boot] [PATCH v2] mx51evk: support new relocation scheme
2010-10-27 11:46 ` Wolfgang Denk
2010-10-27 11:54 ` Shawn Guo
@ 2010-10-27 15:32 ` Shawn Guo
2010-10-27 16:06 ` Wolfgang Denk
1 sibling, 1 reply; 15+ messages in thread
From: Shawn Guo @ 2010-10-27 15:32 UTC (permalink / raw)
To: u-boot
On Wed, Oct 27, 2010 at 7:46 PM, Wolfgang Denk <wd@denx.de> wrote:
> Dear Shawn Guo,
>
> In message <1288174358-14896-1-git-send-email-shawn.gsc@gmail.com> you wrote:
>> This patch is to fix build breakage and support new relocatoin
>> scheme for mx51evk.
>>
>> - Correct IRAM base address and add size definition
>>
>> ? The IRAM starts from 0x1FFE0000 on final revsion i.mx51 than
>> ? 0x1FFE8000 which is for older revision.
>>
>> - Include imx-regs.h in mx51evk.h
>>
>> ? Definitions like CSD0_BASE_ADDR and IRAM_BASE_ADDR can be
>> ? referred to.
>>
>> - Define CONFIG_SYS_INIT_RAM_ADDR and CONFIG_SYS_INIT_RAM_SIZE
>>
>> ? This is something suggested by Wolfgang, and for automatic
>> ? calculation of macros like CONFIG_SYS_GBL_DATA_SIZE (done) and
>> ? CONFIG_SYS_INIT_SP_ADDR (later).
>
> Um... this is NOT what we discussed.
>
>> +#define CONFIG_SYS_SDRAM_BASE ? ? ? ? ? ? ? ?(PHYS_SDRAM_1)
>> +#define CONFIG_SYS_INIT_RAM_ADDR ? ? (IRAM_BASE_ADDR)
>> +#define CONFIG_SYS_INIT_RAM_SIZE ? ? (IRAM_SIZE)
>> +#define CONFIG_SYS_INIT_SP_ADDR ? ? ?\
>> + ? ? (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_RAM_SIZE)
>> +
>
> No. ?This is not what I want to se.
>
> Memory allocation in the inital ram has the global data at the top.
>
> Please use something like
>
> #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)
>
It ends up with the following compiling error.
start.S:175: Error: garbage following instruction -- `ldr
sp,=(((0x1FFE0000)+((0x00020000)-#96)))'
Can we just go the current way for the near term, and wait for the
auto calculation to clean it up?
--
Regards,
Shawn
^ permalink raw reply [flat|nested] 15+ messages in thread
* [U-Boot] [PATCH v2] mx51evk: support new relocation scheme
2010-10-27 15:32 ` Shawn Guo
@ 2010-10-27 16:06 ` Wolfgang Denk
0 siblings, 0 replies; 15+ messages in thread
From: Wolfgang Denk @ 2010-10-27 16:06 UTC (permalink / raw)
To: u-boot
Dear Shawn Guo,
In message <AANLkTinOgVhJ8B2BuDQBUjjWKi+ADN98eTYfK2H+8bWJ@mail.gmail.com> you wrote:
>
> It ends up with the following compiling error.
>
> start.S:175: Error: garbage following instruction -- `ldr
> sp,=(((0x1FFE0000)+((0x00020000)-#96)))'
>
> Can we just go the current way for the near term, and wait for the
> auto calculation to clean it up?
This has been fixed - see
http://article.gmane.org/gmane.comp.boot-loaders.u-boot/87669
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
I'd like to meet the man who invented sex and see what he's working
on now.
^ permalink raw reply [flat|nested] 15+ messages in thread
* [U-Boot] [PATCH v3] mx51evk: support new relocation scheme
2010-10-27 10:12 [U-Boot] [PATCH v2] mx51evk: support new relocation scheme Shawn Guo
` (2 preceding siblings ...)
2010-10-27 11:46 ` Wolfgang Denk
@ 2010-10-28 2:13 ` Shawn.Guo at freescale.com
2010-10-28 11:22 ` Stefano Babic
3 siblings, 1 reply; 15+ messages in thread
From: Shawn.Guo at freescale.com @ 2010-10-28 2:13 UTC (permalink / raw)
To: u-boot
From: Shawn Guo <shawn.gsc@gmail.com>
This patch is to fix build breakage and support new relocation
scheme for mx51evk.
- Correct IRAM base address and add size definition
The IRAM starts from 0x1FFE0000 on final revsion i.mx51 than
0x1FFE8000 which is for older revision.
- Include imx-regs.h in mx51evk.h
Definitions like CSD0_BASE_ADDR and IRAM_BASE_ADDR can be
referred to.
- Define CONFIG_SYS_INIT_RAM_ADDR and CONFIG_SYS_INIT_RAM_SIZE
They are used to define init RAM layout.
- Remove comment for CONFIG_SYS_GBL_DATA_SIZE which has been
buried by Wolfgang's commit below
25ddd1fb: Replace CONFIG_SYS_GBL_DATA_SIZE by auto-generated value
Signed-off-by: Shawn Guo <shawn.gsc@gmail.com>
---
Changes for v3:
- Correct init RAM layout to have global data at the top.
Changes for v2:
- Combine two patches before into one, as the separation is not
so logical.
- Define init stack at the end of init RAM to address comments
from Stefano, Heiko and Wolfgang.
arch/arm/include/asm/arch-mx5/imx-regs.h | 3 ++-
board/freescale/mx51evk/mx51evk.c | 6 +++---
include/configs/mx51evk.h | 12 ++++++++++--
3 files changed, 15 insertions(+), 6 deletions(-)
diff --git a/arch/arm/include/asm/arch-mx5/imx-regs.h b/arch/arm/include/asm/arch-mx5/imx-regs.h
index 3ddda40..0b6249a 100644
--- a/arch/arm/include/asm/arch-mx5/imx-regs.h
+++ b/arch/arm/include/asm/arch-mx5/imx-regs.h
@@ -26,7 +26,8 @@
/*
* IRAM
*/
-#define IRAM_BASE_ADDR 0x1FFE8000 /* internal ram */
+#define IRAM_BASE_ADDR 0x1FFE0000 /* internal ram */
+#define IRAM_SIZE 0x00020000 /* 128 KB */
/*
* Graphics Memory of GPU
*/
diff --git a/board/freescale/mx51evk/mx51evk.c b/board/freescale/mx51evk/mx51evk.c
index c8d7d39..8820698 100644
--- a/board/freescale/mx51evk/mx51evk.c
+++ b/board/freescale/mx51evk/mx51evk.c
@@ -52,9 +52,9 @@ u32 get_board_rev(void)
int dram_init(void)
{
- gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
- gd->bd->bi_dram[0].size = get_ram_size((long *)PHYS_SDRAM_1,
- PHYS_SDRAM_1_SIZE);
+ /* dram_init must store complete ramsize in gd->ram_size */
+ gd->ram_size = get_ram_size((volatile void *)CONFIG_SYS_SDRAM_BASE,
+ PHYS_SDRAM_1_SIZE);
return 0;
}
diff --git a/include/configs/mx51evk.h b/include/configs/mx51evk.h
index f31fc4e..6282467 100644
--- a/include/configs/mx51evk.h
+++ b/include/configs/mx51evk.h
@@ -24,11 +24,11 @@
#ifndef __CONFIG_H
#define __CONFIG_H
+#include <asm/arch/imx-regs.h>
/* High Level Configuration Options */
#define CONFIG_MX51 /* in a mx51 */
-#define CONFIG_SKIP_RELOCATE_UBOOT
#define CONFIG_SYS_MX5_HCLK 24000000
#define CONFIG_SYS_MX5_CLK32 32768
@@ -51,7 +51,6 @@
* Size of malloc() pool
*/
#define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + 2 * 1024 * 1024)
-/* size in bytes reserved for initial data */
#define BOARD_LATE_INIT
@@ -174,6 +173,15 @@
#define PHYS_SDRAM_1 CSD0_BASE_ADDR
#define PHYS_SDRAM_1_SIZE (512 * 1024 * 1024)
+#define CONFIG_SYS_SDRAM_BASE (PHYS_SDRAM_1)
+#define CONFIG_SYS_INIT_RAM_ADDR (IRAM_BASE_ADDR)
+#define CONFIG_SYS_INIT_RAM_SIZE (IRAM_SIZE)
+
+#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)
+
#define CONFIG_SYS_DDR_CLKSEL 0
#define CONFIG_SYS_CLKTL_CBCDR 0x59E35100
--
1.7.1
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [U-Boot] [PATCH v3] mx51evk: support new relocation scheme
2010-10-28 2:13 ` [U-Boot] [PATCH v3] " Shawn.Guo at freescale.com
@ 2010-10-28 11:22 ` Stefano Babic
0 siblings, 0 replies; 15+ messages in thread
From: Stefano Babic @ 2010-10-28 11:22 UTC (permalink / raw)
To: u-boot
On 10/28/2010 04:13 AM, Shawn.Guo at freescale.com wrote:
> From: Shawn Guo <shawn.gsc@gmail.com>
>
> This patch is to fix build breakage and support new relocation
> scheme for mx51evk.
>
> - Correct IRAM base address and add size definition
>
> The IRAM starts from 0x1FFE0000 on final revsion i.mx51 than
> 0x1FFE8000 which is for older revision.
>
> - Include imx-regs.h in mx51evk.h
>
> Definitions like CSD0_BASE_ADDR and IRAM_BASE_ADDR can be
> referred to.
>
> - Define CONFIG_SYS_INIT_RAM_ADDR and CONFIG_SYS_INIT_RAM_SIZE
>
> They are used to define init RAM layout.
>
> - Remove comment for CONFIG_SYS_GBL_DATA_SIZE which has been
> buried by Wolfgang's commit below
>
> 25ddd1fb: Replace CONFIG_SYS_GBL_DATA_SIZE by auto-generated value
>
> Signed-off-by: Shawn Guo <shawn.gsc@gmail.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] 15+ messages in thread
end of thread, other threads:[~2010-10-28 11:22 UTC | newest]
Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-27 10:12 [U-Boot] [PATCH v2] mx51evk: support new relocation scheme Shawn Guo
2010-10-27 11:28 ` Stefano Babic
2010-10-27 11:29 ` Jason Liu
2010-10-27 11:37 ` Shawn Guo
2010-10-27 11:44 ` Jason Liu
2010-10-27 11:46 ` Wolfgang Denk
2010-10-27 11:54 ` Shawn Guo
2010-10-27 12:17 ` Stefano Babic
2010-10-27 12:23 ` Wolfgang Denk
2010-10-27 12:28 ` Shawn Guo
2010-10-27 12:45 ` Wolfgang Denk
2010-10-27 15:32 ` Shawn Guo
2010-10-27 16:06 ` Wolfgang Denk
2010-10-28 2:13 ` [U-Boot] [PATCH v3] " Shawn.Guo at freescale.com
2010-10-28 11:22 ` Stefano Babic
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox