Lines Matching full:isp
232 ipu6_pkg_dir_configure_spc(struct ipu6_device *isp, in ipu6_pkg_dir_configure_spc() argument
245 dma_addr = sg_dma_address(isp->isys->fw_sgt.sgl); in ipu6_pkg_dir_configure_spc()
247 dma_addr = sg_dma_address(isp->psys->fw_sgt.sgl); in ipu6_pkg_dir_configure_spc()
250 prog = (struct ipu6_cell_program *)((u64)isp->cpd_fw->data + pg_offset); in ipu6_pkg_dir_configure_spc()
253 dev_warn(&isp->pdev->dev, in ipu6_pkg_dir_configure_spc()
264 void ipu6_configure_spc(struct ipu6_device *isp, in ipu6_configure_spc() argument
277 if (isp->secure_mode) in ipu6_configure_spc()
280 ipu6_pkg_dir_configure_spc(isp, hw_variant, pkg_dir_idx, base, in ipu6_configure_spc()
290 static void ipu6_internal_pdata_init(struct ipu6_device *isp) in ipu6_internal_pdata_init() argument
292 u8 hw_ver = isp->hw_ver; in ipu6_internal_pdata_init()
485 static void ipu6_configure_vc_mechanism(struct ipu6_device *isp) in ipu6_configure_vc_mechanism() argument
487 u32 val = readl(isp->base + BUTTRESS_REG_BTRS_CTRL); in ipu6_configure_vc_mechanism()
499 writel(val, isp->base + BUTTRESS_REG_BTRS_CTRL); in ipu6_configure_vc_mechanism()
508 struct ipu6_device *isp; in ipu6_pci_probe() local
513 isp = devm_kzalloc(dev, sizeof(*isp), GFP_KERNEL); in ipu6_pci_probe()
514 if (!isp) in ipu6_pci_probe()
517 isp->pdev = pdev; in ipu6_pci_probe()
518 INIT_LIST_HEAD(&isp->devices); in ipu6_pci_probe()
531 isp->base = pcim_iomap_table(pdev)[IPU6_PCI_BAR]; in ipu6_pci_probe()
532 pci_set_drvdata(pdev, isp); in ipu6_pci_probe()
535 isp->cpd_metadata_cmpnt_size = sizeof(struct ipu6_cpd_metadata_cmpnt); in ipu6_pci_probe()
538 isp->hw_ver = IPU6_VER_6; in ipu6_pci_probe()
539 isp->cpd_fw_name = IPU6_FIRMWARE_NAME; in ipu6_pci_probe()
542 isp->hw_ver = IPU6_VER_6SE; in ipu6_pci_probe()
543 isp->cpd_fw_name = IPU6SE_FIRMWARE_NAME; in ipu6_pci_probe()
544 isp->cpd_metadata_cmpnt_size = in ipu6_pci_probe()
549 isp->hw_ver = IPU6_VER_6EP; in ipu6_pci_probe()
550 isp->cpd_fw_name = IPU6EP_FIRMWARE_NAME; in ipu6_pci_probe()
553 isp->hw_ver = IPU6_VER_6EP; in ipu6_pci_probe()
554 isp->cpd_fw_name = IPU6EPADLN_FIRMWARE_NAME; in ipu6_pci_probe()
557 isp->hw_ver = IPU6_VER_6EP_MTL; in ipu6_pci_probe()
558 isp->cpd_fw_name = IPU6EPMTL_FIRMWARE_NAME; in ipu6_pci_probe()
566 ipu6_internal_pdata_init(isp); in ipu6_pci_probe()
568 isys_base = isp->base + isys_ipdata.hw_variant.offset; in ipu6_pci_probe()
569 psys_base = isp->base + psys_ipdata.hw_variant.offset; in ipu6_pci_probe()
577 ret = ipu6_pci_config_setup(pdev, isp->hw_ver); in ipu6_pci_probe()
581 ret = ipu6_buttress_init(isp); in ipu6_pci_probe()
585 ret = request_firmware(&isp->cpd_fw, isp->cpd_fw_name, dev); in ipu6_pci_probe()
587 dev_err_probe(&isp->pdev->dev, ret, in ipu6_pci_probe()
589 isp->cpd_fw_name); in ipu6_pci_probe()
593 ret = ipu6_cpd_validate_cpd_file(isp, isp->cpd_fw->data, in ipu6_pci_probe()
594 isp->cpd_fw->size); in ipu6_pci_probe()
596 dev_err_probe(&isp->pdev->dev, ret, in ipu6_pci_probe()
608 isp->isys = ipu6_isys_init(pdev, dev, isys_ctrl, isys_base, in ipu6_pci_probe()
610 if (IS_ERR(isp->isys)) { in ipu6_pci_probe()
611 ret = PTR_ERR(isp->isys); in ipu6_pci_probe()
622 isp->psys = ipu6_psys_init(pdev, &isp->isys->auxdev.dev, psys_ctrl, in ipu6_pci_probe()
624 if (IS_ERR(isp->psys)) { in ipu6_pci_probe()
625 ret = PTR_ERR(isp->psys); in ipu6_pci_probe()
629 ret = pm_runtime_resume_and_get(&isp->psys->auxdev.dev); in ipu6_pci_probe()
633 ret = ipu6_mmu_hw_init(isp->psys->mmu); in ipu6_pci_probe()
635 dev_err_probe(&isp->pdev->dev, ret, in ipu6_pci_probe()
640 ret = ipu6_buttress_map_fw_image(isp->psys, isp->cpd_fw, in ipu6_pci_probe()
641 &isp->psys->fw_sgt); in ipu6_pci_probe()
643 dev_err_probe(&isp->pdev->dev, ret, "failed to map fw image\n"); in ipu6_pci_probe()
647 ret = ipu6_cpd_create_pkg_dir(isp->psys, isp->cpd_fw->data); in ipu6_pci_probe()
649 dev_err_probe(&isp->pdev->dev, ret, in ipu6_pci_probe()
656 IRQF_SHARED, IPU6_NAME, isp); in ipu6_pci_probe()
662 ret = ipu6_buttress_authenticate(isp); in ipu6_pci_probe()
664 dev_err_probe(&isp->pdev->dev, ret, in ipu6_pci_probe()
669 ipu6_mmu_hw_cleanup(isp->psys->mmu); in ipu6_pci_probe()
670 pm_runtime_put(&isp->psys->auxdev.dev); in ipu6_pci_probe()
673 ipu6_configure_vc_mechanism(isp); in ipu6_pci_probe()
675 val = readl(isp->base + BUTTRESS_REG_SKU); in ipu6_pci_probe()
679 pdev->device, isp->hw_ver); in ipu6_pci_probe()
684 isp->bus_ready_to_probe = true; in ipu6_pci_probe()
689 devm_free_irq(dev, pdev->irq, isp); in ipu6_pci_probe()
691 if (isp->psys) { in ipu6_pci_probe()
692 ipu6_cpd_free_pkg_dir(isp->psys); in ipu6_pci_probe()
693 ipu6_buttress_unmap_fw_image(isp->psys, &isp->psys->fw_sgt); in ipu6_pci_probe()
695 if (!IS_ERR_OR_NULL(isp->psys) && !IS_ERR_OR_NULL(isp->psys->mmu)) in ipu6_pci_probe()
696 ipu6_mmu_cleanup(isp->psys->mmu); in ipu6_pci_probe()
697 if (!IS_ERR_OR_NULL(isp->isys) && !IS_ERR_OR_NULL(isp->isys->mmu)) in ipu6_pci_probe()
698 ipu6_mmu_cleanup(isp->isys->mmu); in ipu6_pci_probe()
700 release_firmware(isp->cpd_fw); in ipu6_pci_probe()
702 ipu6_buttress_exit(isp); in ipu6_pci_probe()
709 struct ipu6_device *isp = pci_get_drvdata(pdev); in ipu6_pci_remove() local
710 struct ipu6_mmu *isys_mmu = isp->isys->mmu; in ipu6_pci_remove()
711 struct ipu6_mmu *psys_mmu = isp->psys->mmu; in ipu6_pci_remove()
713 devm_free_irq(&pdev->dev, pdev->irq, isp); in ipu6_pci_remove()
714 ipu6_cpd_free_pkg_dir(isp->psys); in ipu6_pci_remove()
716 ipu6_buttress_unmap_fw_image(isp->psys, &isp->psys->fw_sgt); in ipu6_pci_remove()
717 ipu6_buttress_exit(isp); in ipu6_pci_remove()
724 release_firmware(isp->cpd_fw); in ipu6_pci_remove()
732 struct ipu6_device *isp = pci_get_drvdata(pdev); in ipu6_pci_reset_prepare() local
734 pm_runtime_forbid(&isp->pdev->dev); in ipu6_pci_reset_prepare()
739 struct ipu6_device *isp = pci_get_drvdata(pdev); in ipu6_pci_reset_done() local
741 ipu6_buttress_restore(isp); in ipu6_pci_reset_done()
742 if (isp->secure_mode) in ipu6_pci_reset_done()
743 ipu6_buttress_reset_authentication(isp); in ipu6_pci_reset_done()
745 isp->need_ipc_reset = true; in ipu6_pci_reset_done()
746 pm_runtime_allow(&isp->pdev->dev); in ipu6_pci_reset_done()
761 struct ipu6_device *isp = pci_get_drvdata(pdev); in ipu6_resume() local
762 struct ipu6_buttress *b = &isp->buttress; in ipu6_resume()
766 ipu6_configure_vc_mechanism(isp); in ipu6_resume()
768 isp->secure_mode = ipu6_buttress_get_secure_mode(isp); in ipu6_resume()
770 isp->secure_mode ? "secure" : "non-secure"); in ipu6_resume()
772 ipu6_buttress_restore(isp); in ipu6_resume()
774 ret = ipu6_buttress_ipc_reset(isp, &b->cse); in ipu6_resume()
776 dev_err(&isp->pdev->dev, "IPC reset protocol failed!\n"); in ipu6_resume()
778 ret = pm_runtime_resume_and_get(&isp->psys->auxdev.dev); in ipu6_resume()
780 dev_err(&isp->psys->auxdev.dev, "Failed to get runtime PM\n"); in ipu6_resume()
784 ret = ipu6_buttress_authenticate(isp); in ipu6_resume()
786 dev_err(&isp->pdev->dev, "FW authentication failed(%d)\n", ret); in ipu6_resume()
788 pm_runtime_put(&isp->psys->auxdev.dev); in ipu6_resume()
796 struct ipu6_device *isp = pci_get_drvdata(pdev); in ipu6_runtime_resume() local
799 ipu6_configure_vc_mechanism(isp); in ipu6_runtime_resume()
800 ipu6_buttress_restore(isp); in ipu6_runtime_resume()
802 if (isp->need_ipc_reset) { in ipu6_runtime_resume()
803 struct ipu6_buttress *b = &isp->buttress; in ipu6_runtime_resume()
805 isp->need_ipc_reset = false; in ipu6_runtime_resume()
806 ret = ipu6_buttress_ipc_reset(isp, &b->cse); in ipu6_runtime_resume()
808 dev_err(&isp->pdev->dev, "IPC reset protocol failed\n"); in ipu6_runtime_resume()