9 #include <linux/kernel.h>
13 #include <linux/errno.h>
15 #define PIC32_NULL 0x00
17 #define PIC32_SYSRD 0x02
19 #define PIC32_SYSWR 0x20
20 #define PIC32_IRQ_CLR 0x40
21 #define PIC32_STATUS 0x80
23 #define DELAY() udelay(100)
32 static inline unsigned int ioready(
void)
34 return readl(bus_status) & 1;
37 static inline void wait_ioready(
void)
39 do { }
while (!ioready());
42 static inline void wait_ioclear(
void)
44 do { }
while (ioready());
47 static inline void check_ioclear(
void)
50 pr_debug(
"ioclear: initially busy\n");
71 status =
readl(bus_xfer);
73 val =
readl(bus_xfer);
76 pr_debug(
"pic32_bus_readl: *%x -> %x (status=%x)\n", reg, val, status);
78 spin_unlock_irqrestore(&pic32_bus_lock, flags);
97 status =
readl(bus_xfer);
100 pr_debug(
"pic32_bus_writel: *%x <- %x (status=%x)\n", reg, val, status);
102 spin_unlock_irqrestore(&pic32_bus_lock, flags);