qproc 228 drivers/remoteproc/qcom_q6v5_mss.c static int q6v5_regulator_enable(struct q6v5 *qproc, qproc 239 drivers/remoteproc/qcom_q6v5_mss.c dev_err(qproc->dev, qproc 250 drivers/remoteproc/qcom_q6v5_mss.c dev_err(qproc->dev, qproc 258 drivers/remoteproc/qcom_q6v5_mss.c dev_err(qproc->dev, "Regulator enable failed\n"); qproc 278 drivers/remoteproc/qcom_q6v5_mss.c static void q6v5_regulator_disable(struct q6v5 *qproc, qproc 325 drivers/remoteproc/qcom_q6v5_mss.c static int q6v5_pds_enable(struct q6v5 *qproc, struct device **pds, qproc 349 drivers/remoteproc/qcom_q6v5_mss.c static void q6v5_pds_disable(struct q6v5 *qproc, struct device **pds, qproc 360 drivers/remoteproc/qcom_q6v5_mss.c static int q6v5_xfer_mem_ownership(struct q6v5 *qproc, int *current_perm, qproc 366 drivers/remoteproc/qcom_q6v5_mss.c if (!qproc->need_mem_protection) qproc 382 drivers/remoteproc/qcom_q6v5_mss.c struct q6v5 *qproc = rproc->priv; qproc 384 drivers/remoteproc/qcom_q6v5_mss.c memcpy(qproc->mba_region, fw->data, fw->size); qproc 389 drivers/remoteproc/qcom_q6v5_mss.c static int q6v5_reset_assert(struct q6v5 *qproc) qproc 393 drivers/remoteproc/qcom_q6v5_mss.c if (qproc->has_alt_reset) { qproc 394 drivers/remoteproc/qcom_q6v5_mss.c reset_control_assert(qproc->pdc_reset); qproc 395 drivers/remoteproc/qcom_q6v5_mss.c ret = reset_control_reset(qproc->mss_restart); qproc 396 drivers/remoteproc/qcom_q6v5_mss.c reset_control_deassert(qproc->pdc_reset); qproc 398 drivers/remoteproc/qcom_q6v5_mss.c ret = reset_control_assert(qproc->mss_restart); qproc 404 drivers/remoteproc/qcom_q6v5_mss.c static int q6v5_reset_deassert(struct q6v5 *qproc) qproc 408 drivers/remoteproc/qcom_q6v5_mss.c if (qproc->has_alt_reset) { qproc 409 drivers/remoteproc/qcom_q6v5_mss.c reset_control_assert(qproc->pdc_reset); qproc 410 drivers/remoteproc/qcom_q6v5_mss.c writel(1, qproc->rmb_base + RMB_MBA_ALT_RESET); qproc 411 drivers/remoteproc/qcom_q6v5_mss.c ret = reset_control_reset(qproc->mss_restart); qproc 412 drivers/remoteproc/qcom_q6v5_mss.c writel(0, qproc->rmb_base + RMB_MBA_ALT_RESET); qproc 413 drivers/remoteproc/qcom_q6v5_mss.c reset_control_deassert(qproc->pdc_reset); qproc 415 drivers/remoteproc/qcom_q6v5_mss.c ret = reset_control_deassert(qproc->mss_restart); qproc 421 drivers/remoteproc/qcom_q6v5_mss.c static int q6v5_rmb_pbl_wait(struct q6v5 *qproc, int ms) qproc 428 drivers/remoteproc/qcom_q6v5_mss.c val = readl(qproc->rmb_base + RMB_PBL_STATUS_REG); qproc 441 drivers/remoteproc/qcom_q6v5_mss.c static int q6v5_rmb_mba_wait(struct q6v5 *qproc, u32 status, int ms) qproc 449 drivers/remoteproc/qcom_q6v5_mss.c val = readl(qproc->rmb_base + RMB_MBA_STATUS_REG); qproc 467 drivers/remoteproc/qcom_q6v5_mss.c static int q6v5proc_reset(struct q6v5 *qproc) qproc 473 drivers/remoteproc/qcom_q6v5_mss.c if (qproc->version == MSS_SDM845) { qproc 474 drivers/remoteproc/qcom_q6v5_mss.c val = readl(qproc->reg_base + QDSP6SS_SLEEP); qproc 476 drivers/remoteproc/qcom_q6v5_mss.c writel(val, qproc->reg_base + QDSP6SS_SLEEP); qproc 478 drivers/remoteproc/qcom_q6v5_mss.c ret = readl_poll_timeout(qproc->reg_base + QDSP6SS_SLEEP, qproc 482 drivers/remoteproc/qcom_q6v5_mss.c dev_err(qproc->dev, "QDSP6SS Sleep clock timed out\n"); qproc 487 drivers/remoteproc/qcom_q6v5_mss.c writel(1, qproc->reg_base + QDSP6SS_BOOT_CORE_START); qproc 489 drivers/remoteproc/qcom_q6v5_mss.c writel(1, qproc->reg_base + QDSP6SS_BOOT_CMD); qproc 491 drivers/remoteproc/qcom_q6v5_mss.c ret = readl_poll_timeout(qproc->rmb_base + RMB_MBA_MSS_STATUS, qproc 494 drivers/remoteproc/qcom_q6v5_mss.c dev_err(qproc->dev, "Boot FSM failed to complete.\n"); qproc 496 drivers/remoteproc/qcom_q6v5_mss.c q6v5_reset_deassert(qproc); qproc 501 drivers/remoteproc/qcom_q6v5_mss.c } else if (qproc->version == MSS_MSM8996) { qproc 504 drivers/remoteproc/qcom_q6v5_mss.c qproc->reg_base + QDSP6SS_STRAP_ACC); qproc 507 drivers/remoteproc/qcom_q6v5_mss.c val = readl(qproc->reg_base + QDSP6SS_RESET_REG); qproc 509 drivers/remoteproc/qcom_q6v5_mss.c writel(val, qproc->reg_base + QDSP6SS_RESET_REG); qproc 512 drivers/remoteproc/qcom_q6v5_mss.c val = readl(qproc->reg_base + QDSP6SS_XO_CBCR); qproc 514 drivers/remoteproc/qcom_q6v5_mss.c writel(val, qproc->reg_base + QDSP6SS_XO_CBCR); qproc 517 drivers/remoteproc/qcom_q6v5_mss.c ret = readl_poll_timeout(qproc->reg_base + QDSP6SS_XO_CBCR, qproc 521 drivers/remoteproc/qcom_q6v5_mss.c dev_err(qproc->dev, qproc 526 drivers/remoteproc/qcom_q6v5_mss.c val = readl(qproc->reg_base + QDSP6SS_PWR_CTL_REG); qproc 528 drivers/remoteproc/qcom_q6v5_mss.c writel(val, qproc->reg_base + QDSP6SS_PWR_CTL_REG); qproc 529 drivers/remoteproc/qcom_q6v5_mss.c val |= readl(qproc->reg_base + QDSP6SS_PWR_CTL_REG); qproc 534 drivers/remoteproc/qcom_q6v5_mss.c writel(val, qproc->reg_base + QDSP6SS_PWR_CTL_REG); qproc 537 drivers/remoteproc/qcom_q6v5_mss.c val = readl(qproc->reg_base + QDSP6SS_PWR_CTL_REG); qproc 539 drivers/remoteproc/qcom_q6v5_mss.c writel(val, qproc->reg_base + QDSP6SS_PWR_CTL_REG); qproc 543 drivers/remoteproc/qcom_q6v5_mss.c writel(val, qproc->reg_base + QDSP6SS_PWR_CTL_REG); qproc 546 drivers/remoteproc/qcom_q6v5_mss.c val = readl(qproc->reg_base + QDSP6SS_MEM_PWR_CTL); qproc 549 drivers/remoteproc/qcom_q6v5_mss.c writel(val, qproc->reg_base + qproc 556 drivers/remoteproc/qcom_q6v5_mss.c val |= readl(qproc->reg_base + QDSP6SS_MEM_PWR_CTL); qproc 560 drivers/remoteproc/qcom_q6v5_mss.c val = readl(qproc->reg_base + QDSP6SS_PWR_CTL_REG); qproc 562 drivers/remoteproc/qcom_q6v5_mss.c writel(val, qproc->reg_base + QDSP6SS_PWR_CTL_REG); qproc 565 drivers/remoteproc/qcom_q6v5_mss.c val = readl(qproc->reg_base + QDSP6SS_RESET_REG); qproc 567 drivers/remoteproc/qcom_q6v5_mss.c writel(val, qproc->reg_base + QDSP6SS_RESET_REG); qproc 570 drivers/remoteproc/qcom_q6v5_mss.c val = readl(qproc->reg_base + QDSP6SS_PWR_CTL_REG); qproc 572 drivers/remoteproc/qcom_q6v5_mss.c writel(val, qproc->reg_base + QDSP6SS_PWR_CTL_REG); qproc 573 drivers/remoteproc/qcom_q6v5_mss.c val |= readl(qproc->reg_base + QDSP6SS_PWR_CTL_REG); qproc 579 drivers/remoteproc/qcom_q6v5_mss.c val = readl(qproc->reg_base + QDSP6SS_PWR_CTL_REG); qproc 582 drivers/remoteproc/qcom_q6v5_mss.c writel(val, qproc->reg_base + QDSP6SS_PWR_CTL_REG); qproc 584 drivers/remoteproc/qcom_q6v5_mss.c writel(val, qproc->reg_base + QDSP6SS_PWR_CTL_REG); qproc 586 drivers/remoteproc/qcom_q6v5_mss.c writel(val, qproc->reg_base + QDSP6SS_PWR_CTL_REG); qproc 588 drivers/remoteproc/qcom_q6v5_mss.c writel(val, qproc->reg_base + QDSP6SS_PWR_CTL_REG); qproc 592 drivers/remoteproc/qcom_q6v5_mss.c writel(val, qproc->reg_base + QDSP6SS_PWR_CTL_REG); qproc 595 drivers/remoteproc/qcom_q6v5_mss.c val = readl(qproc->reg_base + QDSP6SS_RESET_REG); qproc 597 drivers/remoteproc/qcom_q6v5_mss.c writel(val, qproc->reg_base + QDSP6SS_RESET_REG); qproc 600 drivers/remoteproc/qcom_q6v5_mss.c val = readl(qproc->reg_base + QDSP6SS_GFMUX_CTL_REG); qproc 602 drivers/remoteproc/qcom_q6v5_mss.c writel(val, qproc->reg_base + QDSP6SS_GFMUX_CTL_REG); qproc 605 drivers/remoteproc/qcom_q6v5_mss.c val = readl(qproc->reg_base + QDSP6SS_RESET_REG); qproc 607 drivers/remoteproc/qcom_q6v5_mss.c writel(val, qproc->reg_base + QDSP6SS_RESET_REG); qproc 611 drivers/remoteproc/qcom_q6v5_mss.c ret = q6v5_rmb_pbl_wait(qproc, 1000); qproc 613 drivers/remoteproc/qcom_q6v5_mss.c dev_err(qproc->dev, "PBL boot timed out\n"); qproc 615 drivers/remoteproc/qcom_q6v5_mss.c dev_err(qproc->dev, "PBL returned unexpected status %d\n", ret); qproc 624 drivers/remoteproc/qcom_q6v5_mss.c static void q6v5proc_halt_axi_port(struct q6v5 *qproc, qproc 652 drivers/remoteproc/qcom_q6v5_mss.c dev_err(qproc->dev, "port failed halt\n"); qproc 658 drivers/remoteproc/qcom_q6v5_mss.c static int q6v5_mpss_init_image(struct q6v5 *qproc, const struct firmware *fw) qproc 673 drivers/remoteproc/qcom_q6v5_mss.c ptr = dma_alloc_attrs(qproc->dev, size, &phys, GFP_KERNEL, dma_attrs); qproc 676 drivers/remoteproc/qcom_q6v5_mss.c dev_err(qproc->dev, "failed to allocate mdt buffer\n"); qproc 684 drivers/remoteproc/qcom_q6v5_mss.c ret = q6v5_xfer_mem_ownership(qproc, &mdata_perm, true, phys, size); qproc 686 drivers/remoteproc/qcom_q6v5_mss.c dev_err(qproc->dev, qproc 692 drivers/remoteproc/qcom_q6v5_mss.c writel(phys, qproc->rmb_base + RMB_PMI_META_DATA_REG); qproc 693 drivers/remoteproc/qcom_q6v5_mss.c writel(RMB_CMD_META_DATA_READY, qproc->rmb_base + RMB_MBA_COMMAND_REG); qproc 695 drivers/remoteproc/qcom_q6v5_mss.c ret = q6v5_rmb_mba_wait(qproc, RMB_MBA_META_DATA_AUTH_SUCCESS, 1000); qproc 697 drivers/remoteproc/qcom_q6v5_mss.c dev_err(qproc->dev, "MPSS header authentication timed out\n"); qproc 699 drivers/remoteproc/qcom_q6v5_mss.c dev_err(qproc->dev, "MPSS header authentication failed: %d\n", ret); qproc 702 drivers/remoteproc/qcom_q6v5_mss.c xferop_ret = q6v5_xfer_mem_ownership(qproc, &mdata_perm, false, phys, size); qproc 704 drivers/remoteproc/qcom_q6v5_mss.c dev_warn(qproc->dev, qproc 708 drivers/remoteproc/qcom_q6v5_mss.c dma_free_attrs(qproc->dev, size, ptr, phys, dma_attrs); qproc 728 drivers/remoteproc/qcom_q6v5_mss.c static int q6v5_mba_load(struct q6v5 *qproc) qproc 733 drivers/remoteproc/qcom_q6v5_mss.c qcom_q6v5_prepare(&qproc->q6v5); qproc 735 drivers/remoteproc/qcom_q6v5_mss.c ret = q6v5_pds_enable(qproc, qproc->active_pds, qproc->active_pd_count); qproc 737 drivers/remoteproc/qcom_q6v5_mss.c dev_err(qproc->dev, "failed to enable active power domains\n"); qproc 741 drivers/remoteproc/qcom_q6v5_mss.c ret = q6v5_pds_enable(qproc, qproc->proxy_pds, qproc->proxy_pd_count); qproc 743 drivers/remoteproc/qcom_q6v5_mss.c dev_err(qproc->dev, "failed to enable proxy power domains\n"); qproc 747 drivers/remoteproc/qcom_q6v5_mss.c ret = q6v5_regulator_enable(qproc, qproc->proxy_regs, qproc 748 drivers/remoteproc/qcom_q6v5_mss.c qproc->proxy_reg_count); qproc 750 drivers/remoteproc/qcom_q6v5_mss.c dev_err(qproc->dev, "failed to enable proxy supplies\n"); qproc 754 drivers/remoteproc/qcom_q6v5_mss.c ret = q6v5_clk_enable(qproc->dev, qproc->proxy_clks, qproc 755 drivers/remoteproc/qcom_q6v5_mss.c qproc->proxy_clk_count); qproc 757 drivers/remoteproc/qcom_q6v5_mss.c dev_err(qproc->dev, "failed to enable proxy clocks\n"); qproc 761 drivers/remoteproc/qcom_q6v5_mss.c ret = q6v5_regulator_enable(qproc, qproc->active_regs, qproc 762 drivers/remoteproc/qcom_q6v5_mss.c qproc->active_reg_count); qproc 764 drivers/remoteproc/qcom_q6v5_mss.c dev_err(qproc->dev, "failed to enable supplies\n"); qproc 768 drivers/remoteproc/qcom_q6v5_mss.c ret = q6v5_clk_enable(qproc->dev, qproc->reset_clks, qproc 769 drivers/remoteproc/qcom_q6v5_mss.c qproc->reset_clk_count); qproc 771 drivers/remoteproc/qcom_q6v5_mss.c dev_err(qproc->dev, "failed to enable reset clocks\n"); qproc 775 drivers/remoteproc/qcom_q6v5_mss.c ret = q6v5_reset_deassert(qproc); qproc 777 drivers/remoteproc/qcom_q6v5_mss.c dev_err(qproc->dev, "failed to deassert mss restart\n"); qproc 781 drivers/remoteproc/qcom_q6v5_mss.c ret = q6v5_clk_enable(qproc->dev, qproc->active_clks, qproc 782 drivers/remoteproc/qcom_q6v5_mss.c qproc->active_clk_count); qproc 784 drivers/remoteproc/qcom_q6v5_mss.c dev_err(qproc->dev, "failed to enable clocks\n"); qproc 789 drivers/remoteproc/qcom_q6v5_mss.c ret = q6v5_xfer_mem_ownership(qproc, &qproc->mba_perm, true, qproc 790 drivers/remoteproc/qcom_q6v5_mss.c qproc->mba_phys, qproc->mba_size); qproc 792 drivers/remoteproc/qcom_q6v5_mss.c dev_err(qproc->dev, qproc 797 drivers/remoteproc/qcom_q6v5_mss.c writel(qproc->mba_phys, qproc->rmb_base + RMB_MBA_IMAGE_REG); qproc 799 drivers/remoteproc/qcom_q6v5_mss.c ret = q6v5proc_reset(qproc); qproc 803 drivers/remoteproc/qcom_q6v5_mss.c ret = q6v5_rmb_mba_wait(qproc, 0, 5000); qproc 805 drivers/remoteproc/qcom_q6v5_mss.c dev_err(qproc->dev, "MBA boot timed out\n"); qproc 809 drivers/remoteproc/qcom_q6v5_mss.c dev_err(qproc->dev, "MBA returned unexpected status %d\n", ret); qproc 814 drivers/remoteproc/qcom_q6v5_mss.c qproc->dump_mba_loaded = true; qproc 818 drivers/remoteproc/qcom_q6v5_mss.c q6v5proc_halt_axi_port(qproc, qproc->halt_map, qproc->halt_q6); qproc 819 drivers/remoteproc/qcom_q6v5_mss.c q6v5proc_halt_axi_port(qproc, qproc->halt_map, qproc->halt_modem); qproc 820 drivers/remoteproc/qcom_q6v5_mss.c q6v5proc_halt_axi_port(qproc, qproc->halt_map, qproc->halt_nc); qproc 823 drivers/remoteproc/qcom_q6v5_mss.c xfermemop_ret = q6v5_xfer_mem_ownership(qproc, &qproc->mba_perm, false, qproc 824 drivers/remoteproc/qcom_q6v5_mss.c qproc->mba_phys, qproc 825 drivers/remoteproc/qcom_q6v5_mss.c qproc->mba_size); qproc 827 drivers/remoteproc/qcom_q6v5_mss.c dev_err(qproc->dev, qproc 832 drivers/remoteproc/qcom_q6v5_mss.c q6v5_clk_disable(qproc->dev, qproc->active_clks, qproc 833 drivers/remoteproc/qcom_q6v5_mss.c qproc->active_clk_count); qproc 835 drivers/remoteproc/qcom_q6v5_mss.c q6v5_reset_assert(qproc); qproc 837 drivers/remoteproc/qcom_q6v5_mss.c q6v5_clk_disable(qproc->dev, qproc->reset_clks, qproc 838 drivers/remoteproc/qcom_q6v5_mss.c qproc->reset_clk_count); qproc 840 drivers/remoteproc/qcom_q6v5_mss.c q6v5_regulator_disable(qproc, qproc->active_regs, qproc 841 drivers/remoteproc/qcom_q6v5_mss.c qproc->active_reg_count); qproc 843 drivers/remoteproc/qcom_q6v5_mss.c q6v5_clk_disable(qproc->dev, qproc->proxy_clks, qproc 844 drivers/remoteproc/qcom_q6v5_mss.c qproc->proxy_clk_count); qproc 846 drivers/remoteproc/qcom_q6v5_mss.c q6v5_regulator_disable(qproc, qproc->proxy_regs, qproc 847 drivers/remoteproc/qcom_q6v5_mss.c qproc->proxy_reg_count); qproc 849 drivers/remoteproc/qcom_q6v5_mss.c q6v5_pds_disable(qproc, qproc->proxy_pds, qproc->proxy_pd_count); qproc 851 drivers/remoteproc/qcom_q6v5_mss.c q6v5_pds_disable(qproc, qproc->active_pds, qproc->active_pd_count); qproc 853 drivers/remoteproc/qcom_q6v5_mss.c qcom_q6v5_unprepare(&qproc->q6v5); qproc 858 drivers/remoteproc/qcom_q6v5_mss.c static void q6v5_mba_reclaim(struct q6v5 *qproc) qproc 863 drivers/remoteproc/qcom_q6v5_mss.c qproc->dump_mba_loaded = false; qproc 865 drivers/remoteproc/qcom_q6v5_mss.c q6v5proc_halt_axi_port(qproc, qproc->halt_map, qproc->halt_q6); qproc 866 drivers/remoteproc/qcom_q6v5_mss.c q6v5proc_halt_axi_port(qproc, qproc->halt_map, qproc->halt_modem); qproc 867 drivers/remoteproc/qcom_q6v5_mss.c q6v5proc_halt_axi_port(qproc, qproc->halt_map, qproc->halt_nc); qproc 868 drivers/remoteproc/qcom_q6v5_mss.c if (qproc->version == MSS_MSM8996) { qproc 872 drivers/remoteproc/qcom_q6v5_mss.c val = readl(qproc->reg_base + QDSP6SS_PWR_CTL_REG); qproc 875 drivers/remoteproc/qcom_q6v5_mss.c writel(val, qproc->reg_base + QDSP6SS_PWR_CTL_REG); qproc 878 drivers/remoteproc/qcom_q6v5_mss.c q6v5_reset_assert(qproc); qproc 880 drivers/remoteproc/qcom_q6v5_mss.c q6v5_clk_disable(qproc->dev, qproc->reset_clks, qproc 881 drivers/remoteproc/qcom_q6v5_mss.c qproc->reset_clk_count); qproc 882 drivers/remoteproc/qcom_q6v5_mss.c q6v5_clk_disable(qproc->dev, qproc->active_clks, qproc 883 drivers/remoteproc/qcom_q6v5_mss.c qproc->active_clk_count); qproc 884 drivers/remoteproc/qcom_q6v5_mss.c q6v5_regulator_disable(qproc, qproc->active_regs, qproc 885 drivers/remoteproc/qcom_q6v5_mss.c qproc->active_reg_count); qproc 886 drivers/remoteproc/qcom_q6v5_mss.c q6v5_pds_disable(qproc, qproc->active_pds, qproc->active_pd_count); qproc 891 drivers/remoteproc/qcom_q6v5_mss.c ret = q6v5_xfer_mem_ownership(qproc, &qproc->mba_perm, false, qproc 892 drivers/remoteproc/qcom_q6v5_mss.c qproc->mba_phys, qproc 893 drivers/remoteproc/qcom_q6v5_mss.c qproc->mba_size); qproc 896 drivers/remoteproc/qcom_q6v5_mss.c ret = qcom_q6v5_unprepare(&qproc->q6v5); qproc 898 drivers/remoteproc/qcom_q6v5_mss.c q6v5_pds_disable(qproc, qproc->proxy_pds, qproc 899 drivers/remoteproc/qcom_q6v5_mss.c qproc->proxy_pd_count); qproc 900 drivers/remoteproc/qcom_q6v5_mss.c q6v5_clk_disable(qproc->dev, qproc->proxy_clks, qproc 901 drivers/remoteproc/qcom_q6v5_mss.c qproc->proxy_clk_count); qproc 902 drivers/remoteproc/qcom_q6v5_mss.c q6v5_regulator_disable(qproc, qproc->proxy_regs, qproc 903 drivers/remoteproc/qcom_q6v5_mss.c qproc->proxy_reg_count); qproc 909 drivers/remoteproc/qcom_q6v5_mss.c struct q6v5 *qproc = rproc->priv; qproc 913 drivers/remoteproc/qcom_q6v5_mss.c ret = request_firmware(&fw, rproc->firmware, qproc->dev); qproc 918 drivers/remoteproc/qcom_q6v5_mss.c ret = q6v5_mba_load(qproc); qproc 924 drivers/remoteproc/qcom_q6v5_mss.c static int q6v5_mpss_load(struct q6v5 *qproc) qproc 944 drivers/remoteproc/qcom_q6v5_mss.c fw_name_len = strlen(qproc->hexagon_mdt_image); qproc 948 drivers/remoteproc/qcom_q6v5_mss.c fw_name = kstrdup(qproc->hexagon_mdt_image, GFP_KERNEL); qproc 952 drivers/remoteproc/qcom_q6v5_mss.c ret = request_firmware(&fw, fw_name, qproc->dev); qproc 954 drivers/remoteproc/qcom_q6v5_mss.c dev_err(qproc->dev, "unable to load %s\n", fw_name); qproc 959 drivers/remoteproc/qcom_q6v5_mss.c writel(0, qproc->rmb_base + RMB_PMI_CODE_LENGTH_REG); qproc 961 drivers/remoteproc/qcom_q6v5_mss.c ret = q6v5_mpss_init_image(qproc, fw); qproc 989 drivers/remoteproc/qcom_q6v5_mss.c q6v5_xfer_mem_ownership(qproc, &qproc->mpss_perm, false, qproc 990 drivers/remoteproc/qcom_q6v5_mss.c qproc->mpss_phys, qproc->mpss_size); qproc 992 drivers/remoteproc/qcom_q6v5_mss.c mpss_reloc = relocate ? min_addr : qproc->mpss_phys; qproc 993 drivers/remoteproc/qcom_q6v5_mss.c qproc->mpss_reloc = mpss_reloc; qproc 1002 drivers/remoteproc/qcom_q6v5_mss.c if (offset < 0 || offset + phdr->p_memsz > qproc->mpss_size) { qproc 1003 drivers/remoteproc/qcom_q6v5_mss.c dev_err(qproc->dev, "segment outside memory range\n"); qproc 1008 drivers/remoteproc/qcom_q6v5_mss.c ptr = qproc->mpss_region + offset; qproc 1013 drivers/remoteproc/qcom_q6v5_mss.c dev_err(qproc->dev, qproc 1024 drivers/remoteproc/qcom_q6v5_mss.c ret = request_firmware(&seg_fw, fw_name, qproc->dev); qproc 1026 drivers/remoteproc/qcom_q6v5_mss.c dev_err(qproc->dev, "failed to load %s\n", fw_name); qproc 1043 drivers/remoteproc/qcom_q6v5_mss.c ret = q6v5_xfer_mem_ownership(qproc, &qproc->mpss_perm, true, qproc 1044 drivers/remoteproc/qcom_q6v5_mss.c qproc->mpss_phys, qproc->mpss_size); qproc 1046 drivers/remoteproc/qcom_q6v5_mss.c dev_err(qproc->dev, qproc 1052 drivers/remoteproc/qcom_q6v5_mss.c boot_addr = relocate ? qproc->mpss_phys : min_addr; qproc 1053 drivers/remoteproc/qcom_q6v5_mss.c writel(boot_addr, qproc->rmb_base + RMB_PMI_CODE_START_REG); qproc 1054 drivers/remoteproc/qcom_q6v5_mss.c writel(RMB_CMD_LOAD_READY, qproc->rmb_base + RMB_MBA_COMMAND_REG); qproc 1055 drivers/remoteproc/qcom_q6v5_mss.c writel(size, qproc->rmb_base + RMB_PMI_CODE_LENGTH_REG); qproc 1057 drivers/remoteproc/qcom_q6v5_mss.c ret = q6v5_rmb_mba_wait(qproc, RMB_MBA_AUTH_COMPLETE, 10000); qproc 1059 drivers/remoteproc/qcom_q6v5_mss.c dev_err(qproc->dev, "MPSS authentication timed out\n"); qproc 1061 drivers/remoteproc/qcom_q6v5_mss.c dev_err(qproc->dev, "MPSS authentication failed: %d\n", ret); qproc 1076 drivers/remoteproc/qcom_q6v5_mss.c struct q6v5 *qproc = rproc->priv; qproc 1081 drivers/remoteproc/qcom_q6v5_mss.c if (!qproc->dump_mba_loaded) { qproc 1085 drivers/remoteproc/qcom_q6v5_mss.c ret = q6v5_xfer_mem_ownership(qproc, &qproc->mpss_perm, qproc 1087 drivers/remoteproc/qcom_q6v5_mss.c qproc->mpss_phys, qproc 1088 drivers/remoteproc/qcom_q6v5_mss.c qproc->mpss_size); qproc 1097 drivers/remoteproc/qcom_q6v5_mss.c qproc->dump_segment_mask |= mask; qproc 1100 drivers/remoteproc/qcom_q6v5_mss.c if (qproc->dump_segment_mask == qproc->dump_complete_mask) { qproc 1101 drivers/remoteproc/qcom_q6v5_mss.c if (qproc->dump_mba_loaded) { qproc 1103 drivers/remoteproc/qcom_q6v5_mss.c q6v5_xfer_mem_ownership(qproc, &qproc->mpss_perm, qproc 1105 drivers/remoteproc/qcom_q6v5_mss.c qproc->mpss_phys, qproc 1106 drivers/remoteproc/qcom_q6v5_mss.c qproc->mpss_size); qproc 1107 drivers/remoteproc/qcom_q6v5_mss.c q6v5_mba_reclaim(qproc); qproc 1114 drivers/remoteproc/qcom_q6v5_mss.c struct q6v5 *qproc = (struct q6v5 *)rproc->priv; qproc 1118 drivers/remoteproc/qcom_q6v5_mss.c ret = q6v5_mba_load(qproc); qproc 1122 drivers/remoteproc/qcom_q6v5_mss.c dev_info(qproc->dev, "MBA booted, loading mpss\n"); qproc 1124 drivers/remoteproc/qcom_q6v5_mss.c ret = q6v5_mpss_load(qproc); qproc 1128 drivers/remoteproc/qcom_q6v5_mss.c ret = qcom_q6v5_wait_for_start(&qproc->q6v5, msecs_to_jiffies(5000)); qproc 1130 drivers/remoteproc/qcom_q6v5_mss.c dev_err(qproc->dev, "start timed out\n"); qproc 1134 drivers/remoteproc/qcom_q6v5_mss.c xfermemop_ret = q6v5_xfer_mem_ownership(qproc, &qproc->mba_perm, false, qproc 1135 drivers/remoteproc/qcom_q6v5_mss.c qproc->mba_phys, qproc 1136 drivers/remoteproc/qcom_q6v5_mss.c qproc->mba_size); qproc 1138 drivers/remoteproc/qcom_q6v5_mss.c dev_err(qproc->dev, qproc 1142 drivers/remoteproc/qcom_q6v5_mss.c qproc->dump_segment_mask = 0; qproc 1143 drivers/remoteproc/qcom_q6v5_mss.c qproc->running = true; qproc 1148 drivers/remoteproc/qcom_q6v5_mss.c q6v5_mba_reclaim(qproc); qproc 1155 drivers/remoteproc/qcom_q6v5_mss.c struct q6v5 *qproc = (struct q6v5 *)rproc->priv; qproc 1158 drivers/remoteproc/qcom_q6v5_mss.c qproc->running = false; qproc 1160 drivers/remoteproc/qcom_q6v5_mss.c ret = qcom_q6v5_request_stop(&qproc->q6v5); qproc 1162 drivers/remoteproc/qcom_q6v5_mss.c dev_err(qproc->dev, "timed out on wait\n"); qproc 1164 drivers/remoteproc/qcom_q6v5_mss.c q6v5_mba_reclaim(qproc); qproc 1171 drivers/remoteproc/qcom_q6v5_mss.c struct q6v5 *qproc = rproc->priv; qproc 1174 drivers/remoteproc/qcom_q6v5_mss.c offset = da - qproc->mpss_reloc; qproc 1175 drivers/remoteproc/qcom_q6v5_mss.c if (offset < 0 || offset + len > qproc->mpss_size) qproc 1178 drivers/remoteproc/qcom_q6v5_mss.c return qproc->mpss_region + offset; qproc 1188 drivers/remoteproc/qcom_q6v5_mss.c struct q6v5 *qproc = rproc->priv; qproc 1192 drivers/remoteproc/qcom_q6v5_mss.c ret = request_firmware(&fw, qproc->hexagon_mdt_image, qproc->dev); qproc 1194 drivers/remoteproc/qcom_q6v5_mss.c dev_err(qproc->dev, "unable to load %s\n", qproc 1195 drivers/remoteproc/qcom_q6v5_mss.c qproc->hexagon_mdt_image); qproc 1201 drivers/remoteproc/qcom_q6v5_mss.c qproc->dump_complete_mask = 0; qproc 1216 drivers/remoteproc/qcom_q6v5_mss.c qproc->dump_complete_mask |= BIT(i); qproc 1233 drivers/remoteproc/qcom_q6v5_mss.c struct q6v5 *qproc = container_of(q6v5, struct q6v5, q6v5); qproc 1235 drivers/remoteproc/qcom_q6v5_mss.c q6v5_clk_disable(qproc->dev, qproc->proxy_clks, qproc 1236 drivers/remoteproc/qcom_q6v5_mss.c qproc->proxy_clk_count); qproc 1237 drivers/remoteproc/qcom_q6v5_mss.c q6v5_regulator_disable(qproc, qproc->proxy_regs, qproc 1238 drivers/remoteproc/qcom_q6v5_mss.c qproc->proxy_reg_count); qproc 1239 drivers/remoteproc/qcom_q6v5_mss.c q6v5_pds_disable(qproc, qproc->proxy_pds, qproc->proxy_pd_count); qproc 1242 drivers/remoteproc/qcom_q6v5_mss.c static int q6v5_init_mem(struct q6v5 *qproc, struct platform_device *pdev) qproc 1249 drivers/remoteproc/qcom_q6v5_mss.c qproc->reg_base = devm_ioremap_resource(&pdev->dev, res); qproc 1250 drivers/remoteproc/qcom_q6v5_mss.c if (IS_ERR(qproc->reg_base)) qproc 1251 drivers/remoteproc/qcom_q6v5_mss.c return PTR_ERR(qproc->reg_base); qproc 1254 drivers/remoteproc/qcom_q6v5_mss.c qproc->rmb_base = devm_ioremap_resource(&pdev->dev, res); qproc 1255 drivers/remoteproc/qcom_q6v5_mss.c if (IS_ERR(qproc->rmb_base)) qproc 1256 drivers/remoteproc/qcom_q6v5_mss.c return PTR_ERR(qproc->rmb_base); qproc 1265 drivers/remoteproc/qcom_q6v5_mss.c qproc->halt_map = syscon_node_to_regmap(args.np); qproc 1267 drivers/remoteproc/qcom_q6v5_mss.c if (IS_ERR(qproc->halt_map)) qproc 1268 drivers/remoteproc/qcom_q6v5_mss.c return PTR_ERR(qproc->halt_map); qproc 1270 drivers/remoteproc/qcom_q6v5_mss.c qproc->halt_q6 = args.args[0]; qproc 1271 drivers/remoteproc/qcom_q6v5_mss.c qproc->halt_modem = args.args[1]; qproc 1272 drivers/remoteproc/qcom_q6v5_mss.c qproc->halt_nc = args.args[2]; qproc 1330 drivers/remoteproc/qcom_q6v5_mss.c static void q6v5_pds_detach(struct q6v5 *qproc, struct device **pds, qproc 1339 drivers/remoteproc/qcom_q6v5_mss.c static int q6v5_init_reset(struct q6v5 *qproc) qproc 1341 drivers/remoteproc/qcom_q6v5_mss.c qproc->mss_restart = devm_reset_control_get_exclusive(qproc->dev, qproc 1343 drivers/remoteproc/qcom_q6v5_mss.c if (IS_ERR(qproc->mss_restart)) { qproc 1344 drivers/remoteproc/qcom_q6v5_mss.c dev_err(qproc->dev, "failed to acquire mss restart\n"); qproc 1345 drivers/remoteproc/qcom_q6v5_mss.c return PTR_ERR(qproc->mss_restart); qproc 1348 drivers/remoteproc/qcom_q6v5_mss.c if (qproc->has_alt_reset) { qproc 1349 drivers/remoteproc/qcom_q6v5_mss.c qproc->pdc_reset = devm_reset_control_get_exclusive(qproc->dev, qproc 1351 drivers/remoteproc/qcom_q6v5_mss.c if (IS_ERR(qproc->pdc_reset)) { qproc 1352 drivers/remoteproc/qcom_q6v5_mss.c dev_err(qproc->dev, "failed to acquire pdc reset\n"); qproc 1353 drivers/remoteproc/qcom_q6v5_mss.c return PTR_ERR(qproc->pdc_reset); qproc 1360 drivers/remoteproc/qcom_q6v5_mss.c static int q6v5_alloc_memory_region(struct q6v5 *qproc) qproc 1367 drivers/remoteproc/qcom_q6v5_mss.c child = of_get_child_by_name(qproc->dev->of_node, "mba"); qproc 1371 drivers/remoteproc/qcom_q6v5_mss.c dev_err(qproc->dev, "unable to resolve mba region\n"); qproc 1376 drivers/remoteproc/qcom_q6v5_mss.c qproc->mba_phys = r.start; qproc 1377 drivers/remoteproc/qcom_q6v5_mss.c qproc->mba_size = resource_size(&r); qproc 1378 drivers/remoteproc/qcom_q6v5_mss.c qproc->mba_region = devm_ioremap_wc(qproc->dev, qproc->mba_phys, qproc->mba_size); qproc 1379 drivers/remoteproc/qcom_q6v5_mss.c if (!qproc->mba_region) { qproc 1380 drivers/remoteproc/qcom_q6v5_mss.c dev_err(qproc->dev, "unable to map memory region: %pa+%zx\n", qproc 1381 drivers/remoteproc/qcom_q6v5_mss.c &r.start, qproc->mba_size); qproc 1385 drivers/remoteproc/qcom_q6v5_mss.c child = of_get_child_by_name(qproc->dev->of_node, "mpss"); qproc 1389 drivers/remoteproc/qcom_q6v5_mss.c dev_err(qproc->dev, "unable to resolve mpss region\n"); qproc 1394 drivers/remoteproc/qcom_q6v5_mss.c qproc->mpss_phys = qproc->mpss_reloc = r.start; qproc 1395 drivers/remoteproc/qcom_q6v5_mss.c qproc->mpss_size = resource_size(&r); qproc 1396 drivers/remoteproc/qcom_q6v5_mss.c qproc->mpss_region = devm_ioremap_wc(qproc->dev, qproc->mpss_phys, qproc->mpss_size); qproc 1397 drivers/remoteproc/qcom_q6v5_mss.c if (!qproc->mpss_region) { qproc 1398 drivers/remoteproc/qcom_q6v5_mss.c dev_err(qproc->dev, "unable to map memory region: %pa+%zx\n", qproc 1399 drivers/remoteproc/qcom_q6v5_mss.c &r.start, qproc->mpss_size); qproc 1409 drivers/remoteproc/qcom_q6v5_mss.c struct q6v5 *qproc; qproc 1428 drivers/remoteproc/qcom_q6v5_mss.c mba_image, sizeof(*qproc)); qproc 1436 drivers/remoteproc/qcom_q6v5_mss.c qproc = (struct q6v5 *)rproc->priv; qproc 1437 drivers/remoteproc/qcom_q6v5_mss.c qproc->dev = &pdev->dev; qproc 1438 drivers/remoteproc/qcom_q6v5_mss.c qproc->rproc = rproc; qproc 1439 drivers/remoteproc/qcom_q6v5_mss.c qproc->hexagon_mdt_image = "modem.mdt"; qproc 1441 drivers/remoteproc/qcom_q6v5_mss.c 1, &qproc->hexagon_mdt_image); qproc 1445 drivers/remoteproc/qcom_q6v5_mss.c platform_set_drvdata(pdev, qproc); qproc 1447 drivers/remoteproc/qcom_q6v5_mss.c ret = q6v5_init_mem(qproc, pdev); qproc 1451 drivers/remoteproc/qcom_q6v5_mss.c ret = q6v5_alloc_memory_region(qproc); qproc 1455 drivers/remoteproc/qcom_q6v5_mss.c ret = q6v5_init_clocks(&pdev->dev, qproc->proxy_clks, qproc 1461 drivers/remoteproc/qcom_q6v5_mss.c qproc->proxy_clk_count = ret; qproc 1463 drivers/remoteproc/qcom_q6v5_mss.c ret = q6v5_init_clocks(&pdev->dev, qproc->reset_clks, qproc 1469 drivers/remoteproc/qcom_q6v5_mss.c qproc->reset_clk_count = ret; qproc 1471 drivers/remoteproc/qcom_q6v5_mss.c ret = q6v5_init_clocks(&pdev->dev, qproc->active_clks, qproc 1477 drivers/remoteproc/qcom_q6v5_mss.c qproc->active_clk_count = ret; qproc 1479 drivers/remoteproc/qcom_q6v5_mss.c ret = q6v5_regulator_init(&pdev->dev, qproc->proxy_regs, qproc 1485 drivers/remoteproc/qcom_q6v5_mss.c qproc->proxy_reg_count = ret; qproc 1487 drivers/remoteproc/qcom_q6v5_mss.c ret = q6v5_regulator_init(&pdev->dev, qproc->active_regs, qproc 1493 drivers/remoteproc/qcom_q6v5_mss.c qproc->active_reg_count = ret; qproc 1495 drivers/remoteproc/qcom_q6v5_mss.c ret = q6v5_pds_attach(&pdev->dev, qproc->active_pds, qproc 1501 drivers/remoteproc/qcom_q6v5_mss.c qproc->active_pd_count = ret; qproc 1503 drivers/remoteproc/qcom_q6v5_mss.c ret = q6v5_pds_attach(&pdev->dev, qproc->proxy_pds, qproc 1509 drivers/remoteproc/qcom_q6v5_mss.c qproc->proxy_pd_count = ret; qproc 1511 drivers/remoteproc/qcom_q6v5_mss.c qproc->has_alt_reset = desc->has_alt_reset; qproc 1512 drivers/remoteproc/qcom_q6v5_mss.c ret = q6v5_init_reset(qproc); qproc 1516 drivers/remoteproc/qcom_q6v5_mss.c qproc->version = desc->version; qproc 1517 drivers/remoteproc/qcom_q6v5_mss.c qproc->need_mem_protection = desc->need_mem_protection; qproc 1519 drivers/remoteproc/qcom_q6v5_mss.c ret = qcom_q6v5_init(&qproc->q6v5, pdev, rproc, MPSS_CRASH_REASON_SMEM, qproc 1524 drivers/remoteproc/qcom_q6v5_mss.c qproc->mpss_perm = BIT(QCOM_SCM_VMID_HLOS); qproc 1525 drivers/remoteproc/qcom_q6v5_mss.c qproc->mba_perm = BIT(QCOM_SCM_VMID_HLOS); qproc 1526 drivers/remoteproc/qcom_q6v5_mss.c qcom_add_glink_subdev(rproc, &qproc->glink_subdev); qproc 1527 drivers/remoteproc/qcom_q6v5_mss.c qcom_add_smd_subdev(rproc, &qproc->smd_subdev); qproc 1528 drivers/remoteproc/qcom_q6v5_mss.c qcom_add_ssr_subdev(rproc, &qproc->ssr_subdev, "mpss"); qproc 1529 drivers/remoteproc/qcom_q6v5_mss.c qproc->sysmon = qcom_add_sysmon_subdev(rproc, "modem", 0x12); qproc 1530 drivers/remoteproc/qcom_q6v5_mss.c if (IS_ERR(qproc->sysmon)) { qproc 1531 drivers/remoteproc/qcom_q6v5_mss.c ret = PTR_ERR(qproc->sysmon); qproc 1542 drivers/remoteproc/qcom_q6v5_mss.c q6v5_pds_detach(qproc, qproc->proxy_pds, qproc->proxy_pd_count); qproc 1544 drivers/remoteproc/qcom_q6v5_mss.c q6v5_pds_detach(qproc, qproc->active_pds, qproc->active_pd_count); qproc 1553 drivers/remoteproc/qcom_q6v5_mss.c struct q6v5 *qproc = platform_get_drvdata(pdev); qproc 1555 drivers/remoteproc/qcom_q6v5_mss.c rproc_del(qproc->rproc); qproc 1557 drivers/remoteproc/qcom_q6v5_mss.c qcom_remove_sysmon_subdev(qproc->sysmon); qproc 1558 drivers/remoteproc/qcom_q6v5_mss.c qcom_remove_glink_subdev(qproc->rproc, &qproc->glink_subdev); qproc 1559 drivers/remoteproc/qcom_q6v5_mss.c qcom_remove_smd_subdev(qproc->rproc, &qproc->smd_subdev); qproc 1560 drivers/remoteproc/qcom_q6v5_mss.c qcom_remove_ssr_subdev(qproc->rproc, &qproc->ssr_subdev); qproc 1562 drivers/remoteproc/qcom_q6v5_mss.c q6v5_pds_detach(qproc, qproc->active_pds, qproc->active_pd_count); qproc 1563 drivers/remoteproc/qcom_q6v5_mss.c q6v5_pds_detach(qproc, qproc->proxy_pds, qproc->proxy_pd_count); qproc 1565 drivers/remoteproc/qcom_q6v5_mss.c rproc_free(qproc->rproc); qproc 75 include/linux/poll.h static inline void init_poll_funcptr(poll_table *pt, poll_queue_proc qproc) qproc 77 include/linux/poll.h pt->_qproc = qproc;