Lines Matching refs:pao

134 static u16 adapter_boot_load_dsp(struct hpi_adapter_obj *pao,
137 static u16 message_response_sequence(struct hpi_adapter_obj *pao,
140 static void hw_message(struct hpi_adapter_obj *pao, struct hpi_message *phm,
147 static void adapter_delete(struct hpi_adapter_obj *pao,
150 static u16 create_adapter_obj(struct hpi_adapter_obj *pao,
153 static void delete_adapter_obj(struct hpi_adapter_obj *pao);
155 static int adapter_irq_query_and_clear(struct hpi_adapter_obj *pao,
158 static void outstream_host_buffer_allocate(struct hpi_adapter_obj *pao,
161 static void outstream_host_buffer_get_info(struct hpi_adapter_obj *pao,
164 static void outstream_host_buffer_free(struct hpi_adapter_obj *pao,
166 static void outstream_write(struct hpi_adapter_obj *pao,
169 static void outstream_get_info(struct hpi_adapter_obj *pao,
172 static void outstream_start(struct hpi_adapter_obj *pao,
175 static void outstream_open(struct hpi_adapter_obj *pao,
178 static void outstream_reset(struct hpi_adapter_obj *pao,
181 static void instream_host_buffer_allocate(struct hpi_adapter_obj *pao,
184 static void instream_host_buffer_get_info(struct hpi_adapter_obj *pao,
187 static void instream_host_buffer_free(struct hpi_adapter_obj *pao,
190 static void instream_read(struct hpi_adapter_obj *pao,
193 static void instream_get_info(struct hpi_adapter_obj *pao,
196 static void instream_start(struct hpi_adapter_obj *pao,
199 static u32 boot_loader_read_mem32(struct hpi_adapter_obj *pao, int dsp_index,
202 static void boot_loader_write_mem32(struct hpi_adapter_obj *pao,
205 static u16 boot_loader_config_emif(struct hpi_adapter_obj *pao,
208 static u16 boot_loader_test_memory(struct hpi_adapter_obj *pao, int dsp_index,
211 static u16 boot_loader_test_internal_memory(struct hpi_adapter_obj *pao,
214 static u16 boot_loader_test_external_memory(struct hpi_adapter_obj *pao,
217 static u16 boot_loader_test_pld(struct hpi_adapter_obj *pao, int dsp_index);
221 static void subsys_message(struct hpi_adapter_obj *pao, in subsys_message() argument
234 static void control_message(struct hpi_adapter_obj *pao, in control_message() argument
238 struct hpi_hw_obj *phw = pao->priv; in control_message()
243 if (pao->has_control_cache) { in control_message()
252 hw_message(pao, phm, phr); in control_message()
257 hw_message(pao, phm, phr); in control_message()
260 hw_message(pao, phm, phr); in control_message()
261 if (pao->has_control_cache) in control_message()
271 static void adapter_message(struct hpi_adapter_obj *pao, in adapter_message() argument
276 adapter_delete(pao, phm, phr); in adapter_message()
279 hw_message(pao, phm, phr); in adapter_message()
284 static void outstream_message(struct hpi_adapter_obj *pao, in outstream_message() argument
299 outstream_write(pao, phm, phr); in outstream_message()
302 outstream_get_info(pao, phm, phr); in outstream_message()
305 outstream_host_buffer_allocate(pao, phm, phr); in outstream_message()
308 outstream_host_buffer_get_info(pao, phm, phr); in outstream_message()
311 outstream_host_buffer_free(pao, phm, phr); in outstream_message()
314 outstream_start(pao, phm, phr); in outstream_message()
317 outstream_open(pao, phm, phr); in outstream_message()
320 outstream_reset(pao, phm, phr); in outstream_message()
323 hw_message(pao, phm, phr); in outstream_message()
328 static void instream_message(struct hpi_adapter_obj *pao, in instream_message() argument
343 instream_read(pao, phm, phr); in instream_message()
346 instream_get_info(pao, phm, phr); in instream_message()
349 instream_host_buffer_allocate(pao, phm, phr); in instream_message()
352 instream_host_buffer_get_info(pao, phm, phr); in instream_message()
355 instream_host_buffer_free(pao, phm, phr); in instream_message()
358 instream_start(pao, phm, phr); in instream_message()
361 hw_message(pao, phm, phr); in instream_message()
371 void _HPI_6205(struct hpi_adapter_obj *pao, struct hpi_message *phm, in _HPI_6205() argument
374 if (pao && (pao->dsp_crashed >= 10) in _HPI_6205()
393 subsys_message(pao, phm, phr); in _HPI_6205()
397 adapter_message(pao, phm, phr); in _HPI_6205()
401 control_message(pao, phm, phr); in _HPI_6205()
405 outstream_message(pao, phm, phr); in _HPI_6205()
409 instream_message(pao, phm, phr); in _HPI_6205()
413 hw_message(pao, phm, phr); in _HPI_6205()
426 struct hpi_adapter_obj *pao = NULL; in HPI_6205() local
430 pao = hpi_find_adapter(phm->adapter_index); in HPI_6205()
437 if (pao) in HPI_6205()
438 _HPI_6205(pao, phm, phr); in HPI_6205()
491 static void adapter_delete(struct hpi_adapter_obj *pao, in adapter_delete() argument
496 if (!pao) { in adapter_delete()
500 phw = pao->priv; in adapter_delete()
503 boot_loader_write_mem32(pao, 0, C6205_BAR0_TIMER1_CTL, 0); in adapter_delete()
507 delete_adapter_obj(pao); in adapter_delete()
508 hpi_delete_adapter(pao); in adapter_delete()
515 static u16 create_adapter_obj(struct hpi_adapter_obj *pao, in create_adapter_obj() argument
518 struct hpi_hw_obj *phw = pao->priv; in create_adapter_obj()
525 pao->dsp_crashed = 0; in create_adapter_obj()
532 pao->pci.ap_mem_base[1] + in create_adapter_obj()
533 C6205_BAR1_HSR / sizeof(*pao->pci.ap_mem_base[1]); in create_adapter_obj()
535 pao->pci.ap_mem_base[1] + in create_adapter_obj()
536 C6205_BAR1_HDCR / sizeof(*pao->pci.ap_mem_base[1]); in create_adapter_obj()
538 pao->pci.ap_mem_base[1] + in create_adapter_obj()
539 C6205_BAR1_DSPP / sizeof(*pao->pci.ap_mem_base[1]); in create_adapter_obj()
541 pao->has_control_cache = 0; in create_adapter_obj()
545 pao->pci.pci_dev)) in create_adapter_obj()
560 err = adapter_boot_load_dsp(pao, pos_error_code); in create_adapter_obj()
589 pao->pci.pci_dev); in create_adapter_obj()
615 pao->has_control_cache = 1; in create_adapter_obj()
619 pao->has_control_cache = 0; in create_adapter_obj()
639 err = message_response_sequence(pao, &hm, &hr); in create_adapter_obj()
648 pao->type = hr.u.ax.info.adapter_type; in create_adapter_obj()
649 pao->index = hr.u.ax.info.adapter_index; in create_adapter_obj()
658 phw->p_cache->adap_idx = pao->index; in create_adapter_obj()
662 pao->irq_query_and_clear = adapter_irq_query_and_clear; in create_adapter_obj()
663 pao->instream_host_buffer_status = in create_adapter_obj()
665 pao->outstream_host_buffer_status = in create_adapter_obj()
668 return hpi_add_adapter(pao); in create_adapter_obj()
675 static void delete_adapter_obj(struct hpi_adapter_obj *pao) in delete_adapter_obj() argument
677 struct hpi_hw_obj *phw = pao->priv; in delete_adapter_obj()
708 static int adapter_irq_query_and_clear(struct hpi_adapter_obj *pao, in adapter_irq_query_and_clear() argument
711 struct hpi_hw_obj *phw = pao->priv; in adapter_irq_query_and_clear()
729 static void outstream_host_buffer_allocate(struct hpi_adapter_obj *pao, in outstream_host_buffer_allocate() argument
734 struct hpi_hw_obj *phw = pao->priv; in outstream_host_buffer_allocate()
766 pao->pci.pci_dev); in outstream_host_buffer_allocate()
819 hw_message(pao, phm, phr); in outstream_host_buffer_allocate()
831 static void outstream_host_buffer_get_info(struct hpi_adapter_obj *pao, in outstream_host_buffer_get_info() argument
834 struct hpi_hw_obj *phw = pao->priv; in outstream_host_buffer_get_info()
860 static void outstream_host_buffer_free(struct hpi_adapter_obj *pao, in outstream_host_buffer_free() argument
863 struct hpi_hw_obj *phw = pao->priv; in outstream_host_buffer_free()
870 hw_message(pao, phm, phr); in outstream_host_buffer_free()
892 static void outstream_write(struct hpi_adapter_obj *pao, in outstream_write() argument
895 struct hpi_hw_obj *phw = pao->priv; in outstream_write()
902 hw_message(pao, phm, phr); in outstream_write()
957 hw_message(pao, phm, phr); /* send the format to the DSP */ in outstream_write()
966 static void outstream_get_info(struct hpi_adapter_obj *pao, in outstream_get_info() argument
969 struct hpi_hw_obj *phw = pao->priv; in outstream_get_info()
974 hw_message(pao, phm, phr); in outstream_get_info()
992 static void outstream_start(struct hpi_adapter_obj *pao, in outstream_start() argument
995 hw_message(pao, phm, phr); in outstream_start()
998 static void outstream_reset(struct hpi_adapter_obj *pao, in outstream_reset() argument
1001 struct hpi_hw_obj *phw = pao->priv; in outstream_reset()
1003 hw_message(pao, phm, phr); in outstream_reset()
1006 static void outstream_open(struct hpi_adapter_obj *pao, in outstream_open() argument
1009 outstream_reset(pao, phm, phr); in outstream_open()
1015 static void instream_host_buffer_allocate(struct hpi_adapter_obj *pao, in instream_host_buffer_allocate() argument
1020 struct hpi_hw_obj *phw = pao->priv; in instream_host_buffer_allocate()
1048 pao->pci.pci_dev); in instream_host_buffer_allocate()
1096 hw_message(pao, phm, phr); in instream_host_buffer_allocate()
1108 static void instream_host_buffer_get_info(struct hpi_adapter_obj *pao, in instream_host_buffer_get_info() argument
1111 struct hpi_hw_obj *phw = pao->priv; in instream_host_buffer_get_info()
1137 static void instream_host_buffer_free(struct hpi_adapter_obj *pao, in instream_host_buffer_free() argument
1140 struct hpi_hw_obj *phw = pao->priv; in instream_host_buffer_free()
1147 hw_message(pao, phm, phr); in instream_host_buffer_free()
1165 static void instream_start(struct hpi_adapter_obj *pao, in instream_start() argument
1168 hw_message(pao, phm, phr); in instream_start()
1176 static void instream_read(struct hpi_adapter_obj *pao, in instream_read() argument
1179 struct hpi_hw_obj *phw = pao->priv; in instream_read()
1188 hw_message(pao, phm, phr); in instream_read()
1227 static void instream_get_info(struct hpi_adapter_obj *pao, in instream_get_info() argument
1230 struct hpi_hw_obj *phw = pao->priv; in instream_get_info()
1234 hw_message(pao, phm, phr); in instream_get_info()
1256 static u16 adapter_boot_load_dsp(struct hpi_adapter_obj *pao, in adapter_boot_load_dsp() argument
1259 struct hpi_hw_obj *phw = pao->priv; in adapter_boot_load_dsp()
1268 boot_code_id[1] = pao->pci.pci_dev->subsystem_device; in adapter_boot_load_dsp()
1341 boot_loader_write_mem32(pao, 0, 0x018C0024, 0x00002202); in adapter_boot_load_dsp()
1344 boot_loader_write_mem32(pao, 0, C6205_BAR0_TIMER1_CTL, 0); in adapter_boot_load_dsp()
1346 if (0 != (boot_loader_read_mem32(pao, 0, in adapter_boot_load_dsp()
1352 boot_loader_write_mem32(pao, 0, C6205_BAR0_TIMER1_CTL, 4); in adapter_boot_load_dsp()
1353 if (4 != (boot_loader_read_mem32(pao, 0, in adapter_boot_load_dsp()
1364 err = boot_loader_config_emif(pao, dsp); in adapter_boot_load_dsp()
1368 err = boot_loader_test_internal_memory(pao, dsp); in adapter_boot_load_dsp()
1372 err = boot_loader_test_external_memory(pao, dsp); in adapter_boot_load_dsp()
1376 err = boot_loader_test_pld(pao, dsp); in adapter_boot_load_dsp()
1381 err = hpi_dsp_code_open(boot_code_id[dsp], pao->pci.pci_dev, in adapter_boot_load_dsp()
1409 boot_loader_write_mem32(pao, dsp, address, in adapter_boot_load_dsp()
1414 boot_loader_read_mem32(pao, dsp, in adapter_boot_load_dsp()
1444 data = boot_loader_read_mem32(pao, dsp, in adapter_boot_load_dsp()
1484 boot_loader_write_mem32(pao, 0, in adapter_boot_load_dsp()
1488 boot_loader_read_mem32(pao, 0, in adapter_boot_load_dsp()
1512 static u32 boot_loader_read_mem32(struct hpi_adapter_obj *pao, int dsp_index, in boot_loader_read_mem32() argument
1515 struct hpi_hw_obj *phw = pao->priv; in boot_loader_read_mem32()
1523 p_data = pao->pci.ap_mem_base[1] + in boot_loader_read_mem32()
1525 sizeof(*pao->pci.ap_mem_base[1]); in boot_loader_read_mem32()
1538 p_data = pao->pci.ap_mem_base[0] + in boot_loader_read_mem32()
1545 boot_loader_write_mem32(pao, 0, HPIAL_ADDR, address); in boot_loader_read_mem32()
1546 boot_loader_write_mem32(pao, 0, HPIAH_ADDR, address >> 16); in boot_loader_read_mem32()
1547 lsb = boot_loader_read_mem32(pao, 0, HPIDL_ADDR); in boot_loader_read_mem32()
1548 data = boot_loader_read_mem32(pao, 0, HPIDH_ADDR); in boot_loader_read_mem32()
1554 static void boot_loader_write_mem32(struct hpi_adapter_obj *pao, in boot_loader_write_mem32() argument
1557 struct hpi_hw_obj *phw = pao->priv; in boot_loader_write_mem32()
1566 p_data = pao->pci.ap_mem_base[1] + in boot_loader_write_mem32()
1568 sizeof(*pao->pci.ap_mem_base[1]); in boot_loader_write_mem32()
1580 p_data = pao->pci.ap_mem_base[0] + in boot_loader_write_mem32()
1586 boot_loader_write_mem32(pao, 0, HPIAL_ADDR, address); in boot_loader_write_mem32()
1587 boot_loader_write_mem32(pao, 0, HPIAH_ADDR, address >> 16); in boot_loader_write_mem32()
1590 boot_loader_read_mem32(pao, 0, 0); in boot_loader_write_mem32()
1592 boot_loader_write_mem32(pao, 0, HPIDL_ADDR, data); in boot_loader_write_mem32()
1593 boot_loader_write_mem32(pao, 0, HPIDH_ADDR, data >> 16); in boot_loader_write_mem32()
1596 boot_loader_read_mem32(pao, 0, 0); in boot_loader_write_mem32()
1600 static u16 boot_loader_config_emif(struct hpi_adapter_obj *pao, int dsp_index) in boot_loader_config_emif() argument
1615 boot_loader_write_mem32(pao, dsp_index, 0x01800000, 0x3779); in boot_loader_config_emif()
1626 boot_loader_write_mem32(pao, dsp_index, 0x01800008, setting); in boot_loader_config_emif()
1627 if (setting != boot_loader_read_mem32(pao, dsp_index, in boot_loader_config_emif()
1639 boot_loader_write_mem32(pao, dsp_index, 0x01800004, setting); in boot_loader_config_emif()
1640 if (setting != boot_loader_read_mem32(pao, dsp_index, in boot_loader_config_emif()
1651 boot_loader_write_mem32(pao, dsp_index, 0x01800010, setting); in boot_loader_config_emif()
1652 if (setting != boot_loader_read_mem32(pao, dsp_index, in boot_loader_config_emif()
1662 boot_loader_write_mem32(pao, dsp_index, 0x01800014, setting); in boot_loader_config_emif()
1663 if (setting != boot_loader_read_mem32(pao, dsp_index, in boot_loader_config_emif()
1669 boot_loader_write_mem32(pao, dsp_index, 0x01800018, in boot_loader_config_emif()
1674 boot_loader_write_mem32(pao, dsp_index, 0x0180001C, in boot_loader_config_emif()
1683 boot_loader_write_mem32(pao, 0, HPICL_ADDR, write_data); in boot_loader_config_emif()
1684 boot_loader_write_mem32(pao, 0, HPICH_ADDR, write_data); in boot_loader_config_emif()
1687 0xFFF7 & boot_loader_read_mem32(pao, 0, HPICL_ADDR); in boot_loader_config_emif()
1696 boot_loader_write_mem32(pao, 0, HPIAL_ADDR, in boot_loader_config_emif()
1698 boot_loader_write_mem32(pao, 0, HPIAH_ADDR, in boot_loader_config_emif()
1701 0xFFFF & boot_loader_read_mem32(pao, 0, in boot_loader_config_emif()
1705 boot_loader_read_mem32(pao, 0, in boot_loader_config_emif()
1724 boot_loader_write_mem32(pao, dsp_index, 0x01B7C100, 0x0000); in boot_loader_config_emif()
1727 boot_loader_write_mem32(pao, dsp_index, 0x01B7C120, 0x8002); in boot_loader_config_emif()
1729 boot_loader_write_mem32(pao, dsp_index, 0x01B7C11C, 0x8001); in boot_loader_config_emif()
1731 boot_loader_write_mem32(pao, dsp_index, 0x01B7C118, 0x8000); in boot_loader_config_emif()
1736 boot_loader_write_mem32(pao, 0, (0x018C0024L), 0x00002A0A); in boot_loader_config_emif()
1738 boot_loader_write_mem32(pao, dsp_index, 0x01B7C100, 0x0001); in boot_loader_config_emif()
1741 boot_loader_write_mem32(pao, 0, (0x018C0024L), 0x00002A02); in boot_loader_config_emif()
1745 boot_loader_write_mem32(pao, 0, 0x01800004, /* CE1 */ in boot_loader_config_emif()
1754 if ((boot_loader_read_mem32(pao, dsp_index, 0x01B7C100) & 0xF) in boot_loader_config_emif()
1760 boot_loader_write_mem32(pao, dsp_index, C6713_EMIF_GCTL, in boot_loader_config_emif()
1774 boot_loader_write_mem32(pao, dsp_index, C6713_EMIF_CE0, in boot_loader_config_emif()
1796 boot_loader_write_mem32(pao, dsp_index, C6713_EMIF_SDRAMEXT, in boot_loader_config_emif()
1816 boot_loader_write_mem32(pao, dsp_index, C6713_EMIF_SDRAMCTL, in boot_loader_config_emif()
1822 boot_loader_write_mem32(pao, dsp_index, in boot_loader_config_emif()
1833 static u16 boot_loader_test_memory(struct hpi_adapter_obj *pao, int dsp_index, in boot_loader_test_memory() argument
1850 boot_loader_write_mem32(pao, dsp_index, test_addr, in boot_loader_test_memory()
1852 data = boot_loader_read_mem32(pao, dsp_index, in boot_loader_test_memory()
1871 boot_loader_write_mem32(pao, dsp_index, test_addr, test_data); in boot_loader_test_memory()
1872 boot_loader_write_mem32(pao, dsp_index, test_addr + 4, 0); in boot_loader_test_memory()
1873 data = boot_loader_read_mem32(pao, dsp_index, test_addr); in boot_loader_test_memory()
1882 boot_loader_write_mem32(pao, dsp_index, test_addr, 0x0); in boot_loader_test_memory()
1888 boot_loader_write_mem32(pao, dsp_index, test_addr, 0x0); in boot_loader_test_memory()
1893 static u16 boot_loader_test_internal_memory(struct hpi_adapter_obj *pao, in boot_loader_test_internal_memory() argument
1900 err = boot_loader_test_memory(pao, dsp_index, 0x00000000, in boot_loader_test_internal_memory()
1904 err = boot_loader_test_memory(pao, dsp_index, in boot_loader_test_internal_memory()
1909 err = boot_loader_test_memory(pao, dsp_index, 0x00000000, in boot_loader_test_internal_memory()
1913 err = boot_loader_test_memory(pao, dsp_index, in boot_loader_test_internal_memory()
1923 static u16 boot_loader_test_external_memory(struct hpi_adapter_obj *pao, in boot_loader_test_external_memory() argument
1931 if (pao->pci.pci_dev->subsystem_device == 0x5000) { in boot_loader_test_external_memory()
1945 if (boot_loader_test_memory(pao, dsp_index, dRAM_start_address, in boot_loader_test_external_memory()
1951 static u16 boot_loader_test_pld(struct hpi_adapter_obj *pao, int dsp_index) in boot_loader_test_pld() argument
1956 if (pao->pci.pci_dev->subsystem_device == 0x5000) { in boot_loader_test_pld()
1958 data = boot_loader_read_mem32(pao, dsp_index, in boot_loader_test_pld()
1962 data = boot_loader_read_mem32(pao, dsp_index, in boot_loader_test_pld()
1969 if (pao->pci.pci_dev->subsystem_device == 0x8700) { in boot_loader_test_pld()
1971 data = boot_loader_read_mem32(pao, dsp_index, in boot_loader_test_pld()
1976 boot_loader_write_mem32(pao, dsp_index, 0x90000000, in boot_loader_test_pld()
1986 static short hpi6205_transfer_data(struct hpi_adapter_obj *pao, u8 *p_data, in hpi6205_transfer_data() argument
1989 struct hpi_hw_obj *phw = pao->priv; in hpi6205_transfer_data()
2084 static u16 message_response_sequence(struct hpi_adapter_obj *pao, in message_response_sequence() argument
2088 struct hpi_hw_obj *phw = pao->priv; in message_response_sequence()
2168 static void hw_message(struct hpi_adapter_obj *pao, struct hpi_message *phm, in hw_message() argument
2174 hpios_dsplock_lock(pao); in hw_message()
2176 err = message_response_sequence(pao, phm, phr); in hw_message()
2188 pao->dsp_crashed++; in hw_message()
2194 pao->dsp_crashed = 0; in hw_message()
2202 err = hpi6205_transfer_data(pao, phm->u.d.u.data.pb_data, in hw_message()
2208 err = hpi6205_transfer_data(pao, phm->u.d.u.data.pb_data, in hw_message()
2216 hpios_dsplock_unlock(pao); in hw_message()