Commit 6d674804 authored by Arnd Bergmann's avatar Arnd Bergmann

Merge tag 'qcom-drivers-for-6.12' of...

Merge tag 'qcom-drivers-for-6.12' of https://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux into soc/drivers

Qualcomm driver updates for v6.12

Support is added for making SCM driver configure the system either for a
full or minimal ramdump following a system crash. The ramdump mode is
changed from being enable-only to enable/disable as requested.

The QSEECOM uefisecapp interface is allow-listed on Surface Laptop 7 and
Lenovo Thinkpad T14s, providing EFI variable access.

The change to match the SMD RPM driver based on the SMD channel name is
reverted, in favor of stepping back to OF-based matching, as a means to
get module autoloading to work properly.

AOSS, APR, ICE, OCMEM, PBS and SMP2P drivers has error handling cleaned
up using scoped resources.

Trace events are added to the BWMON and SMP2P drivers, for better
insights into their operations.

The X1E LLCC configuration data is updated based on recommended values.

A number of platforms are added to the in-kernel PD-mapper.

SocInfo driver is extended with IDs from SM7325, QCS8275 and QCS8300
families.

* tag 'qcom-drivers-for-6.12' of https://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux: (33 commits)
  firmware: qcom: scm: Allow QSEECOM on Surface Laptop 7 models
  dt-bindings: soc: qcom: qcom,pmic-glink: Document SM7325 compatible
  soc: qcom: pd_mapper: Add SM7325 compatible
  soc: qcom: socinfo: Add Soc IDs for SM7325 family
  dt-bindings: arm: qcom,ids: Add IDs for SM7325 family
  soc: qcom: socinfo: add QCS8275/QCS8300 SoC ID
  dt-bindings: arm: qcom,ids: add SoC ID for QCS8275/QCS8300
  soc: qcom: smp2p: use scoped device node handling to simplify error paths
  soc: qcom: pbs: use scoped device node handling to simplify error paths
  soc: qcom: ocmem: use scoped device node handling to simplify error paths
  soc: qcom: ice: use scoped device node handling to simplify error paths
  soc: qcom: aoss: simplify with scoped for each OF child loop
  soc: qcom: apr: simplify with scoped for each OF child loop
  soc: qcom: smd-rpm: add qcom,smd-rpm compatible
  dt-bindings: soc: qcom: smd-rpm: add generic compatibles
  Revert "soc: qcom: smd-rpm: Match rpmsg channel instead of compatible"
  firmware: qcom: scm: Add multiple download mode support
  firmware: qcom: scm: Refactor code to support multiple dload mode
  soc: qcom: pd_mapper: Add more older platforms without domains
  soc: qcom: pd_mapper: Add X1E80100
  ...

