[U-Boot] [PATCH v3] rockchip: Reconfigure the malloc based to point to system memory
Simon Glass
sjg at chromium.org
Sat Oct 3 14:40:54 CEST 2015
On 3 October 2015 at 12:25, Sjoerd Simons <sjoerd.simons at collabora.co.uk> wrote:
>
> When malloc_base initially gets setup in the SPL it is based on the
> current (early) stack pointer, which for rockchip is pointing into SRAM.
> This means simple memory allocations happen in SRAM space, which is
> somewhat unfortunate. Specifically a bounce buffer for the mmc allocated
> in SRAM space seems to cause the mmc engine to stall/fail causing
> timeouts and a failure to load the main u-boot image.
>
> To resolve this, reconfigure the malloc_base to start at the relocated
> stack pointer after DRAM has been setup.
>
> For reference, things did work fine on rockchip before 596380db was
> merged to fix memalign_simple due to a combination of rockchip SDRAM
> starting at address 0 and the dw_mmc driver not checking errors from
> bounce_buffer_start. As a result, when a bounce buffer needed to be
> allocated mem_align simple would fail and return NULL. The mmc driver
> ignored the error and happily continued with the bounce buffer address
> being set to 0, which just happened to work fine..
>
> Signed-off-by: Sjoerd Simons <sjoerd.simons at collabora.co.uk>
> Reviewed-by: Hans de Goede <hdegoede at redhat.com>
> Acked-by: Simon Glass <sjg at chromium.org>
>
> ---
> A better fix for this issue would be to reconfigure the
> malloc_base in spl_relocate_stack_gd following the same steps as is done
> for the initial setup (for which Hans de Goede already posted some
> patches). However at this point in the release cycle i preferred to do a
> minimal rockchip only fix (so those boards become bootable again) for
> this issue to minimize the potential impact on other boards.
>
> Changes in v3:
> - Fixing coding style for the comment block
>
> Changes in v2:
> - Also gd->malloc_ptr to 0 to not waste any potential space
>
> arch/arm/mach-rockchip/board-spl.c | 7 +++++++
> 1 file changed, 7 insertions(+)
Applied to u-boot-rockchip, thanks!
More information about the U-Boot
mailing list