move sys clock frequency to lib so other crates can depend on it

This commit is contained in:
bunnie 2025-08-10 17:55:06 +08:00
parent 781c74ba79
commit a31978edab
2 changed files with 4 additions and 3 deletions

View file

@ -52,3 +52,6 @@ pub const GUARD_MEMORY_BYTES: usize = 8 * crate::PAGE_SIZE; // 1 extra page for
#[cfg(feature = "swap")]
pub const SWAPPER_PID: u8 = 2;
#[cfg(feature = "cramium-soc")]
pub const SYSTEM_CLOCK_FREQUENCY: u32 = 800_000_000;

View file

@ -64,8 +64,6 @@ static ALLOCATOR: linked_list_allocator::LockedHeap = linked_list_allocator::Loc
break into the loader updater less able to get at any root keys?
*/
pub const SYSTEM_CLOCK_FREQUENCY: u32 = 800_000_000;
// Define the .data region - bootstrap baremetal using these hard-coded parameters.
pub const DATA_ORIGIN: usize = 0x61000000;
pub const DATA_SIZE_BYTES: usize = 0x5000;
@ -255,7 +253,7 @@ pub fn early_init() -> u32 {
// Now setup the clocks for real
// Safety: this can only be called in the early_init boot context
#[cfg(not(feature = "simulation-only"))]
let perclk = unsafe { init_clock_asic(SYSTEM_CLOCK_FREQUENCY) };
let perclk = unsafe { init_clock_asic(crate::SYSTEM_CLOCK_FREQUENCY) };
#[cfg(feature = "simulation-only")]
let perclk = 100_000_000;
crate::println!("Perclk is {} Hz", perclk);