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

Commit 393d2d0f authored by Andrey Smirnov's avatar Andrey Smirnov Committed by Herbert Xu
Browse files

crypto: caam - use ioread64*_hi_lo in rd_reg64



Following the same transformation logic as outlined in previous commit
converting wr_reg64, convert rd_reg64 to use helpers from
<linux/io-64-nonatomic-hi-lo.h> first. No functional change intended.

Signed-off-by: default avatarAndrey Smirnov <andrew.smirnov@gmail.com>
Reviewed-by: default avatarHoria Geantă <horia.geanta@nxp.com>
Cc: Chris Spencer <christopher.spencer@sea.co.uk>
Cc: Cory Tusar <cory.tusar@zii.aero>
Cc: Chris Healy <cphealy@gmail.com>
Cc: Lucas Stach <l.stach@pengutronix.de>
Cc: Horia Geantă <horia.geanta@nxp.com>
Cc: Aymen Sghaier <aymen.sghaier@nxp.com>
Cc: Leonard Crestez <leonard.crestez@nxp.com>
Cc: linux-crypto@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent 9f5db8b5
Loading
Loading
Loading
Loading
+13 −5
Original line number Diff line number Diff line
@@ -172,12 +172,20 @@ static inline void wr_reg64(void __iomem *reg, u64 data)

static inline u64 rd_reg64(void __iomem *reg)
{
	if (!caam_imx && caam_little_end)
		return ((u64)rd_reg32((u32 __iomem *)(reg) + 1) << 32 |
			(u64)rd_reg32((u32 __iomem *)(reg)));
	if (caam_little_end) {
		if (caam_imx) {
			u32 low, high;

			high = ioread32(reg);
			low  = ioread32(reg + sizeof(u32));

	return ((u64)rd_reg32((u32 __iomem *)(reg)) << 32 |
		(u64)rd_reg32((u32 __iomem *)(reg) + 1));
			return low + ((u64)high << 32);
		} else {
			return ioread64(reg);
		}
	} else {
		return ioread64be(reg);
	}
}
#endif /* CONFIG_64BIT  */