1
0
mirror of git://projects.qi-hardware.com/openwrt-xburst.git synced 2024-11-28 22:49:43 +02:00
openwrt-xburst/target/linux/aruba-2.6/patches/000-aruba.patch
kaloz 685bac6aca fix aruba compile for .21
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@7327 3c298f89-4303-0410-b956-a3cf2f4a3e73
2007-05-24 09:43:58 +00:00

216 lines
7.1 KiB
Diff

diff -Nur linux-2.6.21.1/arch/mips/Kconfig linux-2.6.21.1-owrt/arch/mips/Kconfig
--- linux-2.6.21.1/arch/mips/Kconfig 2007-04-27 23:49:26.000000000 +0200
+++ linux-2.6.21.1-owrt/arch/mips/Kconfig 2007-05-23 23:34:01.000000000 +0200
@@ -220,6 +220,17 @@
<http://www.marvell.com/>. Say Y here if you wish to build a
kernel for this platform.
+config MACH_ARUBA
+ bool "Support for the ARUBA product line"
+ select DMA_NONCOHERENT
+ select CPU_HAS_PREFETCH
+ select HW_HAS_PCI
+ select SWAP_IO_SPACE
+ select SYS_SUPPORTS_32BIT_KERNEL
+ select SYS_HAS_CPU_MIPS32_R1
+ select SYS_SUPPORTS_BIG_ENDIAN
+
+
config MACH_JAZZ
bool "Jazz family of machines"
select ARC
diff -Nur linux-2.6.21.1/arch/mips/Makefile linux-2.6.21.1-owrt/arch/mips/Makefile
--- linux-2.6.21.1/arch/mips/Makefile 2007-04-27 23:49:26.000000000 +0200
+++ linux-2.6.21.1-owrt/arch/mips/Makefile 2007-05-23 23:34:01.000000000 +0200
@@ -158,6 +158,14 @@
#
#
+# Aruba
+#
+
+core-$(CONFIG_MACH_ARUBA) += arch/mips/aruba/
+cflags-$(CONFIG_MACH_ARUBA) += -Iinclude/asm-mips/aruba
+load-$(CONFIG_MACH_ARUBA) += 0x80100000
+
+#
# Acer PICA 61, Mips Magnum 4000 and Olivetti M700.
#
core-$(CONFIG_MACH_JAZZ) += arch/mips/jazz/
diff -Nur linux-2.6.21.1/drivers/net/Kconfig linux-2.6.21.1-owrt/drivers/net/Kconfig
--- linux-2.6.21.1/drivers/net/Kconfig 2007-04-27 23:49:26.000000000 +0200
+++ linux-2.6.21.1-owrt/drivers/net/Kconfig 2007-05-24 10:45:57.000000000 +0200
@@ -201,6 +201,13 @@
source "drivers/net/arm/Kconfig"
+config IDT_RC32434_ETH
+ tristate "IDT RC32434 Local Ethernet support"
+ depends on NET_ETHERNET
+ help
+ IDT RC32434 has one local ethernet port. Say Y here to enable it.
+ To compile this driver as a module, choose M here.
+
config MACE
tristate "MACE (Power Mac ethernet) support"
depends on NET_ETHERNET && PPC_PMAC && PPC32
diff -Nur linux-2.6.21.1/drivers/net/Makefile linux-2.6.21.1-owrt/drivers/net/Makefile
--- linux-2.6.21.1/drivers/net/Makefile 2007-04-27 23:49:26.000000000 +0200
+++ linux-2.6.21.1-owrt/drivers/net/Makefile 2007-05-24 10:45:57.000000000 +0200
@@ -38,6 +38,7 @@
obj-$(CONFIG_MACE) += mace.o
obj-$(CONFIG_BMAC) += bmac.o
+obj-$(CONFIG_IDT_RC32434_ETH) += rc32434_eth.o
obj-$(CONFIG_DGRS) += dgrs.o
obj-$(CONFIG_VORTEX) += 3c59x.o
obj-$(CONFIG_TYPHOON) += typhoon.o
diff -Nur linux-2.6.21.1/drivers/net/natsemi.c linux-2.6.21.1-owrt/drivers/net/natsemi.c
--- linux-2.6.21.1/drivers/net/natsemi.c 2007-04-27 23:49:26.000000000 +0200
+++ linux-2.6.21.1-owrt/drivers/net/natsemi.c 2007-05-23 23:34:01.000000000 +0200
@@ -656,6 +656,49 @@
static int netdev_get_eeprom(struct net_device *dev, u8 *buf);
static const 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;
@@ -794,6 +837,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++) {
@@ -802,6 +846,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.21.1/include/asm-mips/bootinfo.h linux-2.6.21.1-owrt/include/asm-mips/bootinfo.h
--- linux-2.6.21.1/include/asm-mips/bootinfo.h 2007-04-27 23:49:26.000000000 +0200
+++ linux-2.6.21.1-owrt/include/asm-mips/bootinfo.h 2007-05-23 23:34:01.000000000 +0200
@@ -213,6 +213,17 @@
#define MACH_GROUP_NEC_EMMA2RH 25 /* NEC EMMA2RH (was 23) */
#define MACH_NEC_MARKEINS 0 /* NEC EMMA2RH Mark-eins */
+
+/*
+ * Valid machtype for group ARUBA
+ */
+#define MACH_GROUP_ARUBA 23
+#define MACH_ARUBA_UNKNOWN 0
+#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
const char *get_system_type(void);
diff -Nur linux-2.6.21.1/include/asm-mips/cpu.h linux-2.6.21.1-owrt/include/asm-mips/cpu.h
--- linux-2.6.21.1/include/asm-mips/cpu.h 2007-04-27 23:49:26.000000000 +0200
+++ linux-2.6.21.1-owrt/include/asm-mips/cpu.h 2007-05-23 23:34:01.000000000 +0200
@@ -54,6 +54,9 @@
#define PRID_IMP_R14000 0x0f00
#define PRID_IMP_R8000 0x1000
#define PRID_IMP_PR4450 0x1200
+#define PRID_IMP_RC32334 0x1800
+#define PRID_IMP_RC32355 0x1900
+#define PRID_IMP_RC32365 0x1900
#define PRID_IMP_R4600 0x2000
#define PRID_IMP_R4700 0x2100
#define PRID_IMP_TX39 0x2200
@@ -200,7 +203,8 @@
#define CPU_SB1A 62
#define CPU_74K 63
#define CPU_R14000 64
-#define CPU_LAST 64
+#define CPU_RC32300 65
+#define CPU_LAST 65
/*
* ISA Level encodings
diff -Nur linux-2.6.21.1/include/asm-mips/mach-generic/irq.h linux-2.6.21.1-owrt/include/asm-mips/mach-generic/irq.h
--- linux-2.6.21.1/include/asm-mips/mach-generic/irq.h 2007-04-27 23:49:26.000000000 +0200
+++ linux-2.6.21.1-owrt/include/asm-mips/mach-generic/irq.h 2007-05-23 23:35:55.000000000 +0200
@@ -9,7 +9,7 @@
#define __ASM_MACH_GENERIC_IRQ_H
#ifndef NR_IRQS
-#define NR_IRQS 128
+#define NR_IRQS 256
#endif
#ifdef CONFIG_I8259
diff -Nur linux-2.6.21.1/include/linux/kernel.h linux-2.6.21.1-owrt/include/linux/kernel.h
--- linux-2.6.21.1/include/linux/kernel.h 2007-04-27 23:49:26.000000000 +0200
+++ linux-2.6.21.1-owrt/include/linux/kernel.h 2007-05-23 23:34:01.000000000 +0200
@@ -334,6 +334,7 @@
};
/* Force a compilation error if condition is true */
+extern void BUILD_BUG(void);
#define BUILD_BUG_ON(condition) ((void)sizeof(char[1 - 2*!!(condition)]))
/* Force a compilation error if condition is true, but also produce a