9
0
Fork 0

dm9000: replace DM9000_WIDTH_8/16/32 by IORESOURCE_MEM_8/16/32BIT

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
This commit is contained in:
Jean-Christophe PLAGNIOL-VILLARD 2011-07-23 17:29:21 +08:00
parent aaefaddde3
commit 3465da7aa8
6 changed files with 10 additions and 14 deletions

View File

@ -89,7 +89,7 @@ static void ek_add_device_nand(void)
*/
#if defined(CONFIG_DRIVER_NET_DM9000)
static struct dm9000_platform_data dm9000_data = {
.buswidth = DM9000_WIDTH_16,
.buswidth = IORESOURCE_MEM_16BIT,
.srom = 0,
};

View File

@ -63,7 +63,7 @@ static struct device_d nand_dev = {
* Area 2: Offset 0x304...0x307
*/
static struct dm9000_platform_data dm9000_data = {
.buswidth = DM9000_WIDTH_16,
.buswidth = IORESOURCE_MEM_16BIT,
.srom = 1,
};

View File

@ -89,7 +89,7 @@ static void pm_add_device_nand(void)
*/
#if defined(CONFIG_DRIVER_NET_DM9000)
static struct dm9000_platform_data dm9000_data = {
.buswidth = DM9000_WIDTH_16,
.buswidth = IORESOURCE_MEM_16BIT,
.srom = 1,
};

View File

@ -35,7 +35,7 @@
#include <mach/devices-imx1.h>
static struct dm9000_platform_data dm9000_data = {
.buswidth = DM9000_WIDTH_16,
.buswidth = IORESOURCE_MEM_16BIT,
.srom = 1,
};

View File

@ -294,16 +294,16 @@ static int dm9000_eth_send (struct eth_device *edev,
writeb(DM9000_MWCMD, priv->iobase);
switch (priv->buswidth) {
case DM9000_WIDTH_8:
case IORESOURCE_MEM_8BIT:
for (i = 0; i < length; i++)
writeb(data_ptr[i] & 0xff, priv->iodata);
break;
case DM9000_WIDTH_16:
case IORESOURCE_MEM_16BIT:
tmplen = (length + 1) / 2;
for (i = 0; i < tmplen; i++)
writew(((u16 *)data_ptr)[i], priv->iodata);
break;
case DM9000_WIDTH_32:
case IORESOURCE_MEM_32BIT:
tmplen = (length + 3) / 4;
for (i = 0; i < tmplen; i++)
writel(((u32 *) data_ptr)[i], priv->iodata);
@ -371,20 +371,20 @@ static int dm9000_eth_rx (struct eth_device *edev)
/* Move data from DM9000 */
/* Read received packet from RX SRAM */
switch (priv->buswidth) {
case DM9000_WIDTH_8:
case IORESOURCE_MEM_8BIT:
RxStatus = readb(priv->iodata) + (readb(priv->iodata) << 8);
RxLen = readb(priv->iodata) + (readb(priv->iodata) << 8);
for (i = 0; i < RxLen; i++)
rdptr[i] = readb(priv->iodata);
break;
case DM9000_WIDTH_16:
case IORESOURCE_MEM_16BIT:
RxStatus = readw(priv->iodata);
RxLen = readw(priv->iodata);
tmplen = (RxLen + 1) / 2;
for (i = 0; i < tmplen; i++)
((u16 *) rdptr)[i] = readw(priv->iodata);
break;
case DM9000_WIDTH_32:
case IORESOURCE_MEM_32BIT:
tmpdata = readl(priv->iodata);
RxStatus = tmpdata;
RxLen = tmpdata >> 16;

View File

@ -2,10 +2,6 @@
#ifndef __DM9000_H__
#define __DM9000_H__
#define DM9000_WIDTH_8 1
#define DM9000_WIDTH_16 2
#define DM9000_WIDTH_32 3
struct dm9000_platform_data {
int buswidth;
int srom;