Eli Rosencruft
Eli Rosencruft

Reputation: 7262

Linux PowerPC Book E reserve pristine RAM through warm reboot

With CONFIG_FSL_BOOKE (P1020 RDB) 2.6.31 I need to reserve 1MB of RAM at some fixed location (doesn't matter where) that is pristine, meaning it is not touched by U-Boot or the bootmem allocator, so that the RAM contents survive warm reboot. With the caveat that I cannot change U-boot to use CONFIG_PRAM/mem=.

Compiling relocatable kernel is not an option in arc/powerpc 2.6.31. memmap is not supported in arch/powerpc/kernel/setup_32.c.

Ideally this area should be reserved and not L1 d-cached, so that it can be used to store ramoops from interrupt context.

Is there any way to move _end out to 0x600000 before bootmem to create a hole that is not touched by anyone? That is, to trick the kernel into thinking that _end is farther out?

In vmlinux.lds.S I tried something like:

    . = ALIGN(PAGE_SIZE);
    _end = . ;
    PROVIDE32 (end = .);

Changed to

    . = ALIGN(PAGE_SIZE);
    _start_unused_ram = .;
    . = ALIGN(0x400000);
    _end = . ;
    PROVIDE32 (end = .);

However, the area between __bss_stop and 0x400000 was overwritten.

Upvotes: 3

Views: 581

Answers (1)

mpe
mpe

Reputation: 2720

The best solution would be to add the area of memory as a reserved region in the device tree.

That way it will be reserved early during boot and should not be touched by the kernel.

Upvotes: 1

Related Questions