summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnup Patel <[email protected]>2018-12-31 11:30:55 +0530
committerAnup Patel <[email protected]>2019-01-02 09:57:12 +0530
commit5ed3cf37073125a38ac839ad11de687f20286b33 (patch)
treef3d959f4e831882cd40361a19668184bbfaabdba
parente0d6914b3c40c1609ccf196fa448ea6880ff23d5 (diff)
include: Move RISCV_PLATFORM_xyz defines to sbi_platform.h
The struct sbi_platform related defines RISCV_PLATFORM_xyz should be in sbi_platform.h so that we can keep these defines in-sync with changes in struct sbi_platform. Signed-off-by: Anup Patel <[email protected]>
-rw-r--r--firmware/fw_base.S9
-rw-r--r--include/sbi/riscv_asm.h5
-rw-r--r--include/sbi/sbi_platform.h9
3 files changed, 14 insertions, 9 deletions
diff --git a/firmware/fw_base.S b/firmware/fw_base.S
index d872061d..d927c3e0 100644
--- a/firmware/fw_base.S
+++ b/firmware/fw_base.S
@@ -9,6 +9,7 @@
#include <sbi/riscv_asm.h>
#include <sbi/riscv_encoding.h>
+#include <sbi/sbi_platform.h>
#include <sbi/sbi_scratch.h>
.align 3
@@ -134,8 +135,8 @@ _start_warm:
*/
csrr s6, mhartid
la a4, platform
- lwu s7, RISCV_PLATFORM_HART_COUNT_OFFSET(a4)
- lwu s8, RISCV_PLATFORM_HART_STACK_SIZE_OFFSET(a4)
+ lwu s7, SBI_PLATFORM_HART_COUNT_OFFSET(a4)
+ lwu s8, SBI_PLATFORM_HART_STACK_SIZE_OFFSET(a4)
/* HART ID should be within expected limit */
csrr s6, mhartid
@@ -205,8 +206,8 @@ _hartid_to_scratch:
* s2 -> Temporary
*/
la s2, platform
- lwu s0, RISCV_PLATFORM_HART_STACK_SIZE_OFFSET(s2)
- lwu s2, RISCV_PLATFORM_HART_COUNT_OFFSET(s2)
+ lwu s0, SBI_PLATFORM_HART_STACK_SIZE_OFFSET(s2)
+ lwu s2, SBI_PLATFORM_HART_COUNT_OFFSET(s2)
mul s2, s2, s0
la s1, _fw_end
add s1, s1, s2
diff --git a/include/sbi/riscv_asm.h b/include/sbi/riscv_asm.h
index c169d93c..6fd7d5d7 100644
--- a/include/sbi/riscv_asm.h
+++ b/include/sbi/riscv_asm.h
@@ -69,11 +69,6 @@
#error "Unexpected __SIZEOF_SHORT__"
#endif
-#define RISCV_PLATFORM_NAME_OFFSET (0x0)
-#define RISCV_PLATFORM_FEATURES_OFFSET (0x40)
-#define RISCV_PLATFORM_HART_COUNT_OFFSET (0x48)
-#define RISCV_PLATFORM_HART_STACK_SIZE_OFFSET (0x4c)
-
#define RISCV_TRAP_REGS_zero 0
#define RISCV_TRAP_REGS_ra 1
#define RISCV_TRAP_REGS_sp 2
diff --git a/include/sbi/sbi_platform.h b/include/sbi/sbi_platform.h
index 8532c03b..43fb4ea8 100644
--- a/include/sbi/sbi_platform.h
+++ b/include/sbi/sbi_platform.h
@@ -10,6 +10,13 @@
#ifndef __SBI_PLATFORM_H__
#define __SBI_PLATFORM_H__
+#define SBI_PLATFORM_NAME_OFFSET (0x0)
+#define SBI_PLATFORM_FEATURES_OFFSET (0x40)
+#define SBI_PLATFORM_HART_COUNT_OFFSET (0x48)
+#define SBI_PLATFORM_HART_STACK_SIZE_OFFSET (0x4c)
+
+#ifndef __ASSEMBLY__
+
#include <sbi/sbi_scratch.h>
enum sbi_platform_features {
@@ -240,3 +247,5 @@ static inline int sbi_platform_system_shutdown(struct sbi_platform *plat,
}
#endif
+
+#endif