|
@@ -1,16 +1,26 @@
|
|
|
|
+use static_toml::static_toml;
|
|
|
|
+
|
|
/// The address where the SBI link start.
|
|
/// The address where the SBI link start.
|
|
pub const SBI_LINK_START_ADDRESS: usize = 0x80000000;
|
|
pub const SBI_LINK_START_ADDRESS: usize = 0x80000000;
|
|
|
|
+
|
|
|
|
+static_toml! {
|
|
|
|
+ const CONFIG = include_toml!("../../target/config.toml");
|
|
|
|
+}
|
|
|
|
+
|
|
/// Maximum number of supported harts.
|
|
/// Maximum number of supported harts.
|
|
-pub const NUM_HART_MAX: usize = 8;
|
|
|
|
|
|
+pub const NUM_HART_MAX: usize = CONFIG.num_hart_max as usize;
|
|
/// Stack size per hart (hardware thread) in bytes.
|
|
/// Stack size per hart (hardware thread) in bytes.
|
|
-pub const LEN_STACK_PER_HART: usize = 16 * 1024;
|
|
|
|
|
|
+pub const LEN_STACK_PER_HART: usize = CONFIG.len_stack_per_hart as usize;
|
|
/// Heap Size of SBI firmware.
|
|
/// Heap Size of SBI firmware.
|
|
-pub const HEAP_SIZE: usize = 32 * 1024;
|
|
|
|
|
|
+pub const HEAP_SIZE: usize = CONFIG.heap_size as usize;
|
|
/// Platform page size.
|
|
/// Platform page size.
|
|
-pub const PAGE_SIZE: usize = 4096;
|
|
|
|
|
|
+pub const PAGE_SIZE: usize = CONFIG.page_size as usize;
|
|
|
|
+/// Log Level.
|
|
|
|
+pub const LOG_LEVEL: &'static str = CONFIG.log_level;
|
|
|
|
+/// Address for jump mode.
|
|
|
|
+#[cfg(feature = "jump")]
|
|
|
|
+pub const JUMP_ADDRESS: usize = CONFIG.jump_address as usize;
|
|
|
|
+
|
|
/// TLB_FLUSH_LIMIT defines the TLB refresh range limit.
|
|
/// TLB_FLUSH_LIMIT defines the TLB refresh range limit.
|
|
/// If the TLB refresh range is greater than TLB_FLUSH_LIMIT, the entire TLB is refreshed.
|
|
/// If the TLB refresh range is greater than TLB_FLUSH_LIMIT, the entire TLB is refreshed.
|
|
pub const TLB_FLUSH_LIMIT: usize = 4 * PAGE_SIZE;
|
|
pub const TLB_FLUSH_LIMIT: usize = 4 * PAGE_SIZE;
|
|
-
|
|
|
|
-#[cfg(feature = "jump")]
|
|
|
|
-pub const JUMP_ADDRESS: usize = 0x50000000;
|
|
|