add redboot parsing and rtl8169 fixes, enable r8169 and add the free ixp4xx ethernet driver - the later still needs fixes and testing for the gateway 7001

SVN-Revision: 5311
This commit is contained in:
Imre Kaloz 2006-10-27 12:32:10 +00:00
parent 2d2179f503
commit 93ab44d5d6
8 changed files with 3322 additions and 57 deletions

View file

@ -294,6 +294,32 @@ define KernelPackage/8139too
endef
$(eval $(call KernelPackage,8139too))
define KernelPackage/r8169
TITLE:=RealTek RTL-8169 PCI Gigabit Ethernet Adapter kernel support
DESCRIPTION:=\
Kernel modules for RealTek RTL-8169 PCI Gigabit Ethernet adapters.
FILES:=$(MODULES_DIR)/kernel/drivers/net/r8169.$(LINUX_KMOD_SUFFIX)
KCONFIG:=$(CONFIG_R8169)
DEPENDS:=@LINUX_2_6_X86
SUBMENU:=$(NDMENU)
AUTOLOAD:=$(call AutoLoad,50,r8169)
endef
$(eval $(call KernelPackage,r8169))
define KernelPackage/ixp4xx-npe
TITLE:=Intel(R) IXP4xx ethernet support
DESCRIPTION:=\
Kernel modules for Intel(R) IXP4xx onboard ethernet.
FILES:=$(MODULES_DIR)/kernel/drivers/net/ixp4xx/ixp4xx_npe.$(LINUX_KMOD_SUFFIX) \
$(MODULES_DIR)/kernel/drivers/net/ixp4xx/ixp4xx_qmgr.$(LINUX_KMOD_SUFFIX) \
$(MODULES_DIR)/kernel/drivers/net/ixp4xx/ixp4xx_mac.$(LINUX_KMOD_SUFFIX)
KCONFIG:=$(CONFIG_IXP4XX_MAC)
DEPENDS:=@LINUX_2_6_IXP4XX
SUBMENU:=$(NDMENU)
AUTOLOAD:=$(call AutoLoad,20,ixp4xx_npe ixp4xx_qmgr ixp4xx_mac)
endef
$(eval $(call KernelPackage,ixp4xx-npe))
define KernelPackage/e100
TITLE:=Intel(R) PRO/100+ cards kernel support
DESCRIPTION:=\

View file

