19 #define L4_34XX_BASE 0x48000000
21 #include <linux/types.h>
39 #define OMAP_SSI_OFFSET 0x58000
40 #define OMAP_SSI_SIZE 0x1000
41 #define OMAP_SSI_SYSCONFIG_OFFSET 0x10
43 #define SSI_AUTOIDLE (1 << 0)
44 #define SSI_SIDLE_SMARTIDLE (2 << 3)
45 #define SSI_MIDLE_NOIDLE (1 << 12)
55 #define DMT_ID(id) ((id) + 4)
56 #define DM_TIMER_CLOCKS 4
59 #define MCBSP_ID(id) ((id) - 6)
73 static u32 dsp_clocks;
77 return clk & (1 <<
id);
80 static inline void set_dsp_clk_active(
u32 *
clk,
u8 id)
85 static inline void set_dsp_clk_inactive(
u32 *
clk,
u8 id)
90 static s8 get_clk_type(
u8 id)
145 iva2_clk =
clk_get(&dspbridge_device.
dev,
"iva2_ck");
146 if (IS_ERR(iva2_clk))
153 if (IS_ERR(
ssi.sst_fck) || IS_ERR(
ssi.ssr_fck) || IS_ERR(
ssi.ick))
154 dev_err(
bridge,
"failed to get ssi: sst %p, ssr %p, ick %p\n",
190 pr_err(
"%s: GPTimer interrupt failed\n", __func__);
206 if (is_dsp_clk_active(dsp_clocks, clk_id)) {
207 dev_err(
bridge,
"WARN: clock id %d already enabled\n", clk_id);
211 switch (get_clk_type(clk_id)) {
218 #ifdef CONFIG_OMAP_MCBSP
225 dev_err(
bridge,
"ERROR: DSP requested to enable WDT3 clk\n");
247 set_dsp_clk_active(&dsp_clocks, clk_id);
265 if (is_dsp_clk_active(dsp_per_clocks, clk_id))
282 if (!is_dsp_clk_active(dsp_clocks, clk_id)) {
283 dev_err(
bridge,
"ERR: clock id %d already disabled\n", clk_id);
287 switch (get_clk_type(clk_id)) {
294 #ifdef CONFIG_OMAP_MCBSP
301 dev_err(
bridge,
"ERROR: DSP requested to disable WDT3 clk\n");
316 set_dsp_clk_inactive(&dsp_clocks, clk_id);
336 if (is_dsp_clk_active(dsp_per_clocks, clk_id))
348 clk_speed_khz /= 1000;
349 dev_dbg(
bridge,
"%s: clk speed Khz = %d\n", __func__, clk_speed_khz);
351 return clk_speed_khz;
361 pr_err(
"%s: error, SSI not configured\n", __func__);