[PATCH 1/2] board: stemmy: Parse atags to get available memory

Linus Walleij linus.walleij at linaro.org
Thu Jul 8 01:53:55 CEST 2021


On Wed, Jul 7, 2021 at 12:59 PM Stephan Gerhold <stephan at gerhold.net> wrote:

> At the moment the "stemmy" board attempts to detect the RAM size with
> a simple memory test (get_ram_size()). Unfortunately, this does not work
> correctly for devices with 768 MiB RAM (e.g. Samsung Galaxy Ace 2
> (GT-I8160), "codina"). Reading/writing memory after the 768 MiB RAM
> succeeds but actually overwrites some earlier parts of the memory.
>
> For U-Boot this does not result in any major problems, but on Linux
> this will eventually lead to strange crashes because of the memory
> corruption.
>
> Since the "stemmy" U-Boot port is designed to be chainloaded from
> the original Samsung bootloader, the most reliable way to get the
> available amount of RAM is to look at the ATAGS passed by the Samsung
> bootloader. Fortunately, the header used to generate ATAGS in U-Boot
> (asm/setup.h) can also be easily used to parse them.
>
> Also clarify and simplify stemmy.h a bit to make it more clear where
> some of the magic values in there are actually coming from.
>
> Signed-off-by: Stephan Gerhold <stephan at gerhold.net>

Reviewed-by: Linus Walleij <linus.walleij at linaro.org>

>               - Samsung Galaxy S III mini (GT-I8190)    "golden"
>               - Samsung Galaxy S Advance (GT-I9070)     "janice"
>               - Samsung Galaxy Xcover 2 (GT-S7710)      "skomer"
> +             - Samsung Galaxy Ace 2 (GT-I8160)         "codina"

I have also used Stemmy U-boot successfully on
Samsung Galaxy Beam (GT-I8530) "gavini"
Samsung Galaxy Amp (SGH-I407) "kyle"

Yours,
Linus Walleij


More information about the U-Boot mailing list