fix ethernet irq setting in system code for ap60/61
[openwrt/staging/mkresin.git] / openwrt / target / linux / aruba-2.6 / patches / 000-aruba.patch
index ad00045d338deb82d480ae04b96e6eecc0741a14..ce9cf2289f79f8e025248137d257261fe1f571e7 100644 (file)
@@ -487,7 +487,7 @@ diff -Nur linux-2.6.15/arch/mips/aruba/irq.c linux-2.6.15-openwrt/arch/mips/arub
 +              case MACH_ARUBA_AP60:
 +              default:
 +                      #define MERLOT_WLAN1_IRQ   2    // bit 10 in CP0_status register
-+                      #define MERLOT_ENET_IRQ    3    // bit 11 in CP0_status register
++                      #define MERLOT_ENET_IRQ    4    // bit 11 in CP0_status register
 +                      #define MERLOT_WLAN_IRQ    5    // bit 13 in CP0_status register
 +                      #define MERLOT_MISC_IRQ    6    // bit 14 in CP0_status register = GROUP 0
 +      
@@ -3873,7 +3873,7 @@ diff -Nur linux-2.6.15/drivers/pci/access.c linux-2.6.15-openwrt/drivers/pci/acc
 diff -Nur linux-2.6.15/include/asm-mips/bootinfo.h linux-2.6.15-openwrt/include/asm-mips/bootinfo.h
 --- linux-2.6.15/include/asm-mips/bootinfo.h   2006-01-03 04:21:10.000000000 +0100
 +++ linux-2.6.15-openwrt/include/asm-mips/bootinfo.h   2006-01-10 00:32:33.000000000 +0100
-@@ -218,6 +218,16 @@
+@@ -218,6 +218,17 @@
  #define MACH_GROUP_TITAN       22     /* PMC-Sierra Titan             */
  #define  MACH_TITAN_YOSEMITE  1       /* PMC-Sierra Yosemite          */
  
@@ -3886,6 +3886,7 @@ diff -Nur linux-2.6.15/include/asm-mips/bootinfo.h linux-2.6.15-openwrt/include/
 +#define  MACH_ARUBA_AP60      1
 +#define  MACH_ARUBA_AP65      2
 +#define  MACH_ARUBA_AP70      3
++#define  MACH_ARUBA_AP40      4
 +
  #define CL_SIZE                       COMMAND_LINE_SIZE
  
@@ -11748,3 +11749,103 @@ diff -Nur linux-2.6.15/Makefile linux-2.6.15-openwrt/Makefile
  
  # Cross compiling and selecting different set of gcc/bin-utils
  # ---------------------------------------------------------------------------
+diff -Nur linux-2.6.15/drivers/net/natsemi.c linux-2.6.15-openwrt/drivers/net/natsemi.c
+--- linux-2.6.15/drivers/net/natsemi.c 2006-01-02 19:21:10.000000000 -0800
++++ linux-2.6.15-openwrt/drivers/net/natsemi.c 2006-01-10 07:29:49.581994000 -0800
+@@ -771,6 +771,49 @@
+ static int netdev_get_eeprom(struct net_device *dev, u8 *buf);
+ static struct ethtool_ops ethtool_ops;
++#ifdef CONFIG_MACH_ARUBA
++
++#include <linux/ctype.h>
++
++#ifndef ERR
++#define ERR(fmt, args...) printk("%s: " fmt, __func__, ##args)
++#endif
++
++static int parse_mac_addr(struct net_device *dev, char* macstr)
++{
++        int i, j;
++        unsigned char result, value;
++
++        for (i=0; i<6; i++) {
++                result = 0;
++                if (i != 5 && *(macstr+2) != ':') {
++                        ERR("invalid mac address format: %d %c\n",
++                            i, *(macstr+2));
++                        return -EINVAL;
++                }
++                for (j=0; j<2; j++) {
++                        if (isxdigit(*macstr) && (value = isdigit(*macstr) ? *macstr-'0' :
++                                                  toupper(*macstr)-'A'+10) < 16) {
++                                result = result*16 + value;
++                                macstr++;
++                        }
++                        else {
++                                ERR("invalid mac address "
++                                    "character: %c\n", *macstr);
++                                return -EINVAL;
++                        }
++                }
++
++                macstr++;
++                dev->dev_addr[i] = result;
++        }
++
++      dev->dev_addr[5]++;
++        return 0;
++}
++
++#endif
++
+ static inline void __iomem *ns_ioaddr(struct net_device *dev)
+ {
+       return (void __iomem *) dev->base_addr;
+@@ -859,6 +902,7 @@
+               goto err_ioremap;
+       }
++#ifndef CONFIG_MACH_ARUBA
+       /* Work around the dropped serial bit. */
+       prev_eedata = eeprom_read(ioaddr, 6);
+       for (i = 0; i < 3; i++) {
+@@ -867,6 +911,19 @@
+               dev->dev_addr[i*2+1] = eedata >> 7;
+               prev_eedata = eedata;
+       }
++#else
++      {
++              char mac[32];
++              unsigned char def_mac[6] = {00, 0x0b, 0x86, 0xba, 0xdb, 0xad};
++              extern char *getenv(char *e);
++              memset(mac, 0, 32);
++              memcpy(mac, getenv("ethaddr"), 17);
++              if (parse_mac_addr(dev, mac)){
++                      printk("%s: MAC address not found\n", __func__);
++                      memcpy(dev->dev_addr, def_mac, 6);
++              }
++      }
++#endif
+       dev->base_addr = (unsigned long __force) ioaddr;
+       dev->irq = irq;
+diff -Nur linux-2.6.15/drivers/net/Makefile linux-2.6.15-openwrt/drivers/net/Makefile
+--- linux-2.6.15/drivers/net/Makefile  2006-01-13 09:19:55.000000000 -0800
++++ linux-2.6.15-openwrt/drivers/net/Makefile  2006-01-09 20:44:10.378339000 -0800
+@@ -35,6 +35,7 @@
+ obj-$(CONFIG_OAKNET) += oaknet.o 8390.o
++obj-$(CONFIG_IDT_RC32434_ETH) += rc32434_eth.o
+ obj-$(CONFIG_DGRS) += dgrs.o
+ obj-$(CONFIG_VORTEX) += 3c59x.o
+ obj-$(CONFIG_TYPHOON) += typhoon.o
+@@ -190,7 +189,6 @@
+ obj-$(CONFIG_SMC91X) += smc91x.o
+ obj-$(CONFIG_DM9000) += dm9000.o
+ obj-$(CONFIG_FEC_8XX) += fec_8xx/
+-obj-$(CONFIG_IDT_RC32434_ETH) += rc32434_eth.o
+ obj-$(CONFIG_ARM) += arm/
+ obj-$(CONFIG_DEV_APPLETALK) += appletalk/