36 static u32 ul_ext_base;
37 static u32 ul_ext_end;
40 static u32 ul_dyn_ext_base;
41 static u32 ul_trace_sec_beg;
42 static u32 ul_trace_sec_end;
43 static u32 ul_shm_base_virt;
52 u8 *host_buff,
u32 dsp_addr,
58 u32 ul_tlb_base_virt = 0;
59 u32 ul_shm_offset_virt = 0;
60 u32 dw_ext_prog_virt_mem;
62 bool trace_read =
false;
64 if (!ul_shm_base_virt) {
70 if (!status && !ul_trace_sec_beg) {
75 if (!status && !ul_trace_sec_end) {
81 if ((dsp_addr <= ul_trace_sec_end) &&
82 (dsp_addr >= ul_trace_sec_beg))
87 if (trace_read && dw_base_addr) {
98 if (!status && !ul_dyn_ext_base) {
116 ul_ext_base = ul_shm_base_virt;
117 ul_ext_end = ul_trace_sec_end;
121 if (ul_ext_end < ul_ext_base)
127 dw_ext_prog_virt_mem =
132 ul_shm_base_virt - ul_tlb_base_virt;
133 ul_shm_offset_virt +=
136 dw_ext_prog_virt_mem -= ul_shm_offset_virt;
137 dw_ext_prog_virt_mem +=
138 (ul_ext_base - ul_dyn_ext_base);
140 dw_ext_prog_virt_mem;
150 dw_base_addr = dw_ext_prog_virt_mem;
154 if (!dw_base_addr || !ul_ext_base || !ul_ext_end)
157 offset = dsp_addr - ul_ext_base;
160 memcpy(host_buff, (
u8 *) dw_base_addr + offset, ul_num_bytes);
171 u8 *host_buff,
u32 dsp_addr,
u32 ul_num_bytes,
187 if (offset < base1) {
193 offset = offset -
base2;
198 offset = offset -
base3;
203 memcpy((
u8 *) (dw_base_addr + offset), host_buff, ul_num_bytes);
205 *((
u32 *) host_buff) = dw_base_addr +
offset;
217 u8 *host_buff,
u32 dsp_addr,
223 u8 temp_byte1, temp_byte2;
227 u32 dw_ext_prog_virt_mem;
228 u32 ul_tlb_base_virt = 0;
229 u32 ul_shm_offset_virt = 0;
231 bool trace_load =
false;
245 if ((dsp_addr <= ul_trace_sec_end) &&
246 (dsp_addr >= ul_trace_sec_beg))
251 if ((dynamic_load || trace_load) && dw_base_addr) {
298 ul_ext_base = ul_shm_base_virt;
300 if (ul_ext_end < ul_ext_base)
319 ul_shm_base_virt - ul_tlb_base_virt;
321 dw_ext_prog_virt_mem =
324 dw_ext_prog_virt_mem = host_res->
mem_base[1];
325 dw_ext_prog_virt_mem +=
326 (ul_ext_base - ul_dyn_ext_base);
331 dw_ext_prog_virt_mem,
332 ul_ext_end - ul_ext_base);
340 if (!dw_base_addr || !ul_ext_base || !ul_ext_end)
344 for (i = 0; i < 4; i++)
345 remain_byte[i] = 0x0;
347 dw_offset = dsp_addr - ul_ext_base;
349 if (dsp_addr > ul_ext_end || dw_offset > dsp_addr)
354 memcpy((
u8 *) dw_base_addr + dw_offset, host_buff,
357 *((
u32 *) host_buff) = dw_base_addr + dw_offset;
371 #ifdef CONFIG_TIDSPBRIDGE_DVFS
380 if (!dev_context->
mbox)
388 #ifdef CONFIG_TIDSPBRIDGE_DVFS
391 if (opplevel == VDD1_OPP1) {
419 omap_mbox_restore_ctx(dev_context->
mbox);
433 pr_err(
"omap_mbox_msg_send Fail and status = %d\n", status);