Commit 950addfa authored by David S. Miller's avatar David S. Miller

Merge davem@nuts.davemloft.net:/disk1/BK/sparc-2.6

into kernel.bkbits.net:/home/davem/sparc-2.6
parents 4f0fdda0 66467abe
# #
# Automatically generated make config: don't edit # Automatically generated make config: don't edit
# Linux kernel version: 2.6.9-rc1 # Linux kernel version: 2.6.9-rc2
# Thu Sep 2 23:38:33 2004 # Thu Sep 16 14:44:26 2004
# #
CONFIG_64BIT=y CONFIG_64BIT=y
CONFIG_MMU=y CONFIG_MMU=y
CONFIG_TIME_INTERPOLATION=y
# #
# Code maturity level options # Code maturity level options
...@@ -15,6 +16,7 @@ CONFIG_CLEAN_COMPILE=y ...@@ -15,6 +16,7 @@ CONFIG_CLEAN_COMPILE=y
# #
# General setup # General setup
# #
CONFIG_LOCALVERSION=""
CONFIG_SWAP=y CONFIG_SWAP=y
CONFIG_SYSVIPC=y CONFIG_SYSVIPC=y
CONFIG_POSIX_MQUEUE=y CONFIG_POSIX_MQUEUE=y
...@@ -1077,6 +1079,7 @@ CONFIG_SERIO_I8042=y ...@@ -1077,6 +1079,7 @@ CONFIG_SERIO_I8042=y
# CONFIG_SERIO_CT82C710 is not set # CONFIG_SERIO_CT82C710 is not set
# CONFIG_SERIO_PARKBD is not set # CONFIG_SERIO_PARKBD is not set
CONFIG_SERIO_PCIPS2=m CONFIG_SERIO_PCIPS2=m
CONFIG_SERIO_RAW=m
# #
# Input Device Drivers # Input Device Drivers
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
#include <asm/io.h> #include <asm/io.h>
#include <asm/byteorder.h> #include <asm/byteorder.h>
void outsb(unsigned long addr, const void *src, unsigned long count) void outsb(void __iomem *addr, const void *src, unsigned long count)
{ {
const u8 *p = src; const u8 *p = src;
...@@ -15,7 +15,7 @@ void outsb(unsigned long addr, const void *src, unsigned long count) ...@@ -15,7 +15,7 @@ void outsb(unsigned long addr, const void *src, unsigned long count)
outb(*p++, addr); outb(*p++, addr);
} }
void outsw(unsigned long addr, const void *src, unsigned long count) void outsw(void __iomem *addr, const void *src, unsigned long count)
{ {
if(count) { if(count) {
u16 *ps = (u16 *)src; u16 *ps = (u16 *)src;
...@@ -44,7 +44,7 @@ void outsw(unsigned long addr, const void *src, unsigned long count) ...@@ -44,7 +44,7 @@ void outsw(unsigned long addr, const void *src, unsigned long count)
} }
} }
void outsl(unsigned long addr, const void *src, unsigned long count) void outsl(void __iomem *addr, const void *src, unsigned long count)
{ {
if(count) { if(count) {
if((((u64)src) & 0x3) == 0) { if((((u64)src) & 0x3) == 0) {
...@@ -119,7 +119,7 @@ void outsl(unsigned long addr, const void *src, unsigned long count) ...@@ -119,7 +119,7 @@ void outsl(unsigned long addr, const void *src, unsigned long count)
} }
} }
void insb(unsigned long addr, void *dst, unsigned long count) void insb(void __iomem *addr, void *dst, unsigned long count)
{ {
if(count) { if(count) {
u32 *pi; u32 *pi;
...@@ -144,7 +144,7 @@ void insb(unsigned long addr, void *dst, unsigned long count) ...@@ -144,7 +144,7 @@ void insb(unsigned long addr, void *dst, unsigned long count)
} }
} }
void insw(unsigned long addr, void *dst, unsigned long count) void insw(void __iomem *addr, void *dst, unsigned long count)
{ {
if(count) { if(count) {
u16 *ps = dst; u16 *ps = dst;
...@@ -169,7 +169,7 @@ void insw(unsigned long addr, void *dst, unsigned long count) ...@@ -169,7 +169,7 @@ void insw(unsigned long addr, void *dst, unsigned long count)
} }
} }
void insl(unsigned long addr, void *dst, unsigned long count) void insl(void __iomem *addr, void *dst, unsigned long count)
{ {
if(count) { if(count) {
if((((unsigned long)dst) & 0x3) == 0) { if((((unsigned long)dst) & 0x3) == 0) {
......
...@@ -81,29 +81,29 @@ do { (s)->imask = (i); \ ...@@ -81,29 +81,29 @@ do { (s)->imask = (i); \
* That's why here are the following inline functions... * That's why here are the following inline functions...
*/ */
typedef unsigned long xram_p; typedef void __iomem *xram_p;
/* Get 32bit number from XRAM */ /* Get 32bit number from XRAM */
static inline u32 xram_get_32 (xram_p x) static inline u32 xram_get_32(xram_p x)
{ {
return ((sbus_readw(x + 0x00UL) << 16) | return ((sbus_readw(x + 0x00UL) << 16) |
(sbus_readw(x + 0x02UL))); (sbus_readw(x + 0x02UL)));
} }
/* Like the above, but when we don't care about the high 16 bits */ /* Like the above, but when we don't care about the high 16 bits */
static inline u32 xram_get_32low (xram_p x) static inline u32 xram_get_32low(xram_p x)
{ {
return (u32) sbus_readw(x + 0x02UL); return (u32) sbus_readw(x + 0x02UL);
} }
static inline u16 xram_get_16 (xram_p x) static inline u16 xram_get_16(xram_p x)
{ {
return sbus_readw(x); return sbus_readw(x);
} }
static inline u8 xram_get_8 (xram_p x) static inline u8 xram_get_8(xram_p x)
{ {
if (x & (xram_p)0x1) { if ((unsigned long)x & 0x1UL) {
x = x - 1; x = x - 1;
return (u8) sbus_readw(x); return (u8) sbus_readw(x);
} else { } else {
...@@ -111,7 +111,7 @@ static inline u8 xram_get_8 (xram_p x) ...@@ -111,7 +111,7 @@ static inline u8 xram_get_8 (xram_p x)
} }
} }
static inline void xram_copy_from (void *p, xram_p x, int len) static inline void xram_copy_from(void *p, xram_p x, int len)
{ {
for (len >>= 2; len > 0; len--, x += sizeof(u32)) { for (len >>= 2; len > 0; len--, x += sizeof(u32)) {
u32 val, *p32 = p; u32 val, *p32 = p;
...@@ -123,7 +123,7 @@ static inline void xram_copy_from (void *p, xram_p x, int len) ...@@ -123,7 +123,7 @@ static inline void xram_copy_from (void *p, xram_p x, int len)
} }
} }
static inline void xram_copy_to (xram_p x, void *p, int len) static inline void xram_copy_to(xram_p x, void *p, int len)
{ {
for (len >>= 2; len > 0; len--, x += sizeof(u32)) { for (len >>= 2; len > 0; len--, x += sizeof(u32)) {
u32 tmp, *p32 = p; u32 tmp, *p32 = p;
...@@ -135,7 +135,7 @@ static inline void xram_copy_to (xram_p x, void *p, int len) ...@@ -135,7 +135,7 @@ static inline void xram_copy_to (xram_p x, void *p, int len)
} }
} }
static inline void xram_bzero (xram_p x, int len) static inline void xram_bzero(xram_p x, int len)
{ {
for (len >>= 1; len > 0; len--, x += sizeof(u16)) for (len >>= 1; len > 0; len--, x += sizeof(u16))
sbus_writew(0, x); sbus_writew(0, x);
...@@ -274,7 +274,7 @@ struct soc { ...@@ -274,7 +274,7 @@ struct soc {
soc_cq req[2]; /* Request CQs */ soc_cq req[2]; /* Request CQs */
soc_cq rsp[2]; /* Response CQs */ soc_cq rsp[2]; /* Response CQs */
int soc_no; int soc_no;
unsigned long regs; void __iomem *regs;
xram_p xram; xram_p xram;
fc_wwn wwn; fc_wwn wwn;
u32 imask; /* Our copy of regs->imask */ u32 imask; /* Our copy of regs->imask */
......
...@@ -60,7 +60,7 @@ static char *version = ...@@ -60,7 +60,7 @@ static char *version =
#define for_each_socal(s) for (s = socals; s; s = s->next) #define for_each_socal(s) for (s = socals; s; s = s->next)
struct socal *socals = NULL; struct socal *socals = NULL;
static void socal_copy_from_xram(void *d, unsigned long xram, long size) static void socal_copy_from_xram(void *d, void __iomem *xram, long size)
{ {
u32 *dp = (u32 *) d; u32 *dp = (u32 *) d;
while (size) { while (size) {
...@@ -70,7 +70,7 @@ static void socal_copy_from_xram(void *d, unsigned long xram, long size) ...@@ -70,7 +70,7 @@ static void socal_copy_from_xram(void *d, unsigned long xram, long size)
} }
} }
static void socal_copy_to_xram(unsigned long xram, void *s, long size) static void socal_copy_to_xram(void __iomem *xram, void *s, long size)
{ {
u32 *sp = (u32 *) s; u32 *sp = (u32 *) s;
while (size) { while (size) {
......
...@@ -295,9 +295,9 @@ struct socal { ...@@ -295,9 +295,9 @@ struct socal {
socal_cq req[4]; /* Request CQs */ socal_cq req[4]; /* Request CQs */
socal_cq rsp[4]; /* Response CQs */ socal_cq rsp[4]; /* Response CQs */
int socal_no; int socal_no;
unsigned long regs; void __iomem *regs;
unsigned long xram; void __iomem *xram;
unsigned long eeprom; void __iomem *eeprom;
fc_wwn wwn; fc_wwn wwn;
u32 imask; /* Our copy of regs->imask */ u32 imask; /* Our copy of regs->imask */
u32 cfg; /* Our copy of regs->cfg */ u32 cfg; /* Our copy of regs->cfg */
......
...@@ -18,7 +18,7 @@ static int i8042_aux_irq = -1; ...@@ -18,7 +18,7 @@ static int i8042_aux_irq = -1;
#define I8042_AUX_PHYS_DESC "sparcps2/serio1" #define I8042_AUX_PHYS_DESC "sparcps2/serio1"
#define I8042_MUX_PHYS_DESC "sparcps2/serio%d" #define I8042_MUX_PHYS_DESC "sparcps2/serio%d"
static unsigned long kbd_iobase; static void __iomem *kbd_iobase;
#define I8042_COMMAND_REG (kbd_iobase + 0x64UL) #define I8042_COMMAND_REG (kbd_iobase + 0x64UL)
#define I8042_DATA_REG (kbd_iobase + 0x60UL) #define I8042_DATA_REG (kbd_iobase + 0x60UL)
...@@ -64,7 +64,7 @@ static int i8042_platform_init(void) ...@@ -64,7 +64,7 @@ static int i8042_platform_init(void)
if (strncmp(prop, "SUNW,JavaStation-1", len) == 0) { if (strncmp(prop, "SUNW,JavaStation-1", len) == 0) {
/* Hardcoded values for MrCoffee. */ /* Hardcoded values for MrCoffee. */
i8042_kbd_irq = i8042_aux_irq = 13 | 0x20; i8042_kbd_irq = i8042_aux_irq = 13 | 0x20;
kbd_iobase = (unsigned long) ioremap(0x71300060, 8); kbd_iobase = ioremap(0x71300060, 8);
if (!kbd_iobase) if (!kbd_iobase)
return -1; return -1;
} else { } else {
...@@ -85,7 +85,7 @@ static int i8042_platform_init(void) ...@@ -85,7 +85,7 @@ static int i8042_platform_init(void)
if (!strcmp(child->prom_name, OBP_PS2KBD_NAME1) || if (!strcmp(child->prom_name, OBP_PS2KBD_NAME1) ||
!strcmp(child->prom_name, OBP_PS2KBD_NAME2)) { !strcmp(child->prom_name, OBP_PS2KBD_NAME2)) {
i8042_kbd_irq = child->irqs[0]; i8042_kbd_irq = child->irqs[0];
kbd_iobase = (unsigned long) kbd_iobase =
ioremap(child->resource[0].start, 8); ioremap(child->resource[0].start, 8);
} }
if (!strcmp(child->prom_name, OBP_PS2MS_NAME1) || if (!strcmp(child->prom_name, OBP_PS2MS_NAME1) ||
...@@ -109,7 +109,7 @@ static int i8042_platform_init(void) ...@@ -109,7 +109,7 @@ static int i8042_platform_init(void)
static inline void i8042_platform_exit(void) static inline void i8042_platform_exit(void)
{ {
#ifdef CONFIG_PCI #ifdef CONFIG_PCI
iounmap((void *)kbd_iobase); iounmap(kbd_iobase);
#endif #endif
} }
......
...@@ -581,8 +581,8 @@ typedef struct _MPT_ADAPTER ...@@ -581,8 +581,8 @@ typedef struct _MPT_ADAPTER
int pci_irq; /* This irq */ int pci_irq; /* This irq */
char name[MPT_NAME_LENGTH]; /* "iocN" */ char name[MPT_NAME_LENGTH]; /* "iocN" */
char *prod_name; /* "LSIFC9x9" */ char *prod_name; /* "LSIFC9x9" */
volatile SYSIF_REGS *chip; /* == c8817000 (mmap) */ SYSIF_REGS __iomem *chip; /* == c8817000 (mmap) */
volatile SYSIF_REGS *pio_chip; /* Programmed IO (downloadboot) */ SYSIF_REGS __iomem *pio_chip; /* Programmed IO (downloadboot) */
u32 mem_phys; /* == f4020000 (mmap) */ u32 mem_phys; /* == f4020000 (mmap) */
u32 pio_mem_phys; /* Programmed IO (downloadboot) */ u32 pio_mem_phys; /* Programmed IO (downloadboot) */
int mem_size; /* mmap memory size */ int mem_size; /* mmap memory size */
......
...@@ -1837,7 +1837,7 @@ static int __devinit b44_init_one(struct pci_dev *pdev, ...@@ -1837,7 +1837,7 @@ static int __devinit b44_init_one(struct pci_dev *pdev,
return 0; return 0;
err_out_iounmap: err_out_iounmap:
iounmap((void *) bp->regs); iounmap(bp->regs);
err_out_free_dev: err_out_free_dev:
free_netdev(dev); free_netdev(dev);
...@@ -1859,7 +1859,7 @@ static void __devexit b44_remove_one(struct pci_dev *pdev) ...@@ -1859,7 +1859,7 @@ static void __devexit b44_remove_one(struct pci_dev *pdev)
struct b44 *bp = netdev_priv(dev); struct b44 *bp = netdev_priv(dev);
unregister_netdev(dev); unregister_netdev(dev);
iounmap((void *) bp->regs); iounmap(bp->regs);
free_netdev(dev); free_netdev(dev);
pci_release_regions(pdev); pci_release_regions(pdev);
pci_disable_device(pdev); pci_disable_device(pdev);
......
...@@ -527,7 +527,7 @@ struct b44 { ...@@ -527,7 +527,7 @@ struct b44 {
struct net_device_stats stats; struct net_device_stats stats;
struct b44_hw_stats hw_stats; struct b44_hw_stats hw_stats;
volatile void __iomem *regs; void __iomem *regs;
struct pci_dev *pdev; struct pci_dev *pdev;
struct net_device *dev; struct net_device *dev;
......
...@@ -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. */
......
...@@ -68,7 +68,7 @@ static struct bigmac *root_bigmac_dev; ...@@ -68,7 +68,7 @@ static struct bigmac *root_bigmac_dev;
#define QEC_RESET_TRIES 200 #define QEC_RESET_TRIES 200
static int qec_global_reset(unsigned long gregs) static int qec_global_reset(void __iomem *gregs)
{ {
int tries = QEC_RESET_TRIES; int tries = QEC_RESET_TRIES;
...@@ -88,7 +88,7 @@ static int qec_global_reset(unsigned long gregs) ...@@ -88,7 +88,7 @@ static int qec_global_reset(unsigned long gregs)
static void qec_init(struct bigmac *bp) static void qec_init(struct bigmac *bp)
{ {
unsigned long gregs = bp->gregs; void __iomem *gregs = bp->gregs;
struct sbus_dev *qec_sdev = bp->qec_sdev; struct sbus_dev *qec_sdev = bp->qec_sdev;
u8 bsizes = bp->bigmac_bursts; u8 bsizes = bp->bigmac_bursts;
u32 regval; u32 regval;
...@@ -117,7 +117,7 @@ static void qec_init(struct bigmac *bp) ...@@ -117,7 +117,7 @@ static void qec_init(struct bigmac *bp)
#define TX_RESET_TRIES 32 #define TX_RESET_TRIES 32
#define RX_RESET_TRIES 32 #define RX_RESET_TRIES 32
static void bigmac_tx_reset(unsigned long bregs) static void bigmac_tx_reset(void __iomem *bregs)
{ {
int tries = TX_RESET_TRIES; int tries = TX_RESET_TRIES;
...@@ -137,7 +137,7 @@ static void bigmac_tx_reset(unsigned long bregs) ...@@ -137,7 +137,7 @@ static void bigmac_tx_reset(unsigned long bregs)
} }
} }
static void bigmac_rx_reset(unsigned long bregs) static void bigmac_rx_reset(void __iomem *bregs)
{ {
int tries = RX_RESET_TRIES; int tries = RX_RESET_TRIES;
...@@ -159,7 +159,7 @@ static void bigmac_stop(struct bigmac *bp) ...@@ -159,7 +159,7 @@ static void bigmac_stop(struct bigmac *bp)
bigmac_rx_reset(bp->bregs); bigmac_rx_reset(bp->bregs);
} }
static void bigmac_get_counters(struct bigmac *bp, unsigned long bregs) static void bigmac_get_counters(struct bigmac *bp, void __iomem *bregs)
{ {
struct net_device_stats *stats = &bp->enet_stats; struct net_device_stats *stats = &bp->enet_stats;
...@@ -244,7 +244,7 @@ static void bigmac_init_rings(struct bigmac *bp, int from_irq) ...@@ -244,7 +244,7 @@ static void bigmac_init_rings(struct bigmac *bp, int from_irq)
#define MGMT_CLKON (MGMT_PAL_INT_MDIO|MGMT_PAL_EXT_MDIO|MGMT_PAL_OENAB|MGMT_PAL_DCLOCK) #define MGMT_CLKON (MGMT_PAL_INT_MDIO|MGMT_PAL_EXT_MDIO|MGMT_PAL_OENAB|MGMT_PAL_DCLOCK)
#define MGMT_CLKOFF (MGMT_PAL_INT_MDIO|MGMT_PAL_EXT_MDIO|MGMT_PAL_OENAB) #define MGMT_CLKOFF (MGMT_PAL_INT_MDIO|MGMT_PAL_EXT_MDIO|MGMT_PAL_OENAB)
static void idle_transceiver(unsigned long tregs) static void idle_transceiver(void __iomem *tregs)
{ {
int i = 20; int i = 20;
...@@ -256,7 +256,7 @@ static void idle_transceiver(unsigned long tregs) ...@@ -256,7 +256,7 @@ static void idle_transceiver(unsigned long tregs)
} }
} }
static void write_tcvr_bit(struct bigmac *bp, unsigned long tregs, int bit) static void write_tcvr_bit(struct bigmac *bp, void __iomem *tregs, int bit)
{ {
if (bp->tcvr_type == internal) { if (bp->tcvr_type == internal) {
bit = (bit & 1) << 3; bit = (bit & 1) << 3;
...@@ -279,7 +279,7 @@ static void write_tcvr_bit(struct bigmac *bp, unsigned long tregs, int bit) ...@@ -279,7 +279,7 @@ static void write_tcvr_bit(struct bigmac *bp, unsigned long tregs, int bit)
} }
} }
static int read_tcvr_bit(struct bigmac *bp, unsigned long tregs) static int read_tcvr_bit(struct bigmac *bp, void __iomem *tregs)
{ {
int retval = 0; int retval = 0;
...@@ -302,7 +302,7 @@ static int read_tcvr_bit(struct bigmac *bp, unsigned long tregs) ...@@ -302,7 +302,7 @@ static int read_tcvr_bit(struct bigmac *bp, unsigned long tregs)
return retval; return retval;
} }
static int read_tcvr_bit2(struct bigmac *bp, unsigned long tregs) static int read_tcvr_bit2(struct bigmac *bp, void __iomem *tregs)
{ {
int retval = 0; int retval = 0;
...@@ -325,7 +325,7 @@ static int read_tcvr_bit2(struct bigmac *bp, unsigned long tregs) ...@@ -325,7 +325,7 @@ static int read_tcvr_bit2(struct bigmac *bp, unsigned long tregs)
} }
static void put_tcvr_byte(struct bigmac *bp, static void put_tcvr_byte(struct bigmac *bp,
unsigned long tregs, void __iomem *tregs,
unsigned int byte) unsigned int byte)
{ {
int shift = 4; int shift = 4;
...@@ -336,7 +336,7 @@ static void put_tcvr_byte(struct bigmac *bp, ...@@ -336,7 +336,7 @@ static void put_tcvr_byte(struct bigmac *bp,
} while (shift >= 0); } while (shift >= 0);
} }
static void bigmac_tcvr_write(struct bigmac *bp, unsigned long tregs, static void bigmac_tcvr_write(struct bigmac *bp, void __iomem *tregs,
int reg, unsigned short val) int reg, unsigned short val)
{ {
int shift; int shift;
...@@ -376,7 +376,7 @@ static void bigmac_tcvr_write(struct bigmac *bp, unsigned long tregs, ...@@ -376,7 +376,7 @@ static void bigmac_tcvr_write(struct bigmac *bp, unsigned long tregs,
} }
static unsigned short bigmac_tcvr_read(struct bigmac *bp, static unsigned short bigmac_tcvr_read(struct bigmac *bp,
unsigned long tregs, void __iomem *tregs,
int reg) int reg)
{ {
unsigned short retval = 0; unsigned short retval = 0;
...@@ -444,7 +444,7 @@ static unsigned short bigmac_tcvr_read(struct bigmac *bp, ...@@ -444,7 +444,7 @@ static unsigned short bigmac_tcvr_read(struct bigmac *bp,
static void bigmac_tcvr_init(struct bigmac *bp) static void bigmac_tcvr_init(struct bigmac *bp)
{ {
unsigned long tregs = bp->tregs; void __iomem *tregs = bp->tregs;
u32 mpal; u32 mpal;
idle_transceiver(tregs); idle_transceiver(tregs);
...@@ -482,7 +482,7 @@ static void bigmac_tcvr_init(struct bigmac *bp) ...@@ -482,7 +482,7 @@ static void bigmac_tcvr_init(struct bigmac *bp)
static int bigmac_init(struct bigmac *, int); static int bigmac_init(struct bigmac *, int);
static int try_next_permutation(struct bigmac *bp, unsigned long tregs) static int try_next_permutation(struct bigmac *bp, void __iomem *tregs)
{ {
if (bp->sw_bmcr & BMCR_SPEED100) { if (bp->sw_bmcr & BMCR_SPEED100) {
int timeout; int timeout;
...@@ -518,7 +518,7 @@ static int try_next_permutation(struct bigmac *bp, unsigned long tregs) ...@@ -518,7 +518,7 @@ static int try_next_permutation(struct bigmac *bp, unsigned long tregs)
static void bigmac_timer(unsigned long data) static void bigmac_timer(unsigned long data)
{ {
struct bigmac *bp = (struct bigmac *) data; struct bigmac *bp = (struct bigmac *) data;
unsigned long tregs = bp->tregs; void __iomem *tregs = bp->tregs;
int restart_timer = 0; int restart_timer = 0;
bp->timer_ticks++; bp->timer_ticks++;
...@@ -573,7 +573,7 @@ static void bigmac_timer(unsigned long data) ...@@ -573,7 +573,7 @@ static void bigmac_timer(unsigned long data)
*/ */
static void bigmac_begin_auto_negotiation(struct bigmac *bp) static void bigmac_begin_auto_negotiation(struct bigmac *bp)
{ {
unsigned long tregs = bp->tregs; void __iomem *tregs = bp->tregs;
int timeout; int timeout;
/* Grab new software copies of PHY registers. */ /* Grab new software copies of PHY registers. */
...@@ -612,9 +612,9 @@ static void bigmac_begin_auto_negotiation(struct bigmac *bp) ...@@ -612,9 +612,9 @@ static void bigmac_begin_auto_negotiation(struct bigmac *bp)
static int bigmac_init(struct bigmac *bp, int from_irq) static int bigmac_init(struct bigmac *bp, int from_irq)
{ {
unsigned long gregs = bp->gregs; void __iomem *gregs = bp->gregs;
unsigned long cregs = bp->creg; void __iomem *cregs = bp->creg;
unsigned long bregs = bp->bregs; void __iomem *bregs = bp->bregs;
unsigned char *e = &bp->dev->dev_addr[0]; unsigned char *e = &bp->dev->dev_addr[0];
/* Latch current counters into statistics. */ /* Latch current counters into statistics. */
...@@ -987,7 +987,7 @@ static struct net_device_stats *bigmac_get_stats(struct net_device *dev) ...@@ -987,7 +987,7 @@ static struct net_device_stats *bigmac_get_stats(struct net_device *dev)
static void bigmac_set_multicast(struct net_device *dev) static void bigmac_set_multicast(struct net_device *dev)
{ {
struct bigmac *bp = (struct bigmac *) dev->priv; struct bigmac *bp = (struct bigmac *) dev->priv;
unsigned long bregs = bp->bregs; void __iomem *bregs = bp->bregs;
struct dev_mc_list *dmi = dev->mc_list; struct dev_mc_list *dmi = dev->mc_list;
char *addrs; char *addrs;
int i; int i;
......
...@@ -303,10 +303,10 @@ enum bigmac_timer_state { ...@@ -303,10 +303,10 @@ enum bigmac_timer_state {
}; };
struct bigmac { struct bigmac {
unsigned long gregs; /* QEC Global Registers */ void __iomem *gregs; /* QEC Global Registers */
unsigned long creg; /* QEC BigMAC Channel Registers */ void __iomem *creg; /* QEC BigMAC Channel Registers */
unsigned long bregs; /* BigMAC Registers */ void __iomem *bregs; /* BigMAC Registers */
unsigned long tregs; /* BigMAC Transceiver */ void __iomem *tregs; /* BigMAC Transceiver */
struct bmac_init_block *bmac_block; /* RX and TX descriptors */ struct bmac_init_block *bmac_block; /* RX and TX descriptors */
__u32 bblock_dvma; /* RX and TX descriptors */ __u32 bblock_dvma; /* RX and TX descriptors */
......
...@@ -203,12 +203,12 @@ MODULE_DEVICE_TABLE(pci, happymeal_pci_ids); ...@@ -203,12 +203,12 @@ MODULE_DEVICE_TABLE(pci, happymeal_pci_ids);
*/ */
#if defined(CONFIG_SBUS) && defined(CONFIG_PCI) #if defined(CONFIG_SBUS) && defined(CONFIG_PCI)
static void sbus_hme_write32(unsigned long reg, u32 val) static void sbus_hme_write32(void __iomem *reg, u32 val)
{ {
sbus_writel(val, reg); sbus_writel(val, reg);
} }
static u32 sbus_hme_read32(unsigned long reg) static u32 sbus_hme_read32(void __iomem *reg)
{ {
return sbus_readl(reg); return sbus_readl(reg);
} }
...@@ -232,12 +232,12 @@ static u32 sbus_hme_read_desc32(u32 *p) ...@@ -232,12 +232,12 @@ static u32 sbus_hme_read_desc32(u32 *p)
return *p; return *p;
} }
static void pci_hme_write32(unsigned long reg, u32 val) static void pci_hme_write32(void __iomem *reg, u32 val)
{ {
writel(val, reg); writel(val, reg);
} }
static u32 pci_hme_read32(unsigned long reg) static u32 pci_hme_read32(void __iomem *reg)
{ {
return readl(reg); return readl(reg);
} }
...@@ -354,7 +354,7 @@ do { (__txd)->tx_addr = cpu_to_le32(__addr); \ ...@@ -354,7 +354,7 @@ do { (__txd)->tx_addr = cpu_to_le32(__addr); \
/* Oh yes, the MIF BitBang is mighty fun to program. BitBucket is more like it. */ /* Oh yes, the MIF BitBang is mighty fun to program. BitBucket is more like it. */
static void BB_PUT_BIT(struct happy_meal *hp, unsigned long tregs, int bit) static void BB_PUT_BIT(struct happy_meal *hp, void __iomem *tregs, int bit)
{ {
hme_write32(hp, tregs + TCVR_BBDATA, bit); hme_write32(hp, tregs + TCVR_BBDATA, bit);
hme_write32(hp, tregs + TCVR_BBCLOCK, 0); hme_write32(hp, tregs + TCVR_BBCLOCK, 0);
...@@ -362,7 +362,7 @@ static void BB_PUT_BIT(struct happy_meal *hp, unsigned long tregs, int bit) ...@@ -362,7 +362,7 @@ static void BB_PUT_BIT(struct happy_meal *hp, unsigned long tregs, int bit)
} }
#if 0 #if 0
static u32 BB_GET_BIT(struct happy_meal *hp, unsigned long tregs, int internal) static u32 BB_GET_BIT(struct happy_meal *hp, void __iomem *tregs, int internal)
{ {
u32 ret; u32 ret;
...@@ -378,7 +378,7 @@ static u32 BB_GET_BIT(struct happy_meal *hp, unsigned long tregs, int internal) ...@@ -378,7 +378,7 @@ static u32 BB_GET_BIT(struct happy_meal *hp, unsigned long tregs, int internal)
} }
#endif #endif
static u32 BB_GET_BIT2(struct happy_meal *hp, unsigned long tregs, int internal) static u32 BB_GET_BIT2(struct happy_meal *hp, void __iomem *tregs, int internal)
{ {
u32 retval; u32 retval;
...@@ -397,7 +397,7 @@ static u32 BB_GET_BIT2(struct happy_meal *hp, unsigned long tregs, int internal) ...@@ -397,7 +397,7 @@ static u32 BB_GET_BIT2(struct happy_meal *hp, unsigned long tregs, int internal)
#define TCVR_FAILURE 0x80000000 /* Impossible MIF read value */ #define TCVR_FAILURE 0x80000000 /* Impossible MIF read value */
static int happy_meal_bb_read(struct happy_meal *hp, static int happy_meal_bb_read(struct happy_meal *hp,
unsigned long tregs, int reg) void __iomem *tregs, int reg)
{ {
u32 tmp; u32 tmp;
int retval = 0; int retval = 0;
...@@ -443,7 +443,7 @@ static int happy_meal_bb_read(struct happy_meal *hp, ...@@ -443,7 +443,7 @@ static int happy_meal_bb_read(struct happy_meal *hp,
} }
static void happy_meal_bb_write(struct happy_meal *hp, static void happy_meal_bb_write(struct happy_meal *hp,
unsigned long tregs, int reg, void __iomem *tregs, int reg,
unsigned short value) unsigned short value)
{ {
u32 tmp; u32 tmp;
...@@ -488,7 +488,7 @@ static void happy_meal_bb_write(struct happy_meal *hp, ...@@ -488,7 +488,7 @@ static void happy_meal_bb_write(struct happy_meal *hp,
#define TCVR_READ_TRIES 16 #define TCVR_READ_TRIES 16
static int happy_meal_tcvr_read(struct happy_meal *hp, static int happy_meal_tcvr_read(struct happy_meal *hp,
unsigned long tregs, int reg) void __iomem *tregs, int reg)
{ {
int tries = TCVR_READ_TRIES; int tries = TCVR_READ_TRIES;
int retval; int retval;
...@@ -520,7 +520,7 @@ static int happy_meal_tcvr_read(struct happy_meal *hp, ...@@ -520,7 +520,7 @@ static int happy_meal_tcvr_read(struct happy_meal *hp,
#define TCVR_WRITE_TRIES 16 #define TCVR_WRITE_TRIES 16
static void happy_meal_tcvr_write(struct happy_meal *hp, static void happy_meal_tcvr_write(struct happy_meal *hp,
unsigned long tregs, int reg, void __iomem *tregs, int reg,
unsigned short value) unsigned short value)
{ {
int tries = TCVR_WRITE_TRIES; int tries = TCVR_WRITE_TRIES;
...@@ -579,7 +579,7 @@ static void happy_meal_tcvr_write(struct happy_meal *hp, ...@@ -579,7 +579,7 @@ static void happy_meal_tcvr_write(struct happy_meal *hp,
* service routine, and the chip is reset, or the link is ifconfig'd down * service routine, and the chip is reset, or the link is ifconfig'd down
* and then back up, this entire process repeats itself all over again. * and then back up, this entire process repeats itself all over again.
*/ */
static int try_next_permutation(struct happy_meal *hp, unsigned long tregs) static int try_next_permutation(struct happy_meal *hp, void __iomem *tregs)
{ {
hp->sw_bmcr = happy_meal_tcvr_read(hp, tregs, MII_BMCR); hp->sw_bmcr = happy_meal_tcvr_read(hp, tregs, MII_BMCR);
...@@ -603,7 +603,7 @@ static int try_next_permutation(struct happy_meal *hp, unsigned long tregs) ...@@ -603,7 +603,7 @@ static int try_next_permutation(struct happy_meal *hp, unsigned long tregs)
return -1; return -1;
} }
static void display_link_mode(struct happy_meal *hp, unsigned long tregs) static void display_link_mode(struct happy_meal *hp, void __iomem *tregs)
{ {
printk(KERN_INFO "%s: Link is up using ", hp->dev->name); printk(KERN_INFO "%s: Link is up using ", hp->dev->name);
if (hp->tcvr_type == external) if (hp->tcvr_type == external)
...@@ -625,7 +625,7 @@ static void display_link_mode(struct happy_meal *hp, unsigned long tregs) ...@@ -625,7 +625,7 @@ static void display_link_mode(struct happy_meal *hp, unsigned long tregs)
} }
} }
static void display_forced_link_mode(struct happy_meal *hp, unsigned long tregs) static void display_forced_link_mode(struct happy_meal *hp, void __iomem *tregs)
{ {
printk(KERN_INFO "%s: Link has been forced up using ", hp->dev->name); printk(KERN_INFO "%s: Link has been forced up using ", hp->dev->name);
if (hp->tcvr_type == external) if (hp->tcvr_type == external)
...@@ -644,7 +644,7 @@ static void display_forced_link_mode(struct happy_meal *hp, unsigned long tregs) ...@@ -644,7 +644,7 @@ static void display_forced_link_mode(struct happy_meal *hp, unsigned long tregs)
printk("Half Duplex.\n"); printk("Half Duplex.\n");
} }
static int set_happy_link_modes(struct happy_meal *hp, unsigned long tregs) static int set_happy_link_modes(struct happy_meal *hp, void __iomem *tregs)
{ {
int full; int full;
...@@ -708,7 +708,7 @@ static int happy_meal_init(struct happy_meal *hp); ...@@ -708,7 +708,7 @@ static int happy_meal_init(struct happy_meal *hp);
static int is_lucent_phy(struct happy_meal *hp) static int is_lucent_phy(struct happy_meal *hp)
{ {
unsigned long tregs = hp->tcvregs; void __iomem *tregs = hp->tcvregs;
unsigned short mr2, mr3; unsigned short mr2, mr3;
int ret = 0; int ret = 0;
...@@ -724,7 +724,7 @@ static int is_lucent_phy(struct happy_meal *hp) ...@@ -724,7 +724,7 @@ static int is_lucent_phy(struct happy_meal *hp)
static void happy_meal_timer(unsigned long data) static void happy_meal_timer(unsigned long data)
{ {
struct happy_meal *hp = (struct happy_meal *) data; struct happy_meal *hp = (struct happy_meal *) data;
unsigned long tregs = hp->tcvregs; void __iomem *tregs = hp->tcvregs;
int restart_timer = 0; int restart_timer = 0;
spin_lock_irq(&hp->happy_lock); spin_lock_irq(&hp->happy_lock);
...@@ -905,7 +905,7 @@ static void happy_meal_timer(unsigned long data) ...@@ -905,7 +905,7 @@ static void happy_meal_timer(unsigned long data)
#define RX_RESET_TRIES 32 #define RX_RESET_TRIES 32
/* hp->happy_lock must be held */ /* hp->happy_lock must be held */
static void happy_meal_tx_reset(struct happy_meal *hp, unsigned long bregs) static void happy_meal_tx_reset(struct happy_meal *hp, void __iomem *bregs)
{ {
int tries = TX_RESET_TRIES; int tries = TX_RESET_TRIES;
...@@ -925,7 +925,7 @@ static void happy_meal_tx_reset(struct happy_meal *hp, unsigned long bregs) ...@@ -925,7 +925,7 @@ static void happy_meal_tx_reset(struct happy_meal *hp, unsigned long bregs)
} }
/* hp->happy_lock must be held */ /* hp->happy_lock must be held */
static void happy_meal_rx_reset(struct happy_meal *hp, unsigned long bregs) static void happy_meal_rx_reset(struct happy_meal *hp, void __iomem *bregs)
{ {
int tries = RX_RESET_TRIES; int tries = RX_RESET_TRIES;
...@@ -947,7 +947,7 @@ static void happy_meal_rx_reset(struct happy_meal *hp, unsigned long bregs) ...@@ -947,7 +947,7 @@ static void happy_meal_rx_reset(struct happy_meal *hp, unsigned long bregs)
#define STOP_TRIES 16 #define STOP_TRIES 16
/* hp->happy_lock must be held */ /* hp->happy_lock must be held */
static void happy_meal_stop(struct happy_meal *hp, unsigned long gregs) static void happy_meal_stop(struct happy_meal *hp, void __iomem *gregs)
{ {
int tries = STOP_TRIES; int tries = STOP_TRIES;
...@@ -967,7 +967,7 @@ static void happy_meal_stop(struct happy_meal *hp, unsigned long gregs) ...@@ -967,7 +967,7 @@ static void happy_meal_stop(struct happy_meal *hp, unsigned long gregs)
} }
/* hp->happy_lock must be held */ /* hp->happy_lock must be held */
static void happy_meal_get_counters(struct happy_meal *hp, unsigned long bregs) static void happy_meal_get_counters(struct happy_meal *hp, void __iomem *bregs)
{ {
struct net_device_stats *stats = &hp->net_stats; struct net_device_stats *stats = &hp->net_stats;
...@@ -990,7 +990,7 @@ static void happy_meal_get_counters(struct happy_meal *hp, unsigned long bregs) ...@@ -990,7 +990,7 @@ static void happy_meal_get_counters(struct happy_meal *hp, unsigned long bregs)
} }
/* hp->happy_lock must be held */ /* hp->happy_lock must be held */
static void happy_meal_poll_stop(struct happy_meal *hp, unsigned long tregs) static void happy_meal_poll_stop(struct happy_meal *hp, void __iomem *tregs)
{ {
ASD(("happy_meal_poll_stop: ")); ASD(("happy_meal_poll_stop: "));
...@@ -1025,7 +1025,7 @@ static void happy_meal_poll_stop(struct happy_meal *hp, unsigned long tregs) ...@@ -1025,7 +1025,7 @@ static void happy_meal_poll_stop(struct happy_meal *hp, unsigned long tregs)
#define TCVR_UNISOLATE_TRIES 32 /* Dis-isolation can take longer. */ #define TCVR_UNISOLATE_TRIES 32 /* Dis-isolation can take longer. */
/* hp->happy_lock must be held */ /* hp->happy_lock must be held */
static int happy_meal_tcvr_reset(struct happy_meal *hp, unsigned long tregs) static int happy_meal_tcvr_reset(struct happy_meal *hp, void __iomem *tregs)
{ {
u32 tconfig; u32 tconfig;
int result, tries = TCVR_RESET_TRIES; int result, tries = TCVR_RESET_TRIES;
...@@ -1123,7 +1123,7 @@ static int happy_meal_tcvr_reset(struct happy_meal *hp, unsigned long tregs) ...@@ -1123,7 +1123,7 @@ static int happy_meal_tcvr_reset(struct happy_meal *hp, unsigned long tregs)
* *
* hp->happy_lock must be held * hp->happy_lock must be held
*/ */
static void happy_meal_transceiver_check(struct happy_meal *hp, unsigned long tregs) static void happy_meal_transceiver_check(struct happy_meal *hp, void __iomem *tregs)
{ {
unsigned long tconfig = hme_read32(hp, tregs + TCVR_CFG); unsigned long tconfig = hme_read32(hp, tregs + TCVR_CFG);
...@@ -1318,7 +1318,7 @@ static void happy_meal_init_rings(struct happy_meal *hp) ...@@ -1318,7 +1318,7 @@ static void happy_meal_init_rings(struct happy_meal *hp)
/* hp->happy_lock must be held */ /* hp->happy_lock must be held */
static void happy_meal_begin_auto_negotiation(struct happy_meal *hp, static void happy_meal_begin_auto_negotiation(struct happy_meal *hp,
unsigned long tregs, void __iomem *tregs,
struct ethtool_cmd *ep) struct ethtool_cmd *ep)
{ {
int timeout; int timeout;
...@@ -1443,11 +1443,11 @@ static void happy_meal_begin_auto_negotiation(struct happy_meal *hp, ...@@ -1443,11 +1443,11 @@ static void happy_meal_begin_auto_negotiation(struct happy_meal *hp,
/* hp->happy_lock must be held */ /* hp->happy_lock must be held */
static int happy_meal_init(struct happy_meal *hp) static int happy_meal_init(struct happy_meal *hp)
{ {
unsigned long gregs = hp->gregs; void __iomem *gregs = hp->gregs;
unsigned long etxregs = hp->etxregs; void __iomem *etxregs = hp->etxregs;
unsigned long erxregs = hp->erxregs; void __iomem *erxregs = hp->erxregs;
unsigned long bregs = hp->bigmacregs; void __iomem *bregs = hp->bigmacregs;
unsigned long tregs = hp->tcvregs; void __iomem *tregs = hp->tcvregs;
u32 regtmp, rxcfg; u32 regtmp, rxcfg;
unsigned char *e = &hp->dev->dev_addr[0]; unsigned char *e = &hp->dev->dev_addr[0];
...@@ -1736,9 +1736,9 @@ static int happy_meal_init(struct happy_meal *hp) ...@@ -1736,9 +1736,9 @@ static int happy_meal_init(struct happy_meal *hp)
/* hp->happy_lock must be held */ /* hp->happy_lock must be held */
static void happy_meal_set_initial_advertisement(struct happy_meal *hp) static void happy_meal_set_initial_advertisement(struct happy_meal *hp)
{ {
unsigned long tregs = hp->tcvregs; void __iomem *tregs = hp->tcvregs;
unsigned long bregs = hp->bigmacregs; void __iomem *bregs = hp->bigmacregs;
unsigned long gregs = hp->gregs; void __iomem *gregs = hp->gregs;
happy_meal_stop(hp, gregs); happy_meal_stop(hp, gregs);
hme_write32(hp, tregs + TCVR_IMASK, 0xffff); hme_write32(hp, tregs + TCVR_IMASK, 0xffff);
...@@ -1910,7 +1910,7 @@ static int happy_meal_is_not_so_happy(struct happy_meal *hp, u32 status) ...@@ -1910,7 +1910,7 @@ static int happy_meal_is_not_so_happy(struct happy_meal *hp, u32 status)
/* hp->happy_lock must be held */ /* hp->happy_lock must be held */
static void happy_meal_mif_interrupt(struct happy_meal *hp) static void happy_meal_mif_interrupt(struct happy_meal *hp)
{ {
unsigned long tregs = hp->tcvregs; void __iomem *tregs = hp->tcvregs;
printk(KERN_INFO "%s: Link status change.\n", hp->dev->name); printk(KERN_INFO "%s: Link status change.\n", hp->dev->name);
hp->sw_bmcr = happy_meal_tcvr_read(hp, tregs, MII_BMCR); hp->sw_bmcr = happy_meal_tcvr_read(hp, tregs, MII_BMCR);
...@@ -2390,7 +2390,7 @@ static struct net_device_stats *happy_meal_get_stats(struct net_device *dev) ...@@ -2390,7 +2390,7 @@ static struct net_device_stats *happy_meal_get_stats(struct net_device *dev)
static void happy_meal_set_multicast(struct net_device *dev) static void happy_meal_set_multicast(struct net_device *dev)
{ {
struct happy_meal *hp = dev->priv; struct happy_meal *hp = dev->priv;
unsigned long bregs = hp->bigmacregs; void __iomem *bregs = hp->bigmacregs;
struct dev_mc_list *dmi = dev->mc_list; struct dev_mc_list *dmi = dev->mc_list;
char *addrs; char *addrs;
int i; int i;
...@@ -3025,7 +3025,8 @@ static int __init happy_meal_pci_init(struct pci_dev *pdev) ...@@ -3025,7 +3025,8 @@ static int __init happy_meal_pci_init(struct pci_dev *pdev)
#endif #endif
struct happy_meal *hp; struct happy_meal *hp;
struct net_device *dev; struct net_device *dev;
unsigned long hpreg_base; void __iomem *hpreg_base;
unsigned long hpreg_res;
int i, qfe_slot = -1; int i, qfe_slot = -1;
char prom_name[64]; char prom_name[64];
int err; int err;
...@@ -3084,7 +3085,7 @@ static int __init happy_meal_pci_init(struct pci_dev *pdev) ...@@ -3084,7 +3085,7 @@ static int __init happy_meal_pci_init(struct pci_dev *pdev)
qp->happy_meals[qfe_slot] = dev; qp->happy_meals[qfe_slot] = dev;
} }
hpreg_base = pci_resource_start(pdev, 0); hpreg_res = pci_resource_start(pdev, 0);
err = -ENODEV; err = -ENODEV;
if ((pci_resource_flags(pdev, 0) & IORESOURCE_IO) != 0) { if ((pci_resource_flags(pdev, 0) & IORESOURCE_IO) != 0) {
printk(KERN_ERR "happymeal(PCI): Cannot find proper PCI device base address.\n"); printk(KERN_ERR "happymeal(PCI): Cannot find proper PCI device base address.\n");
...@@ -3096,7 +3097,7 @@ static int __init happy_meal_pci_init(struct pci_dev *pdev) ...@@ -3096,7 +3097,7 @@ static int __init happy_meal_pci_init(struct pci_dev *pdev)
goto err_out_clear_quattro; goto err_out_clear_quattro;
} }
if ((hpreg_base = (unsigned long) ioremap(hpreg_base, 0x8000)) == 0) { if ((hpreg_base = ioremap(hpreg_res, 0x8000)) == 0) {
printk(KERN_ERR "happymeal(PCI): Unable to remap card memory.\n"); printk(KERN_ERR "happymeal(PCI): Unable to remap card memory.\n");
goto err_out_free_res; goto err_out_free_res;
} }
......
...@@ -397,7 +397,7 @@ struct quattro; ...@@ -397,7 +397,7 @@ struct quattro;
/* Happy happy, joy joy! */ /* Happy happy, joy joy! */
struct happy_meal { struct happy_meal {
unsigned long gregs; /* Happy meal global registers */ void __iomem *gregs; /* Happy meal global registers */
struct hmeal_init_block *happy_block; /* RX and TX descriptors (CPU addr) */ struct hmeal_init_block *happy_block; /* RX and TX descriptors (CPU addr) */
#if defined(CONFIG_SBUS) && defined(CONFIG_PCI) #if defined(CONFIG_SBUS) && defined(CONFIG_PCI)
...@@ -423,14 +423,14 @@ struct happy_meal { ...@@ -423,14 +423,14 @@ struct happy_meal {
struct net_device_stats net_stats; /* Statistical counters */ struct net_device_stats net_stats; /* Statistical counters */
#if defined(CONFIG_SBUS) && defined(CONFIG_PCI) #if defined(CONFIG_SBUS) && defined(CONFIG_PCI)
u32 (*read32)(unsigned long); u32 (*read32)(void __iomem *);
void (*write32)(unsigned long, u32); void (*write32)(void __iomem *, u32);
#endif #endif
unsigned long etxregs; /* External transmitter regs */ void __iomem *etxregs; /* External transmitter regs */
unsigned long erxregs; /* External receiver regs */ void __iomem *erxregs; /* External receiver regs */
unsigned long bigmacregs; /* BIGMAC core regs */ void __iomem *bigmacregs; /* BIGMAC core regs */
unsigned long tcvregs; /* MIF transceiver regs */ void __iomem *tcvregs; /* MIF transceiver regs */
dma_addr_t hblock_dvma; /* DVMA visible address happy block */ dma_addr_t hblock_dvma; /* DVMA visible address happy block */
unsigned int happy_flags; /* Driver state flags */ unsigned int happy_flags; /* Driver state flags */
......
...@@ -230,9 +230,9 @@ struct lance_init_block { ...@@ -230,9 +230,9 @@ struct lance_init_block {
((__u32)(((unsigned long)(&(((struct lance_init_block *)0)->rt[elem][0]))))) ((__u32)(((unsigned long)(&(((struct lance_init_block *)0)->rt[elem][0])))))
struct lance_private { struct lance_private {
unsigned long lregs; /* Lance RAP/RDP regs. */ void __iomem *lregs; /* Lance RAP/RDP regs. */
unsigned long dregs; /* DMA controller regs. */ void __iomem *dregs; /* DMA controller regs. */
volatile struct lance_init_block *init_block; struct lance_init_block *init_block;
spinlock_t lock; spinlock_t lock;
...@@ -270,7 +270,7 @@ struct lance_private { ...@@ -270,7 +270,7 @@ struct lance_private {
#define LANCE_REG_SIZE 0x04UL #define LANCE_REG_SIZE 0x04UL
#define STOP_LANCE(__lp) \ #define STOP_LANCE(__lp) \
do { unsigned long __base = (__lp)->lregs; \ do { void __iomem *__base = (__lp)->lregs; \
sbus_writew(LE_CSR0, __base + RAP); \ sbus_writew(LE_CSR0, __base + RAP); \
sbus_writew(LE_C0_STOP, __base + RDP); \ sbus_writew(LE_C0_STOP, __base + RDP); \
} while (0) } while (0)
...@@ -314,7 +314,7 @@ static void load_csrs(struct lance_private *lp) ...@@ -314,7 +314,7 @@ static void load_csrs(struct lance_private *lp)
static void lance_init_ring_dvma(struct net_device *dev) static void lance_init_ring_dvma(struct net_device *dev)
{ {
struct lance_private *lp = netdev_priv(dev); struct lance_private *lp = netdev_priv(dev);
volatile struct lance_init_block *ib = lp->init_block; struct lance_init_block *ib = lp->init_block;
dma_addr_t aib = lp->init_block_dvma; dma_addr_t aib = lp->init_block_dvma;
__u32 leptr; __u32 leptr;
int i; int i;
...@@ -371,7 +371,7 @@ static void lance_init_ring_dvma(struct net_device *dev) ...@@ -371,7 +371,7 @@ static void lance_init_ring_dvma(struct net_device *dev)
static void lance_init_ring_pio(struct net_device *dev) static void lance_init_ring_pio(struct net_device *dev)
{ {
struct lance_private *lp = netdev_priv(dev); struct lance_private *lp = netdev_priv(dev);
volatile struct lance_init_block *ib = lp->init_block; struct lance_init_block *ib = lp->init_block;
u32 leptr; u32 leptr;
int i; int i;
...@@ -501,8 +501,8 @@ static int init_restart_lance(struct lance_private *lp) ...@@ -501,8 +501,8 @@ static int init_restart_lance(struct lance_private *lp)
static void lance_rx_dvma(struct net_device *dev) static void lance_rx_dvma(struct net_device *dev)
{ {
struct lance_private *lp = netdev_priv(dev); struct lance_private *lp = netdev_priv(dev);
volatile struct lance_init_block *ib = lp->init_block; struct lance_init_block *ib = lp->init_block;
volatile struct lance_rx_desc *rd; struct lance_rx_desc *rd;
u8 bits; u8 bits;
int len, entry = lp->rx_new; int len, entry = lp->rx_new;
struct sk_buff *skb; struct sk_buff *skb;
...@@ -564,14 +564,14 @@ static void lance_rx_dvma(struct net_device *dev) ...@@ -564,14 +564,14 @@ static void lance_rx_dvma(struct net_device *dev)
static void lance_tx_dvma(struct net_device *dev) static void lance_tx_dvma(struct net_device *dev)
{ {
struct lance_private *lp = netdev_priv(dev); struct lance_private *lp = netdev_priv(dev);
volatile struct lance_init_block *ib = lp->init_block; struct lance_init_block *ib = lp->init_block;
int i, j; int i, j;
spin_lock(&lp->lock); spin_lock(&lp->lock);
j = lp->tx_old; j = lp->tx_old;
for (i = j; i != lp->tx_new; i = j) { for (i = j; i != lp->tx_new; i = j) {
volatile struct lance_tx_desc *td = &ib->btx_ring [i]; struct lance_tx_desc *td = &ib->btx_ring [i];
u8 bits = td->tmd1_bits; u8 bits = td->tmd1_bits;
/* If we hit a packet not owned by us, stop */ /* If we hit a packet not owned by us, stop */
...@@ -641,12 +641,12 @@ static void lance_tx_dvma(struct net_device *dev) ...@@ -641,12 +641,12 @@ static void lance_tx_dvma(struct net_device *dev)
spin_unlock(&lp->lock); spin_unlock(&lp->lock);
} }
static void lance_piocopy_to_skb(struct sk_buff *skb, volatile void *piobuf, int len) static void lance_piocopy_to_skb(struct sk_buff *skb, void __iomem *piobuf, int len)
{ {
u16 *p16 = (u16 *) skb->data; u16 *p16 = (u16 *) skb->data;
u32 *p32; u32 *p32;
u8 *p8; u8 *p8;
unsigned long pbuf = (unsigned long) piobuf; void __iomem *pbuf = piobuf;
/* We know here that both src and dest are on a 16bit boundary. */ /* We know here that both src and dest are on a 16bit boundary. */
*p16++ = sbus_readw(pbuf); *p16++ = sbus_readw(pbuf);
...@@ -674,8 +674,8 @@ static void lance_piocopy_to_skb(struct sk_buff *skb, volatile void *piobuf, int ...@@ -674,8 +674,8 @@ static void lance_piocopy_to_skb(struct sk_buff *skb, volatile void *piobuf, int
static void lance_rx_pio(struct net_device *dev) static void lance_rx_pio(struct net_device *dev)
{ {
struct lance_private *lp = netdev_priv(dev); struct lance_private *lp = netdev_priv(dev);
volatile struct lance_init_block *ib = lp->init_block; struct lance_init_block *ib = lp->init_block;
volatile struct lance_rx_desc *rd; struct lance_rx_desc *rd;
unsigned char bits; unsigned char bits;
int len, entry; int len, entry;
struct sk_buff *skb; struct sk_buff *skb;
...@@ -736,14 +736,14 @@ static void lance_rx_pio(struct net_device *dev) ...@@ -736,14 +736,14 @@ static void lance_rx_pio(struct net_device *dev)
static void lance_tx_pio(struct net_device *dev) static void lance_tx_pio(struct net_device *dev)
{ {
struct lance_private *lp = netdev_priv(dev); struct lance_private *lp = netdev_priv(dev);
volatile struct lance_init_block *ib = lp->init_block; struct lance_init_block *ib = lp->init_block;
int i, j; int i, j;
spin_lock(&lp->lock); spin_lock(&lp->lock);
j = lp->tx_old; j = lp->tx_old;
for (i = j; i != lp->tx_new; i = j) { for (i = j; i != lp->tx_new; i = j) {
volatile struct lance_tx_desc *td = &ib->btx_ring [i]; struct lance_tx_desc *td = &ib->btx_ring [i];
u8 bits = sbus_readb(&td->tmd1_bits); u8 bits = sbus_readb(&td->tmd1_bits);
/* If we hit a packet not owned by us, stop */ /* If we hit a packet not owned by us, stop */
...@@ -880,7 +880,7 @@ static irqreturn_t lance_interrupt(int irq, void *dev_id, struct pt_regs *regs) ...@@ -880,7 +880,7 @@ static irqreturn_t lance_interrupt(int irq, void *dev_id, struct pt_regs *regs)
static void build_fake_packet(struct lance_private *lp) static void build_fake_packet(struct lance_private *lp)
{ {
struct net_device *dev = lp->dev; struct net_device *dev = lp->dev;
volatile struct lance_init_block *ib = lp->init_block; struct lance_init_block *ib = lp->init_block;
u16 *packet; u16 *packet;
struct ethhdr *eth; struct ethhdr *eth;
int i, entry; int i, entry;
...@@ -916,7 +916,7 @@ struct net_device *last_dev; ...@@ -916,7 +916,7 @@ struct net_device *last_dev;
static int lance_open(struct net_device *dev) static int lance_open(struct net_device *dev)
{ {
struct lance_private *lp = netdev_priv(dev); struct lance_private *lp = netdev_priv(dev);
volatile struct lance_init_block *ib = lp->init_block; struct lance_init_block *ib = lp->init_block;
int status = 0; int status = 0;
last_dev = dev; last_dev = dev;
...@@ -1006,9 +1006,9 @@ static int lance_reset(struct net_device *dev) ...@@ -1006,9 +1006,9 @@ static int lance_reset(struct net_device *dev)
return status; return status;
} }
static void lance_piocopy_from_skb(volatile void *dest, unsigned char *src, int len) static void lance_piocopy_from_skb(void __iomem *dest, unsigned char *src, int len)
{ {
unsigned long piobuf = (unsigned long) dest; void __iomem *piobuf = dest;
u32 *p32; u32 *p32;
u16 *p16; u16 *p16;
u8 *p8; u8 *p8;
...@@ -1064,11 +1064,11 @@ static void lance_piocopy_from_skb(volatile void *dest, unsigned char *src, int ...@@ -1064,11 +1064,11 @@ static void lance_piocopy_from_skb(volatile void *dest, unsigned char *src, int
sbus_writeb(src[0], piobuf); sbus_writeb(src[0], piobuf);
} }
static void lance_piozero(volatile void *dest, int len) static void lance_piozero(void __iomem *dest, int len)
{ {
unsigned long piobuf = (unsigned long) dest; void __iomem *piobuf = dest;
if (piobuf & 1) { if ((unsigned long)piobuf & 1) {
sbus_writeb(0, piobuf); sbus_writeb(0, piobuf);
piobuf += 1; piobuf += 1;
len -= 1; len -= 1;
...@@ -1079,7 +1079,7 @@ static void lance_piozero(volatile void *dest, int len) ...@@ -1079,7 +1079,7 @@ static void lance_piozero(volatile void *dest, int len)
sbus_writeb(0, piobuf); sbus_writeb(0, piobuf);
return; return;
} }
if (piobuf & 2) { if ((unsigned long)piobuf & 2) {
sbus_writew(0, piobuf); sbus_writew(0, piobuf);
piobuf += 2; piobuf += 2;
len -= 2; len -= 2;
...@@ -1113,7 +1113,7 @@ static void lance_tx_timeout(struct net_device *dev) ...@@ -1113,7 +1113,7 @@ static void lance_tx_timeout(struct net_device *dev)
static int lance_start_xmit(struct sk_buff *skb, struct net_device *dev) static int lance_start_xmit(struct sk_buff *skb, struct net_device *dev)
{ {
struct lance_private *lp = netdev_priv(dev); struct lance_private *lp = netdev_priv(dev);
volatile struct lance_init_block *ib = lp->init_block; struct lance_init_block *ib = lp->init_block;
int entry, skblen, len; int entry, skblen, len;
skblen = skb->len; skblen = skb->len;
...@@ -1174,8 +1174,8 @@ static struct net_device_stats *lance_get_stats(struct net_device *dev) ...@@ -1174,8 +1174,8 @@ static struct net_device_stats *lance_get_stats(struct net_device *dev)
static void lance_load_multicast(struct net_device *dev) static void lance_load_multicast(struct net_device *dev)
{ {
struct lance_private *lp = netdev_priv(dev); struct lance_private *lp = netdev_priv(dev);
volatile struct lance_init_block *ib = lp->init_block; struct lance_init_block *ib = lp->init_block;
volatile u16 *mcast_table = (u16 *) &ib->filter; u16 *mcast_table = (u16 *) &ib->filter;
struct dev_mc_list *dmi = dev->mc_list; struct dev_mc_list *dmi = dev->mc_list;
char *addrs; char *addrs;
int i; int i;
...@@ -1224,7 +1224,7 @@ static void lance_load_multicast(struct net_device *dev) ...@@ -1224,7 +1224,7 @@ static void lance_load_multicast(struct net_device *dev)
static void lance_set_multicast(struct net_device *dev) static void lance_set_multicast(struct net_device *dev)
{ {
struct lance_private *lp = netdev_priv(dev); struct lance_private *lp = netdev_priv(dev);
volatile struct lance_init_block *ib = lp->init_block; struct lance_init_block *ib = lp->init_block;
u16 mode; u16 mode;
if (!netif_running(dev)) if (!netif_running(dev))
...@@ -1277,12 +1277,12 @@ static void lance_free_hwresources(struct lance_private *lp) ...@@ -1277,12 +1277,12 @@ static void lance_free_hwresources(struct lance_private *lp)
sbus_iounmap(lp->lregs, LANCE_REG_SIZE); sbus_iounmap(lp->lregs, LANCE_REG_SIZE);
if (lp->init_block != NULL) { if (lp->init_block != NULL) {
if (lp->pio_buffer) { if (lp->pio_buffer) {
sbus_iounmap((unsigned long)lp->init_block, sbus_iounmap(lp->init_block,
sizeof(struct lance_init_block)); sizeof(struct lance_init_block));
} else { } else {
sbus_free_consistent(lp->sdev, sbus_free_consistent(lp->sdev,
sizeof(struct lance_init_block), sizeof(struct lance_init_block),
(void *)lp->init_block, lp->init_block,
lp->init_block_dvma); lp->init_block_dvma);
} }
} }
...@@ -1349,7 +1349,7 @@ static int __init sparc_lance_init(struct sbus_dev *sdev, ...@@ -1349,7 +1349,7 @@ static int __init sparc_lance_init(struct sbus_dev *sdev,
lp->sdev = sdev; lp->sdev = sdev;
if (lebuffer) { if (lebuffer) {
lp->init_block = (volatile struct lance_init_block *) lp->init_block =
sbus_ioremap(&lebuffer->resource[0], 0, sbus_ioremap(&lebuffer->resource[0], 0,
sizeof(struct lance_init_block), "lebuffer"); sizeof(struct lance_init_block), "lebuffer");
if (lp->init_block == NULL) { if (lp->init_block == NULL) {
...@@ -1362,7 +1362,7 @@ static int __init sparc_lance_init(struct sbus_dev *sdev, ...@@ -1362,7 +1362,7 @@ static int __init sparc_lance_init(struct sbus_dev *sdev,
lp->rx = lance_rx_pio; lp->rx = lance_rx_pio;
lp->tx = lance_tx_pio; lp->tx = lance_tx_pio;
} else { } else {
lp->init_block = (volatile struct lance_init_block *) lp->init_block =
sbus_alloc_consistent(sdev, sizeof(struct lance_init_block), sbus_alloc_consistent(sdev, sizeof(struct lance_init_block),
&lp->init_block_dvma); &lp->init_block_dvma);
if (lp->init_block == NULL || if (lp->init_block == NULL ||
......
...@@ -49,7 +49,7 @@ static void qe_set_multicast(struct net_device *dev); ...@@ -49,7 +49,7 @@ static void qe_set_multicast(struct net_device *dev);
#define QEC_RESET_TRIES 200 #define QEC_RESET_TRIES 200
static inline int qec_global_reset(unsigned long gregs) static inline int qec_global_reset(void __iomem *gregs)
{ {
int tries = QEC_RESET_TRIES; int tries = QEC_RESET_TRIES;
...@@ -73,8 +73,8 @@ static inline int qec_global_reset(unsigned long gregs) ...@@ -73,8 +73,8 @@ static inline int qec_global_reset(unsigned long gregs)
static inline int qe_stop(struct sunqe *qep) static inline int qe_stop(struct sunqe *qep)
{ {
unsigned long cregs = qep->qcregs; void __iomem *cregs = qep->qcregs;
unsigned long mregs = qep->mregs; void __iomem *mregs = qep->mregs;
int tries; int tries;
/* Reset the MACE, then the QEC channel. */ /* Reset the MACE, then the QEC channel. */
...@@ -130,9 +130,9 @@ static void qe_init_rings(struct sunqe *qep) ...@@ -130,9 +130,9 @@ static void qe_init_rings(struct sunqe *qep)
static int qe_init(struct sunqe *qep, int from_irq) static int qe_init(struct sunqe *qep, int from_irq)
{ {
struct sunqec *qecp = qep->parent; struct sunqec *qecp = qep->parent;
unsigned long cregs = qep->qcregs; void __iomem *cregs = qep->qcregs;
unsigned long mregs = qep->mregs; void __iomem *mregs = qep->mregs;
unsigned long gregs = qecp->gregs; void __iomem *gregs = qecp->gregs;
unsigned char *e = &qep->dev->dev_addr[0]; unsigned char *e = &qep->dev->dev_addr[0];
u32 tmp; u32 tmp;
int i; int i;
...@@ -699,7 +699,7 @@ static void qe_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info) ...@@ -699,7 +699,7 @@ static void qe_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info)
static u32 qe_get_link(struct net_device *dev) static u32 qe_get_link(struct net_device *dev)
{ {
struct sunqe *qep = dev->priv; struct sunqe *qep = dev->priv;
unsigned long mregs = qep->mregs; void __iomem *mregs = qep->mregs;
u8 phyconfig; u8 phyconfig;
spin_lock_irq(&qep->lock); spin_lock_irq(&qep->lock);
......
...@@ -311,7 +311,7 @@ struct qe_init_block { ...@@ -311,7 +311,7 @@ struct qe_init_block {
struct sunqe; struct sunqe;
struct sunqec { struct sunqec {
unsigned long gregs; /* QEC Global Registers */ void __iomem *gregs; /* QEC Global Registers */
struct sunqe *qes[4]; /* Each child MACE */ struct sunqe *qes[4]; /* Each child MACE */
unsigned int qec_bursts; /* Support burst sizes */ unsigned int qec_bursts; /* Support burst sizes */
struct sbus_dev *qec_sdev; /* QEC's SBUS device */ struct sbus_dev *qec_sdev; /* QEC's SBUS device */
...@@ -331,8 +331,8 @@ struct sunqe_buffers { ...@@ -331,8 +331,8 @@ struct sunqe_buffers {
((__u32)((unsigned long)(&(((struct sunqe_buffers *)0)->mem[elem][0])))) ((__u32)((unsigned long)(&(((struct sunqe_buffers *)0)->mem[elem][0]))))
struct sunqe { struct sunqe {
unsigned long qcregs; /* QEC per-channel Registers */ void __iomem *qcregs; /* QEC per-channel Registers */
unsigned long mregs; /* Per-channel MACE Registers */ void __iomem *mregs; /* Per-channel MACE Registers */
struct qe_init_block *qe_block; /* RX and TX descriptors */ struct qe_init_block *qe_block; /* RX and TX descriptors */
__u32 qblock_dvma; /* RX and TX descriptors */ __u32 qblock_dvma; /* RX and TX descriptors */
spinlock_t lock; /* Protects txfull state */ spinlock_t lock; /* Protects txfull state */
......
...@@ -248,11 +248,11 @@ struct typhoon { ...@@ -248,11 +248,11 @@ struct typhoon {
/* Tx cache line section */ /* Tx cache line section */
struct transmit_ring txLoRing ____cacheline_aligned; struct transmit_ring txLoRing ____cacheline_aligned;
struct pci_dev * tx_pdev; struct pci_dev * tx_pdev;
unsigned long tx_ioaddr; void __iomem *tx_ioaddr;
u32 txlo_dma_addr; u32 txlo_dma_addr;
/* Irq/Rx cache line section */ /* Irq/Rx cache line section */
unsigned long ioaddr ____cacheline_aligned; void __iomem *ioaddr ____cacheline_aligned;
struct typhoon_indexes *indexes; struct typhoon_indexes *indexes;
u8 awaiting_resp; u8 awaiting_resp;
u8 duplex; u8 duplex;
...@@ -373,7 +373,7 @@ typhoon_inc_rx_index(u32 *index, const int count) ...@@ -373,7 +373,7 @@ typhoon_inc_rx_index(u32 *index, const int count)
} }
static int static int
typhoon_reset(unsigned long ioaddr, int wait_type) typhoon_reset(void __iomem *ioaddr, int wait_type)
{ {
int i, err = 0; int i, err = 0;
int timeout; int timeout;
...@@ -428,7 +428,7 @@ typhoon_reset(unsigned long ioaddr, int wait_type) ...@@ -428,7 +428,7 @@ typhoon_reset(unsigned long ioaddr, int wait_type)
} }
static int static int
typhoon_wait_status(unsigned long ioaddr, u32 wait_value) typhoon_wait_status(void __iomem *ioaddr, u32 wait_value)
{ {
int i, err = 0; int i, err = 0;
...@@ -1240,7 +1240,7 @@ typhoon_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) ...@@ -1240,7 +1240,7 @@ typhoon_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
} }
static int static int
typhoon_wait_interrupt(unsigned long ioaddr) typhoon_wait_interrupt(void __iomem *ioaddr)
{ {
int i, err = 0; int i, err = 0;
...@@ -1348,7 +1348,7 @@ typhoon_init_rings(struct typhoon *tp) ...@@ -1348,7 +1348,7 @@ typhoon_init_rings(struct typhoon *tp)
static int static int
typhoon_download_firmware(struct typhoon *tp) typhoon_download_firmware(struct typhoon *tp)
{ {
unsigned long ioaddr = tp->ioaddr; void __iomem *ioaddr = tp->ioaddr;
struct pci_dev *pdev = tp->pdev; struct pci_dev *pdev = tp->pdev;
struct typhoon_file_header *fHdr; struct typhoon_file_header *fHdr;
struct typhoon_section_header *sHdr; struct typhoon_section_header *sHdr;
...@@ -1497,7 +1497,7 @@ typhoon_download_firmware(struct typhoon *tp) ...@@ -1497,7 +1497,7 @@ typhoon_download_firmware(struct typhoon *tp)
static int static int
typhoon_boot_3XP(struct typhoon *tp, u32 initial_status) typhoon_boot_3XP(struct typhoon *tp, u32 initial_status)
{ {
unsigned long ioaddr = tp->ioaddr; void __iomem *ioaddr = tp->ioaddr;
if(typhoon_wait_status(ioaddr, initial_status) < 0) { if(typhoon_wait_status(ioaddr, initial_status) < 0) {
printk(KERN_ERR "%s: boot ready timeout\n", tp->name); printk(KERN_ERR "%s: boot ready timeout\n", tp->name);
...@@ -1812,7 +1812,8 @@ static irqreturn_t ...@@ -1812,7 +1812,8 @@ static irqreturn_t
typhoon_interrupt(int irq, void *dev_instance, struct pt_regs *rgs) typhoon_interrupt(int irq, void *dev_instance, struct pt_regs *rgs)
{ {
struct net_device *dev = (struct net_device *) dev_instance; struct net_device *dev = (struct net_device *) dev_instance;
unsigned long ioaddr = dev->base_addr; struct typhoon *tp = dev->priv;
void __iomem *ioaddr = tp->ioaddr;
u32 intr_status; u32 intr_status;
intr_status = readl(ioaddr + TYPHOON_REG_INTR_STATUS); intr_status = readl(ioaddr + TYPHOON_REG_INTR_STATUS);
...@@ -1852,7 +1853,7 @@ static int ...@@ -1852,7 +1853,7 @@ static int
typhoon_sleep(struct typhoon *tp, int state, u16 events) typhoon_sleep(struct typhoon *tp, int state, u16 events)
{ {
struct pci_dev *pdev = tp->pdev; struct pci_dev *pdev = tp->pdev;
unsigned long ioaddr = tp->ioaddr; void __iomem *ioaddr = tp->ioaddr;
struct cmd_desc xp_cmd; struct cmd_desc xp_cmd;
int err; int err;
...@@ -1890,7 +1891,7 @@ static int ...@@ -1890,7 +1891,7 @@ static int
typhoon_wakeup(struct typhoon *tp, int wait_type) typhoon_wakeup(struct typhoon *tp, int wait_type)
{ {
struct pci_dev *pdev = tp->pdev; struct pci_dev *pdev = tp->pdev;
unsigned long ioaddr = tp->ioaddr; void __iomem *ioaddr = tp->ioaddr;
pci_set_power_state(pdev, 0); pci_set_power_state(pdev, 0);
pci_restore_state(pdev, tp->pci_state); pci_restore_state(pdev, tp->pci_state);
...@@ -1911,7 +1912,7 @@ static int ...@@ -1911,7 +1912,7 @@ static int
typhoon_start_runtime(struct typhoon *tp) typhoon_start_runtime(struct typhoon *tp)
{ {
struct net_device *dev = tp->dev; struct net_device *dev = tp->dev;
unsigned long ioaddr = tp->ioaddr; void __iomem *ioaddr = tp->ioaddr;
struct cmd_desc xp_cmd; struct cmd_desc xp_cmd;
int err; int err;
...@@ -2006,7 +2007,7 @@ typhoon_stop_runtime(struct typhoon *tp, int wait_type) ...@@ -2006,7 +2007,7 @@ typhoon_stop_runtime(struct typhoon *tp, int wait_type)
{ {
struct typhoon_indexes *indexes = tp->indexes; struct typhoon_indexes *indexes = tp->indexes;
struct transmit_ring *txLo = &tp->txLoRing; struct transmit_ring *txLo = &tp->txLoRing;
unsigned long ioaddr = tp->ioaddr; void __iomem *ioaddr = tp->ioaddr;
struct cmd_desc xp_cmd; struct cmd_desc xp_cmd;
int i; int i;
...@@ -2070,7 +2071,7 @@ typhoon_tx_timeout(struct net_device *dev) ...@@ -2070,7 +2071,7 @@ typhoon_tx_timeout(struct net_device *dev)
{ {
struct typhoon *tp = (struct typhoon *) dev->priv; struct typhoon *tp = (struct typhoon *) dev->priv;
if(typhoon_reset(dev->base_addr, WaitNoSleep) < 0) { if(typhoon_reset(tp->ioaddr, WaitNoSleep) < 0) {
printk(KERN_WARNING "%s: could not reset in tx timeout\n", printk(KERN_WARNING "%s: could not reset in tx timeout\n",
dev->name); dev->name);
goto truely_dead; goto truely_dead;
...@@ -2091,7 +2092,7 @@ typhoon_tx_timeout(struct net_device *dev) ...@@ -2091,7 +2092,7 @@ typhoon_tx_timeout(struct net_device *dev)
truely_dead: truely_dead:
/* Reset the hardware, and turn off carrier to avoid more timeouts */ /* Reset the hardware, and turn off carrier to avoid more timeouts */
typhoon_reset(dev->base_addr, NoWait); typhoon_reset(tp->ioaddr, NoWait);
netif_carrier_off(dev); netif_carrier_off(dev);
} }
...@@ -2126,7 +2127,7 @@ typhoon_open(struct net_device *dev) ...@@ -2126,7 +2127,7 @@ typhoon_open(struct net_device *dev)
if(typhoon_boot_3XP(tp, TYPHOON_STATUS_WAITING_FOR_HOST) < 0) { if(typhoon_boot_3XP(tp, TYPHOON_STATUS_WAITING_FOR_HOST) < 0) {
printk(KERN_ERR "%s: unable to reboot into sleep img\n", printk(KERN_ERR "%s: unable to reboot into sleep img\n",
dev->name); dev->name);
typhoon_reset(dev->base_addr, NoWait); typhoon_reset(tp->ioaddr, NoWait);
goto out; goto out;
} }
...@@ -2192,7 +2193,7 @@ typhoon_resume(struct pci_dev *pdev) ...@@ -2192,7 +2193,7 @@ typhoon_resume(struct pci_dev *pdev)
return 0; return 0;
reset: reset:
typhoon_reset(dev->base_addr, NoWait); typhoon_reset(tp->ioaddr, NoWait);
return -EBUSY; return -EBUSY;
} }
...@@ -2276,6 +2277,7 @@ typhoon_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -2276,6 +2277,7 @@ typhoon_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
struct typhoon *tp; struct typhoon *tp;
int card_id = (int) ent->driver_data; int card_id = (int) ent->driver_data;
unsigned long ioaddr; unsigned long ioaddr;
void __iomem *ioaddr_mapped;
void *shared; void *shared;
dma_addr_t shared_dma; dma_addr_t shared_dma;
struct cmd_desc xp_cmd; struct cmd_desc xp_cmd;
...@@ -2345,14 +2347,13 @@ typhoon_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -2345,14 +2347,13 @@ typhoon_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
/* map our MMIO region /* map our MMIO region
*/ */
ioaddr = pci_resource_start(pdev, 1); ioaddr = pci_resource_start(pdev, 1);
ioaddr = (unsigned long) ioremap(ioaddr, 128); ioaddr_mapped = ioremap(ioaddr, 128);
if(!ioaddr) { if (!ioaddr_mapped) {
printk(ERR_PFX "%s: cannot remap MMIO, aborting\n", printk(ERR_PFX "%s: cannot remap MMIO, aborting\n",
pci_name(pdev)); pci_name(pdev));
err = -EIO; err = -EIO;
goto error_out_regions; goto error_out_regions;
} }
dev->base_addr = ioaddr;
/* allocate pci dma space for rx and tx descriptor rings /* allocate pci dma space for rx and tx descriptor rings
*/ */
...@@ -2371,8 +2372,8 @@ typhoon_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -2371,8 +2372,8 @@ typhoon_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
tp->shared_dma = shared_dma; tp->shared_dma = shared_dma;
tp->pdev = pdev; tp->pdev = pdev;
tp->tx_pdev = pdev; tp->tx_pdev = pdev;
tp->ioaddr = dev->base_addr; tp->ioaddr = ioaddr_mapped;
tp->tx_ioaddr = dev->base_addr; tp->tx_ioaddr = ioaddr_mapped;
tp->dev = dev; tp->dev = dev;
/* need to be able to restore PCI state after a suspend */ /* need to be able to restore PCI state after a suspend */
...@@ -2385,7 +2386,7 @@ typhoon_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -2385,7 +2386,7 @@ typhoon_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
* 4) Get the hardware address. * 4) Get the hardware address.
* 5) Put the card to sleep. * 5) Put the card to sleep.
*/ */
if(typhoon_reset(ioaddr, WaitSleep) < 0) { if (typhoon_reset(ioaddr_mapped, WaitSleep) < 0) {
printk(ERR_PFX "%s: could not reset 3XP\n", pci_name(pdev)); printk(ERR_PFX "%s: could not reset 3XP\n", pci_name(pdev));
err = -EIO; err = -EIO;
goto error_out_dma; goto error_out_dma;
...@@ -2518,13 +2519,13 @@ typhoon_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -2518,13 +2519,13 @@ typhoon_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
return 0; return 0;
error_out_reset: error_out_reset:
typhoon_reset(ioaddr, NoWait); typhoon_reset(ioaddr_mapped, NoWait);
error_out_dma: error_out_dma:
pci_free_consistent(pdev, sizeof(struct typhoon_shared), pci_free_consistent(pdev, sizeof(struct typhoon_shared),
shared, shared_dma); shared, shared_dma);
error_out_remap: error_out_remap:
iounmap((void *) ioaddr); iounmap(ioaddr_mapped);
error_out_regions: error_out_regions:
pci_release_regions(pdev); pci_release_regions(pdev);
error_out_dev: error_out_dev:
...@@ -2542,8 +2543,8 @@ typhoon_remove_one(struct pci_dev *pdev) ...@@ -2542,8 +2543,8 @@ typhoon_remove_one(struct pci_dev *pdev)
unregister_netdev(dev); unregister_netdev(dev);
pci_set_power_state(pdev, 0); pci_set_power_state(pdev, 0);
pci_restore_state(pdev, tp->pci_state); pci_restore_state(pdev, tp->pci_state);
typhoon_reset(dev->base_addr, NoWait); typhoon_reset(tp->ioaddr, NoWait);
iounmap((char *) (dev->base_addr)); iounmap(tp->ioaddr);
pci_free_consistent(pdev, sizeof(struct typhoon_shared), pci_free_consistent(pdev, sizeof(struct typhoon_shared),
tp->shared, tp->shared_dma); tp->shared, tp->shared_dma);
pci_release_regions(pdev); pci_release_regions(pdev);
......
...@@ -118,32 +118,18 @@ ...@@ -118,32 +118,18 @@
* UNKNOWN, MAGICAL MYSTERY REGISTER * UNKNOWN, MAGICAL MYSTERY REGISTER
* *
*/ */
struct wd_timer_regblk { #define WD_TIMER_REGSZ 16
volatile __u16 dcntr; /* down counter - hw */ #define WD0_OFF 0
volatile __u16 dcntr_pad; #define WD1_OFF (WD_TIMER_REGSZ * 1)
volatile __u16 limit; /* limit register - hw */ #define WD2_OFF (WD_TIMER_REGSZ * 2)
volatile __u16 limit_pad; #define PLD_OFF (WD_TIMER_REGSZ * 3)
volatile __u8 status; /* status register - b */
volatile __u8 status_pad;
volatile __u16 status_pad2;
volatile __u32 pad32; /* yet more padding */
};
struct wd_pld_regblk { #define WD_DCNTR 0x00
volatile __u8 intr_mask; /* interrupt mask - b */ #define WD_LIMIT 0x04
volatile __u8 intr_mask_pad; #define WD_STATUS 0x08
volatile __u16 intr_mask_pad2;
volatile __u8 status; /* device status - b */
volatile __u8 status_pad;
volatile __u16 status_pad2;
};
struct wd_regblk { #define PLD_IMASK (PLD_OFF + 0x00)
volatile struct wd_timer_regblk wd0_regs; #define PLD_STATUS (PLD_OFF + 0x04)
volatile struct wd_timer_regblk wd1_regs;
volatile struct wd_timer_regblk wd2_regs;
volatile struct wd_pld_regblk pld_regs;
};
/* Individual timer structure /* Individual timer structure
*/ */
...@@ -151,7 +137,7 @@ struct wd_timer { ...@@ -151,7 +137,7 @@ struct wd_timer {
__u16 timeout; __u16 timeout;
__u8 intr_mask; __u8 intr_mask;
unsigned char runstatus; unsigned char runstatus;
volatile struct wd_timer_regblk* regs; void __iomem *regs;
}; };
/* Device structure /* Device structure
...@@ -165,7 +151,7 @@ struct wd_device { ...@@ -165,7 +151,7 @@ struct wd_device {
unsigned short opt_timeout; unsigned short opt_timeout;
unsigned char initialized; unsigned char initialized;
struct wd_timer watchdog[WD_NUMDEVS]; struct wd_timer watchdog[WD_NUMDEVS];
volatile struct wd_regblk* regs; void __iomem *regs;
}; };
static struct wd_device wd_dev = { static struct wd_device wd_dev = {
...@@ -495,12 +481,12 @@ static void wd_dumpregs(void) ...@@ -495,12 +481,12 @@ static void wd_dumpregs(void)
i, i,
wd_getstatus(&wd_dev.watchdog[i])); wd_getstatus(&wd_dev.watchdog[i]));
} }
printk("\tintr_mask at 0x%lx: 0x%x\n", printk("\tintr_mask at %p: 0x%x\n",
(unsigned long)(&wd_dev.regs->pld_regs.intr_mask), wd_dev.regs + PLD_IMASK,
readb(&wd_dev.regs->pld_regs.intr_mask)); readb(wd_dev.regs + PLD_IMASK));
printk("\tpld_status at 0x%lx: 0x%x\n", printk("\tpld_status at %p: 0x%x\n",
(unsigned long)(&wd_dev.regs->pld_regs.status), wd_dev.regs + PLD_STATUS,
readb(&wd_dev.regs->pld_regs.status)); readb(wd_dev.regs + PLD_STATUS));
} }
#endif #endif
...@@ -513,7 +499,7 @@ static void wd_dumpregs(void) ...@@ -513,7 +499,7 @@ static void wd_dumpregs(void)
*/ */
static void wd_toggleintr(struct wd_timer* pTimer, int enable) static void wd_toggleintr(struct wd_timer* pTimer, int enable)
{ {
unsigned char curregs = wd_readb(&wd_dev.regs->pld_regs.intr_mask); unsigned char curregs = wd_readb(wd_dev.regs + PLD_IMASK);
unsigned char setregs = unsigned char setregs =
(NULL == pTimer) ? (NULL == pTimer) ?
(WD0_INTR_MASK | WD1_INTR_MASK | WD2_INTR_MASK) : (WD0_INTR_MASK | WD1_INTR_MASK | WD2_INTR_MASK) :
...@@ -523,7 +509,7 @@ static void wd_toggleintr(struct wd_timer* pTimer, int enable) ...@@ -523,7 +509,7 @@ static void wd_toggleintr(struct wd_timer* pTimer, int enable)
(curregs &= ~setregs): (curregs &= ~setregs):
(curregs |= setregs); (curregs |= setregs);
wd_writeb(curregs, &wd_dev.regs->pld_regs.intr_mask); wd_writeb(curregs, wd_dev.regs + PLD_IMASK);
return; return;
} }
...@@ -534,8 +520,8 @@ static void wd_toggleintr(struct wd_timer* pTimer, int enable) ...@@ -534,8 +520,8 @@ static void wd_toggleintr(struct wd_timer* pTimer, int enable)
*/ */
static void wd_pingtimer(struct wd_timer* pTimer) static void wd_pingtimer(struct wd_timer* pTimer)
{ {
if(wd_readb(&pTimer->regs->status) & WD_S_RUNNING) { if (wd_readb(pTimer->regs + WD_STATUS) & WD_S_RUNNING) {
wd_readw(&pTimer->regs->dcntr); wd_readw(pTimer->regs + WD_DCNTR);
} }
} }
...@@ -547,7 +533,7 @@ static void wd_pingtimer(struct wd_timer* pTimer) ...@@ -547,7 +533,7 @@ static void wd_pingtimer(struct wd_timer* pTimer)
*/ */
static void wd_stoptimer(struct wd_timer* pTimer) static void wd_stoptimer(struct wd_timer* pTimer)
{ {
if(wd_readb(&pTimer->regs->status) & WD_S_RUNNING) { if(wd_readb(pTimer->regs + WD_STATUS) & WD_S_RUNNING) {
wd_toggleintr(pTimer, WD_INTR_OFF); wd_toggleintr(pTimer, WD_INTR_OFF);
if(wd_dev.isbaddoggie) { if(wd_dev.isbaddoggie) {
...@@ -574,7 +560,7 @@ static void wd_starttimer(struct wd_timer* pTimer) ...@@ -574,7 +560,7 @@ static void wd_starttimer(struct wd_timer* pTimer)
} }
pTimer->runstatus &= ~WD_STAT_SVCD; pTimer->runstatus &= ~WD_STAT_SVCD;
wd_writew(pTimer->timeout, &pTimer->regs->limit); wd_writew(pTimer->timeout, pTimer->regs + WD_LIMIT);
wd_toggleintr(pTimer, WD_INTR_ON); wd_toggleintr(pTimer, WD_INTR_ON);
} }
...@@ -584,7 +570,7 @@ static void wd_starttimer(struct wd_timer* pTimer) ...@@ -584,7 +570,7 @@ static void wd_starttimer(struct wd_timer* pTimer)
static void wd_resetbrokentimer(struct wd_timer* pTimer) static void wd_resetbrokentimer(struct wd_timer* pTimer)
{ {
wd_toggleintr(pTimer, WD_INTR_ON); wd_toggleintr(pTimer, WD_INTR_ON);
wd_writew(WD_BLIMIT, &pTimer->regs->limit); wd_writew(WD_BLIMIT, pTimer->regs + WD_LIMIT);
} }
/* Timer device initialization helper. /* Timer device initialization helper.
...@@ -593,7 +579,7 @@ static void wd_resetbrokentimer(struct wd_timer* pTimer) ...@@ -593,7 +579,7 @@ static void wd_resetbrokentimer(struct wd_timer* pTimer)
static int wd_inittimer(int whichdog) static int wd_inittimer(int whichdog)
{ {
struct miscdevice *whichmisc; struct miscdevice *whichmisc;
volatile struct wd_timer_regblk *whichregs; void __iomem *whichregs;
char whichident[8]; char whichident[8];
int whichmask; int whichmask;
__u16 whichlimit; __u16 whichlimit;
...@@ -603,7 +589,7 @@ static int wd_inittimer(int whichdog) ...@@ -603,7 +589,7 @@ static int wd_inittimer(int whichdog)
case WD0_ID: case WD0_ID:
whichmisc = &wd0_miscdev; whichmisc = &wd0_miscdev;
strcpy(whichident, "RIC"); strcpy(whichident, "RIC");
whichregs = &wd_dev.regs->wd0_regs; whichregs = wd_dev.regs + WD0_OFF;
whichmask = WD0_INTR_MASK; whichmask = WD0_INTR_MASK;
whichlimit= (0 == wd0_timeout) ? whichlimit= (0 == wd0_timeout) ?
(wd_dev.opt_timeout): (wd_dev.opt_timeout):
...@@ -612,7 +598,7 @@ static int wd_inittimer(int whichdog) ...@@ -612,7 +598,7 @@ static int wd_inittimer(int whichdog)
case WD1_ID: case WD1_ID:
whichmisc = &wd1_miscdev; whichmisc = &wd1_miscdev;
strcpy(whichident, "XIR"); strcpy(whichident, "XIR");
whichregs = &wd_dev.regs->wd1_regs; whichregs = wd_dev.regs + WD1_OFF;
whichmask = WD1_INTR_MASK; whichmask = WD1_INTR_MASK;
whichlimit= (0 == wd1_timeout) ? whichlimit= (0 == wd1_timeout) ?
(wd_dev.opt_timeout): (wd_dev.opt_timeout):
...@@ -621,7 +607,7 @@ static int wd_inittimer(int whichdog) ...@@ -621,7 +607,7 @@ static int wd_inittimer(int whichdog)
case WD2_ID: case WD2_ID:
whichmisc = &wd2_miscdev; whichmisc = &wd2_miscdev;
strcpy(whichident, "POR"); strcpy(whichident, "POR");
whichregs = &wd_dev.regs->wd2_regs; whichregs = wd_dev.regs + WD2_OFF;
whichmask = WD2_INTR_MASK; whichmask = WD2_INTR_MASK;
whichlimit= (0 == wd2_timeout) ? whichlimit= (0 == wd2_timeout) ?
(wd_dev.opt_timeout): (wd_dev.opt_timeout):
...@@ -686,8 +672,8 @@ static void wd_brokentimer(unsigned long data) ...@@ -686,8 +672,8 @@ static void wd_brokentimer(unsigned long data)
static int wd_getstatus(struct wd_timer* pTimer) static int wd_getstatus(struct wd_timer* pTimer)
{ {
unsigned char stat = wd_readb(&pTimer->regs->status); unsigned char stat = wd_readb(pTimer->regs + WD_STATUS);
unsigned char intr = wd_readb(&wd_dev.regs->pld_regs.intr_mask); unsigned char intr = wd_readb(wd_dev.regs + PLD_IMASK);
unsigned char ret = WD_STOPPED; unsigned char ret = WD_STOPPED;
/* determine STOPPED */ /* determine STOPPED */
...@@ -805,7 +791,7 @@ static void __exit wd_cleanup(void) ...@@ -805,7 +791,7 @@ static void __exit wd_cleanup(void)
* also now eventually trip. * also now eventually trip.
*/ */
for(id = WD0_ID; id < WD_NUMDEVS; ++id) { for(id = WD0_ID; id < WD_NUMDEVS; ++id) {
if(WD_S_RUNNING == wd_readb(&wd_dev.watchdog[id].regs->status)) { if(WD_S_RUNNING == wd_readb(wd_dev.watchdog[id].regs + WD_STATUS)) {
if(wd_dev.opt_enable) { if(wd_dev.opt_enable) {
printk(KERN_WARNING "%s%i: timer not stopped at release\n", printk(KERN_WARNING "%s%i: timer not stopped at release\n",
WD_OBPNAME, id); WD_OBPNAME, id);
...@@ -818,7 +804,7 @@ static void __exit wd_cleanup(void) ...@@ -818,7 +804,7 @@ static void __exit wd_cleanup(void)
"%s%i: defect workaround disabled at release, "\ "%s%i: defect workaround disabled at release, "\
"timer expires in ~%01i sec\n", "timer expires in ~%01i sec\n",
WD_OBPNAME, id, WD_OBPNAME, id,
wd_readw(&wd_dev.watchdog[id].regs->limit) / 10); wd_readw(wd_dev.watchdog[id].regs + WD_LIMIT) / 10);
} }
} }
} }
......
...@@ -70,7 +70,7 @@ MODULE_SUPPORTED_DEVICE ...@@ -70,7 +70,7 @@ MODULE_SUPPORTED_DEVICE
* FLIP - Inverts display for upside-down mounted board * FLIP - Inverts display for upside-down mounted board
* bits 0-4 - 7-segment display contents * bits 0-4 - 7-segment display contents
*/ */
volatile u8* d7s_regs = NULL; static void __iomem* d7s_regs;
static inline void d7s_free(void) static inline void d7s_free(void)
{ {
......
...@@ -130,10 +130,8 @@ static int errno; ...@@ -130,10 +130,8 @@ static int errno;
*/ */
#define ENVCTRL_CPCI_IGNORED_NODE 0x70 #define ENVCTRL_CPCI_IGNORED_NODE 0x70
struct pcf8584_reg { #define PCF8584_DATA 0x00
unsigned char data; #define PCF8584_CSR 0x01
unsigned char csr;
};
/* Each child device can be monitored by up to PCF8584_MAX_CHANNELS. /* Each child device can be monitored by up to PCF8584_MAX_CHANNELS.
* Property of a port or channel as defined by the firmware. * Property of a port or channel as defined by the firmware.
...@@ -175,7 +173,7 @@ struct i2c_child_t { ...@@ -175,7 +173,7 @@ struct i2c_child_t {
char mon_type[PCF8584_MAX_CHANNELS]; char mon_type[PCF8584_MAX_CHANNELS];
}; };
volatile static struct pcf8584_reg *i2c = NULL; static void __iomem *i2c;
static struct i2c_child_t i2c_childlist[ENVCTRL_MAX_CPU*2]; static struct i2c_child_t i2c_childlist[ENVCTRL_MAX_CPU*2];
static unsigned char chnls_mask[] = { 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80 }; static unsigned char chnls_mask[] = { 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80 };
static unsigned int warning_temperature = 0; static unsigned int warning_temperature = 0;
...@@ -185,22 +183,6 @@ static char read_cpu; ...@@ -185,22 +183,6 @@ static char read_cpu;
/* Forward declarations. */ /* Forward declarations. */
static struct i2c_child_t *envctrl_get_i2c_child(unsigned char); static struct i2c_child_t *envctrl_get_i2c_child(unsigned char);
/* Function description: Read a byte from an i2c controller register.
* Return: A byte from the passed in address.
*/
static inline unsigned char envctrl_readb(volatile unsigned char *p)
{
return readb(p);
}
/* Function description: Write a byte to an i2c controller register.
* Return: Nothing.
*/
static inline void envctrl_writeb(unsigned char val, volatile unsigned char *p)
{
writeb(val, p);
}
/* Function Description: Test the PIN bit (Pending Interrupt Not) /* Function Description: Test the PIN bit (Pending Interrupt Not)
* to test when serial transmission is completed . * to test when serial transmission is completed .
* Return : None. * Return : None.
...@@ -210,7 +192,7 @@ static void envtrl_i2c_test_pin(void) ...@@ -210,7 +192,7 @@ static void envtrl_i2c_test_pin(void)
int limit = 1000000; int limit = 1000000;
while (--limit > 0) { while (--limit > 0) {
if (!(envctrl_readb(&i2c->csr) & STATUS_PIN)) if (!(readb(i2c + PCF8584_CSR) & STATUS_PIN))
break; break;
udelay(1); udelay(1);
} }
...@@ -228,7 +210,7 @@ static void envctrl_i2c_test_bb(void) ...@@ -228,7 +210,7 @@ static void envctrl_i2c_test_bb(void)
while (--limit > 0) { while (--limit > 0) {
/* Busy bit 0 means busy. */ /* Busy bit 0 means busy. */
if (envctrl_readb(&i2c->csr) & STATUS_BB) if (readb(i2c + PCF8584_CSR) & STATUS_BB)
break; break;
udelay(1); udelay(1);
} }
...@@ -245,20 +227,20 @@ static int envctrl_i2c_read_addr(unsigned char addr) ...@@ -245,20 +227,20 @@ static int envctrl_i2c_read_addr(unsigned char addr)
envctrl_i2c_test_bb(); envctrl_i2c_test_bb();
/* Load address. */ /* Load address. */
envctrl_writeb(addr + 1, &i2c->data); writeb(addr + 1, i2c + PCF8584_DATA);
envctrl_i2c_test_bb(); envctrl_i2c_test_bb();
envctrl_writeb(OBD_SEND_START, &i2c->csr); writeb(OBD_SEND_START, i2c + PCF8584_CSR);
/* Wait for PIN. */ /* Wait for PIN. */
envtrl_i2c_test_pin(); envtrl_i2c_test_pin();
/* CSR 0 means acknowledged. */ /* CSR 0 means acknowledged. */
if (!(envctrl_readb(&i2c->csr) & STATUS_LRB)) { if (!(readb(i2c + PCF8584_CSR) & STATUS_LRB)) {
return envctrl_readb(&i2c->data); return readb(i2c + PCF8584_DATA);
} else { } else {
envctrl_writeb(OBD_SEND_STOP, &i2c->csr); writeb(OBD_SEND_STOP, i2c + PCF8584_CSR);
return 0; return 0;
} }
} }
...@@ -269,10 +251,10 @@ static int envctrl_i2c_read_addr(unsigned char addr) ...@@ -269,10 +251,10 @@ static int envctrl_i2c_read_addr(unsigned char addr)
static void envctrl_i2c_write_addr(unsigned char addr) static void envctrl_i2c_write_addr(unsigned char addr)
{ {
envctrl_i2c_test_bb(); envctrl_i2c_test_bb();
envctrl_writeb(addr, &i2c->data); writeb(addr, i2c + PCF8584_DATA);
/* Generate Start condition. */ /* Generate Start condition. */
envctrl_writeb(OBD_SEND_START, &i2c->csr); writeb(OBD_SEND_START, i2c + PCF8584_CSR);
} }
/* Function Description: Read 1 byte of data from addr /* Function Description: Read 1 byte of data from addr
...@@ -282,8 +264,8 @@ static void envctrl_i2c_write_addr(unsigned char addr) ...@@ -282,8 +264,8 @@ static void envctrl_i2c_write_addr(unsigned char addr)
static unsigned char envctrl_i2c_read_data(void) static unsigned char envctrl_i2c_read_data(void)
{ {
envtrl_i2c_test_pin(); envtrl_i2c_test_pin();
envctrl_writeb(CONTROL_ES0, &i2c->csr); /* Send neg ack. */ writeb(CONTROL_ES0, i2c + PCF8584_CSR); /* Send neg ack. */
return envctrl_readb(&i2c->data); return readb(i2c + PCF8584_DATA);
} }
/* Function Description: Instruct the device which port to read data from. /* Function Description: Instruct the device which port to read data from.
...@@ -292,7 +274,7 @@ static unsigned char envctrl_i2c_read_data(void) ...@@ -292,7 +274,7 @@ static unsigned char envctrl_i2c_read_data(void)
static void envctrl_i2c_write_data(unsigned char port) static void envctrl_i2c_write_data(unsigned char port)
{ {
envtrl_i2c_test_pin(); envtrl_i2c_test_pin();
envctrl_writeb(port, &i2c->data); writeb(port, i2c + PCF8584_DATA);
} }
/* Function Description: Generate Stop condition after last byte is sent. /* Function Description: Generate Stop condition after last byte is sent.
...@@ -301,7 +283,7 @@ static void envctrl_i2c_write_data(unsigned char port) ...@@ -301,7 +283,7 @@ static void envctrl_i2c_write_data(unsigned char port)
static void envctrl_i2c_stop(void) static void envctrl_i2c_stop(void)
{ {
envtrl_i2c_test_pin(); envtrl_i2c_test_pin();
envctrl_writeb(OBD_SEND_STOP, &i2c->csr); writeb(OBD_SEND_STOP, i2c + PCF8584_CSR);
} }
/* Function Description: Read adc device. /* Function Description: Read adc device.
...@@ -323,7 +305,7 @@ static unsigned char envctrl_i2c_read_8591(unsigned char addr, unsigned char por ...@@ -323,7 +305,7 @@ static unsigned char envctrl_i2c_read_8591(unsigned char addr, unsigned char por
envctrl_i2c_read_data(); envctrl_i2c_read_data();
envctrl_i2c_stop(); envctrl_i2c_stop();
return envctrl_readb(&i2c->data); return readb(i2c + PCF8584_DATA);
} }
/* Function Description: Read gpio device. /* Function Description: Read gpio device.
...@@ -1084,8 +1066,7 @@ static int __init envctrl_init(void) ...@@ -1084,8 +1066,7 @@ static int __init envctrl_init(void)
for_each_ebus(ebus) { for_each_ebus(ebus) {
for_each_ebusdev(edev, ebus) { for_each_ebusdev(edev, ebus) {
if (!strcmp(edev->prom_name, "i2c")) { if (!strcmp(edev->prom_name, "i2c")) {
i2c = ioremap( edev->resource[0].start, i2c = ioremap(edev->resource[0].start, 0x2);
sizeof(struct pcf8584_reg));
for_each_edevchild(edev, edev_child) { for_each_edevchild(edev, edev_child) {
if (!strcmp("gpio", edev_child->prom_name)) { if (!strcmp("gpio", edev_child->prom_name)) {
i2c_childlist[i].i2ctype = I2C_GPIO; i2c_childlist[i].i2ctype = I2C_GPIO;
...@@ -1108,15 +1089,15 @@ static int __init envctrl_init(void) ...@@ -1108,15 +1089,15 @@ static int __init envctrl_init(void)
} }
/* Set device address. */ /* Set device address. */
envctrl_writeb(CONTROL_PIN, &i2c->csr); writeb(CONTROL_PIN, i2c + PCF8584_CSR);
envctrl_writeb(PCF8584_ADDRESS, &i2c->data); writeb(PCF8584_ADDRESS, i2c + PCF8584_DATA);
/* Set system clock and SCL frequencies. */ /* Set system clock and SCL frequencies. */
envctrl_writeb(CONTROL_PIN | CONTROL_ES1, &i2c->csr); writeb(CONTROL_PIN | CONTROL_ES1, i2c + PCF8584_CSR);
envctrl_writeb(CLK_4_43 | BUS_CLK_90, &i2c->data); writeb(CLK_4_43 | BUS_CLK_90, i2c + PCF8584_DATA);
/* Enable serial interface. */ /* Enable serial interface. */
envctrl_writeb(CONTROL_PIN | CONTROL_ES0 | CONTROL_ACK, &i2c->csr); writeb(CONTROL_PIN | CONTROL_ES0 | CONTROL_ACK, i2c + PCF8584_CSR);
udelay(200); udelay(200);
/* Register the device as a minor miscellaneous device. */ /* Register the device as a minor miscellaneous device. */
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
#include <asm/io.h> #include <asm/io.h>
#include <asm/sbus.h> #include <asm/sbus.h>
#include <asm/ebus.h> #include <asm/ebus.h>
#include <asm/upa.h>
static spinlock_t flash_lock = SPIN_LOCK_UNLOCKED; static spinlock_t flash_lock = SPIN_LOCK_UNLOCKED;
static struct { static struct {
...@@ -115,7 +116,7 @@ flash_read(struct file * file, char __user * buf, ...@@ -115,7 +116,7 @@ flash_read(struct file * file, char __user * buf,
count = flash.read_size - p; count = flash.read_size - p;
for (i = 0; i < count; i++) { for (i = 0; i < count; i++) {
u8 data = readb(flash.read_base + p + i); u8 data = upa_readb(flash.read_base + p + i);
if (put_user(data, buf)) if (put_user(data, buf))
return -EFAULT; return -EFAULT;
buf++; buf++;
......
...@@ -17,14 +17,6 @@ ...@@ -17,14 +17,6 @@
struct sbus_dma *dma_chain; struct sbus_dma *dma_chain;
/* Print out the current values in the DMA control registers */
extern __inline__ void dump_dma_regs(unsigned long dregs)
{
printk("DMA CONTROL<%08x> ADDR<%08x> CNT<%08x> TEST<%08x>\n",
sbus_readl(dregs + DMA_CSR), sbus_readl(dregs + DMA_ADDR),
sbus_readl(dregs + DMA_COUNT), sbus_readl(dregs + DMA_TEST));
}
void __init init_one_dvma(struct sbus_dma *dma, int num_dma) void __init init_one_dvma(struct sbus_dma *dma, int num_dma)
{ {
printk("dma%d: ", num_dma); printk("dma%d: ", num_dma);
...@@ -64,9 +56,6 @@ void __init init_one_dvma(struct sbus_dma *dma, int num_dma) ...@@ -64,9 +56,6 @@ void __init init_one_dvma(struct sbus_dma *dma, int num_dma)
break; break;
} }
printk("\n"); printk("\n");
#if 0 /* Clutters up the screen */
dump_dma_regs(dma->regs);
#endif
} }
/* Probe this SBus DMA module(s) */ /* Probe this SBus DMA module(s) */
......
...@@ -77,8 +77,8 @@ struct scsi_cmnd; ...@@ -77,8 +77,8 @@ struct scsi_cmnd;
/* We get one of these for each ESP probed. */ /* We get one of these for each ESP probed. */
struct esp { struct esp {
unsigned long eregs; /* ESP controller registers */ void __iomem *eregs; /* ESP controller registers */
unsigned long dregs; /* DMA controller registers */ void __iomem *dregs; /* DMA controller registers */
struct sbus_dma *dma; /* DMA controller sw state */ struct sbus_dma *dma; /* DMA controller sw state */
struct Scsi_Host *ehost; /* Backpointer to SCSI Host */ struct Scsi_Host *ehost; /* Backpointer to SCSI Host */
struct sbus_dev *sdev; /* Pointer to SBus entry */ struct sbus_dev *sdev; /* Pointer to SBus entry */
......
...@@ -987,7 +987,7 @@ const char *qlogicpti_info(struct Scsi_Host *host) ...@@ -987,7 +987,7 @@ const char *qlogicpti_info(struct Scsi_Host *host)
static char buf[80]; static char buf[80];
struct qlogicpti *qpti = (struct qlogicpti *) host->hostdata; struct qlogicpti *qpti = (struct qlogicpti *) host->hostdata;
sprintf(buf, "PTI Qlogic,ISP SBUS SCSI irq %s regs at %lx", sprintf(buf, "PTI Qlogic,ISP SBUS SCSI irq %s regs at %p",
__irq_itoa(qpti->qhost->irq), qpti->qregs); __irq_itoa(qpti->qhost->irq), qpti->qregs);
return buf; return buf;
} }
......
...@@ -335,7 +335,7 @@ struct scsi_cmnd; ...@@ -335,7 +335,7 @@ struct scsi_cmnd;
/* Software state for the driver. */ /* Software state for the driver. */
struct qlogicpti { struct qlogicpti {
/* These are the hot elements in the cache, so they come first. */ /* These are the hot elements in the cache, so they come first. */
unsigned long qregs; /* Adapter registers */ void __iomem *qregs; /* Adapter registers */
struct pti_queue_entry *res_cpu; /* Ptr to RESPONSE bufs (CPU) */ struct pti_queue_entry *res_cpu; /* Ptr to RESPONSE bufs (CPU) */
struct pti_queue_entry *req_cpu; /* Ptr to REQUEST bufs (CPU) */ struct pti_queue_entry *req_cpu; /* Ptr to REQUEST bufs (CPU) */
...@@ -370,7 +370,7 @@ struct qlogicpti { ...@@ -370,7 +370,7 @@ struct qlogicpti {
struct host_param host_param; struct host_param host_param;
struct dev_param dev_param[MAX_TARGETS]; struct dev_param dev_param[MAX_TARGETS];
unsigned long sreg; void __iomem *sreg;
#define SREG_TPOWER 0x80 /* State of termpwr */ #define SREG_TPOWER 0x80 /* State of termpwr */
#define SREG_FUSE 0x40 /* State of on board fuse */ #define SREG_FUSE 0x40 /* State of on board fuse */
#define SREG_PDISAB 0x20 /* Disable state for power on */ #define SREG_PDISAB 0x20 /* Disable state for power on */
......
...@@ -62,7 +62,7 @@ enum dvma_rev { ...@@ -62,7 +62,7 @@ enum dvma_rev {
struct sbus_dma { struct sbus_dma {
struct sbus_dma *next; struct sbus_dma *next;
struct sbus_dev *sdev; struct sbus_dev *sdev;
unsigned long regs; void __iomem *regs;
/* Status, misc info */ /* Status, misc info */
int node; /* Prom node for this DMA device */ int node; /* Prom node for this DMA device */
......
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
#define __ide_mm_outsw __ide_outsw #define __ide_mm_outsw __ide_outsw
#define __ide_mm_outsl __ide_outsl #define __ide_mm_outsl __ide_outsl
static __inline__ unsigned int inw_be(unsigned long addr) static inline unsigned int inw_be(void __iomem *addr)
{ {
unsigned int ret; unsigned int ret;
...@@ -49,9 +49,7 @@ static __inline__ unsigned int inw_be(unsigned long addr) ...@@ -49,9 +49,7 @@ static __inline__ unsigned int inw_be(unsigned long addr)
return ret; return ret;
} }
static __inline__ void __ide_insw(unsigned long port, static inline void __ide_insw(void __iomem *port, void *dst, u32 count)
void *dst,
u32 count)
{ {
#if (L1DCACHE_SIZE > PAGE_SIZE) /* is there D$ aliasing problem */ #if (L1DCACHE_SIZE > PAGE_SIZE) /* is there D$ aliasing problem */
unsigned long end = (unsigned long)dst + (count << 1); unsigned long end = (unsigned long)dst + (count << 1);
...@@ -81,16 +79,14 @@ static __inline__ void __ide_insw(unsigned long port, ...@@ -81,16 +79,14 @@ static __inline__ void __ide_insw(unsigned long port,
#endif #endif
} }
static __inline__ void outw_be(unsigned short w, unsigned long addr) static inline void outw_be(unsigned short w, void __iomem *addr)
{ {
__asm__ __volatile__("stha %0, [%1] %2" __asm__ __volatile__("stha %0, [%1] %2"
: /* no outputs */ : /* no outputs */
: "r" (w), "r" (addr), "i" (ASI_PHYS_BYPASS_EC_E)); : "r" (w), "r" (addr), "i" (ASI_PHYS_BYPASS_EC_E));
} }
static __inline__ void __ide_outsw(unsigned long port, static inline void __ide_outsw(void __iomem *port, void *src, u32 count)
void *src,
u32 count)
{ {
#if (L1DCACHE_SIZE > PAGE_SIZE) /* is there D$ aliasing problem */ #if (L1DCACHE_SIZE > PAGE_SIZE) /* is there D$ aliasing problem */
unsigned long end = (unsigned long)src + (count << 1); unsigned long end = (unsigned long)src + (count << 1);
......
...@@ -100,12 +100,18 @@ static __inline__ void _outl(u32 l, unsigned long addr) ...@@ -100,12 +100,18 @@ static __inline__ void _outl(u32 l, unsigned long addr)
#define inl_p(__addr) inl(__addr) #define inl_p(__addr) inl(__addr)
#define outl_p(__l, __addr) outl(__l, __addr) #define outl_p(__l, __addr) outl(__l, __addr)
extern void outsb(unsigned long addr, const void *src, unsigned long count); extern void outsb(void __iomem *addr, const void *src, unsigned long count);
extern void outsw(unsigned long addr, const void *src, unsigned long count); extern void outsw(void __iomem *addr, const void *src, unsigned long count);
extern void outsl(unsigned long addr, const void *src, unsigned long count); extern void outsl(void __iomem *addr, const void *src, unsigned long count);
extern void insb(unsigned long addr, void *dst, unsigned long count); extern void insb(void __iomem *addr, void *dst, unsigned long count);
extern void insw(unsigned long addr, void *dst, unsigned long count); extern void insw(void __iomem *addr, void *dst, unsigned long count);
extern void insl(unsigned long addr, void *dst, unsigned long count); extern void insl(void __iomem *addr, void *dst, unsigned long count);
#define ioread8_rep(a,d,c) insb(a,d,c)
#define ioread16_rep(a,d,c) insw(a,d,c)
#define ioread32_rep(a,d,c) insl(a,d,c)
#define iowrite8_rep(a,s,c) outsb(a,s,c)
#define iowrite16_rep(a,s,c) outsw(a,s,c)
#define iowrite32_rep(a,s,c) outsl(a,s,c)
/* Memory functions, same as I/O accesses on Ultra. */ /* Memory functions, same as I/O accesses on Ultra. */
static inline u8 _readb(void __iomem *addr) static inline u8 _readb(void __iomem *addr)
......
...@@ -126,10 +126,14 @@ static int parport_pc_find_nonpci_ports (int autoirq, int autodma) ...@@ -126,10 +126,14 @@ static int parport_pc_find_nonpci_ports (int autoirq, int autodma)
if (ebus_ecpp_p(edev)) { if (ebus_ecpp_p(edev)) {
unsigned long base = edev->resource[0].start; unsigned long base = edev->resource[0].start;
unsigned long config = edev->resource[1].start; unsigned long config = edev->resource[1].start;
unsigned long d_base = edev->resource[2].start;
unsigned long d_len;
spin_lock_init(&sparc_ebus_dmas[count].info.lock); spin_lock_init(&sparc_ebus_dmas[count].info.lock);
d_len = (edev->resource[2].end -
d_base) + 1;
sparc_ebus_dmas[count].info.regs = sparc_ebus_dmas[count].info.regs =
edev->resource[2].start; ioremap(d_base, d_len);
if (!sparc_ebus_dmas[count].info.regs) if (!sparc_ebus_dmas[count].info.regs)
continue; continue;
sparc_ebus_dmas[count].info.flags = 0; sparc_ebus_dmas[count].info.flags = 0;
......
...@@ -314,7 +314,7 @@ struct amd7930_map { ...@@ -314,7 +314,7 @@ struct amd7930_map {
typedef struct snd_amd7930 { typedef struct snd_amd7930 {
spinlock_t lock; spinlock_t lock;
unsigned long regs; void __iomem *regs;
u32 flags; u32 flags;
#define AMD7930_FLAG_PLAYBACK 0x00000001 #define AMD7930_FLAG_PLAYBACK 0x00000001
#define AMD7930_FLAG_CAPTURE 0x00000002 #define AMD7930_FLAG_CAPTURE 0x00000002
......
...@@ -64,7 +64,7 @@ MODULE_SUPPORTED_DEVICE("{{Sun,CS4231}}"); ...@@ -64,7 +64,7 @@ MODULE_SUPPORTED_DEVICE("{{Sun,CS4231}}");
typedef struct snd_cs4231 { typedef struct snd_cs4231 {
spinlock_t lock; spinlock_t lock;
unsigned long port; void __iomem *port;
#ifdef EBUS_SUPPORT #ifdef EBUS_SUPPORT
struct ebus_dma_info eb2c; struct ebus_dma_info eb2c;
struct ebus_dma_info eb2p; struct ebus_dma_info eb2p;
...@@ -357,7 +357,7 @@ static unsigned char snd_cs4231_original_image[32] = ...@@ -357,7 +357,7 @@ static unsigned char snd_cs4231_original_image[32] =
0x00, /* 1f/31 - cbrl */ 0x00, /* 1f/31 - cbrl */
}; };
static u8 __cs4231_readb(cs4231_t *cp, unsigned long reg_addr) static u8 __cs4231_readb(cs4231_t *cp, void __iomem *reg_addr)
{ {
#ifdef EBUS_SUPPORT #ifdef EBUS_SUPPORT
if (cp->flags & CS4231_FLAG_EBUS) { if (cp->flags & CS4231_FLAG_EBUS) {
...@@ -372,7 +372,7 @@ static u8 __cs4231_readb(cs4231_t *cp, unsigned long reg_addr) ...@@ -372,7 +372,7 @@ static u8 __cs4231_readb(cs4231_t *cp, unsigned long reg_addr)
#endif #endif
} }
static void __cs4231_writeb(cs4231_t *cp, u8 val, unsigned long reg_addr) static void __cs4231_writeb(cs4231_t *cp, u8 val, void __iomem *reg_addr)
{ {
#ifdef EBUS_SUPPORT #ifdef EBUS_SUPPORT
if (cp->flags & CS4231_FLAG_EBUS) { if (cp->flags & CS4231_FLAG_EBUS) {
...@@ -551,7 +551,7 @@ static void snd_cs4231_mce_up(cs4231_t *chip) ...@@ -551,7 +551,7 @@ static void snd_cs4231_mce_up(cs4231_t *chip)
chip->mce_bit |= CS4231_MCE; chip->mce_bit |= CS4231_MCE;
timeout = __cs4231_readb(chip, CS4231P(chip, REGSEL)); timeout = __cs4231_readb(chip, CS4231P(chip, REGSEL));
if (timeout == 0x80) if (timeout == 0x80)
snd_printk("mce_up [0x%lx]: serious init problem - codec still busy\n", chip->port); snd_printk("mce_up [%p]: serious init problem - codec still busy\n", chip->port);
if (!(timeout & CS4231_MCE)) if (!(timeout & CS4231_MCE))
__cs4231_writeb(chip, chip->mce_bit | (timeout & 0x1f), CS4231P(chip, REGSEL)); __cs4231_writeb(chip, chip->mce_bit | (timeout & 0x1f), CS4231P(chip, REGSEL));
spin_unlock_irqrestore(&chip->lock, flags); spin_unlock_irqrestore(&chip->lock, flags);
...@@ -576,7 +576,7 @@ static void snd_cs4231_mce_down(cs4231_t *chip) ...@@ -576,7 +576,7 @@ static void snd_cs4231_mce_down(cs4231_t *chip)
timeout = __cs4231_readb(chip, CS4231P(chip, REGSEL)); timeout = __cs4231_readb(chip, CS4231P(chip, REGSEL));
__cs4231_writeb(chip, chip->mce_bit | (timeout & 0x1f), CS4231P(chip, REGSEL)); __cs4231_writeb(chip, chip->mce_bit | (timeout & 0x1f), CS4231P(chip, REGSEL));
if (timeout == 0x80) if (timeout == 0x80)
snd_printk("mce_down [0x%lx]: serious init problem - codec still busy\n", chip->port); snd_printk("mce_down [%p]: serious init problem - codec still busy\n", chip->port);
if ((timeout & CS4231_MCE) == 0) { if ((timeout & CS4231_MCE) == 0) {
spin_unlock_irqrestore(&chip->lock, flags); spin_unlock_irqrestore(&chip->lock, flags);
return; return;
...@@ -2107,9 +2107,9 @@ static int __init snd_cs4231_ebus_create(snd_card_t *card, ...@@ -2107,9 +2107,9 @@ static int __init snd_cs4231_ebus_create(snd_card_t *card,
chip->eb2p.client_cookie = chip; chip->eb2p.client_cookie = chip;
chip->eb2p.irq = edev->irqs[1]; chip->eb2p.irq = edev->irqs[1];
chip->port = (unsigned long) ioremap(edev->resource[0].start, 0x10); chip->port = ioremap(edev->resource[0].start, 0x10);
chip->eb2p.regs = (unsigned long) ioremap(edev->resource[1].start, 0x10); chip->eb2p.regs = ioremap(edev->resource[1].start, 0x10);
chip->eb2c.regs = (unsigned long) ioremap(edev->resource[2].start, 0x10); chip->eb2c.regs = ioremap(edev->resource[2].start, 0x10);
if (!chip->port || !chip->eb2p.regs || !chip->eb2c.regs) { if (!chip->port || !chip->eb2p.regs || !chip->eb2c.regs) {
snd_cs4231_ebus_free(chip); snd_cs4231_ebus_free(chip);
snd_printk("cs4231-%d: Unable to map chip registers.\n", dev); snd_printk("cs4231-%d: Unable to map chip registers.\n", dev);
......
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