aboutsummaryrefslogtreecommitdiff
path: root/firmware/fw_jump.S
diff options
context:
space:
mode:
authorAnup Patel <anup.patel@wdc.com>2019-04-29 10:44:15 +0530
committerAnup Patel <anup@brainfault.org>2019-05-10 12:26:22 +0530
commit25472de89ee3b98cd466f69d1f419f943dcbcb0f (patch)
tree64b47b9269befa075a2cb1bc6fd0c4594d361e8f /firmware/fw_jump.S
parent243a5e05324ee584f1575ad7764a3e4527d6b5ae (diff)
firmware: Allow firmwares to provide next mode and options
This patch extends existing firmwares (i.e. fw_jump and fw_payload) to explicitly provide next mode and options to fw_base. We also introduce fw_save_info() which is called by fw_base very early on boot HART. This function can be used by existing firmwares (i.e. fw_jump and fw_payload) to save information passed by previous booting stage. Overall, this is a preparatory patch for implementing fw_dynamic. Signed-off-by: Anup Patel <anup.patel@wdc.com> Reviewed-by: Alistair Francis <alistair.francis@wdc.com> Reviewed-by: Atish Patra <atish.patra@wdc.com>
Diffstat (limited to 'firmware/fw_jump.S')
-rw-r--r--firmware/fw_jump.S50
1 files changed, 47 insertions, 3 deletions
diff --git a/firmware/fw_jump.S b/firmware/fw_jump.S
index 4b71863..cdf1f41 100644
--- a/firmware/fw_jump.S
+++ b/firmware/fw_jump.S
@@ -11,17 +11,35 @@
.align 3
.section .entry, "ax", %progbits
+ .global fw_save_info
+ /*
+ * We can only use a0, a1, a2, a3, and a4 registers here.
+ * The a0, a1, and a2 registers will be same as passed by
+ * previous booting stage.
+ * Nothing to be returned here.
+ */
+fw_save_info:
+ ret
+
+ .align 3
+ .section .entry, "ax", %progbits
.global fw_prev_arg1
+ /*
+ * We can only use a0, a1, and a2 registers here.
+ * The previous arg1 should be returned in 'a0'.
+ */
fw_prev_arg1:
- /* We return previous arg1 in 'a0' */
add a0, zero, zero
ret
.align 3
.section .entry, "ax", %progbits
.global fw_next_arg1
+ /*
+ * We can only use a0, a1, and a2 registers here.
+ * The next arg1 should be returned in 'a0'.
+ */
fw_next_arg1:
- /* We return next arg1 in 'a0' */
#ifdef FW_JUMP_FDT_ADDR
li a0, FW_JUMP_FDT_ADDR
#else
@@ -32,12 +50,38 @@ fw_next_arg1:
.align 3
.section .entry, "ax", %progbits
.global fw_next_addr
+ /*
+ * We can only use a0, a1, and a2 registers here.
+ * The next address should be returned in 'a0'.
+ */
fw_next_addr:
- /* We return next address in 'a0' */
la a0, _jump_addr
REG_L a0, (a0)
ret
+ .align 3
+ .section .entry, "ax", %progbits
+ .global fw_next_mode
+ /*
+ * We can only use a0, a1, and a2 registers here.
+ * The next address should be returned in 'a0'
+ */
+fw_next_mode:
+ li a0, PRV_S
+ ret
+
+ .align 3
+ .section .entry, "ax", %progbits
+ .global fw_options
+ /*
+ * We can only use a0, a1, and a2 registers here.
+ * The 'a4' register will have default options.
+ * The next address should be returned in 'a0'.
+ */
+fw_options:
+ add a0, zero, zero
+ ret
+
#ifndef FW_JUMP_ADDR
#error "Must define FW_JUMP_ADDR"
#endif