bsp_define 0.1.54

系统必须的配置项定义
Documentation
//! 系统必须的配置项定义
#![no_std]

pub mod clocksource;
pub mod console;
pub mod irqchip;
pub mod memrange;
pub mod smp;

/// 系统`Bsp`定义
pub trait BspDefine<C, I, CLK>
where
    C: console::ConsoleImpl,
    I: irqchip::IrqchipImpl,
    CLK: clocksource::ClockImpl,
{
    /// 定义系统多核信息
    const DEFINE_SMP: smp::SmpDefine = smp::SmpDefine::create(
        smp::PsciCompatible::Psci0_1,
        smp::PsciEnableMethod::Hvc,
        0,
        [0; smp::NR_CPUS],
        1,
    );

    /// 定义系统内存域信息
    const DEFINE_MEMS: memrange::MemDefine;

    /// 定义系统控制台信息
    const DEFINE_CONSOLE: C;

    /// 定义系统中断控制器信息
    const DEFINE_IRQCHIP: I;

    /// 定义系统时钟源信息
    const DEFINE_CLOCK: CLK;

    /// 定义系统心跳周期(默认 5ms)
    const DEFINE_SYSTEM_TICK: usize = 5;

    /// 系统启动前期调用, 用于时钟等板级系统初始化
    fn early_init(&self) {}

    /// 系统启动后期调用, 主要完成最终板级初始化和加载APP
    fn late_init(&self);

    /// 从核启动后期调用
    fn secondary_init(&self) {}
}