summaryrefslogtreecommitdiff
path: root/drivers/net/cs8900.h
diff options
context:
space:
mode:
authorBen Warren <biggerbadderben@gmail.com>2009-08-25 13:09:37 -0700
committerBen Warren <biggerbadderben@gmail.com>2009-08-25 13:35:54 -0700
commitb1c0eaac110bc919e5b4e88821348e714493f266 (patch)
tree83afd97b738803932cef748fd4de3e82e4ef259a /drivers/net/cs8900.h
parentd47628a6ecf80cd4584a50b6c795b90c985a48e5 (diff)
downloadu-boot-imx-b1c0eaac110bc919e5b4e88821348e714493f266.zip
u-boot-imx-b1c0eaac110bc919e5b4e88821348e714493f266.tar.gz
u-boot-imx-b1c0eaac110bc919e5b4e88821348e714493f266.tar.bz2
Convert CS8900 Ethernet driver to CONFIG_NET_MULTI API
All in-tree boards that use this controller have CONFIG_NET_MULTI added Also: - changed CONFIG_DRIVER_CS8900 to CONFIG_CS8900 - changed CS8900_BASE to CONFIG_CS8900_BASE - changed CS8900_BUS?? to CONFIG_CS8900_BUS?? - cleaned up line lengths - modified VCMA9 command function that accesses the device - removed MAC address initialization from lib_arm/board.c Signed-off-by: Ben Warren <biggerbadderben@gmail.com> Tested-by: Wolfgang Denk <wd@denx.de> Acked-by: Wolfgang Denk <wd@denx.de>
Diffstat (limited to 'drivers/net/cs8900.h')
-rw-r--r--drivers/net/cs8900.h41
1 files changed, 24 insertions, 17 deletions
diff --git a/drivers/net/cs8900.h b/drivers/net/cs8900.h
index f9c32dd..23c5cb0 100644
--- a/drivers/net/cs8900.h
+++ b/drivers/net/cs8900.h
@@ -1,6 +1,11 @@
+#ifndef CS8900_H
+#define CS8900_H
/*
* Cirrus Logic CS8900A Ethernet
*
+ * (C) 2009 Ben Warren , biggerbadderben@gmail.com
+ * Converted to use CONFIG_NET_MULTI API
+ *
* (C) Copyright 2002
* Sysgo Real-Time Solutions, GmbH <www.elinos.com>
* Marius Groeger <mgroeger@sysgo.de>
@@ -35,33 +40,34 @@
#include <asm/types.h>
#include <config.h>
-#ifdef CONFIG_DRIVER_CS8900
-
+#define CS8900_DRIVERNAME "CS8900"
/* although the registers are 16 bit, they are 32-bit aligned on the
EDB7111. so we have to read them as 32-bit registers and ignore the
upper 16-bits. i'm not sure if this holds for the EDB7211. */
-#ifdef CS8900_BUS16
+#ifdef CONFIG_CS8900_BUS16
/* 16 bit aligned registers, 16 bit wide */
#define CS8900_REG u16
- #define CS8900_OFF 0x02
- #define CS8900_BUS16_0 *(volatile u8 *)(CS8900_BASE+0x00)
- #define CS8900_BUS16_1 *(volatile u8 *)(CS8900_BASE+0x01)
-#elif defined(CS8900_BUS32)
+#elif defined(CONFIG_CS8900_BUS32)
/* 32 bit aligned registers, 16 bit wide (we ignore upper 16 bits) */
#define CS8900_REG u32
- #define CS8900_OFF 0x04
#else
#error unknown bussize ...
#endif
-#define CS8900_RTDATA *(volatile CS8900_REG *)(CS8900_BASE+0x00*CS8900_OFF)
-#define CS8900_TxCMD *(volatile CS8900_REG *)(CS8900_BASE+0x02*CS8900_OFF)
-#define CS8900_TxLEN *(volatile CS8900_REG *)(CS8900_BASE+0x03*CS8900_OFF)
-#define CS8900_ISQ *(volatile CS8900_REG *)(CS8900_BASE+0x04*CS8900_OFF)
-#define CS8900_PPTR *(volatile CS8900_REG *)(CS8900_BASE+0x05*CS8900_OFF)
-#define CS8900_PDATA *(volatile CS8900_REG *)(CS8900_BASE+0x06*CS8900_OFF)
+struct cs8900_regs {
+ CS8900_REG rtdata;
+ CS8900_REG pad0;
+ CS8900_REG txcmd;
+ CS8900_REG txlen;
+ CS8900_REG isq;
+ CS8900_REG pptr;
+ CS8900_REG pdata;
+};
+struct cs8900_priv {
+ struct cs8900_regs *regs;
+};
#define ISQ_RxEvent 0x04
#define ISQ_TxEvent 0x08
@@ -251,7 +257,8 @@
#define EEPROM_READ_CMD 0x0200
#define EEPROM_ERASE_CMD 0x0300
-extern int cs8900_e2prom_read(uchar, ushort *);
-extern int cs8900_e2prom_write(uchar, ushort);
+/* Exported functions */
+int cs8900_e2prom_read(struct eth_device *dev, uchar, ushort *);
+int cs8900_e2prom_write(struct eth_device *dev, uchar, ushort);
-#endif /* CONFIG_DRIVER_CS8900 */
+#endif /* CS8900_H */