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

Commit da1a9b00 authored by Laura Abbott's avatar Laura Abbott Committed by Stepan Moskovchenko
Browse files

arm: Properly support 64-bit read/write



Several places were incorrectly casting 64 bit types to
32 bit types. Cast to the appropriate value. Also, actually
assign the value we are attempting to write to the correct
register. This way, we actually write the value we want
instead of whatever happens to be in r2.

Change-Id: Ica0b40b9ea5916f6dc11c011d8875cdb59e2feba
Signed-off-by: default avatarLaura Abbott <lauraa@codeaurora.org>
parent 1ce07d93
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -97,8 +97,10 @@ static inline void __raw_writell_no_log(u64 val, volatile void __iomem *addr)
{
	register u64 v asm ("r2");

	v = val;

	asm volatile("strd %1, %0"
		     : "+Qo" (*(volatile u32 __force *)addr)
		     : "+Qo" (*(volatile u64 __force *)addr)
		     : "r" (v));
}

@@ -125,7 +127,7 @@ static inline u64 __raw_readll_no_log(const volatile void __iomem *addr)
	register u64 val asm ("r2");

	asm volatile("ldrd %1, %0"
		     : "+Qo" (*(volatile u32 __force *)addr),
		     : "+Qo" (*(volatile u64 __force *)addr),
		       "=r" (val));
	return val;
}
@@ -362,7 +364,7 @@ extern void _memset_io(volatile void __iomem *, int, size_t);
#define writeb_relaxed(v,c)	__raw_writeb(v,c)
#define writew_relaxed(v,c)	__raw_writew((__force u16) cpu_to_le16(v),c)
#define writel_relaxed(v,c)	__raw_writel((__force u32) cpu_to_le32(v),c)
#define writell_relaxed(v,c)	__raw_writell((__force u32) cpu_to_le32(v),c)
#define writell_relaxed(v,c)	__raw_writell((__force u64) cpu_to_le64(v),c)
#define writel_relaxed_no_log(v, c) __raw_writel_no_log((__force u32) cpu_to_le32(v),c)
#define writell_relaxed_no_log(v, c) __raw_writell_no_log((__force u64) cpu_to_le64(v),c)