Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1279fb07 authored by Amir Samuelov's avatar Amir Samuelov Committed by Gerrit - the friendly Code Review server
Browse files

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.

Change-Id: Icd301952cbfe16ee00f3cbfd00eeed158497eacc
Signed-off-by: default avatarAmir Samuelov <amirs@codeaurora.org>
parent b775a871
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -34,6 +34,7 @@ struct pil_priv;
 * @modem_ssr: true if modem is restarting, false if booting for first time.
 * @clear_fw_region: Clear fw region on failure in loading.
 * @subsys_vmid: memprot id for the subsystem.
 * @extra_size: extra memory allocated at the end of the image.
 */
struct pil_desc {
	const char *name;
@@ -63,6 +64,7 @@ struct pil_desc {
	int *aux_minidump_ids;
	int num_aux_minidump_ids;
	bool minidump_as_elf32;
	u32 extra_size;
};

/**
+5 −1
Original line number Diff line number Diff line
@@ -658,7 +658,7 @@ static int pil_mem_setup_trusted(struct pil_desc *pil, phys_addr_t addr,

	desc.args[0] = d->pas_id;
	desc.args[1] = addr;
	desc.args[2] = size;
	desc.args[2] = size + pil->extra_size;
	desc.arginfo = SCM_ARGS(3);
	ret = scm_call2(SCM_SIP_FNID(SCM_SVC_PIL, PAS_MEM_SETUP_CMD),
			&desc);
@@ -1197,6 +1197,10 @@ static int pil_tz_driver_probe(struct platform_device *pdev)
		}
		mask_scsr_irqs(d);

		rc = of_property_read_u32(pdev->dev.of_node, "qcom,extra-size",
						&d->desc.extra_size);
		if (rc)
			d->desc.extra_size = 0;
	} else {
		d->subsys_desc.err_fatal_handler =
						subsys_err_fatal_intr_handler;