board: rename monitor to spi_monitor The board-level monitor module orchestrates the SPI monitor (SPIPF) and SCU mux control for SPI flash protection. Rename the file monitor.rs -> spi_monitor.rs and the struct Ast1060Monitor -> Ast1060SpiMonitor, and update the module path/re-export in lib.rs and the srcs list in BUILD.bazel, to reflect that it is specifically an SPI monitor. Assisted-by: Claude:claude-opus-4-8 Signed-off-by: Christina Quast <christina.quast@9elements.com>
diff --git a/target/ast10x0/board/BUILD.bazel b/target/ast10x0/board/BUILD.bazel index 34075da..29ec348 100644 --- a/target/ast10x0/board/BUILD.bazel +++ b/target/ast10x0/board/BUILD.bazel
@@ -8,7 +8,7 @@ name = "ast10x0_board", srcs = [ "src/lib.rs", - "src/monitor.rs", + "src/spi_monitor.rs", "src/spim_wiring.rs", ], crate_name = "ast10x0_board",
diff --git a/target/ast10x0/board/src/lib.rs b/target/ast10x0/board/src/lib.rs index 0f5f180..dd7445d 100644 --- a/target/ast10x0/board/src/lib.rs +++ b/target/ast10x0/board/src/lib.rs
@@ -15,10 +15,10 @@ use ast10x0_peripherals::scu::{ClockRegisterHalf, ScuRegisterHalf}; use ast10x0_peripherals::scu::{PinctrlPin, ScuRegisters}; -pub mod monitor; +pub mod spi_monitor; pub mod spim_wiring; -pub use monitor::Ast1060Monitor; +pub use spi_monitor::Ast1060SpiMonitor; pub use spim_wiring::{ apply_spim_external_mux, apply_spim_pinctrl, apply_spim_wiring, apply_spim_wiring_with_log, bmc_spim_csin_levels, bmc_spim_path_debug, enable_flash_power, presets,
diff --git a/target/ast10x0/board/src/monitor.rs b/target/ast10x0/board/src/spi_monitor.rs similarity index 95% rename from target/ast10x0/board/src/monitor.rs rename to target/ast10x0/board/src/spi_monitor.rs index ae48623..62dfc72 100644 --- a/target/ast10x0/board/src/monitor.rs +++ b/target/ast10x0/board/src/spi_monitor.rs
@@ -3,7 +3,7 @@ //! Board-level SPI Monitor orchestration. //! -//! `Ast1060Monitor` is the concrete implementation of the `Monitor` trait, orchestrating +//! `Ast1060SpiMonitor` is the concrete implementation of the `Monitor` trait, orchestrating //! both SCU (for external mux control) and SPIPF (for enforcement, filtering, and locks). //! //! This layer ensures no duplication: mux control delegates to SCU routing, and SPIPF @@ -33,7 +33,7 @@ /// monitor.set_address_privilege(/*...*/)?; /// monitor.lock_policy(MonitorInstance::Spim0)?; /// ``` -pub struct Ast1060Monitor<'a> { +pub struct Ast1060SpiMonitor<'a> { scu: &'a mut ScuRegisters, spipf: &'a mut [SpiMonitorRegisters; 4], read_blocked_region_count: u8, @@ -41,7 +41,7 @@ write_blocked_region_count: u8, } -impl<'a> Ast1060Monitor<'a> { +impl<'a> Ast1060SpiMonitor<'a> { /// Create a new board-level Monitor with access to both SCU and SPIPF. pub fn new( scu: &'a mut ScuRegisters, @@ -125,7 +125,7 @@ } } -impl<'a> Monitor for Ast1060Monitor<'a> { +impl<'a> Monitor for Ast1060SpiMonitor<'a> { fn set_mux(&mut self, instance: MonitorInstance, mux: MuxSelect) -> BootResult<()> { // External mux selection is controlled via SCU0F0 register. // Delegate to SCU routing layer which has the actual register access. @@ -267,13 +267,13 @@ #[test] fn test_enforcement_flag() { - assert!(!Ast1060Monitor::is_enforcement_active(0)); - assert!(Ast1060Monitor::is_enforcement_active(1 << 4)); + assert!(!Ast1060SpiMonitor::is_enforcement_active(0)); + assert!(Ast1060SpiMonitor::is_enforcement_active(1 << 4)); } #[test] fn test_lock_flag() { - assert!(!Ast1060Monitor::is_policy_locked(0)); - assert!(Ast1060Monitor::is_policy_locked(1)); + assert!(!Ast1060SpiMonitor::is_policy_locked(0)); + assert!(Ast1060SpiMonitor::is_policy_locked(1)); } }