2022-09-27 14:19:33

by Srinivasa Rao Mandadapu

[permalink] [raw]
Subject: [PATCH v9 0/7] Update ADSP pil loader for SC7280 platform

Update ADSP pil loader driver for SC7280 platforms.
Changes since V8:
-- Add glink-edge reference in dt-bindings.
-- Remove redundant glinke-edge properties in dt-bindings.
-- Make all reg propertioes as mandatory in dt-bindings.
-- Add iommus property in dt-bindings.
Changes since V7:
-- Drop out of reset time out patch.
-- Remove redundant clocks in dt bindings.
-- Fix dt compilation error in dt bindings.
Changes since V6:
-- Update dt-bindings with glink-edge
-- Add qcom,qmp property.
-- Update parse firmware callback.
-- Update commit message.
-- Update smmu map and unmap function names.
-- Revert adsp_ops const change.
-- Move iommu check to within smmu map/unmap functions.
Changes since V5:
-- Remove adsp_rproc_unmap_smmu, adsp_of_unmap_smmu, adsp_of_map_smmu and
adsp_rproc_map_smmu functions.
-- Remove find_loaded_rsc_table call back initialization.
-- Rename adsp_sandbox_needed to has_iommu.
-- Update parse_fw callback in rproc ops.
-- Remove qcom,adsp-memory-regions property in dt-bindings.
-- Change adsp binary extension name.
Changes since V4:
-- Update halt registers description in dt bindings.
-- Update Memory sandboxing with proper APIs for resource
allocation and free.
Changes since V3:
-- Rename is_adsp_sb_needed to adsp_sandbox_needed.
-- Update sc7280 compatible name entry in sorted order.
-- Add smmu unmapping in error case and in adsp stop.
-- Revert converting sdm845 dt bindings to generic and
create new dt bindings for sc7280.
Changes since V2:
-- Generated patch with -M flag.
-- Add Clock property in dt bindings.
-- Add qcom,adsp-memory-regions property.
-- Add is_adsp_sb_needed flag instead of is_wpss.
-- Initialize is_adsp_sb_needed flag.
-- Remove empty proxy pds array.
-- Replace platform_bus_type with adsp->dev->bus.
-- Use API of_parse_phandle_with_args() instead of
of_parse_phandle_with_fixed_args().
-- Replace adsp->is_wpss with adsp->is_adsp.
-- Update error handling in adsp_start().
Changes since V1:
-- Change reg property maxItems to minItems and update description.
-- Fix typo errors.

Srinivasa Rao Mandadapu (7):
dt-bindings: remoteproc: qcom: Add SC7280 ADSP support
remoteproc: qcom: Add flag in adsp private data structure
remoteproc: qcom: Add compatible name for SC7280 ADSP
remoteproc: qcom: Update rproc parse firmware callback
remoteproc: qcom: Replace hard coded values with macros
remoteproc: qcom: Add efuse evb selection control
remoteproc: qcom: Add support for memory sandbox

.../bindings/remoteproc/qcom,sc7280-adsp-pil.yaml | 194 +++++++++++++++++++++
drivers/remoteproc/qcom_q6v5_adsp.c | 124 ++++++++++++-
2 files changed, 314 insertions(+), 4 deletions(-)
create mode 100644 Documentation/devicetree/bindings/remoteproc/qcom,sc7280-adsp-pil.yaml

--
2.7.4


2022-09-27 14:53:32

by Srinivasa Rao Mandadapu

[permalink] [raw]
Subject: [PATCH v9 6/7] remoteproc: qcom: Add efuse evb selection control

Add efuse evb selection control and enable it for starting ADSP.

Signed-off-by: Srinivasa Rao Mandadapu <[email protected]>
Reviewed-by: Stephen Boyd <[email protected]>
Reviewed-by: Sibi Sankar <[email protected]>
---
Changes since V5:
-- Split devm_platform_ioremap_resource_byname function.

drivers/remoteproc/qcom_q6v5_adsp.c | 17 +++++++++++++++++
1 file changed, 17 insertions(+)

diff --git a/drivers/remoteproc/qcom_q6v5_adsp.c b/drivers/remoteproc/qcom_q6v5_adsp.c
index 14c94af..4e70e76 100644
--- a/drivers/remoteproc/qcom_q6v5_adsp.c
+++ b/drivers/remoteproc/qcom_q6v5_adsp.c
@@ -56,6 +56,7 @@

#define LPASS_BOOT_CORE_START BIT(0)
#define LPASS_BOOT_CMD_START BIT(0)
+#define LPASS_EFUSE_Q6SS_EVB_SEL 0x0

