diff options
author | Solomon Peachy <pizza@shaftnet.org> | 2025-01-08 08:03:17 -0500 |
---|---|---|
committer | Solomon Peachy <pizza@shaftnet.org> | 2025-01-08 08:04:25 -0500 |
commit | f1173e07ecee8141e0f3c80190a9ff53f13ee307 (patch) | |
tree | 00fd3ab869e6c90561db61751297ebb9a5e88ccd | |
parent | 4cd0c35150eea6e0652b7598dbd004a449305f8e (diff) | |
download | rockbox-f1173e07ec.tar.gz rockbox-f1173e07ec.zip |
imx233: Fix clkctrl for STMP3600 variants (creativezenv)
Change-Id: Ia8f0ce13cdf7dcbf1339bb7648f7a99822f74017
-rw-r--r-- | firmware/target/arm/imx233/clkctrl-imx233.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/firmware/target/arm/imx233/clkctrl-imx233.c b/firmware/target/arm/imx233/clkctrl-imx233.c index 1a8f523d5a..d0feabb0a5 100644 --- a/firmware/target/arm/imx233/clkctrl-imx233.c +++ b/firmware/target/arm/imx233/clkctrl-imx233.c @@ -88,8 +88,12 @@ void imx233_clkctrl_set_div(enum imx233_clock_t clk, int div) #endif case CLK_SSP: BF_WR(CLKCTRL_SSP, DIV(div)); break; case CLK_HBUS: +#if IMX233_SUBTARGET >= 3700 /* make sure to switch to integer divide mode simulteanously */ BF_WR(CLKCTRL_HBUS, DIV_FRAC_EN(0), DIV(div)); break; +#else + BF_WR(CLKCTRL_HBUS, DIV(div)); break; +#endif case CLK_XBUS: BF_WR(CLKCTRL_XBUS, DIV(div)); break; default: return; } @@ -111,9 +115,11 @@ int imx233_clkctrl_get_div(enum imx233_clock_t clk) case CLK_SSP: return BF_RD(CLKCTRL_SSP, DIV); case CLK_HBUS: /* since fractional and integer divider share the same field, clain it is disabled in frac mode */ +#if IMX233_SUBTARGET >= 3700 if(BF_RD(CLKCTRL_HBUS, DIV_FRAC_EN)) return 0; else +#endif return BF_RD(CLKCTRL_HBUS, DIV); case CLK_XBUS: return BF_RD(CLKCTRL_XBUS, DIV); default: return 0; @@ -143,7 +149,11 @@ void imx233_clkctrl_set_frac_div(enum imx233_clock_t clk, int fracdiv) /* value 0 is forbidden because we can't simply disabble the divider, it's always * active but either in integer or fractional mode * make sure we write both the value and frac_en bit at the same time */ +#if IMX233_SUBTARGET >= 3700 BF_WR(CLKCTRL_HBUS, DIV_FRAC_EN(1), DIV(fracdiv)); +#else + BF_WR(CLKCTRL_HBUS, DIV(fracdiv)); +#endif break; default: break; } |