Lines Matching refs:pao

156 static u16 hpi6000_dsp_block_write32(struct hpi_adapter_obj *pao,
158 static u16 hpi6000_dsp_block_read32(struct hpi_adapter_obj *pao,
161 static short hpi6000_adapter_boot_load_dsp(struct hpi_adapter_obj *pao,
163 static short hpi6000_check_PCI2040_error_flag(struct hpi_adapter_obj *pao,
168 static short hpi6000_update_control_cache(struct hpi_adapter_obj *pao,
170 static short hpi6000_message_response_sequence(struct hpi_adapter_obj *pao,
173 static void hw_message(struct hpi_adapter_obj *pao, struct hpi_message *phm,
176 static short hpi6000_wait_dsp_ack(struct hpi_adapter_obj *pao, u16 dsp_index,
179 static short hpi6000_send_host_command(struct hpi_adapter_obj *pao,
184 static short hpi6000_send_data(struct hpi_adapter_obj *pao, u16 dsp_index,
187 static short hpi6000_get_data(struct hpi_adapter_obj *pao, u16 dsp_index,
203 static void adapter_delete(struct hpi_adapter_obj *pao,
206 static void adapter_get_asserts(struct hpi_adapter_obj *pao,
209 static short create_adapter_obj(struct hpi_adapter_obj *pao,
212 static void delete_adapter_obj(struct hpi_adapter_obj *pao);
231 static void control_message(struct hpi_adapter_obj *pao, in control_message() argument
234 struct hpi_hw_obj *phw = pao->priv; in control_message()
238 if (pao->has_control_cache) { in control_message()
240 err = hpi6000_update_control_cache(pao, phm); in control_message()
256 hw_message(pao, phm, phr); in control_message()
259 hw_message(pao, phm, phr); in control_message()
265 hw_message(pao, phm, phr); in control_message()
270 static void adapter_message(struct hpi_adapter_obj *pao, in adapter_message() argument
275 adapter_get_asserts(pao, phm, phr); in adapter_message()
279 adapter_delete(pao, phm, phr); in adapter_message()
283 hw_message(pao, phm, phr); in adapter_message()
288 static void outstream_message(struct hpi_adapter_obj *pao, in outstream_message() argument
302 hw_message(pao, phm, phr); in outstream_message()
307 static void instream_message(struct hpi_adapter_obj *pao, in instream_message() argument
322 hw_message(pao, phm, phr); in instream_message()
334 struct hpi_adapter_obj *pao = NULL; in HPI_6000() local
337 pao = hpi_find_adapter(phm->adapter_index); in HPI_6000()
338 if (!pao) { in HPI_6000()
347 if (pao->dsp_crashed >= 10) { in HPI_6000()
371 adapter_message(pao, phm, phr); in HPI_6000()
375 control_message(pao, phm, phr); in HPI_6000()
379 outstream_message(pao, phm, phr); in HPI_6000()
383 instream_message(pao, phm, phr); in HPI_6000()
387 hw_message(pao, phm, phr); in HPI_6000()
411 struct hpi_adapter_obj *pao; in subsys_create_adapter() local
444 pao = hpi_find_adapter(ao.index); in subsys_create_adapter()
445 if (!pao) { in subsys_create_adapter()
453 struct hpi_hw_obj *phw = pao->priv; in subsys_create_adapter()
454 phw->ado[dsp_index].pa_parent_adapter = pao; in subsys_create_adapter()
462 static void adapter_delete(struct hpi_adapter_obj *pao, in adapter_delete() argument
465 delete_adapter_obj(pao); in adapter_delete()
466 hpi_delete_adapter(pao); in adapter_delete()
471 static short create_adapter_obj(struct hpi_adapter_obj *pao, in create_adapter_obj() argument
478 struct hpi_hw_obj *phw = pao->priv; in create_adapter_obj()
483 phw->dw2040_HPICSR = pao->pci.ap_mem_base[0]; in create_adapter_obj()
484 phw->dw2040_HPIDSP = pao->pci.ap_mem_base[1]; in create_adapter_obj()
510 phw->ado[dsp_index].pa_parent_adapter = pao; in create_adapter_obj()
514 pao->has_control_cache = 0; in create_adapter_obj()
521 boot_error = hpi6000_adapter_boot_load_dsp(pao, pos_error_code); in create_adapter_obj()
550 error = hpi6000_message_response_sequence(pao, 0, &hm, &hr0); in create_adapter_obj()
556 error = hpi6000_message_response_sequence(pao, 1, &hm, in create_adapter_obj()
561 pao->type = hr0.u.ax.info.adapter_type; in create_adapter_obj()
562 pao->index = hr0.u.ax.info.adapter_index; in create_adapter_obj()
583 pao->has_control_cache = 1; in create_adapter_obj()
586 HPI_DEBUG_LOG(DEBUG, "get adapter info ASI%04X index %d\n", pao->type, in create_adapter_obj()
587 pao->index); in create_adapter_obj()
590 phw->p_cache->adap_idx = pao->index; in create_adapter_obj()
592 return hpi_add_adapter(pao); in create_adapter_obj()
595 static void delete_adapter_obj(struct hpi_adapter_obj *pao) in delete_adapter_obj() argument
597 struct hpi_hw_obj *phw = pao->priv; in delete_adapter_obj()
599 if (pao->has_control_cache) in delete_adapter_obj()
611 static void adapter_get_asserts(struct hpi_adapter_obj *pao, in adapter_get_asserts() argument
629 hw_message(pao, phm, phr); /*get DSP asserts */ in adapter_get_asserts()
637 static short hpi6000_adapter_boot_load_dsp(struct hpi_adapter_obj *pao, in hpi6000_adapter_boot_load_dsp() argument
640 struct hpi_hw_obj *phw = pao->priv; in hpi6000_adapter_boot_load_dsp()
660 switch (pao->pci.pci_dev->subsystem_device) { in hpi6000_adapter_boot_load_dsp()
947 error = hpi_dsp_code_open(boot_load_family, pao->pci.pci_dev, in hpi6000_adapter_boot_load_dsp()
975 error = hpi6000_dsp_block_write32(pao, (u16)dsp_index, in hpi6000_adapter_boot_load_dsp()
1057 && hpi6000_check_PCI2040_error_flag(pao, in hpi6000_adapter_boot_load_dsp()
1100 if (HPI_ADAPTER_FAMILY_ASI(pao->pci.pci_dev-> in hpi6000_adapter_boot_load_dsp()
1106 if (HPI_ADAPTER_FAMILY_ASI(pao->pci.pci_dev-> in hpi6000_adapter_boot_load_dsp()
1218 static u16 hpi6000_dsp_block_write32(struct hpi_adapter_obj *pao, in hpi6000_dsp_block_write32() argument
1221 struct hpi_hw_obj *phw = pao->priv; in hpi6000_dsp_block_write32()
1240 } while (hpi6000_check_PCI2040_error_flag(pao, H6WRITE) in hpi6000_dsp_block_write32()
1256 static u16 hpi6000_dsp_block_read32(struct hpi_adapter_obj *pao, in hpi6000_dsp_block_read32() argument
1259 struct hpi_hw_obj *phw = pao->priv; in hpi6000_dsp_block_read32()
1279 } while (hpi6000_check_PCI2040_error_flag(pao, H6READ) in hpi6000_dsp_block_read32()
1296 static short hpi6000_message_response_sequence(struct hpi_adapter_obj *pao, in hpi6000_message_response_sequence() argument
1299 struct hpi_hw_obj *phw = pao->priv; in hpi6000_message_response_sequence()
1308 ack = hpi6000_wait_dsp_ack(pao, dsp_index, HPI_HIF_IDLE); in hpi6000_message_response_sequence()
1310 pao->dsp_crashed++; in hpi6000_message_response_sequence()
1313 pao->dsp_crashed = 0; in hpi6000_message_response_sequence()
1323 } while (hpi6000_check_PCI2040_error_flag(pao, H6READ) in hpi6000_message_response_sequence()
1334 if (hpi6000_dsp_block_write32(pao, dsp_index, address, p_data, in hpi6000_message_response_sequence()
1338 if (hpi6000_send_host_command(pao, dsp_index, HPI_HIF_GET_RESP)) in hpi6000_message_response_sequence()
1342 ack = hpi6000_wait_dsp_ack(pao, dsp_index, HPI_HIF_GET_RESP); in hpi6000_message_response_sequence()
1353 } while (hpi6000_check_PCI2040_error_flag(pao, H6READ) in hpi6000_message_response_sequence()
1366 } while (hpi6000_check_PCI2040_error_flag(pao, H6READ) && --timeout); in hpi6000_message_response_sequence()
1372 if (hpi6000_dsp_block_read32(pao, dsp_index, address, p_data, in hpi6000_message_response_sequence()
1377 if (hpi6000_send_host_command(pao, dsp_index, HPI_HIF_IDLE)) in hpi6000_message_response_sequence()
1412 static short hpi6000_send_data(struct hpi_adapter_obj *pao, u16 dsp_index, in hpi6000_send_data() argument
1415 struct hpi_hw_obj *phw = pao->priv; in hpi6000_send_data()
1428 ack = hpi6000_wait_dsp_ack(pao, dsp_index, HPI_HIF_IDLE); in hpi6000_send_data()
1432 if (hpi6000_send_host_command(pao, dsp_index, in hpi6000_send_data()
1438 ack = hpi6000_wait_dsp_ack(pao, dsp_index, HPI_HIF_SEND_DATA); in hpi6000_send_data()
1448 } while (hpi6000_check_PCI2040_error_flag(pao, H6READ)); in hpi6000_send_data()
1464 if (hpi6000_dsp_block_write32(pao, dsp_index, in hpi6000_send_data()
1473 if (hpi6000_send_host_command(pao, dsp_index, HPI_HIF_IDLE)) in hpi6000_send_data()
1485 static short hpi6000_get_data(struct hpi_adapter_obj *pao, u16 dsp_index, in hpi6000_get_data() argument
1488 struct hpi_hw_obj *phw = pao->priv; in hpi6000_get_data()
1499 ack = hpi6000_wait_dsp_ack(pao, dsp_index, HPI_HIF_IDLE); in hpi6000_get_data()
1503 if (hpi6000_send_host_command(pao, dsp_index, in hpi6000_get_data()
1508 ack = hpi6000_wait_dsp_ack(pao, dsp_index, HPI_HIF_GET_DATA); in hpi6000_get_data()
1517 } while (hpi6000_check_PCI2040_error_flag(pao, H6READ)); in hpi6000_get_data()
1526 if (hpi6000_dsp_block_read32(pao, dsp_index, in hpi6000_get_data()
1535 if (hpi6000_send_host_command(pao, dsp_index, HPI_HIF_IDLE)) in hpi6000_get_data()
1549 static short hpi6000_send_host_command(struct hpi_adapter_obj *pao, in hpi6000_send_host_command() argument
1552 struct hpi_hw_obj *phw = pao->priv; in hpi6000_send_host_command()
1561 } while (hpi6000_check_PCI2040_error_flag(pao, H6WRITE) && --timeout); in hpi6000_send_host_command()
1573 static short hpi6000_check_PCI2040_error_flag(struct hpi_adapter_obj *pao, in hpi6000_check_PCI2040_error_flag() argument
1578 struct hpi_hw_obj *phw = pao->priv; in hpi6000_check_PCI2040_error_flag()
1595 static short hpi6000_wait_dsp_ack(struct hpi_adapter_obj *pao, u16 dsp_index, in hpi6000_wait_dsp_ack() argument
1598 struct hpi_hw_obj *phw = pao->priv; in hpi6000_wait_dsp_ack()
1622 && !hpi6000_check_PCI2040_error_flag(pao, H6READ)) in hpi6000_wait_dsp_ack()
1637 static short hpi6000_update_control_cache(struct hpi_adapter_obj *pao, in hpi6000_update_control_cache() argument
1641 struct hpi_hw_obj *phw = pao->priv; in hpi6000_update_control_cache()
1647 hpios_dsplock_lock(pao); in hpi6000_update_control_cache()
1654 } while (hpi6000_check_PCI2040_error_flag(pao, H6READ) && --timeout); in hpi6000_update_control_cache()
1675 } while (hpi6000_check_PCI2040_error_flag(pao, H6READ) in hpi6000_update_control_cache()
1688 if (hpi6000_dsp_block_read32(pao, dsp_index, address, in hpi6000_update_control_cache()
1699 } while (hpi6000_check_PCI2040_error_flag(pao, H6WRITE) in hpi6000_update_control_cache()
1710 hpios_dsplock_unlock(pao); in hpi6000_update_control_cache()
1715 static u16 get_dsp_index(struct hpi_adapter_obj *pao, struct hpi_message *phm) in get_dsp_index() argument
1736 static void hw_message(struct hpi_adapter_obj *pao, struct hpi_message *phm, in hw_message() argument
1741 struct hpi_hw_obj *phw = pao->priv; in hw_message()
1747 dsp_index = get_dsp_index(pao, phm); in hw_message()
1756 add_index = get_dsp_index(pao, &hm); in hw_message()
1764 hpios_dsplock_lock(pao); in hw_message()
1765 error = hpi6000_message_response_sequence(pao, dsp_index, phm, phr); in hw_message()
1776 error = hpi6000_send_data(pao, dsp_index, phm, phr); in hw_message()
1780 error = hpi6000_get_data(pao, dsp_index, phm, phr); in hw_message()
1787 error = hpi6000_message_response_sequence(pao, in hw_message()
1807 hpios_dsplock_unlock(pao); in hw_message()