summaryrefslogtreecommitdiff
path: root/firmware
diff options
context:
space:
mode:
authorAnup Patel <anup.patel@wdc.com>2018-12-22 10:10:54 +0300
committerAnup Patel <anup@brainfault.org>2018-12-22 18:19:52 +0300
commit58ca525a7d35b2d4cd7045fd343fb6d85567f01d (patch)
tree01d947176b3f14ec1bb5c7487d1b725682bd68bd /firmware
parent1cf7ec9e3bbf287fc9d601d2346b9e73fda40a84 (diff)
downloadopensbi-58ca525a7d35b2d4cd7045fd343fb6d85567f01d.tar.xz
firmware: Don't depend on PLAT_HART_COUNT and PLAT_HART_STACK_SIZE
The hart_count and hart_stack_size information is already available in "struct sbi_platform" so we use that instead of depending on PLAT_HART_COUNT and PLAT_HART_STACK_SIZE. Signed-off-by: Anup Patel <anup.patel@wdc.com>
Diffstat (limited to 'firmware')
-rw-r--r--firmware/fw_common.S10
1 files changed, 6 insertions, 4 deletions
diff --git a/firmware/fw_common.S b/firmware/fw_common.S
index 4c11e85..d426f15 100644
--- a/firmware/fw_common.S
+++ b/firmware/fw_common.S
@@ -132,8 +132,9 @@ _start_warm:
* s8 -> HART Stack Size
*/
csrr s6, mhartid
- li s7, PLAT_HART_COUNT
- li s8, PLAT_HART_STACK_SIZE
+ la a4, platform
+ lwu s7, RISCV_PLATFORM_HART_COUNT_OFFSET(a4)
+ lwu s8, RISCV_PLATFORM_HART_STACK_SIZE_OFFSET(a4)
/* HART ID should be within expected limit */
csrr s6, mhartid
@@ -202,8 +203,9 @@ _hartid_to_scratch:
* s1 -> HART Stack End
* s2 -> Temporary
*/
- li s0, PLAT_HART_STACK_SIZE
- li s2, PLAT_HART_COUNT
+ la s2, platform
+ lwu s0, RISCV_PLATFORM_HART_STACK_SIZE_OFFSET(s2)
+ lwu s2, RISCV_PLATFORM_HART_COUNT_OFFSET(s2)
mul s2, s2, s0
la s1, _fw_end
add s1, s1, s2