summaryrefslogtreecommitdiffstats
path: root/firmware
diff options
context:
space:
mode:
Diffstat (limited to 'firmware')
-rw-r--r--firmware/target/arm/imx233/clkctrl-imx233.c9
-rw-r--r--firmware/target/arm/imx233/clkctrl-imx233.h5
2 files changed, 10 insertions, 4 deletions
diff --git a/firmware/target/arm/imx233/clkctrl-imx233.c b/firmware/target/arm/imx233/clkctrl-imx233.c
index ccccaae59d..cfee4aea37 100644
--- a/firmware/target/arm/imx233/clkctrl-imx233.c
+++ b/firmware/target/arm/imx233/clkctrl-imx233.c
@@ -103,7 +103,9 @@ void imx233_clkctrl_set_clock_divisor(enum imx233_clock_t clk, int div)
__FIELD_SET(HW_CLKCTRL_EMI, DIV_EMI, div);
break;
case CLK_HBUS:
- __FIELD_SET(HW_CLKCTRL_HBUS, DIV, div);
+ /* disable frac enable at the same time */
+ HW_CLKCTRL_HBUS = div << HW_CLKCTRL_HBUS__DIV_BP |
+ (HW_CLKCTRL_HBUS & ~(HW_CLKCTRL_HBUS__DIV_FRAC_EN | HW_CLKCTRL_HBUS__DIV_BM));
break;
case CLK_XBUS:
__FIELD_SET(HW_CLKCTRL_XBUS, DIV, div);
@@ -137,8 +139,9 @@ void imx233_clkctrl_set_fractional_divisor(enum imx233_clock_t clk, int fracdiv)
switch(clk)
{
case CLK_HBUS:
- __FIELD_SET(HW_CLKCTRL_HBUS, DIV, fracdiv);
- __REG_SET(HW_CLKCTRL_HBUS) = HW_CLKCTRL_HBUS__DIV_FRAC_EN;
+ /* set frac enable at the same time */
+ HW_CLKCTRL_HBUS = fracdiv << HW_CLKCTRL_HBUS__DIV_BP | HW_CLKCTRL_HBUS__DIV_FRAC_EN |
+ (HW_CLKCTRL_HBUS & ~HW_CLKCTRL_HBUS__DIV_BM);
return;
case CLK_PIX: REG = &HW_CLKCTRL_FRAC_PIX; break;
case CLK_IO: REG = &HW_CLKCTRL_FRAC_IO; break;
diff --git a/firmware/target/arm/imx233/clkctrl-imx233.h b/firmware/target/arm/imx233/clkctrl-imx233.h
index ec3412d0f3..665674108c 100644
--- a/firmware/target/arm/imx233/clkctrl-imx233.h
+++ b/firmware/target/arm/imx233/clkctrl-imx233.h
@@ -124,7 +124,7 @@ enum imx233_clock_t
CLK_HBUS, /* freq, div, frac */
CLK_PLL, /* freq, enable */
CLK_XTAL, /* freq */
- CLK_EMI, /* freq, div, frac, bypass (NOTE: don't modify directly EMI) */
+ CLK_EMI, /* freq, div, frac, bypass */
CLK_XBUS, /* freq, div */
};
@@ -139,6 +139,7 @@ enum imx233_xtal_clk_t
/* Auto-Slow monitoring */
enum imx233_as_monitor_t
{
+ AS_NONE = 0, /* Do not monitor any activity */
AS_CPU_INSTR = 1 << 21, /* Monitor CPU instruction access to AHB */
AS_CPU_DATA = 1 << 22, /* Monitor CPU data access to AHB */
AS_TRAFFIC = 1 << 23, /* Monitor AHB master activity */
@@ -147,6 +148,7 @@ enum imx233_as_monitor_t
AS_APBHDMA = 1 << 26, /* Monitor APBH DMA activity */
AS_PXP = 1 << 27, /* Monitor PXP activity */
AS_DCP = 1 << 28, /* Monitor DCP activity */
+ AS_ALL = 0xff << 21, /* Monitor all activity */
};
enum imx233_as_div_t
@@ -183,6 +185,7 @@ void imx233_clkctrl_set_auto_slow_divisor(enum imx233_as_div_t div);
enum imx233_as_div_t imx233_clkctrl_get_auto_slow_divisor(void);
void imx233_clkctrl_enable_auto_slow(bool enable);
bool imx233_clkctrl_is_auto_slow_enabled(void);
+/* can use a mask of clocks */
void imx233_clkctrl_enable_auto_slow_monitor(enum imx233_as_monitor_t monitor, bool enable);
bool imx233_clkctrl_is_auto_slow_monitor_enabled(enum imx233_as_monitor_t monitor);