summaryrefslogtreecommitdiff
path: root/src/arch/arm
diff options
context:
space:
mode:
authorPatrick Rudolph <siro@das-labor.org>2020-03-01 10:02:50 +0100
committerPatrick Georgi <pgeorgi@google.com>2020-08-03 05:11:17 +0000
commit6588652ef576c1b26b016925a427b4752a71ffcb (patch)
tree578cb99fd1ecc68d5ef7599b82414fbbc8d6f18d /src/arch/arm
parent935495f3e70e4759e871a33eea004433fc8928a4 (diff)
downloadcoreboot-6588652ef576c1b26b016925a427b4752a71ffcb.tar.xz
mb/emulation/qemu-armv7: Fix board
Fix multiple issues allowing to boot until "Payload not loaded": * The FMAP_CACHE was placed in memory mapped flash - Place the FMAP_CACHE in DRAM. * The FMAP_CACHE was overlapping the BOOTBLOCK, which has a default size of 128KiB. - Increase the bootblock size in memlayout to 128KiB to match the FMAP. * The heap in bootblock wasn't usable. - Add a linking check in armv7 common bootblock to relocate itself to the linked address. * A FIT payload couldn't be compiled in as the POSTRAM_CBFS_CACHE was missing. - Add the POSTRAM_CBFS_CACHE to memlayout. * The coreboot log is spammed with missing timestamp table error messages - Add TIMESTAMP table to memlayout. Tested on QEMU armv7 vexpress. Change-Id: Ib9357a5c059ca179826c5a7e7616a5c688ec2e95 Signed-off-by: Patrick Rudolph <siro@das-labor.org> Reviewed-on: https://review.coreboot.org/c/coreboot/+/39187 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Julius Werner <jwerner@chromium.org> Reviewed-by: Angel Pons <th3fanbus@gmail.com> Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Diffstat (limited to 'src/arch/arm')
-rw-r--r--src/arch/arm/armv7/bootblock.S33
1 files changed, 31 insertions, 2 deletions
diff --git a/src/arch/arm/armv7/bootblock.S b/src/arch/arm/armv7/bootblock.S
index e1879c0b30..47813a78f8 100644
--- a/src/arch/arm/armv7/bootblock.S
+++ b/src/arch/arm/armv7/bootblock.S
@@ -62,14 +62,43 @@ init_stack_loop:
cmp r0, r1
bne init_stack_loop
+ /* Set stackpointer in internal RAM */
+ ldr sp, =_estack
+
+ /*
+ * For platforms where the flash is memory mapped (qemu), check if the
+ * bootblock needs to relocate itself.
+ */
+check_position:
+ adr r0, check_position
+ ldr r1, =check_position
+
+ cmp r0, r1
+ beq call_bootblock
+
+ /* Calculate source */
+ ldr r2, =_program
+ sub r1, r1, r2
+ sub r1, r0, r1
+ /* Get destination */
+ ldr r0, =_program
+ /* Get size */
+ ldr r2, =_eprogram
+ sub r2, r2, r0
+
+ bl memcpy
+
+ /* Get absolute address */
+ ldr lr, =call_bootblock
+ /* Directly modify pc as branch instruction changes the state */
+ mov pc, lr
+
call_bootblock:
/* Restore parameter passed in by maskrom/vendor firmware. */
ldr r0, =maskrom_param
str r10, [r0]
- /* Set stackpointer in internal RAM to call bootblock main() */
- ldr sp, =_estack
ldr r0,=0x00000000
/*
* The current design of cpu_info places the struct at the top of the