struct adsp_pil_data {
int crash_reason_smem;
@@ -86,6 +87,7 @@ struct qcom_adsp {
struct clk_bulk_data *clks;

void __iomem *qdsp6ss_base;
+ void __iomem *lpass_efuse;

struct reset_control *pdc_sync_reset;
struct reset_control *restart;
@@ -367,6 +369,9 @@ static int adsp_start(struct rproc *rproc)
/* Program boot address */
writel(adsp->mem_phys >> 4, adsp->qdsp6ss_base + RST_EVB_REG);

+ if (adsp->lpass_efuse)
+ writel(LPASS_EFUSE_Q6SS_EVB_SEL, adsp->lpass_efuse);
+
/* De-assert QDSP6 stop core. QDSP6 will execute after out of reset */
writel(LPASS_BOOT_CORE_START, adsp->qdsp6ss_base + CORE_START_REG);

@@ -533,6 +538,7 @@ static int adsp_init_reset(struct qcom_adsp *adsp)
static int adsp_init_mmio(struct qcom_adsp *adsp,
struct platform_device *pdev)
{
+ struct resource *efuse_region;
struct device_node *syscon;
int ret;

@@ -542,6 +548,17 @@ static int adsp_init_mmio(struct qcom_adsp *adsp,
return PTR_ERR(adsp->qdsp6ss_base);
}

+ efuse_region = platform_get_resource(pdev, IORESOURCE_MEM, 1);
+ if (!efuse_region) {
+ adsp->lpass_efuse = NULL;
+ dev_dbg(adsp->dev, "failed to get efuse memory region\n");
+ } else {
+ adsp->lpass_efuse = devm_ioremap_resource(&pdev->dev, efuse_region);
+ if (IS_ERR(adsp->lpass_efuse)) {
+ dev_err(adsp->dev, "failed to map efuse registers\n");
+ return PTR_ERR(adsp->lpass_efuse);
+ }
+ }
syscon = of_parse_phandle(pdev->dev.of_node, "qcom,halt-regs", 0);
if (!syscon) {
dev_err(&pdev->dev, "failed to parse qcom,halt-regs\n");
--
2.7.4

2022-09-27 14:57:41

by Srinivasa Rao Mandadapu

[permalink] [raw]
Subject: [PATCH v9 4/7] remoteproc: qcom: Update rproc parse firmware callback

Change parse_fw callback in rproc ops from qcom_register_dump_segments
to local function such that, it can perform coredump segments registration
and it can parse section header in memory sandboxing required platforms.

Signed-off-by: Srinivasa Rao Mandadapu <[email protected]>
---
Changes since V6:
-- Update parse firmware callback.

drivers/remoteproc/qcom_q6v5_adsp.c | 23 ++++++++++++++++++++++-
1 file changed, 22 insertions(+), 1 deletion(-)

diff --git a/drivers/remoteproc/qcom_q6v5_adsp.c b/drivers/remoteproc/qcom_q6v5_adsp.c
index 14a3864..b8cbbf7 100644
--- a/drivers/remoteproc/qcom_q6v5_adsp.c
+++ b/drivers/remoteproc/qcom_q6v5_adsp.c
@@ -439,6 +439,27 @@ static void *adsp_da_to_va(struct rproc *rproc, u64 da, size_t len, bool *is_iom
return adsp->mem_region + offset;
}

+static int adsp_parse_firmware(struct rproc *rproc, const struct firmware *fw)
+{
+ struct qcom_adsp *adsp = rproc->priv;
+ int ret;
+
+ ret = qcom_register_dump_segments(rproc, fw);
+ if (ret) {
+ dev_err(&rproc->dev, "Error in registering dump segments\n");
+ return ret;
+ }
+
+ if (adsp->has_iommu) {
+ ret = rproc_elf_load_rsc_table(rproc, fw);
+ if (ret) {
+ dev_err(&rproc->dev, "Error in loading resource table\n");
+ return ret;
+ }
+ }
+ return 0;
+}
+
static unsigned long adsp_panic(struct rproc *rproc)
{
struct qcom_adsp *adsp = rproc->priv;
@@ -450,7 +471,7 @@ static const struct rproc_ops adsp_ops = {
.start = adsp_start,
.stop = adsp_stop,
.da_to_va = adsp_da_to_va,
- .parse_fw = qcom_register_dump_segments,
+ .parse_fw = adsp_parse_firmware,
.load = adsp_load,
.panic = adsp_panic,
};
--
2.7.4