From patchwork Fri Dec 8 15:04:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 13485493 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="shhcAVCE" Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com [IPv6:2a00:1450:4864:20::331]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E0C11198D for ; Fri, 8 Dec 2023 07:04:43 -0800 (PST) Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-40c26a45b2dso12638115e9.1 for ; Fri, 08 Dec 2023 07:04:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1702047882; x=1702652682; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=71CxKbWqIB1thWUHFZAzLfbTO4lgIALsc6uKYJhAAGc=; b=shhcAVCEl76UvbS8vrxQrCqlKXUvX9HbGRNEpIEJ4Ir/VfNXyXdR5/sZ6QTOBdiEGV xQdW7YOC9GJNtN8I32g4wmiNOn5pmFpN/2hRz+1B8ZTg7/mxLUPboihXhWPZHXVAsoL2 typBHuEm6tmIEDv8K2/pK6UqFmipUfKOlSFjEajSJR92cVafVz38l5S9slbkWfADFLkk hTmlZVlpvhMBHWGiN6F7+GWlGIKzojsZqvA5GP9580Erdf/c+WZS/9tXXjBbv8ZyMuM3 M2ZBbgOLqh/c3kvws69eUzW5drlvSzTtQbUNW215dn2H6Kr143ra6DRCjgH0heJFCUrq hXDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702047882; x=1702652682; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=71CxKbWqIB1thWUHFZAzLfbTO4lgIALsc6uKYJhAAGc=; b=fu4lrhHsmM54OvfUmJ8FRt5YBLo8UrHPyuBbG/M5H2nbbLqm5IaSjcmpHiEoN+I9Sm U6MqW5rHp/ZNEWa7CkC7c6gXts4+PHsW6+t27sHccogN05WgSW7y8M7ABOrWyIzgfVmu E8Kxx5qWgW8kntES8uUzR9/pKTRTMH1exHLun4gbxiRYa7XBFEJ2mI9w3ptSdd7AZWWY 9RTUQqgjitDbNi0O0T97dgUcp3TtIwhE38mRmHMzQsVoiVcJbkhNc+WsFZ8aaxqst0iD stbvZw5gX4TnaOqPwSNCBFy38i+i2ty1YHpUsD+ORiWB4PIK2+pLy6dO3Jje3z1oG6/z 79/Q== X-Gm-Message-State: AOJu0Yy1Wh2ktWCKVofpWMDkNhwAcOzdsnQRae7/dZb5tu7CNs1IC930 RJyCBhLaP03XXlWXY9iL5mEi7Jy40X7xPWDQovjt3NvU X-Google-Smtp-Source: AGHT+IH1daTgQjHpJQimj0+aXAZhe+a6pkiEbbNbSG7KVUdT6oXN7ibghEwHNjYrCwM2w7PceyFXWQ== X-Received: by 2002:a05:600c:2489:b0:40b:5e56:7b70 with SMTP id 9-20020a05600c248900b0040b5e567b70mr147004wms.185.1702047882295; Fri, 08 Dec 2023 07:04:42 -0800 (PST) Received: from arrakeen.starnux.net ([2a01:e0a:982:cbb0:52eb:f6ff:feb3:451a]) by smtp.gmail.com with ESMTPSA id v12-20020a05600c470c00b0040b37f107c4sm2000403wmo.16.2023.12.08.07.04.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Dec 2023 07:04:40 -0800 (PST) From: Neil Armstrong Date: Fri, 08 Dec 2023 16:04:33 +0100 Subject: [PATCH v4 1/3] dt-bindings: remoteproc: qcom,sm8550-pas: document the SM8650 PAS Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20231208-topic-sm8650-upstream-remoteproc-v4-1-a96c3e5f0913@linaro.org> References: <20231208-topic-sm8650-upstream-remoteproc-v4-0-a96c3e5f0913@linaro.org> In-Reply-To: <20231208-topic-sm8650-upstream-remoteproc-v4-0-a96c3e5f0913@linaro.org> To: Andy Gross , Bjorn Andersson , Konrad Dybcio , Mathieu Poirier , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Manivannan Sadhasivam Cc: linux-arm-msm@vger.kernel.org, linux-remoteproc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Neil Armstrong , Krzysztof Kozlowski X-Mailer: b4 0.12.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=3084; i=neil.armstrong@linaro.org; h=from:subject:message-id; bh=gsIvwnD1pTzAEzxjRT3QO/jWU2a/vS/+hNR3Zbvsze0=; b=owEBbQKS/ZANAwAKAXfc29rIyEnRAcsmYgBlczCDONJoFqaR7iNWI12OHcYaTEI9wCiFw7heVmgk kSDmQdOJAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCZXMwgwAKCRB33NvayMhJ0V09D/ 9/x3J8FIkKuNQi3JAgnVlRwNEG9qgR9gcW7y5JVNe6TgTR0BqDlfYG1/6oB8fqFEvW0OR/2Nzx+rws DMcFdll3RsRbqvd8++CK0JS6aotME0kbCEaoEsbj0rzFlmm3MtmDHHP75aQoR21OM0+InU8N6lfrfG DvQ91X9fOGq/P/khpac0S9j3BUCATaC8UGWAADsl6iiiU6ibyHZzK/ObAWwCpYFD/0D6FSjGWf3jQq n8cCzxb3Z5bITChsgwM4xU0vsdRwxjBgjlUAAHY28RFfewdv+rqLkMWbiDvBVMLgs2+F0S0RTN8qgi 43rHIoFSvZv6lhjrykVP2wrlSpmc5TlkTx1P6gtfcWzYQ+rYdKHhnLwYDDgR/5YmxCexVJAo03ovQt NyK8vANVdlkm04KiLaT3DDRlaNpjed0RkHfl4UTIfn/brthOblTUEAOfz2NICxRzRN0fCUJmn75Dkz xv9F8+yaYAaSBfjIOOkznVIZJmN4YhoeOZx9hpXcqXx6lapa4b7zF0xlCSFiWnVPpo3jS1Bg3UyE+6 p7BH/gEUBXAvKEuA1NWQHWLfHdwW4cEKw5faEJ+oy1D/miI0KmIvVr4fqaWOlyiNdrZ427VaiZ+VvS jqWEXsIZ3m9bnZYZcAqo+7ksu+o+xMhJNTMt4TYquXOvbLJmxG38+Dzm5C5A== X-Developer-Key: i=neil.armstrong@linaro.org; a=openpgp; fpr=89EC3D058446217450F22848169AB7B1A4CFF8AE Document the DSP Peripheral Authentication Service on the SM8650 Platform. Reviewed-by: Krzysztof Kozlowski Signed-off-by: Neil Armstrong --- .../bindings/remoteproc/qcom,sm8550-pas.yaml | 44 +++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/remoteproc/qcom,sm8550-pas.yaml b/Documentation/devicetree/bindings/remoteproc/qcom,sm8550-pas.yaml index 58120829fb06..4e8ce9e7e9fa 100644 --- a/Documentation/devicetree/bindings/remoteproc/qcom,sm8550-pas.yaml +++ b/Documentation/devicetree/bindings/remoteproc/qcom,sm8550-pas.yaml @@ -19,6 +19,9 @@ properties: - qcom,sm8550-adsp-pas - qcom,sm8550-cdsp-pas - qcom,sm8550-mpss-pas + - qcom,sm8650-adsp-pas + - qcom,sm8650-cdsp-pas + - qcom,sm8650-mpss-pas reg: maxItems: 1 @@ -49,6 +52,7 @@ properties: - description: Memory region for main Firmware authentication - description: Memory region for Devicetree Firmware authentication - description: DSM Memory region + - description: DSM Memory region 2 required: - compatible @@ -63,6 +67,7 @@ allOf: enum: - qcom,sm8550-adsp-pas - qcom,sm8550-cdsp-pas + - qcom,sm8650-adsp-pas then: properties: interrupts: @@ -71,7 +76,26 @@ allOf: maxItems: 5 memory-region: maxItems: 2 - else: + - if: + properties: + compatible: + enum: + - qcom,sm8650-cdsp-pas + then: + properties: + interrupts: + maxItems: 5 + interrupt-names: + maxItems: 5 + memory-region: + minItems: 3 + maxItems: 3 + - if: + properties: + compatible: + enum: + - qcom,sm8550-mpss-pas + then: properties: interrupts: minItems: 6 @@ -79,12 +103,28 @@ allOf: minItems: 6 memory-region: minItems: 3 + maxItems: 3 + - if: + properties: + compatible: + enum: + - qcom,sm8650-mpss-pas + then: + properties: + interrupts: + minItems: 6 + interrupt-names: + minItems: 6 + memory-region: + minItems: 4 + maxItems: 4 - if: properties: compatible: enum: - qcom,sm8550-adsp-pas + - qcom,sm8650-adsp-pas then: properties: power-domains: @@ -101,6 +141,7 @@ allOf: compatible: enum: - qcom,sm8550-mpss-pas + - qcom,sm8650-mpss-pas then: properties: power-domains: @@ -116,6 +157,7 @@ allOf: compatible: enum: - qcom,sm8550-cdsp-pas + - qcom,sm8650-cdsp-pas then: properties: power-domains: From patchwork Fri Dec 8 15:04:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 13485494 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="fgScv7an" Received: from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com [IPv6:2a00:1450:4864:20::32c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BB60810C0 for ; Fri, 8 Dec 2023 07:04:45 -0800 (PST) Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-40c07ed92fdso22966225e9.3 for ; Fri, 08 Dec 2023 07:04:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1702047884; x=1702652684; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=vqsZcKguWohjsHLctat99spRZt5y5tI5qjm0SvLl4ZE=; b=fgScv7an4HitG28gBHCyWXr97WHImnDASHeFH3/Xv0+GMPbbSx5skst45ACl1HLqUu B6bqetDXaDeQeGyQgXbDk4b+kLnnpqcpAdjVor/6LA6Z4bFO0Bg65/qqjM2gh1gUMMjF QJSH6ITkeLAztT4+1FXjTV+/JSHe1fC6LCINVBeJ8BE6BaJltCkkNw2v3oGfWj5a+8wn qbPWBdrsf28r+p4CggGDKdpcWUUV2aXEarN4Ykcufhka5E3ATrAdMyGV8UBRGRY7f4lH hI5c7yGjZNdiZHEeQAqSE/GgYASeK0PrpKaP+in1bDYCRdaY2CkQE5z0cPCedozxzntI DR9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702047884; x=1702652684; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=vqsZcKguWohjsHLctat99spRZt5y5tI5qjm0SvLl4ZE=; b=oAcaMiF6a9qrwLJROsGvX1UcoMkdbwr4bWrOBcIX1soJbJP3nQAqwEtahwBNmeXjM2 BywiKKPpu4+IkADLk+VqrCkQQ2qbvEshX0sD+51ENdB7UzQsS2Y9lcoMJ73Ru0lmtG0e aK0g5aG8UOfODfseX6+wwesfU8Wf8qKNHjStGZthXB+bd/cEc3DHGGFVjwAS8BUTyAWi TPcSQZizTPPocdGn8EM/Br8VEJ9lTMt7d0vPPKe31DXzaRXRpVZhMUXQrXBYR79nGaia 7K2t3mAIl5tbPdgbjpmgJYKMjnpVQlf7Bzs+7uUcrUs8LUgj7elp018nPV0YwCcdllmx ceuA== X-Gm-Message-State: AOJu0YxBuRpb8uAN98nQlt9pioKY+oitYZIp2Y0fjFMs1qhZjB+15GIb aTlXLRN+K7kOsXdsTXWGsPtWcFwl1KXGMRJf3WUZ+a1d X-Google-Smtp-Source: AGHT+IEGrOMDBSqbJbtKBd1B39IlguouFg19YcjI+RXPV6h3LgFUtfUHRmjp7+SERjDE3IbuPml7hw== X-Received: by 2002:a05:600c:3187:b0:40c:2b01:e09e with SMTP id s7-20020a05600c318700b0040c2b01e09emr68023wmp.47.1702047884171; Fri, 08 Dec 2023 07:04:44 -0800 (PST) Received: from arrakeen.starnux.net ([2a01:e0a:982:cbb0:52eb:f6ff:feb3:451a]) by smtp.gmail.com with ESMTPSA id v12-20020a05600c470c00b0040b37f107c4sm2000403wmo.16.2023.12.08.07.04.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Dec 2023 07:04:43 -0800 (PST) From: Neil Armstrong Date: Fri, 08 Dec 2023 16:04:34 +0100 Subject: [PATCH v4 2/3] remoteproc: qcom: pas: make region assign more generic Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20231208-topic-sm8650-upstream-remoteproc-v4-2-a96c3e5f0913@linaro.org> References: <20231208-topic-sm8650-upstream-remoteproc-v4-0-a96c3e5f0913@linaro.org> In-Reply-To: <20231208-topic-sm8650-upstream-remoteproc-v4-0-a96c3e5f0913@linaro.org> To: Andy Gross , Bjorn Andersson , Konrad Dybcio , Mathieu Poirier , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Manivannan Sadhasivam Cc: linux-arm-msm@vger.kernel.org, linux-remoteproc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Neil Armstrong , Mukesh Ojha X-Mailer: b4 0.12.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=6215; i=neil.armstrong@linaro.org; h=from:subject:message-id; bh=ngRD2EAfVMz2KjhJy1sRQsKXQwwdQll+L7PCtpZ2fv8=; b=owEBbQKS/ZANAwAKAXfc29rIyEnRAcsmYgBlczCEqRI08YmvdKKcw1RoHeYRnkkqlBCzasaIPUVO AwQdtwSJAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCZXMwhAAKCRB33NvayMhJ0Tg3EA CThhkclpTj+X0mF0zlyJbsBBIYVn69T8AOYxM7v6jLB2iqp0oRaFXGFYqSIYwCX//NdmjnkCuz6igy tGFYoF0iWz28h5p5K/OmSCq27HJLwX5FoFdAUSWLf2v5hMixIUauwdnlC9apNXXvKPRvYIOcf2Ygck O2pZfHVgzOj8SXgaKK3TUxCn2RE/5J3Lx+k0KKkMbZzzaKjUVbi4EdaEjJEvd3FM5geJXWn7BUv/GG 48gVdE/VK0vLDHxC6icB3ErZbGxq87L3/VYBKvnjTdhrqEKvre3sG/toPYXiktPX4xd2bJkWBES1Fu Tp9eEwH2ehuOSj4xZnPInxtFK+hxqmQDs8UWRo9OJmP6uW5+C6IRFXkdk+zCo81k1K4BLwbBwWvR1A kNEhJ+Hg0oggSVnYM28fxUEGm9hZJXxiGm5fAsb/dYUF9gb6VRU5VJ1qIVeoyDINY23gNt9ip/LuN0 bbn/iiiXQQo8ZPl6hKKTeMfHlLLg0TDJd+35Gx1y9K1Fnj/X74U2yepnrhoCYIJC6ZtOHtLlobxk8G U0lQRa9cngUv1svdEnwY875d+5DkQer+UZQ0vnk4PAhR0uyX8ApqDeFnGdXU5eziNdAz3Ht3PxPGkn k4AJljXcXjm5wDdRltrti5H+lus/ZO4iqtjNTYi/gwhSCo7b+CBr5EjjaQvg== X-Developer-Key: i=neil.armstrong@linaro.org; a=openpgp; fpr=89EC3D058446217450F22848169AB7B1A4CFF8AE The current memory region assign only supports a single memory region. But new platforms introduces more regions to make the memory requirements more flexible for various use cases. Those new platforms also shares the memory region between the DSP and HLOS. To handle this, make the region assign more generic in order to support more than a single memory region and also permit setting the regions permissions as shared. Reviewed-by: Mukesh Ojha Signed-off-by: Neil Armstrong --- drivers/remoteproc/qcom_q6v5_pas.c | 100 ++++++++++++++++++++++++------------- 1 file changed, 66 insertions(+), 34 deletions(-) diff --git a/drivers/remoteproc/qcom_q6v5_pas.c b/drivers/remoteproc/qcom_q6v5_pas.c index 913a5d2068e8..46371f1ad32d 100644 --- a/drivers/remoteproc/qcom_q6v5_pas.c +++ b/drivers/remoteproc/qcom_q6v5_pas.c @@ -33,6 +33,8 @@ #define ADSP_DECRYPT_SHUTDOWN_DELAY_MS 100 +#define MAX_ASSIGN_COUNT 2 + struct adsp_data { int crash_reason_smem; const char *firmware_name; @@ -51,6 +53,9 @@ struct adsp_data { int ssctl_id; int region_assign_idx; + int region_assign_count; + bool region_assign_shared; + int region_assign_vmid; }; struct qcom_adsp { @@ -87,15 +92,18 @@ struct qcom_adsp { phys_addr_t dtb_mem_phys; phys_addr_t mem_reloc; phys_addr_t dtb_mem_reloc; - phys_addr_t region_assign_phys; + phys_addr_t region_assign_phys[MAX_ASSIGN_COUNT]; void *mem_region; void *dtb_mem_region; size_t mem_size; size_t dtb_mem_size; - size_t region_assign_size; + size_t region_assign_size[MAX_ASSIGN_COUNT]; int region_assign_idx; - u64 region_assign_perms; + int region_assign_count; + bool region_assign_shared; + int region_assign_vmid; + u64 region_assign_perms[MAX_ASSIGN_COUNT]; struct qcom_rproc_glink glink_subdev; struct qcom_rproc_subdev smd_subdev; @@ -590,37 +598,53 @@ static int adsp_alloc_memory_region(struct qcom_adsp *adsp) static int adsp_assign_memory_region(struct qcom_adsp *adsp) { - struct reserved_mem *rmem = NULL; - struct qcom_scm_vmperm perm; + struct qcom_scm_vmperm perm[MAX_ASSIGN_COUNT]; struct device_node *node; + unsigned int perm_size; + int offset; int ret; if (!adsp->region_assign_idx) return 0; - node = of_parse_phandle(adsp->dev->of_node, "memory-region", adsp->region_assign_idx); - if (node) - rmem = of_reserved_mem_lookup(node); - of_node_put(node); - if (!rmem) { - dev_err(adsp->dev, "unable to resolve shareable memory-region\n"); - return -EINVAL; - } + for (offset = 0; offset < adsp->region_assign_count; ++offset) { + struct reserved_mem *rmem = NULL; + + node = of_parse_phandle(adsp->dev->of_node, "memory-region", + adsp->region_assign_idx + offset); + if (node) + rmem = of_reserved_mem_lookup(node); + of_node_put(node); + if (!rmem) { + dev_err(adsp->dev, "unable to resolve shareable memory-region index %d\n", + offset); + return -EINVAL; + } - perm.vmid = QCOM_SCM_VMID_MSS_MSA; - perm.perm = QCOM_SCM_PERM_RW; + if (adsp->region_assign_shared) { + perm[0].vmid = QCOM_SCM_VMID_HLOS; + perm[0].perm = QCOM_SCM_PERM_RW; + perm[1].vmid = adsp->region_assign_vmid; + perm[1].perm = QCOM_SCM_PERM_RW; + perm_size = 2; + } else { + perm[0].vmid = adsp->region_assign_vmid; + perm[0].perm = QCOM_SCM_PERM_RW; + perm_size = 1; + } - adsp->region_assign_phys = rmem->base; - adsp->region_assign_size = rmem->size; - adsp->region_assign_perms = BIT(QCOM_SCM_VMID_HLOS); + adsp->region_assign_phys[offset] = rmem->base; + adsp->region_assign_size[offset] = rmem->size; + adsp->region_assign_perms[offset] = BIT(QCOM_SCM_VMID_HLOS); - ret = qcom_scm_assign_mem(adsp->region_assign_phys, - adsp->region_assign_size, - &adsp->region_assign_perms, - &perm, 1); - if (ret < 0) { - dev_err(adsp->dev, "assign memory failed\n"); - return ret; + ret = qcom_scm_assign_mem(adsp->region_assign_phys[offset], + adsp->region_assign_size[offset], + &adsp->region_assign_perms[offset], + perm, perm_size); + if (ret < 0) { + dev_err(adsp->dev, "assign memory %d failed\n", offset); + return ret; + } } return 0; @@ -629,20 +653,23 @@ static int adsp_assign_memory_region(struct qcom_adsp *adsp) static void adsp_unassign_memory_region(struct qcom_adsp *adsp) { struct qcom_scm_vmperm perm; + int offset; int ret; - if (!adsp->region_assign_idx) + if (!adsp->region_assign_idx || adsp->region_assign_shared) return; - perm.vmid = QCOM_SCM_VMID_HLOS; - perm.perm = QCOM_SCM_PERM_RW; + for (offset = 0; offset < adsp->region_assign_count; ++offset) { + perm.vmid = QCOM_SCM_VMID_HLOS; + perm.perm = QCOM_SCM_PERM_RW; - ret = qcom_scm_assign_mem(adsp->region_assign_phys, - adsp->region_assign_size, - &adsp->region_assign_perms, - &perm, 1); - if (ret < 0) - dev_err(adsp->dev, "unassign memory failed\n"); + ret = qcom_scm_assign_mem(adsp->region_assign_phys[offset], + adsp->region_assign_size[offset], + &adsp->region_assign_perms[offset], + &perm, 1); + if (ret < 0) + dev_err(adsp->dev, "unassign memory %d failed\n", offset); + } } static int adsp_probe(struct platform_device *pdev) @@ -696,6 +723,9 @@ static int adsp_probe(struct platform_device *pdev) adsp->info_name = desc->sysmon_name; adsp->decrypt_shutdown = desc->decrypt_shutdown; adsp->region_assign_idx = desc->region_assign_idx; + adsp->region_assign_count = min_t(int, MAX_ASSIGN_COUNT, desc->region_assign_count); + adsp->region_assign_vmid = desc->region_assign_vmid; + adsp->region_assign_shared = desc->region_assign_shared; if (dtb_fw_name) { adsp->dtb_firmware_name = dtb_fw_name; adsp->dtb_pas_id = desc->dtb_pas_id; @@ -1163,6 +1193,8 @@ static const struct adsp_data sm8550_mpss_resource = { .sysmon_name = "modem", .ssctl_id = 0x12, .region_assign_idx = 2, + .region_assign_count = 1, + .region_assign_vmid = QCOM_SCM_VMID_MSS_MSA, }; static const struct of_device_id adsp_of_match[] = { From patchwork Fri Dec 8 15:04:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 13485495 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="d7CDpz9a" Received: from mail-wm1-x32a.google.com (mail-wm1-x32a.google.com [IPv6:2a00:1450:4864:20::32a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5ED3210DE for ; Fri, 8 Dec 2023 07:04:48 -0800 (PST) Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-40b27726369so23601705e9.0 for ; Fri, 08 Dec 2023 07:04:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1702047887; x=1702652687; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=+bz0o75W9MzjWsPmoc4He/MB+sZajR/qnjzvhwV4daA=; b=d7CDpz9aXxCvxs9kUGV8eMwpf4b1Qb4xGWUJViLGBdOZEGI2waYOIqCQDNKlF/rFU9 7nbGHvQy5UYNeIfI4oGyrX6+nVykdDrB0+MzXmSS44Uyn3GhYp5wt+4dC4duJH0KYV+Z 6e/RjvZii4YjjzT2JR7/3aUz7X0PTQgp59CzgTHUkXOItIrna/ITJ4QAWSnJAzYe8DvM xKnr3VXMMh4osy2op6jCeRLoXK6JpP7Mp20QyctxYXb6ZrZ3+MNg9uqcgxgoLopsbP/a Pz06amljag0/R7whj/HRg4idZM6d94Fi2yt6gokEFALLC0WMg6VAfhIDfzdztqq9LYJ0 glVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702047887; x=1702652687; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+bz0o75W9MzjWsPmoc4He/MB+sZajR/qnjzvhwV4daA=; b=sjPnAL3LwYpEsSV4lNoeh+1kThksRmI5os1fRu7TdpMgCfTQXbgJvn/RQ9m8HC4Cs8 sbrLo3ngSyfA2EeqCF2oI8jw3RUCesibvNCWLfqyLolhfZ4KZ7qnV/mKxKOPShuITYCZ bEw3aeCNEPd/9d1sBNQj/39xGu8wWiXzkS056LPqwceJ6Nsy9yKjBldLWL1hQQu7EW6q eRspIrT+fSXHLzeClUuulC3lMuc27Zs+JdJXU1tH7osc58gl2q31R3w1QxuuBYUJb4lr uiugQYOX4hsvwAmKTJxKmer18VYOcc1mBiDYDpyOGvAjwpmmJCxbTUViHHCVyk4u1Ffm 4uLg== X-Gm-Message-State: AOJu0Yws3FOgFf0dmF1viegC2NrMPpfUIcYTFcDmm4IpDVcrqCFMbKWR v8Bo8LtKF2GIGNAyMK73Qd85aJdCD/cYkYfHlCjwdnFm X-Google-Smtp-Source: AGHT+IGDI2fCx+vZCS3lHiLW7ZwS3gdvHKJv1VeClxkJuterxZyNMowaDAqMfBLEYM7ikZbnserOYw== X-Received: by 2002:a7b:c4c7:0:b0:40c:38dc:f6bf with SMTP id g7-20020a7bc4c7000000b0040c38dcf6bfmr46253wmk.113.1702047886472; Fri, 08 Dec 2023 07:04:46 -0800 (PST) Received: from arrakeen.starnux.net ([2a01:e0a:982:cbb0:52eb:f6ff:feb3:451a]) by smtp.gmail.com with ESMTPSA id v12-20020a05600c470c00b0040b37f107c4sm2000403wmo.16.2023.12.08.07.04.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Dec 2023 07:04:46 -0800 (PST) From: Neil Armstrong Date: Fri, 08 Dec 2023 16:04:35 +0100 Subject: [PATCH v4 3/3] remoteproc: qcom: pas: Add SM8650 remoteproc support Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20231208-topic-sm8650-upstream-remoteproc-v4-3-a96c3e5f0913@linaro.org> References: <20231208-topic-sm8650-upstream-remoteproc-v4-0-a96c3e5f0913@linaro.org> In-Reply-To: <20231208-topic-sm8650-upstream-remoteproc-v4-0-a96c3e5f0913@linaro.org> To: Andy Gross , Bjorn Andersson , Konrad Dybcio , Mathieu Poirier , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Manivannan Sadhasivam Cc: linux-arm-msm@vger.kernel.org, linux-remoteproc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Neil Armstrong , Dmitry Baryshkov X-Mailer: b4 0.12.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=2575; i=neil.armstrong@linaro.org; h=from:subject:message-id; bh=Yr+xJnX3+hDxJJC9As0bT7NBW6HwY0A1wunSQu1QjKk=; b=owEBbQKS/ZANAwAKAXfc29rIyEnRAcsmYgBlczCEjBeer/jq4rycqvkHab/25ZaCLwFZijMUPLxW dVHZp6eJAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCZXMwhAAKCRB33NvayMhJ0XmmEA Cog4G+a3m9hGo96czS42RFwcYU/MSAY5+joX58uUmp/5yklIEomWX9L+6SCd0EpJXvlLSP8VPo5BKK xbUqwv6oJNqZTAhgDtP+9VIc0N/tk1J13+ePDfxOVDrKDbLxnyLGN8CDo3htAlVQingyPFX2Z796RF iSB1HBT2HzzkorwT9M6X0QItjJbq5xec4SfGqV6jcy7wbp2/QNo2u60VXKSLzXyb+B/lLWIv7K74k0 sEa4we0DBcAJO0dpE6FLW1N6VDBBOi+sXR0LORvRjyZNpybylQpjyF+RlkkM6WnA8gmsxNoxQSZWt+ oCdeK7khSCspP1XoWmtrWzyeXUfBnvF0V22vmHduZ0b1qE97J1Fj71tnTx2w46jTj/6NtikqwcWeq/ P2L0wnHrKxhmFhFrq7d2QujXsehF5bV0miJnkIR7QDmjUk8fGoQyZyzzrGtRUn4QpLUIIbsBI0SwH/ S/u0lhUC+lYRUb+wcwcQlfRmN5DBsgQZvxGYYXtIXW7NY0H2GorFShV36O5jUNRtmPFDPGpm7mevEf ZkABNf5nwwqb1AXkwfey8Tb7rrumjb8i+RKF9MK4CnXzGP2z3k8MSCblDSg5nUXOxL5J2OzsclKjne 15lChqz4Kt6gHxJ/NkpjMAtMJtXPRwxQ6TBVqora2s7AwrNC9G/5vTLfNmtw== X-Developer-Key: i=neil.armstrong@linaro.org; a=openpgp; fpr=89EC3D058446217450F22848169AB7B1A4CFF8AE Add DSP Peripheral Authentication Service support for the SM8650 platform. Reviewed-by: Dmitry Baryshkov Signed-off-by: Neil Armstrong --- drivers/remoteproc/qcom_q6v5_pas.c | 50 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/drivers/remoteproc/qcom_q6v5_pas.c b/drivers/remoteproc/qcom_q6v5_pas.c index 46371f1ad32d..01effbd969a5 100644 --- a/drivers/remoteproc/qcom_q6v5_pas.c +++ b/drivers/remoteproc/qcom_q6v5_pas.c @@ -1197,6 +1197,53 @@ static const struct adsp_data sm8550_mpss_resource = { .region_assign_vmid = QCOM_SCM_VMID_MSS_MSA, }; +static const struct adsp_data sm8650_cdsp_resource = { + .crash_reason_smem = 601, + .firmware_name = "cdsp.mdt", + .dtb_firmware_name = "cdsp_dtb.mdt", + .pas_id = 18, + .dtb_pas_id = 0x25, + .minidump_id = 7, + .auto_boot = true, + .proxy_pd_names = (char*[]){ + "cx", + "mxc", + "nsp", + NULL + }, + .load_state = "cdsp", + .ssr_name = "cdsp", + .sysmon_name = "cdsp", + .ssctl_id = 0x17, + .region_assign_idx = 2, + .region_assign_count = 1, + .region_assign_shared = true, + .region_assign_vmid = QCOM_SCM_VMID_CDSP, +}; + +static const struct adsp_data sm8650_mpss_resource = { + .crash_reason_smem = 421, + .firmware_name = "modem.mdt", + .dtb_firmware_name = "modem_dtb.mdt", + .pas_id = 4, + .dtb_pas_id = 0x26, + .minidump_id = 3, + .auto_boot = false, + .decrypt_shutdown = true, + .proxy_pd_names = (char*[]){ + "cx", + "mss", + NULL + }, + .load_state = "modem", + .ssr_name = "mpss", + .sysmon_name = "modem", + .ssctl_id = 0x12, + .region_assign_idx = 2, + .region_assign_count = 2, + .region_assign_vmid = QCOM_SCM_VMID_MSS_MSA, +}; + static const struct of_device_id adsp_of_match[] = { { .compatible = "qcom,msm8226-adsp-pil", .data = &adsp_resource_init}, { .compatible = "qcom,msm8953-adsp-pil", .data = &msm8996_adsp_resource}, @@ -1249,6 +1296,9 @@ static const struct of_device_id adsp_of_match[] = { { .compatible = "qcom,sm8550-adsp-pas", .data = &sm8550_adsp_resource}, { .compatible = "qcom,sm8550-cdsp-pas", .data = &sm8550_cdsp_resource}, { .compatible = "qcom,sm8550-mpss-pas", .data = &sm8550_mpss_resource}, + { .compatible = "qcom,sm8650-adsp-pas", .data = &sm8550_adsp_resource}, + { .compatible = "qcom,sm8650-cdsp-pas", .data = &sm8650_cdsp_resource}, + { .compatible = "qcom,sm8650-mpss-pas", .data = &sm8650_mpss_resource}, { }, }; MODULE_DEVICE_TABLE(of, adsp_of_match);