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

Commit 0fc1e597 authored by Chris Lew's avatar Chris Lew
Browse files

neuron: ch_haven: Read peer name from device tree



Add support for the primary vm to read the vm peer name from device
tree. This information is needed to share memory to the peer vm.

Change-Id: I9a38370c8b80480bcdd0988c515adf64b36f99c1
Signed-off-by: default avatarChris Lew <clew@codeaurora.org>
parent 7c177596
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@
#include <linux/kthread.h>
#include <linux/neuron.h>
#include <asm-generic/barrier.h>
#include <linux/haven/hh_rm_drv.h>
#include <linux/haven/hh_dbl.h>
#include "ch_mq_shmem_common.h"

@@ -335,10 +336,16 @@ static int channel_hh_map_memory(struct neuron_mq_data_priv *priv,
		return -ENXIO;
	}

	if (of_property_read_bool(dev->of_node, "qcom,primary"))
	if (of_property_read_bool(dev->of_node, "qcom,primary")) {
		memset(priv->base, 0,
		       sizeof(struct neuron_shmem_channel_header));

		ret = of_property_read_u32(dev->of_node, "peer-name",
					   &priv->peer_name);
		if (ret)
			priv->peer_name = HH_SELF_VM;
	}

	return 0;
}

+8 −1
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@
#include <linux/kthread.h>
#include <linux/neuron.h>
#include <asm-generic/barrier.h>
#include <linux/haven/hh_rm_drv.h>
#include <linux/haven/hh_dbl.h>
#include "ch_mq_shmem_common.h"

@@ -320,10 +321,16 @@ static int channel_hh_map_memory(struct neuron_mq_data_priv *priv,
		return -ENXIO;
	}

	if (of_property_read_bool(dev->of_node, "qcom,primary"))
	if (of_property_read_bool(dev->of_node, "qcom,primary")) {
		memset(priv->base, 0,
		       sizeof(struct neuron_shmem_channel_header));

		ret = of_property_read_u32(dev->of_node, "peer-name",
					   &priv->peer_name);
		if (ret)
			priv->peer_name = HH_SELF_VM;
	}

	return 0;
}

+2 −0
Original line number Diff line number Diff line
@@ -76,6 +76,8 @@ struct neuron_mq_data_priv {
	atomic64_t virq_payload;
	/* A counter to calculate the interrupt received. */
	u32 interrupt_counter;
	/* name of peer vm */
	u32 peer_name;
	/* haven tx doorbell descriptor */
	void *tx_dbl;
	/* haven rx doorbell descriptor */