* [U-Boot] [PATCH 3/7 v2] integrator: do not test first part of the memory
@ 2011-10-24 7:02 Linus Walleij
2011-11-08 21:08 ` Albert ARIBAUD
0 siblings, 1 reply; 2+ messages in thread
From: Linus Walleij @ 2011-10-24 7:02 UTC (permalink / raw)
To: u-boot
When booting from Flash, the Integrator remaps its flash memory
from 0x24000000 to 0x00000000, and starts executing it at
0x00000000. This ROM thus hides the RAM underneath and first
0x40000 bytes of the memory cannot be tested by get_ram_size().
So let's test from 0x40000 to the end of detected memory
instead.
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
ChangeLog v1->v2:
- Rebased to U-Boot ARM HEAD at Alberts request, see message
4EA1C8E7.7090105 at aribaud.net
---
board/armltd/integrator/integrator.c | 19 +++++++++++++++----
1 files changed, 15 insertions(+), 4 deletions(-)
diff --git a/board/armltd/integrator/integrator.c b/board/armltd/integrator/integrator.c
index c8d2bc7..83f047c 100644
--- a/board/armltd/integrator/integrator.c
+++ b/board/armltd/integrator/integrator.c
@@ -86,6 +86,15 @@ int misc_init_r (void)
return (0);
}
+/*
+ * The Integrator remaps the Flash memory to 0x00000000 and executes U-Boot
+ * from there, which means we cannot test the RAM underneath the ROM at this
+ * point. It will be unmapped later on, when we are executing from the
+ * relocated in RAM U-Boot. We simply assume that this RAM is usable if the
+ * RAM on higher addresses works fine.
+ */
+#define REMAPPED_FLASH_SZ 0x40000
+
int dram_init (void)
{
gd->bd->bi_dram[0].start = CONFIG_SYS_SDRAM_BASE;
@@ -111,15 +120,17 @@ extern void dram_query(void);
*
*/
sdram_shift = ((cm_reg_sdram & 0x0000001C)/4)%4;
- gd->bd->bi_dram[0].size = 0x01000000 << sdram_shift;
- gd->ram_size = get_ram_size((long *)CONFIG_SYS_SDRAM_BASE,
+ gd->ram_size = get_ram_size((long *) CONFIG_SYS_SDRAM_BASE +
+ REMAPPED_FLASH_SZ,
0x01000000 << sdram_shift);
}
#else
- gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
- gd->ram_size = get_ram_size((long *)CONFIG_SYS_SDRAM_BASE,
+ gd->ram_size = get_ram_size((long *) CONFIG_SYS_SDRAM_BASE +
+ REMAPPED_FLASH_SZ,
PHYS_SDRAM_1_SIZE);
#endif /* CM_SPD_DETECT */
+ /* We only have one bank of RAM, set it to whatever was detected */
+ gd->bd->bi_dram[0].size = gd->ram_size;
return 0;
}
--
1.7.6.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [U-Boot] [PATCH 3/7 v2] integrator: do not test first part of the memory
2011-10-24 7:02 [U-Boot] [PATCH 3/7 v2] integrator: do not test first part of the memory Linus Walleij
@ 2011-11-08 21:08 ` Albert ARIBAUD
0 siblings, 0 replies; 2+ messages in thread
From: Albert ARIBAUD @ 2011-11-08 21:08 UTC (permalink / raw)
To: u-boot
Hi Linus,
Le 24/10/2011 09:02, Linus Walleij a ?crit :
> When booting from Flash, the Integrator remaps its flash memory
> from 0x24000000 to 0x00000000, and starts executing it at
> 0x00000000. This ROM thus hides the RAM underneath and first
> 0x40000 bytes of the memory cannot be tested by get_ram_size().
> So let's test from 0x40000 to the end of detected memory
> instead.
>
> Signed-off-by: Linus Walleij<linus.walleij@linaro.org>
> ---
> ChangeLog v1->v2:
> - Rebased to U-Boot ARM HEAD at Alberts request, see message
> 4EA1C8E7.7090105 at aribaud.net
> ---
> board/armltd/integrator/integrator.c | 19 +++++++++++++++----
> 1 files changed, 15 insertions(+), 4 deletions(-)
>
> diff --git a/board/armltd/integrator/integrator.c b/board/armltd/integrator/integrator.c
> index c8d2bc7..83f047c 100644
> --- a/board/armltd/integrator/integrator.c
> +++ b/board/armltd/integrator/integrator.c
> @@ -86,6 +86,15 @@ int misc_init_r (void)
> return (0);
> }
>
> +/*
> + * The Integrator remaps the Flash memory to 0x00000000 and executes U-Boot
> + * from there, which means we cannot test the RAM underneath the ROM at this
> + * point. It will be unmapped later on, when we are executing from the
> + * relocated in RAM U-Boot. We simply assume that this RAM is usable if the
> + * RAM on higher addresses works fine.
> + */
> +#define REMAPPED_FLASH_SZ 0x40000
> +
> int dram_init (void)
> {
> gd->bd->bi_dram[0].start = CONFIG_SYS_SDRAM_BASE;
> @@ -111,15 +120,17 @@ extern void dram_query(void);
> *
> */
> sdram_shift = ((cm_reg_sdram& 0x0000001C)/4)%4;
> - gd->bd->bi_dram[0].size = 0x01000000<< sdram_shift;
> - gd->ram_size = get_ram_size((long *)CONFIG_SYS_SDRAM_BASE,
> + gd->ram_size = get_ram_size((long *) CONFIG_SYS_SDRAM_BASE +
> + REMAPPED_FLASH_SZ,
> 0x01000000<< sdram_shift);
> }
> #else
> - gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
> - gd->ram_size = get_ram_size((long *)CONFIG_SYS_SDRAM_BASE,
> + gd->ram_size = get_ram_size((long *) CONFIG_SYS_SDRAM_BASE +
> + REMAPPED_FLASH_SZ,
> PHYS_SDRAM_1_SIZE);
> #endif /* CM_SPD_DETECT */
> + /* We only have one bank of RAM, set it to whatever was detected */
> + gd->bd->bi_dram[0].size = gd->ram_size;
>
> return 0;
> }
Applied to u-boot-arm/master, thanks!
Amicalement,
--
Albert.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-11-08 21:08 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-24 7:02 [U-Boot] [PATCH 3/7 v2] integrator: do not test first part of the memory Linus Walleij
2011-11-08 21:08 ` Albert ARIBAUD
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox