
Introduce support for the Qualcomm IPQ50xx SoC. This series adds support for the following components: - minimal boot support: GCC/pinctrl/watchdog/CPUFreq/SDI (upstreamed) - USB2 (upstreamed) - Thermal/Tsens - PCIe gen2 1&2-lane PHY and controller - PWM and PWM LED - QPIC SPI NAND controller - CMN PLL Block (provider of fixed rate clocks to GCC/ethernet/more.) - Ethernet: IPQ5018 Internal GE PHY (1 gbps) - Remoteproc MPD driver for IPQ5018 (2.4G) & QCN6122 (5/6G) Wifi Co-developed-by: Ziyang Huang <hzyitc@outlook.com> Signed-off-by: Ziyang Huang <hzyitc@outlook.com> Signed-off-by: George Moussalem <george.moussalem@outlook.com> Link: https://github.com/openwrt/openwrt/pull/17182 Signed-off-by: Robert Marko <robimarko@gmail.com>
112 lines
3.3 KiB
Diff
112 lines
3.3 KiB
Diff
From 4ae334127f073aa5f7c9209c9f0a17fd9e331db1 Mon Sep 17 00:00:00 2001
|
|
From: Ziyang Huang <hzyitc@outlook.com>
|
|
Date: Sun, 8 Sep 2024 16:40:12 +0800
|
|
Subject: [PATCH] remoteproc: qcom_q6v5_mpd: support ipq5018
|
|
|
|
Signed-off-by: Ziyang Huang <hzyitc@outlook.com>
|
|
---
|
|
drivers/remoteproc/qcom_q6v5_mpd.c | 37 +++++++++++++++++++++++++++---
|
|
1 file changed, 34 insertions(+), 3 deletions(-)
|
|
|
|
--- a/drivers/remoteproc/qcom_q6v5_mpd.c
|
|
+++ b/drivers/remoteproc/qcom_q6v5_mpd.c
|
|
@@ -155,6 +155,8 @@ static int q6_wcss_spawn_pd(struct rproc
|
|
static int wcss_pd_start(struct rproc *rproc)
|
|
{
|
|
struct userpd *upd = rproc->priv;
|
|
+ struct rproc *rpd_rproc = dev_get_drvdata(upd->dev->parent);
|
|
+ struct q6_wcss *wcss = rpd_rproc->priv;
|
|
u32 pasid = (upd->pd_asid << 8) | UPD_SWID;
|
|
int ret;
|
|
|
|
@@ -170,6 +172,14 @@ static int wcss_pd_start(struct rproc *r
|
|
return ret;
|
|
}
|
|
|
|
+ if (upd->pd_asid == 1) {
|
|
+ ret = qcom_scm_internal_wifi_powerup(wcss->desc->pasid);
|
|
+ if (ret) {
|
|
+ dev_err(upd->dev, "failed to power up internal radio\n");
|
|
+ return ret;
|
|
+ }
|
|
+ }
|
|
+
|
|
return ret;
|
|
}
|
|
|
|
@@ -179,6 +189,12 @@ static int q6_wcss_stop(struct rproc *rp
|
|
const struct wcss_data *desc = wcss->desc;
|
|
int ret;
|
|
|
|
+ ret = qcom_q6v5_request_stop(&wcss->q6, NULL);
|
|
+ if (ret) {
|
|
+ dev_err(wcss->dev, "pd not stopped\n");
|
|
+ return ret;
|
|
+ }
|
|
+
|
|
ret = qcom_scm_pas_shutdown(desc->pasid);
|
|
if (ret) {
|
|
dev_err(wcss->dev, "not able to shutdown\n");
|
|
@@ -218,6 +234,7 @@ static int wcss_pd_stop(struct rproc *rp
|
|
{
|
|
struct userpd *upd = rproc->priv;
|
|
struct rproc *rpd_rproc = dev_get_drvdata(upd->dev->parent);
|
|
+ struct q6_wcss *wcss = rpd_rproc->priv;
|
|
u32 pasid = (upd->pd_asid << 8) | UPD_SWID;
|
|
int ret;
|
|
|
|
@@ -229,6 +246,14 @@ static int wcss_pd_stop(struct rproc *rp
|
|
}
|
|
}
|
|
|
|
+ if (upd->pd_asid == 1) {
|
|
+ ret = qcom_scm_internal_wifi_shutdown(wcss->desc->pasid);
|
|
+ if (ret) {
|
|
+ dev_err(upd->dev, "failed to power down internal radio\n");
|
|
+ return ret;
|
|
+ }
|
|
+ }
|
|
+
|
|
ret = qcom_scm_msa_unlock(pasid);
|
|
if (ret) {
|
|
dev_err(upd->dev, "failed to power down pd\n");
|
|
@@ -430,15 +455,14 @@ static int wcss_pd_load(struct rproc *rp
|
|
struct userpd *upd = rproc->priv;
|
|
struct rproc *rpd_rproc = dev_get_drvdata(upd->dev->parent);
|
|
struct q6_wcss *wcss = rpd_rproc->priv;
|
|
- u32 pasid = (upd->pd_asid << 8) | UPD_SWID;
|
|
int ret;
|
|
|
|
ret = rproc_boot(rpd_rproc);
|
|
if (ret)
|
|
return ret;
|
|
|
|
- return qcom_mdt_load(upd->dev, fw, rproc->firmware,
|
|
- pasid, wcss->mem_region,
|
|
+ return qcom_mdt_load_pd_seg(upd->dev, fw, rproc->firmware,
|
|
+ wcss->desc->pasid, upd->pd_asid, wcss->mem_region,
|
|
wcss->mem_phys, wcss->mem_size,
|
|
NULL);
|
|
}
|
|
@@ -777,6 +801,12 @@ static int q6_wcss_remove(struct platfor
|
|
return 0;
|
|
}
|
|
|
|
+static const struct wcss_data q6_ipq5018_res_init = {
|
|
+ .pasid = MPD_WCNSS_PAS_ID,
|
|
+ // .share_upd_info_to_q6 = true, /* Version 1 */
|
|
+ // .mdt_load_sec = qcom_mdt_load_pd_seg,
|
|
+};
|
|
+
|
|
static const struct wcss_data q6_ipq5332_res_init = {
|
|
.pasid = MPD_WCNSS_PAS_ID,
|
|
.share_upd_info_to_q6 = true,
|
|
@@ -787,6 +817,7 @@ static const struct wcss_data q6_ipq9574
|
|
};
|
|
|
|
static const struct of_device_id q6_wcss_of_match[] = {
|
|
+ { .compatible = "qcom,ipq5018-q6-mpd", .data = &q6_ipq5018_res_init },
|
|
{ .compatible = "qcom,ipq5332-q6-mpd", .data = &q6_ipq5332_res_init },
|
|
{ .compatible = "qcom,ipq9574-q6-mpd", .data = &q6_ipq9574_res_init },
|
|
{ },
|