Lines Matching refs:pao

145 static u16 adapter_boot_load_dsp(struct hpi_adapter_obj *pao,
148 static u16 message_response_sequence(struct hpi_adapter_obj *pao,
151 static void hw_message(struct hpi_adapter_obj *pao, struct hpi_message *phm,
158 static void adapter_delete(struct hpi_adapter_obj *pao,
161 static u16 create_adapter_obj(struct hpi_adapter_obj *pao,
164 static void delete_adapter_obj(struct hpi_adapter_obj *pao);
166 static void outstream_host_buffer_allocate(struct hpi_adapter_obj *pao,
169 static void outstream_host_buffer_get_info(struct hpi_adapter_obj *pao,
172 static void outstream_host_buffer_free(struct hpi_adapter_obj *pao,
174 static void outstream_write(struct hpi_adapter_obj *pao,
177 static void outstream_get_info(struct hpi_adapter_obj *pao,
180 static void outstream_start(struct hpi_adapter_obj *pao,
183 static void outstream_open(struct hpi_adapter_obj *pao,
186 static void outstream_reset(struct hpi_adapter_obj *pao,
189 static void instream_host_buffer_allocate(struct hpi_adapter_obj *pao,
192 static void instream_host_buffer_get_info(struct hpi_adapter_obj *pao,
195 static void instream_host_buffer_free(struct hpi_adapter_obj *pao,
198 static void instream_read(struct hpi_adapter_obj *pao,
201 static void instream_get_info(struct hpi_adapter_obj *pao,
204 static void instream_start(struct hpi_adapter_obj *pao,
207 static u32 boot_loader_read_mem32(struct hpi_adapter_obj *pao, int dsp_index,
210 static void boot_loader_write_mem32(struct hpi_adapter_obj *pao,
213 static u16 boot_loader_config_emif(struct hpi_adapter_obj *pao,
216 static u16 boot_loader_test_memory(struct hpi_adapter_obj *pao, int dsp_index,
219 static u16 boot_loader_test_internal_memory(struct hpi_adapter_obj *pao,
222 static u16 boot_loader_test_external_memory(struct hpi_adapter_obj *pao,
225 static u16 boot_loader_test_pld(struct hpi_adapter_obj *pao, int dsp_index);
229 static void subsys_message(struct hpi_adapter_obj *pao, in subsys_message() argument
242 static void control_message(struct hpi_adapter_obj *pao, in control_message() argument
246 struct hpi_hw_obj *phw = pao->priv; in control_message()
251 if (pao->has_control_cache) { in control_message()
260 hw_message(pao, phm, phr); in control_message()
265 hw_message(pao, phm, phr); in control_message()
268 hw_message(pao, phm, phr); in control_message()
269 if (pao->has_control_cache) in control_message()
279 static void adapter_message(struct hpi_adapter_obj *pao, in adapter_message() argument
284 adapter_delete(pao, phm, phr); in adapter_message()
288 hw_message(pao, phm, phr); in adapter_message()
293 static void outstream_message(struct hpi_adapter_obj *pao, in outstream_message() argument
308 outstream_write(pao, phm, phr); in outstream_message()
311 outstream_get_info(pao, phm, phr); in outstream_message()
314 outstream_host_buffer_allocate(pao, phm, phr); in outstream_message()
317 outstream_host_buffer_get_info(pao, phm, phr); in outstream_message()
320 outstream_host_buffer_free(pao, phm, phr); in outstream_message()
323 outstream_start(pao, phm, phr); in outstream_message()
326 outstream_open(pao, phm, phr); in outstream_message()
329 outstream_reset(pao, phm, phr); in outstream_message()
332 hw_message(pao, phm, phr); in outstream_message()
337 static void instream_message(struct hpi_adapter_obj *pao, in instream_message() argument
352 instream_read(pao, phm, phr); in instream_message()
355 instream_get_info(pao, phm, phr); in instream_message()
358 instream_host_buffer_allocate(pao, phm, phr); in instream_message()
361 instream_host_buffer_get_info(pao, phm, phr); in instream_message()
364 instream_host_buffer_free(pao, phm, phr); in instream_message()
367 instream_start(pao, phm, phr); in instream_message()
370 hw_message(pao, phm, phr); in instream_message()
380 void _HPI_6205(struct hpi_adapter_obj *pao, struct hpi_message *phm, in _HPI_6205() argument
383 if (pao && (pao->dsp_crashed >= 10) in _HPI_6205()
402 subsys_message(pao, phm, phr); in _HPI_6205()
406 adapter_message(pao, phm, phr); in _HPI_6205()
410 control_message(pao, phm, phr); in _HPI_6205()
414 outstream_message(pao, phm, phr); in _HPI_6205()
418 instream_message(pao, phm, phr); in _HPI_6205()
422 hw_message(pao, phm, phr); in _HPI_6205()
435 struct hpi_adapter_obj *pao = NULL; in HPI_6205() local
439 pao = hpi_find_adapter(phm->adapter_index); in HPI_6205()
446 if (pao) in HPI_6205()
447 _HPI_6205(pao, phm, phr); in HPI_6205()
500 static void adapter_delete(struct hpi_adapter_obj *pao, in adapter_delete() argument
505 if (!pao) { in adapter_delete()
509 phw = pao->priv; in adapter_delete()
512 boot_loader_write_mem32(pao, 0, C6205_BAR0_TIMER1_CTL, 0); in adapter_delete()
516 delete_adapter_obj(pao); in adapter_delete()
517 hpi_delete_adapter(pao); in adapter_delete()
524 static u16 create_adapter_obj(struct hpi_adapter_obj *pao, in create_adapter_obj() argument
527 struct hpi_hw_obj *phw = pao->priv; in create_adapter_obj()
534 pao->dsp_crashed = 0; in create_adapter_obj()
541 pao->pci.ap_mem_base[1] + in create_adapter_obj()
542 C6205_BAR1_HSR / sizeof(*pao->pci.ap_mem_base[1]); in create_adapter_obj()
544 pao->pci.ap_mem_base[1] + in create_adapter_obj()
545 C6205_BAR1_HDCR / sizeof(*pao->pci.ap_mem_base[1]); in create_adapter_obj()
547 pao->pci.ap_mem_base[1] + in create_adapter_obj()
548 C6205_BAR1_DSPP / sizeof(*pao->pci.ap_mem_base[1]); in create_adapter_obj()
550 pao->has_control_cache = 0; in create_adapter_obj()
554 pao->pci.pci_dev)) in create_adapter_obj()
569 err = adapter_boot_load_dsp(pao, pos_error_code); in create_adapter_obj()
598 pao->pci.pci_dev); in create_adapter_obj()
624 pao->has_control_cache = 1; in create_adapter_obj()
628 pao->has_control_cache = 0; in create_adapter_obj()
649 err = message_response_sequence(pao, &hm, &hr); in create_adapter_obj()
658 pao->type = hr.u.ax.info.adapter_type; in create_adapter_obj()
659 pao->index = hr.u.ax.info.adapter_index; in create_adapter_obj()
672 phw->p_cache->adap_idx = pao->index; in create_adapter_obj()
676 return hpi_add_adapter(pao); in create_adapter_obj()
683 static void delete_adapter_obj(struct hpi_adapter_obj *pao) in delete_adapter_obj() argument
685 struct hpi_hw_obj *phw = pao->priv; in delete_adapter_obj()
722 static void outstream_host_buffer_allocate(struct hpi_adapter_obj *pao, in outstream_host_buffer_allocate() argument
727 struct hpi_hw_obj *phw = pao->priv; in outstream_host_buffer_allocate()
759 pao->pci.pci_dev); in outstream_host_buffer_allocate()
812 hw_message(pao, phm, phr); in outstream_host_buffer_allocate()
824 static void outstream_host_buffer_get_info(struct hpi_adapter_obj *pao, in outstream_host_buffer_get_info() argument
827 struct hpi_hw_obj *phw = pao->priv; in outstream_host_buffer_get_info()
853 static void outstream_host_buffer_free(struct hpi_adapter_obj *pao, in outstream_host_buffer_free() argument
856 struct hpi_hw_obj *phw = pao->priv; in outstream_host_buffer_free()
863 hw_message(pao, phm, phr); in outstream_host_buffer_free()
885 static void outstream_write(struct hpi_adapter_obj *pao, in outstream_write() argument
888 struct hpi_hw_obj *phw = pao->priv; in outstream_write()
895 hw_message(pao, phm, phr); in outstream_write()
950 hw_message(pao, phm, phr); /* send the format to the DSP */ in outstream_write()
959 static void outstream_get_info(struct hpi_adapter_obj *pao, in outstream_get_info() argument
962 struct hpi_hw_obj *phw = pao->priv; in outstream_get_info()
967 hw_message(pao, phm, phr); in outstream_get_info()
985 static void outstream_start(struct hpi_adapter_obj *pao, in outstream_start() argument
988 hw_message(pao, phm, phr); in outstream_start()
991 static void outstream_reset(struct hpi_adapter_obj *pao, in outstream_reset() argument
994 struct hpi_hw_obj *phw = pao->priv; in outstream_reset()
996 hw_message(pao, phm, phr); in outstream_reset()
999 static void outstream_open(struct hpi_adapter_obj *pao, in outstream_open() argument
1002 outstream_reset(pao, phm, phr); in outstream_open()
1008 static void instream_host_buffer_allocate(struct hpi_adapter_obj *pao, in instream_host_buffer_allocate() argument
1013 struct hpi_hw_obj *phw = pao->priv; in instream_host_buffer_allocate()
1041 pao->pci.pci_dev); in instream_host_buffer_allocate()
1089 hw_message(pao, phm, phr); in instream_host_buffer_allocate()
1101 static void instream_host_buffer_get_info(struct hpi_adapter_obj *pao, in instream_host_buffer_get_info() argument
1104 struct hpi_hw_obj *phw = pao->priv; in instream_host_buffer_get_info()
1130 static void instream_host_buffer_free(struct hpi_adapter_obj *pao, in instream_host_buffer_free() argument
1133 struct hpi_hw_obj *phw = pao->priv; in instream_host_buffer_free()
1140 hw_message(pao, phm, phr); in instream_host_buffer_free()
1158 static void instream_start(struct hpi_adapter_obj *pao, in instream_start() argument
1161 hw_message(pao, phm, phr); in instream_start()
1169 static void instream_read(struct hpi_adapter_obj *pao, in instream_read() argument
1172 struct hpi_hw_obj *phw = pao->priv; in instream_read()
1181 hw_message(pao, phm, phr); in instream_read()
1220 static void instream_get_info(struct hpi_adapter_obj *pao, in instream_get_info() argument
1223 struct hpi_hw_obj *phw = pao->priv; in instream_get_info()
1227 hw_message(pao, phm, phr); in instream_get_info()
1249 static u16 adapter_boot_load_dsp(struct hpi_adapter_obj *pao, in adapter_boot_load_dsp() argument
1252 struct hpi_hw_obj *phw = pao->priv; in adapter_boot_load_dsp()
1261 boot_code_id[1] = pao->pci.pci_dev->subsystem_device; in adapter_boot_load_dsp()
1334 boot_loader_write_mem32(pao, 0, (0x018C0024L), 0x00002202); in adapter_boot_load_dsp()
1337 boot_loader_write_mem32(pao, 0, C6205_BAR0_TIMER1_CTL, 0); in adapter_boot_load_dsp()
1340 boot_loader_read_mem32(pao, 0, 0); in adapter_boot_load_dsp()
1344 boot_loader_write_mem32(pao, 0, C6205_BAR0_TIMER1_CTL, 4); in adapter_boot_load_dsp()
1353 err = boot_loader_config_emif(pao, dsp); in adapter_boot_load_dsp()
1357 err = boot_loader_test_internal_memory(pao, dsp); in adapter_boot_load_dsp()
1361 err = boot_loader_test_external_memory(pao, dsp); in adapter_boot_load_dsp()
1365 err = boot_loader_test_pld(pao, dsp); in adapter_boot_load_dsp()
1370 err = hpi_dsp_code_open(boot_code_id[dsp], pao->pci.pci_dev, in adapter_boot_load_dsp()
1398 boot_loader_write_mem32(pao, dsp, address, in adapter_boot_load_dsp()
1403 boot_loader_read_mem32(pao, dsp, in adapter_boot_load_dsp()
1433 data = boot_loader_read_mem32(pao, dsp, in adapter_boot_load_dsp()
1473 boot_loader_write_mem32(pao, 0, in adapter_boot_load_dsp()
1477 boot_loader_read_mem32(pao, 0, in adapter_boot_load_dsp()
1501 static u32 boot_loader_read_mem32(struct hpi_adapter_obj *pao, int dsp_index, in boot_loader_read_mem32() argument
1504 struct hpi_hw_obj *phw = pao->priv; in boot_loader_read_mem32()
1512 p_data = pao->pci.ap_mem_base[1] + in boot_loader_read_mem32()
1514 sizeof(*pao->pci.ap_mem_base[1]); in boot_loader_read_mem32()
1527 p_data = pao->pci.ap_mem_base[0] + in boot_loader_read_mem32()
1534 boot_loader_write_mem32(pao, 0, HPIAL_ADDR, address); in boot_loader_read_mem32()
1535 boot_loader_write_mem32(pao, 0, HPIAH_ADDR, address >> 16); in boot_loader_read_mem32()
1536 lsb = boot_loader_read_mem32(pao, 0, HPIDL_ADDR); in boot_loader_read_mem32()
1537 data = boot_loader_read_mem32(pao, 0, HPIDH_ADDR); in boot_loader_read_mem32()
1543 static void boot_loader_write_mem32(struct hpi_adapter_obj *pao, in boot_loader_write_mem32() argument
1546 struct hpi_hw_obj *phw = pao->priv; in boot_loader_write_mem32()
1555 p_data = pao->pci.ap_mem_base[1] + in boot_loader_write_mem32()
1557 sizeof(*pao->pci.ap_mem_base[1]); in boot_loader_write_mem32()
1569 p_data = pao->pci.ap_mem_base[0] + in boot_loader_write_mem32()
1575 boot_loader_write_mem32(pao, 0, HPIAL_ADDR, address); in boot_loader_write_mem32()
1576 boot_loader_write_mem32(pao, 0, HPIAH_ADDR, address >> 16); in boot_loader_write_mem32()
1579 boot_loader_read_mem32(pao, 0, 0); in boot_loader_write_mem32()
1581 boot_loader_write_mem32(pao, 0, HPIDL_ADDR, data); in boot_loader_write_mem32()
1582 boot_loader_write_mem32(pao, 0, HPIDH_ADDR, data >> 16); in boot_loader_write_mem32()
1585 boot_loader_read_mem32(pao, 0, 0); in boot_loader_write_mem32()
1589 static u16 boot_loader_config_emif(struct hpi_adapter_obj *pao, int dsp_index) in boot_loader_config_emif() argument
1604 boot_loader_write_mem32(pao, dsp_index, 0x01800000, 0x3779); in boot_loader_config_emif()
1615 boot_loader_write_mem32(pao, dsp_index, 0x01800008, setting); in boot_loader_config_emif()
1616 if (setting != boot_loader_read_mem32(pao, dsp_index, in boot_loader_config_emif()
1628 boot_loader_write_mem32(pao, dsp_index, 0x01800004, setting); in boot_loader_config_emif()
1629 if (setting != boot_loader_read_mem32(pao, dsp_index, in boot_loader_config_emif()
1640 boot_loader_write_mem32(pao, dsp_index, 0x01800010, setting); in boot_loader_config_emif()
1641 if (setting != boot_loader_read_mem32(pao, dsp_index, in boot_loader_config_emif()
1651 boot_loader_write_mem32(pao, dsp_index, 0x01800014, setting); in boot_loader_config_emif()
1652 if (setting != boot_loader_read_mem32(pao, dsp_index, in boot_loader_config_emif()
1658 boot_loader_write_mem32(pao, dsp_index, 0x01800018, in boot_loader_config_emif()
1663 boot_loader_write_mem32(pao, dsp_index, 0x0180001C, in boot_loader_config_emif()
1672 boot_loader_write_mem32(pao, 0, HPICL_ADDR, write_data); in boot_loader_config_emif()
1673 boot_loader_write_mem32(pao, 0, HPICH_ADDR, write_data); in boot_loader_config_emif()
1676 0xFFF7 & boot_loader_read_mem32(pao, 0, HPICL_ADDR); in boot_loader_config_emif()
1685 boot_loader_write_mem32(pao, 0, HPIAL_ADDR, in boot_loader_config_emif()
1687 boot_loader_write_mem32(pao, 0, HPIAH_ADDR, in boot_loader_config_emif()
1690 0xFFFF & boot_loader_read_mem32(pao, 0, in boot_loader_config_emif()
1694 boot_loader_read_mem32(pao, 0, in boot_loader_config_emif()
1713 boot_loader_write_mem32(pao, dsp_index, 0x01B7C100, 0x0000); in boot_loader_config_emif()
1716 boot_loader_write_mem32(pao, dsp_index, 0x01B7C120, 0x8002); in boot_loader_config_emif()
1718 boot_loader_write_mem32(pao, dsp_index, 0x01B7C11C, 0x8001); in boot_loader_config_emif()
1720 boot_loader_write_mem32(pao, dsp_index, 0x01B7C118, 0x8000); in boot_loader_config_emif()
1725 boot_loader_write_mem32(pao, 0, (0x018C0024L), 0x00002A0A); in boot_loader_config_emif()
1727 boot_loader_write_mem32(pao, dsp_index, 0x01B7C100, 0x0001); in boot_loader_config_emif()
1730 boot_loader_write_mem32(pao, 0, (0x018C0024L), 0x00002A02); in boot_loader_config_emif()
1734 boot_loader_write_mem32(pao, 0, 0x01800004, /* CE1 */ in boot_loader_config_emif()
1743 if ((boot_loader_read_mem32(pao, dsp_index, 0x01B7C100) & 0xF) in boot_loader_config_emif()
1749 boot_loader_write_mem32(pao, dsp_index, C6713_EMIF_GCTL, in boot_loader_config_emif()
1763 boot_loader_write_mem32(pao, dsp_index, C6713_EMIF_CE0, in boot_loader_config_emif()
1785 boot_loader_write_mem32(pao, dsp_index, C6713_EMIF_SDRAMEXT, in boot_loader_config_emif()
1805 boot_loader_write_mem32(pao, dsp_index, C6713_EMIF_SDRAMCTL, in boot_loader_config_emif()
1811 boot_loader_write_mem32(pao, dsp_index, in boot_loader_config_emif()
1822 static u16 boot_loader_test_memory(struct hpi_adapter_obj *pao, int dsp_index, in boot_loader_test_memory() argument
1839 boot_loader_write_mem32(pao, dsp_index, test_addr, in boot_loader_test_memory()
1841 data = boot_loader_read_mem32(pao, dsp_index, in boot_loader_test_memory()
1860 boot_loader_write_mem32(pao, dsp_index, test_addr, test_data); in boot_loader_test_memory()
1861 boot_loader_write_mem32(pao, dsp_index, test_addr + 4, 0); in boot_loader_test_memory()
1862 data = boot_loader_read_mem32(pao, dsp_index, test_addr); in boot_loader_test_memory()
1871 boot_loader_write_mem32(pao, dsp_index, test_addr, 0x0); in boot_loader_test_memory()
1877 boot_loader_write_mem32(pao, dsp_index, test_addr, 0x0); in boot_loader_test_memory()
1882 static u16 boot_loader_test_internal_memory(struct hpi_adapter_obj *pao, in boot_loader_test_internal_memory() argument
1889 err = boot_loader_test_memory(pao, dsp_index, 0x00000000, in boot_loader_test_internal_memory()
1893 err = boot_loader_test_memory(pao, dsp_index, in boot_loader_test_internal_memory()
1898 err = boot_loader_test_memory(pao, dsp_index, 0x00000000, in boot_loader_test_internal_memory()
1902 err = boot_loader_test_memory(pao, dsp_index, in boot_loader_test_internal_memory()
1912 static u16 boot_loader_test_external_memory(struct hpi_adapter_obj *pao, in boot_loader_test_external_memory() argument
1920 if (pao->pci.pci_dev->subsystem_device == 0x5000) { in boot_loader_test_external_memory()
1934 if (boot_loader_test_memory(pao, dsp_index, dRAM_start_address, in boot_loader_test_external_memory()
1940 static u16 boot_loader_test_pld(struct hpi_adapter_obj *pao, int dsp_index) in boot_loader_test_pld() argument
1945 if (pao->pci.pci_dev->subsystem_device == 0x5000) { in boot_loader_test_pld()
1947 data = boot_loader_read_mem32(pao, dsp_index, in boot_loader_test_pld()
1951 data = boot_loader_read_mem32(pao, dsp_index, in boot_loader_test_pld()
1958 if (pao->pci.pci_dev->subsystem_device == 0x8700) { in boot_loader_test_pld()
1960 data = boot_loader_read_mem32(pao, dsp_index, in boot_loader_test_pld()
1965 boot_loader_write_mem32(pao, dsp_index, 0x90000000, in boot_loader_test_pld()
1975 static short hpi6205_transfer_data(struct hpi_adapter_obj *pao, u8 *p_data, in hpi6205_transfer_data() argument
1978 struct hpi_hw_obj *phw = pao->priv; in hpi6205_transfer_data()
2073 static u16 message_response_sequence(struct hpi_adapter_obj *pao, in message_response_sequence() argument
2077 struct hpi_hw_obj *phw = pao->priv; in message_response_sequence()
2157 static void hw_message(struct hpi_adapter_obj *pao, struct hpi_message *phm, in hw_message() argument
2163 hpios_dsplock_lock(pao); in hw_message()
2165 err = message_response_sequence(pao, phm, phr); in hw_message()
2177 pao->dsp_crashed++; in hw_message()
2183 pao->dsp_crashed = 0; in hw_message()
2191 err = hpi6205_transfer_data(pao, phm->u.d.u.data.pb_data, in hw_message()
2197 err = hpi6205_transfer_data(pao, phm->u.d.u.data.pb_data, in hw_message()
2205 hpios_dsplock_unlock(pao); in hw_message()