[PATCH 4/5] esdhc-xload: Add bigendian support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Sascha Hauer <s.hauer@xxxxxxxxxxxxxx>
---
 drivers/mci/imx-esdhc-pbl.c | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/drivers/mci/imx-esdhc-pbl.c b/drivers/mci/imx-esdhc-pbl.c
index 72df54d685..33d78aad05 100644
--- a/drivers/mci/imx-esdhc-pbl.c
+++ b/drivers/mci/imx-esdhc-pbl.c
@@ -29,17 +29,24 @@
 
 struct esdhc {
 	void __iomem *regs;
-	int is_mx6;
+	bool is_mx6;
+	bool is_be;
 };
 
 static uint32_t esdhc_read32(struct esdhc *esdhc, int reg)
 {
-	return readl(esdhc->regs + reg);
+	if (esdhc->is_be)
+		return in_be32(esdhc->regs + reg);
+	else
+		return readl(esdhc->regs + reg);
 }
 
 static void esdhc_write32(struct esdhc *esdhc, int reg, uint32_t val)
 {
-	writel(val, esdhc->regs + reg);
+	if (esdhc->is_be)
+		out_be32(esdhc->regs + reg, val);
+	else
+		writel(val, esdhc->regs + reg);
 }
 
 static void __udelay(int us)
-- 
2.20.1


_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux