summaryrefslogtreecommitdiff
path: root/src/arch/riscv/payload.S
diff options
context:
space:
mode:
authorXiang Wang <wxjstz@126.com>2018-07-19 17:35:39 +0800
committerron minnich <rminnich@gmail.com>2019-02-02 16:53:21 +0000
commit820dcfceb3901dbb00bb90c876e374126ca14e20 (patch)
tree2f0ba3f1038291f9dda7755680551cbe425f7922 /src/arch/riscv/payload.S
parentc47d43a8af5dfdbdb7afebb39f999f18f36c9d23 (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/payload.S')
-rw-r--r--src/arch/riscv/payload.S35
1 files changed, 0 insertions, 35 deletions
diff --git a/src/arch/riscv/payload.S b/src/arch/riscv/payload.S
deleted file mode 100644
index 1b8cb96110..0000000000
--- a/src/arch/riscv/payload.S
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * This file is part of the coreboot project.
- *
- * Copyright (C) 2016 Google Inc
- * Copyright (C) 2018 Jonathan Neuschäfer
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- */
-
-// "return" to a payload. a0: FDT, a1: entry point
- .global riscvpayload
-riscvpayload:
- /* Load the entry point */
- mv t0, a1
- csrw mepc, t0
- csrr t0, mstatus
-
- /* Set mstatus.MPP (the previous privilege mode) to supervisor mode */
- li t1, ~(3<<11)
- and t0, t0, t1
- li t2, (1<<11)
- or t0, t0, t2
- csrw mstatus, t0
-
- /* Pass the right arguments and jump! */
- mv a1, a0
- csrr a0, mhartid
- mret