* upgrade ixp4xx to 2.6.23.12 * upgrade to the new ethernet driver (temporary breaks Marvell switch support on Compex units) * handle NPE microcodes in a user friendly way - YAY for Intel for changing the license * add support for the Lanready AP1000 (used in for example the Ligowave LGO2AGN)

SVN-Revision: 10016
owl
Imre Kaloz 2007-12-28 21:00:01 +00:00
parent 91c42459f5
commit efadab3747
47 changed files with 8289 additions and 81 deletions

View File

@ -0,0 +1,57 @@
#
# Copyright (C) 2007 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=ixp4xx-microcode
PKG_VERSION:=2.4
PKG_RELEASE:=1
PKG_SOURCE:=IPL_ixp400NpeLibrary-2_4.zip
PKG_SOURCE_URL:=http://downloadmirror.intel.com/12954/eng/
PKG_MD5SUM:=9a6dc3846041b899edf9eff8a906fb11
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
include $(INCLUDE_DIR)/package.mk
define Package/ixp4xx-microcode
SECTION:=net
CATEGORY:=Network
TITLE:=Microcode for the IXP4xx network engines
DEPENDS:=@TARGET_ixp4xx
endef
define Package/ixp4xx-microcode/description
This package contains the microcode needed to use the network engines in IXP4xx CPUs
endef
define Build/Prepare
rm -rf $(PKG_BUILD_DIR)
mkdir -p $(PKG_BUILD_DIR)
unzip -d $(PKG_BUILD_DIR)/ $(DL_DIR)/$(PKG_SOURCE)
mv $(PKG_BUILD_DIR)/ixp400_xscale_sw/src/npeDl/IxNpeMicrocode.c $(PKG_BUILD_DIR)/
rm -rf $(PKG_BUILD_DIR)/ixp400_xscale_sw
$(CP) ./src/* $(PKG_BUILD_DIR)/
endef
define Build/Compile
(cd $(PKG_BUILD_DIR); \
$(HOSTCC) -Wall IxNpeMicrocode.c -o IxNpeMicrocode; \
./IxNpeMicrocode -be \
)
endef
define Package/ixp4xx-microcode/install
$(INSTALL_DIR) $(1)/lib/firmware
$(INSTALL_DIR) $(1)/usr/share/doc
$(INSTALL_BIN) $(PKG_BUILD_DIR)/NPE-B $(1)/lib/firmware/
$(INSTALL_BIN) $(PKG_BUILD_DIR)/NPE-C $(1)/lib/firmware/
$(INSTALL_DATA) $(PKG_BUILD_DIR)/LICENSE.IPL $(1)/usr/share/doc/
endef
$(eval $(call BuildPackage,ixp4xx-microcode))

View File

@ -0,0 +1,27 @@
INTEL(R) SOFTWARE LICENSE AGREEMENT
Copyright (c) 2007, Intel Corporation.
All rights reserved.
Redistribution. Redistribution and use in binary form, without modification, are permitted
provided that the following conditions are met:
o Redistributions must reproduce the above copyright notice and the following disclaimer in the
documentation and/or other materials provided with the distribution.
o Neither the name of Intel Corporation nor the names of its suppliers may be used to endorse
or promote products derived from this software without specific prior written permission.
o No reverse engineering, decompilation, or disassembly of this software is permitted.
Limited patent license. Intel Corporation grants a world-wide, royalty-free, non-exclusive
license under patents it now or hereafter owns or controls to make, have made, use, import,
offer to sell and sell (.Utilize.) this software, but solely to the extent that any such patent is
necessary to Utilize the software alone. The patent license shall not apply to any combinations
which include this software. No hardware per se is licensed hereunder.
DISCLAIMER. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
OF SUCH DAMAGE.

View File

@ -22,7 +22,7 @@
# NOTE: for now it's for only IXP4xx in big endian mode
# list of supported boards, in "boardname machtypeid" format
for board in "avila 526" "gateway7001 731" "nslu2 597" "nas100d 865" "wg302v2 890" "pronghornmetro 1040" "compex 1273" "wrt300nv2 1077" "loft 849" "dsmg600 964" "fsg3 1091"
for board in "avila 526" "gateway7001 731" "nslu2 597" "nas100d 865" "wg302v2 890" "pronghornmetro 1040" "compex 1273" "wrt300nv2 1077" "loft 849" "dsmg600 964" "fsg3 1091" "ap1000 1543"
do
set -- $board
hexid=$(printf %x\\n $2)

View File

@ -12,8 +12,10 @@ BOARDNAME:=Intel XScale IXP4xx
FEATURES:=squashfs
SUBTARGETS=generic harddisk
LINUX_VERSION:=2.6.21.7
LINUX_VERSION:=2.6.23.12
include $(INCLUDE_DIR)/target.mk
DEFAULT_PACKAGES += ixp4xx-microcode
$(eval $(call BuildTarget))

View File

@ -28,6 +28,7 @@ CONFIG_ARCH_IXP4XX=y
# CONFIG_ARCH_KS8695 is not set
# CONFIG_ARCH_L7200 is not set
# CONFIG_ARCH_LH7A40X is not set
# CONFIG_ARCH_MXC is not set
# CONFIG_ARCH_NETX is not set
# CONFIG_ARCH_NS9XXX is not set
# CONFIG_ARCH_OMAP is not set
@ -182,11 +183,13 @@ CONFIG_IP_NF_TARGET_REDIRECT=m
# CONFIG_IP_NF_TFTP is not set
CONFIG_IP_PIMSM_V1=y
CONFIG_IP_PIMSM_V2=y
CONFIG_IXP4XX_ETH=y
# CONFIG_IXP4XX_HSS is not set
# CONFIG_IXP4XX_INDIRECT_PCI is not set
CONFIG_IXP4XX_MAC=y
CONFIG_IXP4XX_NPE=y
CONFIG_IXP4XX_NPE_FW_LOAD=y
CONFIG_IXP4XX_NPE_FW_MTD=y
CONFIG_IXP4XX_FW_LOAD=y
CONFIG_IXP4XX_QMGR=y
CONFIG_IXP4XX_CRYPTO=y
CONFIG_IXP4XX_WATCHDOG=y
@ -199,6 +202,7 @@ CONFIG_LEGACY_PTYS=y
CONFIG_LEGACY_PTY_COUNT=256
# CONFIG_LIBCRC32C is not set
# CONFIG_LLC2 is not set
CONFIG_MACH_AP1000=y
CONFIG_MACH_AVILA=y
CONFIG_MACH_COMPEX=y
CONFIG_MACH_DSMG600=y
@ -212,6 +216,7 @@ CONFIG_MACH_LOFT=y
CONFIG_MACH_NAS100D=y
CONFIG_MACH_NSLU2=y
CONFIG_MACH_PRONGHORNMETRO=y
CONFIG_MACH_SIDEWINDER=y
CONFIG_MACH_WG302V2=y
CONFIG_MACH_WRT300NV2=y
# CONFIG_MAC_PARTITION is not set
@ -345,13 +350,16 @@ CONFIG_RTC_CLASS=y
# CONFIG_RTC_DEBUG is not set
# CONFIG_RTC_DRV_DS1307 is not set
# CONFIG_RTC_DRV_DS1553 is not set
# CONFIG_RTC_DRV_DS1672 is not set
CONFIG_RTC_DRV_DS1672=y
# CONFIG_RTC_DRV_DS1742 is not set
CONFIG_RTC_DRV_ISL1208=y
# CONFIG_RTC_DRV_M41T80 is not set
# CONFIG_RTC_DRV_M48T59 is not set
# CONFIG_RTC_DRV_M48T86 is not set
CONFIG_RTC_DRV_PCF8563=y
# CONFIG_RTC_DRV_PCF8583 is not set
# CONFIG_RTC_DRV_RS5C372 is not set
# CONFIG_RTC_DRV_STK17TA8 is not set
# CONFIG_RTC_DRV_TEST is not set
# CONFIG_RTC_DRV_V3020 is not set
CONFIG_RTC_DRV_X1205=y
@ -456,6 +464,7 @@ CONFIG_USB_EHCI_TT_NEWSCHED=y
# CONFIG_USB_GTCO is not set
CONFIG_USB_OHCI_HCD=m
CONFIG_USB_UHCI_HCD=m
# CONFIG_USER_NS is not set
CONFIG_VECTORS_BASE=0xffff0000
# CONFIG_VIA_RHINE is not set
CONFIG_VIA_VELOCITY=m

View File

@ -1,9 +0,0 @@
config IXP4XX_INCLUDE_UCODE
bool "Build images with Intel IXP4xx Microcode"
depends TARGET_ixp4xx
default y
help
You must manually download IPL_ixp400NpeLibrary-2_4.zip from
http://www.intel.com/design/network/products/npfamily/ixp400_archives.htm
and put it in the dl/ directory of the build system.
You will need to agree to the Intel Public License to do so - please do read it!

View File

@ -7,43 +7,28 @@
include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/image.mk
UCODEFILE:=IPL_ixp400NpeLibrary-2_4.zip
ifneq ($(CONFIG_IXP4XX_INCLUDE_UCODE),)
define Require/npe-ucode
[ -f $(DL_DIR)/$(UCODEFILE) ]
endef
define Build/Compile/npe
$(MAKE) -C npe-ucode \
BUILD_DIR="$(KDIR)" \
TARGET="$(KDIR)" \
compile
endef
define Image/Build/slug
define Image/Build/slug
BIN_DIR=$(BIN_DIR) $(TOPDIR)/scripts/slugimage.pl \
-L $(KDIR)/apex-nslu2-armeb.bin -m $(KDIR)/NPE-B \
-L $(KDIR)/apex-nslu2-armeb.bin \
-k $(BIN_DIR)/openwrt-nslu2-zImage \
-r rootfs:$(BIN_DIR)/openwrt-$(BOARD)-$(1).img \
-p -o $(BIN_DIR)/openwrt-nslu2-$(1).bin
BIN_DIR=$(BIN_DIR) $(TOPDIR)/scripts/slugimage.pl \
-F -L $(KDIR)/apex-nslu2-armeb.bin -m $(KDIR)/NPE-B \
-F -L $(KDIR)/apex-nslu2-armeb.bin \
-k $(BIN_DIR)/openwrt-nslu2-zImage \
-r rootfs:$(BIN_DIR)/openwrt-$(BOARD)-$(1).img \
-p -o $(BIN_DIR)/openwrt-nslu2-$(1)-16mb.bin
endef
endif
endef
define Build/Compile
$(MAKE) -C apex \
BUILD_DIR="$(KDIR)" \
TARGET="$(KDIR)" \
compile
$(call Build/Compile/npe)
endef
define Build/Clean
$(MAKE) -C apex clean
$(MAKE) -C npe-ucode clean
endef
define Image/Prepare
@ -52,7 +37,6 @@ endef
define Image/BuildKernel
cp $(KDIR)/zImage $(BIN_DIR)/openwrt-$(BOARD)-zImage
# $(shell BIN_DIR=$(BIN_DIR) $(TOPDIR)/scripts/arm-magic.sh)
BIN_DIR=$(BIN_DIR) $(TOPDIR)/scripts/arm-magic.sh
endef
@ -76,10 +60,3 @@ define Image/Build/squashfs
endef
$(eval $(call BuildImage))
$(eval $(call Require,npe-ucode, \
You must manually download $(UCODEFILE) from \\\
http://www.intel.com/design/network/products/npfamily/ixp400_archives.htm \\\
and put it in $(DL_DIR). \\\
You will need to agree to the Intel Public License to do so - please do read it! \
))

View File

@ -1,41 +0,0 @@
#
# Copyright (C) 2006 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
# $Id$
include $(TOPDIR)/rules.mk
PKG_NAME:=npe-ucode
PKG_VERSION:=2.4
PKG_RELEASE:=2
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE:=IPL_ixp400NpeLibrary-2_4.zip
include $(INCLUDE_DIR)/package.mk
define Build/Prepare
rm -rf $(PKG_BUILD_DIR)
mkdir -p $(PKG_BUILD_DIR)
unzip -d $(PKG_BUILD_DIR)/ $(DL_DIR)/$(PKG_SOURCE)
mv $(PKG_BUILD_DIR)/ixp400_xscale_sw/src/npeDl/IxNpeMicrocode.c $(PKG_BUILD_DIR)/
rm -rf $(PKG_BUILD_DIR)/ixp400_xscale_sw
$(CP) ./src/* $(PKG_BUILD_DIR)/
endef
define Build/Compile
(cd $(PKG_BUILD_DIR); \
$(HOSTCC) -Wall IxNpeMicrocode.c -o IxNpeMicrocode; \
./IxNpeMicrocode -be \
)
endef
define Build/InstallDev
$(INSTALL_BIN) $(PKG_BUILD_DIR)/NPE-B $(TARGET)/
$(INSTALL_BIN) $(PKG_BUILD_DIR)/NPE-C $(TARGET)/
endef
$(eval $(call Build/DefaultTargets))

View File

@ -0,0 +1,119 @@
diff -uprN linux-2.6.23.orig/arch/arm/kernel/relocate_kernel.S linux-2.6.23/arch/arm/kernel/relocate_kernel.S
--- linux-2.6.23.orig/arch/arm/kernel/relocate_kernel.S 2007-10-09 15:31:38.000000000 -0500
+++ linux-2.6.23/arch/arm/kernel/relocate_kernel.S 2007-10-09 22:19:32.000000000 -0500
@@ -7,6 +7,23 @@
.globl relocate_new_kernel
relocate_new_kernel:
+ /* Move boot params back to where the kernel expects them */
+
+ ldr r0,kexec_boot_params_address
+ teq r0,#0
+ beq 8f
+
+ ldr r1,kexec_boot_params_copy
+ mov r6,#KEXEC_BOOT_PARAMS_SIZE/4
+7:
+ ldr r5,[r1],#4
+ str r5,[r0],#4
+ subs r6,r6,#1
+ bne 7b
+
+8:
+ /* Boot params moved, now go on with the kernel */
+
ldr r0,kexec_indirection_page
ldr r1,kexec_start_address
@@ -50,7 +67,7 @@ relocate_new_kernel:
mov lr,r1
mov r0,#0
ldr r1,kexec_mach_type
- mov r2,#0
+ ldr r2,kexec_boot_params_address
mov pc,lr
.globl kexec_start_address
@@ -65,6 +82,16 @@ kexec_indirection_page:
kexec_mach_type:
.long 0x0
+ /* phy addr where new kernel will expect to find boot params */
+ .globl kexec_boot_params_address
+kexec_boot_params_address:
+ .long 0x0
+
+ /* phy addr where old kernel put a copy of orig boot params */
+ .globl kexec_boot_params_copy
+kexec_boot_params_copy:
+ .long 0x0
+
relocate_new_kernel_end:
.globl relocate_new_kernel_size
diff -uprN linux-2.6.23.orig/arch/arm/kernel/setup.c linux-2.6.23/arch/arm/kernel/setup.c
--- linux-2.6.23.orig/arch/arm/kernel/setup.c 2007-10-09 15:31:38.000000000 -0500
+++ linux-2.6.23/arch/arm/kernel/setup.c 2007-10-09 20:06:10.000000000 -0500
@@ -24,6 +24,7 @@
#include <linux/interrupt.h>
#include <linux/smp.h>
#include <linux/fs.h>
+#include <linux/kexec.h>
#include <asm/cpu.h>
#include <asm/elf.h>
@@ -770,6 +771,23 @@ static int __init customize_machine(void
}
arch_initcall(customize_machine);
+#ifdef CONFIG_KEXEC
+
+/* Physical addr of where the boot params should be for this machine */
+extern unsigned long kexec_boot_params_address;
+
+/* Physical addr of the buffer into which the boot params are copied */
+extern unsigned long kexec_boot_params_copy;
+
+/* Pointer to the boot params buffer, for manipulation and display */
+unsigned long kexec_boot_params;
+EXPORT_SYMBOL(kexec_boot_params);
+
+/* The buffer itself - make sure it is sized correctly */
+static unsigned long kexec_boot_params_buf[(KEXEC_BOOT_PARAMS_SIZE + 3) / 4];
+
+#endif
+
void __init setup_arch(char **cmdline_p)
{
struct tag *tags = (struct tag *)&init_tags;
@@ -788,6 +806,18 @@ void __init setup_arch(char **cmdline_p)
else if (mdesc->boot_params)
tags = phys_to_virt(mdesc->boot_params);
+#ifdef CONFIG_KEXEC
+ kexec_boot_params_copy = virt_to_phys(kexec_boot_params_buf);
+ kexec_boot_params = (unsigned long)kexec_boot_params_buf;
+ if (__atags_pointer) {
+ kexec_boot_params_address = __atags_pointer;
+ memcpy((void *)kexec_boot_params, tags, KEXEC_BOOT_PARAMS_SIZE);
+ } else if (mdesc->boot_params) {
+ kexec_boot_params_address = mdesc->boot_params;
+ memcpy((void *)kexec_boot_params, tags, KEXEC_BOOT_PARAMS_SIZE);
+ }
+#endif
+
/*
* If we have the old style parameters, convert them to
* a tag list.
diff -uprN linux-2.6.23.orig/include/asm-arm/kexec.h linux-2.6.23/include/asm-arm/kexec.h
--- linux-2.6.23.orig/include/asm-arm/kexec.h 2007-10-09 15:31:38.000000000 -0500
+++ linux-2.6.23/include/asm-arm/kexec.h 2007-10-09 22:19:32.000000000 -0500
@@ -14,6 +14,8 @@
#define KEXEC_ARCH KEXEC_ARCH_ARM
+#define KEXEC_BOOT_PARAMS_SIZE 1536
+
#ifndef __ASSEMBLY__
struct kimage;

View File

@ -0,0 +1,926 @@
diff -uprN linux-2.6.23.orig/drivers/net/via-velocity.c linux-2.6.23/drivers/net/via-velocity.c
--- linux-2.6.23.orig/drivers/net/via-velocity.c 2007-10-09 15:31:38.000000000 -0500
+++ linux-2.6.23/drivers/net/via-velocity.c 2007-10-11 00:53:45.000000000 -0500
@@ -96,11 +96,31 @@ MODULE_AUTHOR("VIA Networking Technologi
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("VIA Networking Velocity Family Gigabit Ethernet Adapter Driver");
+/* Valid values for vdebug (additive, this is a bitmask):
+ * 0x00 => off
+ * 0x01 => always on
+ * 0x02 => additional detail on tx (rx, too, if anyone implements same)
+ * 0x04 => detail the initialization process
+ * 0x08 => spot debug detail; to be used as developers see fit
+ */
+static int vdebug = 0;
+
+/* HAIL - these macros are for the normal 0x01-type tracing... */
+#define HAIL(S) \
+ if (vdebug&1) printk(KERN_NOTICE "%s\n", (S));
+#define HAILS(S,T) \
+ if (vdebug&1) printk(KERN_NOTICE "%s -> status=0x%x\n", (S), (T));
+
#define VELOCITY_PARAM(N,D) \
static int N[MAX_UNITS]=OPTION_DEFAULT;\
module_param_array(N, int, NULL, 0); \
MODULE_PARM_DESC(N, D);
+#define VELO_DEBUG_MIN 0
+#define VELO_DEBUG_MAX 255
+#define VELO_DEBUG_DEF 0
+VELOCITY_PARAM(velo_debug, "Debug level");
+
#define RX_DESC_MIN 64
#define RX_DESC_MAX 255
#define RX_DESC_DEF 64
@@ -385,12 +405,12 @@ static void __devinit velocity_set_int_o
if (val == -1)
*opt = def;
else if (val < min || val > max) {
- VELOCITY_PRT(MSG_LEVEL_INFO, KERN_NOTICE "%s: the value of parameter %s is invalid, the valid range is (%d-%d)\n",
- devname, name, min, max);
+ VELOCITY_PRT(MSG_LEVEL_INFO, KERN_NOTICE "via-velocity: the value of parameter %s is invalid, the valid range is (%d-%d)\n",
+ name, min, max);
*opt = def;
} else {
- VELOCITY_PRT(MSG_LEVEL_INFO, KERN_INFO "%s: set value of parameter %s to %d\n",
- devname, name, val);
+ VELOCITY_PRT(MSG_LEVEL_INFO, KERN_INFO "via-velocity: set value of parameter %s to %d\n",
+ name, val);
*opt = val;
}
}
@@ -415,12 +435,12 @@ static void __devinit velocity_set_bool_
if (val == -1)
*opt |= (def ? flag : 0);
else if (val < 0 || val > 1) {
- printk(KERN_NOTICE "%s: the value of parameter %s is invalid, the valid range is (0-1)\n",
- devname, name);
+ printk(KERN_NOTICE "via-velocity: the value of parameter %s is invalid, the valid range is (0-1)\n",
+ name);
*opt |= (def ? flag : 0);
} else {
- printk(KERN_INFO "%s: set parameter %s to %s\n",
- devname, name, val ? "TRUE" : "FALSE");
+ printk(KERN_INFO "via-velocity: set parameter %s to %s\n",
+ name, val ? "TRUE" : "FALSE");
*opt |= (val ? flag : 0);
}
}
@@ -438,6 +458,7 @@ static void __devinit velocity_set_bool_
static void __devinit velocity_get_options(struct velocity_opt *opts, int index, char *devname)
{
+ velocity_set_int_opt(&opts->velo_debug, velo_debug[index], VELO_DEBUG_MIN, VELO_DEBUG_MAX, VELO_DEBUG_DEF, "velo_debug", devname);
velocity_set_int_opt(&opts->rx_thresh, rx_thresh[index], RX_THRESH_MIN, RX_THRESH_MAX, RX_THRESH_DEF, "rx_thresh", devname);
velocity_set_int_opt(&opts->DMA_length, DMA_length[index], DMA_LENGTH_MIN, DMA_LENGTH_MAX, DMA_LENGTH_DEF, "DMA_length", devname);
velocity_set_int_opt(&opts->numrx, RxDescriptors[index], RX_DESC_MIN, RX_DESC_MAX, RX_DESC_DEF, "RxDescriptors", devname);
@@ -452,6 +473,7 @@ static void __devinit velocity_get_optio
velocity_set_int_opt((int *) &opts->wol_opts, wol_opts[index], WOL_OPT_MIN, WOL_OPT_MAX, WOL_OPT_DEF, "Wake On Lan options", devname);
velocity_set_int_opt((int *) &opts->int_works, int_works[index], INT_WORKS_MIN, INT_WORKS_MAX, INT_WORKS_DEF, "Interrupt service works", devname);
opts->numrx = (opts->numrx & ~3);
+ vdebug = opts->velo_debug;
}
/**
@@ -466,6 +488,8 @@ static void velocity_init_cam_filter(str
{
struct mac_regs __iomem * regs = vptr->mac_regs;
+ HAIL("velocity_init_cam_filter");
+
/* Turn on MCFG_PQEN, turn off MCFG_RTGOPT */
WORD_REG_BITS_SET(MCFG_PQEN, MCFG_RTGOPT, &regs->MCFG);
WORD_REG_BITS_ON(MCFG_VIDFR, &regs->MCFG);
@@ -484,14 +508,12 @@ static void velocity_init_cam_filter(str
WORD_REG_BITS_ON(MCFG_RTGOPT, &regs->MCFG);
mac_set_cam(regs, 0, (u8 *) & (vptr->options.vid), VELOCITY_VLAN_ID_CAM);
- vptr->vCAMmask[0] |= 1;
- mac_set_cam_mask(regs, vptr->vCAMmask, VELOCITY_VLAN_ID_CAM);
} else {
u16 temp = 0;
mac_set_cam(regs, 0, (u8 *) &temp, VELOCITY_VLAN_ID_CAM);
- temp = 1;
- mac_set_cam_mask(regs, (u8 *) &temp, VELOCITY_VLAN_ID_CAM);
}
+ vptr->vCAMmask[0] |= 1;
+ mac_set_cam_mask(regs, vptr->vCAMmask, VELOCITY_VLAN_ID_CAM);
}
/**
@@ -508,13 +530,15 @@ static void velocity_rx_reset(struct vel
struct mac_regs __iomem * regs = vptr->mac_regs;
int i;
+ HAIL("velocity_rx_reset");
vptr->rd_dirty = vptr->rd_filled = vptr->rd_curr = 0;
/*
* Init state, all RD entries belong to the NIC
*/
for (i = 0; i < vptr->options.numrx; ++i)
- vptr->rd_ring[i].rdesc0.owner = OWNED_BY_NIC;
+ /* vptr->rd_ring[i].rdesc0.owner = OWNED_BY_NIC; BE */
+ vptr->rd_ring[i].rdesc0 |= cpu_to_le32(BE_OWNED_BY_NIC); /* BE */
writew(vptr->options.numrx, &regs->RBRDU);
writel(vptr->rd_pool_dma, &regs->RDBaseLo);
@@ -537,12 +561,15 @@ static void velocity_init_registers(stru
struct mac_regs __iomem * regs = vptr->mac_regs;
int i, mii_status;
+ if (vdebug&5) printk(KERN_NOTICE "velocity_init_registers: entering\n");
+
mac_wol_reset(regs);
switch (type) {
case VELOCITY_INIT_RESET:
case VELOCITY_INIT_WOL:
+ if (vdebug&4) printk(KERN_NOTICE "velocity_init_registers: RESET or WOL\n");
netif_stop_queue(vptr->dev);
/*
@@ -570,12 +597,13 @@ static void velocity_init_registers(stru
case VELOCITY_INIT_COLD:
default:
+ if (vdebug&4) printk(KERN_NOTICE "velocity_init_registers: COLD or default\n");
/*
* Do reset
*/
velocity_soft_reset(vptr);
+ if (vdebug&4) printk(KERN_NOTICE "velocity_init_registers: soft reset complete.\n");
mdelay(5);
-
mac_eeprom_reload(regs);
for (i = 0; i < 6; i++) {
writeb(vptr->dev->dev_addr[i], &(regs->PAR[i]));
@@ -593,11 +621,16 @@ static void velocity_init_registers(stru
*/
BYTE_REG_BITS_SET(CFGB_OFSET, (CFGB_CRANDOM | CFGB_CAP | CFGB_MBA | CFGB_BAKOPT), &regs->CFGB);
+ if (vdebug&4) printk(KERN_NOTICE "velocity_init_registers: Initializing CAM filter\n");
/*
* Init CAM filter
*/
+ if (vdebug&8) printk(KERN_NOTICE "velocity: spot debug: about to init CAM filters\n");
+ mdelay(5); /* MJW - ARM processors, kernel 2.6.19 - this fixes oopses and hangs */
velocity_init_cam_filter(vptr);
+ if (vdebug&8) printk(KERN_NOTICE "velocity: spot debug: init CAM filters complete\n");
+ if (vdebug&4) printk(KERN_NOTICE "velocity_init_registers: Setting packet filter\n");
/*
* Set packet filter: Receive directed and broadcast address
*/
@@ -607,10 +640,12 @@ static void velocity_init_registers(stru
* Enable MII auto-polling
*/
enable_mii_autopoll(regs);
+ if (vdebug&4) printk(KERN_NOTICE "velocity_init_registers: enable_mii_autopoll complete.\n");
vptr->int_mask = INT_MASK_DEF;
- writel(cpu_to_le32(vptr->rd_pool_dma), &regs->RDBaseLo);
+ /* writel(cpu_to_le32(vptr->rd_pool_dma), &regs->RDBaseLo); BE */
+ writel((vptr->rd_pool_dma), &regs->RDBaseLo); /* BE */
writew(vptr->options.numrx - 1, &regs->RDCSize);
mac_rx_queue_run(regs);
mac_rx_queue_wake(regs);
@@ -618,10 +653,13 @@ static void velocity_init_registers(stru
writew(vptr->options.numtx - 1, &regs->TDCSize);
for (i = 0; i < vptr->num_txq; i++) {
- writel(cpu_to_le32(vptr->td_pool_dma[i]), &(regs->TDBaseLo[i]));
+ /* writel(cpu_to_le32(vptr->td_pool_dma[i]), &(regs->TDBaseLo[i])); BE */
+ writel((vptr->td_pool_dma[i]), &(regs->TDBaseLo[i])); /* BE */
mac_tx_queue_run(regs, i);
}
+ if (vdebug&4) printk(KERN_NOTICE "velocity_init_registers: DMA settings complete.\n");
+
init_flow_control_register(vptr);
writel(CR0_STOP, &regs->CR0Clr);
@@ -640,8 +678,10 @@ static void velocity_init_registers(stru
enable_flow_control_ability(vptr);
mac_hw_mibs_init(regs);
+ if (vdebug&4) printk(KERN_NOTICE "velocity_init_registers: Set interrupt mask\n");
mac_write_int_mask(vptr->int_mask, regs);
mac_clear_isr(regs);
+ if (vdebug&4) printk(KERN_NOTICE "velocity_init_registers: complete.\n");
}
}
@@ -659,6 +699,7 @@ static int velocity_soft_reset(struct ve
struct mac_regs __iomem * regs = vptr->mac_regs;
int i = 0;
+ HAIL("velocity_soft_reset");
writel(CR0_SFRST, &regs->CR0Set);
for (i = 0; i < W_MAX_TIMEOUT; i++) {
@@ -722,6 +763,7 @@ static int __devinit velocity_found1(str
VELOCITY_FULL_DRV_NAM, VELOCITY_VERSION);
printk(KERN_INFO "Copyright (c) 2002, 2003 VIA Networking Technologies, Inc.\n");
printk(KERN_INFO "Copyright (c) 2004 Red Hat Inc.\n");
+ printk(KERN_INFO "BE support, misc. fixes MJW 01Jan2007 - may be unstable\n");
first = 0;
}
@@ -934,6 +976,7 @@ static int velocity_init_rings(struct ve
dma_addr_t pool_dma;
u8 *pool;
+ HAIL("velocity_init_rings");
/*
* Allocate all RD/TD rings a single pool
*/
@@ -996,6 +1039,7 @@ static int velocity_init_rings(struct ve
static void velocity_free_rings(struct velocity_info *vptr)
{
int size;
+ HAIL("velocity_free_rings");
size = vptr->options.numrx * sizeof(struct rx_desc) +
vptr->options.numtx * sizeof(struct tx_desc) * vptr->num_txq;
@@ -1012,6 +1056,7 @@ static inline void velocity_give_many_rx
struct mac_regs __iomem *regs = vptr->mac_regs;
int avail, dirty, unusable;
+ HAIL("velocity_give_many_rx_descs");
/*
* RD number must be equal to 4X per hardware spec
* (programming guide rev 1.20, p.13)
@@ -1025,7 +1070,8 @@ static inline void velocity_give_many_rx
dirty = vptr->rd_dirty - unusable;
for (avail = vptr->rd_filled & 0xfffc; avail; avail--) {
dirty = (dirty > 0) ? dirty - 1 : vptr->options.numrx - 1;
- vptr->rd_ring[dirty].rdesc0.owner = OWNED_BY_NIC;
+ /* vptr->rd_ring[dirty].rdesc0.owner = OWNED_BY_NIC; BE */
+ vptr->rd_ring[dirty].rdesc0 |= cpu_to_le32(BE_OWNED_BY_NIC); /* BE */
}
writew(vptr->rd_filled & 0xfffc, &regs->RBRDU);
@@ -1035,12 +1081,14 @@ static inline void velocity_give_many_rx
static int velocity_rx_refill(struct velocity_info *vptr)
{
int dirty = vptr->rd_dirty, done = 0, ret = 0;
+ HAIL("velocity_rx_refill");
do {
struct rx_desc *rd = vptr->rd_ring + dirty;
/* Fine for an all zero Rx desc at init time as well */
- if (rd->rdesc0.owner == OWNED_BY_NIC)
+ /* if (rd->rdesc0.owner == OWNED_BY_NIC) BE */
+ if (rd->rdesc0 & cpu_to_le32(BE_OWNED_BY_NIC)) /* BE */
break;
if (!vptr->rd_info[dirty].skb) {
@@ -1075,6 +1123,7 @@ static int velocity_init_rd_ring(struct
unsigned int rsize = sizeof(struct velocity_rd_info) *
vptr->options.numrx;
+ HAIL("velocity_init_rd_ring");
vptr->rd_info = kmalloc(rsize, GFP_KERNEL);
if(vptr->rd_info == NULL)
goto out;
@@ -1104,6 +1153,7 @@ static void velocity_free_rd_ring(struct
{
int i;
+ HAIL("velocity_free_rd_ring");
if (vptr->rd_info == NULL)
return;
@@ -1145,6 +1195,7 @@ static int velocity_init_td_ring(struct
unsigned int tsize = sizeof(struct velocity_td_info) *
vptr->options.numtx;
+ HAIL("velocity_init_td_ring");
/* Init the TD ring entries */
for (j = 0; j < vptr->num_txq; j++) {
curr = vptr->td_pool_dma[j];
@@ -1181,6 +1232,7 @@ static void velocity_free_td_ring_entry(
struct velocity_td_info * td_info = &(vptr->td_infos[q][n]);
int i;
+ HAIL("velocity_free_td_ring_entry");
if (td_info == NULL)
return;
@@ -1210,6 +1262,7 @@ static void velocity_free_td_ring(struct
{
int i, j;
+ HAIL("velocity_free_td_ring");
for (j = 0; j < vptr->num_txq; j++) {
if (vptr->td_infos[j] == NULL)
continue;
@@ -1237,34 +1290,42 @@ static int velocity_rx_srv(struct veloci
struct net_device_stats *stats = &vptr->stats;
int rd_curr = vptr->rd_curr;
int works = 0;
+ u16 wRSR; /* BE */
+ HAILS("velocity_rx_srv", status);
do {
struct rx_desc *rd = vptr->rd_ring + rd_curr;
if (!vptr->rd_info[rd_curr].skb)
break;
- if (rd->rdesc0.owner == OWNED_BY_NIC)
+ /* if (rd->rdesc0.owner == OWNED_BY_NIC) BE */
+ if (rd->rdesc0 & cpu_to_le32(BE_OWNED_BY_NIC)) /* BE */
break;
rmb();
+ wRSR = (u16)(cpu_to_le32(rd->rdesc0)); /* BE */
/*
* Don't drop CE or RL error frame although RXOK is off
*/
- if ((rd->rdesc0.RSR & RSR_RXOK) || (!(rd->rdesc0.RSR & RSR_RXOK) && (rd->rdesc0.RSR & (RSR_CE | RSR_RL)))) {
+ /* if ((rd->rdesc0.RSR & RSR_RXOK) || (!(rd->rdesc0.RSR & RSR_RXOK) && (rd->rdesc0.RSR & (RSR_CE | RSR_RL)))) { BE */
+ if ((wRSR & RSR_RXOK) || (!(wRSR & RSR_RXOK) && (wRSR & (RSR_CE | RSR_RL)))) { /* BE */
if (velocity_receive_frame(vptr, rd_curr) < 0)
stats->rx_dropped++;
} else {
- if (rd->rdesc0.RSR & RSR_CRC)
+ /* if (rd->rdesc0.RSR & RSR_CRC) BE */
+ if (wRSR & RSR_CRC) /* BE */
stats->rx_crc_errors++;
- if (rd->rdesc0.RSR & RSR_FAE)
+ /* if (rd->rdesc0.RSR & RSR_FAE) BE */
+ if (wRSR & RSR_FAE) /* BE */
stats->rx_frame_errors++;
stats->rx_dropped++;
}
- rd->inten = 1;
+ /* rd->inten = 1; BE */
+ rd->ltwo |= cpu_to_le32(BE_INT_ENABLE); /* BE */
vptr->dev->last_rx = jiffies;
@@ -1295,13 +1356,21 @@ static int velocity_rx_srv(struct veloci
static inline void velocity_rx_csum(struct rx_desc *rd, struct sk_buff *skb)
{
+ u8 bCSM;
+ HAIL("velocity_rx_csum");
skb->ip_summed = CHECKSUM_NONE;
- if (rd->rdesc1.CSM & CSM_IPKT) {
- if (rd->rdesc1.CSM & CSM_IPOK) {
- if ((rd->rdesc1.CSM & CSM_TCPKT) ||
- (rd->rdesc1.CSM & CSM_UDPKT)) {
- if (!(rd->rdesc1.CSM & CSM_TUPOK)) {
+// if (rd->rdesc1.CSM & CSM_IPKT) {
+// if (rd->rdesc1.CSM & CSM_IPOK) {
+// if ((rd->rdesc1.CSM & CSM_TCPKT) ||
+// (rd->rdesc1.CSM & CSM_UDPKT)) {
+// if (!(rd->rdesc1.CSM & CSM_TUPOK)) {
+ bCSM = (u8)(cpu_to_le32(rd->rdesc1) >> 16); /* BE */
+ if (bCSM & CSM_IPKT) {
+ if (bCSM & CSM_IPOK) {
+ if ((bCSM & CSM_TCPKT) ||
+ (bCSM & CSM_UDPKT)) {
+ if (!(bCSM & CSM_TUPOK)) { /* BE */
return;
}
}
@@ -1327,9 +1396,11 @@ static inline int velocity_rx_copy(struc
{
int ret = -1;
+ HAIL("velocity_rx_copy");
if (pkt_size < rx_copybreak) {
struct sk_buff *new_skb;
+ HAIL("velocity_rx_copy (working...)");
new_skb = dev_alloc_skb(pkt_size + 2);
if (new_skb) {
new_skb->dev = vptr->dev;
@@ -1360,10 +1431,12 @@ static inline int velocity_rx_copy(struc
static inline void velocity_iph_realign(struct velocity_info *vptr,
struct sk_buff *skb, int pkt_size)
{
+ HAIL("velocity_iph_realign");
/* FIXME - memmove ? */
if (vptr->flags & VELOCITY_FLAGS_IP_ALIGN) {
int i;
+ HAIL("velocity_iph_realign (working...)");
for (i = pkt_size; i >= 0; i--)
*(skb->data + i + 2) = *(skb->data + i);
skb_reserve(skb, 2);
@@ -1382,19 +1455,27 @@ static inline void velocity_iph_realign(
static int velocity_receive_frame(struct velocity_info *vptr, int idx)
{
void (*pci_action)(struct pci_dev *, dma_addr_t, size_t, int);
+ u16 pkt_len; /* BE */
+ u16 wRSR; /* BE */
+ struct sk_buff *skb;
struct net_device_stats *stats = &vptr->stats;
struct velocity_rd_info *rd_info = &(vptr->rd_info[idx]);
struct rx_desc *rd = &(vptr->rd_ring[idx]);
- int pkt_len = rd->rdesc0.len;
- struct sk_buff *skb;
+ /* int pkt_len = rd->rdesc0.len BE */;
+
+ pkt_len = ((cpu_to_le32(rd->rdesc0) >> 16) & 0x00003FFFUL); /* BE */
+ wRSR = (u16)(cpu_to_le32(rd->rdesc0)); /* BE */
- if (rd->rdesc0.RSR & (RSR_STP | RSR_EDP)) {
+ HAIL("velocity_receive_frame");
+ /* if (rd->rdesc0.RSR & (RSR_STP | RSR_EDP)) { BE */
+ if (wRSR & (RSR_STP | RSR_EDP)) { /* BE */
VELOCITY_PRT(MSG_LEVEL_VERBOSE, KERN_ERR " %s : the received frame span multple RDs.\n", vptr->dev->name);
stats->rx_length_errors++;
return -EINVAL;
}
- if (rd->rdesc0.RSR & RSR_MAR)
+ /* if (rd->rdesc0.RSR & RSR_MAR) BE */
+ if (wRSR & RSR_MAR) /* BE */
vptr->stats.multicast++;
skb = rd_info->skb;
@@ -1407,7 +1488,8 @@ static int velocity_receive_frame(struct
*/
if (vptr->flags & VELOCITY_FLAGS_VAL_PKT_LEN) {
- if (rd->rdesc0.RSR & RSR_RL) {
+ /* if (rd->rdesc0.RSR & RSR_RL) { BE */
+ if (wRSR & RSR_RL) { /* BE */
stats->rx_length_errors++;
return -EINVAL;
}
@@ -1451,6 +1533,7 @@ static int velocity_alloc_rx_buf(struct
struct rx_desc *rd = &(vptr->rd_ring[idx]);
struct velocity_rd_info *rd_info = &(vptr->rd_info[idx]);
+ HAIL("velocity_alloc_rx_buf");
rd_info->skb = dev_alloc_skb(vptr->rx_buf_sz + 64);
if (rd_info->skb == NULL)
return -ENOMEM;
@@ -1468,10 +1551,14 @@ static int velocity_alloc_rx_buf(struct
*/
*((u32 *) & (rd->rdesc0)) = 0;
- rd->len = cpu_to_le32(vptr->rx_buf_sz);
- rd->inten = 1;
+ /* rd->len = cpu_to_le32(vptr->rx_buf_sz); BE */
+ /* rd->inten = 1; BE */
rd->pa_low = cpu_to_le32(rd_info->skb_dma);
- rd->pa_high = 0;
+ /* rd->pa_high = 0; BE */
+ rd->ltwo &= cpu_to_le32(0xC000FFFFUL); /* BE */
+ rd->ltwo |= cpu_to_le32((vptr->rx_buf_sz << 16)); /* BE */
+ rd->ltwo |= cpu_to_le32(BE_INT_ENABLE); /* BE */
+ rd->ltwo &= cpu_to_le32(0xFFFF0000UL); /* BE */
return 0;
}
@@ -1492,9 +1579,11 @@ static int velocity_tx_srv(struct veloci
int full = 0;
int idx;
int works = 0;
+ u16 wTSR; /* BE */
struct velocity_td_info *tdinfo;
struct net_device_stats *stats = &vptr->stats;
+ HAILS("velocity_tx_srv", status);
for (qnum = 0; qnum < vptr->num_txq; qnum++) {
for (idx = vptr->td_tail[qnum]; vptr->td_used[qnum] > 0;
idx = (idx + 1) % vptr->options.numtx) {
@@ -1505,22 +1594,29 @@ static int velocity_tx_srv(struct veloci
td = &(vptr->td_rings[qnum][idx]);
tdinfo = &(vptr->td_infos[qnum][idx]);
- if (td->tdesc0.owner == OWNED_BY_NIC)
+ /* if (td->tdesc0.owner == OWNED_BY_NIC) BE */
+ if (td->tdesc0 & cpu_to_le32(BE_OWNED_BY_NIC)) /* BE */
break;
if ((works++ > 15))
break;
- if (td->tdesc0.TSR & TSR0_TERR) {
+ wTSR = (u16)cpu_to_le32(td->tdesc0);
+ /* if (td->tdesc0.TSR & TSR0_TERR) { BE */
+ if (wTSR & TSR0_TERR) { /* BE */
stats->tx_errors++;
stats->tx_dropped++;
- if (td->tdesc0.TSR & TSR0_CDH)
+ /* if (td->tdesc0.TSR & TSR0_CDH) BE */
+ if (wTSR & TSR0_CDH) /* BE */
stats->tx_heartbeat_errors++;
- if (td->tdesc0.TSR & TSR0_CRS)
+ /* if (td->tdesc0.TSR & TSR0_CRS) BE */
+ if (wTSR & TSR0_CRS) /* BE */
stats->tx_carrier_errors++;
- if (td->tdesc0.TSR & TSR0_ABT)
+ /* if (td->tdesc0.TSR & TSR0_ABT) BE */
+ if (wTSR & TSR0_ABT) /* BE */
stats->tx_aborted_errors++;
- if (td->tdesc0.TSR & TSR0_OWC)
+ /* if (td->tdesc0.TSR & TSR0_OWC) BE */
+ if (wTSR & TSR0_OWC) /* BE */
stats->tx_window_errors++;
} else {
stats->tx_packets++;
@@ -1609,6 +1705,7 @@ static void velocity_print_link_status(s
static void velocity_error(struct velocity_info *vptr, int status)
{
+ HAILS("velocity_error", status);
if (status & ISR_TXSTLI) {
struct mac_regs __iomem * regs = vptr->mac_regs;
@@ -1698,6 +1795,7 @@ static void velocity_free_tx_buf(struct
struct sk_buff *skb = tdinfo->skb;
int i;
+ HAIL("velocity_free_tx_buf");
/*
* Don't unmap the pre-allocated tx_bufs
*/
@@ -1901,6 +1999,7 @@ static int velocity_xmit(struct sk_buff
struct velocity_td_info *tdinfo;
unsigned long flags;
int index;
+ u32 lbufsz; /* BE */
int pktlen = skb->len;
@@ -1917,9 +2016,18 @@ static int velocity_xmit(struct sk_buff
td_ptr = &(vptr->td_rings[qnum][index]);
tdinfo = &(vptr->td_infos[qnum][index]);
- td_ptr->tdesc1.TCPLS = TCPLS_NORMAL;
- td_ptr->tdesc1.TCR = TCR0_TIC;
- td_ptr->td_buf[0].queue = 0;
+ td_ptr->tdesc0 = 0x00000000UL; /* BE */
+ td_ptr->tdesc1 = 0x00000000UL; /* BE */
+
+ /* td_ptr->tdesc1.TCPLS = TCPLS_NORMAL; BE */
+ td_ptr->tdesc1 &= cpu_to_le32(0xfcffffffUL); /* BE */
+ td_ptr->tdesc1 |= cpu_to_le32(((u32)TCPLS_NORMAL) << 24); /* BE */
+
+ /* td_ptr->tdesc1.TCR = TCR0_TIC; BE */
+ td_ptr->tdesc1 |= cpu_to_le32(BE_TCR_TIC); /* BE */
+
+ /* td_ptr->td_buf[0].queue = 0; BE */
+ td_ptr->td_buf[0].ltwo &= cpu_to_le32(~BE_QUEUE_ENABLE); /* BE */
/*
* Pad short frames.
@@ -1931,20 +2039,36 @@ static int velocity_xmit(struct sk_buff
memset(tdinfo->buf + skb->len, 0, ETH_ZLEN - skb->len);
tdinfo->skb = skb;
tdinfo->skb_dma[0] = tdinfo->buf_dma;
- td_ptr->tdesc0.pktsize = pktlen;
+ /* td_ptr->tdesc0.pktsize = pktlen; */
+ td_ptr->tdesc0 &= cpu_to_le32(0xc000ffffUL); /* BE */
+ lbufsz = pktlen; /* Assign, and make sure it's unsigned 32 bits - BE */
+ lbufsz = lbufsz << 16; /* BE - shift over */
+ td_ptr->tdesc0 |= cpu_to_le32(lbufsz); /* BE */
+
td_ptr->td_buf[0].pa_low = cpu_to_le32(tdinfo->skb_dma[0]);
- td_ptr->td_buf[0].pa_high = 0;
- td_ptr->td_buf[0].bufsize = td_ptr->tdesc0.pktsize;
+ /* td_ptr->td_buf[0].pa_high = 0; */
+ /* td_ptr->td_buf[0].bufsize = td_ptr->tdesc0.pktsize; */
+ td_ptr->td_buf[0].ltwo = cpu_to_le32(lbufsz); /* BE */
tdinfo->nskb_dma = 1;
- td_ptr->tdesc1.CMDZ = 2;
+ /* td_ptr->tdesc1.CMDZ = 2; */
+ td_ptr->tdesc1 &= cpu_to_le32(0x0fffffffUL); /* BE */
+ td_ptr->tdesc1 |= cpu_to_le32(((u32)0x2) << 28); /* BE */
} else
#ifdef VELOCITY_ZERO_COPY_SUPPORT
+ /*
+ * BE - NOTE on the VELOCITY_ZERO_COPY_SUPPORT:
+ * This block of code has NOT been patched up for BE support, as
+ * it is certainly broken -- if it compiles at all. Since the BE
+ * fixes depend on the broken code, attempts to convert to BE support
+ * would almost certainly confuse more than help.
+ */
if (skb_shinfo(skb)->nr_frags > 0) {
int nfrags = skb_shinfo(skb)->nr_frags;
tdinfo->skb = skb;
if (nfrags > 6) {
skb_copy_from_linear_data(skb, tdinfo->buf, skb->len);
tdinfo->skb_dma[0] = tdinfo->buf_dma;
+ /* BE: Er, exactly what value are we assigning in this next line? */
td_ptr->tdesc0.pktsize =
td_ptr->td_buf[0].pa_low = cpu_to_le32(tdinfo->skb_dma[0]);
td_ptr->td_buf[0].pa_high = 0;
@@ -1961,6 +2085,7 @@ static int velocity_xmit(struct sk_buff
/* FIXME: support 48bit DMA later */
td_ptr->td_buf[i].pa_low = cpu_to_le32(tdinfo->skb_dma);
td_ptr->td_buf[i].pa_high = 0;
+ /* BE: This next line can't be right: */
td_ptr->td_buf[i].bufsize = skb->len->skb->data_len;
for (i = 0; i < nfrags; i++) {
@@ -1978,7 +2103,7 @@ static int velocity_xmit(struct sk_buff
}
} else
-#endif
+#endif /* (broken) VELOCITY_ZERO_COPY_SUPPORT */
{
/*
* Map the linear network buffer into PCI space and
@@ -1986,19 +2111,30 @@ static int velocity_xmit(struct sk_buff
*/
tdinfo->skb = skb;
tdinfo->skb_dma[0] = pci_map_single(vptr->pdev, skb->data, pktlen, PCI_DMA_TODEVICE);
- td_ptr->tdesc0.pktsize = pktlen;
+ /* td_ptr->tdesc0.pktsize = pktlen; BE */
+ td_ptr->tdesc0 &= cpu_to_le32(0xc000ffffUL); /* BE */
+ lbufsz = pktlen; /* Assign, and make sure it's unsigned 32 bits - BE */
+ lbufsz = lbufsz << 16; /* BE */
+ td_ptr->tdesc0 |= cpu_to_le32(lbufsz); /* BE */
td_ptr->td_buf[0].pa_low = cpu_to_le32(tdinfo->skb_dma[0]);
- td_ptr->td_buf[0].pa_high = 0;
- td_ptr->td_buf[0].bufsize = td_ptr->tdesc0.pktsize;
+ /* td_ptr->td_buf[0].pa_high = 0; BE */
+ /* td_ptr->td_buf[0].bufsize = td_ptr->tdesc0.pktsize; BE */
+ td_ptr->td_buf[0].ltwo = cpu_to_le32(lbufsz); /* BE */
+
tdinfo->nskb_dma = 1;
- td_ptr->tdesc1.CMDZ = 2;
+ /* td_ptr->tdesc1.CMDZ = 2; BE */
+ td_ptr->tdesc1 &= cpu_to_le32(0x0fffffffUL); /* BE */
+ td_ptr->tdesc1 |= cpu_to_le32(((u32)0x2) << 28);/* BE */
}
if (vptr->flags & VELOCITY_FLAGS_TAGGING) {
- td_ptr->tdesc1.pqinf.VID = (vptr->options.vid & 0xfff);
- td_ptr->tdesc1.pqinf.priority = 0;
- td_ptr->tdesc1.pqinf.CFI = 0;
- td_ptr->tdesc1.TCR |= TCR0_VETAG;
+ /* td_ptr->tdesc1.pqinf.priority = 0; BE */
+ /* td_ptr->tdesc1.pqinf.CFI = 0; BE */
+ td_ptr->tdesc1 &= cpu_to_le32(0xFFFF0000UL); /* BE */
+ /* td_ptr->tdesc1.pqinf.VID = (vptr->options.vid & 0xfff); BE */
+ td_ptr->tdesc1 |= cpu_to_le32((vptr->options.vid & 0xfff)); /* BE */
+ /* td_ptr->tdesc1.TCR |= TCR0_VETAG; BE */
+ td_ptr->tdesc1 |= cpu_to_le32(BE_TCR_VETAG); /* BE */
}
/*
@@ -2008,26 +2144,34 @@ static int velocity_xmit(struct sk_buff
&& (skb->ip_summed == CHECKSUM_PARTIAL)) {
const struct iphdr *ip = ip_hdr(skb);
if (ip->protocol == IPPROTO_TCP)
- td_ptr->tdesc1.TCR |= TCR0_TCPCK;
+ /* td_ptr->tdesc1.TCR |= TCR0_TCPCK; BE */
+ td_ptr->tdesc1 |= cpu_to_le32(BE_TCR_TCPCK); /* BE */
else if (ip->protocol == IPPROTO_UDP)
- td_ptr->tdesc1.TCR |= (TCR0_UDPCK);
- td_ptr->tdesc1.TCR |= TCR0_IPCK;
- }
+ /* td_ptr->tdesc1.TCR |= (TCR0_UDPCK); BE */
+ td_ptr->tdesc1 |= cpu_to_le32(BE_TCR_UDPCK); /* BE */
+ /* td_ptr->tdesc1.TCR |= TCR0_IPCK; BE */
+ td_ptr->tdesc1 |= cpu_to_le32(BE_TCR_IPCK); /* BE */
+ }
{
int prev = index - 1;
if (prev < 0)
prev = vptr->options.numtx - 1;
- td_ptr->tdesc0.owner = OWNED_BY_NIC;
+ /* td_ptr->tdesc0.owner = OWNED_BY_NIC; BE */
+ td_ptr->tdesc0 |= cpu_to_le32(BE_OWNED_BY_NIC); /* BE */
vptr->td_used[qnum]++;
vptr->td_curr[qnum] = (index + 1) % vptr->options.numtx;
if (AVAIL_TD(vptr, qnum) < 1)
netif_stop_queue(dev);
- td_ptr = &(vptr->td_rings[qnum][prev]);
- td_ptr->td_buf[0].queue = 1;
+ td_ptr = &(vptr->td_rings[qnum][prev]);
+ /* td_ptr->td_buf[0].queue = 1; BE */
+ td_ptr->td_buf[0].ltwo |= cpu_to_le32(BE_QUEUE_ENABLE); /* BE */
+ if (vdebug&2) printk(KERN_NOTICE "velocity_xmit: (%s) len=%d idx=%d tdesc0=0x%x tdesc1=0x%x ltwo=0x%x\n",
+ (pktlen<ETH_ZLEN) ? "short" : "normal", pktlen, index,
+ td_ptr->tdesc0, td_ptr->tdesc1, td_ptr->td_buf[0].ltwo);
mac_tx_queue_wake(vptr->mac_regs, qnum);
}
dev->trans_start = jiffies;
@@ -2053,7 +2197,7 @@ static int velocity_intr(int irq, void *
u32 isr_status;
int max_count = 0;
-
+ HAIL("velocity_intr");
spin_lock(&vptr->lock);
isr_status = mac_read_isr(vptr->mac_regs);
@@ -2072,7 +2216,10 @@ static int velocity_intr(int irq, void *
while (isr_status != 0) {
mac_write_isr(vptr->mac_regs, isr_status);
- if (isr_status & (~(ISR_PRXI | ISR_PPRXI | ISR_PTXI | ISR_PPTXI)))
+ HAILS("velocity_intr",isr_status);
+ /* MJW - velocity_error is ALWAYS called; need to mask off some other flags */
+ /* if (isr_status & (~(ISR_PRXI | ISR_PPRXI | ISR_PTXI | ISR_PPTXI))) */
+ if (isr_status & (~(ISR_PRXI | ISR_PPRXI | ISR_PTXI | ISR_PPTXI | ISR_PTX0I | ISR_ISR0)))
velocity_error(vptr, isr_status);
if (isr_status & (ISR_PRXI | ISR_PPRXI))
max_count += velocity_rx_srv(vptr, isr_status);
@@ -2110,6 +2257,7 @@ static void velocity_set_multi(struct ne
int i;
struct dev_mc_list *mclist;
+ HAIL("velocity_set_multi");
if (dev->flags & IFF_PROMISC) { /* Set promiscuous. */
writel(0xffffffff, &regs->MARCAM[0]);
writel(0xffffffff, &regs->MARCAM[4]);
@@ -2153,6 +2301,7 @@ static struct net_device_stats *velocity
{
struct velocity_info *vptr = netdev_priv(dev);
+ HAIL("net_device_stats");
/* If the hardware is down, don't touch MII */
if(!netif_running(dev))
return &vptr->stats;
@@ -2197,6 +2346,7 @@ static int velocity_ioctl(struct net_dev
struct velocity_info *vptr = netdev_priv(dev);
int ret;
+ HAIL("velocity_ioctl");
/* If we are asked for information and the device is power
saving then we need to bring the device back up to talk to it */
@@ -2415,6 +2565,7 @@ static int velocity_mii_read(struct mac_
{
u16 ww;
+ HAIL("velocity_mii_read");
/*
* Disable MIICR_MAUTO, so that mii addr can be set normally
*/
@@ -2451,6 +2602,7 @@ static int velocity_mii_write(struct mac
{
u16 ww;
+ HAIL("velocity_mii_write");
/*
* Disable MIICR_MAUTO, so that mii addr can be set normally
*/
diff -uprN linux-2.6.23.orig/drivers/net/via-velocity.h linux-2.6.23/drivers/net/via-velocity.h
--- linux-2.6.23.orig/drivers/net/via-velocity.h 2007-10-09 15:31:38.000000000 -0500
+++ linux-2.6.23/drivers/net/via-velocity.h 2007-10-11 00:53:45.000000000 -0500
@@ -196,64 +196,70 @@
* Receive descriptor
*/
-struct rdesc0 {
- u16 RSR; /* Receive status */
- u16 len:14; /* Received packet length */
- u16 reserved:1;
- u16 owner:1; /* Who owns this buffer ? */
-};
-
-struct rdesc1 {
- u16 PQTAG;
- u8 CSM;
- u8 IPKT;
-};
+//struct rdesc0 {
+// u16 RSR; /* Receive status */
+// u16 len:14; /* Received packet length */
+// u16 reserved:1;
+// u16 owner:1; /* Who owns this buffer ? */
+//};
+
+//struct rdesc1 {
+// u16 PQTAG;
+// u8 CSM;
+// u8 IPKT;
+//};
struct rx_desc {
- struct rdesc0 rdesc0;
- struct rdesc1 rdesc1;
+// struct rdesc0 rdesc0;
+// struct rdesc1 rdesc1;
+ u32 rdesc0;
+ u32 rdesc1;
u32 pa_low; /* Low 32 bit PCI address */
- u16 pa_high; /* Next 16 bit PCI address (48 total) */
- u16 len:15; /* Frame size */
- u16 inten:1; /* Enable interrupt */
+// u16 pa_high; /* Next 16 bit PCI address (48 total) */
+// u16 len:15; /* Frame size */
+// u16 inten:1; /* Enable interrupt */
+ u32 ltwo;
} __attribute__ ((__packed__));
/*
* Transmit descriptor
*/
-struct tdesc0 {
- u16 TSR; /* Transmit status register */
- u16 pktsize:14; /* Size of frame */
- u16 reserved:1;
- u16 owner:1; /* Who owns the buffer */
-};
-
-struct pqinf { /* Priority queue info */
- u16 VID:12;
- u16 CFI:1;
- u16 priority:3;
-} __attribute__ ((__packed__));
-
-struct tdesc1 {
- struct pqinf pqinf;
- u8 TCR;
- u8 TCPLS:2;
- u8 reserved:2;
- u8 CMDZ:4;
-} __attribute__ ((__packed__));
+//struct tdesc0 {
+// u16 TSR; /* Transmit status register */
+// u16 pktsize:14; /* Size of frame */
+// u16 reserved:1;
+// u16 owner:1; /* Who owns the buffer */
+//};
+
+//struct pqinf { /* Priority queue info */
+// u16 VID:12;
+// u16 CFI:1;
+// u16 priority:3;
+//} __attribute__ ((__packed__));
+
+//struct tdesc1 {
+// struct pqinf pqinf;
+// u8 TCR;
+// u8 TCPLS:2;
+// u8 reserved:2;
+// u8 CMDZ:4;
+//} __attribute__ ((__packed__));
struct td_buf {
u32 pa_low;
- u16 pa_high;
- u16 bufsize:14;
- u16 reserved:1;
- u16 queue:1;
+// u16 pa_high;
+// u16 bufsize:14;
+// u16 reserved:1;
+// u16 queue:1;
+ u32 ltwo;
} __attribute__ ((__packed__));
struct tx_desc {
- struct tdesc0 tdesc0;
- struct tdesc1 tdesc1;
+// struct tdesc0 tdesc0;
+// struct tdesc1 tdesc1;
+ u32 tdesc0;
+ u32 tdesc1;
struct td_buf td_buf[7];
};
@@ -279,6 +285,16 @@ enum velocity_owner {
OWNED_BY_NIC = 1
};
+/* Constants added for the BE fixes */
+#define BE_OWNED_BY_NIC 0x80000000UL
+#define BE_INT_ENABLE 0x80000000UL
+#define BE_QUEUE_ENABLE 0x80000000UL
+#define BE_TCR_TIC 0x00800000UL
+#define BE_TCR_VETAG 0x00200000UL
+#define BE_TCR_TCPCK 0x00040000UL
+#define BE_TCR_UDPCK 0x00080000UL
+#define BE_TCR_IPCK 0x00100000UL
+
/*
* MAC registers and macros.
@@ -1698,6 +1714,7 @@ enum velocity_flow_cntl_type {
};
struct velocity_opt {
+ int velo_debug; /* debug flag */
int numrx; /* Number of RX descriptors */
int numtx; /* Number of TX descriptors */
enum speed_opt spd_dpx; /* Media link mode */

View File

@ -0,0 +1,411 @@
diff -uprN linux-2.6.23.orig/arch/arm/mach-ixp4xx/fsg-pci.c linux-2.6.23/arch/arm/mach-ixp4xx/fsg-pci.c
--- linux-2.6.23.orig/arch/arm/mach-ixp4xx/fsg-pci.c 1969-12-31 18:00:00.000000000 -0600
+++ linux-2.6.23/arch/arm/mach-ixp4xx/fsg-pci.c 2007-10-11 00:55:34.000000000 -0500
@@ -0,0 +1,71 @@
+/*
+ * arch/arch/mach-ixp4xx/fsg-pci.c
+ *
+ * FSG board-level PCI initialization
+ *
+ * Author: Rod Whitby <rod@whitby.id.au>
+ * Maintainer: http://www.nslu2-linux.org/
+ *
+ * based on ixdp425-pci.c:
+ * Copyright (C) 2002 Intel Corporation.
+ * Copyright (C) 2003-2004 MontaVista Software, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ */
+
+#include <linux/pci.h>
+#include <linux/init.h>
+#include <linux/irq.h>
+
+#include <asm/mach/pci.h>
+#include <asm/mach-types.h>
+
+void __init fsg_pci_preinit(void)
+{
+ set_irq_type(IRQ_FSG_PCI_INTA, IRQT_LOW);
+ set_irq_type(IRQ_FSG_PCI_INTB, IRQT_LOW);
+ set_irq_type(IRQ_FSG_PCI_INTC, IRQT_LOW);
+
+ ixp4xx_pci_preinit();
+}
+
+static int __init fsg_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
+{
+ static int pci_irq_table[FSG_PCI_IRQ_LINES] = {
+ IRQ_FSG_PCI_INTC,
+ IRQ_FSG_PCI_INTB,
+ IRQ_FSG_PCI_INTA,
+ };
+
+ int irq = -1;
+ slot = slot - 11;
+
+ if (slot >= 1 && slot <= FSG_PCI_MAX_DEV &&
+ pin >= 1 && pin <= FSG_PCI_IRQ_LINES) {
+ irq = pci_irq_table[(slot - 1)];
+ }
+ printk("%s: Mapped slot %d pin %d to IRQ %d\n", __FUNCTION__,slot, pin, irq);
+
+ return irq;
+}
+
+struct hw_pci fsg_pci __initdata = {
+ .nr_controllers = 1,
+ .preinit = fsg_pci_preinit,
+ .swizzle = pci_std_swizzle,
+ .setup = ixp4xx_setup,
+ .scan = ixp4xx_scan_bus,
+ .map_irq = fsg_map_irq,
+};
+
+int __init fsg_pci_init(void)
+{
+ if (machine_is_fsg())
+ pci_common_init(&fsg_pci);
+ return 0;
+}
+
+subsys_initcall(fsg_pci_init);
diff -uprN linux-2.6.23.orig/arch/arm/mach-ixp4xx/fsg-setup.c linux-2.6.23/arch/arm/mach-ixp4xx/fsg-setup.c
--- linux-2.6.23.orig/arch/arm/mach-ixp4xx/fsg-setup.c 1969-12-31 18:00:00.000000000 -0600
+++ linux-2.6.23/arch/arm/mach-ixp4xx/fsg-setup.c 2007-10-11 00:55:34.000000000 -0500
@@ -0,0 +1,186 @@
+/*
+ * arch/arm/mach-ixp4xx/fsg-setup.c
+ *
+ * FSG board-setup
+ *
+ * based ixdp425-setup.c:
+ * Copyright (C) 2003-2004 MontaVista Software, Inc.
+ *
+ * Author: Rod Whitby <rod@whitby.id.au>
+ * Maintainers: http://www.nslu2-linux.org/
+ *
+ */
+
+#include <linux/kernel.h>
+#include <linux/serial.h>
+#include <linux/serial_8250.h>
+#include <linux/leds.h>
+#include <linux/i2c-gpio.h>
+
+#include <asm/mach-types.h>
+#include <asm/mach/arch.h>
+#include <asm/mach/flash.h>
+
+static struct flash_platform_data fsg_flash_data = {
+ .map_name = "cfi_probe",
+ .width = 2,
+};
+
+static struct resource fsg_flash_resource = {
+ .flags = IORESOURCE_MEM,
+};
+
+static struct platform_device fsg_flash = {
+ .name = "IXP4XX-Flash",
+ .id = 0,
+ .dev.platform_data = &fsg_flash_data,
+ .num_resources = 1,
+ .resource = &fsg_flash_resource,
+};
+
+static struct i2c_gpio_platform_data fsg_i2c_gpio_data = {
+ .sda_pin = FSG_SDA_PIN,
+ .scl_pin = FSG_SCL_PIN,
+};
+
+static struct platform_device fsg_i2c_gpio = {
+ .name = "i2c-gpio",
+ .id = 0,
+ .dev = {
+ .platform_data = &fsg_i2c_gpio_data,
+ },
+};
+
+#ifdef CONFIG_LEDS_CLASS
+static struct resource fsg_led_resources[] = {
+ {
+ .name = "ring",
+ .start = FSG_LED_RING_GPIO,
+ .end = FSG_LED_RING_GPIO,
+ .flags = IXP4XX_GPIO_HIGH,
+ },
+ {
+ .name = "sync",
+ .start = FSG_LED_SYNC_GPIO,
+ .end = FSG_LED_SYNC_GPIO,
+ .flags = IXP4XX_GPIO_HIGH,
+ },
+ {
+ .name = "usb",
+ .start = FSG_LED_USB_GPIO,
+ .end = FSG_LED_USB_GPIO,
+ .flags = IXP4XX_GPIO_HIGH,
+ },
+ {
+ .name = "sata",
+ .start = FSG_LED_SATA_GPIO,
+ .end = FSG_LED_SATA_GPIO,
+ .flags = IXP4XX_GPIO_HIGH,
+ },
+ {
+ .name = "wan",
+ .start = FSG_LED_WAN_GPIO,
+ .end = FSG_LED_WAN_GPIO,
+ .flags = IXP4XX_GPIO_HIGH,
+ },
+ {
+ .name = "wlan",
+ .start = FSG_LED_WLAN_GPIO,
+ .end = FSG_LED_WLAN_GPIO,
+ .flags = IXP4XX_GPIO_HIGH,
+ },
+};
+
+static struct platform_device fsg_leds = {
+ .name = "IXP4XX-GPIO-LED",
+ .id = -1,
+ .num_resources = ARRAY_SIZE(fsg_led_resources),
+ .resource = fsg_led_resources,
+};
+#endif
+
+static struct resource fsg_uart_resources[] = {
+ {
+ .start = IXP4XX_UART1_BASE_PHYS,
+ .end = IXP4XX_UART1_BASE_PHYS + 0x0fff,
+ .flags = IORESOURCE_MEM,
+ },
+ {
+ .start = IXP4XX_UART2_BASE_PHYS,
+ .end = IXP4XX_UART2_BASE_PHYS + 0x0fff,
+ .flags = IORESOURCE_MEM,
+ }
+};
+
+static struct plat_serial8250_port fsg_uart_data[] = {
+ {
+ .mapbase = IXP4XX_UART1_BASE_PHYS,
+ .membase = (char *)IXP4XX_UART1_BASE_VIRT + REG_OFFSET,
+ .irq = IRQ_IXP4XX_UART1,
+ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
+ .iotype = UPIO_MEM,
+ .regshift = 2,
+ .uartclk = IXP4XX_UART_XTAL,
+ },
+ {
+ .mapbase = IXP4XX_UART2_BASE_PHYS,
+ .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET,
+ .irq = IRQ_IXP4XX_UART2,
+ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
+ .iotype = UPIO_MEM,
+ .regshift = 2,
+ .uartclk = IXP4XX_UART_XTAL,
+ },
+ { }
+};
+
+static struct platform_device fsg_uart = {
+ .name = "serial8250",
+ .id = PLAT8250_DEV_PLATFORM,
+ .dev.platform_data = fsg_uart_data,
+ .num_resources = ARRAY_SIZE(fsg_uart_resources),
+ .resource = fsg_uart_resources,
+};
+
+static struct platform_device *fsg_devices[] __initdata = {
+ &fsg_i2c_gpio,
+ &fsg_flash,
+#ifdef CONFIG_LEDS_IXP4XX
+ &fsg_leds,
+#endif
+};
+
+static void __init fsg_init(void)
+{
+ ixp4xx_sys_init();
+
+ fsg_flash_resource.start = IXP4XX_EXP_BUS_BASE(0);
+ fsg_flash_resource.end =
+ IXP4XX_EXP_BUS_BASE(0) + ixp4xx_exp_bus_size - 1;
+
+ *IXP4XX_EXP_CS0 |= IXP4XX_FLASH_WRITABLE;
+ *IXP4XX_EXP_CS1 = *IXP4XX_EXP_CS0;
+
+ /* Configure CS2 for operation, 8bit and writable */
+ *IXP4XX_EXP_CS2 = 0xbfff0002;
+
+ /* This is only useful on a modified machine, but it is valuable
+ * to have it first in order to see debug messages, and so that
+ * it does *not* get removed if platform_add_devices fails!
+ */
+ (void)platform_device_register(&fsg_uart);
+
+ platform_add_devices(fsg_devices, ARRAY_SIZE(fsg_devices));
+}
+
+MACHINE_START(FSG, "Freecom FSG-3")
+ /* Maintainer: www.nslu2-linux.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 = fsg_init,
+MACHINE_END
+
diff -uprN linux-2.6.23.orig/arch/arm/mach-ixp4xx/Kconfig linux-2.6.23/arch/arm/mach-ixp4xx/Kconfig
--- linux-2.6.23.orig/arch/arm/mach-ixp4xx/Kconfig 2007-10-09 15:31:38.000000000 -0500
+++ linux-2.6.23/arch/arm/mach-ixp4xx/Kconfig 2007-10-11 00:55:34.000000000 -0500
@@ -125,6 +125,15 @@ config ARCH_IXDP4XX
depends on ARCH_IXDP425 || MACH_IXDP465 || MACH_KIXRP435
default y
+config MACH_FSG
+ bool
+ prompt "Freecom FSG-3"
+ select PCI
+ help
+ Say 'Y' here if you want your kernel to support Freecom's
+ FSG-3 device. For more information on this platform
+ see http://www.nslu2-linux.org/wiki/FSG3/HomePage
+
#
# Certain registers and IRQs are only enabled if supporting IXP465 CPUs
#
diff -uprN linux-2.6.23.orig/arch/arm/mach-ixp4xx/Makefile linux-2.6.23/arch/arm/mach-ixp4xx/Makefile
--- linux-2.6.23.orig/arch/arm/mach-ixp4xx/Makefile 2007-10-09 15:31:38.000000000 -0500
+++ linux-2.6.23/arch/arm/mach-ixp4xx/Makefile 2007-10-11 00:55:34.000000000 -0500
@@ -15,6 +15,7 @@ obj-pci-$(CONFIG_MACH_NAS100D) += nas10
obj-pci-$(CONFIG_MACH_DSMG600) += dsmg600-pci.o
obj-pci-$(CONFIG_MACH_GATEWAY7001) += gateway7001-pci.o
obj-pci-$(CONFIG_MACH_WG302V2) += wg302v2-pci.o
+obj-pci-$(CONFIG_MACH_FSG) += fsg-pci.o
obj-y += common.o
@@ -28,5 +29,6 @@ obj-$(CONFIG_MACH_NAS100D) += nas100d-se
obj-$(CONFIG_MACH_DSMG600) += dsmg600-setup.o dsmg600-power.o
obj-$(CONFIG_MACH_GATEWAY7001) += gateway7001-setup.o
obj-$(CONFIG_MACH_WG302V2) += wg302v2-setup.o
+obj-$(CONFIG_MACH_FSG) += fsg-setup.o
obj-$(CONFIG_PCI) += $(obj-pci-$(CONFIG_PCI)) common-pci.o
diff -uprN linux-2.6.23.orig/include/asm-arm/arch-ixp4xx/fsg.h linux-2.6.23/include/asm-arm/arch-ixp4xx/fsg.h
--- linux-2.6.23.orig/include/asm-arm/arch-ixp4xx/fsg.h 1969-12-31 18:00:00.000000000 -0600
+++ linux-2.6.23/include/asm-arm/arch-ixp4xx/fsg.h 2007-10-11 00:55:34.000000000 -0500
@@ -0,0 +1,74 @@
+/*
+ * include/asm-arm/arch-ixp4xx/fsg.h
+ *
+ * Freecom FSG-3 platform specific definitions
+ *
+ * Author: Rod Whitby <rod@whitby.id.au>
+ * Author: Tomasz Chmielewski <mangoo@wpkg.org>
+ * Maintainers: http://www.nslu2-linux.org
+ *
+ * Based on coyote.h by
+ * Copyright 2004 (c) MontaVista, Software, Inc.
+ *
+ * This file is licensed under the terms of the GNU General Public
+ * License version 2. This program is licensed "as is" without any
+ * warranty of any kind, whether express or implied.
+ */
+
+#ifndef __ASM_ARCH_HARDWARE_H__
+#error "Do not include this directly, instead #include <asm/hardware.h>"
+#endif
+
+#define FSG_SDA_PIN 12
+#define FSG_SCL_PIN 13
+
+/*
+ * FSG PCI IRQs
+ */
+#define FSG_PCI_MAX_DEV 3
+#define FSG_PCI_IRQ_LINES 3
+
+
+/* PCI controller GPIO to IRQ pin mappings */
+#define FSG_PCI_INTA_PIN 6
+#define FSG_PCI_INTB_PIN 7
+#define FSG_PCI_INTC_PIN 5
+
+/* Buttons */
+
+#define FSG_SB_GPIO 4
+#define FSG_RB_GPIO 9
+#define FSG_UB_GPIO 10
+
+#define FSG_SB_IRQ IRQ_IXP4XX_GPIO4
+#define FSG_RB_IRQ IRQ_IXP4XX_GPIO9
+#define FSG_UB_IRQ IRQ_IXP4XX_GPIO10
+
+#define FSG_SB_BM (1L << FSG_SB_GPIO)
+#define FSG_RB_BM (1L << FSG_RB_GPIO)
+#define FSG_UB_BM (1L << FSG_UB_GPIO)
+
+/* LEDs */
+
+#define FSG_LED_RING_GPIO 0
+#define FSG_LED_SYNC_GPIO 1
+#define FSG_LED_USB_GPIO 2
+#define FSG_LED_SATA_GPIO 3
+#define FSG_LED_WAN_GPIO 4
+#define FSG_LED_WLAN_GPIO 5
+
+/* %%% REMOVE %%%
+#define FSG_PCI_SLOT0_PIN 6
+#define FSG_PCI_SLOT1_PIN 7
+
+#define FSG_PCI_SLOT0_DEVID 14
+#define FSG_PCI_SLOT1_DEVID 15
+
+#define FSG_IDE_BASE_PHYS IXP4XX_EXP_BUS_BASE(3)
+#define FSG_IDE_BASE_VIRT 0xFFFE1000
+#define FSG_IDE_REGION_SIZE 0x1000
+
+#define FSG_IDE_DATA_PORT 0xFFFE10E0
+#define FSG_IDE_CTRL_PORT 0xFFFE10FC
+#define FSG_IDE_ERROR_PORT 0xFFFE10E2
+*/
diff -uprN linux-2.6.23.orig/include/asm-arm/arch-ixp4xx/hardware.h linux-2.6.23/include/asm-arm/arch-ixp4xx/hardware.h
--- linux-2.6.23.orig/include/asm-arm/arch-ixp4xx/hardware.h 2007-10-09 15:31:38.000000000 -0500
+++ linux-2.6.23/include/asm-arm/arch-ixp4xx/hardware.h 2007-10-11 00:55:34.000000000 -0500
@@ -45,5 +45,6 @@
#include "nslu2.h"
#include "nas100d.h"
#include "dsmg600.h"
+#include "fsg.h"
#endif /* _ASM_ARCH_HARDWARE_H */
diff -uprN linux-2.6.23.orig/include/asm-arm/arch-ixp4xx/irqs.h linux-2.6.23/include/asm-arm/arch-ixp4xx/irqs.h
--- linux-2.6.23.orig/include/asm-arm/arch-ixp4xx/irqs.h 2007-10-09 15:31:38.000000000 -0500
+++ linux-2.6.23/include/asm-arm/arch-ixp4xx/irqs.h 2007-10-11 00:55:34.000000000 -0500
@@ -128,4 +128,17 @@
#define IRQ_DSMG600_PCI_INTE IRQ_IXP4XX_GPIO7
#define IRQ_DSMG600_PCI_INTF IRQ_IXP4XX_GPIO6
+/*
+ * Freecom FSG-3 Board IRQs
+ */
+#define IRQ_FSG_PCI_INTA IRQ_IXP4XX_GPIO6
+#define IRQ_FSG_PCI_INTB IRQ_IXP4XX_GPIO7
+#define IRQ_FSG_PCI_INTC IRQ_IXP4XX_GPIO5
+
+/* %%% REMOVE %%%
+#define IRQ_FSG_PCI_SLOT0 IRQ_IXP4XX_GPIO6
+#define IRQ_FSG_PCI_SLOT1 IRQ_IXP4XX_GPIO7
+#define IRQ_FSG_IDE IRQ_IXP4XX_GPIO5
+*/
+
#endif

View File

@ -0,0 +1,187 @@
diff -uprN linux-2.6.23.orig/drivers/i2c/chips/eeprom.c linux-2.6.23/drivers/i2c/chips/eeprom.c
--- linux-2.6.23.orig/drivers/i2c/chips/eeprom.c 2007-10-09 15:31:38.000000000 -0500
+++ linux-2.6.23/drivers/i2c/chips/eeprom.c 2007-10-11 00:57:25.000000000 -0500
@@ -33,6 +33,8 @@
#include <linux/jiffies.h>
#include <linux/i2c.h>
#include <linux/mutex.h>
+#include <linux/notifier.h>
+#include <linux/eeprom.h>
/* Addresses to scan */
static unsigned short normal_i2c[] = { 0x50, 0x51, 0x52, 0x53, 0x54,
@@ -41,26 +43,7 @@ static unsigned short normal_i2c[] = { 0
/* Insmod parameters */
I2C_CLIENT_INSMOD_1(eeprom);
-
-/* Size of EEPROM in bytes */
-#define EEPROM_SIZE 256
-
-/* possible types of eeprom devices */
-enum eeprom_nature {
- UNKNOWN,
- VAIO,
-};
-
-/* Each client has this additional data */
-struct eeprom_data {
- struct i2c_client client;
- struct mutex update_lock;
- u8 valid; /* bitfield, bit!=0 if slice is valid */
- unsigned long last_updated[8]; /* In jiffies, 8 slices */
- u8 data[EEPROM_SIZE]; /* Register values */
- enum eeprom_nature nature;
-};
-
+ATOMIC_NOTIFIER_HEAD(eeprom_chain);
static int eeprom_attach_adapter(struct i2c_adapter *adapter);
static int eeprom_detect(struct i2c_adapter *adapter, int address, int kind);
@@ -191,6 +174,7 @@ static int eeprom_detect(struct i2c_adap
data->valid = 0;
mutex_init(&data->update_lock);
data->nature = UNKNOWN;
+ data->attr = &eeprom_attr;
/* Tell the I2C layer a new client has arrived */
if ((err = i2c_attach_client(new_client)))
@@ -214,6 +198,9 @@ static int eeprom_detect(struct i2c_adap
if (err)
goto exit_detach;
+ /* call the notifier chain */
+ atomic_notifier_call_chain(&eeprom_chain, EEPROM_REGISTER, data);
+
return 0;
exit_detach:
@@ -239,6 +226,41 @@ static int eeprom_detach_client(struct i
return 0;
}
+/**
+ * register_eeprom_notifier - register a 'user' of EEPROM devices.
+ * @nb: pointer to notifier info structure
+ *
+ * Registers a callback function to be called upon detection
+ * of an EEPROM device. Detection invokes the 'add' callback
+ * with the kobj of the mutex and a bin_attribute which allows
+ * read from the EEPROM. The intention is that the notifier
+ * will be able to read system configuration from the notifier.
+ *
+ * Only EEPROMs detected *after* the addition of the notifier
+ * are notified. I.e. EEPROMs already known to the system
+ * will not be notified - add the notifier from board level
+ * code!
+ */
+int register_eeprom_notifier(struct notifier_block *nb)
+{
+ return atomic_notifier_chain_register(&eeprom_chain, nb);
+}
+
+/**
+ * unregister_eeprom_notifier - unregister a 'user' of EEPROM devices.
+ * @old: pointer to notifier info structure
+ *
+ * Removes a callback function from the list of 'users' to be
+ * notified upon detection of EEPROM devices.
+ */
+int unregister_eeprom_notifier(struct notifier_block *nb)
+{
+ return atomic_notifier_chain_unregister(&eeprom_chain, nb);
+}
+
+EXPORT_SYMBOL_GPL(register_eeprom_notifier);
+EXPORT_SYMBOL_GPL(unregister_eeprom_notifier);
+
static int __init eeprom_init(void)
{
return i2c_add_driver(&eeprom_driver);
diff -uprN linux-2.6.23.orig/include/linux/eeprom.h linux-2.6.23/include/linux/eeprom.h
--- linux-2.6.23.orig/include/linux/eeprom.h 1969-12-31 18:00:00.000000000 -0600
+++ linux-2.6.23/include/linux/eeprom.h 2007-10-11 00:57:25.000000000 -0500
@@ -0,0 +1,71 @@
+#ifndef _LINUX_EEPROM_H
+#define _LINUX_EEPROM_H
+/*
+ * EEPROM notifier header
+ *
+ * Copyright (C) 2006 John Bowler
+ */
+
+/*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef __KERNEL__
+#error This is a kernel header
+#endif
+
+#include <linux/list.h>
+#include <linux/kobject.h>
+#include <linux/sysfs.h>
+
+/* Size of EEPROM in bytes */
+#define EEPROM_SIZE 256
+
+/* possible types of eeprom devices */
+enum eeprom_nature {
+ UNKNOWN,
+ VAIO,
+};
+
+/* Each client has this additional data */
+struct eeprom_data {
+ struct i2c_client client;
+ struct mutex update_lock;
+ u8 valid; /* bitfield, bit!=0 if slice is valid */
+ unsigned long last_updated[8]; /* In jiffies, 8 slices */
+ u8 data[EEPROM_SIZE]; /* Register values */
+ enum eeprom_nature nature;
+ struct bin_attribute *attr;
+};
+
+/*
+ * This is very basic.
+ *
+ * If an EEPROM is detected on the I2C bus (this only works for
+ * I2C EEPROMs) the notifier chain is called with
+ * both the I2C information and the kobject for the sysfs
+ * device which has been registers. It is then possible to
+ * read from the device via the bin_attribute::read method
+ * to extract configuration information.
+ *
+ * Register the notifier in the board level code, there is no
+ * need to unregister it but you can if you want (it will save
+ * a little bit or kernel memory to do so).
+ */
+
+extern int register_eeprom_notifier(struct notifier_block *nb);
+extern int unregister_eeprom_notifier(struct notifier_block *nb);
+
+#endif /* _LINUX_EEPROM_H */
diff -uprN linux-2.6.23.orig/include/linux/notifier.h linux-2.6.23/include/linux/notifier.h
--- linux-2.6.23.orig/include/linux/notifier.h 2007-10-09 15:31:38.000000000 -0500
+++ linux-2.6.23/include/linux/notifier.h 2007-10-11 00:57:25.000000000 -0500
@@ -231,5 +231,8 @@ static inline int notifier_to_errno(int
#define PM_SUSPEND_PREPARE 0x0003 /* Going to suspend the system */
#define PM_POST_SUSPEND 0x0004 /* Suspend finished */
+/* eeprom notifier chain */
+#define EEPROM_REGISTER 0x0001
+
#endif /* __KERNEL__ */
#endif /* _LINUX_NOTIFIER_H */

View File

@ -0,0 +1,23 @@
diff -uprN linux-2.6.23.orig/drivers/ata/pata_artop.c linux-2.6.23/drivers/ata/pata_artop.c
--- linux-2.6.23.orig/drivers/ata/pata_artop.c 2007-10-09 15:31:38.000000000 -0500
+++ linux-2.6.23/drivers/ata/pata_artop.c 2007-10-11 00:59:14.000000000 -0500
@@ -27,6 +27,7 @@
#include <scsi/scsi_host.h>
#include <linux/libata.h>
#include <linux/ata.h>
+#include <asm/mach-types.h>
#define DRV_NAME "pata_artop"
#define DRV_VERSION "0.4.4"
@@ -489,6 +490,11 @@ static int artop_init_one (struct pci_de
pci_read_config_byte(pdev, 0x4a, &reg);
pci_write_config_byte(pdev, 0x4a, (reg & ~0x01) | 0x80);
+ /* NAS100D workaround - probing second port kills uhci_hcd */
+#ifdef CONFIG_MACH_NAS100D
+ if (machine_is_nas100d())
+ ppi[1] = &ata_dummy_port_info;
+#endif
}
BUG_ON(ppi[0] == NULL);

View File

@ -0,0 +1,36 @@
---
arch/arm/mach-ixp4xx/dsmg600-power.c | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
Index: linux-2.6.22-rc5-armeb/arch/arm/mach-ixp4xx/dsmg600-power.c
===================================================================
--- linux-2.6.22-rc5-armeb.orig/arch/arm/mach-ixp4xx/dsmg600-power.c
+++ linux-2.6.22-rc5-armeb/arch/arm/mach-ixp4xx/dsmg600-power.c
@@ -50,6 +50,13 @@
if (*IXP4XX_GPIO_GPINR & DSMG600_PB_BM) {
/* IO Pin is 1 (button pushed) */
+ if (power_button_countdown > 0) {
+ power_button_countdown--;
+ }
+
+ } else {
+
+ /* Done on button release, to allow for auto-power-on mods. */
if (power_button_countdown == 0) {
/* Signal init to do the ctrlaltdel action, this will bypass
* init if it hasn't started and do a kernel_restart.
@@ -58,11 +65,9 @@
/* Change the state of the power LED to "blink" */
gpio_line_set(DSMG600_LED_PWR_GPIO, IXP4XX_GPIO_LOW);
+ } else {
+ power_button_countdown = PBUTTON_HOLDDOWN_COUNT;
}
- power_button_countdown--;
-
- } else {
- power_button_countdown = PBUTTON_HOLDDOWN_COUNT;
}
mod_timer(&dsmg600_power_timer, jiffies + msecs_to_jiffies(500));

View File

@ -0,0 +1,133 @@
---
arch/arm/mach-ixp4xx/nas100d-power.c | 68 ++++++++++++++++++++++++++++++++--
include/asm-arm/arch-ixp4xx/nas100d.h | 18 +++++----
2 files changed, 75 insertions(+), 11 deletions(-)
Index: linux-2.6.22-rc5-armeb/arch/arm/mach-ixp4xx/nas100d-power.c
===================================================================
--- linux-2.6.22-rc5-armeb.orig/arch/arm/mach-ixp4xx/nas100d-power.c
+++ linux-2.6.22-rc5-armeb/arch/arm/mach-ixp4xx/nas100d-power.c
@@ -21,15 +21,60 @@
#include <linux/irq.h>
#include <linux/module.h>
#include <linux/reboot.h>
+#include <linux/jiffies.h>
+#include <linux/timer.h>
#include <asm/mach-types.h>
-static irqreturn_t nas100d_reset_handler(int irq, void *dev_id)
+extern void ctrl_alt_del(void);
+
+/* This is used to make sure the power-button pusher is serious. The button
+ * must be held until the value of this counter reaches zero.
+ */
+static volatile int power_button_countdown;
+
+/* Must hold the button down for at least this many counts to be processed */
+#define PBUTTON_HOLDDOWN_COUNT 4 /* 2 secs */
+
+static void nas100d_power_handler(unsigned long data);
+static DEFINE_TIMER(nas100d_power_timer, nas100d_power_handler, 0, 0);
+
+static void nas100d_power_handler(unsigned long data)
{
- /* Signal init to do the ctrlaltdel action, this will bypass init if
- * it hasn't started and do a kernel_restart.
+ /* This routine is called twice per second to check the
+ * state of the power button.
*/
- ctrl_alt_del();
+
+ if (*IXP4XX_GPIO_GPINR & NAS100D_PB_BM) {
+
+ /* IO Pin is 1 (button pushed) */
+ if (power_button_countdown > 0) {
+ power_button_countdown--;
+ }
+
+ } else {
+
+ /* Done on button release, to allow for auto-power-on mods. */
+ if (power_button_countdown == 0) {
+ /* Signal init to do the ctrlaltdel action, this will bypass
+ * init if it hasn't started and do a kernel_restart.
+ */
+ ctrl_alt_del();
+
+ /* Change the state of the power LED to "blink" */
+ gpio_line_set(NAS100D_LED_PWR_GPIO, IXP4XX_GPIO_LOW);
+ } else {
+ power_button_countdown = PBUTTON_HOLDDOWN_COUNT;
+ }
+ }
+
+ mod_timer(&nas100d_power_timer, jiffies + msecs_to_jiffies(500));
+}
+
+static irqreturn_t nas100d_reset_handler(int irq, void *dev_id)
+{
+ /* This is the paper-clip reset, it shuts the machine down directly. */
+ machine_power_off();
return IRQ_HANDLED;
}
@@ -50,6 +95,19 @@
return -EIO;
}
+ /* The power button on the Iomega NAS100d is on GPIO 14, but
+ * it cannot handle interrupts on that GPIO line. So we'll
+ * have to poll it with a kernel timer.
+ */
+
+ /* Make sure that the power button GPIO is set up as an input */
+ gpio_line_config(NAS100D_PB_GPIO, IXP4XX_GPIO_IN);
+
+ /* Set the initial value for the power button IRQ handler */
+ power_button_countdown = PBUTTON_HOLDDOWN_COUNT;
+
+ mod_timer(&nas100d_power_timer, jiffies + msecs_to_jiffies(500));
+
return 0;
}
@@ -58,6 +116,8 @@
if (!(machine_is_nas100d()))
return;
+ del_timer_sync(&nas100d_power_timer);
+
free_irq(NAS100D_RB_IRQ, NULL);
}
Index: linux-2.6.22-rc5-armeb/include/asm-arm/arch-ixp4xx/nas100d.h
===================================================================
--- linux-2.6.22-rc5-armeb.orig/include/asm-arm/arch-ixp4xx/nas100d.h
+++ linux-2.6.22-rc5-armeb/include/asm-arm/arch-ixp4xx/nas100d.h
@@ -39,14 +39,18 @@
/* Buttons */
#define NAS100D_PB_GPIO 14
+#define NAS100D_PB_BM (1L << NAS100D_PB_GPIO)
+
#define NAS100D_RB_GPIO 4
-#define NAS100D_PO_GPIO 12 /* power off */
-#define NAS100D_PB_IRQ IRQ_IXP4XX_GPIO14
#define NAS100D_RB_IRQ IRQ_IXP4XX_GPIO4
-/*
-#define NAS100D_PB_BM (1L << NAS100D_PB_GPIO)
-#define NAS100D_PO_BM (1L << NAS100D_PO_GPIO)
-#define NAS100D_RB_BM (1L << NAS100D_RB_GPIO)
-*/
+#define NAS100D_PO_GPIO 12 /* power off */
+
+/* LEDs */
+
+#define NAS100D_LED_PWR_GPIO 15
+#define NAS100D_LED_PWR_BM (1L << NAS100D_LED_PWR_GPIO)
+
+#define NAS100D_LED_WLAN_GPIO 0
+#define NAS100D_LED_WLAN_BM (1L << NAS100D_LED_WLAN_GPIO)

View File

@ -0,0 +1,47 @@
diff --git a/arch/arm/mach-ixp4xx/nslu2-setup.c b/arch/arm/mach-ixp4xx/nslu2-setup.c
index 9bf8ccb..77277d2 100644
--- a/arch/arm/mach-ixp4xx/nslu2-setup.c
+++ b/arch/arm/mach-ixp4xx/nslu2-setup.c
@@ -18,6 +18,7 @@
#include <linux/serial.h>
#include <linux/serial_8250.h>
#include <linux/leds.h>
+#include <linux/i2c-gpio.h>
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
@@ -41,7 +42,7 @@ static struct platform_device nslu2_flash = {
.resource = &nslu2_flash_resource,
};
-static struct ixp4xx_i2c_pins nslu2_i2c_gpio_pins = {
+static struct i2c_gpio_platform_data nslu2_i2c_gpio_data = {
.sda_pin = NSLU2_SDA_PIN,
.scl_pin = NSLU2_SCL_PIN,
};
@@ -82,11 +83,12 @@ static struct platform_device nslu2_leds = {
};
#endif
-static struct platform_device nslu2_i2c_controller = {
- .name = "IXP4XX-I2C",
+static struct platform_device nslu2_i2c_gpio = {
+ .name = "i2c-gpio",
.id = 0,
- .dev.platform_data = &nslu2_i2c_gpio_pins,
- .num_resources = 0,
+ .dev = {
+ .platform_data = &nslu2_i2c_gpio_data,
+ },
};
static struct platform_device nslu2_beeper = {
@@ -139,7 +141,7 @@ static struct platform_device nslu2_uart = {
};
static struct platform_device *nslu2_devices[] __initdata = {
- &nslu2_i2c_controller,
+ &nslu2_i2c_gpio,
&nslu2_flash,
&nslu2_beeper,
#ifdef CONFIG_LEDS_IXP4XX

View File

@ -0,0 +1,44 @@
diff --git a/arch/arm/mach-ixp4xx/nas100d-setup.c b/arch/arm/mach-ixp4xx/nas100d-setup.c
index 78a1741..54d884f 100644
--- a/arch/arm/mach-ixp4xx/nas100d-setup.c
+++ b/arch/arm/mach-ixp4xx/nas100d-setup.c
@@ -16,6 +16,7 @@
#include <linux/serial.h>
#include <linux/serial_8250.h>
#include <linux/leds.h>
+#include <linux/i2c-gpio.h>
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
@@ -68,16 +69,17 @@ static struct platform_device nas100d_leds = {
};
#endif
-static struct ixp4xx_i2c_pins nas100d_i2c_gpio_pins = {
+static struct i2c_gpio_platform_data nas100d_i2c_gpio_data = {
.sda_pin = NAS100D_SDA_PIN,
.scl_pin = NAS100D_SCL_PIN,
};
-static struct platform_device nas100d_i2c_controller = {
- .name = "IXP4XX-I2C",
+static struct platform_device nas100d_i2c_gpio = {
+ .name = "i2c-gpio",
.id = 0,
- .dev.platform_data = &nas100d_i2c_gpio_pins,
- .num_resources = 0,
+ .dev = {
+ .platform_data = &nas100d_i2c_gpio_data,
+ },
};
static struct resource nas100d_uart_resources[] = {
@@ -124,7 +126,7 @@ static struct platform_device nas100d_uart = {
};
static struct platform_device *nas100d_devices[] __initdata = {
- &nas100d_i2c_controller,
+ &nas100d_i2c_gpio,
&nas100d_flash,
#ifdef CONFIG_LEDS_IXP4XX
&nas100d_leds,

View File

@ -0,0 +1,45 @@
Index: linux-2.6.22-rc3-git2-armeb/arch/arm/mach-ixp4xx/avila-setup.c
===================================================================
--- linux-2.6.22-rc3-git2-armeb.orig/arch/arm/mach-ixp4xx/avila-setup.c 2007-05-31 04:05:33.000000000 -0700
+++ linux-2.6.22-rc3-git2-armeb/arch/arm/mach-ixp4xx/avila-setup.c 2007-05-31 04:12:50.000000000 -0700
@@ -18,6 +18,7 @@
#include <linux/tty.h>
#include <linux/serial_8250.h>
#include <linux/slab.h>
+#include <linux/i2c-gpio.h>
#include <asm/types.h>
#include <asm/setup.h>
@@ -47,18 +48,17 @@
.resource = &avila_flash_resource,
};
-static struct ixp4xx_i2c_pins avila_i2c_gpio_pins = {
+static struct i2c_gpio_platform_data avila_i2c_gpio_data = {
.sda_pin = AVILA_SDA_PIN,
.scl_pin = AVILA_SCL_PIN,
};
-static struct platform_device avila_i2c_controller = {
- .name = "IXP4XX-I2C",
+static struct platform_device avila_i2c_gpio = {
+ .name = "i2c-gpio",
.id = 0,
- .dev = {
- .platform_data = &avila_i2c_gpio_pins,
+ .dev = {
+ .platform_data = &avila_i2c_gpio_data,
},
- .num_resources = 0
};
static struct resource avila_uart_resources[] = {
@@ -133,7 +133,7 @@
};
static struct platform_device *avila_devices[] __initdata = {
- &avila_i2c_controller,
+ &avila_i2c_gpio,
&avila_flash,
&avila_uart
};

View File

@ -0,0 +1,43 @@
Index: linux-2.6.22-rc3-git2-armeb/arch/arm/mach-ixp4xx/dsmg600-setup.c
===================================================================
--- linux-2.6.22-rc3-git2-armeb.orig/arch/arm/mach-ixp4xx/dsmg600-setup.c 2007-05-31 04:05:30.000000000 -0700
+++ linux-2.6.22-rc3-git2-armeb/arch/arm/mach-ixp4xx/dsmg600-setup.c 2007-05-31 04:13:02.000000000 -0700
@@ -14,6 +14,7 @@
#include <linux/kernel.h>
#include <linux/serial.h>
#include <linux/serial_8250.h>
+#include <linux/i2c-gpio.h>
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
@@ -37,15 +38,17 @@
.resource = &dsmg600_flash_resource,
};
-static struct ixp4xx_i2c_pins dsmg600_i2c_gpio_pins = {
+static struct i2c_gpio_platform_data dsmg600_i2c_gpio_data = {
.sda_pin = DSMG600_SDA_PIN,
.scl_pin = DSMG600_SCL_PIN,
};
-static struct platform_device dsmg600_i2c_controller = {
- .name = "IXP4XX-I2C",
+static struct platform_device dsmg600_i2c_gpio = {
+ .name = "i2c-gpio",
.id = 0,
- .dev.platform_data = &dsmg600_i2c_gpio_pins,
+ .dev = {
+ .platform_data = &dsmg600_i2c_gpio_data,
+ },
};
#ifdef CONFIG_LEDS_CLASS
@@ -116,7 +119,7 @@
};
static struct platform_device *dsmg600_devices[] __initdata = {
- &dsmg600_i2c_controller,
+ &dsmg600_i2c_gpio,
&dsmg600_flash,
};

View File

@ -0,0 +1,44 @@
diff -uprN linux-2.6.23.orig/arch/arm/mach-ixp4xx/ixdp425-setup.c linux-2.6.23/arch/arm/mach-ixp4xx/ixdp425-setup.c
--- linux-2.6.23.orig/arch/arm/mach-ixp4xx/ixdp425-setup.c 2007-10-09 15:31:38.000000000 -0500
+++ linux-2.6.23/arch/arm/mach-ixp4xx/ixdp425-setup.c 2007-10-11 01:01:02.000000000 -0500
@@ -15,6 +15,7 @@
#include <linux/tty.h>
#include <linux/serial_8250.h>
#include <linux/slab.h>
+#include <linux/i2c-gpio.h>
#include <linux/io.h>
#include <linux/mtd/mtd.h>
#include <linux/mtd/nand.h>
@@ -120,18 +121,17 @@ static struct platform_device ixdp425_fl
};
#endif /* CONFIG_MTD_NAND_PLATFORM */
-static struct ixp4xx_i2c_pins ixdp425_i2c_gpio_pins = {
+static struct i2c_gpio_platform_data ixdp425_i2c_gpio_data = {
.sda_pin = IXDP425_SDA_PIN,
.scl_pin = IXDP425_SCL_PIN,
};
-static struct platform_device ixdp425_i2c_controller = {
- .name = "IXP4XX-I2C",
+static struct platform_device ixdp425_i2c_gpio = {
+ .name = "i2c-gpio",
.id = 0,
- .dev = {
- .platform_data = &ixdp425_i2c_gpio_pins,
+ .dev = {
+ .platform_data = &ixdp425_i2c_gpio_data,
},
- .num_resources = 0
};
static struct resource ixdp425_uart_resources[] = {
@@ -178,7 +178,7 @@ static struct platform_device ixdp425_ua
};
static struct platform_device *ixdp425_devices[] __initdata = {
- &ixdp425_i2c_controller,
+ &ixdp425_i2c_gpio,
&ixdp425_flash,
#if defined(CONFIG_MTD_NAND_PLATFORM) || \
defined(CONFIG_MTD_NAND_PLATFORM_MODULE)

View File

@ -0,0 +1,36 @@
diff --git a/arch/arm/mach-ixp4xx/nslu2-setup.c b/arch/arm/mach-ixp4xx/nslu2-setup.c
index 77277d2..e0d0dde 100644
--- a/arch/arm/mach-ixp4xx/nslu2-setup.c
+++ b/arch/arm/mach-ixp4xx/nslu2-setup.c
@@ -140,6 +140,23 @@ static struct platform_device nslu2_uart = {
.resource = nslu2_uart_resources,
};
+/* Built-in 10/100 Ethernet MAC interfaces */
+static struct eth_plat_info nslu2_plat_eth[] = {
+ {
+ .phy = 1,
+ .rxq = 3,
+ .txreadyq = 20,
+ }
+};
+
+static struct platform_device nslu2_eth[] = {
+ {
+ .name = "ixp4xx_eth",
+ .id = IXP4XX_ETH_NPEB,
+ .dev.platform_data = nslu2_plat_eth,
+ }
+};
+
static struct platform_device *nslu2_devices[] __initdata = {
&nslu2_i2c_gpio,
&nslu2_flash,
@@ -147,6 +164,7 @@ static struct platform_device *nslu2_devices[] __initdata = {
#ifdef CONFIG_LEDS_IXP4XX
&nslu2_leds,
#endif
+ &nslu2_eth[0],
};
static void nslu2_power_off(void)

View File

@ -0,0 +1,35 @@
diff --git a/arch/arm/mach-ixp4xx/nas100d-setup.c b/arch/arm/mach-ixp4xx/nas100d-setup.c
index 54d884f..d4d8540 100644
--- a/arch/arm/mach-ixp4xx/nas100d-setup.c
+++ b/arch/arm/mach-ixp4xx/nas100d-setup.c
@@ -125,12 +125,30 @@ static struct platform_device nas100d_uart = {
.resource = nas100d_uart_resources,
};
+/* Built-in 10/100 Ethernet MAC interfaces */
+static struct eth_plat_info nas100d_plat_eth[] = {
+ {
+ .phy = 0,
+ .rxq = 3,
+ .txreadyq = 20,
+ }
+};
+
+static struct platform_device nas100d_eth[] = {
+ {
+ .name = "ixp4xx_eth",
+ .id = IXP4XX_ETH_NPEB,
+ .dev.platform_data = nas100d_plat_eth,
+ }
+};
+
static struct platform_device *nas100d_devices[] __initdata = {
&nas100d_i2c_gpio,
&nas100d_flash,
#ifdef CONFIG_LEDS_IXP4XX
&nas100d_leds,
#endif
+ &nas100d_eth[0],
};
static void nas100d_power_off(void)

View File

@ -0,0 +1,43 @@
diff --git a/arch/arm/mach-ixp4xx/avila-setup.c b/arch/arm/mach-ixp4xx/avila-setup.c
index e38f45f..10ed5d6 100644
--- a/arch/arm/mach-ixp4xx/avila-setup.c
+++ b/arch/arm/mach-ixp4xx/avila-setup.c
@@ -132,10 +132,37 @@ static struct platform_device avila_pata = {
.resource = avila_pata_resources,
};
+/* Built-in 10/100 Ethernet MAC interfaces */
+static struct eth_plat_info avila_plat_eth[] = {
+ {
+ .phy = 0,
+ .rxq = 3,
+ .txreadyq = 20,
+ }, {
+ .phy = 1,
+ .rxq = 4,
+ .txreadyq = 21,
+ }
+};
+
+static struct platform_device avila_eth[] = {
+ {
+ .name = "ixp4xx_eth",
+ .id = IXP4XX_ETH_NPEB,
+ .dev.platform_data = avila_plat_eth,
+ }, {
+ .name = "ixp4xx_eth",
+ .id = IXP4XX_ETH_NPEC,
+ .dev.platform_data = avila_plat_eth + 1,
+ }
+};
+
static struct platform_device *avila_devices[] __initdata = {
&avila_i2c_gpio,
&avila_flash,
- &avila_uart
+ &avila_uart,
+ &avila_eth[0],
+ &avila_eth[1],
};
static void __init avila_init(void)

View File

@ -0,0 +1,44 @@
diff --git a/arch/arm/mach-ixp4xx/fsg-setup.c b/arch/arm/mach-ixp4xx/fsg-setup.c
index 11336e6..ec3d517 100644
--- a/arch/arm/mach-ixp4xx/fsg-setup.c
+++ b/arch/arm/mach-ixp4xx/fsg-setup.c
@@ -142,12 +142,39 @@ static struct platform_device fsg_uart = {
.resource = fsg_uart_resources,
};
+/* Built-in 10/100 Ethernet MAC interfaces */
+static struct eth_plat_info fsg_plat_eth[] = {
+ {
+ .phy = 5,
+ .rxq = 3,
+ .txreadyq = 20,
+ }, {
+ .phy = 4,
+ .rxq = 4,
+ .txreadyq = 21,
+ }
+};
+
+static struct platform_device fsg_eth[] = {
+ {
+ .name = "ixp4xx_eth",
+ .id = IXP4XX_ETH_NPEB,
+ .dev.platform_data = fsg_plat_eth,
+ }, {
+ .name = "ixp4xx_eth",
+ .id = IXP4XX_ETH_NPEC,
+ .dev.platform_data = fsg_plat_eth + 1,
+ }
+};
+
static struct platform_device *fsg_devices[] __initdata = {
&fsg_i2c_gpio,
&fsg_flash,
#ifdef CONFIG_LEDS_IXP4XX
&fsg_leds,
#endif
+ &fsg_eth[0],
+ &fsg_eth[1],
};
static void __init fsg_init(void)

View File

@ -0,0 +1,52 @@
diff --git a/arch/arm/mach-ixp4xx/nslu2-setup.c b/arch/arm/mach-ixp4xx/nslu2-setup.c
index e0d0dde..6e24916 100644
--- a/arch/arm/mach-ixp4xx/nslu2-setup.c
+++ b/arch/arm/mach-ixp4xx/nslu2-setup.c
@@ -19,6 +19,7 @@
#include <linux/serial_8250.h>
#include <linux/leds.h>
#include <linux/i2c-gpio.h>
+#include <linux/mtd/mtd.h>
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
@@ -167,6 +168,30 @@ static struct platform_device *nslu2_devices[] __initdata = {
&nslu2_eth[0],
};
+static void nslu2_flash_add(struct mtd_info *mtd)
+{
+ if (strcmp(mtd->name, "RedBoot") == 0) {
+ size_t retlen;
+ u_char mac[6];
+
+ if (mtd->read(mtd, 0x3FFB0, 6, &retlen, mac) == 0 && retlen == 6) {
+ printk(KERN_INFO "nslu2 mac: %.2x:%.2x:%.2x:%.2x:%.2x:%.2x\n",
+ mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
+ memcpy(nslu2_plat_eth[0].hwaddr, mac, 6);
+ } else {
+ printk(KERN_ERR "nslu2 mac: read failed\n");
+ }
+ }
+}
+
+static void nslu2_flash_remove(struct mtd_info *mtd) {
+}
+
+static struct mtd_notifier nslu2_flash_notifier = {
+ .add = nslu2_flash_add,
+ .remove = nslu2_flash_remove,
+};
+
static void nslu2_power_off(void)
{
/* This causes the box to drop the power and go dead. */
@@ -209,6 +234,8 @@ static void __init nslu2_init(void)
(void)platform_device_register(&nslu2_uart);
platform_add_devices(nslu2_devices, ARRAY_SIZE(nslu2_devices));
+
+ register_mtd_user(&nslu2_flash_notifier);
}
MACHINE_START(NSLU2, "Linksys NSLU2")

View File

@ -0,0 +1,52 @@
diff --git a/arch/arm/mach-ixp4xx/nas100d-setup.c b/arch/arm/mach-ixp4xx/nas100d-setup.c
index d4d8540..b8c99fa 100644
--- a/arch/arm/mach-ixp4xx/nas100d-setup.c
+++ b/arch/arm/mach-ixp4xx/nas100d-setup.c
@@ -17,6 +17,7 @@
#include <linux/serial_8250.h>
#include <linux/leds.h>
#include <linux/i2c-gpio.h>
+#include <linux/mtd/mtd.h>
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
@@ -151,6 +152,30 @@ static struct platform_device *nas100d_devices[] __initdata = {
&nas100d_eth[0],
};
+static void nas100d_flash_add(struct mtd_info *mtd)
+{
+ if (strcmp(mtd->name, "RedBoot config") == 0) {
+ size_t retlen;
+ u_char mac[6];
+
+ if (mtd->read(mtd, 0x0FD8, 6, &retlen, mac) == 0 && retlen == 6) {
+ printk(KERN_INFO "nas100d mac: %.2x:%.2x:%.2x:%.2x:%.2x:%.2x\n",
+ mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
+ memcpy(nas100d_plat_eth[0].hwaddr, mac, 6);
+ } else {
+ printk(KERN_ERR "nas100d mac: read failed\n");
+ }
+ }
+}
+
+static void nas100d_flash_remove(struct mtd_info *mtd) {
+}
+
+static struct mtd_notifier nas100d_flash_notifier = {
+ .add = nas100d_flash_add,
+ .remove = nas100d_flash_remove,
+};
+
static void nas100d_power_off(void)
{
/* This causes the box to drop the power and go dead. */
@@ -183,6 +208,8 @@ static void __init nas100d_init(void)
(void)platform_device_register(&nas100d_uart);
platform_add_devices(nas100d_devices, ARRAY_SIZE(nas100d_devices));
+
+ register_mtd_user(&nas100d_flash_notifier);
}
MACHINE_START(NAS100D, "Iomega NAS 100d")

View File

@ -0,0 +1,56 @@
diff --git a/arch/arm/mach-ixp4xx/fsg-setup.c b/arch/arm/mach-ixp4xx/fsg-setup.c
index ec3d517..7cc7201 100644
--- a/arch/arm/mach-ixp4xx/fsg-setup.c
+++ b/arch/arm/mach-ixp4xx/fsg-setup.c
@@ -16,6 +16,7 @@
#include <linux/serial_8250.h>
#include <linux/leds.h>
#include <linux/i2c-gpio.h>
+#include <linux/mtd/mtd.h>
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
@@ -177,6 +178,34 @@ static struct platform_device *fsg_devices[] __initdata = {
&fsg_eth[1],
};
+static void fsg_flash_add(struct mtd_info *mtd)
+{
+ if (strcmp(mtd->name, "RedBoot config") == 0) {
+ size_t retlen;
+ u_char mac[6];
+
+ if (mtd->read(mtd, 0x0422, 6, &retlen, mac) == 0 && retlen == 6) {
+ printk(KERN_INFO "eth0 mac: %.2x:%.2x:%.2x:%.2x:%.2x:%.2x\n",
+ mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
+ memcpy(fsg_plat_eth[0].hwaddr, mac, 6);
+ mac[5]++;
+ printk(KERN_INFO "eth1 mac: %.2x:%.2x:%.2x:%.2x:%.2x:%.2x\n",
+ mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
+ memcpy(fsg_plat_eth[1].hwaddr, mac, 6);
+ } else {
+ printk(KERN_ERR "fsg mac: read failed\n");
+ }
+ }
+}
+
+static void fsg_flash_remove(struct mtd_info *mtd) {
+}
+
+static struct mtd_notifier fsg_flash_notifier = {
+ .add = fsg_flash_add,
+ .remove = fsg_flash_remove,
+};
+
static void __init fsg_init(void)
{
ixp4xx_sys_init();
@@ -198,6 +227,8 @@ static void __init fsg_init(void)
(void)platform_device_register(&fsg_uart);
platform_add_devices(fsg_devices, ARRAY_SIZE(fsg_devices));
+
+ register_mtd_user(&fsg_flash_notifier);
}
MACHINE_START(FSG, "Freecom FSG-3")

View File

@ -0,0 +1,17 @@
Index: linux-2.6.19/drivers/char/random.c
===================================================================
--- linux-2.6.19.orig/drivers/char/random.c
+++ linux-2.6.19/drivers/char/random.c
@@ -248,9 +248,9 @@
/*
* Configuration information
*/
-#define INPUT_POOL_WORDS 128
-#define OUTPUT_POOL_WORDS 32
-#define SEC_XFER_SIZE 512
+#define INPUT_POOL_WORDS 256
+#define OUTPUT_POOL_WORDS 64
+#define SEC_XFER_SIZE 1024
/*
* The minimum number of bits of entropy before we wake up a read on

View File

@ -0,0 +1,55 @@
diff -uprN linux-2.6.23.orig/arch/arm/mach-ixp4xx/nslu2-setup.c linux-2.6.23/arch/arm/mach-ixp4xx/nslu2-setup.c
--- linux-2.6.23.orig/arch/arm/mach-ixp4xx/nslu2-setup.c 2007-10-09 15:31:38.000000000 -0500
+++ linux-2.6.23/arch/arm/mach-ixp4xx/nslu2-setup.c 2007-10-11 01:04:46.000000000 -0500
@@ -19,6 +19,7 @@
#include <linux/serial_8250.h>
#include <linux/leds.h>
+#include <asm/setup.h>
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
#include <asm/mach/flash.h>
@@ -171,6 +172,35 @@ static struct sys_timer nslu2_timer = {
.init = nslu2_timer_init,
};
+static char nslu2_rtc_probe[] __initdata = "rtc-isl1208.ignore=0,0x6f rtc-x1205.probe=0,0x6f ";
+
+static void __init nslu2_fixup(struct machine_desc *desc,
+ struct tag *tags, char **cmdline, struct meminfo *mi)
+{
+ struct tag *t = tags;
+ char *p = *cmdline;
+
+ /* Find the end of the tags table, taking note of any cmdline tag. */
+ for (; t->hdr.size; t = tag_next(t)) {
+ if (t->hdr.tag == ATAG_CMDLINE) {
+ p = t->u.cmdline.cmdline;
+ }
+ }
+
+ /* Overwrite the end of the table with a new cmdline tag. */
+ t->hdr.tag = ATAG_CMDLINE;
+ t->hdr.size = (sizeof (struct tag_header) +
+ strlen(nslu2_rtc_probe) + strlen(p) + 1 + 4) >> 2;
+ strlcpy(t->u.cmdline.cmdline, nslu2_rtc_probe, COMMAND_LINE_SIZE);
+ strlcpy(t->u.cmdline.cmdline + strlen(nslu2_rtc_probe), p,
+ COMMAND_LINE_SIZE - strlen(nslu2_rtc_probe));
+
+ /* Terminate the table. */
+ t = tag_next(t);
+ t->hdr.tag = ATAG_NONE;
+ t->hdr.size = 0;
+}
+
static void __init nslu2_init(void)
{
ixp4xx_sys_init();
@@ -196,6 +226,7 @@ MACHINE_START(NSLU2, "Linksys NSLU2")
.phys_io = IXP4XX_PERIPHERAL_BASE_PHYS,
.io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xFFFC,
.boot_params = 0x00000100,
+ .fixup = nslu2_fixup,
.map_io = ixp4xx_map_io,
.init_irq = ixp4xx_init_irq,
.timer = &nslu2_timer,

View File

@ -0,0 +1,55 @@
diff -uprN linux-2.6.23.orig/arch/arm/mach-ixp4xx/nas100d-setup.c linux-2.6.23/arch/arm/mach-ixp4xx/nas100d-setup.c
--- linux-2.6.23.orig/arch/arm/mach-ixp4xx/nas100d-setup.c 2007-10-09 15:31:38.000000000 -0500
+++ linux-2.6.23/arch/arm/mach-ixp4xx/nas100d-setup.c 2007-10-11 01:06:33.000000000 -0500
@@ -17,6 +17,7 @@
#include <linux/serial_8250.h>
#include <linux/leds.h>
+#include <asm/setup.h>
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
#include <asm/mach/flash.h>
@@ -142,6 +143,35 @@ static void nas100d_power_off(void)
gpio_line_set(NAS100D_PO_GPIO, IXP4XX_GPIO_HIGH);
}
+static char nas100d_rtc_probe[] __initdata = "rtc-pcf8563.probe=0,0x51 ";
+
+static void __init nas100d_fixup(struct machine_desc *desc,
+ struct tag *tags, char **cmdline, struct meminfo *mi)
+{
+ struct tag *t = tags;
+ char *p = *cmdline;
+
+ /* Find the end of the tags table, taking note of any cmdline tag. */
+ for (; t->hdr.size; t = tag_next(t)) {
+ if (t->hdr.tag == ATAG_CMDLINE) {
+ p = t->u.cmdline.cmdline;
+ }
+ }
+
+ /* Overwrite the end of the table with a new cmdline tag. */
+ t->hdr.tag = ATAG_CMDLINE;
+ t->hdr.size = (sizeof (struct tag_header) +
+ strlen(nas100d_rtc_probe) + strlen(p) + 1 + 4) >> 2;
+ strlcpy(t->u.cmdline.cmdline, nas100d_rtc_probe, COMMAND_LINE_SIZE);
+ strlcpy(t->u.cmdline.cmdline + strlen(nas100d_rtc_probe), p,
+ COMMAND_LINE_SIZE - strlen(nas100d_rtc_probe));
+
+ /* Terminate the table. */
+ t = tag_next(t);
+ t->hdr.tag = ATAG_NONE;
+ t->hdr.size = 0;
+}
+
static void __init nas100d_init(void)
{
ixp4xx_sys_init();
@@ -170,6 +200,7 @@ MACHINE_START(NAS100D, "Iomega NAS 100d"
.phys_io = IXP4XX_PERIPHERAL_BASE_PHYS,
.io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xFFFC,
.boot_params = 0x00000100,
+ .fixup = nas100d_fixup,
.map_io = ixp4xx_map_io,
.init_irq = ixp4xx_init_irq,
.timer = &ixp4xx_timer,

View File

@ -0,0 +1,55 @@
diff -uprN linux-2.6.23.orig/arch/arm/mach-ixp4xx/avila-setup.c linux-2.6.23/arch/arm/mach-ixp4xx/avila-setup.c
--- linux-2.6.23.orig/arch/arm/mach-ixp4xx/avila-setup.c 2007-10-09 15:31:38.000000000 -0500
+++ linux-2.6.23/arch/arm/mach-ixp4xx/avila-setup.c 2007-10-11 01:08:21.000000000 -0500
@@ -138,6 +138,35 @@ static struct platform_device *avila_dev
&avila_uart
};
+static char avila_rtc_probe[] __initdata = "rtc-ds1672.probe=0,0x68 ";
+
+static void __init avila_fixup(struct machine_desc *desc,
+ struct tag *tags, char **cmdline, struct meminfo *mi)
+{
+ struct tag *t = tags;
+ char *p = *cmdline;
+
+ /* Find the end of the tags table, taking note of any cmdline tag. */
+ for (; t->hdr.size; t = tag_next(t)) {
+ if (t->hdr.tag == ATAG_CMDLINE) {
+ p = t->u.cmdline.cmdline;
+ }
+ }
+
+ /* Overwrite the end of the table with a new cmdline tag. */
+ t->hdr.tag = ATAG_CMDLINE;
+ t->hdr.size = (sizeof (struct tag_header) +
+ strlen(avila_rtc_probe) + strlen(p) + 1 + 4) >> 2;
+ strlcpy(t->u.cmdline.cmdline, avila_rtc_probe, COMMAND_LINE_SIZE);
+ strlcpy(t->u.cmdline.cmdline + strlen(avila_rtc_probe), p,
+ COMMAND_LINE_SIZE - strlen(avila_rtc_probe));
+
+ /* Terminate the table. */
+ t = tag_next(t);
+ t->hdr.tag = ATAG_NONE;
+ t->hdr.size = 0;
+}
+
static void __init avila_init(void)
{
ixp4xx_sys_init();
@@ -165,6 +194,7 @@ MACHINE_START(AVILA, "Gateworks Avila Ne
/* Maintainer: Deepak Saxena <dsaxena@plexity.net> */
.phys_io = IXP4XX_PERIPHERAL_BASE_PHYS,
.io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc,
+ .fixup = avila_fixup,
.map_io = ixp4xx_map_io,
.init_irq = ixp4xx_init_irq,
.timer = &ixp4xx_timer,
@@ -182,6 +212,7 @@ MACHINE_START(LOFT, "Giant Shoulder Inc
/* Maintainer: Tom Billman <kernel@giantshoulderinc.com> */
.phys_io = IXP4XX_PERIPHERAL_BASE_PHYS,
.io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc,
+ .fixup = avila_fixup,
.map_io = ixp4xx_map_io,
.init_irq = ixp4xx_init_irq,
.timer = &ixp4xx_timer,

View File

@ -0,0 +1,56 @@
Index: linux-2.6.22-rc4-armeb/arch/arm/mach-ixp4xx/dsmg600-setup.c
===================================================================
--- linux-2.6.22-rc4-armeb.orig/arch/arm/mach-ixp4xx/dsmg600-setup.c
+++ linux-2.6.22-rc4-armeb/arch/arm/mach-ixp4xx/dsmg600-setup.c
@@ -16,6 +16,7 @@
#include <linux/serial_8250.h>
#include <linux/i2c-gpio.h>
+#include <asm/setup.h>
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
#include <asm/mach/flash.h>
@@ -145,6 +146,35 @@ static struct sys_timer dsmg600_timer =
.init = dsmg600_timer_init,
};
+static char dsmg600_rtc_probe[] __initdata = "rtc-pcf8563.probe=0,0x51 ";
+
+static void __init dsmg600_fixup(struct machine_desc *desc,
+ struct tag *tags, char **cmdline, struct meminfo *mi)
+{
+ struct tag *t = tags;
+ char *p = *cmdline;
+
+ /* Find the end of the tags table, taking note of any cmdline tag. */
+ for (; t->hdr.size; t = tag_next(t)) {
+ if (t->hdr.tag == ATAG_CMDLINE) {
+ p = t->u.cmdline.cmdline;
+ }
+ }
+
+ /* Overwrite the end of the table with a new cmdline tag. */
+ t->hdr.tag = ATAG_CMDLINE;
+ t->hdr.size = (sizeof (struct tag_header) +
+ strlen(dsmg600_rtc_probe) + strlen(p) + 1 + 4) >> 2;
+ strlcpy(t->u.cmdline.cmdline, dsmg600_rtc_probe, COMMAND_LINE_SIZE);
+ strlcpy(t->u.cmdline.cmdline + strlen(dsmg600_rtc_probe), p,
+ COMMAND_LINE_SIZE - strlen(dsmg600_rtc_probe));
+
+ /* Terminate the table. */
+ t = tag_next(t);
+ t->hdr.tag = ATAG_NONE;
+ t->hdr.size = 0;
+}
+
static void __init dsmg600_init(void)
{
ixp4xx_sys_init();
@@ -177,6 +207,7 @@ MACHINE_START(DSMG600, "D-Link DSM-G600
.phys_io = IXP4XX_PERIPHERAL_BASE_PHYS,
.io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xFFFC,
.boot_params = 0x00000100,
+ .fixup = dsmg600_fixup,
.map_io = ixp4xx_map_io,
.init_irq = ixp4xx_init_irq,
.timer = &dsmg600_timer,

View File

@ -0,0 +1,178 @@
diff -uprN linux-2.6.23.orig/kernel/ksysfs.c linux-2.6.23/kernel/ksysfs.c
--- linux-2.6.23.orig/kernel/ksysfs.c 2007-10-09 15:31:38.000000000 -0500
+++ linux-2.6.23/kernel/ksysfs.c 2007-10-11 01:10:26.000000000 -0500
@@ -49,6 +49,165 @@ KERNEL_ATTR_RW(uevent_helper);
#endif
#ifdef CONFIG_KEXEC
+
+#include <asm/setup.h>
+
+extern unsigned long kexec_boot_params;
+
+char kexec_cmdline[COMMAND_LINE_SIZE] = "";
+
+static void
+replace_cmdline_tag(void)
+{
+ char *t;
+ struct tag *real;
+ struct tag *copy;
+ struct tag *rend;
+ int i;
+
+/* TODO: check the return params */
+ t = kmalloc(KEXEC_BOOT_PARAMS_SIZE + COMMAND_LINE_SIZE, GFP_KERNEL);
+ memset((void *)t, 0, KEXEC_BOOT_PARAMS_SIZE + COMMAND_LINE_SIZE);
+
+/* TODO: validate that the boot params are ATAGS, in fact */
+
+ copy = (struct tag *)t;
+ real = (struct tag *)kexec_boot_params;
+ rend = (struct tag *)(kexec_boot_params + KEXEC_BOOT_PARAMS_SIZE);
+ while ((real->hdr.size) && (real < rend)) {
+ if (real->hdr.tag != ATAG_CMDLINE) {
+ memcpy((void *)copy, (void *)real, real->hdr.size * 4);
+ copy = tag_next(copy);
+ }
+ real = tag_next(real);
+ }
+
+/* TODO: validate that we have enough space in the buffer */
+
+ i = strlen(kexec_cmdline);
+ if (i) {
+ copy->hdr.tag = ATAG_CMDLINE;
+ copy->hdr.size = (sizeof(struct tag_header) + i + 1 + 4) >> 2;
+ strcpy(copy->u.cmdline.cmdline, kexec_cmdline);
+ copy = tag_next(copy);
+ }
+
+ copy->hdr.tag = ATAG_NONE; /* Empty tag ends list */
+ copy->hdr.size = 0; /* zero length */
+
+/* TODO: validate that the temporary buffer isn't too full */
+
+ memcpy((void *)kexec_boot_params, (void *)t, KEXEC_BOOT_PARAMS_SIZE);
+
+ kfree(t); /* Don't forget to free the big buffer we used */
+}
+
+static ssize_t kexec_cmdline_show(struct kset *kset, char *page)
+{
+ return sprintf(page, "%s\n", kexec_cmdline);
+}
+
+static ssize_t kexec_cmdline_store(struct kset *kset, const char *page,
+ size_t count)
+{
+ if ((count + 1) > COMMAND_LINE_SIZE)
+ count = COMMAND_LINE_SIZE;
+ memcpy(kexec_cmdline, page, count);
+ kexec_cmdline[count] = '\0';
+ if (count && (kexec_cmdline[count - 1] == '\n'))
+ kexec_cmdline[count - 1] = '\0';
+ replace_cmdline_tag();
+ return count;
+}
+KERNEL_ATTR_RW(kexec_cmdline);
+
+static ssize_t kexec_boot_params_show(struct kset *kset, char *page)
+{
+ unsigned long *p;
+ char buf[PAGE_SIZE];
+ int keep_doing;
+
+ p = (unsigned long *)kexec_boot_params;
+
+ /* if this doesn't look like atags, just print first few words */
+ if (p[1] != ATAG_CORE)
+ return sprintf(page, "0x%lx 0x%lx 0x%lx 0x%lx\n",
+ p[0], p[1], p[2], p[3]);
+
+ /* carefully walk the atag list, and print out the structure */
+ keep_doing = 1;
+ do {
+ switch (p[1]) {
+ case ATAG_CORE:
+ /* watch out, core tag is permitted to be empty */
+ if (p[0] == 5)
+ sprintf(buf,
+ "CORE flg=%ld pgsz=%ld rdev=0x%lx\n",
+ p[2], p[3], p[4]);
+ else
+ sprintf(buf,"CORE\n");
+ break;
+ case ATAG_MEM:
+ sprintf(buf,"MEM %ldM@0x%lx\n", p[2] / (1024 * 1024),
+ p[3]);
+ break;
+ case ATAG_VIDEOTEXT:
+ sprintf(buf,"VIDEOTEXT sz=%ld\n", p[0]);
+ break;
+ case ATAG_RAMDISK:
+ sprintf(buf,"RAMDISK prmpt=%ld %ldK@0x%lx\n",
+ p[2], p[3], p[4]);
+ break;
+ case ATAG_INITRD2:
+ sprintf(buf,"INITRD2 %ldK@0x%lx\n", p[3] / 1024, p[2]);
+ break;
+ case ATAG_SERIAL:
+ sprintf(buf,"SERIAL high=0x%08lx low=0x%08lx\n",
+ p[3], p[2]);
+ break;
+ case ATAG_REVISION:
+ sprintf(buf,"REVISION rev=%ld\n", p[2]);
+ break;
+ case ATAG_VIDEOLFB:
+ sprintf(buf,"VIDEOLFB sz=%ld\n", p[0]);
+ break;
+ case ATAG_CMDLINE:
+ sprintf(buf,"CMD \"%s\"\n", (char *)&p[2]);
+ break;
+ case ATAG_NONE:
+ sprintf(buf,"NONE\n");
+ keep_doing = 0;
+ break;
+ default:
+ sprintf(buf,"-unknown- sz=%ld\n", p[0]);
+ break;
+ }
+
+ /* carefully add to page */
+ if ((strlen(buf) + strlen(page)) < PAGE_SIZE) {
+ strcat(page, buf);
+ } else {
+ keep_doing = 0;
+ }
+
+ /* stop when we encounter a header length of 0 */
+ if (p[0] == 0)
+ keep_doing = 0;
+
+ /* go to the next tag */
+ p += p[0];
+
+ /* stop if we walked off the end of the buffer */
+ if (p > (unsigned long *)(kexec_boot_params +
+ KEXEC_BOOT_PARAMS_SIZE))
+ keep_doing = 0;
+
+ } while (keep_doing);
+
+ return (strlen(page));
+}
+KERNEL_ATTR_RO(kexec_boot_params);
+
static ssize_t kexec_loaded_show(struct kset *kset, char *page)
{
return sprintf(page, "%d\n", !!kexec_image);
@@ -95,6 +254,8 @@ static struct attribute * kernel_attrs[]
#ifdef CONFIG_KEXEC
&kexec_loaded_attr.attr,
&kexec_crash_loaded_attr.attr,
+ &kexec_cmdline_attr.attr,
+ &kexec_boot_params_attr.attr,
#endif
NULL
};

View File

@ -0,0 +1,41 @@
diff -Nur linux-2.6.23/arch/arm/mach-ixp4xx/gateway7001-setup.c linux-2.6.23-owrt/arch/arm/mach-ixp4xx/gateway7001-setup.c
--- linux-2.6.23/arch/arm/mach-ixp4xx/gateway7001-setup.c 2007-10-09 22:31:38.000000000 +0200
+++ linux-2.6.23-owrt/arch/arm/mach-ixp4xx/gateway7001-setup.c 2007-10-22 15:09:33.000000000 +0200
@@ -76,9 +76,36 @@
.resource = &gateway7001_uart_resource,
};
+/* Built-in 10/100 Ethernet MAC interfaces */
+static struct eth_plat_info gateway7001_plat_eth[] = {
+ {
+ .phy = 1,
+ .rxq = 3,
+ .txreadyq = 20,
+ }, {
+ .phy = 2,
+ .rxq = 4,
+ .txreadyq = 21,
+ }
+};
+
+static struct platform_device gateway7001_eth[] = {
+ {
+ .name = "ixp4xx_eth",
+ .id = IXP4XX_ETH_NPEB,
+ .dev.platform_data = gateway7001_plat_eth,
+ }, {
+ .name = "ixp4xx_eth",
+ .id = IXP4XX_ETH_NPEC,
+ .dev.platform_data = gateway7001_plat_eth + 1,
+ }
+};
+
static struct platform_device *gateway7001_devices[] __initdata = {
&gateway7001_flash,
- &gateway7001_uart
+ &gateway7001_uart,
+ &gateway7001_eth[0],
+ &gateway7001_eth[1],
};
static void __init gateway7001_init(void)

View File

@ -0,0 +1,31 @@
diff -Nur linux-2.6.23/arch/arm/mach-ixp4xx/wg302v2-setup.c linux-2.6.23-owrt/arch/arm/mach-ixp4xx/wg302v2-setup.c
--- linux-2.6.23/arch/arm/mach-ixp4xx/wg302v2-setup.c 2007-10-09 22:31:38.000000000 +0200
+++ linux-2.6.23-owrt/arch/arm/mach-ixp4xx/wg302v2-setup.c 2007-10-22 15:02:20.000000000 +0200
@@ -77,9 +77,27 @@
.resource = &wg302v2_uart_resource,
};
+/* Built-in 10/100 Ethernet MAC interfaces */
+static struct eth_plat_info wg302_plat_eth[] = {
+ {
+ .phy = 8,
+ .rxq = 3,
+ .txreadyq = 20,
+ }
+};
+
+static struct platform_device wg302_eth[] = {
+ {
+ .name = "ixp4xx_eth",
+ .id = IXP4XX_ETH_NPEB,
+ .dev.platform_data = wg302_plat_eth,
+ }
+};
+
static struct platform_device *wg302v2_devices[] __initdata = {
&wg302v2_flash,
&wg302v2_uart,
+ &wg302_eth[0],
};
static void __init wg302v2_init(void)

View File

@ -0,0 +1,292 @@
diff -Nur linux-2.6.23/arch/arm/mach-ixp4xx/Kconfig linux-2.6.23-owrt/arch/arm/mach-ixp4xx/Kconfig
--- linux-2.6.23/arch/arm/mach-ixp4xx/Kconfig 2007-10-22 14:47:50.000000000 +0200
+++ linux-2.6.23-owrt/arch/arm/mach-ixp4xx/Kconfig 2007-10-22 15:16:43.000000000 +0200
@@ -57,6 +57,14 @@
WG302 v2 or WAG302 v2 Access Points. For more information
on this platform, see http://openwrt.org
+config MACH_PRONGHORNMETRO
+ bool "Pronghorn Metro"
+ select PCI
+ help
+ Say 'Y' here if you want your kernel to support the ADI
+ Engineering Pronghorn Metro Platform. For more
+ information on this platform, see <file:Documentation/arm/IXP4xx>.
+
config ARCH_IXDP425
bool "IXDP425"
help
diff -Nur linux-2.6.23/arch/arm/mach-ixp4xx/Makefile linux-2.6.23-owrt/arch/arm/mach-ixp4xx/Makefile
--- linux-2.6.23/arch/arm/mach-ixp4xx/Makefile 2007-10-22 14:47:50.000000000 +0200
+++ linux-2.6.23-owrt/arch/arm/mach-ixp4xx/Makefile 2007-10-22 15:26:15.000000000 +0200
@@ -16,6 +16,7 @@
obj-pci-$(CONFIG_MACH_GATEWAY7001) += gateway7001-pci.o
obj-pci-$(CONFIG_MACH_WG302V2) += wg302v2-pci.o
obj-pci-$(CONFIG_MACH_FSG) += fsg-pci.o
+obj-pci-$(CONFIG_MACH_PRONGHORNMETRO) += pronghornmetro-pci.o
obj-y += common.o
@@ -30,6 +31,7 @@
obj-$(CONFIG_MACH_GATEWAY7001) += gateway7001-setup.o
obj-$(CONFIG_MACH_WG302V2) += wg302v2-setup.o
obj-$(CONFIG_MACH_FSG) += fsg-setup.o
+obj-$(CONFIG_MACH_PRONGHORNMETRO) += pronghornmetro-setup.o
obj-$(CONFIG_PCI) += $(obj-pci-$(CONFIG_PCI)) common-pci.o
obj-$(CONFIG_IXP4XX_QMGR) += ixp4xx_qmgr.o
diff -Nur linux-2.6.23/arch/arm/mach-ixp4xx/pronghornmetro-pci.c linux-2.6.23-owrt/arch/arm/mach-ixp4xx/pronghornmetro-pci.c
--- linux-2.6.23/arch/arm/mach-ixp4xx/pronghornmetro-pci.c 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.23-owrt/arch/arm/mach-ixp4xx/pronghornmetro-pci.c 2007-10-22 15:16:43.000000000 +0200
@@ -0,0 +1,74 @@
+/*
+ * arch/arch/mach-ixp4xx/pronghornmetro-pci.c
+ *
+ * PCI setup routines for ADI Engineering Pronghorn Metro
+ *
+ * Copyright (C) 2007 Imre Kaloz <kaloz@openwrt.org>
+ *
+ * based on coyote-pci.c:
+ * Copyright (C) 2002 Jungo Software Technologies.
+ * Copyright (C) 2003 MontaVista Softwrae, Inc.
+ *
+ * Maintainer: Imre Kaloz <kaloz@openwrt.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ */
+
+#include <linux/kernel.h>
+#include <linux/pci.h>
+#include <linux/init.h>
+#include <linux/irq.h>
+
+#include <asm/mach-types.h>
+#include <asm/hardware.h>
+#include <asm/irq.h>
+
+#include <asm/mach/pci.h>
+
+extern void ixp4xx_pci_preinit(void);
+extern int ixp4xx_setup(int nr, struct pci_sys_data *sys);
+extern struct pci_bus *ixp4xx_scan_bus(int nr, struct pci_sys_data *sys);
+
+void __init pronghornmetro_pci_preinit(void)
+{
+ set_irq_type(IRQ_IXP4XX_GPIO4, IRQT_LOW);
+ set_irq_type(IRQ_IXP4XX_GPIO6, IRQT_LOW);
+ set_irq_type(IRQ_IXP4XX_GPIO11, IRQT_LOW);
+ set_irq_type(IRQ_IXP4XX_GPIO1, IRQT_LOW);
+
+ ixp4xx_pci_preinit();
+}
+
+static int __init pronghornmetro_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
+{
+ if (slot == 13)
+ return IRQ_IXP4XX_GPIO4;
+ else if (slot == 14)
+ return IRQ_IXP4XX_GPIO6;
+ else if (slot == 15)
+ return IRQ_IXP4XX_GPIO11;
+ else if (slot == 16)
+ return IRQ_IXP4XX_GPIO1;
+ else return -1;
+}
+
+struct hw_pci pronghornmetro_pci __initdata = {
+ .nr_controllers = 1,
+ .preinit = pronghornmetro_pci_preinit,
+ .swizzle = pci_std_swizzle,
+ .setup = ixp4xx_setup,
+ .scan = ixp4xx_scan_bus,
+ .map_irq = pronghornmetro_map_irq,
+};
+
+int __init pronghornmetro_pci_init(void)
+{
+ if (machine_is_pronghorn_metro())
+ pci_common_init(&pronghornmetro_pci);
+ return 0;
+}
+
+subsys_initcall(pronghornmetro_pci_init);
diff -Nur linux-2.6.23/arch/arm/mach-ixp4xx/pronghornmetro-setup.c linux-2.6.23-owrt/arch/arm/mach-ixp4xx/pronghornmetro-setup.c
--- linux-2.6.23/arch/arm/mach-ixp4xx/pronghornmetro-setup.c 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.23-owrt/arch/arm/mach-ixp4xx/pronghornmetro-setup.c 2007-10-22 15:36:35.000000000 +0200
@@ -0,0 +1,147 @@
+/*
+ * arch/arm/mach-ixp4xx/pronghornmetro-setup.c
+ *
+ * Board setup for the ADI Engineering Pronghorn Metro
+ *
+ * Copyright (C) 2007 Imre Kaloz <Kaloz@openwrt.org>
+ *
+ * based on coyote-setup.c:
+ * Copyright (C) 2003-2005 MontaVista Software, Inc.
+ *
+ * Author: Imre Kaloz <Kaloz@openwrt.org>
+ */
+
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/device.h>
+#include <linux/serial.h>
+#include <linux/tty.h>
+#include <linux/serial_8250.h>
+#include <linux/slab.h>
+
+#include <asm/types.h>
+#include <asm/setup.h>
+#include <asm/memory.h>
+#include <asm/hardware.h>
+#include <asm/irq.h>
+#include <asm/mach-types.h>
+#include <asm/mach/arch.h>
+#include <asm/mach/flash.h>
+
+static struct flash_platform_data pronghornmetro_flash_data = {
+ .map_name = "cfi_probe",
+ .width = 2,
+};
+
+static struct resource pronghornmetro_flash_resource = {
+ .flags = IORESOURCE_MEM,
+};
+
+static struct platform_device pronghornmetro_flash = {
+ .name = "IXP4XX-Flash",
+ .id = 0,
+ .dev = {
+ .platform_data = &pronghornmetro_flash_data,
+ },
+ .num_resources = 1,
+ .resource = &pronghornmetro_flash_resource,
+};
+
+static struct resource pronghornmetro_uart_resource = {
+ .start = IXP4XX_UART2_BASE_PHYS,
+ .end = IXP4XX_UART2_BASE_PHYS + 0x0fff,
+ .flags = IORESOURCE_MEM,
+};
+
+static struct plat_serial8250_port pronghornmetro_uart_data[] = {
+ {
+ .mapbase = IXP4XX_UART2_BASE_PHYS,
+ .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET,
+ .irq = IRQ_IXP4XX_UART2,
+ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
+ .iotype = UPIO_MEM,
+ .regshift = 2,
+ .uartclk = IXP4XX_UART_XTAL,
+ },
+ { },
+};
+
+static struct platform_device pronghornmetro_uart = {
+ .name = "serial8250",
+ .id = PLAT8250_DEV_PLATFORM,
+ .dev = {
+ .platform_data = pronghornmetro_uart_data,
+ },
+ .num_resources = 1,
+ .resource = &pronghornmetro_uart_resource,
+};
+
+static struct resource pronghornmetro_pata_resources[] = {
+ {
+ .flags = IORESOURCE_MEM
+ },
+ {
+ .flags = IORESOURCE_MEM,
+ },
+ {
+ .name = "intrq",
+ .start = IRQ_IXP4XX_GPIO0,
+ .end = IRQ_IXP4XX_GPIO0,
+ .flags = IORESOURCE_IRQ,
+ },
+};
+
+static struct ixp4xx_pata_data pronghornmetro_pata_data = {
+ .cs0_bits = 0xbfff0043,
+ .cs1_bits = 0xbfff0043,
+};
+
+static struct platform_device pronghornmetro_pata = {
+ .name = "pata_ixp4xx_cf",
+ .id = 0,
+ .dev.platform_data = &pronghornmetro_pata_data,
+ .num_resources = ARRAY_SIZE(pronghornmetro_pata_resources),
+ .resource = pronghornmetro_pata_resources,
+};
+
+static struct platform_device *pronghornmetro_devices[] __initdata = {
+ &pronghornmetro_flash,
+ &pronghornmetro_uart,
+};
+
+static void __init pronghornmetro_init(void)
+{
+ ixp4xx_sys_init();
+
+ pronghornmetro_flash_resource.start = IXP4XX_EXP_BUS_BASE(0);
+ pronghornmetro_flash_resource.end = IXP4XX_EXP_BUS_BASE(0) + SZ_16M - 1;
+
+ *IXP4XX_EXP_CS0 |= IXP4XX_FLASH_WRITABLE;
+ *IXP4XX_EXP_CS1 = *IXP4XX_EXP_CS0;
+
+ platform_add_devices(pronghornmetro_devices, ARRAY_SIZE(pronghornmetro_devices));
+
+ pronghornmetro_pata_resources[0].start = IXP4XX_EXP_BUS_BASE(1);
+ pronghornmetro_pata_resources[0].end = IXP4XX_EXP_BUS_END(1);
+
+ pronghornmetro_pata_resources[1].start = IXP4XX_EXP_BUS_BASE(2);
+ pronghornmetro_pata_resources[1].end = IXP4XX_EXP_BUS_END(2);
+
+ pronghornmetro_pata_data.cs0_cfg = IXP4XX_EXP_CS1;
+ pronghornmetro_pata_data.cs1_cfg = IXP4XX_EXP_CS2;
+
+ platform_device_register(&pronghornmetro_pata);
+}
+
+#ifdef CONFIG_MACH_PRONGHORNMETRO
+MACHINE_START(PRONGHORNMETRO, "ADI Engineering Pronghorn Metro")
+ /* 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 = pronghornmetro_init,
+MACHINE_END
+#endif
diff -Nur linux-2.6.23/Documentation/arm/IXP4xx linux-2.6.23-owrt/Documentation/arm/IXP4xx
--- linux-2.6.23/Documentation/arm/IXP4xx 2007-10-09 22:31:38.000000000 +0200
+++ linux-2.6.23-owrt/Documentation/arm/IXP4xx 2007-10-22 15:16:43.000000000 +0200
@@ -111,6 +111,9 @@
the platform has two mini-PCI slots used for 802.11[bga] cards.
Finally, there is an IDE port hanging off the expansion bus.
+ADI Engineering Pronghorn Metro Platform
+http://www.adiengineering.com/php-bin/ecomm4/productDisplay.php?category_id=30&product_id=85
+
Gateworks Avila Network Platform
http://www.gateworks.com/avila_sbc.htm
diff -Nur linux-2.6.23/include/asm-arm/arch-ixp4xx/uncompress.h linux-2.6.23-owrt/include/asm-arm/arch-ixp4xx/uncompress.h
--- linux-2.6.23/include/asm-arm/arch-ixp4xx/uncompress.h 2007-10-22 14:47:50.000000000 +0200
+++ linux-2.6.23-owrt/include/asm-arm/arch-ixp4xx/uncompress.h 2007-10-22 15:18:47.000000000 +0200
@@ -41,7 +41,8 @@
* Some boards are using UART2 as console
*/
if (machine_is_adi_coyote() || machine_is_gtwx5715() ||
- machine_is_gateway7001() || machine_is_wg302v2())
+ machine_is_gateway7001() || machine_is_wg302v2() ||
+ machine_is_pronghorn_metro())
uart_base = (volatile u32*) IXP4XX_UART2_BASE_PHYS;
else
uart_base = (volatile u32*) IXP4XX_UART1_BASE_PHYS;

View File

@ -0,0 +1,40 @@
diff -Nur linux-2.6.23/arch/arm/mach-ixp4xx/pronghornmetro-setup.c linux-2.6.23-owrt/arch/arm/mach-ixp4xx/pronghornmetro-setup.c
--- linux-2.6.23/arch/arm/mach-ixp4xx/pronghornmetro-setup.c 2007-10-22 15:41:27.000000000 +0200
+++ linux-2.6.23-owrt/arch/arm/mach-ixp4xx/pronghornmetro-setup.c 2007-10-22 15:43:30.000000000 +0200
@@ -104,9 +104,36 @@
.resource = pronghornmetro_pata_resources,
};
+/* Built-in 10/100 Ethernet MAC interfaces */
+static struct eth_plat_info pronghornmetro_plat_eth[] = {
+ {
+ .phy = 0,
+ .rxq = 3,
+ .txreadyq = 20,
+ }, {
+ .phy = 1,
+ .rxq = 4,
+ .txreadyq = 21,
+ }
+};
+
+static struct platform_device pronghornmetro_eth[] = {
+ {
+ .name = "ixp4xx_eth",
+ .id = IXP4XX_ETH_NPEB,
+ .dev.platform_data = pronghornmetro_plat_eth,
+ }, {
+ .name = "ixp4xx_eth",
+ .id = IXP4XX_ETH_NPEC,
+ .dev.platform_data = pronghornmetro_plat_eth + 1,
+ }
+};
+
static struct platform_device *pronghornmetro_devices[] __initdata = {
&pronghornmetro_flash,
&pronghornmetro_uart,
+ &pronghornmetro_eth[0],
+ &pronghornmetro_eth[1],
};
static void __init pronghornmetro_init(void)

View File

@ -0,0 +1,185 @@
diff -Nur linux-2.6.23/arch/arm/mach-ixp4xx/Kconfig linux-2.6.23-owrt/arch/arm/mach-ixp4xx/Kconfig
--- linux-2.6.23/arch/arm/mach-ixp4xx/Kconfig 2007-10-23 18:03:34.000000000 +0200
+++ linux-2.6.23-owrt/arch/arm/mach-ixp4xx/Kconfig 2007-10-23 18:22:41.000000000 +0200
@@ -65,6 +65,14 @@
Engineering Pronghorn Metro Platform. For more
information on this platform, see <file:Documentation/arm/IXP4xx>.
+config MACH_COMPEX
+ bool "Compex WP18 / NP18A"
+ select PCI
+ help
+ Say 'Y' here if you want your kernel to support Compex'
+ WP18 or NP18A boards. For more information on this
+ platform, see http://openwrt.org
+
config ARCH_IXDP425
bool "IXDP425"
help
diff -Nur linux-2.6.23/arch/arm/mach-ixp4xx/Makefile linux-2.6.23-owrt/arch/arm/mach-ixp4xx/Makefile
--- linux-2.6.23/arch/arm/mach-ixp4xx/Makefile 2007-10-23 18:03:34.000000000 +0200
+++ linux-2.6.23-owrt/arch/arm/mach-ixp4xx/Makefile 2007-10-23 18:22:41.000000000 +0200
@@ -17,6 +17,7 @@
obj-pci-$(CONFIG_MACH_WG302V2) += wg302v2-pci.o
obj-pci-$(CONFIG_MACH_FSG) += fsg-pci.o
obj-pci-$(CONFIG_MACH_PRONGHORNMETRO) += pronghornmetro-pci.o
+obj-pci-$(CONFIG_MACH_COMPEX) += ixdp425-pci.o
obj-y += common.o
@@ -32,6 +33,7 @@
obj-$(CONFIG_MACH_WG302V2) += wg302v2-setup.o
obj-$(CONFIG_MACH_FSG) += fsg-setup.o
obj-$(CONFIG_MACH_PRONGHORNMETRO) += pronghornmetro-setup.o
+obj-$(CONFIG_MACH_COMPEX) += compex-setup.o
obj-$(CONFIG_PCI) += $(obj-pci-$(CONFIG_PCI)) common-pci.o
obj-$(CONFIG_IXP4XX_QMGR) += ixp4xx_qmgr.o
diff -Nur linux-2.6.23/arch/arm/mach-ixp4xx/compex-setup.c linux-2.6.23-owrt/arch/arm/mach-ixp4xx/compex-setup.c
--- linux-2.6.23/arch/arm/mach-ixp4xx/compex-setup.c 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.23-owrt/arch/arm/mach-ixp4xx/compex-setup.c 2007-10-23 18:22:41.000000000 +0200
@@ -0,0 +1,120 @@
+/*
+ * arch/arm/mach-ixp4xx/compex-setup.c
+ *
+ * Ccompex WP18 / NP18A board-setup
+ *
+ * Copyright (C) 2007 Imre Kaloz <Kaloz@openwrt.org>
+ *
+ * based on ixdp425-setup.c:
+ * Copyright (C) 2003-2005 MontaVista Software, Inc.
+ *
+ * Author: Imre Kaloz <Kaloz@openwrt.org>
+ */
+
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/device.h>
+#include <linux/serial.h>
+#include <linux/tty.h>
+#include <linux/serial_8250.h>
+#include <linux/slab.h>
+
+#include <asm/types.h>
+#include <asm/setup.h>
+#include <asm/memory.h>
+#include <asm/hardware.h>
+#include <asm/mach-types.h>
+#include <asm/irq.h>
+#include <asm/mach/arch.h>
+#include <asm/mach/flash.h>
+
+static struct flash_platform_data compex_flash_data = {
+ .map_name = "cfi_probe",
+ .width = 2,
+};
+
+static struct resource compex_flash_resource = {
+ .flags = IORESOURCE_MEM,
+};
+
+static struct platform_device compex_flash = {
+ .name = "IXP4XX-Flash",
+ .id = 0,
+ .dev = {
+ .platform_data = &compex_flash_data,
+ },
+ .num_resources = 1,
+ .resource = &compex_flash_resource,
+};
+
+static struct resource compex_uart_resources[] = {
+ {
+ .start = IXP4XX_UART1_BASE_PHYS,
+ .end = IXP4XX_UART1_BASE_PHYS + 0x0fff,
+ .flags = IORESOURCE_MEM
+ },
+ {
+ .start = IXP4XX_UART2_BASE_PHYS,
+ .end = IXP4XX_UART2_BASE_PHYS + 0x0fff,
+ .flags = IORESOURCE_MEM
+ }
+};
+
+static struct plat_serial8250_port compex_uart_data[] = {
+ {
+ .mapbase = IXP4XX_UART1_BASE_PHYS,
+ .membase = (char *)IXP4XX_UART1_BASE_VIRT + REG_OFFSET,
+ .irq = IRQ_IXP4XX_UART1,
+ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
+ .iotype = UPIO_MEM,
+ .regshift = 2,
+ .uartclk = IXP4XX_UART_XTAL,
+ },
+ {
+ .mapbase = IXP4XX_UART2_BASE_PHYS,
+ .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET,
+ .irq = IRQ_IXP4XX_UART2,
+ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
+ .iotype = UPIO_MEM,
+ .regshift = 2,
+ .uartclk = IXP4XX_UART_XTAL,
+ },
+ { },
+};
+
+static struct platform_device compex_uart = {
+ .name = "serial8250",
+ .id = PLAT8250_DEV_PLATFORM,
+ .dev.platform_data = compex_uart_data,
+ .num_resources = 2,
+ .resource = compex_uart_resources,
+};
+
+static struct platform_device *compex_devices[] __initdata = {
+ &compex_flash,
+ &compex_uart
+};
+
+static void __init compex_init(void)
+{
+ ixp4xx_sys_init();
+
+ compex_flash_resource.start = IXP4XX_EXP_BUS_BASE(0);
+ compex_flash_resource.end =
+ IXP4XX_EXP_BUS_BASE(0) + SZ_32M - 1;
+
+ platform_add_devices(compex_devices, ARRAY_SIZE(compex_devices));
+}
+
+#ifdef CONFIG_MACH_COMPEX
+MACHINE_START(COMPEX, "Compex WP18 / NP18A")
+ /* 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 = compex_init,
+MACHINE_END
+#endif
diff -Nur linux-2.6.23/arch/arm/mach-ixp4xx/ixdp425-pci.c linux-2.6.23-owrt/arch/arm/mach-ixp4xx/ixdp425-pci.c
--- linux-2.6.23/arch/arm/mach-ixp4xx/ixdp425-pci.c 2007-10-09 22:31:38.000000000 +0200
+++ linux-2.6.23-owrt/arch/arm/mach-ixp4xx/ixdp425-pci.c 2007-10-23 18:22:41.000000000 +0200
@@ -66,7 +66,7 @@
int __init ixdp425_pci_init(void)
{
if (machine_is_ixdp425() || machine_is_ixcdp1100() ||
- machine_is_ixdp465() || machine_is_kixrp435())
+ machine_is_ixdp465() || machine_is_kixrp435() || machine_is_compex())
pci_common_init(&ixdp425_pci);
return 0;
}
diff -Nur linux-2.6.23/arch/arm/tools/mach-types linux-2.6.23-owrt/arch/arm/tools/mach-types
--- linux-2.6.23/arch/arm/tools/mach-types 2007-10-09 22:31:38.000000000 +0200
+++ linux-2.6.23-owrt/arch/arm/tools/mach-types 2007-10-23 18:22:41.000000000 +0200
@@ -1278,7 +1278,7 @@
smdk6400 MACH_SMDK6400 SMDK6400 1270
nokia_n800 MACH_NOKIA_N800 NOKIA_N800 1271
greenphone MACH_GREENPHONE GREENPHONE 1272
-compex42x MACH_COMPEXWP18 COMPEXWP18 1273
+compex MACH_COMPEX COMPEX 1273
xmate MACH_XMATE XMATE 1274
energizer MACH_ENERGIZER ENERGIZER 1275
ime1 MACH_IME1 IME1 1276

View File

@ -0,0 +1,41 @@
diff -Nur linux-2.6.23/arch/arm/mach-ixp4xx/compex-setup.c linux-2.6.23-owrt/arch/arm/mach-ixp4xx/compex-setup.c
--- linux-2.6.23/arch/arm/mach-ixp4xx/compex-setup.c 2007-10-23 18:39:29.000000000 +0200
+++ linux-2.6.23-owrt/arch/arm/mach-ixp4xx/compex-setup.c 2007-10-23 18:45:34.000000000 +0200
@@ -90,9 +90,36 @@
.resource = compex_uart_resources,
};
+/* Built-in 10/100 Ethernet MAC interfaces */
+static struct eth_plat_info compex_plat_eth[] = {
+ {
+ .phy = -1,
+ .rxq = 3,
+ .txreadyq = 20,
+ }, {
+ .phy = 3,
+ .rxq = 4,
+ .txreadyq = 21,
+ }
+};
+
+static struct platform_device compex_eth[] = {
+ {
+ .name = "ixp4xx_eth",
+ .id = IXP4XX_ETH_NPEB,
+ .dev.platform_data = compex_plat_eth,
+ }, {
+ .name = "ixp4xx_eth",
+ .id = IXP4XX_ETH_NPEC,
+ .dev.platform_data = compex_plat_eth + 1,
+ }
+};
+
static struct platform_device *compex_devices[] __initdata = {
&compex_flash,
- &compex_uart
+ &compex_uart,
+ &compex_eth[0],
+ &compex_eth[1],
};
static void __init compex_init(void)

View File

@ -0,0 +1,230 @@
diff -Nur linux-2.6.23/arch/arm/mach-ixp4xx/Kconfig linux-2.6.23-owrt/arch/arm/mach-ixp4xx/Kconfig
--- linux-2.6.23/arch/arm/mach-ixp4xx/Kconfig 2007-10-23 18:39:29.000000000 +0200
+++ linux-2.6.23-owrt/arch/arm/mach-ixp4xx/Kconfig 2007-10-23 19:11:31.000000000 +0200
@@ -73,6 +73,14 @@
WP18 or NP18A boards. For more information on this
platform, see http://openwrt.org
+config MACH_WRT300NV2
+ bool "Linksys WRT300N v2"
+ select PCI
+ help
+ Say 'Y' here if you want your kernel to support Linksys'
+ WRT300N v2 router. For more information on this
+ platform, see http://openwrt.org
+
config ARCH_IXDP425
bool "IXDP425"
help
diff -Nur linux-2.6.23/arch/arm/mach-ixp4xx/Makefile linux-2.6.23-owrt/arch/arm/mach-ixp4xx/Makefile
--- linux-2.6.23/arch/arm/mach-ixp4xx/Makefile 2007-10-23 18:39:29.000000000 +0200
+++ linux-2.6.23-owrt/arch/arm/mach-ixp4xx/Makefile 2007-10-23 19:11:31.000000000 +0200
@@ -18,6 +18,7 @@
obj-pci-$(CONFIG_MACH_FSG) += fsg-pci.o
obj-pci-$(CONFIG_MACH_PRONGHORNMETRO) += pronghornmetro-pci.o
obj-pci-$(CONFIG_MACH_COMPEX) += ixdp425-pci.o
+obj-pci-$(CONFIG_MACH_WRT300NV2) += wrt300nv2-pci.o
obj-y += common.o
@@ -34,6 +35,7 @@
obj-$(CONFIG_MACH_FSG) += fsg-setup.o
obj-$(CONFIG_MACH_PRONGHORNMETRO) += pronghornmetro-setup.o
obj-$(CONFIG_MACH_COMPEX) += compex-setup.o
+obj-$(CONFIG_MACH_WRT300NV2) += wrt300nv2-setup.o
obj-$(CONFIG_PCI) += $(obj-pci-$(CONFIG_PCI)) common-pci.o
obj-$(CONFIG_IXP4XX_QMGR) += ixp4xx_qmgr.o
diff -Nur linux-2.6.23/arch/arm/mach-ixp4xx/wrt300nv2-pci.c linux-2.6.23-owrt/arch/arm/mach-ixp4xx/wrt300nv2-pci.c
--- linux-2.6.23/arch/arm/mach-ixp4xx/wrt300nv2-pci.c 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.23-owrt/arch/arm/mach-ixp4xx/wrt300nv2-pci.c 2007-10-23 19:11:31.000000000 +0200
@@ -0,0 +1,65 @@
+/*
+ * arch/arch/mach-ixp4xx/wrt300nv2-pci.c
+ *
+ * PCI setup routines for Linksys WRT300N v2
+ *
+ * Copyright (C) 2007 Imre Kaloz <kaloz@openwrt.org>
+ *
+ * based on coyote-pci.c:
+ * Copyright (C) 2002 Jungo Software Technologies.
+ * Copyright (C) 2003 MontaVista Softwrae, Inc.
+ *
+ * Maintainer: Imre Kaloz <kaloz@openwrt.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ */
+
+#include <linux/kernel.h>
+#include <linux/pci.h>
+#include <linux/init.h>
+#include <linux/irq.h>
+
+#include <asm/mach-types.h>
+#include <asm/hardware.h>
+#include <asm/irq.h>
+
+#include <asm/mach/pci.h>
+
+extern void ixp4xx_pci_preinit(void);
+extern int ixp4xx_setup(int nr, struct pci_sys_data *sys);
+extern struct pci_bus *ixp4xx_scan_bus(int nr, struct pci_sys_data *sys);
+
+void __init wrt300nv2_pci_preinit(void)
+{
+ set_irq_type(IRQ_IXP4XX_GPIO8, IRQT_LOW);
+
+ ixp4xx_pci_preinit();
+}
+
+static int __init wrt300nv2_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
+{
+ if (slot == 1)
+ return IRQ_IXP4XX_GPIO8;
+ else return -1;
+}
+
+struct hw_pci wrt300nv2_pci __initdata = {
+ .nr_controllers = 1,
+ .preinit = wrt300nv2_pci_preinit,
+ .swizzle = pci_std_swizzle,
+ .setup = ixp4xx_setup,
+ .scan = ixp4xx_scan_bus,
+ .map_irq = wrt300nv2_map_irq,
+};
+
+int __init wrt300nv2_pci_init(void)
+{
+ if (machine_is_wrt300nv2())
+ pci_common_init(&wrt300nv2_pci);
+ return 0;
+}
+
+subsys_initcall(wrt300nv2_pci_init);
diff -Nur linux-2.6.23/arch/arm/mach-ixp4xx/wrt300nv2-setup.c linux-2.6.23-owrt/arch/arm/mach-ixp4xx/wrt300nv2-setup.c
--- linux-2.6.23/arch/arm/mach-ixp4xx/wrt300nv2-setup.c 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.23-owrt/arch/arm/mach-ixp4xx/wrt300nv2-setup.c 2007-10-23 19:11:31.000000000 +0200
@@ -0,0 +1,108 @@
+/*
+ * arch/arm/mach-ixp4xx/wrt300nv2-setup.c
+ *
+ * Board setup for the Linksys WRT300N v2
+ *
+ * Copyright (C) 2007 Imre Kaloz <Kaloz@openwrt.org>
+ *
+ * based on coyote-setup.c:
+ * Copyright (C) 2003-2005 MontaVista Software, Inc.
+ *
+ * Author: Imre Kaloz <Kaloz@openwrt.org>
+ */
+
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/device.h>
+#include <linux/serial.h>
+#include <linux/tty.h>
+#include <linux/serial_8250.h>
+#include <linux/slab.h>
+
+#include <asm/types.h>
+#include <asm/setup.h>
+#include <asm/memory.h>
+#include <asm/hardware.h>
+#include <asm/irq.h>
+#include <asm/mach-types.h>
+#include <asm/mach/arch.h>
+#include <asm/mach/flash.h>
+
+static struct flash_platform_data wrt300nv2_flash_data = {
+ .map_name = "cfi_probe",
+ .width = 2,
+};
+
+static struct resource wrt300nv2_flash_resource = {
+ .flags = IORESOURCE_MEM,
+};
+
+static struct platform_device wrt300nv2_flash = {
+ .name = "IXP4XX-Flash",
+ .id = 0,
+ .dev = {
+ .platform_data = &wrt300nv2_flash_data,
+ },
+ .num_resources = 1,
+ .resource = &wrt300nv2_flash_resource,
+};
+
+static struct resource wrt300nv2_uart_resource = {
+ .start = IXP4XX_UART2_BASE_PHYS,
+ .end = IXP4XX_UART2_BASE_PHYS + 0x0fff,
+ .flags = IORESOURCE_MEM,
+};
+
+static struct plat_serial8250_port wrt300nv2_uart_data[] = {
+ {
+ .mapbase = IXP4XX_UART2_BASE_PHYS,
+ .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET,
+ .irq = IRQ_IXP4XX_UART2,
+ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
+ .iotype = UPIO_MEM,
+ .regshift = 2,
+ .uartclk = IXP4XX_UART_XTAL,
+ },
+ { },
+};
+
+static struct platform_device wrt300nv2_uart = {
+ .name = "serial8250",
+ .id = PLAT8250_DEV_PLATFORM,
+ .dev = {
+ .platform_data = wrt300nv2_uart_data,
+ },
+ .num_resources = 1,
+ .resource = &wrt300nv2_uart_resource,
+};
+
+static struct platform_device *wrt300nv2_devices[] __initdata = {
+ &wrt300nv2_flash,
+ &wrt300nv2_uart
+};
+
+static void __init wrt300nv2_init(void)
+{
+ ixp4xx_sys_init();
+
+ wrt300nv2_flash_resource.start = IXP4XX_EXP_BUS_BASE(0);
+ wrt300nv2_flash_resource.end = IXP4XX_EXP_BUS_BASE(0) + SZ_32M - 1;
+
+ *IXP4XX_EXP_CS0 |= IXP4XX_FLASH_WRITABLE;
+ *IXP4XX_EXP_CS1 = *IXP4XX_EXP_CS0;
+
+ platform_add_devices(wrt300nv2_devices, ARRAY_SIZE(wrt300nv2_devices));
+}
+
+#ifdef CONFIG_MACH_WRT300NV2
+MACHINE_START(WRT300NV2, "Linksys WRT300N v2")
+ /* 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 = wrt300nv2_init,
+MACHINE_END
+#endif
diff -Nur linux-2.6.23/include/asm-arm/arch-ixp4xx/uncompress.h linux-2.6.23-owrt/include/asm-arm/arch-ixp4xx/uncompress.h
--- linux-2.6.23/include/asm-arm/arch-ixp4xx/uncompress.h 2007-10-23 18:03:35.000000000 +0200
+++ linux-2.6.23-owrt/include/asm-arm/arch-ixp4xx/uncompress.h 2007-10-23 19:12:30.000000000 +0200
@@ -42,7 +42,7 @@
*/
if (machine_is_adi_coyote() || machine_is_gtwx5715() ||
machine_is_gateway7001() || machine_is_wg302v2() ||
- machine_is_pronghorn_metro())
+ machine_is_pronghorn_metro() || machine_is_wrt300nv2())
uart_base = (volatile u32*) IXP4XX_UART2_BASE_PHYS;
else
uart_base = (volatile u32*) IXP4XX_UART1_BASE_PHYS;

View File

@ -0,0 +1,41 @@
diff -Nur linux-2.6.23/arch/arm/mach-ixp4xx/wrt300nv2-setup.c linux-2.6.23-owrt/arch/arm/mach-ixp4xx/wrt300nv2-setup.c
--- linux-2.6.23/arch/arm/mach-ixp4xx/wrt300nv2-setup.c 2007-10-23 19:20:08.000000000 +0200
+++ linux-2.6.23-owrt/arch/arm/mach-ixp4xx/wrt300nv2-setup.c 2007-10-23 19:22:19.000000000 +0200
@@ -76,9 +76,36 @@
.resource = &wrt300nv2_uart_resource,
};
+/* Built-in 10/100 Ethernet MAC interfaces */
+static struct eth_plat_info wrt300nv2_plat_eth[] = {
+ {
+ .phy = -1,
+ .rxq = 3,
+ .txreadyq = 20,
+ }, {
+ .phy = 1,
+ .rxq = 4,
+ .txreadyq = 21,
+ }
+};
+
+static struct platform_device wrt300nv2_eth[] = {
+ {
+ .name = "ixp4xx_eth",
+ .id = IXP4XX_ETH_NPEB,
+ .dev.platform_data = wrt300nv2_plat_eth,
+ }, {
+ .name = "ixp4xx_eth",
+ .id = IXP4XX_ETH_NPEC,
+ .dev.platform_data = wrt300nv2_plat_eth + 1,
+ }
+};
+
static struct platform_device *wrt300nv2_devices[] __initdata = {
&wrt300nv2_flash,
- &wrt300nv2_uart
+ &wrt300nv2_uart,
+ &wrt300nv2_eth[0],
+ &wrt300nv2_eth[1],
};
static void __init wrt300nv2_init(void)

View File

@ -0,0 +1,240 @@
diff -Nur linux-2.6.23/arch/arm/mach-ixp4xx/Kconfig linux-2.6.23-owrt/arch/arm/mach-ixp4xx/Kconfig
--- linux-2.6.23/arch/arm/mach-ixp4xx/Kconfig 2007-10-23 19:20:08.000000000 +0200
+++ linux-2.6.23-owrt/arch/arm/mach-ixp4xx/Kconfig 2007-10-23 19:26:46.000000000 +0200
@@ -65,6 +65,14 @@
Engineering Pronghorn Metro Platform. For more
information on this platform, see <file:Documentation/arm/IXP4xx>.
+config MACH_SIDEWINDER
+ bool "Sidewinder"
+ select PCI
+ help
+ Say 'Y' here if you want your kernel to support the ADI
+ Engineering Sidewinder Platform. For more
+ information on this platform, see <file:Documentation/arm/IXP4xx>.
+
config MACH_COMPEX
bool "Compex WP18 / NP18A"
select PCI
@@ -163,7 +171,7 @@
#
config CPU_IXP46X
bool
- depends on MACH_IXDP465
+ depends on MACH_IXDP465 || MACH_SIDEWINDER
default y
config CPU_IXP43X
diff -Nur linux-2.6.23/arch/arm/mach-ixp4xx/Makefile linux-2.6.23-owrt/arch/arm/mach-ixp4xx/Makefile
--- linux-2.6.23/arch/arm/mach-ixp4xx/Makefile 2007-10-23 19:20:08.000000000 +0200
+++ linux-2.6.23-owrt/arch/arm/mach-ixp4xx/Makefile 2007-10-23 19:23:52.000000000 +0200
@@ -19,6 +19,7 @@
obj-pci-$(CONFIG_MACH_PRONGHORNMETRO) += pronghornmetro-pci.o
obj-pci-$(CONFIG_MACH_COMPEX) += ixdp425-pci.o
obj-pci-$(CONFIG_MACH_WRT300NV2) += wrt300nv2-pci.o
+obj-pci-$(CONFIG_MACH_SIDEWINDER) += sidewinder-pci.o
obj-y += common.o
@@ -36,6 +37,7 @@
obj-$(CONFIG_MACH_PRONGHORNMETRO) += pronghornmetro-setup.o
obj-$(CONFIG_MACH_COMPEX) += compex-setup.o
obj-$(CONFIG_MACH_WRT300NV2) += wrt300nv2-setup.o
+obj-$(CONFIG_MACH_SIDEWINDER) += sidewinder-setup.o
obj-$(CONFIG_PCI) += $(obj-pci-$(CONFIG_PCI)) common-pci.o
obj-$(CONFIG_IXP4XX_QMGR) += ixp4xx_qmgr.o
diff -Nur linux-2.6.23/arch/arm/mach-ixp4xx/sidewinder-pci.c linux-2.6.23-owrt/arch/arm/mach-ixp4xx/sidewinder-pci.c
--- linux-2.6.23/arch/arm/mach-ixp4xx/sidewinder-pci.c 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.23-owrt/arch/arm/mach-ixp4xx/sidewinder-pci.c 2007-10-23 19:23:52.000000000 +0200
@@ -0,0 +1,71 @@
+/*
+ * arch/arch/mach-ixp4xx/pronghornmetro-pci.c
+ *
+ * PCI setup routines for ADI Engineering Sidewinder
+ *
+ * Copyright (C) 2007 Imre Kaloz <kaloz@openwrt.org>
+ *
+ * based on coyote-pci.c:
+ * Copyright (C) 2002 Jungo Software Technologies.
+ * Copyright (C) 2003 MontaVista Softwrae, Inc.
+ *
+ * Maintainer: Imre Kaloz <kaloz@openwrt.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ */
+
+#include <linux/kernel.h>
+#include <linux/pci.h>
+#include <linux/init.h>
+#include <linux/irq.h>
+
+#include <asm/mach-types.h>
+#include <asm/hardware.h>
+#include <asm/irq.h>
+
+#include <asm/mach/pci.h>
+
+extern void ixp4xx_pci_preinit(void);
+extern int ixp4xx_setup(int nr, struct pci_sys_data *sys);
+extern struct pci_bus *ixp4xx_scan_bus(int nr, struct pci_sys_data *sys);
+
+void __init sidewinder_pci_preinit(void)
+{
+ set_irq_type(IRQ_IXP4XX_GPIO11, IRQT_LOW);
+ set_irq_type(IRQ_IXP4XX_GPIO10, IRQT_LOW);
+ set_irq_type(IRQ_IXP4XX_GPIO9, IRQT_LOW);
+
+ ixp4xx_pci_preinit();
+}
+
+static int __init sidewinder_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
+{
+ if (slot == 1)
+ return IRQ_IXP4XX_GPIO11;
+ else if (slot == 2)
+ return IRQ_IXP4XX_GPIO10;
+ else if (slot == 3)
+ return IRQ_IXP4XX_GPIO9;
+ else return -1;
+}
+
+struct hw_pci sidewinder_pci __initdata = {
+ .nr_controllers = 1,
+ .preinit = sidewinder_pci_preinit,
+ .swizzle = pci_std_swizzle,
+ .setup = ixp4xx_setup,
+ .scan = ixp4xx_scan_bus,
+ .map_irq = sidewinder_map_irq,
+};
+
+int __init sidewinder_pci_init(void)
+{
+ if (machine_is_sidewinder())
+ pci_common_init(&sidewinder_pci);
+ return 0;
+}
+
+subsys_initcall(sidewinder_pci_init);
diff -Nur linux-2.6.23/arch/arm/mach-ixp4xx/sidewinder-setup.c linux-2.6.23-owrt/arch/arm/mach-ixp4xx/sidewinder-setup.c
--- linux-2.6.23/arch/arm/mach-ixp4xx/sidewinder-setup.c 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.23-owrt/arch/arm/mach-ixp4xx/sidewinder-setup.c 2007-10-23 19:23:52.000000000 +0200
@@ -0,0 +1,115 @@
+/*
+ * arch/arm/mach-ixp4xx/sidewinder-setup.c
+ *
+ * Board setup for the ADI Engineering Sidewinder
+ *
+ * Copyright (C) 2007 Imre Kaloz <Kaloz@openwrt.org>
+ *
+ * based on coyote-setup.c:
+ * Copyright (C) 2003-2005 MontaVista Software, Inc.
+ *
+ * Author: Imre Kaloz <Kaloz@openwrt.org>
+ */
+
+#include <linux/kernel.h>
+#include <linux/serial.h>
+#include <linux/serial_8250.h>
+
+#include <asm/mach-types.h>
+#include <asm/mach/arch.h>
+#include <asm/mach/flash.h>
+
+static struct flash_platform_data sidewinder_flash_data = {
+ .map_name = "cfi_probe",
+ .width = 2,
+};
+
+static struct resource sidewinder_flash_resource = {
+ .flags = IORESOURCE_MEM,
+};
+
+static struct platform_device sidewinder_flash = {
+ .name = "IXP4XX-Flash",
+ .id = 0,
+ .dev = {
+ .platform_data = &sidewinder_flash_data,
+ },
+ .num_resources = 1,
+ .resource = &sidewinder_flash_resource,
+};
+
+static struct resource sidewinder_uart_resources[] = {
+ {
+ .start = IXP4XX_UART1_BASE_PHYS,
+ .end = IXP4XX_UART1_BASE_PHYS + 0x0fff,
+ .flags = IORESOURCE_MEM,
+ },
+ {
+ .start = IXP4XX_UART2_BASE_PHYS,
+ .end = IXP4XX_UART2_BASE_PHYS + 0x0fff,
+ .flags = IORESOURCE_MEM,
+ }
+};
+
+static struct plat_serial8250_port sidewinder_uart_data[] = {
+ {
+ .mapbase = IXP4XX_UART1_BASE_PHYS,
+ .membase = (char *)IXP4XX_UART1_BASE_VIRT + REG_OFFSET,
+ .irq = IRQ_IXP4XX_UART1,
+ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
+ .iotype = UPIO_MEM,
+ .regshift = 2,
+ .uartclk = IXP4XX_UART_XTAL,
+ },
+ {
+ .mapbase = IXP4XX_UART2_BASE_PHYS,
+ .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET,
+ .irq = IRQ_IXP4XX_UART2,
+ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
+ .iotype = UPIO_MEM,
+ .regshift = 2,
+ .uartclk = IXP4XX_UART_XTAL,
+ },
+ { },
+};
+
+static struct platform_device sidewinder_uart = {
+ .name = "serial8250",
+ .id = PLAT8250_DEV_PLATFORM,
+ .dev = {
+ .platform_data = sidewinder_uart_data,
+ },
+ .num_resources = 2,
+ .resource = &sidewinder_uart_resources,
+};
+
+static struct platform_device *sidewinder_devices[] __initdata = {
+ &sidewinder_flash,
+ &sidewinder_uart,
+};
+
+static void __init sidewinder_init(void)
+{
+ ixp4xx_sys_init();
+
+ sidewinder_flash_resource.start = IXP4XX_EXP_BUS_BASE(0);
+ sidewinder_flash_resource.end = IXP4XX_EXP_BUS_BASE(0) + SZ_64M - 1;
+
+ *IXP4XX_EXP_CS0 |= IXP4XX_FLASH_WRITABLE;
+ *IXP4XX_EXP_CS1 = *IXP4XX_EXP_CS0;
+
+ platform_add_devices(sidewinder_devices, ARRAY_SIZE(sidewinder_devices));
+}
+
+#ifdef CONFIG_MACH_SIDEWINDER
+MACHINE_START(SIDEWINDER, "ADI Engineering Sidewinder")
+ /* 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 = sidewinder_init,
+MACHINE_END
+#endif

View File

@ -0,0 +1,212 @@
diff -Nur linux-2.6.23.1/arch/arm/mach-ixp4xx/ap1000-setup.c linux-2.6.23.1-owrt/arch/arm/mach-ixp4xx/ap1000-setup.c
--- linux-2.6.23.1/arch/arm/mach-ixp4xx/ap1000-setup.c 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.23.1-owrt/arch/arm/mach-ixp4xx/ap1000-setup.c 2007-11-14 13:58:58.000000000 +0100
@@ -0,0 +1,151 @@
+/*
+ * arch/arm/mach-ixp4xx/ap1000-setup.c
+ *
+ * Lanready AP-1000
+ *
+ * Copyright (C) 2007 Imre Kaloz <Kaloz@openwrt.org>
+ *
+ * based on ixdp425-setup.c:
+ * Copyright (C) 2003-2005 MontaVista Software, Inc.
+ *
+ * Author: Imre Kaloz <Kaloz@openwrt.org>
+ */
+
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/device.h>
+#include <linux/serial.h>
+#include <linux/tty.h>
+#include <linux/serial_8250.h>
+#include <linux/slab.h>
+
+#include <asm/types.h>
+#include <asm/setup.h>
+#include <asm/memory.h>
+#include <asm/hardware.h>
+#include <asm/mach-types.h>
+#include <asm/irq.h>
+#include <asm/mach/arch.h>
+#include <asm/mach/flash.h>
+
+static struct flash_platform_data ap1000_flash_data = {
+ .map_name = "cfi_probe",
+ .width = 2,
+};
+
+static struct resource ap1000_flash_resource = {
+ .flags = IORESOURCE_MEM,
+};
+
+static struct platform_device ap1000_flash = {
+ .name = "IXP4XX-Flash",
+ .id = 0,
+ .dev = {
+ .platform_data = &ap1000_flash_data,
+ },
+ .num_resources = 1,
+ .resource = &ap1000_flash_resource,
+};
+
+static struct resource ap1000_uart_resources[] = {
+ {
+ .start = IXP4XX_UART1_BASE_PHYS,
+ .end = IXP4XX_UART1_BASE_PHYS + 0x0fff,
+ .flags = IORESOURCE_MEM
+ },
+ {
+ .start = IXP4XX_UART2_BASE_PHYS,
+ .end = IXP4XX_UART2_BASE_PHYS + 0x0fff,
+ .flags = IORESOURCE_MEM
+ }
+};
+
+static struct plat_serial8250_port ap1000_uart_data[] = {
+ {
+ .mapbase = IXP4XX_UART1_BASE_PHYS,
+ .membase = (char *)IXP4XX_UART1_BASE_VIRT + REG_OFFSET,
+ .irq = IRQ_IXP4XX_UART1,
+ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
+ .iotype = UPIO_MEM,
+ .regshift = 2,
+ .uartclk = IXP4XX_UART_XTAL,
+ },
+ {
+ .mapbase = IXP4XX_UART2_BASE_PHYS,
+ .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET,
+ .irq = IRQ_IXP4XX_UART2,
+ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
+ .iotype = UPIO_MEM,
+ .regshift = 2,
+ .uartclk = IXP4XX_UART_XTAL,
+ },
+ { },
+};
+
+static struct platform_device ap1000_uart = {
+ .name = "serial8250",
+ .id = PLAT8250_DEV_PLATFORM,
+ .dev.platform_data = ap1000_uart_data,
+ .num_resources = 2,
+ .resource = ap1000_uart_resources
+};
+
+static struct platform_device *ap1000_devices[] __initdata = {
+ &ap1000_flash,
+ &ap1000_uart
+};
+
+static char ap1000_mem_fixup[] __initdata = "mem=64M ";
+
+static void __init ap1000_fixup(struct machine_desc *desc,
+ struct tag *tags, char **cmdline, struct meminfo *mi)
+
+{
+ struct tag *t = tags;
+ char *p = *cmdline;
+
+ /* Find the end of the tags table, taking note of any cmdline tag. */
+ for (; t->hdr.size; t = tag_next(t)) {
+ if (t->hdr.tag == ATAG_CMDLINE) {
+ p = t->u.cmdline.cmdline;
+ }
+ }
+
+ /* Overwrite the end of the table with a new cmdline tag. */
+ t->hdr.tag = ATAG_CMDLINE;
+ t->hdr.size = (sizeof (struct tag_header) +
+ strlen(ap1000_mem_fixup) + strlen(p) + 1 + 4) >> 2;
+ strlcpy(t->u.cmdline.cmdline, ap1000_mem_fixup, COMMAND_LINE_SIZE);
+ strlcpy(t->u.cmdline.cmdline + strlen(ap1000_mem_fixup), p,
+ COMMAND_LINE_SIZE - strlen(ap1000_mem_fixup));
+
+ /* Terminate the table. */
+ t = tag_next(t);
+ t->hdr.tag = ATAG_NONE;
+ t->hdr.size = 0;
+}
+
+static void __init ap1000_init(void)
+{
+ ixp4xx_sys_init();
+
+ ap1000_flash_resource.start = IXP4XX_EXP_BUS_BASE(0);
+ ap1000_flash_resource.end =
+ IXP4XX_EXP_BUS_BASE(0) + ixp4xx_exp_bus_size - 1;
+
+ platform_add_devices(ap1000_devices, ARRAY_SIZE(ap1000_devices));
+}
+
+#ifdef CONFIG_MACH_AP1000
+MACHINE_START(AP1000, "Lanready AP-1000")
+ /* Maintainer: Imre Kaloz <Kaloz@openwrt.org> */
+ .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS,
+ .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc,
+ .fixup = ap1000_fixup,
+ .map_io = ixp4xx_map_io,
+ .init_irq = ixp4xx_init_irq,
+ .timer = &ixp4xx_timer,
+ .boot_params = 0x0100,
+ .init_machine = ap1000_init,
+MACHINE_END
+#endif
diff -Nur linux-2.6.23.1/arch/arm/mach-ixp4xx/ixdp425-pci.c linux-2.6.23.1-owrt/arch/arm/mach-ixp4xx/ixdp425-pci.c
--- linux-2.6.23.1/arch/arm/mach-ixp4xx/ixdp425-pci.c 2007-11-14 13:15:50.000000000 +0100
+++ linux-2.6.23.1-owrt/arch/arm/mach-ixp4xx/ixdp425-pci.c 2007-11-14 13:27:16.000000000 +0100
@@ -66,7 +66,8 @@
int __init ixdp425_pci_init(void)
{
if (machine_is_ixdp425() || machine_is_ixcdp1100() ||
- machine_is_ixdp465() || machine_is_kixrp435() || machine_is_compex())
+ machine_is_ixdp465() || machine_is_kixrp435() ||
+ machine_is_compex() || machine_is_ap1000())
pci_common_init(&ixdp425_pci);
return 0;
}
diff -Nur linux-2.6.23.1/arch/arm/mach-ixp4xx/Kconfig linux-2.6.23.1-owrt/arch/arm/mach-ixp4xx/Kconfig
--- linux-2.6.23.1/arch/arm/mach-ixp4xx/Kconfig 2007-11-14 13:15:50.000000000 +0100
+++ linux-2.6.23.1-owrt/arch/arm/mach-ixp4xx/Kconfig 2007-11-14 13:25:07.000000000 +0100
@@ -89,6 +89,14 @@
WRT300N v2 router. For more information on this
platform, see http://openwrt.org
+config MACH_AP1000
+ bool "Lanready AP-1000"
+ select PCI
+ help
+ Say 'Y' here if you want your kernel to support Lanready's
+ AP1000 board. For more information on this
+ platform, see http://openwrt.org
+
config ARCH_IXDP425
bool "IXDP425"
help
diff -Nur linux-2.6.23.1/arch/arm/mach-ixp4xx/Makefile linux-2.6.23.1-owrt/arch/arm/mach-ixp4xx/Makefile
--- linux-2.6.23.1/arch/arm/mach-ixp4xx/Makefile 2007-11-14 13:15:50.000000000 +0100
+++ linux-2.6.23.1-owrt/arch/arm/mach-ixp4xx/Makefile 2007-11-14 13:31:29.000000000 +0100
@@ -20,6 +20,7 @@
obj-pci-$(CONFIG_MACH_COMPEX) += ixdp425-pci.o
obj-pci-$(CONFIG_MACH_WRT300NV2) += wrt300nv2-pci.o
obj-pci-$(CONFIG_MACH_SIDEWINDER) += sidewinder-pci.o
+obj-pci-$(CONFIG_MACH_AP1000) += ixdp425-pci.o
obj-y += common.o
@@ -38,5 +39,6 @@
obj-$(CONFIG_MACH_COMPEX) += compex-setup.o
obj-$(CONFIG_MACH_WRT300NV2) += wrt300nv2-setup.o
obj-$(CONFIG_MACH_SIDEWINDER) += sidewinder-setup.o
+obj-$(CONFIG_MACH_AP1000) += ap1000-setup.o
obj-$(CONFIG_PCI) += $(obj-pci-$(CONFIG_PCI)) common-pci.o
diff -Nur linux-2.6.23.1/arch/arm/tools/mach-types linux-2.6.23.1-owrt/arch/arm/tools/mach-types
--- linux-2.6.23.1/arch/arm/tools/mach-types 2007-11-14 13:15:50.000000000 +0100
+++ linux-2.6.23.1-owrt/arch/arm/tools/mach-types 2007-11-14 13:26:06.000000000 +0100
@@ -1367,3 +1367,4 @@
csb726 MACH_CSB726 CSB726 1359
tik27 MACH_TIK27 TIK27 1360
mx_uc7420 MACH_MX_UC7420 MX_UC7420 1361
+ap1000 MACH_AP1000 AP1000 1543

View File

@ -0,0 +1,41 @@
diff -Nur linux-2.6.23.1/arch/arm/mach-ixp4xx/ap1000-setup.c linux-2.6.23.1-owrt/arch/arm/mach-ixp4xx/ap1000-setup.c
--- linux-2.6.23.1/arch/arm/mach-ixp4xx/ap1000-setup.c 2007-11-14 14:11:10.000000000 +0100
+++ linux-2.6.23.1-owrt/arch/arm/mach-ixp4xx/ap1000-setup.c 2007-11-14 14:09:30.000000000 +0100
@@ -90,9 +90,36 @@
.resource = ap1000_uart_resources
};
+/* Built-in 10/100 Ethernet MAC interfaces */
+static struct eth_plat_info ap1000_plat_eth[] = {
+ {
+ .phy = 4,
+ .rxq = 3,
+ .txreadyq = 20,
+ }, {
+ .phy = 5,
+ .rxq = 4,
+ .txreadyq = 21,
+ }
+};
+
+static struct platform_device ap1000_eth[] = {
+ {
+ .name = "ixp4xx_eth",
+ .id = IXP4XX_ETH_NPEB,
+ .dev.platform_data = ap1000_plat_eth,
+ }, {
+ .name = "ixp4xx_eth",
+ .id = IXP4XX_ETH_NPEC,
+ .dev.platform_data = ap1000_plat_eth + 1,
+ }
+};
+
static struct platform_device *ap1000_devices[] __initdata = {
&ap1000_flash,
- &ap1000_uart
+ &ap1000_uart,
+ &ap1000_eth[0],
+ &ap1000_eth[1],
};
static char ap1000_mem_fixup[] __initdata = "mem=64M ";

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,12 @@
diff -Nur linux-2.6.23/arch/arm/mach-ixp4xx/ixp4xx_npe.c linux-2.6.23-openwrt/arch/arm/mach-ixp4xx/ixp4xx_npe.c
--- linux-2.6.23/arch/arm/mach-ixp4xx/ixp4xx_npe.c 2007-10-22 22:18:15.000000000 +0200
+++ linux-2.6.23-openwrt/arch/arm/mach-ixp4xx/ixp4xx_npe.c 2007-10-22 22:32:48.000000000 +0200
@@ -585,6 +585,8 @@
npe_reset(npe);
#endif
+ print_npe(KERN_INFO, npe, "firmware's license can be found in /usr/share/doc/LICENSE.IPL\n");
+
print_npe(KERN_INFO, npe, "firmware functionality 0x%X, "
"revision 0x%X:%X\n", (image->id >> 16) & 0xFF,
(image->id >> 8) & 0xFF, image->id & 0xFF);