diff options
Diffstat (limited to 'firmware/target/arm/imx233/clkctrl-imx233.h')
-rw-r--r-- | firmware/target/arm/imx233/clkctrl-imx233.h | 76 |
1 files changed, 21 insertions, 55 deletions
diff --git a/firmware/target/arm/imx233/clkctrl-imx233.h b/firmware/target/arm/imx233/clkctrl-imx233.h index a15adb367e..ddd8bc9221 100644 --- a/firmware/target/arm/imx233/clkctrl-imx233.h +++ b/firmware/target/arm/imx233/clkctrl-imx233.h | |||
@@ -50,67 +50,33 @@ enum imx233_clock_t | |||
50 | CLK_XTAL, /* freq */ | 50 | CLK_XTAL, /* freq */ |
51 | CLK_EMI, /* freq, div, frac, bypass */ | 51 | CLK_EMI, /* freq, div, frac, bypass */ |
52 | CLK_XBUS, /* freq, div */ | 52 | CLK_XBUS, /* freq, div */ |
53 | CLK_FILT, /* enable */ | ||
54 | CLK_DRI, /* enable */ | ||
55 | CLK_PWM, /* enable */ | ||
56 | CLK_TIMROT, /* enable */ | ||
57 | CLK_UART, /* enable */ | ||
53 | }; | 58 | }; |
54 | 59 | ||
55 | enum imx233_xtal_clk_t | 60 | void imx233_clkctrl_init(void); |
56 | { | ||
57 | XTAL_FILT = 1 << 30, | ||
58 | XTAL_DRI = 1 << 28, | ||
59 | XTAL_TIMROT = 1 << 26, | ||
60 | XTAM_PWM = 1 << 29, | ||
61 | }; | ||
62 | |||
63 | /* Auto-Slow monitoring */ | ||
64 | enum imx233_as_monitor_t | ||
65 | { | ||
66 | AS_NONE = 0, /* Do not monitor any activity */ | ||
67 | AS_CPU_INSTR = 1 << 21, /* Monitor CPU instruction access to AHB */ | ||
68 | AS_CPU_DATA = 1 << 22, /* Monitor CPU data access to AHB */ | ||
69 | AS_TRAFFIC = 1 << 23, /* Monitor AHB master activity */ | ||
70 | AS_TRAFFIC_JAM = 1 << 24, /* Monitor AHB masters (>=3) activity */ | ||
71 | AS_APBXDMA = 1 << 25, /* Monitor APBX DMA activity */ | ||
72 | AS_APBHDMA = 1 << 26, /* Monitor APBH DMA activity */ | ||
73 | AS_PXP = 1 << 27, /* Monitor PXP activity */ | ||
74 | AS_DCP = 1 << 28, /* Monitor DCP activity */ | ||
75 | AS_ALL = 0xff << 21, /* Monitor all activity */ | ||
76 | }; | ||
77 | |||
78 | enum imx233_as_div_t | ||
79 | { | ||
80 | AS_DIV_1 = 0, | ||
81 | AS_DIV_2 = 1, | ||
82 | AS_DIV_4 = 2, | ||
83 | AS_DIV_8 = 3, | ||
84 | AS_DIV_16 = 4, | ||
85 | AS_DIV_32 = 5 | ||
86 | }; | ||
87 | |||
88 | /* can use a mask of clocks */ | ||
89 | void imx233_clkctrl_enable_xtal(enum imx233_xtal_clk_t xtal_clk, bool enable); | ||
90 | void imx233_clkctrl_is_xtal_enabled(enum imx233_xtal_clk_t xtal_clk, bool enable); | ||
91 | /* only use it for non-fractional clocks (ie not for IO) */ | 61 | /* only use it for non-fractional clocks (ie not for IO) */ |
92 | void imx233_clkctrl_enable_clock(enum imx233_clock_t clk, bool enable); | 62 | void imx233_clkctrl_enable(enum imx233_clock_t clk, bool enable); |
93 | bool imx233_clkctrl_is_clock_enabled(enum imx233_clock_t cl); | 63 | bool imx233_clkctrl_is_enabled(enum imx233_clock_t cl); |
94 | void imx233_clkctrl_set_clock_divisor(enum imx233_clock_t clk, int div); | 64 | void imx233_clkctrl_set_div(enum imx233_clock_t clk, int div); |
95 | int imx233_clkctrl_get_clock_divisor(enum imx233_clock_t clk); | 65 | int imx233_clkctrl_get_div(enum imx233_clock_t clk); |
96 | /* call with fracdiv=0 to disable it */ | 66 | /* call with fracdiv=0 to disable it */ |
97 | void imx233_clkctrl_set_fractional_divisor(enum imx233_clock_t clk, int fracdiv); | 67 | void imx233_clkctrl_set_frac_div(enum imx233_clock_t clk, int fracdiv); |
98 | /* 0 means fractional dividor disable */ | 68 | /* 0 means fractional dividor disable */ |
99 | int imx233_clkctrl_get_fractional_divisor(enum imx233_clock_t clk); | 69 | int imx233_clkctrl_get_frac_div(enum imx233_clock_t clk); |
100 | void imx233_clkctrl_set_bypass_pll(enum imx233_clock_t clk, bool bypass); | 70 | void imx233_clkctrl_set_bypass(enum imx233_clock_t clk, bool bypass); |
101 | bool imx233_clkctrl_get_bypass_pll(enum imx233_clock_t clk); | 71 | bool imx233_clkctrl_get_bypass(enum imx233_clock_t clk); |
102 | void imx233_clkctrl_enable_usb_pll(bool enable); | 72 | void imx233_clkctrl_enable_usb(bool enable); |
103 | bool imx233_clkctrl_is_usb_pll_enabled(void); | 73 | bool imx233_clkctrl_is_usb_enabled(void); |
104 | unsigned imx233_clkctrl_get_clock_freq(enum imx233_clock_t clk); | 74 | /* returns frequency in KHz */ |
105 | 75 | unsigned imx233_clkctrl_get_freq(enum imx233_clock_t clk); | |
106 | bool imx233_clkctrl_is_emi_sync_enabled(void); | 76 | /* auto-slow stuff */ |
107 | 77 | void imx233_clkctrl_set_auto_slow_div(unsigned div); | |
108 | void imx233_clkctrl_set_auto_slow_divisor(enum imx233_as_div_t div); | 78 | unsigned imx233_clkctrl_get_auto_slow_div(void); |
109 | enum imx233_as_div_t imx233_clkctrl_get_auto_slow_divisor(void); | ||
110 | void imx233_clkctrl_enable_auto_slow(bool enable); | 79 | void imx233_clkctrl_enable_auto_slow(bool enable); |
111 | bool imx233_clkctrl_is_auto_slow_enabled(void); | 80 | bool imx233_clkctrl_is_auto_slow_enabled(void); |
112 | /* can use a mask of clocks */ | ||
113 | void imx233_clkctrl_enable_auto_slow_monitor(enum imx233_as_monitor_t monitor, bool enable); | ||
114 | bool imx233_clkctrl_is_auto_slow_monitor_enabled(enum imx233_as_monitor_t monitor); | ||
115 | 81 | ||
116 | #endif /* CLKCTRL_IMX233_H */ | 82 | #endif /* CLKCTRL_IMX233_H */ |