summaryrefslogtreecommitdiff
path: root/include/linux/fsl
diff options
context:
space:
mode:
authorYangbo Lu <yangbo.lu@nxp.com>2019-02-12 07:23:59 +0300
committerDavid S. Miller <davem@davemloft.net>2019-02-12 20:58:48 +0300
commitf038ddf25b80be90e1af9439935bdb66fdbf5e28 (patch)
tree654ca5a29e993efe5c95b3f7d587f4d4c6f3d0f9 /include/linux/fsl
parentff54571a747bc1fc8e132ef9c512451ec6de3336 (diff)
downloadlinux-f038ddf25b80be90e1af9439935bdb66fdbf5e28.tar.xz
ptp_qoriq: add little enadian support
There is QorIQ 1588 timer IP block on the new ENETC Ethernet controller. However it uses little endian mode which is different with before. This patch is to add little endian support for the driver by using "little-endian" dts node property. Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/fsl')
-rw-r--r--include/linux/fsl/ptp_qoriq.h21
1 files changed, 15 insertions, 6 deletions
diff --git a/include/linux/fsl/ptp_qoriq.h b/include/linux/fsl/ptp_qoriq.h
index 757aec385493..1f8bb6a6a121 100644
--- a/include/linux/fsl/ptp_qoriq.h
+++ b/include/linux/fsl/ptp_qoriq.h
@@ -157,21 +157,30 @@ struct ptp_qoriq {
u32 cksel;
u32 tmr_fiper1;
u32 tmr_fiper2;
+ u32 (*read)(unsigned __iomem *addr);
+ void (*write)(unsigned __iomem *addr, u32 val);
};
-static inline u32 qoriq_read(unsigned __iomem *addr)
+static inline u32 qoriq_read_be(unsigned __iomem *addr)
{
- u32 val;
-
- val = ioread32be(addr);
- return val;
+ return ioread32be(addr);
}
-static inline void qoriq_write(unsigned __iomem *addr, u32 val)
+static inline void qoriq_write_be(unsigned __iomem *addr, u32 val)
{
iowrite32be(val, addr);
}
+static inline u32 qoriq_read_le(unsigned __iomem *addr)
+{
+ return ioread32(addr);
+}
+
+static inline void qoriq_write_le(unsigned __iomem *addr, u32 val)
+{
+ iowrite32(val, addr);
+}
+
irqreturn_t ptp_qoriq_isr(int irq, void *priv);
int ptp_qoriq_init(struct ptp_qoriq *ptp_qoriq, void __iomem *base,
const struct ptp_clock_info caps);