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

Commit fe63f1d6 authored by Arun Prakash's avatar Arun Prakash
Browse files

soc: qcom: smem: Support to parse smem host id



The current implementation will use hard coded
smem host id which will cause conflicts when gvm
want to communicate with remote sub system through
new smem partition area.

Adding support to parse smem host id from dt entry.
This will help to configure unique smem host id for
gvm which needs direct communication with different
sub system.

Change-Id: I49865968d24a3979c766a006b16e44099a5cbd7f
Signed-off-by: default avatarArun Prakash <app@codeaurora.org>
parent 3aa681b6
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -280,6 +280,9 @@ struct qcom_smem {
/* Pointer to the one and only smem handle */
static struct qcom_smem *__smem;

/* default smem host id for apps is SMEM_HOST_APPS */
static u32 smem_host_id = SMEM_HOST_APPS;

/* Timeout (ms) for the trylock of remote spinlocks */
#define HWSPINLOCK_TIMEOUT	1000

@@ -986,6 +989,7 @@ static int qcom_smem_probe(struct platform_device *pdev)
	int hwlock_id;
	u32 version;
	int ret;
	u32 host_id;

	num_regions = 1;
	if (of_find_property(pdev->dev.of_node, "qcom,rpm-msg-ram", NULL))
@@ -1007,6 +1011,10 @@ static int qcom_smem_probe(struct platform_device *pdev)
					"qcom,rpm-msg-ram", 1)))
		return ret;

	ret = of_property_read_u32(pdev->dev.of_node, "smem-host-id", &host_id);
	if (!ret)
		smem_host_id = host_id;

	header = smem->regions[0].virt_base;
	if (le32_to_cpu(header->initialized) != 1 ||
	    le32_to_cpu(header->reserved)) {
@@ -1030,7 +1038,7 @@ static int qcom_smem_probe(struct platform_device *pdev)
		return -EINVAL;
	}

	ret = qcom_smem_enumerate_partitions(smem, SMEM_HOST_APPS);
	ret = qcom_smem_enumerate_partitions(smem, smem_host_id);
	if (ret < 0)
		return ret;