|
@@ -44,3 +44,83 @@
|
|
|
#define bfin_read_WDOG_CNT() bfin_read32(WDOG_CNT)
|
|
|
#define bfin_write_WDOG_CNT(val) bfin_write32(WDOG_CNT,val)
|
|
|
#define bfin_read_WDOG_STAT() bfin_read32(WDOG_STAT)
|
|
|
+#define bfin_write_WDOG_STAT(val) bfin_write32(WDOG_STAT,val)
|
|
|
+
|
|
|
+/* Real Time Clock (0xFFC0 1400-0xFFC0 17FF) */
|
|
|
+#define bfin_read_RTC_STAT() bfin_read32(RTC_STAT)
|
|
|
+#define bfin_write_RTC_STAT(val) bfin_write32(RTC_STAT,val)
|
|
|
+#define bfin_read_RTC_ICTL() bfin_read16(RTC_ICTL)
|
|
|
+#define bfin_write_RTC_ICTL(val) bfin_write16(RTC_ICTL,val)
|
|
|
+#define bfin_read_RTC_ISTAT() bfin_read16(RTC_ISTAT)
|
|
|
+#define bfin_write_RTC_ISTAT(val) bfin_write16(RTC_ISTAT,val)
|
|
|
+#define bfin_read_RTC_SWCNT() bfin_read16(RTC_SWCNT)
|
|
|
+#define bfin_write_RTC_SWCNT(val) bfin_write16(RTC_SWCNT,val)
|
|
|
+#define bfin_read_RTC_ALARM() bfin_read32(RTC_ALARM)
|
|
|
+#define bfin_write_RTC_ALARM(val) bfin_write32(RTC_ALARM,val)
|
|
|
+#define bfin_read_RTC_FAST() bfin_read16(RTC_FAST)
|
|
|
+#define bfin_write_RTC_FAST(val) bfin_write16(RTC_FAST,val)
|
|
|
+#define bfin_read_RTC_PREN() bfin_read16(RTC_PREN)
|
|
|
+#define bfin_write_RTC_PREN(val) bfin_write16(RTC_PREN,val)
|
|
|
+
|
|
|
+/* DMA Traffic controls */
|
|
|
+#define bfin_read_DMAC_TC_PER() bfin_read16(DMAC_TC_PER)
|
|
|
+#define bfin_write_DMAC_TC_PER(val) bfin_write16(DMAC_TC_PER,val)
|
|
|
+#define bfin_read_DMAC_TC_CNT() bfin_read16(DMAC_TC_CNT)
|
|
|
+#define bfin_write_DMAC_TC_CNT(val) bfin_write16(DMAC_TC_CNT,val)
|
|
|
+
|
|
|
+/* General Purpose IO (0xFFC0 2400-0xFFC0 27FF) */
|
|
|
+#define bfin_read_FIO_DIR() bfin_read16(FIO_DIR)
|
|
|
+#define bfin_write_FIO_DIR(val) bfin_write16(FIO_DIR,val)
|
|
|
+#define bfin_read_FIO_MASKA_C() bfin_read16(FIO_MASKA_C)
|
|
|
+#define bfin_write_FIO_MASKA_C(val) bfin_write16(FIO_MASKA_C,val)
|
|
|
+#define bfin_read_FIO_MASKA_S() bfin_read16(FIO_MASKA_S)
|
|
|
+#define bfin_write_FIO_MASKA_S(val) bfin_write16(FIO_MASKA_S,val)
|
|
|
+#define bfin_read_FIO_MASKB_C() bfin_read16(FIO_MASKB_C)
|
|
|
+#define bfin_write_FIO_MASKB_C(val) bfin_write16(FIO_MASKB_C,val)
|
|
|
+#define bfin_read_FIO_MASKB_S() bfin_read16(FIO_MASKB_S)
|
|
|
+#define bfin_write_FIO_MASKB_S(val) bfin_write16(FIO_MASKB_S,val)
|
|
|
+#define bfin_read_FIO_POLAR() bfin_read16(FIO_POLAR)
|
|
|
+#define bfin_write_FIO_POLAR(val) bfin_write16(FIO_POLAR,val)
|
|
|
+#define bfin_read_FIO_EDGE() bfin_read16(FIO_EDGE)
|
|
|
+#define bfin_write_FIO_EDGE(val) bfin_write16(FIO_EDGE,val)
|
|
|
+#define bfin_read_FIO_BOTH() bfin_read16(FIO_BOTH)
|
|
|
+#define bfin_write_FIO_BOTH(val) bfin_write16(FIO_BOTH,val)
|
|
|
+#define bfin_read_FIO_INEN() bfin_read16(FIO_INEN)
|
|
|
+#define bfin_write_FIO_INEN(val) bfin_write16(FIO_INEN,val)
|
|
|
+#define bfin_read_FIO_MASKA_D() bfin_read16(FIO_MASKA_D)
|
|
|
+#define bfin_write_FIO_MASKA_D(val) bfin_write16(FIO_MASKA_D,val)
|
|
|
+#define bfin_read_FIO_MASKA_T() bfin_read16(FIO_MASKA_T)
|
|
|
+#define bfin_write_FIO_MASKA_T(val) bfin_write16(FIO_MASKA_T,val)
|
|
|
+#define bfin_read_FIO_MASKB_D() bfin_read16(FIO_MASKB_D)
|
|
|
+#define bfin_write_FIO_MASKB_D(val) bfin_write16(FIO_MASKB_D,val)
|
|
|
+#define bfin_read_FIO_MASKB_T() bfin_read16(FIO_MASKB_T)
|
|
|
+#define bfin_write_FIO_MASKB_T(val) bfin_write16(FIO_MASKB_T,val)
|
|
|
+
|
|
|
+#if ANOMALY_05000311
|
|
|
+/* Keep at the CPP expansion to avoid circular header dependency loops */
|
|
|
+#define BFIN_WRITE_FIO_FLAG(name, val) \
|
|
|
+ do { \
|
|
|
+ unsigned long __flags; \
|
|
|
+ __flags = hard_local_irq_save(); \
|
|
|
+ bfin_write16(FIO_FLAG_##name, val); \
|
|
|
+ bfin_read_CHIPID(); \
|
|
|
+ hard_local_irq_restore(__flags); \
|
|
|
+ } while (0)
|
|
|
+#define bfin_write_FIO_FLAG_D(val) BFIN_WRITE_FIO_FLAG(D, val)
|
|
|
+#define bfin_write_FIO_FLAG_C(val) BFIN_WRITE_FIO_FLAG(C, val)
|
|
|
+#define bfin_write_FIO_FLAG_S(val) BFIN_WRITE_FIO_FLAG(S, val)
|
|
|
+#define bfin_write_FIO_FLAG_T(val) BFIN_WRITE_FIO_FLAG(T, val)
|
|
|
+
|
|
|
+#define BFIN_READ_FIO_FLAG(name) \
|
|
|
+ ({ \
|
|
|
+ unsigned long __flags; \
|
|
|
+ u16 __ret; \
|
|
|
+ __flags = hard_local_irq_save(); \
|
|
|
+ __ret = bfin_read16(FIO_FLAG_##name); \
|
|
|
+ bfin_read_CHIPID(); \
|
|
|
+ hard_local_irq_restore(__flags); \
|
|
|
+ __ret; \
|
|
|
+ })
|
|
|
+#define bfin_read_FIO_FLAG_D() BFIN_READ_FIO_FLAG(D)
|
|
|
+#define bfin_read_FIO_FLAG_C() BFIN_READ_FIO_FLAG(C)
|
|
|
+#define bfin_read_FIO_FLAG_S() BFIN_READ_FIO_FLAG(S)
|