cpu/allwinner/a10: Clarify the usage of SRAM during bootblock

We have 32KiB of usable SRAM right when we boot. The first 24KiB can
be loaded with our bootblock, while the other 8KiB can be used as
stack during the bootblock stage.

Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Change-Id: I48d3a37869031c3c1dbc1fab71204d473d64deeb
Reviewed-on: http://review.coreboot.org/4563
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
This commit is contained in:
Alexandru Gagniuc 2013-12-22 18:51:29 -05:00
parent 14964dd372
commit be32f51aa1
2 changed files with 15 additions and 10 deletions

View File

@ -42,18 +42,22 @@ config ROMSTAGE_BASE
hex hex
default SYS_SDRAM_BASE default SYS_SDRAM_BASE
# Keep the stack in SRAM # Keep the stack in SRAM block A2.
# SRAM blocks A1 (0-16KiB) and A2 (16KiB-32KiB) are always accessible to the
# CPU. This gives us 32KiB of SRAM to boot with. The BROM bootloader will use up
# to 24KiB to load our bootblock, which leaves us the area from 24KiB to 32KiB
# to use however we see fit.
config STACK_TOP config STACK_TOP
hex hex
default 0x00008000 default 0x00008000
config STACK_BOTTOM config STACK_BOTTOM
hex hex
default 0x00004000 default 0x00006000
config STACK_SIZE config STACK_SIZE
hex hex
default 0x00004000 default 0x00002000
## TODO Change this to some better address not overlapping bootblock when ## TODO Change this to some better address not overlapping bootblock when
## cbfstool supports creating header in arbitrary location. ## cbfstool supports creating header in arbitrary location.

View File

@ -21,15 +21,16 @@ get_bootblock_size= \
sed 's/[^0-9 ]//g')) \ sed 's/[^0-9 ]//g')) \
$(shell echo $$(($(word 2, $(strip $(bb_s)))))) $(shell echo $$(($(word 2, $(strip $(bb_s))))))
# The boot ROM in the SoC will start loading code if a special boot0 header is # The boot ROM in the SoC will start loading code if a special BOOT0 header is
# found (at an offset of 8KiB in either NAND or SD), and the checksum is # found (at an offset of 8KiB in either NAND or SD), and the checksum is
# correct. this header is normally added by the 'mxsunxiboot' tool. The file # correct. This header is normally added by the 'mxsunxiboot' tool. The boot ROM
# passed to mksunxiboot should only include the bootblock due to size # will load at most 24KiB of data to SRAM, so limit the file size accordingly.
# limitations. # The BOOT0 header takes 32 bytes, so limit our file to 24KiB - 32 bytes.
# FIXME: Figure out how to safely integrate in coreboot.rom. For now, only copy # FIXME: Figure out how to safely integrate in coreboot.rom.
# the first 15 KiB of coreboot.rom (This will not collide with stack) # FIXME: The file passed to mksunxiboot should only include the bootblock due
# to size limitations.
$(obj)/BOOT0: $(obj)/coreboot.rom $(obj)/BOOT0: $(obj)/coreboot.rom
@printf " BOOT0 $(subst $(obj)/,,$(^))\n" @printf " BOOT0 $(subst $(obj)/,,$(^))\n"
touch $@ touch $@
dd if=$^ of=$^.tmp bs=1024 count=15 dd if=$^ of=$^.tmp bs=24544 count=1
-mksunxiboot $^.tmp $@ -mksunxiboot $^.tmp $@