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

Commit f4ba8670 authored by Jingbiao Lu's avatar Jingbiao Lu Committed by Gerrit - the friendly Code Review server
Browse files

soc: qcom: pil: get crypto cell-id through device tree



scm_pas_init takes a cell-id argument which is hard coded.
Since mas-crypto cell-id is changed from msm-3.18 to msm-4.9,
it causes scm_pas_init to fail. So get crypto cell-id
through device tree instead of hard coded.

Change-Id: Icd58099a54bf389daa1caa3ef6f970b6e7e219b9
Signed-off-by: default avatarJingbiao Lu <jingbiao@codeaurora.org>
parent df9c344a
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -71,6 +71,7 @@ Optional properties:
- qcom,signal-aop: Boolean. If set, when subsystem is brought up, pil will send a notification
			to AOP through qmp mailbox driver.

- qcom,mas-crypto: phandle to the bus master of crypto core.

Example:
	qcom,venus@fdce0000 {
+12 −2
Original line number Diff line number Diff line
@@ -1031,7 +1031,8 @@ static int pil_tz_driver_probe(struct platform_device *pdev)
{
	struct pil_tz_data *d;
	struct resource *res;
	u32 proxy_timeout;
	struct device_node *crypto_node;
	u32 proxy_timeout, crypto_id;
	int len, rc;

	d = devm_kzalloc(&pdev->dev, sizeof(*d), GFP_KERNEL);
@@ -1087,7 +1088,16 @@ static int pil_tz_driver_probe(struct platform_device *pdev)
									rc);
			return rc;
		}
		scm_pas_init(MSM_BUS_MASTER_CRYPTO_CORE_0);

		crypto_id = MSM_BUS_MASTER_CRYPTO_CORE_0;
		crypto_node = of_parse_phandle(pdev->dev.of_node,
						"qcom,mas-crypto", 0);
		if (!IS_ERR_OR_NULL(crypto_node)) {
			of_property_read_u32(crypto_node, "cell-id",
				&crypto_id);
		}
		of_node_put(crypto_node);
		scm_pas_init((int)crypto_id);
	}

	rc = pil_desc_init(&d->desc);