Skip to contentSkip to conversation

IFC: Change IO accessor based on endianness

PATCH Superseded Jaiprakash Singh 1 participant 1 message Oct 8, 2014

Subsystems (4)

v1 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 IFC: Change IO accessor based on endianness

From: Jaiprakash Singh <[email protected]>

IFC IO accressor are set at run time based
on IFC IP registers endianness.IFC node in
DTS file contains information about
endianness.

---
 .../bindings/memory-controllers/fsl/ifc.txt        |    2 +
 drivers/memory/fsl_ifc.c                           |  120 ++++++++++++----
 drivers/mtd/nand/fsl_ifc_nand.c                    |  151 +++++++++++---------
 include/linux/fsl_ifc.h                            |    8 ++
 4 files changed, 181 insertions(+), 100 deletions(-)
Documentation/devicetree/bindings/memory-controllers/fsl/ifc.txt +2 -0
index d5e3704..ee6226b 100644
@@ -18,6 +18,8 @@ Properties:
               interrupt (NAND_EVTER_STAT).  If there is only one,
               that interrupt reports both types of event.
 
+- little-endian : If this property is absent, the big-endian mode will
+                  be in use as default for registers.
 
 - ranges : Each range corresponds to a single chipselect, and covers
            the entire access window as configured.
drivers/memory/fsl_ifc.c +89 -31

174 lines not on this page · raw message

drivers/mtd/nand/fsl_ifc_nand.c +82 -69

406 lines not on this page · raw message

include/linux/fsl_ifc.h +8 -0
index f49ddb1..6a380dc 100644
@@ -816,6 +816,13 @@ struct fsl_ifc_regs {
 
 extern unsigned int convert_ifc_address(phys_addr_t addr_base);
 extern int fsl_ifc_find(phys_addr_t addr_base);
+extern u32 ifc_in32(void __iomem *);
+extern u16 ifc_in16(void __iomem *);
+extern u8  ifc_in8(void __iomem *);
+
+extern void ifc_out32(u32 val, void __iomem *addr);
+extern void ifc_out16(u16 val, void __iomem *addr);
+extern void ifc_out8(u8 val, void __iomem *addr);
 
 /* overview of the fsl ifc controller */
 
@@ -830,6 +837,7 @@ struct fsl_ifc_ctrl {
 
 	u32 nand_stat;
 	wait_queue_head_t nand_wait;
+	bool little_endian;
 };
 
 extern struct fsl_ifc_ctrl *fsl_ifc_ctrl_dev;
Signature · 1 line
1.7.10.4