Commit ece6e01b authored by David S. Miller's avatar David S. Miller

[MYRI_SBUS]: Fix iomem warnings.

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 0d82618a
...@@ -85,7 +85,7 @@ static char version[] = ...@@ -85,7 +85,7 @@ static char version[] =
static struct myri_eth *root_myri_dev; static struct myri_eth *root_myri_dev;
#endif #endif
static void myri_reset_off(unsigned long lp, unsigned long cregs) static void myri_reset_off(void __iomem *lp, void __iomem *cregs)
{ {
/* Clear IRQ mask. */ /* Clear IRQ mask. */
sbus_writel(0, lp + LANAI_EIMASK); sbus_writel(0, lp + LANAI_EIMASK);
...@@ -94,7 +94,7 @@ static void myri_reset_off(unsigned long lp, unsigned long cregs) ...@@ -94,7 +94,7 @@ static void myri_reset_off(unsigned long lp, unsigned long cregs)
sbus_writel(CONTROL_ROFF, cregs + MYRICTRL_CTRL); sbus_writel(CONTROL_ROFF, cregs + MYRICTRL_CTRL);
} }
static void myri_reset_on(unsigned long cregs) static void myri_reset_on(void __iomem *cregs)
{ {
/* Enable RESET function. */ /* Enable RESET function. */
sbus_writel(CONTROL_RON, cregs + MYRICTRL_CTRL); sbus_writel(CONTROL_RON, cregs + MYRICTRL_CTRL);
...@@ -103,14 +103,14 @@ static void myri_reset_on(unsigned long cregs) ...@@ -103,14 +103,14 @@ static void myri_reset_on(unsigned long cregs)
sbus_writel(CONTROL_DIRQ, cregs + MYRICTRL_CTRL); sbus_writel(CONTROL_DIRQ, cregs + MYRICTRL_CTRL);
} }
static void myri_disable_irq(unsigned long lp, unsigned long cregs) static void myri_disable_irq(void __iomem *lp, void __iomem *cregs)
{ {
sbus_writel(CONTROL_DIRQ, cregs + MYRICTRL_CTRL); sbus_writel(CONTROL_DIRQ, cregs + MYRICTRL_CTRL);
sbus_writel(0, lp + LANAI_EIMASK); sbus_writel(0, lp + LANAI_EIMASK);
sbus_writel(ISTAT_HOST, lp + LANAI_ISTAT); sbus_writel(ISTAT_HOST, lp + LANAI_ISTAT);
} }
static void myri_enable_irq(unsigned long lp, unsigned long cregs) static void myri_enable_irq(void __iomem *lp, void __iomem *cregs)
{ {
sbus_writel(CONTROL_EIRQ, cregs + MYRICTRL_CTRL); sbus_writel(CONTROL_EIRQ, cregs + MYRICTRL_CTRL);
sbus_writel(ISTAT_HOST, lp + LANAI_EIMASK); sbus_writel(ISTAT_HOST, lp + LANAI_EIMASK);
...@@ -119,7 +119,7 @@ static void myri_enable_irq(unsigned long lp, unsigned long cregs) ...@@ -119,7 +119,7 @@ static void myri_enable_irq(unsigned long lp, unsigned long cregs)
static inline void bang_the_chip(struct myri_eth *mp) static inline void bang_the_chip(struct myri_eth *mp)
{ {
struct myri_shmem *shmem = mp->shmem; struct myri_shmem *shmem = mp->shmem;
unsigned long cregs = mp->cregs; void __iomem *cregs = mp->cregs;
sbus_writel(1, &shmem->send); sbus_writel(1, &shmem->send);
sbus_writel(CONTROL_WON, cregs + MYRICTRL_CTRL); sbus_writel(CONTROL_WON, cregs + MYRICTRL_CTRL);
...@@ -128,7 +128,7 @@ static inline void bang_the_chip(struct myri_eth *mp) ...@@ -128,7 +128,7 @@ static inline void bang_the_chip(struct myri_eth *mp)
static int myri_do_handshake(struct myri_eth *mp) static int myri_do_handshake(struct myri_eth *mp)
{ {
struct myri_shmem *shmem = mp->shmem; struct myri_shmem *shmem = mp->shmem;
unsigned long cregs = mp->cregs; void __iomem *cregs = mp->cregs;
struct myri_channel *chan = &shmem->channel; struct myri_channel *chan = &shmem->channel;
int tick = 0; int tick = 0;
...@@ -176,27 +176,27 @@ static int myri_do_handshake(struct myri_eth *mp) ...@@ -176,27 +176,27 @@ static int myri_do_handshake(struct myri_eth *mp)
static int myri_load_lanai(struct myri_eth *mp) static int myri_load_lanai(struct myri_eth *mp)
{ {
struct net_device *dev = mp->dev; struct net_device *dev = mp->dev;
struct myri_shmem *shmem = mp->shmem; struct myri_shmem __iomem *shmem = mp->shmem;
unsigned char *rptr; void __iomem *rptr;
int i; int i;
myri_disable_irq(mp->lregs, mp->cregs); myri_disable_irq(mp->lregs, mp->cregs);
myri_reset_on(mp->cregs); myri_reset_on(mp->cregs);
rptr = (unsigned char *) mp->lanai; rptr = mp->lanai;
for (i = 0; i < mp->eeprom.ramsz; i++) for (i = 0; i < mp->eeprom.ramsz; i++)
sbus_writeb(0, &rptr[i]); sbus_writeb(0, rptr + i);
if (mp->eeprom.cpuvers >= CPUVERS_3_0) if (mp->eeprom.cpuvers >= CPUVERS_3_0)
sbus_writel(mp->eeprom.cval, mp->lregs + LANAI_CVAL); sbus_writel(mp->eeprom.cval, mp->lregs + LANAI_CVAL);
/* Load executable code. */ /* Load executable code. */
for (i = 0; i < sizeof(lanai4_code); i++) for (i = 0; i < sizeof(lanai4_code); i++)
sbus_writeb(lanai4_code[i], &rptr[(lanai4_code_off * 2) + i]); sbus_writeb(lanai4_code[i], rptr + (lanai4_code_off * 2) + i);
/* Load data segment. */ /* Load data segment. */
for (i = 0; i < sizeof(lanai4_data); i++) for (i = 0; i < sizeof(lanai4_data); i++)
sbus_writeb(lanai4_data[i], &rptr[(lanai4_data_off * 2) + i]); sbus_writeb(lanai4_data[i], rptr + (lanai4_data_off * 2) + i);
/* Set device address. */ /* Set device address. */
sbus_writeb(0, &shmem->addr[0]); sbus_writeb(0, &shmem->addr[0]);
...@@ -237,15 +237,15 @@ static int myri_load_lanai(struct myri_eth *mp) ...@@ -237,15 +237,15 @@ static int myri_load_lanai(struct myri_eth *mp)
static void myri_clean_rings(struct myri_eth *mp) static void myri_clean_rings(struct myri_eth *mp)
{ {
struct sendq *sq = mp->sq; struct sendq __iomem *sq = mp->sq;
struct recvq *rq = mp->rq; struct recvq __iomem *rq = mp->rq;
int i; int i;
sbus_writel(0, &rq->tail); sbus_writel(0, &rq->tail);
sbus_writel(0, &rq->head); sbus_writel(0, &rq->head);
for (i = 0; i < (RX_RING_SIZE+1); i++) { for (i = 0; i < (RX_RING_SIZE+1); i++) {
if (mp->rx_skbs[i] != NULL) { if (mp->rx_skbs[i] != NULL) {
struct myri_rxd *rxd = &rq->myri_rxd[i]; struct myri_rxd __iomem *rxd = &rq->myri_rxd[i];
u32 dma_addr; u32 dma_addr;
dma_addr = sbus_readl(&rxd->myri_scatters[0].addr); dma_addr = sbus_readl(&rxd->myri_scatters[0].addr);
...@@ -261,7 +261,7 @@ static void myri_clean_rings(struct myri_eth *mp) ...@@ -261,7 +261,7 @@ static void myri_clean_rings(struct myri_eth *mp)
for (i = 0; i < TX_RING_SIZE; i++) { for (i = 0; i < TX_RING_SIZE; i++) {
if (mp->tx_skbs[i] != NULL) { if (mp->tx_skbs[i] != NULL) {
struct sk_buff *skb = mp->tx_skbs[i]; struct sk_buff *skb = mp->tx_skbs[i];
struct myri_txd *txd = &sq->myri_txd[i]; struct myri_txd __iomem *txd = &sq->myri_txd[i];
u32 dma_addr; u32 dma_addr;
dma_addr = sbus_readl(&txd->myri_gathers[0].addr); dma_addr = sbus_readl(&txd->myri_gathers[0].addr);
...@@ -274,8 +274,8 @@ static void myri_clean_rings(struct myri_eth *mp) ...@@ -274,8 +274,8 @@ static void myri_clean_rings(struct myri_eth *mp)
static void myri_init_rings(struct myri_eth *mp, int from_irq) static void myri_init_rings(struct myri_eth *mp, int from_irq)
{ {
struct recvq *rq = mp->rq; struct recvq __iomem *rq = mp->rq;
struct myri_rxd *rxd = &rq->myri_rxd[0]; struct myri_rxd __iomem *rxd = &rq->myri_rxd[0];
struct net_device *dev = mp->dev; struct net_device *dev = mp->dev;
int gfp_flags = GFP_KERNEL; int gfp_flags = GFP_KERNEL;
int i; int i;
...@@ -343,7 +343,7 @@ static void dump_ehdr_and_myripad(unsigned char *stuff) ...@@ -343,7 +343,7 @@ static void dump_ehdr_and_myripad(unsigned char *stuff)
static void myri_tx(struct myri_eth *mp, struct net_device *dev) static void myri_tx(struct myri_eth *mp, struct net_device *dev)
{ {
struct sendq *sq = mp->sq; struct sendq __iomem *sq= mp->sq;
int entry = mp->tx_old; int entry = mp->tx_old;
int limit = sbus_readl(&sq->head); int limit = sbus_readl(&sq->head);
...@@ -411,8 +411,8 @@ static unsigned short myri_type_trans(struct sk_buff *skb, struct net_device *de ...@@ -411,8 +411,8 @@ static unsigned short myri_type_trans(struct sk_buff *skb, struct net_device *de
static void myri_rx(struct myri_eth *mp, struct net_device *dev) static void myri_rx(struct myri_eth *mp, struct net_device *dev)
{ {
struct recvq *rq = mp->rq; struct recvq __iomem *rq = mp->rq;
struct recvq *rqa = mp->rqack; struct recvq __iomem *rqa = mp->rqack;
int entry = sbus_readl(&rqa->head); int entry = sbus_readl(&rqa->head);
int limit = sbus_readl(&rqa->tail); int limit = sbus_readl(&rqa->tail);
int drops; int drops;
...@@ -423,11 +423,11 @@ static void myri_rx(struct myri_eth *mp, struct net_device *dev) ...@@ -423,11 +423,11 @@ static void myri_rx(struct myri_eth *mp, struct net_device *dev)
drops = 0; drops = 0;
DRX(("\n")); DRX(("\n"));
while (entry != limit) { while (entry != limit) {
struct myri_rxd *rxdack = &rqa->myri_rxd[entry]; struct myri_rxd __iomem *rxdack = &rqa->myri_rxd[entry];
u32 csum = sbus_readl(&rxdack->csum); u32 csum = sbus_readl(&rxdack->csum);
int len = sbus_readl(&rxdack->myri_scatters[0].len); int len = sbus_readl(&rxdack->myri_scatters[0].len);
int index = sbus_readl(&rxdack->ctx); int index = sbus_readl(&rxdack->ctx);
struct myri_rxd *rxd = &rq->myri_rxd[rq->tail]; struct myri_rxd __iomem *rxd = &rq->myri_rxd[rq->tail];
struct sk_buff *skb = mp->rx_skbs[index]; struct sk_buff *skb = mp->rx_skbs[index];
/* Ack it. */ /* Ack it. */
...@@ -545,7 +545,7 @@ static irqreturn_t myri_interrupt(int irq, void *dev_id, struct pt_regs *regs) ...@@ -545,7 +545,7 @@ static irqreturn_t myri_interrupt(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 myri_eth *mp = (struct myri_eth *) dev->priv; struct myri_eth *mp = (struct myri_eth *) dev->priv;
unsigned long lregs = mp->lregs; void __iomem *lregs = mp->lregs;
struct myri_channel *chan = &mp->shmem->channel; struct myri_channel *chan = &mp->shmem->channel;
unsigned long flags; unsigned long flags;
u32 status; u32 status;
...@@ -610,8 +610,8 @@ static void myri_tx_timeout(struct net_device *dev) ...@@ -610,8 +610,8 @@ static void myri_tx_timeout(struct net_device *dev)
static int myri_start_xmit(struct sk_buff *skb, struct net_device *dev) static int myri_start_xmit(struct sk_buff *skb, struct net_device *dev)
{ {
struct myri_eth *mp = (struct myri_eth *) dev->priv; struct myri_eth *mp = (struct myri_eth *) dev->priv;
struct sendq *sq = mp->sq; struct sendq __iomem *sq = mp->sq;
struct myri_txd *txd; struct myri_txd __iomem *txd;
unsigned long flags; unsigned long flags;
unsigned int head, tail; unsigned int head, tail;
int len, entry; int len, entry;
...@@ -998,22 +998,20 @@ static int __init myri_ether_init(struct sbus_dev *sdev, int num) ...@@ -998,22 +998,20 @@ static int __init myri_ether_init(struct sbus_dev *sdev, int num)
printk("MyriCOM: Cannot map MyriCOM registers.\n"); printk("MyriCOM: Cannot map MyriCOM registers.\n");
goto err; goto err;
} }
mp->lanai = (unsigned short *) (mp->regs + (256 * 1024)); mp->lanai = mp->regs + (256 * 1024);
mp->lanai3 = (unsigned int *) mp->lanai; mp->lregs = mp->lanai + (0x10000 * 2);
mp->lregs = (unsigned long) &mp->lanai[0x10000];
} else { } else {
DET(("Mapping regs for cpuvers >= CPUVERS_4_0\n")); DET(("Mapping regs for cpuvers >= CPUVERS_4_0\n"));
mp->cregs = sbus_ioremap(&sdev->resource[0], 0, mp->cregs = sbus_ioremap(&sdev->resource[0], 0,
PAGE_SIZE, "MyriCOM Control Regs"); PAGE_SIZE, "MyriCOM Control Regs");
mp->lregs = sbus_ioremap(&sdev->resource[0], (256 * 1024), mp->lregs = sbus_ioremap(&sdev->resource[0], (256 * 1024),
PAGE_SIZE, "MyriCOM LANAI Regs"); PAGE_SIZE, "MyriCOM LANAI Regs");
mp->lanai = (unsigned short *) mp->lanai =
sbus_ioremap(&sdev->resource[0], (512 * 1024), sbus_ioremap(&sdev->resource[0], (512 * 1024),
mp->eeprom.ramsz, "MyriCOM SRAM"); mp->eeprom.ramsz, "MyriCOM SRAM");
mp->lanai3 = (unsigned int *) mp->lanai;
} }
DET(("Registers mapped: cregs[%lx] lregs[%lx] lanai[%p] lanai3[%p]\n", DET(("Registers mapped: cregs[%p] lregs[%p] lanai[%p]\n",
mp->cregs, mp->lregs, mp->lanai, mp->lanai3)); mp->cregs, mp->lregs, mp->lanai));
if (mp->eeprom.cpuvers >= CPUVERS_4_0) if (mp->eeprom.cpuvers >= CPUVERS_4_0)
mp->shmem_base = 0xf000; mp->shmem_base = 0xf000;
...@@ -1022,7 +1020,8 @@ static int __init myri_ether_init(struct sbus_dev *sdev, int num) ...@@ -1022,7 +1020,8 @@ static int __init myri_ether_init(struct sbus_dev *sdev, int num)
DET(("Shared memory base is %04x, ", mp->shmem_base)); DET(("Shared memory base is %04x, ", mp->shmem_base));
mp->shmem = (struct myri_shmem *) &mp->lanai[mp->shmem_base]; mp->shmem = (struct myri_shmem __iomem *)
(mp->lanai + (mp->shmem_base * 2));
DET(("shmem mapped at %p\n", mp->shmem)); DET(("shmem mapped at %p\n", mp->shmem));
mp->rqack = &mp->shmem->channel.recvqa; mp->rqack = &mp->shmem->channel.recvqa;
......
...@@ -270,22 +270,21 @@ struct myri_eth { ...@@ -270,22 +270,21 @@ struct myri_eth {
* to obtain good cache hit rates. * to obtain good cache hit rates.
*/ */
spinlock_t irq_lock; spinlock_t irq_lock;
struct myri_shmem *shmem; /* Shared data structures. */ struct myri_shmem __iomem *shmem; /* Shared data structures. */
unsigned long cregs; /* Control register space. */ void __iomem *cregs; /* Control register space. */
struct recvq *rqack; /* Where we ack rx's. */ struct recvq __iomem *rqack; /* Where we ack rx's. */
struct recvq *rq; /* Where we put buffers. */ struct recvq __iomem *rq; /* Where we put buffers. */
struct sendq *sq; /* Where we stuff tx's. */ struct sendq __iomem *sq; /* Where we stuff tx's. */
struct net_device *dev; /* Linux/NET dev struct. */ struct net_device *dev; /* Linux/NET dev struct. */
int tx_old; /* To speed up tx cleaning. */ int tx_old; /* To speed up tx cleaning. */
unsigned long lregs; /* Quick ptr to LANAI regs. */ void __iomem *lregs; /* Quick ptr to LANAI regs. */
struct sk_buff *rx_skbs[RX_RING_SIZE+1];/* RX skb's */ struct sk_buff *rx_skbs[RX_RING_SIZE+1];/* RX skb's */
struct sk_buff *tx_skbs[TX_RING_SIZE]; /* TX skb's */ struct sk_buff *tx_skbs[TX_RING_SIZE]; /* TX skb's */
struct net_device_stats enet_stats; /* Interface stats. */ struct net_device_stats enet_stats; /* Interface stats. */
/* These are less frequently accessed. */ /* These are less frequently accessed. */
unsigned long regs; /* MyriCOM register space. */ void __iomem *regs; /* MyriCOM register space. */
unsigned short *lanai; /* View 2 of register space. */ void __iomem *lanai; /* View 2 of register space. */
unsigned int *lanai3; /* View 3 of register space. */
unsigned int myri_bursts; /* SBUS bursts. */ unsigned int myri_bursts; /* SBUS bursts. */
struct myri_eeprom eeprom; /* Local copy of EEPROM. */ struct myri_eeprom eeprom; /* Local copy of EEPROM. */
unsigned int reg_size; /* Size of register space. */ unsigned int reg_size; /* Size of register space. */
......
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