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

Commit e90ef046 authored by Raghavendra Kakarla's avatar Raghavendra Kakarla
Browse files

drivers: rpmsg: rpm-smd: define readq_relaxed for ARM variants



ARM cannot natively read 64-bit address. As such the readq_ variants
are not defined for this architecture. Add a 32-bit equivalent to read 2
sequential 4-byte memory into a u64 value. Let's keep them locally
defined for now, since they are not native to the ARM architecture.

Change-Id: I9d00d0a9cd185e658d7b860cac2f59c8438e1b30
Signed-off-by: default avatarRaghavendra Kakarla <rkakarla@codeaurora.org>
parent 5f551b33
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -72,6 +72,15 @@
		k = get_next_kvp(k))


#ifdef CONFIG_ARM
#define readq_relaxed(a) ({			\
	u64 val = readl_relaxed((a) + 4);	\
	val <<= 32;				\
	val |=  readl_relaxed((a));		\
	val;					\
})
#endif

/* Debug Definitions */
enum {
	MSM_RPM_LOG_REQUEST_PRETTY	= BIT(0),
@@ -1560,7 +1569,7 @@ static int qcom_smd_rpm_probe(struct rpmsg_device *rpdev)
	int ret = 0;
	int irq;
	void __iomem *reg_base;
	uint32_t version = V0_PROTOCOL_VERSION; /* set to default v0 format */
	uint64_t version = V0_PROTOCOL_VERSION; /* set to default v0 format */

	p = of_find_compatible_node(NULL, NULL, "qcom,rpm-smd");
	if (!p) {
+9 −0
Original line number Diff line number Diff line
@@ -37,6 +37,15 @@

#define GET_FIELD(a) ((strnstr(#a, ".", 80) + 1))

#ifdef CONFIG_ARM
#define readq_relaxed(a) ({			\
	u64 val = readl_relaxed((a) + 4);	\
	val <<= 32;				\
	val |=  readl_relaxed((a));		\
	val;					\
})
#endif

struct msm_rpm_master_stats_platform_data {
	phys_addr_t phys_addr_base;
	u32 phys_size;