diff options
author | Xiang Wang <wxjstz@126.com> | 2018-07-19 17:35:39 +0800 |
---|---|---|
committer | ron minnich <rminnich@gmail.com> | 2019-02-02 16:53:21 +0000 |
commit | 820dcfceb3901dbb00bb90c876e374126ca14e20 (patch) | |
tree | 2f0ba3f1038291f9dda7755680551cbe425f7922 /src/arch/riscv/stages.c | |
parent | c47d43a8af5dfdbdb7afebb39f999f18f36c9d23 (diff) |
riscv: Simplify payload handling
1. Simplify payload code and convert it to C
2. Save the FDT pointer to HLS (hart-local storage).
3. Don't use mscratch to pass FDT pointer as it is used for exception handling.
Change-Id: I32bf2a99e07a65358a7f19b899259f0816eb45e8
Signed-off-by: Xiang Wang <wxjstz@126.com>
Signed-off-by: Philipp Hug <philipp@hug.cx>
Reviewed-on: https://review.coreboot.org/c/31179
Reviewed-by: ron minnich <rminnich@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/arch/riscv/stages.c')
-rw-r--r-- | src/arch/riscv/stages.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/arch/riscv/stages.c b/src/arch/riscv/stages.c index 5e7fa4f75b..07b898f853 100644 --- a/src/arch/riscv/stages.c +++ b/src/arch/riscv/stages.c @@ -28,18 +28,19 @@ #include <arch/encoding.h> #include <arch/stages.h> #include <arch/smp/smp.h> +#include <rules.h> +#include <mcall.h> -void stage_entry(void) +void stage_entry(int hart_id, void *fdt) { - smp_pause(CONFIG_RISCV_WORKING_HARTID); - /* * Save the FDT pointer before entering ramstage, because mscratch * might be overwritten in the trap handler, and there is code in * ramstage that generates misaligned access faults. */ - if (ENV_RAMSTAGE) - rom_fdt = (const void *)read_csr(mscratch); + HLS()->hart_id = hart_id; + HLS()->fdt = fdt; + smp_pause(CONFIG_RISCV_WORKING_HARTID); main(); } |