aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/u-boot/u-boot-1.1.4/u-boot-smc91x-multi.patch
diff options
context:
space:
mode:
Diffstat (limited to 'recipes/u-boot/u-boot-1.1.4/u-boot-smc91x-multi.patch')
-rw-r--r--recipes/u-boot/u-boot-1.1.4/u-boot-smc91x-multi.patch125
1 files changed, 125 insertions, 0 deletions
diff --git a/recipes/u-boot/u-boot-1.1.4/u-boot-smc91x-multi.patch b/recipes/u-boot/u-boot-1.1.4/u-boot-smc91x-multi.patch
new file mode 100644
index 0000000000..3f285e34dc
--- /dev/null
+++ b/recipes/u-boot/u-boot-1.1.4/u-boot-smc91x-multi.patch
@@ -0,0 +1,125 @@
+diff -u a/drivers/smc91111.c a/drivers/smc91111.c
+--- a/drivers/smc91111.c 2005-03-31 15:43:10.000000000 -0800
++++ a/drivers/smc91111.c 2005-04-13 13:48:41.000000000 -0700
+@@ -155,10 +155,14 @@
+ .
+ .------------------------------------------------------------------ */
+
++#ifndef CONFIG_NET_MULTI
+ extern int eth_init(bd_t *bd);
+ extern void eth_halt(void);
+ extern int eth_rx(void);
+ extern int eth_send(volatile void *packet, int length);
++#else
++extern int smc_initialize(bd_t *);
++#endif
+
+
+ /*
+@@ -797,6 +801,56 @@
+ }
+
+
++#ifdef CONFIG_NET_MULTI
++static int smc_multi_init(struct eth_device *, bd_t *);
++static void smc_multi_halt(struct eth_device *);
++static int smc_multi_send(struct eth_device *,volatile void *,int);
++static int smc_multi_recv(struct eth_device *);
++
++extern int smc_initialize(bd_t *bd)
++{
++ struct eth_device *dev;
++
++ dev = (struct eth_device *)malloc(sizeof(struct eth_device));
++ sprintf(dev->name, "SMC91C1111-%d",0);
++ dev->priv = NULL;
++ dev->iobase = SMC_BASE_ADDRESS;
++ dev->init = smc_multi_init;
++ dev->halt = smc_multi_halt;
++ dev->send = smc_multi_send;
++ dev->recv = smc_multi_recv;
++ eth_register(dev);
++
++ return 1; // number of cards detected
++}
++
++static int smc_multi_init(struct eth_device *dev, bd_t *bis)
++{
++ if(dev->priv == NULL)
++ {
++ smc_open(bis);
++ dev->priv = (void *)1;
++ }
++ return 1;
++}
++
++static void smc_multi_halt(struct eth_device *dev)
++{
++ // Not sure when we should actually close...
++ //smc_close();
++}
++
++static int smc_multi_send(struct eth_device *dev, volatile void *packet, int length)
++{
++ return smc_send_packet(packet, length);
++}
++
++static int smc_multi_recv(struct eth_device *dev)
++{
++ return smc_rcv();
++}
++#endif
++
+ /*
+ * Open and Initialize the board
+ *
+@@ -1505,6 +1559,7 @@
+ }
+ #endif
+
++#ifndef CONFIG_NET_MULTI
+ int eth_init(bd_t *bd) {
+ return (smc_open(bd));
+ }
+@@ -1520,6 +1575,7 @@
+ int eth_send(volatile void *packet, int length) {
+ return smc_send_packet(packet, length);
+ }
++#endif //CONFIG_NET_MULTI
+
+ int smc_get_ethaddr (bd_t * bd)
+ {
+--- a/lib_arm/board.c 2005-03-30 16:39:47.000000000 -0800
++++ a/lib_arm/board.c 2005-03-30 14:26:08.000000000 -0800
+@@ -278,6 +278,11 @@
+ /* initialize environment */
+ env_relocate ();
+
++#if (CONFIG_COMMANDS & CFG_CMD_NET) && defined(CONFIG_NET_MULTI)
++ /* must do after the environment variables are set up */
++ eth_initialize (NULL);
++#endif
++
+ #ifdef CONFIG_VFD
+ /* must do this after the framebuffer is allocated */
+ drv_vfd_init();
+--- a/net/eth.c 2004-12-16 09:49:38.000000000 -0800
++++ a/net/eth.c 2005-03-30 17:06:49.000000000 -0800
+@@ -53,6 +53,7 @@
+ extern int scc_initialize(bd_t*);
+ extern int skge_initialize(bd_t*);
+ extern int tsec_initialize(bd_t*, int, char *);
++extern int smc_initialize(bd_t*);
+
+ static struct eth_device *eth_devices, *eth_current;
+
+@@ -196,6 +197,9 @@
+ #if defined(CONFIG_RTL8169)
+ rtl8169_initialize(bis);
+ #endif
++#if defined(CONFIG_DRIVER_SMC91111)
++ smc_initialize(bis);
++#endif
+
+ if (!eth_devices) {
+ puts ("No ethernet found.\n");