From 8585458497b64fe9fef7c125cd1f7c42985c92f4 Mon Sep 17 00:00:00 2001 From: Nurit Lichtenstein Date: Thu, 21 May 2020 15:42:04 +0300 Subject: [PATCH] soc: qcom: pil: allow subsystem to allocate extra memory Allow the subsystem to use some extra memory allocated after the end of the image, for the subsystem to use. This is porting from Kona of commit SHA:1279fb070282. Change-Id: I79d19c9e48b7893d10ac814fb42e5783651417b4 Signed-off-by: Nurit Lichtenstein --- drivers/soc/qcom/peripheral-loader.h | 3 ++- drivers/soc/qcom/subsys-pil-tz.c | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/soc/qcom/peripheral-loader.h b/drivers/soc/qcom/peripheral-loader.h index 0965b21ea0e9..137341e19409 100644 --- a/drivers/soc/qcom/peripheral-loader.h +++ b/drivers/soc/qcom/peripheral-loader.h @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: GPL-2.0-only */ /* - * Copyright (c) 2010-2019, The Linux Foundation. All rights reserved. + * Copyright (c) 2010-2020, The Linux Foundation. All rights reserved. */ #ifndef __MSM_PERIPHERAL_LOADER_H #define __MSM_PERIPHERAL_LOADER_H @@ -62,6 +62,7 @@ struct pil_desc { int minidump_id; int *aux_minidump_ids; int num_aux_minidump_ids; + u32 extra_size; }; /** diff --git a/drivers/soc/qcom/subsys-pil-tz.c b/drivers/soc/qcom/subsys-pil-tz.c index a59bea9666d2..da7067319856 100644 --- a/drivers/soc/qcom/subsys-pil-tz.c +++ b/drivers/soc/qcom/subsys-pil-tz.c @@ -617,6 +617,7 @@ static int pil_mem_setup_trusted(struct pil_desc *pil, phys_addr_t addr, if (d->subsys_desc.no_auth) return 0; + size += pil->extra_size; scm_ret = qcom_scm_pas_mem_setup(d->pas_id, addr, size); return scm_ret; @@ -1349,6 +1350,11 @@ static int pil_tz_generic_probe(struct platform_device *pdev) } } + rc = of_property_read_u32(pdev->dev.of_node, "qcom,extra-size", + &d->desc.extra_size); + if (rc) + d->desc.extra_size = 0; + d->dev = &pdev->dev; d->desc.dev = &pdev->dev; d->desc.owner = THIS_MODULE;