@ -0,0 +1,61 @@
--- linux-2.6.18/drivers/mtd/redboot.c.orig 2006-10-23 11:41:56.000000000 -0400
+++ linux-2.6.18/drivers/mtd/redboot.c 2006-10-23 11:42:09.000000000 -0400
@@ -92,22 +92,47 @@
* swab32(erasesize) then we know we are looking at
* a byte swapped FIS directory - swap all the entries!
* (NOTE: this is 'size' not 'data_length'; size is
- * the full size of the entry.)
+ * the full size of the entry.)
+ *
+ * Handle cases where the FIS directory is less than
+ * a full erase block (like combine FIS directory
+ * and RedBoot config).
+ *
+ * IMHO the best solution would be to compute the
+ * flash address of the RedBoot FIS directory and
+ * compare that with the entry in the FIS directory
+ * entry swabbed. However, I haven't yet figured out
+ * how to compute that.
*/
- if (swab32(buf[i].size) == master->erasesize) {
+
+ unsigned long erasesize_mask = master->erasesize -1;
+ unsigned long eraseaddr_mask = 0xFFFFFFFF ^ erasesize_mask;
+
+ if (((swab32(buf[i].size)+erasesize_mask)
+ & eraseaddr_mask) == master->erasesize) {
int j;
- for (j = 0; j < numslots && buf[j].name[0] != 0xff; ++j) {
+
+ /* N.B. The full table being processed so adjust size now */
+ numslots = swab32(buf[i].size) / sizeof (struct fis_image_desc);
+ for (j = 0; j < numslots; ++j) {
/* The unsigned long fields were written with the
* wrong byte sex, name and pad have no byte sex.
- */
- swab32s(&buf[j].flash_base);
- swab32s(&buf[j].mem_base);
- swab32s(&buf[j].size);
- swab32s(&buf[j].entry_point);
- swab32s(&buf[j].data_length);
- swab32s(&buf[j].desc_cksum);
- swab32s(&buf[j].file_cksum);
+ *
+ * Only process non-deleted entries. Don't exit early.
+ */
+ if (buf[j].name[0] != 0xff) {
+ swab32s(&buf[j].flash_base);
+ swab32s(&buf[j].mem_base);
+ swab32s(&buf[j].size);
+ swab32s(&buf[j].entry_point);
+ swab32s(&buf[j].data_length);
+ swab32s(&buf[j].desc_cksum);
+ swab32s(&buf[j].file_cksum);
+ }
}
+ } else {
+ /* Update numslots based on actual FIS directory size */
+ numslots = buf[i].size / sizeof (struct fis_image_desc);
}
break;
}

View file

@ -0,0 +1,35 @@
diff -Nur linux-2.6.17/drivers/net/r8169.c linux-2.6.17-owrt/drivers/net/r8169.c
--- linux-2.6.17/drivers/net/r8169.c 2006-06-18 03:49:35.000000000 +0200
+++ linux-2.6.17-owrt/drivers/net/r8169.c 2006-10-27 13:18:46.000000000 +0200
@@ -483,7 +483,7 @@
#endif
static const u16 rtl8169_intr_mask =
- SYSErr | LinkChg | RxOverflow | RxFIFOOver | TxErr | TxOK | RxErr | RxOK;
+ LinkChg | RxOverflow | RxFIFOOver | TxErr | TxOK | RxErr | RxOK;
static const u16 rtl8169_napi_event =
RxOK | RxOverflow | RxFIFOOver | TxOK | TxErr;
static const unsigned int rtl8169_rx_config =
@@ -1832,8 +1832,8 @@
*/
RTL_W16(IntrMitigate, 0x0000);
- RTL_W32(TxDescStartAddrLow, ((u64) tp->TxPhyAddr & DMA_32BIT_MASK));
RTL_W32(TxDescStartAddrHigh, ((u64) tp->TxPhyAddr >> 32));
+ RTL_W32(TxDescStartAddrLow, ((u64) tp->TxPhyAddr & DMA_32BIT_MASK));
RTL_W32(RxDescAddrLow, ((u64) tp->RxPhyAddr & DMA_32BIT_MASK));
RTL_W32(RxDescAddrHigh, ((u64) tp->RxPhyAddr >> 32));
RTL_W8(Cfg9346, Cfg9346_Lock);
@@ -2535,10 +2535,12 @@
if (!(status & rtl8169_intr_mask))
break;
+#if 0
if (unlikely(status & SYSErr)) {
rtl8169_pcierr_interrupt(dev);
break;
}
+#endif
if (status & LinkChg)
rtl8169_check_link_status(dev, tp, ioaddr);

View file

@ -1,7 +1,7 @@
#
# Automatically generated make config: don't edit
# Linux kernel version: 2.6.17
# Sun Aug 6 11:18:40 2006
# Fri Oct 27 13:36:15 2006
#
CONFIG_ARM=y
CONFIG_MMU=y
@ -243,7 +243,7 @@ CONFIG_INET_AH=m
CONFIG_INET_ESP=m
CONFIG_INET_IPCOMP=m
CONFIG_INET_XFRM_TUNNEL=m
# CONFIG_INET_TUNNEL is not set
CONFIG_INET_TUNNEL=m
CONFIG_INET_DIAG=m
CONFIG_INET_TCP_DIAG=m
CONFIG_TCP_CONG_ADVANCED=y
@ -271,7 +271,7 @@ CONFIG_INET6_AH=m
CONFIG_INET6_ESP=m
CONFIG_INET6_IPCOMP=m
CONFIG_INET6_XFRM_TUNNEL=m
# CONFIG_INET6_TUNNEL is not set
CONFIG_INET6_TUNNEL=m
# CONFIG_IPV6_TUNNEL is not set
CONFIG_NETFILTER=y
# CONFIG_NETFILTER_DEBUG is not set
@ -385,7 +385,6 @@ CONFIG_IP6_NF_MATCH_AH=m
CONFIG_IP6_NF_FILTER=m
# CONFIG_IP6_NF_TARGET_LOG is not set
CONFIG_IP6_NF_TARGET_REJECT=m
CONFIG_IP6_NF_TARGET_ROUTE=m
# CONFIG_IP6_NF_MANGLE is not set
# CONFIG_IP6_NF_RAW is not set
@ -491,7 +490,7 @@ CONFIG_WIRELESS_EXT=y
#
CONFIG_STANDALONE=y
CONFIG_PREVENT_FIRMWARE_BUILD=y
CONFIG_FW_LOADER=m
CONFIG_FW_LOADER=y
#
# Connector - unified userspace <-> kernelspace linker
@ -732,6 +731,10 @@ CONFIG_IMQ_NUM_DEVS=2
#
CONFIG_NET_ETHERNET=y
CONFIG_MII=y
CONFIG_IXP4XX_QMGR=m
CONFIG_IXP4XX_NPE=m
CONFIG_IXP4XX_FW_LOAD=y
CONFIG_IXP4XX_MAC=m
# CONFIG_HAPPYMEAL is not set
# CONFIG_SUNGEM is not set
# CONFIG_CASSINI is not set
@ -827,7 +830,6 @@ CONFIG_HOSTAP_FIRMWARE=y
CONFIG_HOSTAP_FIRMWARE_NVRAM=y
CONFIG_HOSTAP_PLX=m
CONFIG_HOSTAP_PCI=m
CONFIG_HOSTAP_CS=m
CONFIG_NET_WIRELESS=y
#
@ -1347,16 +1349,16 @@ CONFIG_FRAME_POINTER=y
# Cryptographic options
#
CONFIG_CRYPTO=y
# CONFIG_CRYPTO_HMAC is not set
CONFIG_CRYPTO_HMAC=y
# CONFIG_CRYPTO_NULL is not set
# CONFIG_CRYPTO_MD4 is not set
# CONFIG_CRYPTO_MD5 is not set
# CONFIG_CRYPTO_SHA1 is not set
CONFIG_CRYPTO_MD5=m
CONFIG_CRYPTO_SHA1=m
# CONFIG_CRYPTO_SHA256 is not set
# CONFIG_CRYPTO_SHA512 is not set
# CONFIG_CRYPTO_WP512 is not set
# CONFIG_CRYPTO_TGR192 is not set
# CONFIG_CRYPTO_DES is not set
CONFIG_CRYPTO_DES=m
# CONFIG_CRYPTO_BLOWFISH is not set
# CONFIG_CRYPTO_TWOFISH is not set
# CONFIG_CRYPTO_SERPENT is not set
@ -1367,7 +1369,7 @@ CONFIG_CRYPTO_AES=m
CONFIG_CRYPTO_ARC4=m
# CONFIG_CRYPTO_KHAZAD is not set
# CONFIG_CRYPTO_ANUBIS is not set
# CONFIG_CRYPTO_DEFLATE is not set
CONFIG_CRYPTO_DEFLATE=m
CONFIG_CRYPTO_MICHAEL_MIC=m
# CONFIG_CRYPTO_CRC32C is not set
# CONFIG_CRYPTO_TEST is not set

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,36 @@
---
drivers/net/ixp4xx/ixp4xx_qmgr.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
--- linux-ixp4xx.orig/drivers/net/ixp4xx/ixp4xx_qmgr.c 2006-10-15 18:52:35.000000000 +0200
+++ linux-ixp4xx/drivers/net/ixp4xx/ixp4xx_qmgr.c 2006-10-15 18:54:32.000000000 +0200
@@ -107,7 +107,7 @@ static int get_free_qspace(struct qm_qmg
return -1;
}
-static inline int log2(int x)
+static inline int _log2(int x)
{
int r=0;
while(x>>=1)
@@ -127,7 +127,7 @@ static inline int log2(int x)
*/
static int conf_q_regs(struct qm_queue *queue)
{
- int bsize = log2(queue->len/16);
+ int bsize = _log2(queue->len/16);
int baddr = queue->addr + IX_QMGR_QCFG_SIZE;
/* +2, because baddr is in words and not in bytes */
@@ -141,8 +141,8 @@ void queue_set_watermarks(struct qm_queu
u32 val;
/* calculate the register values
* 0->0, 1->1, 2->2, 4->3, 8->4 16->5...*/
- ne = log2(ne<<1) & 0x7;
- nf = log2(nf<<1) & 0x7;
+ ne = _log2(ne<<1) & 0x7;
+ nf = _log2(nf<<1) & 0x7;
/* Mask out old watermarks */
val = queue_read_cfg_reg(queue) & ~0xfc000000;

View file

@ -1,6 +1,6 @@
diff -Nur linux-2.6.17/arch/arm/boot/compressed/head-xscale.S linux-2.6.17-owrt/arch/arm/boot/compressed/head-xscale.S
--- linux-2.6.17/arch/arm/boot/compressed/head-xscale.S 2006-06-18 03:49:35.000000000 +0200
+++ linux-2.6.17-owrt/arch/arm/boot/compressed/head-xscale.S 2006-08-05 17:02:21.000000000 +0200
--- linux-2.6.17/arch/arm/boot/compressed/head-xscale.S 2006-09-11 12:29:51.000000000 +0200
+++ linux-2.6.17-owrt/arch/arm/boot/compressed/head-xscale.S 2006-09-11 12:30:03.000000000 +0200
@@ -47,6 +47,11 @@
orr r7, r7, #(MACH_TYPE_GTWX5715 & 0xff00)
#endif
@ -13,44 +13,9 @@ diff -Nur linux-2.6.17/arch/arm/boot/compressed/head-xscale.S linux-2.6.17-owrt/
#ifdef CONFIG_ARCH_IXP2000
mov r1, #-1
mov r0, #0xd6000000
diff -Nur linux-2.6.17/arch/arm/mach-ixp4xx/coyote-setup.c linux-2.6.17-owrt/arch/arm/mach-ixp4xx/coyote-setup.c
--- linux-2.6.17/arch/arm/mach-ixp4xx/coyote-setup.c 2006-06-18 03:49:35.000000000 +0200
+++ linux-2.6.17-owrt/arch/arm/mach-ixp4xx/coyote-setup.c 2006-08-05 17:02:21.000000000 +0200
@@ -1,9 +1,10 @@
/*
* arch/arm/mach-ixp4xx/coyote-setup.c
*
- * Board setup for ADI Engineering and IXDGP425 boards
+ * Board setup for ADI Engineering, IXDGP425 and Gateway 7001 boards
*
* Copyright (C) 2003-2005 MontaVista Software, Inc.
+ * Copyright (C) 2006 Imre Kaloz <Kaloz@openwrt.org>
*
* Author: Deepak Saxena <dsaxena@plexity.net>
*/
@@ -111,6 +112,19 @@
MACHINE_END
#endif
+#ifdef CONFIG_MACH_GATEWAY7001
+MACHINE_START(GATEWAY7001, "Gateway 7001")
+ /* Maintainer: Imre Kaloz <kaloz@openwrt.org> */
+ .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS,
+ .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc,
+ .map_io = ixp4xx_map_io,
+ .init_irq = ixp4xx_init_irq,
+ .timer = &ixp4xx_timer,
+ .boot_params = 0x0100,
+ .init_machine = coyote_init,
+MACHINE_END
+#endif
+
/*
* IXDPG425 is identical to Coyote except for which serial port
* is connected.
diff -Nur linux-2.6.17/arch/arm/mach-ixp4xx/gateway7001-pci.c linux-2.6.17-owrt/arch/arm/mach-ixp4xx/gateway7001-pci.c
--- linux-2.6.17/arch/arm/mach-ixp4xx/gateway7001-pci.c 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.17-owrt/arch/arm/mach-ixp4xx/gateway7001-pci.c 2006-08-06 10:37:35.000000000 +0200
+++ linux-2.6.17-owrt/arch/arm/mach-ixp4xx/gateway7001-pci.c 2006-09-11 12:30:03.000000000 +0200
@@ -0,0 +1,67 @@
+/*
+ * arch/arch/mach-ixp4xx/gateway7001-pci.c
@ -120,8 +85,8 @@ diff -Nur linux-2.6.17/arch/arm/mach-ixp4xx/gateway7001-pci.c linux-2.6.17-owrt/
+
+subsys_initcall(gateway7001_pci_init);
diff -Nur linux-2.6.17/arch/arm/mach-ixp4xx/Kconfig linux-2.6.17-owrt/arch/arm/mach-ixp4xx/Kconfig
--- linux-2.6.17/arch/arm/mach-ixp4xx/Kconfig 2006-06-18 03:49:35.000000000 +0200
+++ linux-2.6.17-owrt/arch/arm/mach-ixp4xx/Kconfig 2006-08-05 17:04:13.000000000 +0200
--- linux-2.6.17/arch/arm/mach-ixp4xx/Kconfig 2006-09-11 12:29:51.000000000 +0200
+++ linux-2.6.17-owrt/arch/arm/mach-ixp4xx/Kconfig 2006-09-11 12:30:03.000000000 +0200
@@ -33,6 +33,14 @@
Engineering Coyote Gateway Reference Platform. For more
information on this platform, see <file:Documentation/arm/IXP4xx>.
@ -138,8 +103,8 @@ diff -Nur linux-2.6.17/arch/arm/mach-ixp4xx/Kconfig linux-2.6.17-owrt/arch/arm/m
bool "IXDP425"
select PCI
diff -Nur linux-2.6.17/arch/arm/mach-ixp4xx/Makefile linux-2.6.17-owrt/arch/arm/mach-ixp4xx/Makefile
--- linux-2.6.17/arch/arm/mach-ixp4xx/Makefile 2006-06-18 03:49:35.000000000 +0200
+++ linux-2.6.17-owrt/arch/arm/mach-ixp4xx/Makefile 2006-08-05 17:02:21.000000000 +0200
--- linux-2.6.17/arch/arm/mach-ixp4xx/Makefile 2006-09-11 12:29:51.000000000 +0200
+++ linux-2.6.17-owrt/arch/arm/mach-ixp4xx/Makefile 2006-09-11 12:30:03.000000000 +0200
@@ -11,4 +11,5 @@
obj-$(CONFIG_MACH_GTWX5715) += gtwx5715-pci.o gtwx5715-setup.o
obj-$(CONFIG_MACH_NSLU2) += nslu2-pci.o nslu2-setup.o nslu2-power.o
@ -147,17 +112,111 @@ diff -Nur linux-2.6.17/arch/arm/mach-ixp4xx/Makefile linux-2.6.17-owrt/arch/arm/
+obj-$(CONFIG_MACH_GATEWAY7001) += gateway7001-pci.o coyote-setup.o
diff -Nur linux-2.6.17/include/asm-arm/arch-ixp4xx/uncompress.h linux-2.6.17-owrt/include/asm-arm/arch-ixp4xx/uncompress.h
--- linux-2.6.17/include/asm-arm/arch-ixp4xx/uncompress.h 2006-06-18 03:49:35.000000000 +0200
+++ linux-2.6.17-owrt/include/asm-arm/arch-ixp4xx/uncompress.h 2006-08-05 17:03:32.000000000 +0200
--- linux-2.6.17/include/asm-arm/arch-ixp4xx/uncompress.h 2006-09-11 12:29:51.000000000 +0200
+++ linux-2.6.17-owrt/include/asm-arm/arch-ixp4xx/uncompress.h 2006-09-11 12:31:21.000000000 +0200
@@ -38,9 +38,9 @@
static __inline__ void __arch_decomp_setup(unsigned long arch_id)
{
/*
- * Coyote and gtwx5715 only have UART2 connected
+ * Some targets only have UART2 connected
+ * Some boards only have UART2 connected
*/
- if (machine_is_adi_coyote() || machine_is_gtwx5715())
+ if (machine_is_adi_coyote() || machine_is_gtwx5715() || machine_is_gateway7001())
uart_base = (volatile u32*) IXP4XX_UART2_BASE_PHYS;
else
uart_base = (volatile u32*) IXP4XX_UART1_BASE_PHYS;
diff -Nur linux-2.6.17/arch/arm/mach-ixp4xx/coyote-setup.c linux-2.6.17-owrt/arch/arm/mach-ixp4xx/coyote-setup.c
--- linux-2.6.17/arch/arm/mach-ixp4xx/coyote-setup.c 2006-09-11 12:29:51.000000000 +0200
+++ linux-2.6.17-owrt/arch/arm/mach-ixp4xx/coyote-setup.c 2006-09-11 12:37:51.000000000 +0200
@@ -1,9 +1,10 @@
/*
* arch/arm/mach-ixp4xx/coyote-setup.c
*
- * Board setup for ADI Engineering and IXDGP425 boards
+ * Board setup for ADI Engineering, IXDGP425 and Gateway 7001 boards
*
* Copyright (C) 2003-2005 MontaVista Software, Inc.
+ * Copyright (C) 2006 Imre Kaloz <Kaloz@openwrt.org>
*
* Author: Deepak Saxena <dsaxena@plexity.net>
*/
@@ -73,9 +74,57 @@
.resource = &coyote_uart_resource,
};
+/* MACs */
+static struct resource res_mac0 = {
+ .start = IXP4XX_EthB_BASE_PHYS,
+ .end = IXP4XX_EthB_BASE_PHYS + 0x1ff,
+ .flags = IORESOURCE_MEM,
+};
+
+static struct resource res_mac1 = {
+ .start = IXP4XX_EthC_BASE_PHYS,
+ .end = IXP4XX_EthC_BASE_PHYS + 0x1ff,
+ .flags = IORESOURCE_MEM,
+};
+
+static struct mac_plat_info plat_mac0 = {
+ .npe_id = 1,
+ .phy_id = 0,
+ .eth_id = 0,
+ .rxq_id = 27,
+ .txq_id = 24,
+};
+
+static struct mac_plat_info plat_mac1 = {
+ .npe_id = 2,
+ .phy_id = 1,
+ .eth_id = 1,
+ .rxq_id = 28,
+ .txq_id = 25,
+};
+
+static struct platform_device mac0 = {
+ .name = "ixp4xx_mac",
+ .id = 0,
+ .dev.platform_data = &plat_mac0,
+ .num_resources = 1,
+ .resource = &res_mac0,
+};
+
+static struct platform_device mac1 = {
+ .name = "ixp4xx_mac",
+ .id = 1,
+ .dev.platform_data = &plat_mac1,
+ .num_resources = 1,
+ .resource = &res_mac1,
+};
+
+
static struct platform_device *coyote_devices[] __initdata = {
&coyote_flash,
- &coyote_uart
+ &coyote_uart,
+ &mac0,
+ &mac1
};
static void __init coyote_init(void)
@@ -111,6 +160,19 @@
MACHINE_END
#endif
+#ifdef CONFIG_MACH_GATEWAY7001
+MACHINE_START(GATEWAY7001, "Gateway 7001")
+ /* Maintainer: Imre Kaloz <kaloz@openwrt.org> */
+ .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS,
+ .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc,
+ .map_io = ixp4xx_map_io,
+ .init_irq = ixp4xx_init_irq,
+ .timer = &ixp4xx_timer,
+ .boot_params = 0x0100,
+ .init_machine = coyote_init,
+MACHINE_END
+#endif
+
/*
* IXDPG425 is identical to Coyote except for which serial port
* is connected.

View file

@ -1060,7 +1060,7 @@ CONFIG_E1000=m
# CONFIG_NS83820 is not set
# CONFIG_HAMACHI is not set
# CONFIG_YELLOWFIN is not set
# CONFIG_R8169 is not set
CONFIG_R8169=m
CONFIG_SIS190=m
# CONFIG_SKGE is not set
# CONFIG_SKY2 is not set