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()
651 err = message_response_sequence(pao, &hm, &hr); in create_adapter_obj()
660 pao->type = hr.u.ax.info.adapter_type; in create_adapter_obj()
661 pao->index = hr.u.ax.info.adapter_index; in create_adapter_obj()
674 phw->p_cache->adap_idx = pao->index; in create_adapter_obj()
678 pao->irq_query_and_clear = adapter_irq_query_and_clear; in create_adapter_obj()
679 pao->instream_host_buffer_status = in create_adapter_obj()
681 pao->outstream_host_buffer_status = in create_adapter_obj()
684 return hpi_add_adapter(pao); in create_adapter_obj()
691 static void delete_adapter_obj(struct hpi_adapter_obj *pao) in delete_adapter_obj() argument
693 struct hpi_hw_obj *phw = pao->priv; in delete_adapter_obj()
724 static int adapter_irq_query_and_clear(struct hpi_adapter_obj *pao, in adapter_irq_query_and_clear() argument
727 struct hpi_hw_obj *phw = pao->priv; in adapter_irq_query_and_clear()
745 static void outstream_host_buffer_allocate(struct hpi_adapter_obj *pao, in outstream_host_buffer_allocate() argument
750 struct hpi_hw_obj *phw = pao->priv; in outstream_host_buffer_allocate()
782 pao->pci.pci_dev); in outstream_host_buffer_allocate()
835 hw_message(pao, phm, phr); in outstream_host_buffer_allocate()
847 static void outstream_host_buffer_get_info(struct hpi_adapter_obj *pao, in outstream_host_buffer_get_info() argument
850 struct hpi_hw_obj *phw = pao->priv; in outstream_host_buffer_get_info()
876 static void outstream_host_buffer_free(struct hpi_adapter_obj *pao, in outstream_host_buffer_free() argument
879 struct hpi_hw_obj *phw = pao->priv; in outstream_host_buffer_free()
886 hw_message(pao, phm, phr); in outstream_host_buffer_free()
908 static void outstream_write(struct hpi_adapter_obj *pao, in outstream_write() argument
911 struct hpi_hw_obj *phw = pao->priv; in outstream_write()
918 hw_message(pao, phm, phr); in outstream_write()
973 hw_message(pao, phm, phr); /* send the format to the DSP */ in outstream_write()
982 static void outstream_get_info(struct hpi_adapter_obj *pao, in outstream_get_info() argument
985 struct hpi_hw_obj *phw = pao->priv; in outstream_get_info()
990 hw_message(pao, phm, phr); in outstream_get_info()
1008 static void outstream_start(struct hpi_adapter_obj *pao, in outstream_start() argument
1011 hw_message(pao, phm, phr); in outstream_start()
1014 static void outstream_reset(struct hpi_adapter_obj *pao, in outstream_reset() argument
1017 struct hpi_hw_obj *phw = pao->priv; in outstream_reset()
1019 hw_message(pao, phm, phr); in outstream_reset()
1022 static void outstream_open(struct hpi_adapter_obj *pao, in outstream_open() argument
1025 outstream_reset(pao, phm, phr); in outstream_open()
1031 static void instream_host_buffer_allocate(struct hpi_adapter_obj *pao, in instream_host_buffer_allocate() argument
1036 struct hpi_hw_obj *phw = pao->priv; in instream_host_buffer_allocate()
1064 pao->pci.pci_dev); in instream_host_buffer_allocate()
1112 hw_message(pao, phm, phr); in instream_host_buffer_allocate()
1124 static void instream_host_buffer_get_info(struct hpi_adapter_obj *pao, in instream_host_buffer_get_info() argument
1127 struct hpi_hw_obj *phw = pao->priv; in instream_host_buffer_get_info()
1153 static void instream_host_buffer_free(struct hpi_adapter_obj *pao, in instream_host_buffer_free() argument
1156 struct hpi_hw_obj *phw = pao->priv; in instream_host_buffer_free()
1163 hw_message(pao, phm, phr); in instream_host_buffer_free()
1181 static void instream_start(struct hpi_adapter_obj *pao, in instream_start() argument
1184 hw_message(pao, phm, phr); in instream_start()
1192 static void instream_read(struct hpi_adapter_obj *pao, in instream_read() argument
1195 struct hpi_hw_obj *phw = pao->priv; in instream_read()
1204 hw_message(pao, phm, phr); in instream_read()
1243 static void instream_get_info(struct hpi_adapter_obj *pao, in instream_get_info() argument
1246 struct hpi_hw_obj *phw = pao->priv; in instream_get_info()
1250 hw_message(pao, phm, phr); in instream_get_info()
1272 static u16 adapter_boot_load_dsp(struct hpi_adapter_obj *pao, in adapter_boot_load_dsp() argument
1275 struct hpi_hw_obj *phw = pao->priv; in adapter_boot_load_dsp()
1284 boot_code_id[1] = pao->pci.pci_dev->subsystem_device; in adapter_boot_load_dsp()
1357 boot_loader_write_mem32(pao, 0, 0x018C0024, 0x00002202); in adapter_boot_load_dsp()
1360 boot_loader_write_mem32(pao, 0, C6205_BAR0_TIMER1_CTL, 0); in adapter_boot_load_dsp()
1362 if (0 != (boot_loader_read_mem32(pao, 0, in adapter_boot_load_dsp()
1368 boot_loader_write_mem32(pao, 0, C6205_BAR0_TIMER1_CTL, 4); in adapter_boot_load_dsp()
1369 if (4 != (boot_loader_read_mem32(pao, 0, in adapter_boot_load_dsp()
1380 err = boot_loader_config_emif(pao, dsp); in adapter_boot_load_dsp()
1384 err = boot_loader_test_internal_memory(pao, dsp); in adapter_boot_load_dsp()
1388 err = boot_loader_test_external_memory(pao, dsp); in adapter_boot_load_dsp()
1392 err = boot_loader_test_pld(pao, dsp); in adapter_boot_load_dsp()
1397 err = hpi_dsp_code_open(boot_code_id[dsp], pao->pci.pci_dev, in adapter_boot_load_dsp()
1425 boot_loader_write_mem32(pao, dsp, address, in adapter_boot_load_dsp()
1430 boot_loader_read_mem32(pao, dsp, in adapter_boot_load_dsp()
1460 data = boot_loader_read_mem32(pao, dsp, in adapter_boot_load_dsp()
1500 boot_loader_write_mem32(pao, 0, in adapter_boot_load_dsp()
1504 boot_loader_read_mem32(pao, 0, in adapter_boot_load_dsp()
1528 static u32 boot_loader_read_mem32(struct hpi_adapter_obj *pao, int dsp_index, in boot_loader_read_mem32() argument
1531 struct hpi_hw_obj *phw = pao->priv; in boot_loader_read_mem32()
1539 p_data = pao->pci.ap_mem_base[1] + in boot_loader_read_mem32()
1541 sizeof(*pao->pci.ap_mem_base[1]); in boot_loader_read_mem32()
1554 p_data = pao->pci.ap_mem_base[0] + in boot_loader_read_mem32()
1561 boot_loader_write_mem32(pao, 0, HPIAL_ADDR, address); in boot_loader_read_mem32()
1562 boot_loader_write_mem32(pao, 0, HPIAH_ADDR, address >> 16); in boot_loader_read_mem32()
1563 lsb = boot_loader_read_mem32(pao, 0, HPIDL_ADDR); in boot_loader_read_mem32()
1564 data = boot_loader_read_mem32(pao, 0, HPIDH_ADDR); in boot_loader_read_mem32()
1570 static void boot_loader_write_mem32(struct hpi_adapter_obj *pao, in boot_loader_write_mem32() argument
1573 struct hpi_hw_obj *phw = pao->priv; in boot_loader_write_mem32()
1582 p_data = pao->pci.ap_mem_base[1] + in boot_loader_write_mem32()
1584 sizeof(*pao->pci.ap_mem_base[1]); in boot_loader_write_mem32()
1596 p_data = pao->pci.ap_mem_base[0] + in boot_loader_write_mem32()
1602 boot_loader_write_mem32(pao, 0, HPIAL_ADDR, address); in boot_loader_write_mem32()
1603 boot_loader_write_mem32(pao, 0, HPIAH_ADDR, address >> 16); in boot_loader_write_mem32()
1606 boot_loader_read_mem32(pao, 0, 0); in boot_loader_write_mem32()
1608 boot_loader_write_mem32(pao, 0, HPIDL_ADDR, data); in boot_loader_write_mem32()
1609 boot_loader_write_mem32(pao, 0, HPIDH_ADDR, data >> 16); in boot_loader_write_mem32()
1612 boot_loader_read_mem32(pao, 0, 0); in boot_loader_write_mem32()
1616 static u16 boot_loader_config_emif(struct hpi_adapter_obj *pao, int dsp_index) in boot_loader_config_emif() argument
1631 boot_loader_write_mem32(pao, dsp_index, 0x01800000, 0x3779); in boot_loader_config_emif()
1642 boot_loader_write_mem32(pao, dsp_index, 0x01800008, setting); in boot_loader_config_emif()
1643 if (setting != boot_loader_read_mem32(pao, dsp_index, in boot_loader_config_emif()
1655 boot_loader_write_mem32(pao, dsp_index, 0x01800004, setting); in boot_loader_config_emif()
1656 if (setting != boot_loader_read_mem32(pao, dsp_index, in boot_loader_config_emif()
1667 boot_loader_write_mem32(pao, dsp_index, 0x01800010, setting); in boot_loader_config_emif()
1668 if (setting != boot_loader_read_mem32(pao, dsp_index, in boot_loader_config_emif()
1678 boot_loader_write_mem32(pao, dsp_index, 0x01800014, setting); in boot_loader_config_emif()
1679 if (setting != boot_loader_read_mem32(pao, dsp_index, in boot_loader_config_emif()
1685 boot_loader_write_mem32(pao, dsp_index, 0x01800018, in boot_loader_config_emif()
1690 boot_loader_write_mem32(pao, dsp_index, 0x0180001C, in boot_loader_config_emif()
1699 boot_loader_write_mem32(pao, 0, HPICL_ADDR, write_data); in boot_loader_config_emif()
1700 boot_loader_write_mem32(pao, 0, HPICH_ADDR, write_data); in boot_loader_config_emif()
1703 0xFFF7 & boot_loader_read_mem32(pao, 0, HPICL_ADDR); in boot_loader_config_emif()
1712 boot_loader_write_mem32(pao, 0, HPIAL_ADDR, in boot_loader_config_emif()
1714 boot_loader_write_mem32(pao, 0, HPIAH_ADDR, in boot_loader_config_emif()
1717 0xFFFF & boot_loader_read_mem32(pao, 0, in boot_loader_config_emif()
1721 boot_loader_read_mem32(pao, 0, in boot_loader_config_emif()
1740 boot_loader_write_mem32(pao, dsp_index, 0x01B7C100, 0x0000); in boot_loader_config_emif()
1743 boot_loader_write_mem32(pao, dsp_index, 0x01B7C120, 0x8002); in boot_loader_config_emif()
1745 boot_loader_write_mem32(pao, dsp_index, 0x01B7C11C, 0x8001); in boot_loader_config_emif()
1747 boot_loader_write_mem32(pao, dsp_index, 0x01B7C118, 0x8000); in boot_loader_config_emif()
1752 boot_loader_write_mem32(pao, 0, (0x018C0024L), 0x00002A0A); in boot_loader_config_emif()
1754 boot_loader_write_mem32(pao, dsp_index, 0x01B7C100, 0x0001); in boot_loader_config_emif()
1757 boot_loader_write_mem32(pao, 0, (0x018C0024L), 0x00002A02); in boot_loader_config_emif()
1761 boot_loader_write_mem32(pao, 0, 0x01800004, /* CE1 */ in boot_loader_config_emif()
1770 if ((boot_loader_read_mem32(pao, dsp_index, 0x01B7C100) & 0xF) in boot_loader_config_emif()
1776 boot_loader_write_mem32(pao, dsp_index, C6713_EMIF_GCTL, in boot_loader_config_emif()
1790 boot_loader_write_mem32(pao, dsp_index, C6713_EMIF_CE0, in boot_loader_config_emif()
1812 boot_loader_write_mem32(pao, dsp_index, C6713_EMIF_SDRAMEXT, in boot_loader_config_emif()
1832 boot_loader_write_mem32(pao, dsp_index, C6713_EMIF_SDRAMCTL, in boot_loader_config_emif()
1838 boot_loader_write_mem32(pao, dsp_index, in boot_loader_config_emif()
1849 static u16 boot_loader_test_memory(struct hpi_adapter_obj *pao, int dsp_index, in boot_loader_test_memory() argument
1866 boot_loader_write_mem32(pao, dsp_index, test_addr, in boot_loader_test_memory()
1868 data = boot_loader_read_mem32(pao, dsp_index, in boot_loader_test_memory()
1887 boot_loader_write_mem32(pao, dsp_index, test_addr, test_data); in boot_loader_test_memory()
1888 boot_loader_write_mem32(pao, dsp_index, test_addr + 4, 0); in boot_loader_test_memory()
1889 data = boot_loader_read_mem32(pao, dsp_index, test_addr); in boot_loader_test_memory()
1898 boot_loader_write_mem32(pao, dsp_index, test_addr, 0x0); in boot_loader_test_memory()
1904 boot_loader_write_mem32(pao, dsp_index, test_addr, 0x0); in boot_loader_test_memory()
1909 static u16 boot_loader_test_internal_memory(struct hpi_adapter_obj *pao, in boot_loader_test_internal_memory() argument
1916 err = boot_loader_test_memory(pao, dsp_index, 0x00000000, in boot_loader_test_internal_memory()
1920 err = boot_loader_test_memory(pao, dsp_index, in boot_loader_test_internal_memory()
1925 err = boot_loader_test_memory(pao, dsp_index, 0x00000000, in boot_loader_test_internal_memory()
1929 err = boot_loader_test_memory(pao, dsp_index, in boot_loader_test_internal_memory()
1939 static u16 boot_loader_test_external_memory(struct hpi_adapter_obj *pao, in boot_loader_test_external_memory() argument
1947 if (pao->pci.pci_dev->subsystem_device == 0x5000) { in boot_loader_test_external_memory()
1961 if (boot_loader_test_memory(pao, dsp_index, dRAM_start_address, in boot_loader_test_external_memory()
1967 static u16 boot_loader_test_pld(struct hpi_adapter_obj *pao, int dsp_index) in boot_loader_test_pld() argument
1972 if (pao->pci.pci_dev->subsystem_device == 0x5000) { in boot_loader_test_pld()
1974 data = boot_loader_read_mem32(pao, dsp_index, in boot_loader_test_pld()
1978 data = boot_loader_read_mem32(pao, dsp_index, in boot_loader_test_pld()
1985 if (pao->pci.pci_dev->subsystem_device == 0x8700) { in boot_loader_test_pld()
1987 data = boot_loader_read_mem32(pao, dsp_index, in boot_loader_test_pld()
1992 boot_loader_write_mem32(pao, dsp_index, 0x90000000, in boot_loader_test_pld()
2002 static short hpi6205_transfer_data(struct hpi_adapter_obj *pao, u8 *p_data, in hpi6205_transfer_data() argument
2005 struct hpi_hw_obj *phw = pao->priv; in hpi6205_transfer_data()
2100 static u16 message_response_sequence(struct hpi_adapter_obj *pao, in message_response_sequence() argument
2104 struct hpi_hw_obj *phw = pao->priv; in message_response_sequence()
2184 static void hw_message(struct hpi_adapter_obj *pao, struct hpi_message *phm, in hw_message() argument
2190 hpios_dsplock_lock(pao); in hw_message()
2192 err = message_response_sequence(pao, phm, phr); in hw_message()
2204 pao->dsp_crashed++; in hw_message()
2210 pao->dsp_crashed = 0; in hw_message()
2218 err = hpi6205_transfer_data(pao, phm->u.d.u.data.pb_data, in hw_message()
2224 err = hpi6205_transfer_data(pao, phm->u.d.u.data.pb_data, in hw_message()
2232 hpios_dsplock_unlock(pao); in hw_message()