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 int adapter_irq_query_and_clear(struct hpi_adapter_obj *pao,
169 static void outstream_host_buffer_allocate(struct hpi_adapter_obj *pao,
172 static void outstream_host_buffer_get_info(struct hpi_adapter_obj *pao,
175 static void outstream_host_buffer_free(struct hpi_adapter_obj *pao,
177 static void outstream_write(struct hpi_adapter_obj *pao,
180 static void outstream_get_info(struct hpi_adapter_obj *pao,
183 static void outstream_start(struct hpi_adapter_obj *pao,
186 static void outstream_open(struct hpi_adapter_obj *pao,
189 static void outstream_reset(struct hpi_adapter_obj *pao,
192 static void instream_host_buffer_allocate(struct hpi_adapter_obj *pao,
195 static void instream_host_buffer_get_info(struct hpi_adapter_obj *pao,
198 static void instream_host_buffer_free(struct hpi_adapter_obj *pao,
201 static void instream_read(struct hpi_adapter_obj *pao,
204 static void instream_get_info(struct hpi_adapter_obj *pao,
207 static void instream_start(struct hpi_adapter_obj *pao,
210 static u32 boot_loader_read_mem32(struct hpi_adapter_obj *pao, int dsp_index,
213 static void boot_loader_write_mem32(struct hpi_adapter_obj *pao,
216 static u16 boot_loader_config_emif(struct hpi_adapter_obj *pao,
219 static u16 boot_loader_test_memory(struct hpi_adapter_obj *pao, int dsp_index,
222 static u16 boot_loader_test_internal_memory(struct hpi_adapter_obj *pao,
225 static u16 boot_loader_test_external_memory(struct hpi_adapter_obj *pao,
228 static u16 boot_loader_test_pld(struct hpi_adapter_obj *pao, int dsp_index);
232 static void subsys_message(struct hpi_adapter_obj *pao, in subsys_message() argument
245 static void control_message(struct hpi_adapter_obj *pao, in control_message() argument
249 struct hpi_hw_obj *phw = pao->priv; in control_message()
254 if (pao->has_control_cache) { in control_message()
263 hw_message(pao, phm, phr); in control_message()
268 hw_message(pao, phm, phr); in control_message()
271 hw_message(pao, phm, phr); in control_message()
272 if (pao->has_control_cache) in control_message()
282 static void adapter_message(struct hpi_adapter_obj *pao, in adapter_message() argument
287 adapter_delete(pao, phm, phr); in adapter_message()
290 hw_message(pao, phm, phr); in adapter_message()
295 static void outstream_message(struct hpi_adapter_obj *pao, in outstream_message() argument
310 outstream_write(pao, phm, phr); in outstream_message()
313 outstream_get_info(pao, phm, phr); in outstream_message()
316 outstream_host_buffer_allocate(pao, phm, phr); in outstream_message()
319 outstream_host_buffer_get_info(pao, phm, phr); in outstream_message()
322 outstream_host_buffer_free(pao, phm, phr); in outstream_message()
325 outstream_start(pao, phm, phr); in outstream_message()
328 outstream_open(pao, phm, phr); in outstream_message()
331 outstream_reset(pao, phm, phr); in outstream_message()
334 hw_message(pao, phm, phr); in outstream_message()
339 static void instream_message(struct hpi_adapter_obj *pao, in instream_message() argument
354 instream_read(pao, phm, phr); in instream_message()
357 instream_get_info(pao, phm, phr); in instream_message()
360 instream_host_buffer_allocate(pao, phm, phr); in instream_message()
363 instream_host_buffer_get_info(pao, phm, phr); in instream_message()
366 instream_host_buffer_free(pao, phm, phr); in instream_message()
369 instream_start(pao, phm, phr); in instream_message()
372 hw_message(pao, phm, phr); in instream_message()
382 void _HPI_6205(struct hpi_adapter_obj *pao, struct hpi_message *phm, in _HPI_6205() argument
385 if (pao && (pao->dsp_crashed >= 10) in _HPI_6205()
404 subsys_message(pao, phm, phr); in _HPI_6205()
408 adapter_message(pao, phm, phr); in _HPI_6205()
412 control_message(pao, phm, phr); in _HPI_6205()
416 outstream_message(pao, phm, phr); in _HPI_6205()
420 instream_message(pao, phm, phr); in _HPI_6205()
424 hw_message(pao, phm, phr); in _HPI_6205()
437 struct hpi_adapter_obj *pao = NULL; in HPI_6205() local
441 pao = hpi_find_adapter(phm->adapter_index); in HPI_6205()
448 if (pao) in HPI_6205()
449 _HPI_6205(pao, phm, phr); in HPI_6205()
502 static void adapter_delete(struct hpi_adapter_obj *pao, in adapter_delete() argument
507 if (!pao) { in adapter_delete()
511 phw = pao->priv; in adapter_delete()
514 boot_loader_write_mem32(pao, 0, C6205_BAR0_TIMER1_CTL, 0); in adapter_delete()
518 delete_adapter_obj(pao); in adapter_delete()
519 hpi_delete_adapter(pao); in adapter_delete()
526 static u16 create_adapter_obj(struct hpi_adapter_obj *pao, in create_adapter_obj() argument
529 struct hpi_hw_obj *phw = pao->priv; in create_adapter_obj()
536 pao->dsp_crashed = 0; in create_adapter_obj()
543 pao->pci.ap_mem_base[1] + in create_adapter_obj()
544 C6205_BAR1_HSR / sizeof(*pao->pci.ap_mem_base[1]); in create_adapter_obj()
546 pao->pci.ap_mem_base[1] + in create_adapter_obj()
547 C6205_BAR1_HDCR / sizeof(*pao->pci.ap_mem_base[1]); in create_adapter_obj()
549 pao->pci.ap_mem_base[1] + in create_adapter_obj()
550 C6205_BAR1_DSPP / sizeof(*pao->pci.ap_mem_base[1]); in create_adapter_obj()
552 pao->has_control_cache = 0; in create_adapter_obj()
556 pao->pci.pci_dev)) in create_adapter_obj()
571 err = adapter_boot_load_dsp(pao, pos_error_code); in create_adapter_obj()
600 pao->pci.pci_dev); in create_adapter_obj()
626 pao->has_control_cache = 1; in create_adapter_obj()
630 pao->has_control_cache = 0; in create_adapter_obj()
650 err = message_response_sequence(pao, &hm, &hr); in create_adapter_obj()
659 pao->type = hr.u.ax.info.adapter_type; in create_adapter_obj()
660 pao->index = hr.u.ax.info.adapter_index; in create_adapter_obj()
669 phw->p_cache->adap_idx = pao->index; in create_adapter_obj()
673 pao->irq_query_and_clear = adapter_irq_query_and_clear; in create_adapter_obj()
674 pao->instream_host_buffer_status = in create_adapter_obj()
676 pao->outstream_host_buffer_status = in create_adapter_obj()
679 return hpi_add_adapter(pao); in create_adapter_obj()
686 static void delete_adapter_obj(struct hpi_adapter_obj *pao) in delete_adapter_obj() argument
688 struct hpi_hw_obj *phw = pao->priv; in delete_adapter_obj()
719 static int adapter_irq_query_and_clear(struct hpi_adapter_obj *pao, in adapter_irq_query_and_clear() argument
722 struct hpi_hw_obj *phw = pao->priv; in adapter_irq_query_and_clear()
740 static void outstream_host_buffer_allocate(struct hpi_adapter_obj *pao, in outstream_host_buffer_allocate() argument
745 struct hpi_hw_obj *phw = pao->priv; in outstream_host_buffer_allocate()
777 pao->pci.pci_dev); in outstream_host_buffer_allocate()
830 hw_message(pao, phm, phr); in outstream_host_buffer_allocate()
842 static void outstream_host_buffer_get_info(struct hpi_adapter_obj *pao, in outstream_host_buffer_get_info() argument
845 struct hpi_hw_obj *phw = pao->priv; in outstream_host_buffer_get_info()
871 static void outstream_host_buffer_free(struct hpi_adapter_obj *pao, in outstream_host_buffer_free() argument
874 struct hpi_hw_obj *phw = pao->priv; in outstream_host_buffer_free()
881 hw_message(pao, phm, phr); in outstream_host_buffer_free()
903 static void outstream_write(struct hpi_adapter_obj *pao, in outstream_write() argument
906 struct hpi_hw_obj *phw = pao->priv; in outstream_write()
913 hw_message(pao, phm, phr); in outstream_write()
968 hw_message(pao, phm, phr); /* send the format to the DSP */ in outstream_write()
977 static void outstream_get_info(struct hpi_adapter_obj *pao, in outstream_get_info() argument
980 struct hpi_hw_obj *phw = pao->priv; in outstream_get_info()
985 hw_message(pao, phm, phr); in outstream_get_info()
1003 static void outstream_start(struct hpi_adapter_obj *pao, in outstream_start() argument
1006 hw_message(pao, phm, phr); in outstream_start()
1009 static void outstream_reset(struct hpi_adapter_obj *pao, in outstream_reset() argument
1012 struct hpi_hw_obj *phw = pao->priv; in outstream_reset()
1014 hw_message(pao, phm, phr); in outstream_reset()
1017 static void outstream_open(struct hpi_adapter_obj *pao, in outstream_open() argument
1020 outstream_reset(pao, phm, phr); in outstream_open()
1026 static void instream_host_buffer_allocate(struct hpi_adapter_obj *pao, in instream_host_buffer_allocate() argument
1031 struct hpi_hw_obj *phw = pao->priv; in instream_host_buffer_allocate()
1059 pao->pci.pci_dev); in instream_host_buffer_allocate()
1107 hw_message(pao, phm, phr); in instream_host_buffer_allocate()
1119 static void instream_host_buffer_get_info(struct hpi_adapter_obj *pao, in instream_host_buffer_get_info() argument
1122 struct hpi_hw_obj *phw = pao->priv; in instream_host_buffer_get_info()
1148 static void instream_host_buffer_free(struct hpi_adapter_obj *pao, in instream_host_buffer_free() argument
1151 struct hpi_hw_obj *phw = pao->priv; in instream_host_buffer_free()
1158 hw_message(pao, phm, phr); in instream_host_buffer_free()
1176 static void instream_start(struct hpi_adapter_obj *pao, in instream_start() argument
1179 hw_message(pao, phm, phr); in instream_start()
1187 static void instream_read(struct hpi_adapter_obj *pao, in instream_read() argument
1190 struct hpi_hw_obj *phw = pao->priv; in instream_read()
1199 hw_message(pao, phm, phr); in instream_read()
1238 static void instream_get_info(struct hpi_adapter_obj *pao, in instream_get_info() argument
1241 struct hpi_hw_obj *phw = pao->priv; in instream_get_info()
1245 hw_message(pao, phm, phr); in instream_get_info()
1267 static u16 adapter_boot_load_dsp(struct hpi_adapter_obj *pao, in adapter_boot_load_dsp() argument
1270 struct hpi_hw_obj *phw = pao->priv; in adapter_boot_load_dsp()
1279 boot_code_id[1] = pao->pci.pci_dev->subsystem_device; in adapter_boot_load_dsp()
1352 boot_loader_write_mem32(pao, 0, 0x018C0024, 0x00002202); in adapter_boot_load_dsp()
1355 boot_loader_write_mem32(pao, 0, C6205_BAR0_TIMER1_CTL, 0); in adapter_boot_load_dsp()
1357 if (0 != (boot_loader_read_mem32(pao, 0, in adapter_boot_load_dsp()
1363 boot_loader_write_mem32(pao, 0, C6205_BAR0_TIMER1_CTL, 4); in adapter_boot_load_dsp()
1364 if (4 != (boot_loader_read_mem32(pao, 0, in adapter_boot_load_dsp()
1375 err = boot_loader_config_emif(pao, dsp); in adapter_boot_load_dsp()
1379 err = boot_loader_test_internal_memory(pao, dsp); in adapter_boot_load_dsp()
1383 err = boot_loader_test_external_memory(pao, dsp); in adapter_boot_load_dsp()
1387 err = boot_loader_test_pld(pao, dsp); in adapter_boot_load_dsp()
1392 err = hpi_dsp_code_open(boot_code_id[dsp], pao->pci.pci_dev, in adapter_boot_load_dsp()
1420 boot_loader_write_mem32(pao, dsp, address, in adapter_boot_load_dsp()
1425 boot_loader_read_mem32(pao, dsp, in adapter_boot_load_dsp()
1455 data = boot_loader_read_mem32(pao, dsp, in adapter_boot_load_dsp()
1495 boot_loader_write_mem32(pao, 0, in adapter_boot_load_dsp()
1499 boot_loader_read_mem32(pao, 0, in adapter_boot_load_dsp()
1523 static u32 boot_loader_read_mem32(struct hpi_adapter_obj *pao, int dsp_index, in boot_loader_read_mem32() argument
1526 struct hpi_hw_obj *phw = pao->priv; in boot_loader_read_mem32()
1534 p_data = pao->pci.ap_mem_base[1] + in boot_loader_read_mem32()
1536 sizeof(*pao->pci.ap_mem_base[1]); in boot_loader_read_mem32()
1549 p_data = pao->pci.ap_mem_base[0] + in boot_loader_read_mem32()
1556 boot_loader_write_mem32(pao, 0, HPIAL_ADDR, address); in boot_loader_read_mem32()
1557 boot_loader_write_mem32(pao, 0, HPIAH_ADDR, address >> 16); in boot_loader_read_mem32()
1558 lsb = boot_loader_read_mem32(pao, 0, HPIDL_ADDR); in boot_loader_read_mem32()
1559 data = boot_loader_read_mem32(pao, 0, HPIDH_ADDR); in boot_loader_read_mem32()
1565 static void boot_loader_write_mem32(struct hpi_adapter_obj *pao, in boot_loader_write_mem32() argument
1568 struct hpi_hw_obj *phw = pao->priv; in boot_loader_write_mem32()
1577 p_data = pao->pci.ap_mem_base[1] + in boot_loader_write_mem32()
1579 sizeof(*pao->pci.ap_mem_base[1]); in boot_loader_write_mem32()
1591 p_data = pao->pci.ap_mem_base[0] + in boot_loader_write_mem32()
1597 boot_loader_write_mem32(pao, 0, HPIAL_ADDR, address); in boot_loader_write_mem32()
1598 boot_loader_write_mem32(pao, 0, HPIAH_ADDR, address >> 16); in boot_loader_write_mem32()
1601 boot_loader_read_mem32(pao, 0, 0); in boot_loader_write_mem32()
1603 boot_loader_write_mem32(pao, 0, HPIDL_ADDR, data); in boot_loader_write_mem32()
1604 boot_loader_write_mem32(pao, 0, HPIDH_ADDR, data >> 16); in boot_loader_write_mem32()
1607 boot_loader_read_mem32(pao, 0, 0); in boot_loader_write_mem32()
1611 static u16 boot_loader_config_emif(struct hpi_adapter_obj *pao, int dsp_index) in boot_loader_config_emif() argument
1626 boot_loader_write_mem32(pao, dsp_index, 0x01800000, 0x3779); in boot_loader_config_emif()
1637 boot_loader_write_mem32(pao, dsp_index, 0x01800008, setting); in boot_loader_config_emif()
1638 if (setting != boot_loader_read_mem32(pao, dsp_index, in boot_loader_config_emif()
1650 boot_loader_write_mem32(pao, dsp_index, 0x01800004, setting); in boot_loader_config_emif()
1651 if (setting != boot_loader_read_mem32(pao, dsp_index, in boot_loader_config_emif()
1662 boot_loader_write_mem32(pao, dsp_index, 0x01800010, setting); in boot_loader_config_emif()
1663 if (setting != boot_loader_read_mem32(pao, dsp_index, in boot_loader_config_emif()
1673 boot_loader_write_mem32(pao, dsp_index, 0x01800014, setting); in boot_loader_config_emif()
1674 if (setting != boot_loader_read_mem32(pao, dsp_index, in boot_loader_config_emif()
1680 boot_loader_write_mem32(pao, dsp_index, 0x01800018, in boot_loader_config_emif()
1685 boot_loader_write_mem32(pao, dsp_index, 0x0180001C, in boot_loader_config_emif()
1694 boot_loader_write_mem32(pao, 0, HPICL_ADDR, write_data); in boot_loader_config_emif()
1695 boot_loader_write_mem32(pao, 0, HPICH_ADDR, write_data); in boot_loader_config_emif()
1698 0xFFF7 & boot_loader_read_mem32(pao, 0, HPICL_ADDR); in boot_loader_config_emif()
1707 boot_loader_write_mem32(pao, 0, HPIAL_ADDR, in boot_loader_config_emif()
1709 boot_loader_write_mem32(pao, 0, HPIAH_ADDR, in boot_loader_config_emif()
1712 0xFFFF & boot_loader_read_mem32(pao, 0, in boot_loader_config_emif()
1716 boot_loader_read_mem32(pao, 0, in boot_loader_config_emif()
1735 boot_loader_write_mem32(pao, dsp_index, 0x01B7C100, 0x0000); in boot_loader_config_emif()
1738 boot_loader_write_mem32(pao, dsp_index, 0x01B7C120, 0x8002); in boot_loader_config_emif()
1740 boot_loader_write_mem32(pao, dsp_index, 0x01B7C11C, 0x8001); in boot_loader_config_emif()
1742 boot_loader_write_mem32(pao, dsp_index, 0x01B7C118, 0x8000); in boot_loader_config_emif()
1747 boot_loader_write_mem32(pao, 0, (0x018C0024L), 0x00002A0A); in boot_loader_config_emif()
1749 boot_loader_write_mem32(pao, dsp_index, 0x01B7C100, 0x0001); in boot_loader_config_emif()
1752 boot_loader_write_mem32(pao, 0, (0x018C0024L), 0x00002A02); in boot_loader_config_emif()
1756 boot_loader_write_mem32(pao, 0, 0x01800004, /* CE1 */ in boot_loader_config_emif()
1765 if ((boot_loader_read_mem32(pao, dsp_index, 0x01B7C100) & 0xF) in boot_loader_config_emif()
1771 boot_loader_write_mem32(pao, dsp_index, C6713_EMIF_GCTL, in boot_loader_config_emif()
1785 boot_loader_write_mem32(pao, dsp_index, C6713_EMIF_CE0, in boot_loader_config_emif()
1807 boot_loader_write_mem32(pao, dsp_index, C6713_EMIF_SDRAMEXT, in boot_loader_config_emif()
1827 boot_loader_write_mem32(pao, dsp_index, C6713_EMIF_SDRAMCTL, in boot_loader_config_emif()
1833 boot_loader_write_mem32(pao, dsp_index, in boot_loader_config_emif()
1844 static u16 boot_loader_test_memory(struct hpi_adapter_obj *pao, int dsp_index, in boot_loader_test_memory() argument
1861 boot_loader_write_mem32(pao, dsp_index, test_addr, in boot_loader_test_memory()
1863 data = boot_loader_read_mem32(pao, dsp_index, in boot_loader_test_memory()
1882 boot_loader_write_mem32(pao, dsp_index, test_addr, test_data); in boot_loader_test_memory()
1883 boot_loader_write_mem32(pao, dsp_index, test_addr + 4, 0); in boot_loader_test_memory()
1884 data = boot_loader_read_mem32(pao, dsp_index, test_addr); in boot_loader_test_memory()
1893 boot_loader_write_mem32(pao, dsp_index, test_addr, 0x0); in boot_loader_test_memory()
1899 boot_loader_write_mem32(pao, dsp_index, test_addr, 0x0); in boot_loader_test_memory()
1904 static u16 boot_loader_test_internal_memory(struct hpi_adapter_obj *pao, in boot_loader_test_internal_memory() argument
1911 err = boot_loader_test_memory(pao, dsp_index, 0x00000000, in boot_loader_test_internal_memory()
1915 err = boot_loader_test_memory(pao, dsp_index, in boot_loader_test_internal_memory()
1920 err = boot_loader_test_memory(pao, dsp_index, 0x00000000, in boot_loader_test_internal_memory()
1924 err = boot_loader_test_memory(pao, dsp_index, in boot_loader_test_internal_memory()
1934 static u16 boot_loader_test_external_memory(struct hpi_adapter_obj *pao, in boot_loader_test_external_memory() argument
1942 if (pao->pci.pci_dev->subsystem_device == 0x5000) { in boot_loader_test_external_memory()
1956 if (boot_loader_test_memory(pao, dsp_index, dRAM_start_address, in boot_loader_test_external_memory()
1962 static u16 boot_loader_test_pld(struct hpi_adapter_obj *pao, int dsp_index) in boot_loader_test_pld() argument
1967 if (pao->pci.pci_dev->subsystem_device == 0x5000) { in boot_loader_test_pld()
1969 data = boot_loader_read_mem32(pao, dsp_index, in boot_loader_test_pld()
1973 data = boot_loader_read_mem32(pao, dsp_index, in boot_loader_test_pld()
1980 if (pao->pci.pci_dev->subsystem_device == 0x8700) { in boot_loader_test_pld()
1982 data = boot_loader_read_mem32(pao, dsp_index, in boot_loader_test_pld()
1987 boot_loader_write_mem32(pao, dsp_index, 0x90000000, in boot_loader_test_pld()
1997 static short hpi6205_transfer_data(struct hpi_adapter_obj *pao, u8 *p_data, in hpi6205_transfer_data() argument
2000 struct hpi_hw_obj *phw = pao->priv; in hpi6205_transfer_data()
2095 static u16 message_response_sequence(struct hpi_adapter_obj *pao, in message_response_sequence() argument
2099 struct hpi_hw_obj *phw = pao->priv; in message_response_sequence()
2179 static void hw_message(struct hpi_adapter_obj *pao, struct hpi_message *phm, in hw_message() argument
2185 hpios_dsplock_lock(pao); in hw_message()
2187 err = message_response_sequence(pao, phm, phr); in hw_message()
2199 pao->dsp_crashed++; in hw_message()
2205 pao->dsp_crashed = 0; in hw_message()
2213 err = hpi6205_transfer_data(pao, phm->u.d.u.data.pb_data, in hw_message()
2219 err = hpi6205_transfer_data(pao, phm->u.d.u.data.pb_data, in hw_message()
2227 hpios_dsplock_unlock(pao); in hw_message()