Lines Matching refs:phw
141 static int wait_dsp_ack(struct hpi_hw_obj *phw, int state, int timeout_us);
143 static void send_dsp_command(struct hpi_hw_obj *phw, int cmd);
246 struct hpi_hw_obj *phw = pao->priv; in control_message() local
253 if (hpi_check_control_cache(phw->p_cache, phm, phr)) { in control_message()
270 hpi_cmn_control_cache_sync_to_msg(phw->p_cache, phm, in control_message()
503 struct hpi_hw_obj *phw; in adapter_delete() local
509 phw = pao->priv; in adapter_delete()
514 iowrite32(C6205_HDCR_WARMRESET, phw->prHDCR); in adapter_delete()
527 struct hpi_hw_obj *phw = pao->priv; in create_adapter_obj() local
537 phw->flag_outstream_just_reset[i] = 1; in create_adapter_obj()
540 phw->prHSR = in create_adapter_obj()
543 phw->prHDCR = in create_adapter_obj()
546 phw->prDSPP = in create_adapter_obj()
552 if (hpios_locked_mem_alloc(&phw->h_locked_mem, in create_adapter_obj()
555 phw->p_interface_buffer = NULL; in create_adapter_obj()
556 else if (hpios_locked_mem_get_virt_addr(&phw->h_locked_mem, in create_adapter_obj()
557 (void *)&phw->p_interface_buffer)) in create_adapter_obj()
558 phw->p_interface_buffer = NULL; in create_adapter_obj()
561 phw->p_interface_buffer); in create_adapter_obj()
563 if (phw->p_interface_buffer) { in create_adapter_obj()
564 memset((void *)phw->p_interface_buffer, 0, in create_adapter_obj()
566 phw->p_interface_buffer->dsp_ack = H620_HIF_UNKNOWN; in create_adapter_obj()
579 if (!phw->p_interface_buffer) in create_adapter_obj()
582 interface = phw->p_interface_buffer; in create_adapter_obj()
585 if (!wait_dsp_ack(phw, H620_HIF_RESET, HPI6205_TIMEOUT * 10)) { in create_adapter_obj()
596 err = hpios_locked_mem_alloc(&phw->h_control_cache, in create_adapter_obj()
600 err = hpios_locked_mem_get_virt_addr(&phw-> in create_adapter_obj()
607 phw->p_cache = in create_adapter_obj()
613 if (!phw->p_cache) in create_adapter_obj()
617 err = hpios_locked_mem_get_phys_addr(&phw-> in create_adapter_obj()
626 if (hpios_locked_mem_valid(&phw->h_control_cache)) in create_adapter_obj()
627 hpios_locked_mem_free(&phw->h_control_cache); in create_adapter_obj()
631 send_dsp_command(phw, H620_HIF_IDLE); in create_adapter_obj()
671 if (phw->p_cache) in create_adapter_obj()
672 phw->p_cache->adap_idx = pao->index; in create_adapter_obj()
685 struct hpi_hw_obj *phw = pao->priv; in delete_adapter_obj() local
688 if (hpios_locked_mem_valid(&phw->h_control_cache)) { in delete_adapter_obj()
689 hpios_locked_mem_free(&phw->h_control_cache); in delete_adapter_obj()
690 hpi_free_control_cache(phw->p_cache); in delete_adapter_obj()
693 if (hpios_locked_mem_valid(&phw->h_locked_mem)) { in delete_adapter_obj()
694 hpios_locked_mem_free(&phw->h_locked_mem); in delete_adapter_obj()
695 phw->p_interface_buffer = NULL; in delete_adapter_obj()
699 if (hpios_locked_mem_valid(&phw->instream_host_buffers[i])) { in delete_adapter_obj()
700 hpios_locked_mem_free(&phw->instream_host_buffers[i]); in delete_adapter_obj()
702 phw->instream_host_buffer_size[i] = 0; in delete_adapter_obj()
706 if (hpios_locked_mem_valid(&phw->outstream_host_buffers[i])) { in delete_adapter_obj()
707 hpios_locked_mem_free(&phw->outstream_host_buffers in delete_adapter_obj()
709 phw->outstream_host_buffer_size[i] = 0; in delete_adapter_obj()
711 kfree(phw); in delete_adapter_obj()
727 struct hpi_hw_obj *phw = pao->priv; in outstream_host_buffer_allocate() local
728 struct bus_master_interface *interface = phw->p_interface_buffer; in outstream_host_buffer_allocate()
742 phw->outstream_host_buffer_size[phm->obj_index]; in outstream_host_buffer_allocate()
746 if (phw->outstream_host_buffer_size[phm->obj_index] == in outstream_host_buffer_allocate()
752 if (hpios_locked_mem_valid(&phw->outstream_host_buffers[phm-> in outstream_host_buffer_allocate()
754 hpios_locked_mem_free(&phw->outstream_host_buffers in outstream_host_buffer_allocate()
757 err = hpios_locked_mem_alloc(&phw->outstream_host_buffers in outstream_host_buffer_allocate()
763 phw->outstream_host_buffer_size[phm->obj_index] = 0; in outstream_host_buffer_allocate()
768 (&phw->outstream_host_buffers[phm->obj_index], in outstream_host_buffer_allocate()
778 hpios_locked_mem_free(&phw->outstream_host_buffers in outstream_host_buffer_allocate()
780 phw->outstream_host_buffer_size[phm->obj_index] = 0; in outstream_host_buffer_allocate()
801 phw->outstream_host_buffer_size[phm->obj_index] = in outstream_host_buffer_allocate()
815 && hpios_locked_mem_valid(&phw-> in outstream_host_buffer_allocate()
817 hpios_locked_mem_free(&phw->outstream_host_buffers in outstream_host_buffer_allocate()
819 phw->outstream_host_buffer_size[phm->obj_index] = 0; in outstream_host_buffer_allocate()
827 struct hpi_hw_obj *phw = pao->priv; in outstream_host_buffer_get_info() local
828 struct bus_master_interface *interface = phw->p_interface_buffer; in outstream_host_buffer_get_info()
832 if (hpios_locked_mem_valid(&phw->outstream_host_buffers[phm-> in outstream_host_buffer_get_info()
834 if (hpios_locked_mem_get_virt_addr(&phw-> in outstream_host_buffer_get_info()
856 struct hpi_hw_obj *phw = pao->priv; in outstream_host_buffer_free() local
859 if (phw->outstream_host_buffer_size[phm->obj_index]) { in outstream_host_buffer_free()
862 phw->outstream_host_buffer_size[phm->obj_index] = 0; in outstream_host_buffer_free()
868 hpios_locked_mem_free(&phw->outstream_host_buffers in outstream_host_buffer_free()
888 struct hpi_hw_obj *phw = pao->priv; in outstream_write() local
889 struct bus_master_interface *interface = phw->p_interface_buffer; in outstream_write()
893 if (!phw->outstream_host_buffer_size[phm->obj_index]) { in outstream_write()
911 && hpios_locked_mem_valid(&phw->outstream_host_buffers[phm-> in outstream_write()
917 if (hpios_locked_mem_get_virt_addr(&phw-> in outstream_write()
945 if (phw->flag_outstream_just_reset[phm->obj_index]) { in outstream_write()
948 phw->flag_outstream_just_reset[phm->obj_index] = 0; in outstream_write()
962 struct hpi_hw_obj *phw = pao->priv; in outstream_get_info() local
963 struct bus_master_interface *interface = phw->p_interface_buffer; in outstream_get_info()
966 if (!phw->outstream_host_buffer_size[phm->obj_index]) { in outstream_get_info()
994 struct hpi_hw_obj *phw = pao->priv; in outstream_reset() local
995 phw->flag_outstream_just_reset[phm->obj_index] = 1; in outstream_reset()
1013 struct hpi_hw_obj *phw = pao->priv; in instream_host_buffer_allocate() local
1014 struct bus_master_interface *interface = phw->p_interface_buffer; in instream_host_buffer_allocate()
1024 phw->instream_host_buffer_size[phm->obj_index]; in instream_host_buffer_allocate()
1028 if (phw->instream_host_buffer_size[phm->obj_index] == in instream_host_buffer_allocate()
1034 if (hpios_locked_mem_valid(&phw->instream_host_buffers[phm-> in instream_host_buffer_allocate()
1036 hpios_locked_mem_free(&phw->instream_host_buffers in instream_host_buffer_allocate()
1039 err = hpios_locked_mem_alloc(&phw->instream_host_buffers[phm-> in instream_host_buffer_allocate()
1045 phw->instream_host_buffer_size[phm->obj_index] = 0; in instream_host_buffer_allocate()
1050 (&phw->instream_host_buffers[phm->obj_index], in instream_host_buffer_allocate()
1057 hpios_locked_mem_free(&phw->instream_host_buffers in instream_host_buffer_allocate()
1059 phw->instream_host_buffer_size[phm->obj_index] = 0; in instream_host_buffer_allocate()
1078 phw->instream_host_buffer_size[phm->obj_index] = in instream_host_buffer_allocate()
1092 && hpios_locked_mem_valid(&phw-> in instream_host_buffer_allocate()
1094 hpios_locked_mem_free(&phw->instream_host_buffers in instream_host_buffer_allocate()
1096 phw->instream_host_buffer_size[phm->obj_index] = 0; in instream_host_buffer_allocate()
1104 struct hpi_hw_obj *phw = pao->priv; in instream_host_buffer_get_info() local
1105 struct bus_master_interface *interface = phw->p_interface_buffer; in instream_host_buffer_get_info()
1109 if (hpios_locked_mem_valid(&phw->instream_host_buffers[phm-> in instream_host_buffer_get_info()
1111 if (hpios_locked_mem_get_virt_addr(&phw-> in instream_host_buffer_get_info()
1133 struct hpi_hw_obj *phw = pao->priv; in instream_host_buffer_free() local
1136 if (phw->instream_host_buffer_size[phm->obj_index]) { in instream_host_buffer_free()
1139 phw->instream_host_buffer_size[phm->obj_index] = 0; in instream_host_buffer_free()
1145 hpios_locked_mem_free(&phw->instream_host_buffers in instream_host_buffer_free()
1172 struct hpi_hw_obj *phw = pao->priv; in instream_read() local
1173 struct bus_master_interface *interface = phw->p_interface_buffer; in instream_read()
1180 if (!phw->instream_host_buffer_size[phm->obj_index]) { in instream_read()
1193 if (hpios_locked_mem_valid(&phw->instream_host_buffers[phm-> in instream_read()
1195 if (hpios_locked_mem_get_virt_addr(&phw-> in instream_read()
1223 struct hpi_hw_obj *phw = pao->priv; in instream_get_info() local
1224 struct bus_master_interface *interface = phw->p_interface_buffer; in instream_get_info()
1226 if (!phw->instream_host_buffer_size[phm->obj_index]) { in instream_get_info()
1252 struct hpi_hw_obj *phw = pao->priv; in adapter_boot_load_dsp() local
1289 iowrite32(temp, phw->prHDCR); in adapter_boot_load_dsp()
1293 temp = ioread32(phw->prHSR); in adapter_boot_load_dsp()
1299 iowrite32(temp, phw->prHSR); in adapter_boot_load_dsp()
1302 temp = ioread32(phw->prHDCR); in adapter_boot_load_dsp()
1309 iowrite32(temp, phw->prDSPP); in adapter_boot_load_dsp()
1310 if ((temp | C6205_DSPP_MAP1) != ioread32(phw->prDSPP)) in adapter_boot_load_dsp()
1313 iowrite32(temp, phw->prDSPP); in adapter_boot_load_dsp()
1314 if ((temp | C6205_DSPP_MAP1) != ioread32(phw->prDSPP)) in adapter_boot_load_dsp()
1317 iowrite32(temp, phw->prDSPP); in adapter_boot_load_dsp()
1318 if ((temp | C6205_DSPP_MAP1) != ioread32(phw->prDSPP)) in adapter_boot_load_dsp()
1322 iowrite32(temp, phw->prDSPP); in adapter_boot_load_dsp()
1323 if ((temp | C6205_DSPP_MAP1) != ioread32(phw->prDSPP)) in adapter_boot_load_dsp()
1325 phw->dsp_page = 0; in adapter_boot_load_dsp()
1453 if (phw->p_interface_buffer) { in adapter_boot_load_dsp()
1457 phw->p_interface_buffer; in adapter_boot_load_dsp()
1466 err = hpios_locked_mem_get_phys_addr(&phw->h_locked_mem, in adapter_boot_load_dsp()
1483 temp = ioread32(phw->prHSR); in adapter_boot_load_dsp()
1485 iowrite32(temp, phw->prHSR); in adapter_boot_load_dsp()
1488 temp = ioread32(phw->prHDCR); in adapter_boot_load_dsp()
1490 iowrite32(temp, phw->prHDCR); in adapter_boot_load_dsp()
1504 struct hpi_hw_obj *phw = pao->priv; in boot_loader_read_mem32() local
1519 if (dw4M_page != phw->dsp_page) { in boot_loader_read_mem32()
1520 phw->dsp_page = dw4M_page; in boot_loader_read_mem32()
1522 iowrite32(phw->dsp_page, phw->prDSPP); in boot_loader_read_mem32()
1546 struct hpi_hw_obj *phw = pao->priv; in boot_loader_write_mem32() local
1562 if (dw4M_page != phw->dsp_page) { in boot_loader_write_mem32()
1563 phw->dsp_page = dw4M_page; in boot_loader_write_mem32()
1565 iowrite32(phw->dsp_page, phw->prDSPP); in boot_loader_write_mem32()
1978 struct hpi_hw_obj *phw = pao->priv; in hpi6205_transfer_data() local
1982 struct bus_master_interface *interface = phw->p_interface_buffer; in hpi6205_transfer_data()
1990 if (!wait_dsp_ack(phw, H620_HIF_IDLE, HPI6205_TIMEOUT)) in hpi6205_transfer_data()
2007 send_dsp_command(phw, operation); in hpi6205_transfer_data()
2009 temp2 = wait_dsp_ack(phw, operation, HPI6205_TIMEOUT); in hpi6205_transfer_data()
2032 send_dsp_command(phw, H620_HIF_IDLE); in hpi6205_transfer_data()
2040 static int wait_dsp_ack(struct hpi_hw_obj *phw, int state, int timeout_us) in wait_dsp_ack() argument
2042 struct bus_master_interface *interface = phw->p_interface_buffer; in wait_dsp_ack()
2056 static void send_dsp_command(struct hpi_hw_obj *phw, int cmd) in send_dsp_command() argument
2058 struct bus_master_interface *interface = phw->p_interface_buffer; in send_dsp_command()
2064 r = ioread32(phw->prHDCR); in send_dsp_command()
2066 iowrite32(r, phw->prHDCR); in send_dsp_command()
2068 iowrite32(r, phw->prHDCR); in send_dsp_command()
2077 struct hpi_hw_obj *phw = pao->priv; in message_response_sequence() local
2078 struct bus_master_interface *interface = phw->p_interface_buffer; in message_response_sequence()
2095 if (!wait_dsp_ack(phw, H620_HIF_IDLE, HPI6205_TIMEOUT)) { in message_response_sequence()
2102 send_dsp_command(phw, H620_HIF_GET_RESP); in message_response_sequence()
2104 time_out2 = wait_dsp_ack(phw, H620_HIF_GET_RESP, HPI6205_TIMEOUT); in message_response_sequence()
2137 send_dsp_command(phw, H620_HIF_IDLE); in message_response_sequence()
2146 if (!wait_dsp_ack(phw, H620_HIF_IDLE, HPI6205_TIMEOUT)) { in message_response_sequence()