Commit 62f691a3 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

Staging: slicoss: remove WRITE_REG wrapper

It's not needed, so just call the function instead of using a define.

Cc: Lior Dotan <liodot@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 28980a3c
...@@ -42,8 +42,5 @@ ...@@ -42,8 +42,5 @@
#ifndef _SLIC_OS_SPECIFIC_H_ #ifndef _SLIC_OS_SPECIFIC_H_
#define _SLIC_OS_SPECIFIC_H_ #define _SLIC_OS_SPECIFIC_H_
#define WRITE_REG(reg, value, flush) \
slic_reg32_write((&reg), (value), (flush))
#endif /* _SLIC_OS_SPECIFIC_H_ */ #endif /* _SLIC_OS_SPECIFIC_H_ */
...@@ -64,8 +64,6 @@ static void slic_xmit_fail(struct adapter *adapter, ...@@ -64,8 +64,6 @@ static void slic_xmit_fail(struct adapter *adapter,
static void slic_config_pci(struct pci_dev *pcidev); static void slic_config_pci(struct pci_dev *pcidev);
static struct sk_buff *slic_rcvqueue_getnext(struct adapter *adapter); static struct sk_buff *slic_rcvqueue_getnext(struct adapter *adapter);
static inline void slic_reg32_write(void __iomem *reg, u32 value, uint flush);
#if SLIC_GET_STATS_ENABLED #if SLIC_GET_STATS_ENABLED
static struct net_device_stats *slic_get_stats(struct net_device *dev); static struct net_device_stats *slic_get_stats(struct net_device *dev);
#endif #endif
......
...@@ -195,7 +195,7 @@ static void slic_debug_adapter_destroy(struct adapter *adapter); ...@@ -195,7 +195,7 @@ static void slic_debug_adapter_destroy(struct adapter *adapter);
static void slic_debug_card_create(struct sliccard *card); static void slic_debug_card_create(struct sliccard *card);
static void slic_debug_card_destroy(struct sliccard *card); static void slic_debug_card_destroy(struct sliccard *card);
static inline void slic_reg32_write(void __iomem *reg, u32 value, uint flush) static inline void slic_reg32_write(void __iomem *reg, u32 value, bool flush)
{ {
writel(value, reg); writel(value, reg);
if (flush) if (flush)
...@@ -651,7 +651,7 @@ static int slic_entry_halt(struct net_device *dev) ...@@ -651,7 +651,7 @@ static int slic_entry_halt(struct net_device *dev)
DBG_MSG("slicoss: %s (%s) set adapter[%p] state to ADAPT_DOWN(%d)\n", DBG_MSG("slicoss: %s (%s) set adapter[%p] state to ADAPT_DOWN(%d)\n",
__func__, dev->name, adapter, adapter->state); __func__, dev->name, adapter, adapter->state);
ASSERT(card->adapter[adapter->cardindex] == adapter); ASSERT(card->adapter[adapter->cardindex] == adapter);
WRITE_REG(slic_regs->slic_icr, ICR_INT_OFF, FLUSH); slic_reg32_write(&slic_regs->slic_icr, ICR_INT_OFF, FLUSH);
adapter->all_reg_writes++; adapter->all_reg_writes++;
adapter->icr_reg_writes++; adapter->icr_reg_writes++;
slic_config_clear(adapter); slic_config_clear(adapter);
...@@ -663,7 +663,7 @@ static int slic_entry_halt(struct net_device *dev) ...@@ -663,7 +663,7 @@ static int slic_entry_halt(struct net_device *dev)
adapter->activated = 0; adapter->activated = 0;
} }
#ifdef AUTOMATIC_RESET #ifdef AUTOMATIC_RESET
WRITE_REG(slic_regs->slic_reset_iface, 0, FLUSH); slic_reg32_write(&slic_regs->slic_reset_iface, 0, FLUSH);
#endif #endif
/* /*
* Reset the adapter's rsp, cmd, and rcv queues * Reset the adapter's rsp, cmd, and rcv queues
...@@ -1000,8 +1000,8 @@ static int slic_xmit_start(struct sk_buff *skb, struct net_device *dev) ...@@ -1000,8 +1000,8 @@ static int slic_xmit_start(struct sk_buff *skb, struct net_device *dev)
} }
#endif #endif
if (hcmd->paddrh == 0) { if (hcmd->paddrh == 0) {
WRITE_REG(adapter->slic_regs->slic_cbar, slic_reg32_write(&adapter->slic_regs->slic_cbar,
(hcmd->paddrl | hcmd->cmdsize), DONT_FLUSH); (hcmd->paddrl | hcmd->cmdsize), DONT_FLUSH);
} else { } else {
slic_reg64_write(adapter, &adapter->slic_regs->slic_cbar64, slic_reg64_write(adapter, &adapter->slic_regs->slic_cbar64,
(hcmd->paddrl | hcmd->cmdsize), (hcmd->paddrl | hcmd->cmdsize),
...@@ -1251,7 +1251,8 @@ static irqreturn_t slic_interrupt(int irq, void *dev_id) ...@@ -1251,7 +1251,8 @@ static irqreturn_t slic_interrupt(int irq, void *dev_id)
u32 isr; u32 isr;
if ((adapter->pshmem) && (adapter->pshmem->isr)) { if ((adapter->pshmem) && (adapter->pshmem->isr)) {
WRITE_REG(adapter->slic_regs->slic_icr, ICR_INT_MASK, FLUSH); slic_reg32_write(&adapter->slic_regs->slic_icr,
ICR_INT_MASK, FLUSH);
isr = adapter->isrcopy = adapter->pshmem->isr; isr = adapter->isrcopy = adapter->pshmem->isr;
adapter->pshmem->isr = 0; adapter->pshmem->isr = 0;
adapter->num_isrs++; adapter->num_isrs++;
...@@ -1343,7 +1344,7 @@ static irqreturn_t slic_interrupt(int irq, void *dev_id) ...@@ -1343,7 +1344,7 @@ static irqreturn_t slic_interrupt(int irq, void *dev_id)
adapter->isrcopy = 0; adapter->isrcopy = 0;
adapter->all_reg_writes += 2; adapter->all_reg_writes += 2;
adapter->isr_reg_writes++; adapter->isr_reg_writes++;
WRITE_REG(adapter->slic_regs->slic_isr, 0, FLUSH); slic_reg32_write(&adapter->slic_regs->slic_isr, 0, FLUSH);
} else { } else {
adapter->false_interrupts++; adapter->false_interrupts++;
} }
...@@ -1633,8 +1634,9 @@ static void slic_mcast_set_mask(struct adapter *adapter) ...@@ -1633,8 +1634,9 @@ static void slic_mcast_set_mask(struct adapter *adapter)
*/ */
/* DBG_MSG("slicoss: %s macopts = MAC_ALLMCAST | MAC_PROMISC\n\ /* DBG_MSG("slicoss: %s macopts = MAC_ALLMCAST | MAC_PROMISC\n\
SLUT MODE!!!\n",__func__); */ SLUT MODE!!!\n",__func__); */
WRITE_REG(slic_regs->slic_mcastlow, 0xFFFFFFFF, FLUSH); slic_reg32_write(&slic_regs->slic_mcastlow, 0xFFFFFFFF, FLUSH);
WRITE_REG(slic_regs->slic_mcasthigh, 0xFFFFFFFF, FLUSH); slic_reg32_write(&slic_regs->slic_mcasthigh, 0xFFFFFFFF,
FLUSH);
/* DBG_MSG("%s (%s) WRITE to slic_regs slic_mcastlow&high 0xFFFFFFFF\n", /* DBG_MSG("%s (%s) WRITE to slic_regs slic_mcastlow&high 0xFFFFFFFF\n",
_func__, adapter->netdev->name); */ _func__, adapter->netdev->name); */
} else { } else {
...@@ -1646,11 +1648,10 @@ static void slic_mcast_set_mask(struct adapter *adapter) ...@@ -1646,11 +1648,10 @@ static void slic_mcast_set_mask(struct adapter *adapter)
((ulong) (adapter->mcastmask & 0xFFFFFFFF)), ((ulong) (adapter->mcastmask & 0xFFFFFFFF)),
((ulong) ((adapter->mcastmask >> 32) & 0xFFFFFFFF))); ((ulong) ((adapter->mcastmask >> 32) & 0xFFFFFFFF)));
WRITE_REG(slic_regs->slic_mcastlow, slic_reg32_write(&slic_regs->slic_mcastlow,
(u32) (adapter->mcastmask & 0xFFFFFFFF), FLUSH); (u32)(adapter->mcastmask & 0xFFFFFFFF), FLUSH);
WRITE_REG(slic_regs->slic_mcasthigh, slic_reg32_write(&slic_regs->slic_mcasthigh,
(u32) ((adapter->mcastmask >> 32) & 0xFFFFFFFF), (u32)((adapter->mcastmask >> 32) & 0xFFFFFFFF), FLUSH);
FLUSH);
} }
} }
...@@ -1787,7 +1788,7 @@ static int slic_if_init(struct adapter *adapter) ...@@ -1787,7 +1788,7 @@ static int slic_if_init(struct adapter *adapter)
} }
DBG_MSG("slicoss: %s disable interrupts(slic)\n", __func__); DBG_MSG("slicoss: %s disable interrupts(slic)\n", __func__);
WRITE_REG(slic_regs->slic_icr, ICR_INT_OFF, FLUSH); slic_reg32_write(&slic_regs->slic_icr, ICR_INT_OFF, FLUSH);
mdelay(1); mdelay(1);
if (!adapter->isp_initialized) { if (!adapter->isp_initialized) {
...@@ -1797,13 +1798,13 @@ static int slic_if_init(struct adapter *adapter) ...@@ -1797,13 +1798,13 @@ static int slic_if_init(struct adapter *adapter)
adapter->bit64reglock.flags); adapter->bit64reglock.flags);
#if defined(CONFIG_X86_64) #if defined(CONFIG_X86_64)
WRITE_REG(slic_regs->slic_addr_upper, slic_reg32_write(&slic_regs->slic_addr_upper,
SLIC_GET_ADDR_HIGH(&pshmem->isr), DONT_FLUSH); SLIC_GET_ADDR_HIGH(&pshmem->isr), DONT_FLUSH);
WRITE_REG(slic_regs->slic_isp, slic_reg32_write(&slic_regs->slic_isp,
SLIC_GET_ADDR_LOW(&pshmem->isr), FLUSH); SLIC_GET_ADDR_LOW(&pshmem->isr), FLUSH);
#elif defined(CONFIG_X86) #elif defined(CONFIG_X86)
WRITE_REG(slic_regs->slic_addr_upper, (u32) 0, DONT_FLUSH); slic_reg32_write(&slic_regs->slic_addr_upper, 0, DONT_FLUSH);
WRITE_REG(slic_regs->slic_isp, (u32) &pshmem->isr, FLUSH); slic_reg32_write(&slic_regs->slic_isp, (u32)&pshmem->isr, FLUSH);
#else #else
Stop Compilations Stop Compilations
#endif #endif
...@@ -1858,8 +1859,8 @@ static int slic_if_init(struct adapter *adapter) ...@@ -1858,8 +1859,8 @@ static int slic_if_init(struct adapter *adapter)
DBG_MSG("slicoss: %s ENABLE interrupts(slic)\n", __func__); DBG_MSG("slicoss: %s ENABLE interrupts(slic)\n", __func__);
adapter->isrcopy = 0; adapter->isrcopy = 0;
adapter->pshmem->isr = 0; adapter->pshmem->isr = 0;
WRITE_REG(slic_regs->slic_isr, 0, FLUSH); slic_reg32_write(&slic_regs->slic_isr, 0, FLUSH);
WRITE_REG(slic_regs->slic_icr, ICR_INT_ON, FLUSH); slic_reg32_write(&slic_regs->slic_icr, ICR_INT_ON, FLUSH);
DBG_MSG("slicoss: %s call slic_link_config(slic)\n", __func__); DBG_MSG("slicoss: %s call slic_link_config(slic)\n", __func__);
slic_link_config(adapter, LINK_AUTOSPEED, LINK_AUTOD); slic_link_config(adapter, LINK_AUTOSPEED, LINK_AUTOD);
...@@ -1962,6 +1963,7 @@ static void slic_adapter_freeresources(struct adapter *adapter) ...@@ -1962,6 +1963,7 @@ static void slic_adapter_freeresources(struct adapter *adapter)
static void slic_link_config(struct adapter *adapter, static void slic_link_config(struct adapter *adapter,
u32 linkspeed, u32 linkduplex) u32 linkspeed, u32 linkduplex)
{ {
u32 __iomem *wphy;
u32 speed; u32 speed;
u32 duplex; u32 duplex;
u32 phy_config; u32 phy_config;
...@@ -1986,6 +1988,8 @@ static void slic_link_config(struct adapter *adapter, ...@@ -1986,6 +1988,8 @@ static void slic_link_config(struct adapter *adapter,
if (linkduplex > LINK_AUTOD) if (linkduplex > LINK_AUTOD)
linkduplex = LINK_AUTOD; linkduplex = LINK_AUTOD;
wphy = &adapter->slic_regs->slic_wphy;
if ((linkspeed == LINK_AUTOSPEED) || (linkspeed == LINK_1000MB)) { if ((linkspeed == LINK_AUTOSPEED) || (linkspeed == LINK_1000MB)) {
if (adapter->flags & ADAPT_FLAGS_FIBERMEDIA) { if (adapter->flags & ADAPT_FLAGS_FIBERMEDIA) {
/* We've got a fiber gigabit interface, and register /* We've got a fiber gigabit interface, and register
...@@ -1996,8 +2000,7 @@ static void slic_link_config(struct adapter *adapter, ...@@ -1996,8 +2000,7 @@ static void slic_link_config(struct adapter *adapter,
phy_advreg = (MIICR_REG_4 | (PAR_ADV1000XFD)); phy_advreg = (MIICR_REG_4 | (PAR_ADV1000XFD));
/* enable PAUSE frames */ /* enable PAUSE frames */
phy_advreg |= PAR_ASYMPAUSE_FIBER; phy_advreg |= PAR_ASYMPAUSE_FIBER;
WRITE_REG(adapter->slic_regs->slic_wphy, phy_advreg, slic_reg32_write(wphy, phy_advreg, FLUSH);
FLUSH);
if (linkspeed == LINK_AUTOSPEED) { if (linkspeed == LINK_AUTOSPEED) {
/* reset phy, enable auto-neg */ /* reset phy, enable auto-neg */
...@@ -2005,14 +2008,12 @@ static void slic_link_config(struct adapter *adapter, ...@@ -2005,14 +2008,12 @@ static void slic_link_config(struct adapter *adapter,
(MIICR_REG_PCR | (MIICR_REG_PCR |
(PCR_RESET | PCR_AUTONEG | (PCR_RESET | PCR_AUTONEG |
PCR_AUTONEG_RST)); PCR_AUTONEG_RST));
WRITE_REG(adapter->slic_regs->slic_wphy, slic_reg32_write(wphy, phy_config, FLUSH);
phy_config, FLUSH);
} else { /* forced 1000 Mb FD*/ } else { /* forced 1000 Mb FD*/
/* power down phy to break link /* power down phy to break link
this may not work) */ this may not work) */
phy_config = (MIICR_REG_PCR | PCR_POWERDOWN); phy_config = (MIICR_REG_PCR | PCR_POWERDOWN);
WRITE_REG(adapter->slic_regs->slic_wphy, slic_reg32_write(wphy, phy_config, FLUSH);
phy_config, FLUSH);
/* wait, Marvell says 1 sec, /* wait, Marvell says 1 sec,
try to get away with 10 ms */ try to get away with 10 ms */
mdelay(10); mdelay(10);
...@@ -2023,8 +2024,7 @@ static void slic_link_config(struct adapter *adapter, ...@@ -2023,8 +2024,7 @@ static void slic_link_config(struct adapter *adapter,
(MIICR_REG_PCR | (MIICR_REG_PCR |
(PCR_RESET | PCR_SPEED_1000 | (PCR_RESET | PCR_SPEED_1000 |
PCR_DUPLEX_FULL)); PCR_DUPLEX_FULL));
WRITE_REG(adapter->slic_regs->slic_wphy, slic_reg32_write(wphy, phy_config, FLUSH);
phy_config, FLUSH);
} }
} else { /* copper gigabit */ } else { /* copper gigabit */
...@@ -2048,35 +2048,30 @@ static void slic_link_config(struct adapter *adapter, ...@@ -2048,35 +2048,30 @@ static void slic_link_config(struct adapter *adapter,
phy_advreg |= PAR_ASYMPAUSE; phy_advreg |= PAR_ASYMPAUSE;
/* required by the Cicada PHY */ /* required by the Cicada PHY */
phy_advreg |= PAR_802_3; phy_advreg |= PAR_802_3;
WRITE_REG(adapter->slic_regs->slic_wphy, phy_advreg, slic_reg32_write(wphy, phy_advreg, FLUSH);
FLUSH);
/* advertise FD only @1000 Mb */ /* advertise FD only @1000 Mb */
phy_gctlreg = (MIICR_REG_9 | (PGC_ADV1000FD)); phy_gctlreg = (MIICR_REG_9 | (PGC_ADV1000FD));
WRITE_REG(adapter->slic_regs->slic_wphy, phy_gctlreg, slic_reg32_write(wphy, phy_gctlreg, FLUSH);
FLUSH);
if (adapter->subsysid != SLIC_1GB_CICADA_SUBSYS_ID) { if (adapter->subsysid != SLIC_1GB_CICADA_SUBSYS_ID) {
/* if a Marvell PHY /* if a Marvell PHY
enable auto crossover */ enable auto crossover */
phy_config = phy_config =
(MIICR_REG_16 | (MRV_REG16_XOVERON)); (MIICR_REG_16 | (MRV_REG16_XOVERON));
WRITE_REG(adapter->slic_regs->slic_wphy, slic_reg32_write(wphy, phy_config, FLUSH);
phy_config, FLUSH);
/* reset phy, enable auto-neg */ /* reset phy, enable auto-neg */
phy_config = phy_config =
(MIICR_REG_PCR | (MIICR_REG_PCR |
(PCR_RESET | PCR_AUTONEG | (PCR_RESET | PCR_AUTONEG |
PCR_AUTONEG_RST)); PCR_AUTONEG_RST));
WRITE_REG(adapter->slic_regs->slic_wphy, slic_reg32_write(wphy, phy_config, FLUSH);
phy_config, FLUSH);
} else { /* it's a Cicada PHY */ } else { /* it's a Cicada PHY */
/* enable and restart auto-neg (don't reset) */ /* enable and restart auto-neg (don't reset) */
phy_config = phy_config =
(MIICR_REG_PCR | (MIICR_REG_PCR |
(PCR_AUTONEG | PCR_AUTONEG_RST)); (PCR_AUTONEG | PCR_AUTONEG_RST));
WRITE_REG(adapter->slic_regs->slic_wphy, slic_reg32_write(wphy, phy_config, FLUSH);
phy_config, FLUSH);
} }
} }
} else { } else {
...@@ -2094,13 +2089,12 @@ static void slic_link_config(struct adapter *adapter, ...@@ -2094,13 +2089,12 @@ static void slic_link_config(struct adapter *adapter,
/* if a Marvell PHY /* if a Marvell PHY
disable auto crossover */ disable auto crossover */
phy_config = (MIICR_REG_16 | (MRV_REG16_XOVEROFF)); phy_config = (MIICR_REG_16 | (MRV_REG16_XOVEROFF));
WRITE_REG(adapter->slic_regs->slic_wphy, phy_config, slic_reg32_write(wphy, phy_config, FLUSH);
FLUSH);
} }
/* power down phy to break link (this may not work) */ /* power down phy to break link (this may not work) */
phy_config = (MIICR_REG_PCR | (PCR_POWERDOWN | speed | duplex)); phy_config = (MIICR_REG_PCR | (PCR_POWERDOWN | speed | duplex));
WRITE_REG(adapter->slic_regs->slic_wphy, phy_config, FLUSH); slic_reg32_write(wphy, phy_config, FLUSH);
/* wait, Marvell says 1 sec, try to get away with 10 ms */ /* wait, Marvell says 1 sec, try to get away with 10 ms */
mdelay(10); mdelay(10);
...@@ -2111,13 +2105,11 @@ static void slic_link_config(struct adapter *adapter, ...@@ -2111,13 +2105,11 @@ static void slic_link_config(struct adapter *adapter,
soft reset phy, powerup */ soft reset phy, powerup */
phy_config = phy_config =
(MIICR_REG_PCR | (PCR_RESET | speed | duplex)); (MIICR_REG_PCR | (PCR_RESET | speed | duplex));
WRITE_REG(adapter->slic_regs->slic_wphy, phy_config, slic_reg32_write(wphy, phy_config, FLUSH);
FLUSH);
} else { /* it's a Cicada PHY */ } else { /* it's a Cicada PHY */
/* disable auto-neg, set speed, powerup */ /* disable auto-neg, set speed, powerup */
phy_config = (MIICR_REG_PCR | (speed | duplex)); phy_config = (MIICR_REG_PCR | (speed | duplex));
WRITE_REG(adapter->slic_regs->slic_wphy, phy_config, slic_reg32_write(wphy, phy_config, FLUSH);
FLUSH);
} }
} }
...@@ -2204,28 +2196,27 @@ static int slic_card_download_gbrcv(struct adapter *adapter) ...@@ -2204,28 +2196,27 @@ static int slic_card_download_gbrcv(struct adapter *adapter)
break; break;
} }
/* start download */ /* start download */
WRITE_REG(slic_regs->slic_rcv_wcs, SLIC_RCVWCS_BEGIN, FLUSH); slic_reg32_write(&slic_regs->slic_rcv_wcs, SLIC_RCVWCS_BEGIN, FLUSH);
/* download the rcv sequencer ucode */ /* download the rcv sequencer ucode */
for (codeaddr = 0; codeaddr < rcvucodelen; codeaddr++) { for (codeaddr = 0; codeaddr < rcvucodelen; codeaddr++) {
/* write out instruction address */ /* write out instruction address */
WRITE_REG(slic_regs->slic_rcv_wcs, codeaddr, FLUSH); slic_reg32_write(&slic_regs->slic_rcv_wcs, codeaddr, FLUSH);
instruction = *(u32 *)(fw->data + index); instruction = *(u32 *)(fw->data + index);
index += 4; index += 4;
/* write out the instruction data low addr */ /* write out the instruction data low addr */
WRITE_REG(slic_regs->slic_rcv_wcs, slic_reg32_write(&slic_regs->slic_rcv_wcs, instruction, FLUSH);
instruction, FLUSH);
instruction = *(u8 *)(fw->data + index); instruction = *(u8 *)(fw->data + index);
index++; index++;
/* write out the instruction data high addr */ /* write out the instruction data high addr */
WRITE_REG(slic_regs->slic_rcv_wcs, (u8)instruction, slic_reg32_write(&slic_regs->slic_rcv_wcs, (u8)instruction,
FLUSH); FLUSH);
} }
/* download finished */ /* download finished */
release_firmware(fw); release_firmware(fw);
WRITE_REG(slic_regs->slic_rcv_wcs, SLIC_RCVWCS_FINISH, FLUSH); slic_reg32_write(&slic_regs->slic_rcv_wcs, SLIC_RCVWCS_FINISH, FLUSH);
return 0; return 0;
} }
...@@ -2287,15 +2278,15 @@ static int slic_card_download(struct adapter *adapter) ...@@ -2287,15 +2278,15 @@ static int slic_card_download(struct adapter *adapter)
for (codeaddr = 0; codeaddr < thissectionsize; codeaddr++) { for (codeaddr = 0; codeaddr < thissectionsize; codeaddr++) {
/* Write out instruction address */ /* Write out instruction address */
WRITE_REG(slic_regs->slic_wcs, baseaddress + codeaddr, slic_reg32_write(&slic_regs->slic_wcs,
FLUSH); baseaddress + codeaddr, FLUSH);
/* Write out instruction to low addr */ /* Write out instruction to low addr */
WRITE_REG(slic_regs->slic_wcs, instruction, FLUSH); slic_reg32_write(&slic_regs->slic_wcs, instruction, FLUSH);
instruction = *(u32 *)(fw->data + index); instruction = *(u32 *)(fw->data + index);
index += 4; index += 4;
/* Write out instruction to high addr */ /* Write out instruction to high addr */
WRITE_REG(slic_regs->slic_wcs, instruction, FLUSH); slic_reg32_write(&slic_regs->slic_wcs, instruction, FLUSH);
instruction = *(u32 *)(fw->data + index); instruction = *(u32 *)(fw->data + index);
index += 4; index += 4;
} }
...@@ -2312,15 +2303,17 @@ static int slic_card_download(struct adapter *adapter) ...@@ -2312,15 +2303,17 @@ static int slic_card_download(struct adapter *adapter)
(uint)section,baseaddress,thissectionsize);*/ (uint)section,baseaddress,thissectionsize);*/
for (codeaddr = 0; codeaddr < thissectionsize; codeaddr++) { for (codeaddr = 0; codeaddr < thissectionsize; codeaddr++) {
/* Write out instruction address */ /* Write out instruction address */
WRITE_REG(slic_regs->slic_wcs, slic_reg32_write(&slic_regs->slic_wcs,
SLIC_WCS_COMPARE | (baseaddress + codeaddr), SLIC_WCS_COMPARE | (baseaddress + codeaddr),
FLUSH); FLUSH);
/* Write out instruction to low addr */ /* Write out instruction to low addr */
WRITE_REG(slic_regs->slic_wcs, instruction, FLUSH); slic_reg32_write(&slic_regs->slic_wcs, instruction,
FLUSH);
instruction = *(u32 *)(fw->data + index); instruction = *(u32 *)(fw->data + index);
index += 4; index += 4;
/* Write out instruction to high addr */ /* Write out instruction to high addr */
WRITE_REG(slic_regs->slic_wcs, instruction, FLUSH); slic_reg32_write(&slic_regs->slic_wcs, instruction,
FLUSH);
instruction = *(u32 *)(fw->data + index); instruction = *(u32 *)(fw->data + index);
index += 4; index += 4;
...@@ -2341,7 +2334,7 @@ static int slic_card_download(struct adapter *adapter) ...@@ -2341,7 +2334,7 @@ static int slic_card_download(struct adapter *adapter)
release_firmware(fw); release_firmware(fw);
/* Everything OK, kick off the card */ /* Everything OK, kick off the card */
mdelay(10); mdelay(10);
WRITE_REG(slic_regs->slic_wcs, SLIC_WCS_START, FLUSH); slic_reg32_write(&slic_regs->slic_wcs, SLIC_WCS_START, FLUSH);
/* stall for 20 ms, long enough for ucode to init card /* stall for 20 ms, long enough for ucode to init card
and reach mainloop */ and reach mainloop */
...@@ -2386,9 +2379,7 @@ static void slic_adapter_set_hwaddr(struct adapter *adapter) ...@@ -2386,9 +2379,7 @@ static void slic_adapter_set_hwaddr(struct adapter *adapter)
static void slic_intagg_set(struct adapter *adapter, u32 value) static void slic_intagg_set(struct adapter *adapter, u32 value)
{ {
__iomem struct slic_regs *slic_regs = adapter->slic_regs; slic_reg32_write(&adapter->slic_regs->slic_intagg, value, FLUSH);
WRITE_REG(slic_regs->slic_intagg, value, FLUSH);
adapter->card->loadlevel_current = value; adapter->card->loadlevel_current = value;
} }
...@@ -2457,15 +2448,15 @@ static int slic_card_init(struct sliccard *card, struct adapter *adapter) ...@@ -2457,15 +2448,15 @@ static int slic_card_init(struct sliccard *card, struct adapter *adapter)
} else { } else {
memset(peeprom, 0, sizeof(struct slic_eeprom)); memset(peeprom, 0, sizeof(struct slic_eeprom));
} }
WRITE_REG(slic_regs->slic_icr, ICR_INT_OFF, FLUSH); slic_reg32_write(&slic_regs->slic_icr, ICR_INT_OFF, FLUSH);
mdelay(1); mdelay(1);
pshmem = (struct slic_shmem *)adapter->phys_shmem; pshmem = (struct slic_shmem *)adapter->phys_shmem;
spin_lock_irqsave(&adapter->bit64reglock.lock, spin_lock_irqsave(&adapter->bit64reglock.lock,
adapter->bit64reglock.flags); adapter->bit64reglock.flags);
WRITE_REG(slic_regs->slic_addr_upper, 0, DONT_FLUSH); slic_reg32_write(&slic_regs->slic_addr_upper, 0, DONT_FLUSH);
WRITE_REG(slic_regs->slic_isp, slic_reg32_write(&slic_regs->slic_isp,
SLIC_GET_ADDR_LOW(&pshmem->isr), FLUSH); SLIC_GET_ADDR_LOW(&pshmem->isr), FLUSH);
spin_unlock_irqrestore(&adapter->bit64reglock.lock, spin_unlock_irqrestore(&adapter->bit64reglock.lock,
adapter->bit64reglock.flags); adapter->bit64reglock.flags);
...@@ -2483,15 +2474,15 @@ static int slic_card_init(struct sliccard *card, struct adapter *adapter) ...@@ -2483,15 +2474,15 @@ static int slic_card_init(struct sliccard *card, struct adapter *adapter)
&slic_regs->slic_isp, 0, &slic_regs->slic_isp, 0,
&slic_regs->slic_addr_upper, &slic_regs->slic_addr_upper,
0, FLUSH); 0, FLUSH);
WRITE_REG(slic_regs->slic_isr, 0, slic_reg32_write(&slic_regs->slic_isr,
FLUSH); 0, FLUSH);
slic_upr_request_complete(adapter, 0); slic_upr_request_complete(adapter, 0);
break; break;
} else { } else {
adapter->pshmem->isr = 0; adapter->pshmem->isr = 0;
WRITE_REG(slic_regs->slic_isr, 0, slic_reg32_write(&slic_regs->slic_isr,
FLUSH); 0, FLUSH);
} }
} else { } else {
mdelay(1); mdelay(1);
...@@ -2820,14 +2811,15 @@ static void slic_soft_reset(struct adapter *adapter) ...@@ -2820,14 +2811,15 @@ static void slic_soft_reset(struct adapter *adapter)
if (adapter->card->state == CARD_UP) { if (adapter->card->state == CARD_UP) {
DBG_MSG("slicoss: %s QUIESCE adapter[%p] card[%p] devid[%x]\n", DBG_MSG("slicoss: %s QUIESCE adapter[%p] card[%p] devid[%x]\n",
__func__, adapter, adapter->card, adapter->devid); __func__, adapter, adapter->card, adapter->devid);
WRITE_REG(adapter->slic_regs->slic_quiesce, 0, FLUSH); slic_reg32_write(&adapter->slic_regs->slic_quiesce, 0, FLUSH);
mdelay(1); mdelay(1);
} }
/* DBG_MSG ("slicoss: %s (%s) adapter[%p] card[%p] devid[%x]\n", /* DBG_MSG ("slicoss: %s (%s) adapter[%p] card[%p] devid[%x]\n",
__func__, adapter->netdev->name, adapter, adapter->card, __func__, adapter->netdev->name, adapter, adapter->card,
adapter->devid); */ adapter->devid); */
WRITE_REG(adapter->slic_regs->slic_reset, SLIC_RESET_MAGIC, FLUSH); slic_reg32_write(&adapter->slic_regs->slic_reset, SLIC_RESET_MAGIC,
FLUSH);
mdelay(1); mdelay(1);
} }
...@@ -2858,7 +2850,7 @@ static void slic_config_set(struct adapter *adapter, bool linkchange) ...@@ -2858,7 +2850,7 @@ static void slic_config_set(struct adapter *adapter, bool linkchange)
DBG_MSG("slicoss: FDX adapt[%p] set xmtcfg to [%x]\n", adapter, DBG_MSG("slicoss: FDX adapt[%p] set xmtcfg to [%x]\n", adapter,
value); value);
WRITE_REG(slic_regs->slic_wxcfg, value, FLUSH); slic_reg32_write(&slic_regs->slic_wxcfg, value, FLUSH);
/* Setup rcvcfg last */ /* Setup rcvcfg last */
value = (RcrReset | /* Reset, if linkchange */ value = (RcrReset | /* Reset, if linkchange */
...@@ -2873,7 +2865,7 @@ static void slic_config_set(struct adapter *adapter, bool linkchange) ...@@ -2873,7 +2865,7 @@ static void slic_config_set(struct adapter *adapter, bool linkchange)
DBG_MSG("slicoss: HDX adapt[%p] set xmtcfg to [%x]\n", adapter, DBG_MSG("slicoss: HDX adapt[%p] set xmtcfg to [%x]\n", adapter,
value); value);
WRITE_REG(slic_regs->slic_wxcfg, value, FLUSH); slic_reg32_write(&slic_regs->slic_wxcfg, value, FLUSH);
/* Setup rcvcfg last */ /* Setup rcvcfg last */
value = (RcrReset | /* Reset, if linkchange */ value = (RcrReset | /* Reset, if linkchange */
...@@ -2891,7 +2883,7 @@ static void slic_config_set(struct adapter *adapter, bool linkchange) ...@@ -2891,7 +2883,7 @@ static void slic_config_set(struct adapter *adapter, bool linkchange)
value |= GRCR_RCVALL; value |= GRCR_RCVALL;
DBG_MSG("slicoss: adapt[%p] set rcvcfg to [%x]\n", adapter, value); DBG_MSG("slicoss: adapt[%p] set rcvcfg to [%x]\n", adapter, value);
WRITE_REG(slic_regs->slic_wrcfg, value, FLUSH); slic_reg32_write(&slic_regs->slic_wrcfg, value, FLUSH);
} }
/* /*
...@@ -2907,18 +2899,18 @@ static void slic_config_clear(struct adapter *adapter) ...@@ -2907,18 +2899,18 @@ static void slic_config_clear(struct adapter *adapter)
value = (GXCR_RESET | /* Always reset */ value = (GXCR_RESET | /* Always reset */
GXCR_PAUSEEN); /* Enable pause */ GXCR_PAUSEEN); /* Enable pause */
WRITE_REG(slic_regs->slic_wxcfg, value, FLUSH); slic_reg32_write(&slic_regs->slic_wxcfg, value, FLUSH);
value = (GRCR_RESET | /* Always reset */ value = (GRCR_RESET | /* Always reset */
GRCR_CTLEN | /* Enable CTL frames */ GRCR_CTLEN | /* Enable CTL frames */
GRCR_ADDRAEN | /* Address A enable */ GRCR_ADDRAEN | /* Address A enable */
(GRCR_HASHSIZE << GRCR_HASHSIZE_SHIFT)); (GRCR_HASHSIZE << GRCR_HASHSIZE_SHIFT));
WRITE_REG(slic_regs->slic_wrcfg, value, FLUSH); slic_reg32_write(&slic_regs->slic_wrcfg, value, FLUSH);
/* power down phy */ /* power down phy */
phy_config = (MIICR_REG_PCR | (PCR_POWERDOWN)); phy_config = (MIICR_REG_PCR | (PCR_POWERDOWN));
WRITE_REG(slic_regs->slic_wphy, phy_config, FLUSH); slic_reg32_write(&slic_regs->slic_wphy, phy_config, FLUSH);
} }
static void slic_config_get(struct adapter *adapter, u32 config, static void slic_config_get(struct adapter *adapter, u32 config,
...@@ -2940,14 +2932,14 @@ static void slic_mac_address_config(struct adapter *adapter) ...@@ -2940,14 +2932,14 @@ static void slic_mac_address_config(struct adapter *adapter)
value = *(u32 *) &adapter->currmacaddr[2]; value = *(u32 *) &adapter->currmacaddr[2];
value = ntohl(value); value = ntohl(value);
WRITE_REG(slic_regs->slic_wraddral, value, FLUSH); slic_reg32_write(&slic_regs->slic_wraddral, value, FLUSH);
WRITE_REG(slic_regs->slic_wraddrbl, value, FLUSH); slic_reg32_write(&slic_regs->slic_wraddrbl, value, FLUSH);
value2 = (u32) ((adapter->currmacaddr[0] << 8 | value2 = (u32) ((adapter->currmacaddr[0] << 8 |
adapter->currmacaddr[1]) & 0xFFFF); adapter->currmacaddr[1]) & 0xFFFF);
WRITE_REG(slic_regs->slic_wraddrah, value2, FLUSH); slic_reg32_write(&slic_regs->slic_wraddrah, value2, FLUSH);
WRITE_REG(slic_regs->slic_wraddrbh, value2, FLUSH); slic_reg32_write(&slic_regs->slic_wraddrbh, value2, FLUSH);
DBG_MSG("%s value1[%x] value2[%x] Call slic_mcast_set_mask\n", DBG_MSG("%s value1[%x] value2[%x] Call slic_mcast_set_mask\n",
__func__, value, value2); __func__, value, value2);
...@@ -2986,7 +2978,7 @@ static void slic_mac_config(struct adapter *adapter) ...@@ -2986,7 +2978,7 @@ static void slic_mac_config(struct adapter *adapter)
} }
/* write mac config */ /* write mac config */
WRITE_REG(slic_regs->slic_wmcfg, value, FLUSH); slic_reg32_write(&slic_regs->slic_wmcfg, value, FLUSH);
/* setup mac addresses */ /* setup mac addresses */
slic_mac_address_config(adapter); slic_mac_address_config(adapter);
...@@ -3123,9 +3115,12 @@ static void slic_timer_load_check(ulong cardaddr) ...@@ -3123,9 +3115,12 @@ static void slic_timer_load_check(ulong cardaddr)
{ {
struct sliccard *card = (struct sliccard *)cardaddr; struct sliccard *card = (struct sliccard *)cardaddr;
struct adapter *adapter = card->master; struct adapter *adapter = card->master;
u32 __iomem *intagg;
u32 load = card->events; u32 load = card->events;
u32 level = 0; u32 level = 0;
intagg = &adapter->slic_regs->slic_intagg;
if ((adapter) && (adapter->state == ADAPT_UP) && if ((adapter) && (adapter->state == ADAPT_UP) &&
(card->state == CARD_UP) && (slic_global.dynamic_intagg)) { (card->state == CARD_UP) && (slic_global.dynamic_intagg)) {
if (adapter->devid == SLIC_1GB_DEVICE_ID) { if (adapter->devid == SLIC_1GB_DEVICE_ID) {
...@@ -3147,8 +3142,7 @@ static void slic_timer_load_check(ulong cardaddr) ...@@ -3147,8 +3142,7 @@ static void slic_timer_load_check(ulong cardaddr)
} }
if (card->loadlevel_current != level) { if (card->loadlevel_current != level) {
card->loadlevel_current = level; card->loadlevel_current = level;
WRITE_REG(adapter->slic_regs->slic_intagg, slic_reg32_write(intagg, level, FLUSH);
level, FLUSH);
} }
} else { } else {
if (load > SLIC_LOAD_5) if (load > SLIC_LOAD_5)
...@@ -3165,8 +3159,7 @@ static void slic_timer_load_check(ulong cardaddr) ...@@ -3165,8 +3159,7 @@ static void slic_timer_load_check(ulong cardaddr)
level = SLIC_INTAGG_0; level = SLIC_INTAGG_0;
if (card->loadlevel_current != level) { if (card->loadlevel_current != level) {
card->loadlevel_current = level; card->loadlevel_current = level;
WRITE_REG(adapter->slic_regs->slic_intagg, slic_reg32_write(intagg, level, FLUSH);
level, FLUSH);
} }
} }
} }
...@@ -3413,7 +3406,8 @@ static void slic_upr_start(struct adapter *adapter) ...@@ -3413,7 +3406,8 @@ static void slic_upr_start(struct adapter *adapter)
switch (upr->upr_request) { switch (upr->upr_request) {
case SLIC_UPR_STATS: case SLIC_UPR_STATS:
if (upr->upr_data_h == 0) { if (upr->upr_data_h == 0) {
WRITE_REG(slic_regs->slic_stats, upr->upr_data, FLUSH); slic_reg32_write(&slic_regs->slic_stats, upr->upr_data,
FLUSH);
} else { } else {
slic_reg64_write(adapter, &slic_regs->slic_stats64, slic_reg64_write(adapter, &slic_regs->slic_stats64,
upr->upr_data, upr->upr_data,
...@@ -3456,7 +3450,7 @@ static void slic_upr_start(struct adapter *adapter) ...@@ -3456,7 +3450,7 @@ static void slic_upr_start(struct adapter *adapter)
break; break;
#endif #endif
case SLIC_UPR_PING: case SLIC_UPR_PING:
WRITE_REG(slic_regs->slic_ping, 1, FLUSH); slic_reg32_write(&slic_regs->slic_ping, 1, FLUSH);
break; break;
default: default:
ASSERT(0); ASSERT(0);
...@@ -3718,9 +3712,9 @@ static int slic_rspqueue_init(struct adapter *adapter) ...@@ -3718,9 +3712,9 @@ static int slic_rspqueue_init(struct adapter *adapter)
__func__, i, (void *)rspq->paddr[i], rspq->vaddr[i]); */ __func__, i, (void *)rspq->paddr[i], rspq->vaddr[i]); */
if (paddrh == 0) { if (paddrh == 0) {
WRITE_REG(slic_regs->slic_rbar, slic_reg32_write(&slic_regs->slic_rbar,
(rspq->paddr[i] | SLIC_RSPQ_BUFSINPAGE), (rspq->paddr[i] | SLIC_RSPQ_BUFSINPAGE),
DONT_FLUSH); DONT_FLUSH);
} else { } else {
slic_reg64_write(adapter, &slic_regs->slic_rbar64, slic_reg64_write(adapter, &slic_regs->slic_rbar64,
(rspq->paddr[i] | SLIC_RSPQ_BUFSINPAGE), (rspq->paddr[i] | SLIC_RSPQ_BUFSINPAGE),
...@@ -4262,8 +4256,8 @@ retry_rcvqfill: ...@@ -4262,8 +4256,8 @@ retry_rcvqfill:
} }
#endif #endif
if (paddrh == 0) { if (paddrh == 0) {
WRITE_REG(adapter->slic_regs->slic_hbar, slic_reg32_write(&adapter->slic_regs->slic_hbar,
(u32) paddrl, DONT_FLUSH); (u32)paddrl, DONT_FLUSH);
} else { } else {
slic_reg64_write(adapter, slic_reg64_write(adapter,
&adapter->slic_regs->slic_hbar64, &adapter->slic_regs->slic_hbar64,
...@@ -4320,8 +4314,8 @@ static u32 slic_rcvqueue_reinsert(struct adapter *adapter, struct sk_buff *skb) ...@@ -4320,8 +4314,8 @@ static u32 slic_rcvqueue_reinsert(struct adapter *adapter, struct sk_buff *skb)
rcvq->count); rcvq->count);
} }
if (paddrh == 0) { if (paddrh == 0) {
WRITE_REG(adapter->slic_regs->slic_hbar, (u32) paddrl, slic_reg32_write(&adapter->slic_regs->slic_hbar, (u32)paddrl,
DONT_FLUSH); DONT_FLUSH);
} else { } else {
slic_reg64_write(adapter, &adapter->slic_regs->slic_hbar64, slic_reg64_write(adapter, &adapter->slic_regs->slic_hbar64,
paddrl, &adapter->slic_regs->slic_addr_upper, paddrl, &adapter->slic_regs->slic_addr_upper,
......
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