wcnss 129 drivers/bluetooth/btqcomsmd.c void *wcnss; wcnss 136 drivers/bluetooth/btqcomsmd.c wcnss = dev_get_drvdata(pdev->dev.parent); wcnss 138 drivers/bluetooth/btqcomsmd.c btq->acl_channel = qcom_wcnss_open_channel(wcnss, "APPS_RIVA_BT_ACL", wcnss 143 drivers/bluetooth/btqcomsmd.c btq->cmd_channel = qcom_wcnss_open_channel(wcnss, "APPS_RIVA_BT_CMD", wcnss 1302 drivers/net/wireless/ath/wcn36xx/main.c void *wcnss; wcnss 1308 drivers/net/wireless/ath/wcn36xx/main.c wcnss = dev_get_drvdata(pdev->dev.parent); wcnss 1333 drivers/net/wireless/ath/wcn36xx/main.c wcn->smd_channel = qcom_wcnss_open_channel(wcnss, "WLAN_CTRL", wcn36xx_smd_rsp_process, hw); wcnss 133 drivers/remoteproc/qcom_wcnss.c void qcom_wcnss_assign_iris(struct qcom_wcnss *wcnss, wcnss 137 drivers/remoteproc/qcom_wcnss.c mutex_lock(&wcnss->iris_lock); wcnss 139 drivers/remoteproc/qcom_wcnss.c wcnss->iris = iris; wcnss 140 drivers/remoteproc/qcom_wcnss.c wcnss->use_48mhz_xo = use_48mhz_xo; wcnss 142 drivers/remoteproc/qcom_wcnss.c mutex_unlock(&wcnss->iris_lock); wcnss 147 drivers/remoteproc/qcom_wcnss.c struct qcom_wcnss *wcnss = (struct qcom_wcnss *)rproc->priv; wcnss 149 drivers/remoteproc/qcom_wcnss.c return qcom_mdt_load(wcnss->dev, fw, rproc->firmware, WCNSS_PAS_ID, wcnss 150 drivers/remoteproc/qcom_wcnss.c wcnss->mem_region, wcnss->mem_phys, wcnss 151 drivers/remoteproc/qcom_wcnss.c wcnss->mem_size, &wcnss->mem_reloc); wcnss 154 drivers/remoteproc/qcom_wcnss.c static void wcnss_indicate_nv_download(struct qcom_wcnss *wcnss) wcnss 159 drivers/remoteproc/qcom_wcnss.c val = readl(wcnss->spare_out); wcnss 161 drivers/remoteproc/qcom_wcnss.c writel(val, wcnss->spare_out); wcnss 164 drivers/remoteproc/qcom_wcnss.c static void wcnss_configure_iris(struct qcom_wcnss *wcnss) wcnss 169 drivers/remoteproc/qcom_wcnss.c writel(0, wcnss->pmu_cfg); wcnss 172 drivers/remoteproc/qcom_wcnss.c writel(val, wcnss->pmu_cfg); wcnss 176 drivers/remoteproc/qcom_wcnss.c if (wcnss->use_48mhz_xo) wcnss 180 drivers/remoteproc/qcom_wcnss.c writel(val, wcnss->pmu_cfg); wcnss 184 drivers/remoteproc/qcom_wcnss.c writel(val, wcnss->pmu_cfg); wcnss 187 drivers/remoteproc/qcom_wcnss.c while (readl(wcnss->pmu_cfg) & WCNSS_PMU_IRIS_RESET_STS) wcnss 192 drivers/remoteproc/qcom_wcnss.c writel(val, wcnss->pmu_cfg); wcnss 196 drivers/remoteproc/qcom_wcnss.c writel(val, wcnss->pmu_cfg); wcnss 199 drivers/remoteproc/qcom_wcnss.c while (readl(wcnss->pmu_cfg) & WCNSS_PMU_IRIS_XO_CFG_STS) wcnss 205 drivers/remoteproc/qcom_wcnss.c writel(val, wcnss->pmu_cfg); wcnss 213 drivers/remoteproc/qcom_wcnss.c struct qcom_wcnss *wcnss = (struct qcom_wcnss *)rproc->priv; wcnss 216 drivers/remoteproc/qcom_wcnss.c mutex_lock(&wcnss->iris_lock); wcnss 217 drivers/remoteproc/qcom_wcnss.c if (!wcnss->iris) { wcnss 218 drivers/remoteproc/qcom_wcnss.c dev_err(wcnss->dev, "no iris registered\n"); wcnss 223 drivers/remoteproc/qcom_wcnss.c ret = regulator_bulk_enable(wcnss->num_vregs, wcnss->vregs); wcnss 227 drivers/remoteproc/qcom_wcnss.c ret = qcom_iris_enable(wcnss->iris); wcnss 231 drivers/remoteproc/qcom_wcnss.c wcnss_indicate_nv_download(wcnss); wcnss 232 drivers/remoteproc/qcom_wcnss.c wcnss_configure_iris(wcnss); wcnss 236 drivers/remoteproc/qcom_wcnss.c dev_err(wcnss->dev, wcnss 241 drivers/remoteproc/qcom_wcnss.c ret = wait_for_completion_timeout(&wcnss->start_done, wcnss 243 drivers/remoteproc/qcom_wcnss.c if (wcnss->ready_irq > 0 && ret == 0) { wcnss 245 drivers/remoteproc/qcom_wcnss.c dev_err(wcnss->dev, "start timed out\n"); wcnss 254 drivers/remoteproc/qcom_wcnss.c qcom_iris_disable(wcnss->iris); wcnss 256 drivers/remoteproc/qcom_wcnss.c regulator_bulk_disable(wcnss->num_vregs, wcnss->vregs); wcnss 258 drivers/remoteproc/qcom_wcnss.c mutex_unlock(&wcnss->iris_lock); wcnss 265 drivers/remoteproc/qcom_wcnss.c struct qcom_wcnss *wcnss = (struct qcom_wcnss *)rproc->priv; wcnss 268 drivers/remoteproc/qcom_wcnss.c if (wcnss->state) { wcnss 269 drivers/remoteproc/qcom_wcnss.c qcom_smem_state_update_bits(wcnss->state, wcnss 270 drivers/remoteproc/qcom_wcnss.c BIT(wcnss->stop_bit), wcnss 271 drivers/remoteproc/qcom_wcnss.c BIT(wcnss->stop_bit)); wcnss 273 drivers/remoteproc/qcom_wcnss.c ret = wait_for_completion_timeout(&wcnss->stop_done, wcnss 276 drivers/remoteproc/qcom_wcnss.c dev_err(wcnss->dev, "timed out on wait\n"); wcnss 278 drivers/remoteproc/qcom_wcnss.c qcom_smem_state_update_bits(wcnss->state, wcnss 279 drivers/remoteproc/qcom_wcnss.c BIT(wcnss->stop_bit), wcnss 285 drivers/remoteproc/qcom_wcnss.c dev_err(wcnss->dev, "failed to shutdown: %d\n", ret); wcnss 292 drivers/remoteproc/qcom_wcnss.c struct qcom_wcnss *wcnss = (struct qcom_wcnss *)rproc->priv; wcnss 295 drivers/remoteproc/qcom_wcnss.c offset = da - wcnss->mem_reloc; wcnss 296 drivers/remoteproc/qcom_wcnss.c if (offset < 0 || offset + len > wcnss->mem_size) wcnss 299 drivers/remoteproc/qcom_wcnss.c return wcnss->mem_region + offset; wcnss 312 drivers/remoteproc/qcom_wcnss.c struct qcom_wcnss *wcnss = dev; wcnss 314 drivers/remoteproc/qcom_wcnss.c rproc_report_crash(wcnss->rproc, RPROC_WATCHDOG); wcnss 321 drivers/remoteproc/qcom_wcnss.c struct qcom_wcnss *wcnss = dev; wcnss 327 drivers/remoteproc/qcom_wcnss.c dev_err(wcnss->dev, "fatal error received: %s\n", msg); wcnss 329 drivers/remoteproc/qcom_wcnss.c rproc_report_crash(wcnss->rproc, RPROC_FATAL_ERROR); wcnss 336 drivers/remoteproc/qcom_wcnss.c struct qcom_wcnss *wcnss = dev; wcnss 338 drivers/remoteproc/qcom_wcnss.c complete(&wcnss->start_done); wcnss 359 drivers/remoteproc/qcom_wcnss.c struct qcom_wcnss *wcnss = dev; wcnss 361 drivers/remoteproc/qcom_wcnss.c complete(&wcnss->stop_done); wcnss 366 drivers/remoteproc/qcom_wcnss.c static int wcnss_init_regulators(struct qcom_wcnss *wcnss, wcnss 374 drivers/remoteproc/qcom_wcnss.c bulk = devm_kcalloc(wcnss->dev, wcnss 383 drivers/remoteproc/qcom_wcnss.c ret = devm_regulator_bulk_get(wcnss->dev, num_vregs, bulk); wcnss 397 drivers/remoteproc/qcom_wcnss.c wcnss->vregs = bulk; wcnss 398 drivers/remoteproc/qcom_wcnss.c wcnss->num_vregs = num_vregs; wcnss 403 drivers/remoteproc/qcom_wcnss.c static int wcnss_request_irq(struct qcom_wcnss *wcnss, wcnss 423 drivers/remoteproc/qcom_wcnss.c "wcnss", wcnss); wcnss 430 drivers/remoteproc/qcom_wcnss.c static int wcnss_alloc_memory_region(struct qcom_wcnss *wcnss) wcnss 436 drivers/remoteproc/qcom_wcnss.c node = of_parse_phandle(wcnss->dev->of_node, "memory-region", 0); wcnss 438 drivers/remoteproc/qcom_wcnss.c dev_err(wcnss->dev, "no memory-region specified\n"); wcnss 446 drivers/remoteproc/qcom_wcnss.c wcnss->mem_phys = wcnss->mem_reloc = r.start; wcnss 447 drivers/remoteproc/qcom_wcnss.c wcnss->mem_size = resource_size(&r); wcnss 448 drivers/remoteproc/qcom_wcnss.c wcnss->mem_region = devm_ioremap_wc(wcnss->dev, wcnss->mem_phys, wcnss->mem_size); wcnss 449 drivers/remoteproc/qcom_wcnss.c if (!wcnss->mem_region) { wcnss 450 drivers/remoteproc/qcom_wcnss.c dev_err(wcnss->dev, "unable to map memory region: %pa+%zx\n", wcnss 451 drivers/remoteproc/qcom_wcnss.c &r.start, wcnss->mem_size); wcnss 461 drivers/remoteproc/qcom_wcnss.c struct qcom_wcnss *wcnss; wcnss 478 drivers/remoteproc/qcom_wcnss.c WCNSS_FIRMWARE_NAME, sizeof(*wcnss)); wcnss 484 drivers/remoteproc/qcom_wcnss.c wcnss = (struct qcom_wcnss *)rproc->priv; wcnss 485 drivers/remoteproc/qcom_wcnss.c wcnss->dev = &pdev->dev; wcnss 486 drivers/remoteproc/qcom_wcnss.c wcnss->rproc = rproc; wcnss 487 drivers/remoteproc/qcom_wcnss.c platform_set_drvdata(pdev, wcnss); wcnss 489 drivers/remoteproc/qcom_wcnss.c init_completion(&wcnss->start_done); wcnss 490 drivers/remoteproc/qcom_wcnss.c init_completion(&wcnss->stop_done); wcnss 492 drivers/remoteproc/qcom_wcnss.c mutex_init(&wcnss->iris_lock); wcnss 501 drivers/remoteproc/qcom_wcnss.c ret = wcnss_alloc_memory_region(wcnss); wcnss 505 drivers/remoteproc/qcom_wcnss.c wcnss->pmu_cfg = mmio + data->pmu_offset; wcnss 506 drivers/remoteproc/qcom_wcnss.c wcnss->spare_out = mmio + data->spare_offset; wcnss 508 drivers/remoteproc/qcom_wcnss.c ret = wcnss_init_regulators(wcnss, data->vregs, data->num_vregs); wcnss 512 drivers/remoteproc/qcom_wcnss.c ret = wcnss_request_irq(wcnss, pdev, "wdog", false, wcnss_wdog_interrupt); wcnss 515 drivers/remoteproc/qcom_wcnss.c wcnss->wdog_irq = ret; wcnss 517 drivers/remoteproc/qcom_wcnss.c ret = wcnss_request_irq(wcnss, pdev, "fatal", false, wcnss_fatal_interrupt); wcnss 520 drivers/remoteproc/qcom_wcnss.c wcnss->fatal_irq = ret; wcnss 522 drivers/remoteproc/qcom_wcnss.c ret = wcnss_request_irq(wcnss, pdev, "ready", true, wcnss_ready_interrupt); wcnss 525 drivers/remoteproc/qcom_wcnss.c wcnss->ready_irq = ret; wcnss 527 drivers/remoteproc/qcom_wcnss.c ret = wcnss_request_irq(wcnss, pdev, "handover", true, wcnss_handover_interrupt); wcnss 530 drivers/remoteproc/qcom_wcnss.c wcnss->handover_irq = ret; wcnss 532 drivers/remoteproc/qcom_wcnss.c ret = wcnss_request_irq(wcnss, pdev, "stop-ack", true, wcnss_stop_ack_interrupt); wcnss 535 drivers/remoteproc/qcom_wcnss.c wcnss->stop_ack_irq = ret; wcnss 537 drivers/remoteproc/qcom_wcnss.c if (wcnss->stop_ack_irq) { wcnss 538 drivers/remoteproc/qcom_wcnss.c wcnss->state = qcom_smem_state_get(&pdev->dev, "stop", wcnss 539 drivers/remoteproc/qcom_wcnss.c &wcnss->stop_bit); wcnss 540 drivers/remoteproc/qcom_wcnss.c if (IS_ERR(wcnss->state)) { wcnss 541 drivers/remoteproc/qcom_wcnss.c ret = PTR_ERR(wcnss->state); wcnss 546 drivers/remoteproc/qcom_wcnss.c qcom_add_smd_subdev(rproc, &wcnss->smd_subdev); wcnss 547 drivers/remoteproc/qcom_wcnss.c wcnss->sysmon = qcom_add_sysmon_subdev(rproc, "wcnss", WCNSS_SSCTL_ID); wcnss 548 drivers/remoteproc/qcom_wcnss.c if (IS_ERR(wcnss->sysmon)) { wcnss 549 drivers/remoteproc/qcom_wcnss.c ret = PTR_ERR(wcnss->sysmon); wcnss 567 drivers/remoteproc/qcom_wcnss.c struct qcom_wcnss *wcnss = platform_get_drvdata(pdev); wcnss 571 drivers/remoteproc/qcom_wcnss.c qcom_smem_state_put(wcnss->state); wcnss 572 drivers/remoteproc/qcom_wcnss.c rproc_del(wcnss->rproc); wcnss 574 drivers/remoteproc/qcom_wcnss.c qcom_remove_sysmon_subdev(wcnss->sysmon); wcnss 575 drivers/remoteproc/qcom_wcnss.c qcom_remove_smd_subdev(wcnss->rproc, &wcnss->smd_subdev); wcnss 576 drivers/remoteproc/qcom_wcnss.c rproc_free(wcnss->rproc); wcnss 23 drivers/remoteproc/qcom_wcnss.h void qcom_wcnss_assign_iris(struct qcom_wcnss *wcnss, struct qcom_iris *iris, bool use_48mhz_xo); wcnss 99 drivers/remoteproc/qcom_wcnss_iris.c struct qcom_wcnss *wcnss; wcnss 109 drivers/remoteproc/qcom_wcnss_iris.c wcnss = dev_get_drvdata(pdev->dev.parent); wcnss 146 drivers/remoteproc/qcom_wcnss_iris.c qcom_wcnss_assign_iris(wcnss, iris, data->use_48mhz_xo); wcnss 153 drivers/remoteproc/qcom_wcnss_iris.c struct qcom_wcnss *wcnss = dev_get_drvdata(pdev->dev.parent); wcnss 155 drivers/remoteproc/qcom_wcnss_iris.c qcom_wcnss_assign_iris(wcnss, NULL, false); wcnss 123 drivers/soc/qcom/wcnss_ctrl.c struct wcnss_ctrl *wcnss = dev_get_drvdata(&rpdev->dev); wcnss 131 drivers/soc/qcom/wcnss_ctrl.c dev_err(wcnss->dev, wcnss 137 drivers/soc/qcom/wcnss_ctrl.c dev_info(wcnss->dev, "WCNSS Version %d.%d %d.%d\n", wcnss 141 drivers/soc/qcom/wcnss_ctrl.c complete(&wcnss->ack); wcnss 145 drivers/soc/qcom/wcnss_ctrl.c dev_err(wcnss->dev, wcnss 151 drivers/soc/qcom/wcnss_ctrl.c wcnss->ack_status = nvresp->status; wcnss 152 drivers/soc/qcom/wcnss_ctrl.c complete(&wcnss->ack); wcnss 155 drivers/soc/qcom/wcnss_ctrl.c dev_dbg(wcnss->dev, "cold boot complete\n"); wcnss 156 drivers/soc/qcom/wcnss_ctrl.c complete(&wcnss->cbc); wcnss 159 drivers/soc/qcom/wcnss_ctrl.c dev_info(wcnss->dev, "unknown message type %d\n", hdr->type); wcnss 170 drivers/soc/qcom/wcnss_ctrl.c static int wcnss_request_version(struct wcnss_ctrl *wcnss) wcnss 177 drivers/soc/qcom/wcnss_ctrl.c ret = rpmsg_send(wcnss->channel, &msg, sizeof(msg)); wcnss 181 drivers/soc/qcom/wcnss_ctrl.c ret = wait_for_completion_timeout(&wcnss->ack, WCNSS_CBC_TIMEOUT); wcnss 183 drivers/soc/qcom/wcnss_ctrl.c dev_err(wcnss->dev, "timeout waiting for version response\n"); wcnss 197 drivers/soc/qcom/wcnss_ctrl.c static int wcnss_download_nv(struct wcnss_ctrl *wcnss, bool *expect_cbc) wcnss 209 drivers/soc/qcom/wcnss_ctrl.c ret = request_firmware(&fw, NVBIN_FILE, wcnss->dev); wcnss 211 drivers/soc/qcom/wcnss_ctrl.c dev_err(wcnss->dev, "Failed to load nv file %s: %d\n", wcnss 235 drivers/soc/qcom/wcnss_ctrl.c ret = rpmsg_send(wcnss->channel, req, req->hdr.len); wcnss 237 drivers/soc/qcom/wcnss_ctrl.c dev_err(wcnss->dev, "failed to send smd packet\n"); wcnss 248 drivers/soc/qcom/wcnss_ctrl.c ret = wait_for_completion_timeout(&wcnss->ack, WCNSS_REQUEST_TIMEOUT); wcnss 250 drivers/soc/qcom/wcnss_ctrl.c dev_err(wcnss->dev, "timeout waiting for nv upload ack\n"); wcnss 253 drivers/soc/qcom/wcnss_ctrl.c *expect_cbc = wcnss->ack_status == WCNSS_ACK_COLD_BOOTING; wcnss 271 drivers/soc/qcom/wcnss_ctrl.c struct rpmsg_endpoint *qcom_wcnss_open_channel(void *wcnss, const char *name, rpmsg_rx_cb_t cb, void *priv) wcnss 274 drivers/soc/qcom/wcnss_ctrl.c struct wcnss_ctrl *_wcnss = wcnss; wcnss 286 drivers/soc/qcom/wcnss_ctrl.c struct wcnss_ctrl *wcnss = container_of(work, struct wcnss_ctrl, probe_work); wcnss 290 drivers/soc/qcom/wcnss_ctrl.c ret = wcnss_request_version(wcnss); wcnss 294 drivers/soc/qcom/wcnss_ctrl.c ret = wcnss_download_nv(wcnss, &expect_cbc); wcnss 300 drivers/soc/qcom/wcnss_ctrl.c ret = wait_for_completion_timeout(&wcnss->cbc, WCNSS_REQUEST_TIMEOUT); wcnss 302 drivers/soc/qcom/wcnss_ctrl.c dev_err(wcnss->dev, "expected cold boot completion\n"); wcnss 305 drivers/soc/qcom/wcnss_ctrl.c of_platform_populate(wcnss->dev->of_node, NULL, NULL, wcnss->dev); wcnss 310 drivers/soc/qcom/wcnss_ctrl.c struct wcnss_ctrl *wcnss; wcnss 312 drivers/soc/qcom/wcnss_ctrl.c wcnss = devm_kzalloc(&rpdev->dev, sizeof(*wcnss), GFP_KERNEL); wcnss 313 drivers/soc/qcom/wcnss_ctrl.c if (!wcnss) wcnss 316 drivers/soc/qcom/wcnss_ctrl.c wcnss->dev = &rpdev->dev; wcnss 317 drivers/soc/qcom/wcnss_ctrl.c wcnss->channel = rpdev->ept; wcnss 319 drivers/soc/qcom/wcnss_ctrl.c init_completion(&wcnss->ack); wcnss 320 drivers/soc/qcom/wcnss_ctrl.c init_completion(&wcnss->cbc); wcnss 321 drivers/soc/qcom/wcnss_ctrl.c INIT_WORK(&wcnss->probe_work, wcnss_async_probe); wcnss 323 drivers/soc/qcom/wcnss_ctrl.c dev_set_drvdata(&rpdev->dev, wcnss); wcnss 325 drivers/soc/qcom/wcnss_ctrl.c schedule_work(&wcnss->probe_work); wcnss 332 drivers/soc/qcom/wcnss_ctrl.c struct wcnss_ctrl *wcnss = dev_get_drvdata(&rpdev->dev); wcnss 334 drivers/soc/qcom/wcnss_ctrl.c cancel_work_sync(&wcnss->probe_work); wcnss 9 include/linux/soc/qcom/wcnss_ctrl.h struct rpmsg_endpoint *qcom_wcnss_open_channel(void *wcnss, const char *name, wcnss 14 include/linux/soc/qcom/wcnss_ctrl.h static struct rpmsg_endpoint *qcom_wcnss_open_channel(void *wcnss,