summaryrefslogtreecommitdiff
path: root/board/micronas
diff options
context:
space:
mode:
authorBen Warren <biggerbadderben@gmail.com>2009-07-20 22:01:11 -0700
committerBen Warren <biggerbadderben@gmail.com>2009-07-22 22:53:44 -0700
commit736fead8fdbf8a8407048bebc373cd551d01ec98 (patch)
tree60307d25c8dd18cbdf7e3b3807f924b838cee9fb /board/micronas
parent3bd0a877b74b9c005ae7cb892480ccedfa308c20 (diff)
downloadu-boot-imx-736fead8fdbf8a8407048bebc373cd551d01ec98.zip
u-boot-imx-736fead8fdbf8a8407048bebc373cd551d01ec98.tar.gz
u-boot-imx-736fead8fdbf8a8407048bebc373cd551d01ec98.tar.bz2
Convert SMC911X Ethernet driver to CONFIG_NET_MULTI API
All in-tree boards that use this controller have CONFIG_NET_MULTI added Also: - changed CONFIG_DRIVER_SMC911X* to CONFIG_SMC911X* - cleaned up line lengths - modified all boards that override weak function in this driver - added Signed-off-by: Ben Warren <biggerbadderben@gmail.com> Tested-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'board/micronas')
-rw-r--r--board/micronas/vct/ebi_smc911x.c22
-rw-r--r--board/micronas/vct/vct.c10
2 files changed, 28 insertions, 4 deletions
diff --git a/board/micronas/vct/ebi_smc911x.c b/board/micronas/vct/ebi_smc911x.c
index e1b67a0..c9ef33d 100644
--- a/board/micronas/vct/ebi_smc911x.c
+++ b/board/micronas/vct/ebi_smc911x.c
@@ -18,6 +18,7 @@
*/
#include <common.h>
+#include <netdev.h>
#include <asm/io.h>
#include "vct.h"
@@ -45,10 +46,11 @@ int ebi_init_smc911x(void)
* Accessor functions replacing the "weak" functions in
* drivers/net/smc911x.c
*/
-u32 smc911x_reg_read(u32 addr)
+u32 smc911x_reg_read(struct eth_device *dev, u32 addr)
{
volatile u32 data;
+ addr += dev->iobase;
reg_write(EBI_DEV1_CONFIG2(EBI_BASE), 0x0000004F);
ebi_wait();
reg_write(EBI_CPU_IO_ACCS(EBI_BASE), (EXT_DEVICE_CHANNEL_1 | addr));
@@ -58,8 +60,9 @@ u32 smc911x_reg_read(u32 addr)
return (data);
}
-void smc911x_reg_write(u32 addr, u32 data)
+void smc911x_reg_write(struct eth_device *dev, u32 addr, u32 data)
{
+ addr += dev->iobase;
reg_write(EBI_DEV1_CONFIG2(EBI_BASE), 0x0000004F);
ebi_wait();
reg_write(EBI_IO_ACCS_DATA(EBI_BASE), data);
@@ -68,8 +71,9 @@ void smc911x_reg_write(u32 addr, u32 data)
ebi_wait();
}
-void pkt_data_push(u32 addr, u32 data)
+void pkt_data_push(struct eth_device *dev, u32 addr, u32 data)
{
+ addr += dev->iobase;
reg_write(EBI_DEV1_CONFIG2(EBI_BASE), 0x0000004A);
ebi_wait();
reg_write(EBI_IO_ACCS_DATA(EBI_BASE), data);
@@ -80,10 +84,11 @@ void pkt_data_push(u32 addr, u32 data)
return;
}
-u32 pkt_data_pull(u32 addr)
+u32 pkt_data_pull(struct eth_device *dev, u32 addr)
{
volatile u32 data;
+ addr += dev->iobase;
reg_write(EBI_DEV1_CONFIG2(EBI_BASE), 0x0000004A);
ebi_wait();
reg_write(EBI_CPU_IO_ACCS(EBI_BASE), (EXT_DEVICE_CHANNEL_1 | addr));
@@ -92,3 +97,12 @@ u32 pkt_data_pull(u32 addr)
return data;
}
+
+int board_eth_init(bd_t *bis)
+{
+ int rc = 0;
+#ifdef CONFIG_SMC911X
+ rc = smc911x_initialize(0, CONFIG_DRIVER_SMC911X_BASE);
+#endif
+ return rc;
+}
diff --git a/board/micronas/vct/vct.c b/board/micronas/vct/vct.c
index d320e0b..7fc3507 100644
--- a/board/micronas/vct/vct.c
+++ b/board/micronas/vct/vct.c
@@ -21,6 +21,7 @@
#include <common.h>
#include <command.h>
+#include <netdev.h>
#include <asm/mipsregs.h>
#include "vct.h"
@@ -115,3 +116,12 @@ int checkboard(void)
return 0;
}
+
+int board_eth_init(bd_t *bis)
+{
+ int rc = 0;
+#ifdef CONFIG_SMC911X
+ rc = smc911x_initialize(0, CONFIG_SMC911X_BASE);
+#endif
+ return rc;
+}