Link: https://lore.kernel.org/r/20240904193042.15118-1-andersson@kernel.orgSigned-off-by: default avatarArnd Bergmann <arnd@arndb.de>
parents 3b425306 6614be05
...@@ -354,6 +354,8 @@ Kenneth Westfield <quic_kwestfie@quicinc.com> <kwestfie@codeaurora.org> ...@@ -354,6 +354,8 @@ Kenneth Westfield <quic_kwestfie@quicinc.com> <kwestfie@codeaurora.org>
Kiran Gunda <quic_kgunda@quicinc.com> <kgunda@codeaurora.org> Kiran Gunda <quic_kgunda@quicinc.com> <kgunda@codeaurora.org>
Kirill Tkhai <tkhai@ya.ru> <ktkhai@virtuozzo.com> Kirill Tkhai <tkhai@ya.ru> <ktkhai@virtuozzo.com>
Kishon Vijay Abraham I <kishon@kernel.org> <kishon@ti.com> Kishon Vijay Abraham I <kishon@kernel.org> <kishon@ti.com>
Konrad Dybcio <konradybcio@kernel.org> <konrad.dybcio@linaro.org>
Konrad Dybcio <konradybcio@kernel.org> <konrad.dybcio@somainline.org>
Konstantin Khlebnikov <koct9i@gmail.com> <khlebnikov@yandex-team.ru> Konstantin Khlebnikov <koct9i@gmail.com> <khlebnikov@yandex-team.ru>
Konstantin Khlebnikov <koct9i@gmail.com> <k.khlebnikov@samsung.com> Konstantin Khlebnikov <koct9i@gmail.com> <k.khlebnikov@samsung.com>
Koushik <raghavendra.koushik@neterion.com> Koushik <raghavendra.koushik@neterion.com>
......
...@@ -139,7 +139,7 @@ examples: ...@@ -139,7 +139,7 @@ examples:
- | - |
rpm { rpm {
rpm-requests { rpm-requests {
compatible = "qcom,rpm-msm8916"; compatible = "qcom,rpm-msm8916", "qcom,smd-rpm";
qcom,smd-channels = "rpm_requests"; qcom,smd-channels = "rpm_requests";
clock-controller { clock-controller {
......
...@@ -90,7 +90,7 @@ examples: ...@@ -90,7 +90,7 @@ examples:
qcom,rpm-msg-ram = <&rpm_msg_ram>; qcom,rpm-msg-ram = <&rpm_msg_ram>;
rpm-requests { rpm-requests {
compatible = "qcom,rpm-msm8996"; compatible = "qcom,rpm-msm8996", "qcom,glink-smd-rpm";
qcom,glink-channels = "rpm_requests"; qcom,glink-channels = "rpm_requests";
/* ... */ /* ... */
......
...@@ -142,7 +142,7 @@ examples: ...@@ -142,7 +142,7 @@ examples:
qcom,smd-edge = <15>; qcom,smd-edge = <15>;
rpm-requests { rpm-requests {
compatible = "qcom,rpm-msm8916"; compatible = "qcom,rpm-msm8916", "qcom,smd-rpm";
qcom,smd-channels = "rpm_requests"; qcom,smd-channels = "rpm_requests";
/* ... */ /* ... */
}; };
...@@ -163,7 +163,7 @@ examples: ...@@ -163,7 +163,7 @@ examples:
mboxes = <&apcs_glb 0>; mboxes = <&apcs_glb 0>;
rpm-requests { rpm-requests {
compatible = "qcom,rpm-qcm2290"; compatible = "qcom,rpm-qcm2290", "qcom,glink-smd-rpm";
qcom,glink-channels = "rpm_requests"; qcom,glink-channels = "rpm_requests";
/* ... */ /* ... */
}; };
......
...@@ -30,6 +30,11 @@ properties: ...@@ -30,6 +30,11 @@ properties:
- qcom,sm8450-pmic-glink - qcom,sm8450-pmic-glink
- qcom,sm8550-pmic-glink - qcom,sm8550-pmic-glink
- const: qcom,pmic-glink - const: qcom,pmic-glink
- items:
- enum:
- qcom,sm7325-pmic-glink
- const: qcom,qcm6490-pmic-glink
- const: qcom,pmic-glink
- items: - items:
- enum: - enum:
- qcom,sm8650-pmic-glink - qcom,sm8650-pmic-glink
......
...@@ -30,31 +30,37 @@ maintainers: ...@@ -30,31 +30,37 @@ maintainers:
properties: properties:
compatible: compatible:
enum: oneOf:
- qcom,rpm-apq8084 - items:
- qcom,rpm-ipq6018 - enum:
- qcom,rpm-ipq9574 - qcom,rpm-apq8084
- qcom,rpm-mdm9607 - qcom,rpm-mdm9607
- qcom,rpm-msm8226 - qcom,rpm-msm8226
- qcom,rpm-msm8610 - qcom,rpm-msm8610
- qcom,rpm-msm8909 - qcom,rpm-msm8909
- qcom,rpm-msm8916 - qcom,rpm-msm8916
- qcom,rpm-msm8917 - qcom,rpm-msm8917
- qcom,rpm-msm8936 - qcom,rpm-msm8936
- qcom,rpm-msm8937 - qcom,rpm-msm8937
- qcom,rpm-msm8952 - qcom,rpm-msm8952
- qcom,rpm-msm8953 - qcom,rpm-msm8953
- qcom,rpm-msm8974 - qcom,rpm-msm8974
- qcom,rpm-msm8976 - qcom,rpm-msm8976
- qcom,rpm-msm8994 - qcom,rpm-msm8994
- qcom,rpm-msm8996 - const: qcom,smd-rpm
- qcom,rpm-msm8998 - items:
- qcom,rpm-qcm2290 - enum:
- qcom,rpm-qcs404 - qcom,rpm-ipq6018
- qcom,rpm-sdm660 - qcom,rpm-ipq9574
- qcom,rpm-sm6115 - qcom,rpm-msm8996
- qcom,rpm-sm6125 - qcom,rpm-msm8998
- qcom,rpm-sm6375 - qcom,rpm-qcm2290
- qcom,rpm-qcs404
- qcom,rpm-sdm660
- qcom,rpm-sm6115
- qcom,rpm-sm6125
- qcom,rpm-sm6375
- const: qcom,glink-smd-rpm
clock-controller: clock-controller:
$ref: /schemas/clock/qcom,rpmcc.yaml# $ref: /schemas/clock/qcom,rpmcc.yaml#
...@@ -84,21 +90,7 @@ if: ...@@ -84,21 +90,7 @@ if:
properties: properties:
compatible: compatible:
contains: contains:
enum: const: qcom,smd-rpm
- qcom,rpm-apq8084
- qcom,rpm-mdm9607
- qcom,rpm-msm8226
- qcom,rpm-msm8610
- qcom,rpm-msm8909
- qcom,rpm-msm8916
- qcom,rpm-msm8917
- qcom,rpm-msm8936
- qcom,rpm-msm8937
- qcom,rpm-msm8952
- qcom,rpm-msm8953
- qcom,rpm-msm8974
- qcom,rpm-msm8976
- qcom,rpm-msm8994
then: then:
properties: properties:
qcom,glink-channels: false qcom,glink-channels: false
...@@ -129,7 +121,7 @@ examples: ...@@ -129,7 +121,7 @@ examples:
qcom,smd-edge = <15>; qcom,smd-edge = <15>;
rpm-requests { rpm-requests {
compatible = "qcom,rpm-msm8916"; compatible = "qcom,rpm-msm8916", "qcom,smd-rpm";
qcom,smd-channels = "rpm_requests"; qcom,smd-channels = "rpm_requests";
clock-controller { clock-controller {
......
...@@ -56,7 +56,7 @@ examples: ...@@ -56,7 +56,7 @@ examples:
qcom,smd-edge = <15>; qcom,smd-edge = <15>;
rpm-requests { rpm-requests {
compatible = "qcom,rpm-msm8974"; compatible = "qcom,rpm-msm8974", "qcom,smd-rpm";
qcom,smd-channels = "rpm_requests"; qcom,smd-channels = "rpm_requests";
clock-controller { clock-controller {
......
...@@ -2745,7 +2745,7 @@ F: include/linux/soc/qcom/ ...@@ -2745,7 +2745,7 @@ F: include/linux/soc/qcom/
ARM/QUALCOMM SUPPORT ARM/QUALCOMM SUPPORT
M: Bjorn Andersson <andersson@kernel.org> M: Bjorn Andersson <andersson@kernel.org>
M: Konrad Dybcio <konrad.dybcio@linaro.org> M: Konrad Dybcio <konradybcio@kernel.org>
L: linux-arm-msm@vger.kernel.org L: linux-arm-msm@vger.kernel.org
S: Maintained S: Maintained
T: git git://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux.git T: git git://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux.git
...@@ -7106,7 +7106,7 @@ F: drivers/gpu/drm/tiny/panel-mipi-dbi.c ...@@ -7106,7 +7106,7 @@ F: drivers/gpu/drm/tiny/panel-mipi-dbi.c
DRM DRIVER for Qualcomm Adreno GPUs DRM DRIVER for Qualcomm Adreno GPUs
M: Rob Clark <robdclark@gmail.com> M: Rob Clark <robdclark@gmail.com>
R: Sean Paul <sean@poorly.run> R: Sean Paul <sean@poorly.run>
R: Konrad Dybcio <konrad.dybcio@linaro.org> R: Konrad Dybcio <konradybcio@kernel.org>
L: linux-arm-msm@vger.kernel.org L: linux-arm-msm@vger.kernel.org
L: dri-devel@lists.freedesktop.org L: dri-devel@lists.freedesktop.org
L: freedreno@lists.freedesktop.org L: freedreno@lists.freedesktop.org
...@@ -18777,7 +18777,7 @@ F: include/uapi/drm/qaic_accel.h ...@@ -18777,7 +18777,7 @@ F: include/uapi/drm/qaic_accel.h
QUALCOMM CORE POWER REDUCTION (CPR) AVS DRIVER QUALCOMM CORE POWER REDUCTION (CPR) AVS DRIVER
M: Bjorn Andersson <andersson@kernel.org> M: Bjorn Andersson <andersson@kernel.org>
M: Konrad Dybcio <konrad.dybcio@linaro.org> M: Konrad Dybcio <konradybcio@kernel.org>
L: linux-pm@vger.kernel.org L: linux-pm@vger.kernel.org
L: linux-arm-msm@vger.kernel.org L: linux-arm-msm@vger.kernel.org
S: Maintained S: Maintained
...@@ -18861,6 +18861,7 @@ L: linux-arm-msm@vger.kernel.org ...@@ -18861,6 +18861,7 @@ L: linux-arm-msm@vger.kernel.org
S: Maintained S: Maintained
F: Documentation/devicetree/bindings/interconnect/qcom,msm8998-bwmon.yaml F: Documentation/devicetree/bindings/interconnect/qcom,msm8998-bwmon.yaml
F: drivers/soc/qcom/icc-bwmon.c F: drivers/soc/qcom/icc-bwmon.c
F: drivers/soc/qcom/trace_icc-bwmon.h
QUALCOMM IOMMU QUALCOMM IOMMU
M: Rob Clark <robdclark@gmail.com> M: Rob Clark <robdclark@gmail.com>
......
...@@ -41,17 +41,6 @@ config QCOM_TZMEM_MODE_SHMBRIDGE ...@@ -41,17 +41,6 @@ config QCOM_TZMEM_MODE_SHMBRIDGE
endchoice endchoice
config QCOM_SCM_DOWNLOAD_MODE_DEFAULT
bool "Qualcomm download mode enabled by default"
depends on QCOM_SCM
help
A device with "download mode" enabled will upon an unexpected
warm-restart enter a special debug mode that allows the user to
"download" memory content over USB for offline postmortem analysis.
The feature can be enabled/disabled on the kernel command line.
Say Y here to enable "download mode" by default.
config QCOM_QSEECOM config QCOM_QSEECOM
bool "Qualcomm QSEECOM interface driver" bool "Qualcomm QSEECOM interface driver"
depends on QCOM_SCM=y depends on QCOM_SCM=y
......
...@@ -73,7 +73,7 @@ int scm_get_wq_ctx(u32 *wq_ctx, u32 *flags, u32 *more_pending) ...@@ -73,7 +73,7 @@ int scm_get_wq_ctx(u32 *wq_ctx, u32 *flags, u32 *more_pending)
struct arm_smccc_res get_wq_res; struct arm_smccc_res get_wq_res;
struct arm_smccc_args get_wq_ctx = {0}; struct arm_smccc_args get_wq_ctx = {0};
get_wq_ctx.args[0] = ARM_SMCCC_CALL_VAL(ARM_SMCCC_STD_CALL, get_wq_ctx.args[0] = ARM_SMCCC_CALL_VAL(ARM_SMCCC_FAST_CALL,
ARM_SMCCC_SMC_64, ARM_SMCCC_OWNER_SIP, ARM_SMCCC_SMC_64, ARM_SMCCC_OWNER_SIP,
SCM_SMC_FNID(QCOM_SCM_SVC_WAITQ, QCOM_SCM_WAITQ_GET_WQ_CTX)); SCM_SMC_FNID(QCOM_SCM_SVC_WAITQ, QCOM_SCM_WAITQ_GET_WQ_CTX));
......
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
#include <linux/init.h> #include <linux/init.h>
#include <linux/interconnect.h> #include <linux/interconnect.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/kstrtox.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/of.h> #include <linux/of.h>
#include <linux/of_address.h> #include <linux/of_address.h>
...@@ -32,8 +33,7 @@ ...@@ -32,8 +33,7 @@
#include "qcom_scm.h" #include "qcom_scm.h"
#include "qcom_tzmem.h" #include "qcom_tzmem.h"
static bool download_mode = IS_ENABLED(CONFIG_QCOM_SCM_DOWNLOAD_MODE_DEFAULT); static u32 download_mode;
module_param(download_mode, bool, 0);
struct qcom_scm { struct qcom_scm {
struct device *dev; struct device *dev;
...@@ -126,6 +126,8 @@ static const u8 qcom_scm_cpu_warm_bits[QCOM_SCM_BOOT_MAX_CPUS] = { ...@@ -126,6 +126,8 @@ static const u8 qcom_scm_cpu_warm_bits[QCOM_SCM_BOOT_MAX_CPUS] = {
#define QCOM_DLOAD_MASK GENMASK(5, 4) #define QCOM_DLOAD_MASK GENMASK(5, 4)
#define QCOM_DLOAD_NODUMP 0 #define QCOM_DLOAD_NODUMP 0
#define QCOM_DLOAD_FULLDUMP 1 #define QCOM_DLOAD_FULLDUMP 1
#define QCOM_DLOAD_MINIDUMP 2
#define QCOM_DLOAD_BOTHDUMP 3
static const char * const qcom_scm_convention_names[] = { static const char * const qcom_scm_convention_names[] = {
[SMC_CONVENTION_UNKNOWN] = "unknown", [SMC_CONVENTION_UNKNOWN] = "unknown",
...@@ -134,6 +136,13 @@ static const char * const qcom_scm_convention_names[] = { ...@@ -134,6 +136,13 @@ static const char * const qcom_scm_convention_names[] = {
[SMC_CONVENTION_LEGACY] = "smc legacy", [SMC_CONVENTION_LEGACY] = "smc legacy",
}; };
static const char * const download_mode_name[] = {
[QCOM_DLOAD_NODUMP] = "off",
[QCOM_DLOAD_FULLDUMP] = "full",
[QCOM_DLOAD_MINIDUMP] = "mini",
[QCOM_DLOAD_BOTHDUMP] = "full,mini",
};
static struct qcom_scm *__scm; static struct qcom_scm *__scm;
static int qcom_scm_clk_enable(void) static int qcom_scm_clk_enable(void)
...@@ -526,17 +535,16 @@ static int qcom_scm_io_rmw(phys_addr_t addr, unsigned int mask, unsigned int val ...@@ -526,17 +535,16 @@ static int qcom_scm_io_rmw(phys_addr_t addr, unsigned int mask, unsigned int val
return qcom_scm_io_writel(addr, new); return qcom_scm_io_writel(addr, new);
} }
static void qcom_scm_set_download_mode(bool enable) static void qcom_scm_set_download_mode(u32 dload_mode)
{ {
u32 val = enable ? QCOM_DLOAD_FULLDUMP : QCOM_DLOAD_NODUMP;
int ret = 0; int ret = 0;
if (__scm->dload_mode_addr) { if (__scm->dload_mode_addr) {
ret = qcom_scm_io_rmw(__scm->dload_mode_addr, QCOM_DLOAD_MASK, ret = qcom_scm_io_rmw(__scm->dload_mode_addr, QCOM_DLOAD_MASK,
FIELD_PREP(QCOM_DLOAD_MASK, val)); FIELD_PREP(QCOM_DLOAD_MASK, dload_mode));
} else if (__qcom_scm_is_call_available(__scm->dev, QCOM_SCM_SVC_BOOT, } else if (__qcom_scm_is_call_available(__scm->dev, QCOM_SCM_SVC_BOOT,
QCOM_SCM_BOOT_SET_DLOAD_MODE)) { QCOM_SCM_BOOT_SET_DLOAD_MODE)) {
ret = __qcom_scm_set_dload_mode(__scm->dev, enable); ret = __qcom_scm_set_dload_mode(__scm->dev, !!dload_mode);
} else { } else {
dev_err(__scm->dev, dev_err(__scm->dev,
"No available mechanism for setting download mode\n"); "No available mechanism for setting download mode\n");
...@@ -1724,7 +1732,10 @@ EXPORT_SYMBOL_GPL(qcom_scm_qseecom_app_send); ...@@ -1724,7 +1732,10 @@ EXPORT_SYMBOL_GPL(qcom_scm_qseecom_app_send);
*/ */
static const struct of_device_id qcom_scm_qseecom_allowlist[] __maybe_unused = { static const struct of_device_id qcom_scm_qseecom_allowlist[] __maybe_unused = {
{ .compatible = "lenovo,flex-5g" }, { .compatible = "lenovo,flex-5g" },
{ .compatible = "lenovo,thinkpad-t14s" },
{ .compatible = "lenovo,thinkpad-x13s", }, { .compatible = "lenovo,thinkpad-x13s", },
{ .compatible = "microsoft,romulus13", },
{ .compatible = "microsoft,romulus15", },
{ .compatible = "qcom,sc8180x-primus" }, { .compatible = "qcom,sc8180x-primus" },
{ .compatible = "qcom,x1e80100-crd" }, { .compatible = "qcom,x1e80100-crd" },
{ .compatible = "qcom,x1e80100-qcp" }, { .compatible = "qcom,x1e80100-qcp" },
...@@ -1886,6 +1897,45 @@ static irqreturn_t qcom_scm_irq_handler(int irq, void *data) ...@@ -1886,6 +1897,45 @@ static irqreturn_t qcom_scm_irq_handler(int irq, void *data)
return IRQ_HANDLED; return IRQ_HANDLED;
} }
static int get_download_mode(char *buffer, const struct kernel_param *kp)
{
if (download_mode >= ARRAY_SIZE(download_mode_name))
return sysfs_emit(buffer, "unknown mode\n");
return sysfs_emit(buffer, "%s\n", download_mode_name[download_mode]);
}
static int set_download_mode(const char *val, const struct kernel_param *kp)
{
bool tmp;
int ret;
ret = sysfs_match_string(download_mode_name, val);
if (ret < 0) {
ret = kstrtobool(val, &tmp);
if (ret < 0) {
pr_err("qcom_scm: err: %d\n", ret);
return ret;
}
ret = tmp ? 1 : 0;
}
download_mode = ret;
if (__scm)
qcom_scm_set_download_mode(download_mode);
return 0;
}
static const struct kernel_param_ops download_mode_param_ops = {
.get = get_download_mode,
.set = set_download_mode,
};
module_param_cb(download_mode, &download_mode_param_ops, NULL, 0644);
MODULE_PARM_DESC(download_mode, "download mode: off/0/N for no dump mode, full/on/1/Y for full dump mode, mini for minidump mode and full,mini for both full and minidump mode together are acceptable values");
static int qcom_scm_probe(struct platform_device *pdev) static int qcom_scm_probe(struct platform_device *pdev)
{ {
struct qcom_tzmem_pool_config pool_config; struct qcom_tzmem_pool_config pool_config;
...@@ -1950,18 +2000,16 @@ static int qcom_scm_probe(struct platform_device *pdev) ...@@ -1950,18 +2000,16 @@ static int qcom_scm_probe(struct platform_device *pdev)
__get_convention(); __get_convention();
/* /*
* If requested enable "download mode", from this point on warmboot * If "download mode" is requested, from this point on warmboot
* will cause the boot stages to enter download mode, unless * will cause the boot stages to enter download mode, unless
* disabled below by a clean shutdown/reboot. * disabled below by a clean shutdown/reboot.
*/ */
if (download_mode) qcom_scm_set_download_mode(download_mode);
qcom_scm_set_download_mode(true);
/* /*
* Disable SDI if indicated by DT that it is enabled by default. * Disable SDI if indicated by DT that it is enabled by default.
*/ */
if (of_property_read_bool(pdev->dev.of_node, "qcom,sdi-enabled")) if (of_property_read_bool(pdev->dev.of_node, "qcom,sdi-enabled") || !download_mode)
qcom_scm_disable_sdi(); qcom_scm_disable_sdi();
ret = of_reserved_mem_device_init(__scm->dev); ret = of_reserved_mem_device_init(__scm->dev);
...@@ -2003,7 +2051,7 @@ static int qcom_scm_probe(struct platform_device *pdev) ...@@ -2003,7 +2051,7 @@ static int qcom_scm_probe(struct platform_device *pdev)
static void qcom_scm_shutdown(struct platform_device *pdev) static void qcom_scm_shutdown(struct platform_device *pdev)
{ {
/* Clean shutdown, disable download mode to allow normal restart */ /* Clean shutdown, disable download mode to allow normal restart */
qcom_scm_set_download_mode(false); qcom_scm_set_download_mode(QCOM_DLOAD_NODUMP);
} }
static const struct of_device_id qcom_scm_dt_match[] = { static const struct of_device_id qcom_scm_dt_match[] = {
......
...@@ -40,7 +40,6 @@ struct qcom_tzmem_pool { ...@@ -40,7 +40,6 @@ struct qcom_tzmem_pool {
}; };
struct qcom_tzmem_chunk { struct qcom_tzmem_chunk {
phys_addr_t paddr;
size_t size; size_t size;
struct qcom_tzmem_pool *owner; struct qcom_tzmem_pool *owner;
}; };
...@@ -385,7 +384,6 @@ void *qcom_tzmem_alloc(struct qcom_tzmem_pool *pool, size_t size, gfp_t gfp) ...@@ -385,7 +384,6 @@ void *qcom_tzmem_alloc(struct qcom_tzmem_pool *pool, size_t size, gfp_t gfp)
return NULL; return NULL;
} }
chunk->paddr = gen_pool_virt_to_phys(pool->genpool, vaddr);
chunk->size = size; chunk->size = size;
chunk->owner = pool; chunk->owner = pool;
...@@ -431,25 +429,37 @@ void qcom_tzmem_free(void *vaddr) ...@@ -431,25 +429,37 @@ void qcom_tzmem_free(void *vaddr)
EXPORT_SYMBOL_GPL(qcom_tzmem_free); EXPORT_SYMBOL_GPL(qcom_tzmem_free);
/** /**
* qcom_tzmem_to_phys() - Map the virtual address of a TZ buffer to physical. * qcom_tzmem_to_phys() - Map the virtual address of TZ memory to physical.
* @vaddr: Virtual address of the buffer allocated from a TZ memory pool. * @vaddr: Virtual address of memory allocated from a TZ memory pool.
* *
* Can be used in any context. The address must have been returned by a call * Can be used in any context. The address must point to memory allocated
* to qcom_tzmem_alloc(). * using qcom_tzmem_alloc().
* *
* Returns: Physical address of the buffer. * Returns:
* Physical address mapped from the virtual or 0 if the mapping failed.
*/ */
phys_addr_t qcom_tzmem_to_phys(void *vaddr) phys_addr_t qcom_tzmem_to_phys(void *vaddr)
{ {
struct qcom_tzmem_chunk *chunk; struct qcom_tzmem_chunk *chunk;
struct radix_tree_iter iter;
void __rcu **slot;
phys_addr_t ret;
guard(spinlock_irqsave)(&qcom_tzmem_chunks_lock); guard(spinlock_irqsave)(&qcom_tzmem_chunks_lock);
chunk = radix_tree_lookup(&qcom_tzmem_chunks, (unsigned long)vaddr); radix_tree_for_each_slot(slot, &qcom_tzmem_chunks, &iter, 0) {
if (!chunk) chunk = radix_tree_deref_slot_protected(slot,
return 0; &qcom_tzmem_chunks_lock);
return chunk->paddr; ret = gen_pool_virt_to_phys(chunk->owner->genpool,
(unsigned long)vaddr);
if (ret == -1)
continue;
return ret;
}
return 0;
} }
EXPORT_SYMBOL_GPL(qcom_tzmem_to_phys); EXPORT_SYMBOL_GPL(qcom_tzmem_to_phys);
......
...@@ -77,7 +77,7 @@ config QCOM_PD_MAPPER ...@@ -77,7 +77,7 @@ config QCOM_PD_MAPPER
select QCOM_QMI_HELPERS select QCOM_QMI_HELPERS
select QCOM_PDR_MSG select QCOM_PDR_MSG
select AUXILIARY_BUS select AUXILIARY_BUS
depends on NET && QRTR depends on NET && QRTR && (ARCH_QCOM || COMPILE_TEST)
default QCOM_RPROC_COMMON default QCOM_RPROC_COMMON
help help
The Protection Domain Mapper maps registered services to the domains The Protection Domain Mapper maps registered services to the domains
......
...@@ -25,6 +25,7 @@ qcom_rpmh-y += rpmh.o ...@@ -25,6 +25,7 @@ qcom_rpmh-y += rpmh.o
obj-$(CONFIG_QCOM_SMD_RPM) += rpm-proc.o smd-rpm.o obj-$(CONFIG_QCOM_SMD_RPM) += rpm-proc.o smd-rpm.o
obj-$(CONFIG_QCOM_SMEM) += smem.o obj-$(CONFIG_QCOM_SMEM) += smem.o
obj-$(CONFIG_QCOM_SMEM_STATE) += smem_state.o obj-$(CONFIG_QCOM_SMEM_STATE) += smem_state.o
CFLAGS_smp2p.o := -I$(src)
obj-$(CONFIG_QCOM_SMP2P) += smp2p.o obj-$(CONFIG_QCOM_SMP2P) += smp2p.o
obj-$(CONFIG_QCOM_SMSM) += smsm.o obj-$(CONFIG_QCOM_SMSM) += smsm.o
obj-$(CONFIG_QCOM_SOCINFO) += socinfo.o obj-$(CONFIG_QCOM_SOCINFO) += socinfo.o
......
...@@ -485,11 +485,10 @@ static int of_apr_add_pd_lookups(struct device *dev) ...@@ -485,11 +485,10 @@ static int of_apr_add_pd_lookups(struct device *dev)
{ {
const char *service_name, *service_path; const char *service_name, *service_path;
struct packet_router *apr = dev_get_drvdata(dev); struct packet_router *apr = dev_get_drvdata(dev);
struct device_node *node;
struct pdr_service *pds; struct pdr_service *pds;
int ret; int ret;
for_each_child_of_node(dev->of_node, node) { for_each_child_of_node_scoped(dev->of_node, node) {
ret = of_property_read_string_index(node, "qcom,protection-domain", ret = of_property_read_string_index(node, "qcom,protection-domain",
0, &service_name); 0, &service_name);
if (ret < 0) if (ret < 0)
...@@ -499,14 +498,12 @@ static int of_apr_add_pd_lookups(struct device *dev) ...@@ -499,14 +498,12 @@ static int of_apr_add_pd_lookups(struct device *dev)
1, &service_path); 1, &service_path);
if (ret < 0) { if (ret < 0) {
dev_err(dev, "pdr service path missing: %d\n", ret); dev_err(dev, "pdr service path missing: %d\n", ret);
of_node_put(node);
return ret; return ret;
} }
pds = pdr_add_lookup(apr->pdr, service_name, service_path); pds = pdr_add_lookup(apr->pdr, service_name, service_path);
if (IS_ERR(pds) && PTR_ERR(pds) != -EALREADY) { if (IS_ERR(pds) && PTR_ERR(pds) != -EALREADY) {
dev_err(dev, "pdr add lookup failed: %ld\n", PTR_ERR(pds)); dev_err(dev, "pdr add lookup failed: %ld\n", PTR_ERR(pds));
of_node_put(node);
return PTR_ERR(pds); return PTR_ERR(pds);
} }
} }
......
...@@ -349,7 +349,7 @@ static int cmd_db_dev_probe(struct platform_device *pdev) ...@@ -349,7 +349,7 @@ static int cmd_db_dev_probe(struct platform_device *pdev)
return -EINVAL; return -EINVAL;
} }
cmd_db_header = memremap(rmem->base, rmem->size, MEMREMAP_WB); cmd_db_header = memremap(rmem->base, rmem->size, MEMREMAP_WC);
if (!cmd_db_header) { if (!cmd_db_header) {
ret = -ENOMEM; ret = -ENOMEM;
cmd_db_header = NULL; cmd_db_header = NULL;
......
...@@ -17,6 +17,8 @@ ...@@ -17,6 +17,8 @@
#include <linux/pm_opp.h> #include <linux/pm_opp.h>
#include <linux/regmap.h> #include <linux/regmap.h>
#include <linux/sizes.h> #include <linux/sizes.h>
#define CREATE_TRACE_POINTS
#include "trace_icc-bwmon.h"
/* /*
* The BWMON samples data throughput within 'sample_ms' time. With three * The BWMON samples data throughput within 'sample_ms' time. With three
...@@ -645,9 +647,10 @@ static irqreturn_t bwmon_intr_thread(int irq, void *dev_id) ...@@ -645,9 +647,10 @@ static irqreturn_t bwmon_intr_thread(int irq, void *dev_id)
struct icc_bwmon *bwmon = dev_id; struct icc_bwmon *bwmon = dev_id;
unsigned int irq_enable = 0; unsigned int irq_enable = 0;
struct dev_pm_opp *opp, *target_opp; struct dev_pm_opp *opp, *target_opp;
unsigned int bw_kbps, up_kbps, down_kbps; unsigned int bw_kbps, up_kbps, down_kbps, meas_kbps;
bw_kbps = bwmon->target_kbps; bw_kbps = bwmon->target_kbps;
meas_kbps = bwmon->target_kbps;
target_opp = dev_pm_opp_find_bw_ceil(bwmon->dev, &bw_kbps, 0); target_opp = dev_pm_opp_find_bw_ceil(bwmon->dev, &bw_kbps, 0);
if (IS_ERR(target_opp) && PTR_ERR(target_opp) == -ERANGE) if (IS_ERR(target_opp) && PTR_ERR(target_opp) == -ERANGE)
...@@ -679,6 +682,7 @@ static irqreturn_t bwmon_intr_thread(int irq, void *dev_id) ...@@ -679,6 +682,7 @@ static irqreturn_t bwmon_intr_thread(int irq, void *dev_id)
bwmon_clear_irq(bwmon); bwmon_clear_irq(bwmon);
bwmon_enable(bwmon, irq_enable); bwmon_enable(bwmon, irq_enable);
trace_qcom_bwmon_update(dev_name(bwmon->dev), meas_kbps, up_kbps, down_kbps);
if (bwmon->target_kbps == bwmon->current_kbps) if (bwmon->target_kbps == bwmon->current_kbps)
goto out; goto out;
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
*/ */
#include <linux/bitfield.h> #include <linux/bitfield.h>
#include <linux/cleanup.h>
#include <linux/clk.h> #include <linux/clk.h>
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/iopoll.h> #include <linux/iopoll.h>
...@@ -265,7 +266,6 @@ struct qcom_ice *of_qcom_ice_get(struct device *dev) ...@@ -265,7 +266,6 @@ struct qcom_ice *of_qcom_ice_get(struct device *dev)
{ {
struct platform_device *pdev = to_platform_device(dev); struct platform_device *pdev = to_platform_device(dev);
struct qcom_ice *ice; struct qcom_ice *ice;
struct device_node *node;
struct resource *res; struct resource *res;
void __iomem *base; void __iomem *base;
...@@ -292,15 +292,15 @@ struct qcom_ice *of_qcom_ice_get(struct device *dev) ...@@ -292,15 +292,15 @@ struct qcom_ice *of_qcom_ice_get(struct device *dev)
* (legacy DT binding), then it must at least provide a phandle * (legacy DT binding), then it must at least provide a phandle
* to the ICE devicetree node, otherwise ICE is not supported. * to the ICE devicetree node, otherwise ICE is not supported.
*/ */
node = of_parse_phandle(dev->of_node, "qcom,ice", 0); struct device_node *node __free(device_node) = of_parse_phandle(dev->of_node,
"qcom,ice", 0);
if (!node) if (!node)
return NULL; return NULL;
pdev = of_find_device_by_node(node); pdev = of_find_device_by_node(node);
if (!pdev) { if (!pdev) {
dev_err(dev, "Cannot find device node %s\n", node->name); dev_err(dev, "Cannot find device node %s\n", node->name);
ice = ERR_PTR(-EPROBE_DEFER); return ERR_PTR(-EPROBE_DEFER);
goto out;
} }
ice = platform_get_drvdata(pdev); ice = platform_get_drvdata(pdev);
...@@ -308,8 +308,7 @@ struct qcom_ice *of_qcom_ice_get(struct device *dev) ...@@ -308,8 +308,7 @@ struct qcom_ice *of_qcom_ice_get(struct device *dev)
dev_err(dev, "Cannot get ice instance from %s\n", dev_err(dev, "Cannot get ice instance from %s\n",
dev_name(&pdev->dev)); dev_name(&pdev->dev));
platform_device_put(pdev); platform_device_put(pdev);
ice = ERR_PTR(-EPROBE_DEFER); return ERR_PTR(-EPROBE_DEFER);
goto out;
} }
ice->link = device_link_add(dev, &pdev->dev, DL_FLAG_AUTOREMOVE_SUPPLIER); ice->link = device_link_add(dev, &pdev->dev, DL_FLAG_AUTOREMOVE_SUPPLIER);
...@@ -321,9 +320,6 @@ struct qcom_ice *of_qcom_ice_get(struct device *dev) ...@@ -321,9 +320,6 @@ struct qcom_ice *of_qcom_ice_get(struct device *dev)
ice = ERR_PTR(-EINVAL); ice = ERR_PTR(-EINVAL);
} }
out:
of_node_put(node);
return ice; return ice;
} }
EXPORT_SYMBOL_GPL(of_qcom_ice_get); EXPORT_SYMBOL_GPL(of_qcom_ice_get);
......
...@@ -453,26 +453,24 @@ static const struct llcc_slice_config qdu1000_data_8ch[] = { ...@@ -453,26 +453,24 @@ static const struct llcc_slice_config qdu1000_data_8ch[] = {
}; };
static const struct llcc_slice_config x1e80100_data[] = { static const struct llcc_slice_config x1e80100_data[] = {
{LLCC_CPUSS, 1, 6144, 1, 1, 0xFFF, 0x0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {LLCC_CPUSS, 1, 6144, 1, 1, 0xFFF, 0x0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{LLCC_VIDSC0, 2, 512, 3, 1, 0xFFF, 0x0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {LLCC_VIDSC0, 2, 512, 4, 1, 0xFFF, 0x0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{LLCC_AUDIO, 6, 3072, 1, 1, 0xFFF, 0x0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {LLCC_AUDIO, 6, 1024, 1, 1, 0xFFF, 0x0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{LLCC_CMPT, 10, 6144, 1, 1, 0xFFF, 0x0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {LLCC_CMPT, 10, 6144, 1, 1, 0xFFF, 0x0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{LLCC_GPUHTW, 11, 1024, 1, 1, 0xFFF, 0x0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {LLCC_GPUHTW, 11, 512, 1, 1, 0xFFF, 0x0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{LLCC_GPU, 9, 4096, 1, 1, 0xFFF, 0x0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0}, {LLCC_GPU, 9, 4608, 1, 0, 0xFFF, 0x0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0},
{LLCC_MMUHWT, 18, 512, 1, 1, 0xFFF, 0x0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {LLCC_MMUHWT, 18, 512, 1, 1, 0xFFF, 0x0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{LLCC_AUDHW, 22, 1024, 1, 1, 0xFFF, 0x0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {LLCC_AUDHW, 22, 1024, 1, 1, 0xFFF, 0x0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{LLCC_CVP, 8, 512, 3, 1, 0xFFF, 0x0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {LLCC_CVP, 8, 512, 4, 1, 0xFFF, 0x0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{LLCC_WRCACHE, 31, 512, 1, 1, 0xFFF, 0x0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {LLCC_WRCACHE, 31, 1024, 1, 1, 0xFFF, 0x0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{LLCC_CAMEXP1, 7, 3072, 2, 1, 0xFFF, 0x0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {LLCC_CAMEXP0, 4, 256, 4, 1, 0x3, 0x0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{LLCC_LCPDARE, 30, 512, 3, 1, 0xFFF, 0x0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {LLCC_CAMEXP1, 7, 3072, 3, 1, 0xFFC, 0x0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{LLCC_LCPDARE, 30, 512, 3, 1, 0xFFF, 0x0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0},
{LLCC_AENPU, 3, 3072, 1, 1, 0xFFF, 0x0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {LLCC_AENPU, 3, 3072, 1, 1, 0xFFF, 0x0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{LLCC_ISLAND1, 12, 512, 7, 1, 0x1, 0x0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {LLCC_ISLAND1, 12, 2048, 7, 1, 0x0, 0xF, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{LLCC_ISLAND2, 13, 512, 7, 1, 0x2, 0x0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {LLCC_CAMEXP2, 19, 3072, 3, 1, 0xFFC, 0x0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{LLCC_ISLAND3, 14, 512, 7, 1, 0x3, 0x0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {LLCC_CAMEXP3, 20, 3072, 2, 1, 0xFFC, 0x0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{LLCC_ISLAND4, 15, 512, 7, 1, 0x4, 0x0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {LLCC_CAMEXP4, 21, 3072, 2, 1, 0xFFC, 0x0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{LLCC_CAMEXP2, 19, 3072, 3, 1, 0xFFF, 0x0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{LLCC_CAMEXP3, 20, 3072, 3, 1, 0xFFF, 0x0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{LLCC_CAMEXP4, 21, 3072, 3, 1, 0xFFF, 0x0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
}; };
static const struct llcc_edac_reg_offset llcc_v1_edac_reg_offset = { static const struct llcc_edac_reg_offset llcc_v1_edac_reg_offset = {
......
...@@ -186,23 +186,20 @@ static void update_range(struct ocmem *ocmem, struct ocmem_buf *buf, ...@@ -186,23 +186,20 @@ static void update_range(struct ocmem *ocmem, struct ocmem_buf *buf,
struct ocmem *of_get_ocmem(struct device *dev) struct ocmem *of_get_ocmem(struct device *dev)
{ {
struct platform_device *pdev; struct platform_device *pdev;
struct device_node *devnode;
struct ocmem *ocmem; struct ocmem *ocmem;
devnode = of_parse_phandle(dev->of_node, "sram", 0); struct device_node *devnode __free(device_node) = of_parse_phandle(dev->of_node,
"sram", 0);
if (!devnode || !devnode->parent) { if (!devnode || !devnode->parent) {
dev_err(dev, "Cannot look up sram phandle\n"); dev_err(dev, "Cannot look up sram phandle\n");
of_node_put(devnode);
return ERR_PTR(-ENODEV); return ERR_PTR(-ENODEV);
} }
pdev = of_find_device_by_node(devnode->parent); pdev = of_find_device_by_node(devnode->parent);
if (!pdev) { if (!pdev) {
dev_err(dev, "Cannot find device node %s\n", devnode->name); dev_err(dev, "Cannot find device node %s\n", devnode->name);
of_node_put(devnode);
return ERR_PTR(-EPROBE_DEFER); return ERR_PTR(-EPROBE_DEFER);
} }
of_node_put(devnode);
ocmem = platform_get_drvdata(pdev); ocmem = platform_get_drvdata(pdev);
if (!ocmem) { if (!ocmem) {
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
* Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved. * Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
*/ */
#include <linux/cleanup.h>
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/err.h> #include <linux/err.h>
#include <linux/module.h> #include <linux/module.h>
...@@ -148,11 +149,11 @@ EXPORT_SYMBOL_GPL(qcom_pbs_trigger_event); ...@@ -148,11 +149,11 @@ EXPORT_SYMBOL_GPL(qcom_pbs_trigger_event);
*/ */
struct pbs_dev *get_pbs_client_device(struct device *dev) struct pbs_dev *get_pbs_client_device(struct device *dev)
{ {
struct device_node *pbs_dev_node;
struct platform_device *pdev; struct platform_device *pdev;
struct pbs_dev *pbs; struct pbs_dev *pbs;
pbs_dev_node = of_parse_phandle(dev->of_node, "qcom,pbs", 0); struct device_node *pbs_dev_node __free(device_node) = of_parse_phandle(dev->of_node,
"qcom,pbs", 0);
if (!pbs_dev_node) { if (!pbs_dev_node) {
dev_err(dev, "Missing qcom,pbs property\n"); dev_err(dev, "Missing qcom,pbs property\n");
return ERR_PTR(-ENODEV); return ERR_PTR(-ENODEV);
...@@ -161,28 +162,23 @@ struct pbs_dev *get_pbs_client_device(struct device *dev) ...@@ -161,28 +162,23 @@ struct pbs_dev *get_pbs_client_device(struct device *dev)
pdev = of_find_device_by_node(pbs_dev_node); pdev = of_find_device_by_node(pbs_dev_node);
if (!pdev) { if (!pdev) {
dev_err(dev, "Unable to find PBS dev_node\n"); dev_err(dev, "Unable to find PBS dev_node\n");
pbs = ERR_PTR(-EPROBE_DEFER); return ERR_PTR(-EPROBE_DEFER);
goto out;
} }
pbs = platform_get_drvdata(pdev); pbs = platform_get_drvdata(pdev);
if (!pbs) { if (!pbs) {
dev_err(dev, "Cannot get pbs instance from %s\n", dev_name(&pdev->dev)); dev_err(dev, "Cannot get pbs instance from %s\n", dev_name(&pdev->dev));
platform_device_put(pdev); platform_device_put(pdev);
pbs = ERR_PTR(-EPROBE_DEFER); return ERR_PTR(-EPROBE_DEFER);
goto out;
} }
pbs->link = device_link_add(dev, &pdev->dev, DL_FLAG_AUTOREMOVE_SUPPLIER); pbs->link = device_link_add(dev, &pdev->dev, DL_FLAG_AUTOREMOVE_SUPPLIER);
if (!pbs->link) { if (!pbs->link) {
dev_err(&pdev->dev, "Failed to create device link to consumer %s\n", dev_name(dev)); dev_err(&pdev->dev, "Failed to create device link to consumer %s\n", dev_name(dev));
platform_device_put(pdev); platform_device_put(pdev);
pbs = ERR_PTR(-EINVAL); return ERR_PTR(-EINVAL);
goto out;
} }
out:
of_node_put(pbs_dev_node);
return pbs; return pbs;
} }
EXPORT_SYMBOL_GPL(get_pbs_client_device); EXPORT_SYMBOL_GPL(get_pbs_client_device);
......
...@@ -394,7 +394,7 @@ static int qmp_cooling_device_add(struct qmp *qmp, ...@@ -394,7 +394,7 @@ static int qmp_cooling_device_add(struct qmp *qmp,
static int qmp_cooling_devices_register(struct qmp *qmp) static int qmp_cooling_devices_register(struct qmp *qmp)
{ {
struct device_node *np, *child; struct device_node *np;
int count = 0; int count = 0;
int ret; int ret;
...@@ -407,15 +407,13 @@ static int qmp_cooling_devices_register(struct qmp *qmp) ...@@ -407,15 +407,13 @@ static int qmp_cooling_devices_register(struct qmp *qmp)
if (!qmp->cooling_devs) if (!qmp->cooling_devs)
return -ENOMEM; return -ENOMEM;
for_each_available_child_of_node(np, child) { for_each_available_child_of_node_scoped(np, child) {
if (!of_property_present(child, "#cooling-cells")) if (!of_property_present(child, "#cooling-cells"))
continue; continue;
ret = qmp_cooling_device_add(qmp, &qmp->cooling_devs[count++], ret = qmp_cooling_device_add(qmp, &qmp->cooling_devs[count++],
child); child);
if (ret) { if (ret)
of_node_put(child);
goto unroll; goto unroll;
}
} }
if (!count) if (!count)
......
...@@ -517,12 +517,25 @@ static const struct qcom_pdm_domain_data *sm8550_domains[] = { ...@@ -517,12 +517,25 @@ static const struct qcom_pdm_domain_data *sm8550_domains[] = {
NULL, NULL,
}; };
static const struct of_device_id qcom_pdm_domains[] = { static const struct qcom_pdm_domain_data *x1e80100_domains[] = {
&adsp_audio_pd,
&adsp_root_pd,
&adsp_charger_pd,
&adsp_sensor_pd,
&cdsp_root_pd,
NULL,
};
static const struct of_device_id qcom_pdm_domains[] __maybe_unused = {
{ .compatible = "qcom,apq8016", .data = NULL, },
{ .compatible = "qcom,apq8064", .data = NULL, }, { .compatible = "qcom,apq8064", .data = NULL, },
{ .compatible = "qcom,apq8074", .data = NULL, }, { .compatible = "qcom,apq8074", .data = NULL, },
{ .compatible = "qcom,apq8084", .data = NULL, }, { .compatible = "qcom,apq8084", .data = NULL, },
{ .compatible = "qcom,apq8096", .data = msm8996_domains, }, { .compatible = "qcom,apq8096", .data = msm8996_domains, },
{ .compatible = "qcom,msm8226", .data = NULL, }, { .compatible = "qcom,msm8226", .data = NULL, },
{ .compatible = "qcom,msm8909", .data = NULL, },
{ .compatible = "qcom,msm8916", .data = NULL, },
{ .compatible = "qcom,msm8939", .data = NULL, },
{ .compatible = "qcom,msm8974", .data = NULL, }, { .compatible = "qcom,msm8974", .data = NULL, },
{ .compatible = "qcom,msm8996", .data = msm8996_domains, }, { .compatible = "qcom,msm8996", .data = msm8996_domains, },
{ .compatible = "qcom,msm8998", .data = msm8998_domains, }, { .compatible = "qcom,msm8998", .data = msm8998_domains, },
...@@ -539,12 +552,14 @@ static const struct of_device_id qcom_pdm_domains[] = { ...@@ -539,12 +552,14 @@ static const struct of_device_id qcom_pdm_domains[] = {
{ .compatible = "qcom,sm4250", .data = sm6115_domains, }, { .compatible = "qcom,sm4250", .data = sm6115_domains, },
{ .compatible = "qcom,sm6115", .data = sm6115_domains, }, { .compatible = "qcom,sm6115", .data = sm6115_domains, },
{ .compatible = "qcom,sm6350", .data = sm6350_domains, }, { .compatible = "qcom,sm6350", .data = sm6350_domains, },
{ .compatible = "qcom,sm7325", .data = sc7280_domains, },
{ .compatible = "qcom,sm8150", .data = sm8150_domains, }, { .compatible = "qcom,sm8150", .data = sm8150_domains, },
{ .compatible = "qcom,sm8250", .data = sm8250_domains, }, { .compatible = "qcom,sm8250", .data = sm8250_domains, },
{ .compatible = "qcom,sm8350", .data = sm8350_domains, }, { .compatible = "qcom,sm8350", .data = sm8350_domains, },
{ .compatible = "qcom,sm8450", .data = sm8350_domains, }, { .compatible = "qcom,sm8450", .data = sm8350_domains, },
{ .compatible = "qcom,sm8550", .data = sm8550_domains, }, { .compatible = "qcom,sm8550", .data = sm8550_domains, },
{ .compatible = "qcom,sm8650", .data = sm8550_domains, }, { .compatible = "qcom,sm8650", .data = sm8550_domains, },
{ .compatible = "qcom,x1e80100", .data = x1e80100_domains, },
{}, {},
}; };
......
...@@ -196,9 +196,6 @@ static int qcom_smd_rpm_probe(struct rpmsg_device *rpdev) ...@@ -196,9 +196,6 @@ static int qcom_smd_rpm_probe(struct rpmsg_device *rpdev)
{ {
struct qcom_smd_rpm *rpm; struct qcom_smd_rpm *rpm;
if (!rpdev->dev.of_node)
return -EINVAL;
rpm = devm_kzalloc(&rpdev->dev, sizeof(*rpm), GFP_KERNEL); rpm = devm_kzalloc(&rpdev->dev, sizeof(*rpm), GFP_KERNEL);
if (!rpm) if (!rpm)
return -ENOMEM; return -ENOMEM;
...@@ -218,18 +215,44 @@ static void qcom_smd_rpm_remove(struct rpmsg_device *rpdev) ...@@ -218,18 +215,44 @@ static void qcom_smd_rpm_remove(struct rpmsg_device *rpdev)
of_platform_depopulate(&rpdev->dev); of_platform_depopulate(&rpdev->dev);
} }
static const struct rpmsg_device_id qcom_smd_rpm_id_table[] = { static const struct of_device_id qcom_smd_rpm_of_match[] = {
{ .name = "rpm_requests", }, { .compatible = "qcom,glink-smd-rpm" },
{ /* sentinel */ } { .compatible = "qcom,smd-rpm" },
/*
* Don't add any more compatibles to the list, two previous entryes
* should match all defined devices.
*/
{ .compatible = "qcom,rpm-apq8084" },
{ .compatible = "qcom,rpm-ipq6018" },
{ .compatible = "qcom,rpm-ipq9574" },
{ .compatible = "qcom,rpm-msm8226" },
{ .compatible = "qcom,rpm-msm8909" },
{ .compatible = "qcom,rpm-msm8916" },
{ .compatible = "qcom,rpm-msm8936" },
{ .compatible = "qcom,rpm-msm8953" },
{ .compatible = "qcom,rpm-msm8974" },
{ .compatible = "qcom,rpm-msm8976" },
{ .compatible = "qcom,rpm-msm8994" },
{ .compatible = "qcom,rpm-msm8996" },
{ .compatible = "qcom,rpm-msm8998" },
{ .compatible = "qcom,rpm-sdm660" },
{ .compatible = "qcom,rpm-sm6115" },
{ .compatible = "qcom,rpm-sm6125" },
{ .compatible = "qcom,rpm-sm6375" },
{ .compatible = "qcom,rpm-qcm2290" },
{ .compatible = "qcom,rpm-qcs404" },
{}
}; };
MODULE_DEVICE_TABLE(rpmsg, qcom_smd_rpm_id_table); MODULE_DEVICE_TABLE(of, qcom_smd_rpm_of_match);
static struct rpmsg_driver qcom_smd_rpm_driver = { static struct rpmsg_driver qcom_smd_rpm_driver = {
.probe = qcom_smd_rpm_probe, .probe = qcom_smd_rpm_probe,
.remove = qcom_smd_rpm_remove, .remove = qcom_smd_rpm_remove,
.callback = qcom_smd_rpm_callback, .callback = qcom_smd_rpm_callback,
.id_table = qcom_smd_rpm_id_table, .drv = {
.drv.name = "qcom_smd_rpm", .name = "qcom_smd_rpm",
.of_match_table = qcom_smd_rpm_of_match,
},
}; };
static int __init qcom_smd_rpm_init(void) static int __init qcom_smd_rpm_init(void)
......
...@@ -161,6 +161,9 @@ struct qcom_smp2p { ...@@ -161,6 +161,9 @@ struct qcom_smp2p {
struct list_head outbound; struct list_head outbound;
}; };
#define CREATE_TRACE_POINTS
#include "trace-smp2p.h"
static void qcom_smp2p_kick(struct qcom_smp2p *smp2p) static void qcom_smp2p_kick(struct qcom_smp2p *smp2p)
{ {
/* Make sure any updated data is written before the kick */ /* Make sure any updated data is written before the kick */
...@@ -192,6 +195,7 @@ static void qcom_smp2p_do_ssr_ack(struct qcom_smp2p *smp2p) ...@@ -192,6 +195,7 @@ static void qcom_smp2p_do_ssr_ack(struct qcom_smp2p *smp2p)
struct smp2p_smem_item *out = smp2p->out; struct smp2p_smem_item *out = smp2p->out;
u32 val; u32 val;
trace_smp2p_ssr_ack(smp2p->dev);
smp2p->ssr_ack = !smp2p->ssr_ack; smp2p->ssr_ack = !smp2p->ssr_ack;
val = out->flags & ~BIT(SMP2P_FLAGS_RESTART_ACK_BIT); val = out->flags & ~BIT(SMP2P_FLAGS_RESTART_ACK_BIT);
...@@ -214,6 +218,7 @@ static void qcom_smp2p_negotiate(struct qcom_smp2p *smp2p) ...@@ -214,6 +218,7 @@ static void qcom_smp2p_negotiate(struct qcom_smp2p *smp2p)
smp2p->ssr_ack_enabled = true; smp2p->ssr_ack_enabled = true;
smp2p->negotiation_done = true; smp2p->negotiation_done = true;
trace_smp2p_negotiate(smp2p->dev, out->features);
} }
} }
...@@ -252,6 +257,8 @@ static void qcom_smp2p_notify_in(struct qcom_smp2p *smp2p) ...@@ -252,6 +257,8 @@ static void qcom_smp2p_notify_in(struct qcom_smp2p *smp2p)
status = val ^ entry->last_value; status = val ^ entry->last_value;
entry->last_value = val; entry->last_value = val;
trace_smp2p_notify_in(entry, status, val);
/* No changes of this entry? */ /* No changes of this entry? */
if (!status) if (!status)
continue; continue;
...@@ -415,6 +422,8 @@ static int smp2p_update_bits(void *data, u32 mask, u32 value) ...@@ -415,6 +422,8 @@ static int smp2p_update_bits(void *data, u32 mask, u32 value)
writel(val, entry->value); writel(val, entry->value);
spin_unlock_irqrestore(&entry->lock, flags); spin_unlock_irqrestore(&entry->lock, flags);
trace_smp2p_update_bits(entry, orig, val);
if (val != orig) if (val != orig)
qcom_smp2p_kick(entry->smp2p); qcom_smp2p_kick(entry->smp2p);
...@@ -530,7 +539,6 @@ static int smp2p_parse_ipc(struct qcom_smp2p *smp2p) ...@@ -530,7 +539,6 @@ static int smp2p_parse_ipc(struct qcom_smp2p *smp2p)
static int qcom_smp2p_probe(struct platform_device *pdev) static int qcom_smp2p_probe(struct platform_device *pdev)
{ {
struct smp2p_entry *entry; struct smp2p_entry *entry;
struct device_node *node;
struct qcom_smp2p *smp2p; struct qcom_smp2p *smp2p;
const char *key; const char *key;
int irq; int irq;
...@@ -584,11 +592,10 @@ static int qcom_smp2p_probe(struct platform_device *pdev) ...@@ -584,11 +592,10 @@ static int qcom_smp2p_probe(struct platform_device *pdev)
if (ret < 0) if (ret < 0)
goto release_mbox; goto release_mbox;
for_each_available_child_of_node(pdev->dev.of_node, node) { for_each_available_child_of_node_scoped(pdev->dev.of_node, node) {
entry = devm_kzalloc(&pdev->dev, sizeof(*entry), GFP_KERNEL); entry = devm_kzalloc(&pdev->dev, sizeof(*entry), GFP_KERNEL);
if (!entry) { if (!entry) {
ret = -ENOMEM; ret = -ENOMEM;
of_node_put(node);
goto unwind_interfaces; goto unwind_interfaces;
} }
...@@ -596,25 +603,19 @@ static int qcom_smp2p_probe(struct platform_device *pdev) ...@@ -596,25 +603,19 @@ static int qcom_smp2p_probe(struct platform_device *pdev)
spin_lock_init(&entry->lock); spin_lock_init(&entry->lock);
ret = of_property_read_string(node, "qcom,entry-name", &entry->name); ret = of_property_read_string(node, "qcom,entry-name", &entry->name);
if (ret < 0) { if (ret < 0)
of_node_put(node);
goto unwind_interfaces; goto unwind_interfaces;
}
if (of_property_read_bool(node, "interrupt-controller")) { if (of_property_read_bool(node, "interrupt-controller")) {
ret = qcom_smp2p_inbound_entry(smp2p, entry, node); ret = qcom_smp2p_inbound_entry(smp2p, entry, node);
if (ret < 0) { if (ret < 0)
of_node_put(node);
goto unwind_interfaces; goto unwind_interfaces;
}
list_add(&entry->node, &smp2p->inbound); list_add(&entry->node, &smp2p->inbound);
} else { } else {
ret = qcom_smp2p_outbound_entry(smp2p, entry, node); ret = qcom_smp2p_outbound_entry(smp2p, entry, node);
if (ret < 0) { if (ret < 0)
of_node_put(node);
goto unwind_interfaces; goto unwind_interfaces;
}
list_add(&entry->node, &smp2p->outbound); list_add(&entry->node, &smp2p->outbound);
} }
......
...@@ -401,11 +401,13 @@ static const struct soc_id soc_id[] = { ...@@ -401,11 +401,13 @@ static const struct soc_id soc_id[] = {
{ qcom_board_id(SA8540P) }, { qcom_board_id(SA8540P) },
{ qcom_board_id(QCM4290) }, { qcom_board_id(QCM4290) },
{ qcom_board_id(QCS4290) }, { qcom_board_id(QCS4290) },
{ qcom_board_id(SM7325) },
{ qcom_board_id_named(SM8450_2, "SM8450") }, { qcom_board_id_named(SM8450_2, "SM8450") },
{ qcom_board_id_named(SM8450_3, "SM8450") }, { qcom_board_id_named(SM8450_3, "SM8450") },
{ qcom_board_id(SC7280) }, { qcom_board_id(SC7280) },
{ qcom_board_id(SC7180P) }, { qcom_board_id(SC7180P) },
{ qcom_board_id(QCM6490) }, { qcom_board_id(QCM6490) },
{ qcom_board_id(SM7325P) },
{ qcom_board_id(IPQ5000) }, { qcom_board_id(IPQ5000) },
{ qcom_board_id(IPQ0509) }, { qcom_board_id(IPQ0509) },
{ qcom_board_id(IPQ0518) }, { qcom_board_id(IPQ0518) },
...@@ -441,6 +443,8 @@ static const struct soc_id soc_id[] = { ...@@ -441,6 +443,8 @@ static const struct soc_id soc_id[] = {
{ qcom_board_id(QCM8550) }, { qcom_board_id(QCM8550) },
{ qcom_board_id(IPQ5300) }, { qcom_board_id(IPQ5300) },
{ qcom_board_id(IPQ5321) }, { qcom_board_id(IPQ5321) },
{ qcom_board_id(QCS8300) },
{ qcom_board_id(QCS8275) },
}; };
static const char *socinfo_machine(struct device *dev, unsigned int id) static const char *socinfo_machine(struct device *dev, unsigned int id)
......
/* SPDX-License-Identifier: GPL-2.0 */
/*
* Copyright (c) 2024 Qualcomm Innovation Center, Inc. All rights reserved.
*/
#undef TRACE_SYSTEM
#define TRACE_SYSTEM qcom_smp2p
#if !defined(__QCOM_SMP2P_TRACE_H__) || defined(TRACE_HEADER_MULTI_READ)
#define __QCOM_SMP2P_TRACE_H__
#include <linux/device.h>
#include <linux/tracepoint.h>
TRACE_EVENT(smp2p_ssr_ack,
TP_PROTO(const struct device *dev),
TP_ARGS(dev),
TP_STRUCT__entry(
__string(dev_name, dev_name(dev))
),
TP_fast_assign(
__assign_str(dev_name);
),
TP_printk("%s: SSR detected", __get_str(dev_name))
);
TRACE_EVENT(smp2p_negotiate,
TP_PROTO(const struct device *dev, unsigned int features),
TP_ARGS(dev, features),
TP_STRUCT__entry(
__string(dev_name, dev_name(dev))
__field(u32, out_features)
),
TP_fast_assign(
__assign_str(dev_name);
__entry->out_features = features;
),
TP_printk("%s: state=open out_features=%s", __get_str(dev_name),
__print_flags(__entry->out_features, "|",
{SMP2P_FEATURE_SSR_ACK, "SMP2P_FEATURE_SSR_ACK"})
)
);
TRACE_EVENT(smp2p_notify_in,
TP_PROTO(struct smp2p_entry *smp2p_entry, unsigned long status, u32 val),
TP_ARGS(smp2p_entry, status, val),
TP_STRUCT__entry(
__string(dev_name, dev_name(smp2p_entry->smp2p->dev))
__string(client_name, smp2p_entry->name)
__field(unsigned long, status)
__field(u32, val)
),
TP_fast_assign(
__assign_str(dev_name);
__assign_str(client_name);
__entry->status = status;
__entry->val = val;
),
TP_printk("%s: %s: status:0x%0lx val:0x%0x",
__get_str(dev_name),
__get_str(client_name),
__entry->status,
__entry->val
)
);
TRACE_EVENT(smp2p_update_bits,
TP_PROTO(struct smp2p_entry *smp2p_entry, u32 orig, u32 val),
TP_ARGS(smp2p_entry, orig, val),
TP_STRUCT__entry(
__string(dev_name, dev_name(smp2p_entry->smp2p->dev))
__string(client_name, smp2p_entry->name)
__field(u32, orig)
__field(u32, val)
),
TP_fast_assign(
__assign_str(dev_name);
__assign_str(client_name);
__entry->orig = orig;
__entry->val = val;
),
TP_printk("%s: %s: orig:0x%0x new:0x%0x",
__get_str(dev_name),
__get_str(client_name),
__entry->orig,
__entry->val
)
);
#endif /* __QCOM_SMP2P_TRACE_H__ */
#undef TRACE_INCLUDE_PATH
#define TRACE_INCLUDE_PATH .
#undef TRACE_INCLUDE_FILE
#define TRACE_INCLUDE_FILE trace-smp2p
#include <trace/define_trace.h>
/* SPDX-License-Identifier: GPL-2.0-only */
/*
* Copyright (c) 2024 Qualcomm Innovation Center, Inc. All rights reserved.
*/
#undef TRACE_SYSTEM
#define TRACE_SYSTEM icc_bwmon
#if !defined(_TRACE_ICC_BWMON_H) || defined(TRACE_HEADER_MULTI_READ)
#define _TRACE_ICC_BWMON_H
#include <linux/tracepoint.h>
TRACE_EVENT(qcom_bwmon_update,
TP_PROTO(const char *name,
unsigned int meas_kbps, unsigned int up_kbps, unsigned int down_kbps),
TP_ARGS(name, meas_kbps, up_kbps, down_kbps),
TP_STRUCT__entry(
__string(name, name)
__field(unsigned int, meas_kbps)
__field(unsigned int, up_kbps)
__field(unsigned int, down_kbps)
),
TP_fast_assign(
__assign_str(name);
__entry->meas_kbps = meas_kbps;
__entry->up_kbps = up_kbps;
__entry->down_kbps = down_kbps;
),
TP_printk("name=%s meas_kbps=%u up_kbps=%u down_kbps=%u",
__get_str(name),
__entry->meas_kbps,
__entry->up_kbps,
__entry->down_kbps)
);
#endif /* _TRACE_ICC_BWMON_H */
#undef TRACE_INCLUDE_PATH
#define TRACE_INCLUDE_PATH ../../drivers/soc/qcom/
#undef TRACE_INCLUDE_FILE
#define TRACE_INCLUDE_FILE trace_icc-bwmon
#include <trace/define_trace.h>
...@@ -234,11 +234,13 @@ ...@@ -234,11 +234,13 @@
#define QCOM_ID_SA8540P 461 #define QCOM_ID_SA8540P 461
#define QCOM_ID_QCM4290 469 #define QCOM_ID_QCM4290 469
#define QCOM_ID_QCS4290 470 #define QCOM_ID_QCS4290 470
#define QCOM_ID_SM7325 475
#define QCOM_ID_SM8450_2 480 #define QCOM_ID_SM8450_2 480
#define QCOM_ID_SM8450_3 482 #define QCOM_ID_SM8450_3 482
#define QCOM_ID_SC7280 487 #define QCOM_ID_SC7280 487
#define QCOM_ID_SC7180P 495 #define QCOM_ID_SC7180P 495
#define QCOM_ID_QCM6490 497 #define QCOM_ID_QCM6490 497
#define QCOM_ID_SM7325P 499
#define QCOM_ID_IPQ5000 503 #define QCOM_ID_IPQ5000 503
#define QCOM_ID_IPQ0509 504 #define QCOM_ID_IPQ0509 504
#define QCOM_ID_IPQ0518 505 #define QCOM_ID_IPQ0518 505
...@@ -274,6 +276,8 @@ ...@@ -274,6 +276,8 @@
#define QCOM_ID_QCM8550 604 #define QCOM_ID_QCM8550 604
#define QCOM_ID_IPQ5300 624 #define QCOM_ID_IPQ5300 624
#define QCOM_ID_IPQ5321 650 #define QCOM_ID_IPQ5321 650
#define QCOM_ID_QCS8300 674
#define QCOM_ID_QCS8275 675
/* /*
* The board type and revision information, used by Qualcomm bootloaders and * The board type and revision information, used by Qualcomm bootloaders and
......
...@@ -25,51 +25,6 @@ struct qseecom_client { ...@@ -25,51 +25,6 @@ struct qseecom_client {
u32 app_id; u32 app_id;
}; };
/**
* qseecom_scm_dev() - Get the SCM device associated with the QSEECOM client.
* @client: The QSEECOM client device.
*
* Returns the SCM device under which the provided QSEECOM client device
* operates. This function is intended to be used for DMA allocations.
*/
static inline struct device *qseecom_scm_dev(struct qseecom_client *client)
{
return client->aux_dev.dev.parent->parent;
}
/**
* qseecom_dma_alloc() - Allocate DMA memory for a QSEECOM client.
* @client: The QSEECOM client to allocate the memory for.
* @size: The number of bytes to allocate.
* @dma_handle: Pointer to where the DMA address should be stored.
* @gfp: Allocation flags.
*
* Wrapper function for dma_alloc_coherent(), allocating DMA memory usable for
* TZ/QSEECOM communication. Refer to dma_alloc_coherent() for details.
*/
static inline void *qseecom_dma_alloc(struct qseecom_client *client, size_t size,
dma_addr_t *dma_handle, gfp_t gfp)
{
return dma_alloc_coherent(qseecom_scm_dev(client), size, dma_handle, gfp);
}
/**
* dma_free_coherent() - Free QSEECOM DMA memory.
* @client: The QSEECOM client for which the memory has been allocated.
* @size: The number of bytes allocated.
* @cpu_addr: Virtual memory address to free.
* @dma_handle: DMA memory address to free.
*
* Wrapper function for dma_free_coherent(), freeing memory previously
* allocated with qseecom_dma_alloc(). Refer to dma_free_coherent() for
* details.
*/
static inline void qseecom_dma_free(struct qseecom_client *client, size_t size,
void *cpu_addr, dma_addr_t dma_handle)
{
return dma_free_coherent(qseecom_scm_dev(client), size, cpu_addr, dma_handle);
}
/** /**
* qcom_qseecom_app_send() - Send to and receive data from a given QSEE app. * qcom_qseecom_app_send() - Send to and receive data from a given QSEE app.
* @client: The QSEECOM client associated with the target app. * @client: The QSEECOM client associated with the target app.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment