How can I reserve a portion of SDRAM, say 4 bytes, to pass a flag between the U-Boot and the Linux kernel so that this reserved memory location is not initialized by the linker and the value stored after warm boot? I am trying to avoid using bootargs to minimize the wear and tear of the NAND flash used in the firmware. My question could be considered as an addition to the solution provided: How to determine cold boot and warm boot on an ARM processor?
I built u-boot.lds with the linker script below and built it with: -fno-zero-initialized-in-bss without success.
OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm") OUTPUT_ARCH(arm) ENTRY(_start) SECTIONS { . = 0x00000000; . = ALIGN(4); .text : { cpu/arm926ejs/start.o (.text) *(.text) } . = ALIGN(4); .rodata : { *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*))) } . = ALIGN(4); .data : { *(.data) } . = ALIGN(4); .got : { *(.got) } . = .; __u_boot_cmd_start = .; .u_boot_cmd : { *(.u_boot_cmd) } __u_boot_cmd_end = .; . = ALIGN(4); __bss_start = .; _U_BOOT_FLAG = .; . = . + 4; .bss (NOLOAD) : { *(.bss) . = ALIGN(4); } _end = .; }
Any ideas?
arm memory linux-kernel embedded-linux u-boot
user1357493
source share