Commit de36a0d8 authored by Alexander Viro's avatar Alexander Viro Committed by Jeff Garzik

[PATCH] bmac iomem annotations

Signed-off-by: default avatarAl Viro <viro@parcelfarce.linux.theplanet.co.uk>
Signed-off-by: default avatarJeff Garzik <jgarzik@pobox.com>
parent 7f02d002
...@@ -59,9 +59,9 @@ ...@@ -59,9 +59,9 @@
struct bmac_data { struct bmac_data {
/* volatile struct bmac *bmac; */ /* volatile struct bmac *bmac; */
struct sk_buff_head *queue; struct sk_buff_head *queue;
volatile struct dbdma_regs *tx_dma; volatile struct dbdma_regs __iomem *tx_dma;
int tx_dma_intr; int tx_dma_intr;
volatile struct dbdma_regs *rx_dma; volatile struct dbdma_regs __iomem *rx_dma;
int rx_dma_intr; int rx_dma_intr;
volatile struct dbdma_cmd *tx_cmds; /* xmit dma command list */ volatile struct dbdma_cmd *tx_cmds; /* xmit dma command list */
volatile struct dbdma_cmd *rx_cmds; /* recv dma command list */ volatile struct dbdma_cmd *rx_cmds; /* recv dma command list */
...@@ -165,35 +165,35 @@ static void bmac_start(struct net_device *dev); ...@@ -165,35 +165,35 @@ static void bmac_start(struct net_device *dev);
#define DBDMA_CLEAR(x) ( (x) << 16) #define DBDMA_CLEAR(x) ( (x) << 16)
static inline void static inline void
dbdma_st32(volatile unsigned long *a, unsigned long x) dbdma_st32(volatile __u32 __iomem *a, unsigned long x)
{ {
__asm__ volatile( "stwbrx %0,0,%1" : : "r" (x), "r" (a) : "memory"); __asm__ volatile( "stwbrx %0,0,%1" : : "r" (x), "r" (a) : "memory");
return; return;
} }
static inline unsigned long static inline unsigned long
dbdma_ld32(volatile unsigned long *a) dbdma_ld32(volatile __u32 __iomem *a)
{ {
unsigned long swap; __u32 swap;
__asm__ volatile ("lwbrx %0,0,%1" : "=r" (swap) : "r" (a)); __asm__ volatile ("lwbrx %0,0,%1" : "=r" (swap) : "r" (a));
return swap; return swap;
} }
static void static void
dbdma_continue(volatile struct dbdma_regs *dmap) dbdma_continue(volatile struct dbdma_regs __iomem *dmap)
{ {
dbdma_st32((volatile unsigned long *)&dmap->control, dbdma_st32(&dmap->control,
DBDMA_SET(RUN|WAKE) | DBDMA_CLEAR(PAUSE|DEAD)); DBDMA_SET(RUN|WAKE) | DBDMA_CLEAR(PAUSE|DEAD));
eieio(); eieio();
} }
static void static void
dbdma_reset(volatile struct dbdma_regs *dmap) dbdma_reset(volatile struct dbdma_regs __iomem *dmap)
{ {
dbdma_st32((volatile unsigned long *)&dmap->control, dbdma_st32(&dmap->control,
DBDMA_CLEAR(ACTIVE|DEAD|WAKE|FLUSH|PAUSE|RUN)); DBDMA_CLEAR(ACTIVE|DEAD|WAKE|FLUSH|PAUSE|RUN));
eieio(); eieio();
while (dbdma_ld32((volatile unsigned long *)&dmap->status) & RUN) while (dbdma_ld32(&dmap->status) & RUN)
eieio(); eieio();
} }
...@@ -213,22 +213,22 @@ dbdma_setcmd(volatile struct dbdma_cmd *cp, ...@@ -213,22 +213,22 @@ dbdma_setcmd(volatile struct dbdma_cmd *cp,
static inline static inline
void bmwrite(struct net_device *dev, unsigned long reg_offset, unsigned data ) void bmwrite(struct net_device *dev, unsigned long reg_offset, unsigned data )
{ {
out_le16((void *)dev->base_addr + reg_offset, data); out_le16((void __iomem *)dev->base_addr + reg_offset, data);
} }
static inline static inline
volatile unsigned short bmread(struct net_device *dev, unsigned long reg_offset ) volatile unsigned short bmread(struct net_device *dev, unsigned long reg_offset )
{ {
return in_le16((void *)dev->base_addr + reg_offset); return in_le16((void __iomem *)dev->base_addr + reg_offset);
} }
static void static void
bmac_enable_and_reset_chip(struct net_device *dev) bmac_enable_and_reset_chip(struct net_device *dev)
{ {
struct bmac_data *bp = netdev_priv(dev); struct bmac_data *bp = netdev_priv(dev);
volatile struct dbdma_regs *rd = bp->rx_dma; volatile struct dbdma_regs __iomem *rd = bp->rx_dma;
volatile struct dbdma_regs *td = bp->tx_dma; volatile struct dbdma_regs __iomem *td = bp->tx_dma;
if (rd) if (rd)
dbdma_reset(rd); dbdma_reset(rd);
...@@ -406,7 +406,7 @@ static void ...@@ -406,7 +406,7 @@ static void
bmac_start_chip(struct net_device *dev) bmac_start_chip(struct net_device *dev)
{ {
struct bmac_data *bp = netdev_priv(dev); struct bmac_data *bp = netdev_priv(dev);
volatile struct dbdma_regs *rd = bp->rx_dma; volatile struct dbdma_regs __iomem *rd = bp->rx_dma;
unsigned short oldConfig; unsigned short oldConfig;
/* enable rx dma channel */ /* enable rx dma channel */
...@@ -476,8 +476,8 @@ static int bmac_suspend(struct macio_dev *mdev, u32 state) ...@@ -476,8 +476,8 @@ static int bmac_suspend(struct macio_dev *mdev, u32 state)
bp->sleeping = 1; bp->sleeping = 1;
spin_unlock_irqrestore(&bp->lock, flags); spin_unlock_irqrestore(&bp->lock, flags);
if (bp->opened) { if (bp->opened) {
volatile struct dbdma_regs *rd = bp->rx_dma; volatile struct dbdma_regs __iomem *rd = bp->rx_dma;
volatile struct dbdma_regs *td = bp->tx_dma; volatile struct dbdma_regs __iomem *td = bp->tx_dma;
config = bmread(dev, RXCFG); config = bmread(dev, RXCFG);
bmwrite(dev, RXCFG, (config & ~RxMACEnable)); bmwrite(dev, RXCFG, (config & ~RxMACEnable));
...@@ -602,7 +602,7 @@ bitrev(unsigned char b) ...@@ -602,7 +602,7 @@ bitrev(unsigned char b)
static void static void
bmac_init_tx_ring(struct bmac_data *bp) bmac_init_tx_ring(struct bmac_data *bp)
{ {
volatile struct dbdma_regs *td = bp->tx_dma; volatile struct dbdma_regs __iomem *td = bp->tx_dma;
memset((char *)bp->tx_cmds, 0, (N_TX_RING+1) * sizeof(struct dbdma_cmd)); memset((char *)bp->tx_cmds, 0, (N_TX_RING+1) * sizeof(struct dbdma_cmd));
...@@ -623,7 +623,7 @@ bmac_init_tx_ring(struct bmac_data *bp) ...@@ -623,7 +623,7 @@ bmac_init_tx_ring(struct bmac_data *bp)
static int static int
bmac_init_rx_ring(struct bmac_data *bp) bmac_init_rx_ring(struct bmac_data *bp)
{ {
volatile struct dbdma_regs *rd = bp->rx_dma; volatile struct dbdma_regs __iomem *rd = bp->rx_dma;
int i; int i;
struct sk_buff *skb; struct sk_buff *skb;
...@@ -657,7 +657,7 @@ bmac_init_rx_ring(struct bmac_data *bp) ...@@ -657,7 +657,7 @@ bmac_init_rx_ring(struct bmac_data *bp)
static int bmac_transmit_packet(struct sk_buff *skb, struct net_device *dev) static int bmac_transmit_packet(struct sk_buff *skb, struct net_device *dev)
{ {
struct bmac_data *bp = netdev_priv(dev); struct bmac_data *bp = netdev_priv(dev);
volatile struct dbdma_regs *td = bp->tx_dma; volatile struct dbdma_regs __iomem *td = bp->tx_dma;
int i; int i;
/* see if there's a free slot in the tx ring */ /* see if there's a free slot in the tx ring */
...@@ -693,7 +693,7 @@ static irqreturn_t bmac_rxdma_intr(int irq, void *dev_id, struct pt_regs *regs) ...@@ -693,7 +693,7 @@ static irqreturn_t bmac_rxdma_intr(int irq, void *dev_id, struct pt_regs *regs)
{ {
struct net_device *dev = (struct net_device *) dev_id; struct net_device *dev = (struct net_device *) dev_id;
struct bmac_data *bp = netdev_priv(dev); struct bmac_data *bp = netdev_priv(dev);
volatile struct dbdma_regs *rd = bp->rx_dma; volatile struct dbdma_regs __iomem *rd = bp->rx_dma;
volatile struct dbdma_cmd *cp; volatile struct dbdma_cmd *cp;
int i, nb, stat; int i, nb, stat;
struct sk_buff *skb; struct sk_buff *skb;
...@@ -1331,13 +1331,11 @@ static int __devinit bmac_probe(struct macio_dev *mdev, const struct of_match *m ...@@ -1331,13 +1331,11 @@ static int __devinit bmac_probe(struct macio_dev *mdev, const struct of_match *m
goto err_out_iounmap; goto err_out_iounmap;
bp->is_bmac_plus = is_bmac_plus; bp->is_bmac_plus = is_bmac_plus;
bp->tx_dma = (volatile struct dbdma_regs *) bp->tx_dma = ioremap(macio_resource_start(mdev, 1), macio_resource_len(mdev, 1));
ioremap(macio_resource_start(mdev, 1), macio_resource_len(mdev, 1));
if (!bp->tx_dma) if (!bp->tx_dma)
goto err_out_iounmap; goto err_out_iounmap;
bp->tx_dma_intr = macio_irq(mdev, 1); bp->tx_dma_intr = macio_irq(mdev, 1);
bp->rx_dma = (volatile struct dbdma_regs *) bp->rx_dma = ioremap(macio_resource_start(mdev, 2), macio_resource_len(mdev, 2));
ioremap(macio_resource_start(mdev, 2), macio_resource_len(mdev, 2));
if (!bp->rx_dma) if (!bp->rx_dma)
goto err_out_iounmap_tx; goto err_out_iounmap_tx;
bp->rx_dma_intr = macio_irq(mdev, 2); bp->rx_dma_intr = macio_irq(mdev, 2);
...@@ -1392,11 +1390,11 @@ static int __devinit bmac_probe(struct macio_dev *mdev, const struct of_match *m ...@@ -1392,11 +1390,11 @@ static int __devinit bmac_probe(struct macio_dev *mdev, const struct of_match *m
err_out_irq0: err_out_irq0:
free_irq(dev->irq, dev); free_irq(dev->irq, dev);
err_out_iounmap_rx: err_out_iounmap_rx:
iounmap((void *)bp->rx_dma); iounmap(bp->rx_dma);
err_out_iounmap_tx: err_out_iounmap_tx:
iounmap((void *)bp->tx_dma); iounmap(bp->tx_dma);
err_out_iounmap: err_out_iounmap:
iounmap((void *)dev->base_addr); iounmap((void __iomem *)dev->base_addr);
out_release: out_release:
macio_release_resources(mdev); macio_release_resources(mdev);
out_free: out_free:
...@@ -1421,8 +1419,8 @@ static int bmac_open(struct net_device *dev) ...@@ -1421,8 +1419,8 @@ static int bmac_open(struct net_device *dev)
static int bmac_close(struct net_device *dev) static int bmac_close(struct net_device *dev)
{ {
struct bmac_data *bp = netdev_priv(dev); struct bmac_data *bp = netdev_priv(dev);
volatile struct dbdma_regs *rd = bp->rx_dma; volatile struct dbdma_regs __iomem *rd = bp->rx_dma;
volatile struct dbdma_regs *td = bp->tx_dma; volatile struct dbdma_regs __iomem *td = bp->tx_dma;
unsigned short config; unsigned short config;
int i; int i;
...@@ -1505,8 +1503,8 @@ static void bmac_tx_timeout(unsigned long data) ...@@ -1505,8 +1503,8 @@ static void bmac_tx_timeout(unsigned long data)
{ {
struct net_device *dev = (struct net_device *) data; struct net_device *dev = (struct net_device *) data;
struct bmac_data *bp = netdev_priv(dev); struct bmac_data *bp = netdev_priv(dev);
volatile struct dbdma_regs *td = bp->tx_dma; volatile struct dbdma_regs __iomem *td = bp->tx_dma;
volatile struct dbdma_regs *rd = bp->rx_dma; volatile struct dbdma_regs __iomem *rd = bp->rx_dma;
volatile struct dbdma_cmd *cp; volatile struct dbdma_cmd *cp;
unsigned long flags; unsigned long flags;
unsigned short config, oldConfig; unsigned short config, oldConfig;
...@@ -1638,9 +1636,9 @@ static int __devexit bmac_remove(struct macio_dev *mdev) ...@@ -1638,9 +1636,9 @@ static int __devexit bmac_remove(struct macio_dev *mdev)
free_irq(bp->tx_dma_intr, dev); free_irq(bp->tx_dma_intr, dev);
free_irq(bp->rx_dma_intr, dev); free_irq(bp->rx_dma_intr, dev);
iounmap((void *)dev->base_addr); iounmap((void __iomem *)dev->base_addr);
iounmap((void *)bp->tx_dma); iounmap(bp->tx_dma);
iounmap((void *)bp->rx_dma); iounmap(bp->rx_dma);
macio_release_resources(mdev); macio_release_resources(mdev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment