@@ -50,20 +50,20 @@ use periph_helpers::{PreEnableParts, SPConfHelper};
5050use crate :: chips:: { ClockLimits , clock_limits} ;
5151use crate :: pac;
5252use crate :: pac:: cmc:: vals:: CkctrlCkmode ;
53- use crate :: pac:: scg:: vals:: { Erefs , Range , Scs , SirccsrLk , Sircerr , Sircvld , SosccsrLk , Soscerr } ;
54- #[ cfg( feature = "mcxa2xx" ) ]
5553use crate :: pac:: scg:: vals:: {
56- Fircacc , FircaccIe , FirccsrLk , Fircerr , FircerrIe , Fircsten , Fircvld , FreqSel , Source , SpllLock , SpllcsrLk ,
57- Spllerr , Spllsten , TrimUnlock ,
54+ Erefs , Range , Scs , SirccsrLk , Sircerr , Sircvld , SosccsrLk , Soscerr , Source , SpllLock , SpllcsrLk , Spllerr , Spllsten ,
55+ TrimUnlock ,
5856} ;
57+ #[ cfg( feature = "mcxa2xx" ) ]
58+ use crate :: pac:: scg:: vals:: { Fircacc , FircaccIe , FirccsrLk , Fircerr , FircerrIe , Fircsten , Fircvld , FreqSel } ;
5959use crate :: pac:: spc:: vals:: {
6060 ActiveCfgBgmode , ActiveCfgCoreldoVddDs , ActiveCfgCoreldoVddLvl , LpCfgBgmode , LpCfgCoreldoVddLvl , Vsm ,
6161} ;
62- use crate :: pac:: syscon:: vals:: { AhbclkdivUnstab , FrolfdivHalt , FrolfdivReset , FrolfdivUnstab } ;
63- #[ cfg( feature = "mcxa2xx" ) ]
6462use crate :: pac:: syscon:: vals:: {
65- FrohfdivHalt , FrohfdivReset , FrohfdivUnstab , Pll1clkdivHalt , Pll1clkdivReset , Pll1clkdivUnstab ,
63+ AhbclkdivUnstab , FrolfdivHalt , FrolfdivReset , FrolfdivUnstab , Pll1clkdivHalt , Pll1clkdivReset , Pll1clkdivUnstab ,
6664} ;
65+ #[ cfg( feature = "mcxa2xx" ) ]
66+ use crate :: pac:: syscon:: vals:: { FrohfdivHalt , FrohfdivReset , FrohfdivUnstab } ;
6767pub mod config;
6868pub mod periph_helpers;
6969
@@ -134,7 +134,6 @@ pub fn init(settings: ClocksConfig) -> Result<(), ClockError> {
134134
135135 #[ cfg( not( feature = "sosc-as-gpio" ) ) ]
136136 operator. configure_sosc ( ) ?;
137- #[ cfg( feature = "mcxa2xx" ) ]
138137 operator. configure_spll ( ) ?;
139138
140139 // Finally, setup main clock
@@ -314,7 +313,6 @@ unsafe fn restart_active_only_clocks(_cs: &CriticalSection) {
314313 }
315314
316315 // Ensure SPLL is up and running
317- #[ cfg( feature = "mcxa2xx" ) ]
318316 if let Some ( spll) = clocks. pll1_clk . as_ref ( )
319317 && !matches ! ( spll. power, PoweredClock :: AlwaysEnabled )
320318 {
@@ -490,11 +488,9 @@ pub struct Clocks {
490488 pub cpu_system_clk : Option < Clock > ,
491489
492490 /// `pll1_clk` is the output of the main system PLL, `pll1`.
493- #[ cfg( feature = "mcxa2xx" ) ]
494491 pub pll1_clk : Option < Clock > ,
495492
496493 /// `pll1_clk_div` is a configurable frequency clock, sourced from `pll1_clk`
497- #[ cfg( feature = "mcxa2xx" ) ]
498494 pub pll1_clk_div : Option < Clock > ,
499495}
500496
@@ -871,14 +867,12 @@ impl Clocks {
871867 }
872868
873869 /// Ensure the `pll1_clk` clock is active and valid at the given power state.
874- #[ cfg( feature = "mcxa2xx" ) ]
875870 #[ inline]
876871 pub fn ensure_pll1_clk_active ( & self , at_level : & PoweredClock ) -> Result < u32 , ClockError > {
877872 self . ensure_clock_active ( & self . pll1_clk , "pll1_clk" , at_level)
878873 }
879874
880875 /// Ensure the `pll1_clk_div` clock is active and valid at the given power state.
881- #[ cfg( feature = "mcxa2xx" ) ]
882876 #[ inline]
883877 pub fn ensure_pll1_clk_div_active ( & self , at_level : & PoweredClock ) -> Result < u32 , ClockError > {
884878 self . ensure_clock_active ( & self . pll1_clk_div , "pll1_clk_div" , at_level)
@@ -1706,7 +1700,6 @@ impl ClockOperator<'_> {
17061700 Ok ( ( ) )
17071701 }
17081702
1709- #[ cfg( feature = "mcxa2xx" ) ]
17101703 fn configure_spll ( & mut self ) -> Result < ( ) , ClockError > {
17111704 // # Vocab
17121705 //
@@ -1740,6 +1733,7 @@ impl ClockOperator<'_> {
17401733 . as_ref ( )
17411734 . map ( |c| ( c, Source :: SOSC ) )
17421735 . ok_or ( "sosc not active" ) ,
1736+ #[ cfg( feature = "mcxa2xx" ) ]
17431737 config:: SpllSource :: Firc => self
17441738 . clocks
17451739 . clk_45m
@@ -2094,7 +2088,6 @@ impl ClockOperator<'_> {
20942088 MainClockSource :: RoscFro16K => ( Scs :: ROSC , "fro16k" , self . clocks . clk_16k_vdd_core . as_ref ( ) ) ,
20952089 #[ cfg( all( feature = "mcxa5xx" , not( feature = "rosc-32k-as-gpio" ) ) ) ]
20962090 MainClockSource :: RoscOsc32K => ( Scs :: ROSC , "osc32k" , self . clocks . clk_32k_vdd_core . as_ref ( ) ) ,
2097- #[ cfg( feature = "mcxa2xx" ) ]
20982091 MainClockSource :: SPll1 => ( Scs :: SPLL , "pll1_clk" , self . clocks . pll1_clk . as_ref ( ) ) ,
20992092 } ;
21002093 let Some ( main_clk_src) = clk else {
0 commit comments