1
0
mirror of git://projects.qi-hardware.com/openwrt-xburst.git synced 2025-04-21 12:27:27 +03:00

strip the kernel version suffix from target directories, except for brcm-2.4 (the -2.4 will be included in the board name here). CONFIG_LINUX_<ver>_<board> becomes CONFIG_TARGET_<board>, same for profiles.

git-svn-id: svn://svn.openwrt.org/openwrt/trunk@8653 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
nbd
2007-09-06 16:27:37 +00:00
parent 5389989aba
commit 17c7b6c3fd
701 changed files with 48 additions and 105 deletions

View File

@@ -0,0 +1,24 @@
#
# Copyright (C) 2006 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
ARCH:=armeb
BOARD:=ixp4xx
BOARDNAME:=Intel XScale IXP4xx
FEATURES:=squashfs
LINUX_VERSION:=2.6.21.6
define Target/Description
endef
include $(INCLUDE_DIR)/kernel-build.mk
# include the profiles
-include profiles/*.mk
$(eval $(call BuildKernel))

View File

@@ -0,0 +1,13 @@
# Copyright (C) 2006 OpenWrt.org
config interface loopback
option ifname lo
option proto static
option ipaddr 127.0.0.1
option netmask 255.0.0.0
config interface lan
option ifname eth0
option proto static
option ipaddr 192.168.1.1
option netmask 255.255.255.0

View File

@@ -0,0 +1,492 @@
# CONFIG_8139TOO is not set
# CONFIG_AEABI is not set
CONFIG_ALIGNMENT_TRAP=y
# CONFIG_APM is not set
# CONFIG_ARCH_AAEC2000 is not set
# CONFIG_ARCH_ADI_COYOTE is not set
# CONFIG_ARCH_AT91 is not set
# CONFIG_ARCH_CLPS711X is not set
# CONFIG_ARCH_CLPS7500 is not set
# CONFIG_ARCH_CO285 is not set
# CONFIG_ARCH_DAVINCI is not set
# CONFIG_ARCH_DISCONTIGMEM_ENABLE is not set
# CONFIG_ARCH_EBSA110 is not set
# CONFIG_ARCH_EP93XX is not set
# CONFIG_ARCH_FOOTBRIDGE is not set
# CONFIG_ARCH_H720X is not set
# CONFIG_ARCH_IMX is not set
# CONFIG_ARCH_INTEGRATOR is not set
# CONFIG_ARCH_IOP13XX is not set
# CONFIG_ARCH_IOP32X is not set
# CONFIG_ARCH_IOP33X is not set
CONFIG_ARCH_IXCDP1100=y
CONFIG_ARCH_IXDP425=y
CONFIG_ARCH_IXDP4XX=y
# CONFIG_ARCH_IXP2000 is not set
# CONFIG_ARCH_IXP23XX is not set
CONFIG_ARCH_IXP4XX=y
# CONFIG_ARCH_KS8695 is not set
# CONFIG_ARCH_L7200 is not set
# CONFIG_ARCH_LH7A40X is not set
# CONFIG_ARCH_NETX is not set
# CONFIG_ARCH_NS9XXX is not set
# CONFIG_ARCH_OMAP is not set
# CONFIG_ARCH_PNX4008 is not set
# CONFIG_ARCH_PRPMC1100 is not set
# CONFIG_ARCH_PXA is not set
# CONFIG_ARCH_REALVIEW is not set
# CONFIG_ARCH_RPC is not set
# CONFIG_ARCH_S3C2410 is not set
# CONFIG_ARCH_SA1100 is not set
# CONFIG_ARCH_SHARK is not set
CONFIG_ARCH_SUPPORTS_BIG_ENDIAN=y
# CONFIG_ARCH_VERSATILE is not set
CONFIG_ARM=y
# CONFIG_ARM_THUMB is not set
# CONFIG_ARPD is not set
# CONFIG_ARTHUR is not set
CONFIG_ATA=m
# CONFIG_ATA_GENERIC is not set
# CONFIG_ATA_PIIX is not set
# CONFIG_ATM is not set
# CONFIG_ATMEL is not set
# CONFIG_B44 is not set
CONFIG_BASE_SMALL=0
# CONFIG_BINFMT_AOUT is not set
# CONFIG_BLK_DEV_CRYPTOLOOP is not set
# CONFIG_BLK_DEV_INITRD is not set
# CONFIG_BLK_DEV_NBD is not set
# CONFIG_BONDING is not set
# CONFIG_BRIDGE_NF_EBTABLES is not set
# CONFIG_BSD_DISKLABEL is not set
# CONFIG_CIFS_STATS is not set
CONFIG_CMDLINE="root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200 init=/etc/preinit"
# CONFIG_CONFIGFS_FS is not set
CONFIG_CPU_32=y
CONFIG_CPU_32v5=y
CONFIG_CPU_ABRT_EV5T=y
CONFIG_CPU_BIG_ENDIAN=y
CONFIG_CPU_CACHE_VIVT=y
CONFIG_CPU_CP15=y
CONFIG_CPU_CP15_MMU=y
# CONFIG_CPU_DCACHE_DISABLE is not set
CONFIG_CPU_TLB_V4WBI=y
CONFIG_CPU_XSCALE=y
CONFIG_CRC16=y
CONFIG_CRC_CCITT=m
# CONFIG_CRYPTO_ANUBIS is not set
CONFIG_CRYPTO_BLKCIPHER=m
# CONFIG_CRYPTO_BLOWFISH is not set
# CONFIG_CRYPTO_CAST5 is not set
# CONFIG_CRYPTO_CAST6 is not set
CONFIG_CRYPTO_CBC=m
# CONFIG_CRYPTO_CRC32C is not set
CONFIG_CRYPTO_DES=m
CONFIG_CRYPTO_HASH=y
CONFIG_CRYPTO_HMAC=y
# CONFIG_CRYPTO_KHAZAD is not set
# CONFIG_CRYPTO_MD4 is not set
CONFIG_CRYPTO_MD5=m
# CONFIG_CRYPTO_NULL is not set
# CONFIG_CRYPTO_SERPENT is not set
# CONFIG_CRYPTO_SHA256 is not set
# CONFIG_CRYPTO_SHA512 is not set
# CONFIG_CRYPTO_TEA is not set
# CONFIG_CRYPTO_TEST is not set
# CONFIG_CRYPTO_TGR192 is not set
# CONFIG_CRYPTO_TWOFISH is not set
# CONFIG_CRYPTO_WP512 is not set
# CONFIG_DEBUG_BUGVERBOSE is not set
# CONFIG_DEBUG_USER is not set
CONFIG_DEFAULT_TCP_CONG="westwood"
# CONFIG_DEFAULT_VEGAS is not set
CONFIG_DEFAULT_WESTWOOD=y
CONFIG_DLCI=m
CONFIG_DLCI_COUNT=24
CONFIG_DLCI_MAX=8
# CONFIG_DM9000 is not set
CONFIG_DMABOUNCE=y
CONFIG_DNOTIFY=y
# CONFIG_DSCC4 is not set
# CONFIG_E100 is not set
# CONFIG_FARSYNC is not set
CONFIG_FIRMWARE_EDID=y
# CONFIG_FPE_FASTFPE is not set
CONFIG_FPE_NWFPE=y
# CONFIG_FPE_NWFPE_XP is not set
CONFIG_FRAME_POINTER=y
# CONFIG_HAMRADIO is not set
CONFIG_HARDIRQS_SW_RESEND=y
CONFIG_HDLC=m
CONFIG_HDLC_CISCO=m
CONFIG_HDLC_FR=m
CONFIG_HDLC_PPP=m
CONFIG_HDLC_RAW=m
# CONFIG_HDLC_RAW_ETH is not set
# CONFIG_HERMES is not set
CONFIG_HID=m
# CONFIG_HID_DEBUG is not set
# CONFIG_HID_FF is not set
CONFIG_HWMON=y
# CONFIG_HWMON_DEBUG_CHIP is not set
CONFIG_HW_RANDOM=y
CONFIG_HW_RANDOM_IXP4XX=y
CONFIG_HZ=100
CONFIG_I2C=y
CONFIG_I2C_ALGOBIT=y
# CONFIG_I2C_ALGOPCA is not set
# CONFIG_I2C_ALGOPCF is not set
# CONFIG_I2C_ALI1535 is not set
# CONFIG_I2C_ALI1563 is not set
# CONFIG_I2C_ALI15X3 is not set
# CONFIG_I2C_AMD756 is not set
# CONFIG_I2C_AMD8111 is not set
CONFIG_I2C_CHARDEV=y
# CONFIG_I2C_DEBUG_ALGO is not set
# CONFIG_I2C_DEBUG_BUS is not set
# CONFIG_I2C_DEBUG_CHIP is not set
# CONFIG_I2C_DEBUG_CORE is not set
CONFIG_I2C_GPIO=y
# CONFIG_I2C_I801 is not set
# CONFIG_I2C_I810 is not set
# CONFIG_I2C_IOP3XX is not set
CONFIG_I2C_IXP4XX=y
# CONFIG_I2C_NFORCE2 is not set
# CONFIG_I2C_OCORES is not set
# CONFIG_I2C_PARPORT_LIGHT is not set
# CONFIG_I2C_PCA_ISA is not set
# CONFIG_I2C_PIIX4 is not set
# CONFIG_I2C_PROSAVAGE is not set
# CONFIG_I2C_SAVAGE4 is not set
# CONFIG_I2C_SIS5595 is not set
# CONFIG_I2C_SIS630 is not set
# CONFIG_I2C_SIS96X is not set
# CONFIG_I2C_STUB is not set
# CONFIG_I2C_VIA is not set
# CONFIG_I2C_VIAPRO is not set
# CONFIG_I2C_VOODOO3 is not set
# CONFIG_IDE is not set
# CONFIG_IEEE80211_SOFTMAC is not set
# CONFIG_IKCONFIG is not set
CONFIG_INITRAMFS_SOURCE=""
CONFIG_INPUT=m
CONFIG_INPUT_IXP4XX_BEEPER=m
# CONFIG_IP6_NF_MANGLE is not set
# CONFIG_IP6_NF_MATCH_EUI64 is not set
# CONFIG_IP6_NF_MATCH_FRAG is not set
# CONFIG_IP6_NF_MATCH_HL is not set
# CONFIG_IP6_NF_MATCH_IPV6HEADER is not set
# CONFIG_IP6_NF_MATCH_OPTS is not set
# CONFIG_IP6_NF_MATCH_OWNER is not set
# CONFIG_IP6_NF_MATCH_RT is not set
# CONFIG_IP6_NF_TARGET_LOG is not set
# CONFIG_IPV6_ROUTER_PREF is not set
# CONFIG_IP_ADVANCED_ROUTER is not set
# CONFIG_IP_DCCP is not set
CONFIG_IP_MROUTE=y
# CONFIG_IP_NF_AMANDA is not set
# CONFIG_IP_NF_ARPTABLES is not set
# CONFIG_IP_NF_CT_PROTO_SCTP is not set
# CONFIG_IP_NF_MATCH_ADDRTYPE is not set
# CONFIG_IP_NF_MATCH_ECN is not set
# CONFIG_IP_NF_MATCH_HASHLIMIT is not set
# CONFIG_IP_NF_MATCH_RECENT is not set
# CONFIG_IP_NF_MATCH_TIME is not set
# CONFIG_IP_NF_PPTP is not set
# CONFIG_IP_NF_SET is not set
# CONFIG_IP_NF_TARGET_ECN is not set
# CONFIG_IP_NF_TARGET_LOG is not set
# CONFIG_IP_NF_TARGET_NETMAP is not set
CONFIG_IP_NF_TARGET_REDIRECT=m
# CONFIG_IP_NF_TARGET_SAME is not set
# CONFIG_IP_NF_TARGET_TTL is not set
# CONFIG_IP_NF_TARGET_ULOG is not set
# CONFIG_IP_NF_TFTP is not set
CONFIG_IP_PIMSM_V1=y
CONFIG_IP_PIMSM_V2=y
# 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_QMGR=y
CONFIG_IXP4XX_CRYPTO=y
CONFIG_IXP4XX_WATCHDOG=y
# CONFIG_IWMMXT is not set
# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
CONFIG_JFFS2_FS_DEBUG=0
# CONFIG_JFS_FS is not set
# CONFIG_KEXEC is not set
# CONFIG_LANMEDIA is not set
CONFIG_LEDS_IXP4XX=y
CONFIG_LEGACY_PTYS=y
CONFIG_LEGACY_PTY_COUNT=256
# CONFIG_LIBCRC32C is not set
# CONFIG_LLC2 is not set
CONFIG_MACH_AVILA=y
CONFIG_MACH_COMPEX=y
CONFIG_MACH_DSMG600=y
CONFIG_MACH_FSG=y
CONFIG_MACH_GATEWAY7001=y
# CONFIG_MACH_GTWX5715 is not set
# CONFIG_MACH_IXDP465 is not set
# CONFIG_MACH_IXDPG425 is not set
# CONFIG_MACH_KIXRP435 is not set
CONFIG_MACH_LOFT=y
CONFIG_MACH_NAS100D=y
CONFIG_MACH_NSLU2=y
CONFIG_MACH_PRONGHORNMETRO=y
CONFIG_MACH_WG302V2=y
CONFIG_MACH_WRT300NV2=y
# CONFIG_MAC_PARTITION is not set
# CONFIG_MINIX_FS is not set
CONFIG_MINI_FO=y
CONFIG_MTD=y
# CONFIG_MTD_ABSENT is not set
# CONFIG_MTD_AFS_PARTS is not set
# CONFIG_MTD_ARM_INTEGRATOR is not set
CONFIG_MTD_BLOCK=y
# CONFIG_MTD_BLOCK2MTD is not set
CONFIG_MTD_CFI=y
CONFIG_MTD_CFI_ADV_OPTIONS=y
CONFIG_MTD_CFI_AMDSTD=y
# CONFIG_MTD_CFI_BE_BYTE_SWAP is not set
CONFIG_MTD_CFI_GEOMETRY=n
CONFIG_MTD_CFI_I1=y
CONFIG_MTD_CFI_I2=y
# CONFIG_MTD_CFI_I4 is not set
# CONFIG_MTD_CFI_I8 is not set
CONFIG_MTD_CFI_INTELEXT=y
# CONFIG_MTD_CFI_LE_BYTE_SWAP is not set
CONFIG_MTD_CFI_NOSWAP=y
# CONFIG_MTD_CFI_STAA is not set
CONFIG_MTD_CFI_UTIL=y
CONFIG_MTD_CHAR=y
# CONFIG_MTD_CMDLINE_PARTS is not set
CONFIG_MTD_COMPLEX_MAPPINGS=y
# CONFIG_MTD_CONCAT is not set
# CONFIG_MTD_DEBUG is not set
# CONFIG_MTD_DOC2000 is not set
# CONFIG_MTD_DOC2001 is not set
# CONFIG_MTD_DOC2001PLUS is not set
CONFIG_MTD_GEN_PROBE=y
CONFIG_MTD_IXP4XX=y
# CONFIG_MTD_JEDECPROBE is not set
CONFIG_MTD_MAP_BANK_WIDTH_1=y
# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
CONFIG_MTD_MAP_BANK_WIDTH_2=y
# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
CONFIG_MTD_MAP_BANK_WIDTH_4=y
# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
# CONFIG_MTD_MTDRAM is not set
# CONFIG_MTD_NAND is not set
# CONFIG_MTD_OBSOLETE_CHIPS is not set
# CONFIG_MTD_ONENAND is not set
CONFIG_MTD_OTP=y
CONFIG_MTD_PARTITIONS=y
# CONFIG_MTD_PCI is not set
# CONFIG_MTD_PHRAM is not set
# CONFIG_MTD_PHYSMAP is not set
# CONFIG_MTD_PLATRAM is not set
# CONFIG_MTD_PMC551 is not set
# CONFIG_MTD_RAM is not set
CONFIG_MTD_REDBOOT_DIRECTORY_BLOCK=-1
CONFIG_MTD_REDBOOT_PARTS=y
CONFIG_MTD_REDBOOT_PARTS_READONLY=y
CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED=y
# CONFIG_MTD_ROM is not set
# CONFIG_MTD_SLRAM is not set
# CONFIG_NATSEMI is not set
# CONFIG_NE2K_PCI is not set
# CONFIG_NETDEV_1000 is not set
# CONFIG_NET_CLS_ACT is not set
# CONFIG_NET_CLS_IND is not set
# CONFIG_NET_EMATCH is not set
# CONFIG_NET_IPIP is not set
# CONFIG_NET_SCH_NETEM is not set
# CONFIG_NET_VENDOR_3COM is not set
# CONFIG_NLS_CODEPAGE_437 is not set
# CONFIG_NLS_CODEPAGE_850 is not set
# CONFIG_NLS_ISO8859_1 is not set
# CONFIG_NLS_ISO8859_15 is not set
# CONFIG_NLS_KOI8_R is not set
# CONFIG_NO_IDLE_HZ is not set
# CONFIG_NTFS_FS is not set
# CONFIG_NVRAM is not set
# CONFIG_PATA_ALI is not set
# CONFIG_PATA_AMD is not set
CONFIG_PATA_ARTOP=m
# CONFIG_PATA_ATIIXP is not set
# CONFIG_PATA_CMD64X is not set
# CONFIG_PATA_CS5520 is not set
# CONFIG_PATA_CS5530 is not set
# CONFIG_PATA_CYPRESS is not set
# CONFIG_PATA_EFAR is not set
# CONFIG_PATA_HPT366 is not set
# CONFIG_PATA_HPT37X is not set
# CONFIG_PATA_HPT3X2N is not set
# CONFIG_PATA_HPT3X3 is not set
CONFIG_PATA_IXP4XX_CF=m
# CONFIG_PATA_IT821X is not set
# CONFIG_PATA_JMICRON is not set
# CONFIG_PATA_MPIIX is not set
# CONFIG_PATA_NETCELL is not set
# CONFIG_PATA_NS87410 is not set
# CONFIG_PATA_OLDPIIX is not set
# CONFIG_PATA_OPTI is not set
# CONFIG_PATA_OPTIDMA is not set
# CONFIG_PATA_PDC2027X is not set
# CONFIG_PATA_PDC_OLD is not set
# CONFIG_PATA_RADISYS is not set
# CONFIG_PATA_RZ1000 is not set
# CONFIG_PATA_SC1200 is not set
# CONFIG_PATA_SERVERWORKS is not set
# CONFIG_PATA_SIL680 is not set
# CONFIG_PATA_SIS is not set
# CONFIG_PATA_TRIFLEX is not set
# CONFIG_PATA_VIA is not set
# CONFIG_PATA_WINBOND is not set
# CONFIG_PC300 is not set
# CONFIG_PCCARD is not set
# CONFIG_PCI200SYN is not set
# CONFIG_PCIPCWATCHDOG is not set
# CONFIG_PDC_ADMA is not set
# CONFIG_PM is not set
CONFIG_PPP=m
CONFIG_PPP_MULTILINK=y
CONFIG_PPP_FILTER=y
CONFIG_PPP_ASYNC=m
CONFIG_PPP_SYNC_TTY=m
CONFIG_PPP_DEFLATE=m
CONFIG_PPP_BSDCOMP=m
CONFIG_PPP_MPPE=m
# CONFIG_PRISM54 is not set
# CONFIG_REISERFS_FS is not set
# CONFIG_ROMFS_FS is not set
# CONFIG_RPCSEC_GSS_KRB5 is not set
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_DS1742 is not set
CONFIG_RTC_DRV_ISL1208=y
# 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_TEST is not set
# CONFIG_RTC_DRV_V3020 is not set
CONFIG_RTC_DRV_X1205=y
CONFIG_RTC_HCTOSYS=y
CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
CONFIG_RTC_INTF_DEV=y
# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
CONFIG_RTC_INTF_PROC=y
CONFIG_RTC_INTF_SYSFS=y
CONFIG_RTC_LIB=y
CONFIG_RWSEM_GENERIC_SPINLOCK=y
# CONFIG_SATA_AHCI is not set
# CONFIG_SATA_MV is not set
# CONFIG_SATA_NV is not set
# CONFIG_SATA_PROMISE is not set
# CONFIG_SATA_QSTOR is not set
# CONFIG_SATA_SIL is not set
# CONFIG_SATA_SIL24 is not set
# CONFIG_SATA_SIS is not set
# CONFIG_SATA_SVW is not set
# CONFIG_SATA_SX4 is not set
# CONFIG_SATA_ULI is not set
# CONFIG_SATA_VIA is not set
# CONFIG_SATA_VITESSE is not set
# CONFIG_SCSI_IPR is not set
# CONFIG_SCSI_MULTI_LUN is not set
# CONFIG_SENSORS_ABITUGURU is not set
# CONFIG_SENSORS_ADM1021 is not set
# CONFIG_SENSORS_ADM1025 is not set
# CONFIG_SENSORS_ADM1026 is not set
# CONFIG_SENSORS_ADM1029 is not set
# CONFIG_SENSORS_ADM1031 is not set
# CONFIG_SENSORS_ADM9240 is not set
# CONFIG_SENSORS_ASB100 is not set
# CONFIG_SENSORS_ATXP1 is not set
# CONFIG_SENSORS_DS1337 is not set
# CONFIG_SENSORS_DS1374 is not set
# CONFIG_SENSORS_DS1621 is not set
CONFIG_SENSORS_EEPROM=y
# CONFIG_SENSORS_F71805F is not set
# CONFIG_SENSORS_FSCHER is not set
# CONFIG_SENSORS_FSCPOS is not set
# CONFIG_SENSORS_GL518SM is not set
# CONFIG_SENSORS_GL520SM is not set
# CONFIG_SENSORS_IT87 is not set
# CONFIG_SENSORS_LM63 is not set
# CONFIG_SENSORS_LM75 is not set
# CONFIG_SENSORS_LM77 is not set
# CONFIG_SENSORS_LM78 is not set
# CONFIG_SENSORS_LM80 is not set
# CONFIG_SENSORS_LM83 is not set
# CONFIG_SENSORS_LM85 is not set
# CONFIG_SENSORS_LM87 is not set
# CONFIG_SENSORS_LM90 is not set
# CONFIG_SENSORS_LM92 is not set
# CONFIG_SENSORS_MAX1619 is not set
# CONFIG_SENSORS_MAX6875 is not set
# CONFIG_SENSORS_PC87360 is not set
# CONFIG_SENSORS_PC87427 is not set
# CONFIG_SENSORS_PCA9539 is not set
# CONFIG_SENSORS_PCF8574 is not set
# CONFIG_SENSORS_PCF8591 is not set
# CONFIG_SENSORS_SIS5595 is not set
# CONFIG_SENSORS_SMSC47B397 is not set
# CONFIG_SENSORS_SMSC47M1 is not set
# CONFIG_SENSORS_SMSC47M192 is not set
# CONFIG_SENSORS_VIA686A is not set
# CONFIG_SENSORS_VT1211 is not set
# CONFIG_SENSORS_VT8231 is not set
# CONFIG_SENSORS_W83627EHF is not set
# CONFIG_SENSORS_W83627HF is not set
CONFIG_SENSORS_W83781D=y
# CONFIG_SENSORS_W83791D is not set
# CONFIG_SENSORS_W83792D is not set
# CONFIG_SENSORS_W83793 is not set
# CONFIG_SENSORS_W83L785TS is not set
# CONFIG_SERIAL_8250_EXTENDED is not set
# CONFIG_SHMEM is not set
CONFIG_SLHC=m
# CONFIG_SMB_FS is not set
# CONFIG_SMC91X is not set
# CONFIG_SOFT_WATCHDOG is not set
# CONFIG_SPARSEMEM_STATIC is not set
CONFIG_SPLIT_PTLOCK_CPUS=4096
CONFIG_SYN_COOKIES=y
# CONFIG_TCP_CONG_HSTCP is not set
# CONFIG_TCP_CONG_HYBLA is not set
# CONFIG_TCP_CONG_LP is not set
# CONFIG_TCP_CONG_SCALABLE is not set
CONFIG_TCP_CONG_VEGAS=m
# CONFIG_TCP_CONG_VENO is not set
CONFIG_TCP_CONG_WESTWOOD=y
CONFIG_TINY_SHMEM=y
CONFIG_UID16=y
# CONFIG_UNUSED_SYMBOLS is not set
# CONFIG_USBPCWATCHDOG is not set
CONFIG_USB_BANDWIDTH=y
CONFIG_USB_EHCI_HCD=m
CONFIG_USB_EHCI_ROOT_HUB_TT=y
CONFIG_USB_EHCI_SPLIT_ISO=y
CONFIG_USB_EHCI_TT_NEWSCHED=y
# CONFIG_USB_GTCO is not set
CONFIG_USB_OHCI_HCD=m
CONFIG_USB_UHCI_HCD=m
CONFIG_VECTORS_BASE=0xffff0000
# CONFIG_VIA_RHINE is not set
CONFIG_VIA_VELOCITY=m
CONFIG_VM_EVENT_COUNTERS=y
CONFIG_WAN=y
# CONFIG_WANXL is not set
# CONFIG_XFS_FS is not set
# CONFIG_XIP_KERNEL is not set
CONFIG_XSCALE_PMU=y
CONFIG_ZBOOT_ROM_BSS=0x0
CONFIG_ZBOOT_ROM_TEXT=0x0

View File

@@ -0,0 +1,21 @@
CONFIG_CMDLINE="root=/dev/sda1 noinitrd console=ttyS0,115200"
CONFIG_ATA=y
CONFIG_SATA_VIA=y
CONFIG_USB_ARCH_HAS_HCD=y
CONFIG_USB_ARCH_HAS_OHCI=y
CONFIG_USB_ARCH_HAS_EHCI=y
CONFIG_USB=y
CONFIG_USB_EHCI_HCD=y
CONFIG_USB_EHCI_SPLIT_ISO=y
CONFIG_USB_EHCI_ROOT_HUB_TT=y
CONFIG_USB_EHCI_TT_NEWSCHED=y
CONFIG_USB_OHCI_HCD=y
CONFIG_USB_OHCI_LITTLE_ENDIAN=y
CONFIG_USB_STORAGE=y
CONFIG_EXT3_FS=y
CONFIG_EXT3_FS_XATTR=y
CONFIG_EXT3_FS_POSIX_ACL=y
CONFIG_EXT3_FS_SECURITY=y
CONFIG_JBD=y
CONFIG_FS_MBCACHE=y
CONFIG_BLK_DEV_SD=y

View File

@@ -0,0 +1,10 @@
config IXP4XX_INCLUDE_UCODE
bool "Build images with Intel IXP4xx Microcode"
depends LINUX_2_6_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

@@ -0,0 +1,85 @@
#
# Copyright (C) 2006 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
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
BIN_DIR=$(BIN_DIR) $(TOPDIR)/scripts/slugimage.pl \
-L $(KDIR)/apex-nslu2-armeb.bin -m $(KDIR)/NPE-B \
-k $(BIN_DIR)/openwrt-nslu2-$(KERNEL)-zImage \
-r rootfs:$(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-$(1).img \
-p -o $(BIN_DIR)/openwrt-nslu2-$(KERNEL)-$(1).bin
BIN_DIR=$(BIN_DIR) $(TOPDIR)/scripts/slugimage.pl \
-F -L $(KDIR)/apex-nslu2-armeb.bin -m $(KDIR)/NPE-B \
-k $(BIN_DIR)/openwrt-nslu2-$(KERNEL)-zImage \
-r rootfs:$(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-$(1).img \
-p -o $(BIN_DIR)/openwrt-nslu2-$(KERNEL)-$(1)-16mb.bin
endef
endif
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
cp $(LINUX_DIR)/arch/arm/boot/zImage $(KDIR)/zImage
endef
define Image/BuildKernel
cp $(KDIR)/zImage $(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-zImage
# $(shell BIN_DIR=$(BIN_DIR) $(TOPDIR)/scripts/arm-magic.sh)
BIN_DIR=$(BIN_DIR) $(TOPDIR)/scripts/arm-magic.sh
endef
define Image/Build
$(call Image/Build/$(1),$(1))
endef
define Image/Build/jffs2-64k
dd if=$(KDIR)/root.$(1) of=$(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-$(1).img bs=65536 conv=sync
endef
define Image/Build/jffs2-128k
dd if=$(KDIR)/root.$(1) of=$(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-$(1).img bs=131072 conv=sync
$(call Image/Build/slug,$(1))
endef
define Image/Build/squashfs
$(call prepare_generic_squashfs,$(KDIR)/root.squashfs)
dd if=$(KDIR)/root.$(1) of=$(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-$(1).img bs=131072 conv=sync
$(call Image/Build/slug,$(1))
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

@@ -0,0 +1,40 @@
#
# 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:=apex
PKG_VERSION:=1.5.8
PKG_RELEASE:=1
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=ftp://ftp.buici.com/pub/apex/ \
ftp://metalab.unc.edu/pub/Linux/system/boot/apex/
PKG_MD5SUM:=bb96cc8d50b4f00ee653f0800643ea8a
include $(INCLUDE_DIR)/package.mk
define Build/Configure
$(MAKE) -C $(PKG_BUILD_DIR) \
ARCH=arm \
slugos-nslu2-armeb_config
endef
define Build/Compile
$(MAKE) -C $(PKG_BUILD_DIR) \
$(TARGET_CONFIGURE_OPTS) \
ARCH=arm \
all
endef
define Build/InstallDev
$(INSTALL_BIN) $(PKG_BUILD_DIR)/apex.bin $(TARGET)/apex-nslu2-armeb.bin
endef
$(eval $(call Build/DefaultTargets))

View File

@@ -0,0 +1,20 @@
--- apex-1.5.6/src/mach-ixp42x/slugos-nslu2-armeb_config 2007-06-02 10:06:45.000000000 +0930
+++ apex-1.5.6/src/mach-ixp42x/slugos-nslu2-armeb_config~ 2007-06-03 02:22:18.000000000 +0930
@@ -17,7 +17,7 @@
#
# General Setup
#
-CONFIG_TARGET_DESCRIPTION="SlugOS NSLU2 (bigendian)"
+CONFIG_TARGET_DESCRIPTION="OpenWRT NSLU2 (bigendian)"
CONFIG_CROSS_COMPILE=""
CONFIG_CC_OPTIMIZE_FOR_SIZE=y
# CONFIG_CC_OPTIMIZE_FOR_SPEED is not set
@@ -143,7 +143,7 @@
# Overrides
#
CONFIG_ENV_DEFAULT_CMDLINE_OVERRIDE=y
-CONFIG_ENV_DEFAULT_CMDLINE="root=/dev/mtdblock4 rootfstype=jffs2 console=ttyS0,115200"
+CONFIG_ENV_DEFAULT_CMDLINE="root=/dev/mtdblock4 rootfstype=squashfs,jffs2 console=ttyS0,115200 init=/etc/preinit noinitrd"
# CONFIG_ENV_DEFAULT_STARTUP_OVERRIDE is not set
CONFIG_USES_NOR_BOOTFLASH=y
CONFIG_RELOCATE_SIMPLE=y

View File

@@ -0,0 +1,40 @@
#
# 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:=1
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)/
endef
$(eval $(call Build/DefaultTargets))

View File

@@ -0,0 +1,143 @@
/*
* IxNpeMicrocode.h - Headerfile for compiling the Intel microcode C file
*
* Copyright (C) 2006 Christian Hohnstaedt <chohnstaedt@innominate.com>
*
* This file is released under the GPLv2
*
*
* compile with
*
* gcc -Wall IxNpeMicrocode.c -o IxNpeMicrocode
*
* Executing the resulting binary on your build-host creates the
* "NPE-[ABC].xxxxxxxx" files containing the selected microcode
*
* fetch the IxNpeMicrocode.c from the Intel Access Library.
* It will include this header.
*
* select Images for every NPE from the following
* (used C++ comments for easy uncommenting ....)
*/
// #define IX_NPEDL_NPEIMAGE_NPEA_ETH_SPAN_MASK_FIREWALL_VLAN_QOS_HDR_CONV_EXTMIB
// #define IX_NPEDL_NPEIMAGE_NPEA_ETH_SPAN_VLAN_QOS_HDR_CONV_EXTMIB
// #define IX_NPEDL_NPEIMAGE_NPEA_ETH_LEARN_FILTER_SPAN_MASK_FIREWALL_VLAN_QOS_EXTMIB
// #define IX_NPEDL_NPEIMAGE_NPEA_HSS_TSLOT_SWITCH
// #define IX_NPEDL_NPEIMAGE_NPEA_ETH_SPAN_FIREWALL_VLAN_QOS_HDR_CONV
// #define IX_NPEDL_NPEIMAGE_NPEA_ETH_LEARN_FILTER_SPAN_FIREWALL_VLAN_QOS
// #define IX_NPEDL_NPEIMAGE_NPEA_ETH_LEARN_FILTER_SPAN_FIREWALL
// #define IX_NPEDL_NPEIMAGE_NPEA_HSS_2_PORT
// #define IX_NPEDL_NPEIMAGE_NPEA_DMA
// #define IX_NPEDL_NPEIMAGE_NPEA_ATM_MPHY_12_PORT
// #define IX_NPEDL_NPEIMAGE_NPEA_HSS0_ATM_MPHY_1_PORT
// #define IX_NPEDL_NPEIMAGE_NPEA_HSS0_ATM_SPHY_1_PORT
// #define IX_NPEDL_NPEIMAGE_NPEA_HSS0
// #define IX_NPEDL_NPEIMAGE_NPEA_WEP
// #define IX_NPEDL_NPEIMAGE_NPEB_ETH_SPAN_MASK_FIREWALL_VLAN_QOS_HDR_CONV_EXTMIB
// #define IX_NPEDL_NPEIMAGE_NPEB_ETH_SPAN_VLAN_QOS_HDR_CONV_EXTMIB
// #define IX_NPEDL_NPEIMAGE_NPEB_ETH_LEARN_FILTER_SPAN_MASK_FIREWALL_VLAN_QOS_EXTMIB
// #define IX_NPEDL_NPEIMAGE_NPEB_DMA
// #define IX_NPEDL_NPEIMAGE_NPEB_ETH_SPAN_FIREWALL_VLAN_QOS_HDR_CONV
// #define IX_NPEDL_NPEIMAGE_NPEB_ETH_LEARN_FILTER_SPAN_FIREWALL_VLAN_QOS
#define IX_NPEDL_NPEIMAGE_NPEB_ETH_LEARN_FILTER_SPAN_FIREWALL
// #define IX_NPEDL_NPEIMAGE_NPEC_ETH_SPAN_MASK_FIREWALL_VLAN_QOS_HDR_CONV_EXTMIB
// #define IX_NPEDL_NPEIMAGE_NPEC_ETH_SPAN_VLAN_QOS_HDR_CONV_EXTMIB
// #define IX_NPEDL_NPEIMAGE_NPEC_ETH_LEARN_FILTER_SPAN_MASK_FIREWALL_VLAN_QOS_EXTMIB
// #define IX_NPEDL_NPEIMAGE_NPEC_DMA
// #define IX_NPEDL_NPEIMAGE_NPEC_CRYPTO_AES_ETH_LEARN_FILTER_SPAN
// #define IX_NPEDL_NPEIMAGE_NPEC_CRYPTO_AES_ETH_LEARN_FILTER_FIREWALL
#define IX_NPEDL_NPEIMAGE_NPEC_CRYPTO_AES_CCM_ETH
// #define IX_NPEDL_NPEIMAGE_NPEC_CRYPTO_ETH_LEARN_FILTER_SPAN_FIREWALL
// #define IX_NPEDL_NPEIMAGE_NPEC_ETH_SPAN_FIREWALL_VLAN_QOS_HDR_CONV
// #define IX_NPEDL_NPEIMAGE_NPEC_ETH_LEARN_FILTER_SPAN_FIREWALL_VLAN_QOS
// #define IX_NPEDL_NPEIMAGE_NPEC_ETH_LEARN_FILTER_SPAN_FIREWALL
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <netinet/in.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <errno.h>
#include <endian.h>
#include <byteswap.h>
#include <string.h>
#if __BYTE_ORDER == __LITTLE_ENDIAN
#define to_le32(x) (x)
#define to_be32(x) bswap_32(x)
#else
#define to_be32(x) (x)
#define to_le32(x) bswap_32(x)
#endif
struct dl_image {
unsigned magic;
unsigned id;
unsigned size;
unsigned data[0];
};
const unsigned IxNpeMicrocode_array[];
int main(int argc, char *argv[])
{
struct dl_image *image = (struct dl_image *)IxNpeMicrocode_array;
int imgsiz, i, fd, cnt;
const unsigned *arrayptr = IxNpeMicrocode_array;
const char *names[] = { "IXP425", "IXP465", "unknown" };
int bigendian = 1;
if (argc > 1) {
if (!strcmp(argv[1], "-le"))
bigendian = 0;
else if (!strcmp(argv[1], "-be"))
bigendian = 1;
else {
printf("Usage: %s <-le|-be>\n", argv[0]);
return EXIT_FAILURE;
}
}
for (image = (struct dl_image *)arrayptr, cnt=0;
(image->id != 0xfeedf00d) && (image->magic == 0xfeedf00d);
image = (struct dl_image *)(arrayptr), cnt++)
{
unsigned char field[4];
imgsiz = image->size + 3;
*(unsigned*)field = to_be32(image->id);
char filename[40], slnk[10];
sprintf(filename, "NPE-%c.%08x", (field[0] & 0xf) + 'A',
image->id);
sprintf(slnk, "NPE-%c", (field[0] & 0xf) + 'A');
printf("Writing image: %s.NPE_%c Func: %2x Rev: %02x.%02x "
"Size: %5d to: '%s'\n",
names[field[0] >> 4], (field[0] & 0xf) + 'A',
field[1], field[2], field[3], imgsiz*4, filename);
fd = open(filename, O_CREAT | O_RDWR | O_TRUNC, 0644);
if (fd >= 0) {
for (i=0; i<imgsiz; i++) {
*(unsigned*)field = bigendian ?
to_be32(arrayptr[i]) :
to_le32(arrayptr[i]);
write(fd, field, sizeof(field));
}
close(fd);
unlink(slnk);
symlink(filename, slnk);
} else {
perror(filename);
}
arrayptr += imgsiz;
}
close(fd);
return 0;
}

View File

@@ -0,0 +1,551 @@
This patch adds support for the D-Link DSM-G600 Rev A.
This is an ARM XScale IXP4xx system relatively similar to
the NSLU2 and NAS-100D already supported by mainline. An
important difference is Gigabit Ethernet support using
the Via Velocity chipset.
This patch is the combined work of Michael Westerhof and
Alessandro Zummo, with contributions from Michael-Luke
Jones. This version addresses review comments from rmk
and Deepak Saxena.
Signed-off-by: Michael-Luke Jones <mlj28@cam.ac.uk>
Signed-off-by: Alessandro Zummo <a.zummo@towertech.it>
Signed-off-by: Michael Westerhof <mwester@dls.net>
---
arch/arm/mach-ixp4xx/Kconfig | 9 +
arch/arm/mach-ixp4xx/Makefile | 2
arch/arm/mach-ixp4xx/dsmg600-pci.c | 74 +++++++++++++
arch/arm/mach-ixp4xx/dsmg600-power.c | 130 ++++++++++++++++++++++++
arch/arm/mach-ixp4xx/dsmg600-setup.c | 175 +++++++++++++++++++++++++++++++++
include/asm-arm/arch-ixp4xx/dsmg600.h | 57 ++++++++++
include/asm-arm/arch-ixp4xx/hardware.h | 1
include/asm-arm/arch-ixp4xx/irqs.h | 10 +
8 files changed, 458 insertions(+)
Index: linux-2.6.21.1-armeb/arch/arm/mach-ixp4xx/Kconfig
===================================================================
--- linux-2.6.21.1-armeb.orig/arch/arm/mach-ixp4xx/Kconfig
+++ linux-2.6.21.1-armeb/arch/arm/mach-ixp4xx/Kconfig
@@ -89,6 +89,15 @@
NAS 100d device. For more information on this platform,
see http://www.nslu2-linux.org/wiki/NAS100d/HomePage
+config MACH_DSMG600
+ bool
+ prompt "D-Link DSM-G600 RevA"
+ select PCI
+ help
+ Say 'Y' here if you want your kernel to support D-Link's
+ DSM-G600 RevA device. For more information on this platform,
+ see http://www.nslu2-linux.org/wiki/DSMG600/HomePage
+
#
# Avila and IXDP share the same source for now. Will change in future
#
Index: linux-2.6.21.1-armeb/arch/arm/mach-ixp4xx/Makefile
===================================================================
--- linux-2.6.21.1-armeb.orig/arch/arm/mach-ixp4xx/Makefile
+++ linux-2.6.21.1-armeb/arch/arm/mach-ixp4xx/Makefile
@@ -12,6 +12,7 @@
obj-pci-$(CONFIG_MACH_GTWX5715) += gtwx5715-pci.o
obj-pci-$(CONFIG_MACH_NSLU2) += nslu2-pci.o
obj-pci-$(CONFIG_MACH_NAS100D) += nas100d-pci.o
+obj-pci-$(CONFIG_MACH_DSMG600) += dsmg600-pci.o
obj-y += common.o
@@ -22,5 +23,6 @@
obj-$(CONFIG_MACH_GTWX5715) += gtwx5715-setup.o
obj-$(CONFIG_MACH_NSLU2) += nslu2-setup.o nslu2-power.o
obj-$(CONFIG_MACH_NAS100D) += nas100d-setup.o nas100d-power.o
+obj-$(CONFIG_MACH_DSMG600) += dsmg600-setup.o dsmg600-power.o
obj-$(CONFIG_PCI) += $(obj-pci-$(CONFIG_PCI)) common-pci.o
Index: linux-2.6.21.1-armeb/arch/arm/mach-ixp4xx/dsmg600-pci.c
===================================================================
--- /dev/null
+++ linux-2.6.21.1-armeb/arch/arm/mach-ixp4xx/dsmg600-pci.c
@@ -0,0 +1,74 @@
+/*
+ * DSM-G600 board-level PCI initialization
+ *
+ * Copyright (C) 2006 Tower Technologies
+ * Author: Alessandro Zummo <a.zummo@towertech.it>
+ *
+ * based on ixdp425-pci.c:
+ * Copyright (C) 2002 Intel Corporation.
+ * Copyright (C) 2003-2004 MontaVista Software, Inc.
+ *
+ * Maintainer: http://www.nslu2-linux.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/pci.h>
+#include <linux/init.h>
+#include <linux/irq.h>
+
+#include <asm/mach/pci.h>
+#include <asm/mach-types.h>
+
+void __init dsmg600_pci_preinit(void)
+{
+ set_irq_type(IRQ_DSMG600_PCI_INTA, IRQT_LOW);
+ set_irq_type(IRQ_DSMG600_PCI_INTB, IRQT_LOW);
+ set_irq_type(IRQ_DSMG600_PCI_INTC, IRQT_LOW);
+ set_irq_type(IRQ_DSMG600_PCI_INTD, IRQT_LOW);
+ set_irq_type(IRQ_DSMG600_PCI_INTE, IRQT_LOW);
+ set_irq_type(IRQ_DSMG600_PCI_INTF, IRQT_LOW);
+
+ ixp4xx_pci_preinit();
+}
+
+static int __init dsmg600_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
+{
+ static int pci_irq_table[DSMG600_PCI_MAX_DEV][DSMG600_PCI_IRQ_LINES] =
+ {
+ { IRQ_DSMG600_PCI_INTE, -1, -1 },
+ { IRQ_DSMG600_PCI_INTA, -1, -1 },
+ { IRQ_DSMG600_PCI_INTB, IRQ_DSMG600_PCI_INTC, IRQ_DSMG600_PCI_INTD },
+ { IRQ_DSMG600_PCI_INTF, -1, -1 },
+ };
+
+ int irq = -1;
+
+ if (slot >= 1 && slot <= DSMG600_PCI_MAX_DEV &&
+ pin >= 1 && pin <= DSMG600_PCI_IRQ_LINES)
+ irq = pci_irq_table[slot-1][pin-1];
+
+ return irq;
+}
+
+struct hw_pci __initdata dsmg600_pci = {
+ .nr_controllers = 1,
+ .preinit = dsmg600_pci_preinit,
+ .swizzle = pci_std_swizzle,
+ .setup = ixp4xx_setup,
+ .scan = ixp4xx_scan_bus,
+ .map_irq = dsmg600_map_irq,
+};
+
+int __init dsmg600_pci_init(void)
+{
+ if (machine_is_dsmg600())
+ pci_common_init(&dsmg600_pci);
+
+ return 0;
+}
+
+subsys_initcall(dsmg600_pci_init);
Index: linux-2.6.21.1-armeb/arch/arm/mach-ixp4xx/dsmg600-power.c
===================================================================
--- /dev/null
+++ linux-2.6.21.1-armeb/arch/arm/mach-ixp4xx/dsmg600-power.c
@@ -0,0 +1,130 @@
+/*
+ * arch/arm/mach-ixp4xx/dsmg600-power.c
+ *
+ * DSM-G600 Power/Reset driver
+ * Author: Michael Westerhof <mwester@dls.net>
+ *
+ * Based on nslu2-power.c
+ * Copyright (C) 2005 Tower Technologies
+ * Author: Alessandro Zummo <a.zummo@towertech.it>
+ *
+ * which was based on nslu2-io.c
+ * Copyright (C) 2004 Karen Spearel
+ *
+ * Maintainers: http://www.nslu2-linux.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/module.h>
+#include <linux/reboot.h>
+#include <linux/interrupt.h>
+#include <linux/irq.h>
+#include <linux/jiffies.h>
+#include <linux/timer.h>
+
+#include <asm/mach-types.h>
+
+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 dsmg600_power_handler(unsigned long data);
+static DEFINE_TIMER(dsmg600_power_timer, dsmg600_power_handler, 0, 0);
+
+static void dsmg600_power_handler(unsigned long data)
+{
+ /* This routine is called twice per second to check the
+ * state of the power button.
+ */
+
+ 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.
+ */
+ ctrl_alt_del();
+
+ /* 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;
+ }
+ }
+
+ mod_timer(&dsmg600_power_timer, jiffies + msecs_to_jiffies(500));
+}
+
+static irqreturn_t dsmg600_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;
+}
+
+static int __init dsmg600_power_init(void)
+{
+ if (!(machine_is_dsmg600()))
+ return 0;
+
+ if (request_irq(DSMG600_RB_IRQ, &dsmg600_reset_handler,
+ IRQF_DISABLED | IRQF_TRIGGER_LOW, "DSM-G600 reset button",
+ NULL) < 0) {
+
+ printk(KERN_DEBUG "Reset Button IRQ %d not available\n",
+ DSMG600_RB_IRQ);
+
+ return -EIO;
+ }
+
+ /* The power button on the D-Link DSM-G600 is on GPIO 15, 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(DSMG600_PB_GPIO, IXP4XX_GPIO_IN);
+
+ /* Set the initial value for the power button IRQ handler */
+ power_button_countdown = PBUTTON_HOLDDOWN_COUNT;
+
+ mod_timer(&dsmg600_power_timer, jiffies + msecs_to_jiffies(500));
+
+ return 0;
+}
+
+static void __exit dsmg600_power_exit(void)
+{
+ if (!(machine_is_dsmg600()))
+ return;
+
+ del_timer_sync(&dsmg600_power_timer);
+
+ free_irq(DSMG600_RB_IRQ, NULL);
+}
+
+module_init(dsmg600_power_init);
+module_exit(dsmg600_power_exit);
+
+MODULE_AUTHOR("Michael Westerhof <mwester@dls.net>");
+MODULE_DESCRIPTION("DSM-G600 Power/Reset driver");
+MODULE_LICENSE("GPL");
Index: linux-2.6.21.1-armeb/arch/arm/mach-ixp4xx/dsmg600-setup.c
===================================================================
--- /dev/null
+++ linux-2.6.21.1-armeb/arch/arm/mach-ixp4xx/dsmg600-setup.c
@@ -0,0 +1,175 @@
+/*
+ * DSM-G600 board-setup
+ *
+ * Copyright (C) 2006 Tower Technologies
+ * Author: Alessandro Zummo <a.zummo@towertech.it>
+ *
+ * based ixdp425-setup.c:
+ * Copyright (C) 2003-2004 MontaVista Software, Inc.
+ *
+ * Author: Alessandro Zummo <a.zummo@towertech.it>
+ * Maintainers: http://www.nslu2-linux.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 dsmg600_flash_data = {
+ .map_name = "cfi_probe",
+ .width = 2,
+};
+
+static struct resource dsmg600_flash_resource = {
+ .flags = IORESOURCE_MEM,
+};
+
+static struct platform_device dsmg600_flash = {
+ .name = "IXP4XX-Flash",
+ .id = 0,
+ .dev.platform_data = &dsmg600_flash_data,
+ .num_resources = 1,
+ .resource = &dsmg600_flash_resource,
+};
+
+static struct ixp4xx_i2c_pins dsmg600_i2c_gpio_pins = {
+ .sda_pin = DSMG600_SDA_PIN,
+ .scl_pin = DSMG600_SCL_PIN,
+};
+
+static struct platform_device dsmg600_i2c_controller = {
+ .name = "IXP4XX-I2C",
+ .id = 0,
+ .dev.platform_data = &dsmg600_i2c_gpio_pins,
+};
+
+#ifdef CONFIG_LEDS_CLASS
+static struct resource dsmg600_led_resources[] = {
+ {
+ .name = "power",
+ .start = DSMG600_LED_PWR_GPIO,
+ .end = DSMG600_LED_PWR_GPIO,
+ .flags = IXP4XX_GPIO_HIGH,
+ },
+ {
+ .name = "wlan",
+ .start = DSMG600_LED_WLAN_GPIO,
+ .end = DSMG600_LED_WLAN_GPIO,
+ .flags = IXP4XX_GPIO_LOW,
+ },
+};
+
+static struct platform_device dsmg600_leds = {
+ .name = "IXP4XX-GPIO-LED",
+ .id = -1,
+ .num_resources = ARRAY_SIZE(dsmg600_led_resources),
+ .resource = dsmg600_led_resources,
+};
+#endif
+
+static struct resource dsmg600_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 dsmg600_uart_data[] = {
+ {
+ .mapbase = IXP4XX_UART1_BASE_PHYS,
+ .membase = (char *)IXP4XX_UART1_BASE_VIRT + REG_OFFSET,
+ .irq = IRQ_IXP4XX_UART1,
+ .flags = UPF_BOOT_AUTOCONF,
+ .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,
+ .iotype = UPIO_MEM,
+ .regshift = 2,
+ .uartclk = IXP4XX_UART_XTAL,
+ },
+ { }
+};
+
+static struct platform_device dsmg600_uart = {
+ .name = "serial8250",
+ .id = PLAT8250_DEV_PLATFORM,
+ .dev.platform_data = dsmg600_uart_data,
+ .num_resources = ARRAY_SIZE(dsmg600_uart_resources),
+ .resource = dsmg600_uart_resources,
+};
+
+static struct platform_device *dsmg600_devices[] __initdata = {
+ &dsmg600_i2c_controller,
+ &dsmg600_flash,
+};
+
+static void dsmg600_power_off(void)
+{
+ /* enable the pwr cntl gpio */
+ gpio_line_config(DSMG600_PO_GPIO, IXP4XX_GPIO_OUT);
+
+ /* poweroff */
+ gpio_line_set(DSMG600_PO_GPIO, IXP4XX_GPIO_HIGH);
+}
+
+static void __init dsmg600_init(void)
+{
+ ixp4xx_sys_init();
+
+ /* Make sure that GPIO14 and GPIO15 are not used as clocks */
+ *IXP4XX_GPIO_GPCLKR = 0;
+
+ dsmg600_flash_resource.start = IXP4XX_EXP_BUS_BASE(0);
+ dsmg600_flash_resource.end =
+ IXP4XX_EXP_BUS_BASE(0) + ixp4xx_exp_bus_size - 1;
+
+ pm_power_off = dsmg600_power_off;
+
+ /* The UART is required on the DSM-G600 (Redboot cannot use the
+ * NIC) -- do it here so that it does *not* get removed if
+ * platform_add_devices fails!
+ */
+ (void)platform_device_register(&dsmg600_uart);
+
+ platform_add_devices(dsmg600_devices, ARRAY_SIZE(dsmg600_devices));
+
+#ifdef CONFIG_LEDS_CLASS
+ /* We don't care whether or not this works. */
+ (void)platform_device_register(&dsmg600_leds);
+#endif
+}
+
+static void __init dsmg600_fixup(struct machine_desc *desc,
+ struct tag *tags, char **cmdline, struct meminfo *mi)
+{
+ /* The xtal on this machine is non-standard. */
+ ixp4xx_timer_freq = DSMG600_FREQ;
+}
+
+MACHINE_START(DSMG600, "D-Link DSM-G600 RevA")
+ /* Maintainer: www.nslu2-linux.org */
+ .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 = &ixp4xx_timer,
+ .init_machine = dsmg600_init,
+MACHINE_END
Index: linux-2.6.21.1-armeb/include/asm-arm/arch-ixp4xx/dsmg600.h
===================================================================
--- /dev/null
+++ linux-2.6.21.1-armeb/include/asm-arm/arch-ixp4xx/dsmg600.h
@@ -0,0 +1,57 @@
+/*
+ * DSM-G600 platform specific definitions
+ *
+ * Copyright (C) 2006 Tower Technologies
+ * Author: Alessandro Zummo <a.zummo@towertech.it>
+ *
+ * based on ixdp425.h:
+ * 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 DSMG600_SDA_PIN 5
+#define DSMG600_SCL_PIN 4
+
+/*
+ * DSMG600 PCI IRQs
+ */
+#define DSMG600_PCI_MAX_DEV 4
+#define DSMG600_PCI_IRQ_LINES 3
+
+
+/* PCI controller GPIO to IRQ pin mappings */
+#define DSMG600_PCI_INTA_PIN 11
+#define DSMG600_PCI_INTB_PIN 10
+#define DSMG600_PCI_INTC_PIN 9
+#define DSMG600_PCI_INTD_PIN 8
+#define DSMG600_PCI_INTE_PIN 7
+#define DSMG600_PCI_INTF_PIN 6
+
+/* DSM-G600 Timer Setting */
+#define DSMG600_FREQ 66000000
+
+/* Buttons */
+
+#define DSMG600_PB_GPIO 15 /* power button */
+#define DSMG600_PB_BM (1L << DSMG600_PB_GPIO)
+
+#define DSMG600_RB_GPIO 3 /* reset button */
+
+#define DSMG600_RB_IRQ IRQ_IXP4XX_GPIO3
+
+#define DSMG600_PO_GPIO 2 /* power off */
+
+/* LEDs */
+
+#define DSMG600_LED_PWR_GPIO 0
+#define DSMG600_LED_PWR_BM (1L << DSMG600_LED_PWR_GPIO)
+
+#define DSMG600_LED_WLAN_GPIO 14
+#define DSMG600_LED_WLAN_BM (1L << DSMG600_LED_WLAN_GPIO)
Index: linux-2.6.21.1-armeb/include/asm-arm/arch-ixp4xx/hardware.h
===================================================================
--- linux-2.6.21.1-armeb.orig/include/asm-arm/arch-ixp4xx/hardware.h
+++ linux-2.6.21.1-armeb/include/asm-arm/arch-ixp4xx/hardware.h
@@ -47,5 +47,6 @@
#include "prpmc1100.h"
#include "nslu2.h"
#include "nas100d.h"
+#include "dsmg600.h"
#endif /* _ASM_ARCH_HARDWARE_H */
Index: linux-2.6.21.1-armeb/include/asm-arm/arch-ixp4xx/irqs.h
===================================================================
--- linux-2.6.21.1-armeb.orig/include/asm-arm/arch-ixp4xx/irqs.h
+++ linux-2.6.21.1-armeb/include/asm-arm/arch-ixp4xx/irqs.h
@@ -118,4 +118,14 @@
#define IRQ_NAS100D_PCI_INTD IRQ_IXP4XX_GPIO8
#define IRQ_NAS100D_PCI_INTE IRQ_IXP4XX_GPIO7
+/*
+ * D-Link DSM-G600 RevA board IRQs
+ */
+#define IRQ_DSMG600_PCI_INTA IRQ_IXP4XX_GPIO11
+#define IRQ_DSMG600_PCI_INTB IRQ_IXP4XX_GPIO10
+#define IRQ_DSMG600_PCI_INTC IRQ_IXP4XX_GPIO9
+#define IRQ_DSMG600_PCI_INTD IRQ_IXP4XX_GPIO8
+#define IRQ_DSMG600_PCI_INTE IRQ_IXP4XX_GPIO7
+#define IRQ_DSMG600_PCI_INTF IRQ_IXP4XX_GPIO6
+
#endif

View File

@@ -0,0 +1,131 @@
This patch is required as the frequency fixup in nslu2_init does not
run sufficiently early in the boot sequence to take effect. In
addition the dsmg600 setup code behaviour has been improved such
that a 'fixup' routine is avoided.
Signed-off-by: Michael-Luke Jones <mlj28@cam.ac.uk>
Index: linux-2.6.21-arm/arch/arm/mach-ixp4xx/nslu2-setup.c
===================================================================
--- linux-2.6.21-arm.orig/arch/arm/mach-ixp4xx/nslu2-setup.c 2007-05-07 12:05:40.000000000 -0700
+++ linux-2.6.21-arm/arch/arm/mach-ixp4xx/nslu2-setup.c 2007-05-07 12:15:56.000000000 -0700
@@ -22,6 +22,7 @@
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
#include <asm/mach/flash.h>
+#include <asm/mach/time.h>
static struct flash_platform_data nslu2_flash_data = {
.map_name = "cfi_probe",
@@ -157,10 +158,21 @@
gpio_line_set(NSLU2_PO_GPIO, IXP4XX_GPIO_HIGH);
}
-static void __init nslu2_init(void)
+static void __init nslu2_timer_init(void)
{
- ixp4xx_timer_freq = NSLU2_FREQ;
+ /* The xtal on this machine is non-standard. */
+ ixp4xx_timer_freq = NSLU2_FREQ;
+
+ /* Call standard timer_init function. */
+ ixp4xx_timer_init();
+}
+static struct sys_timer nslu2_timer = {
+ .init = nslu2_timer_init,
+};
+
+static void __init nslu2_init(void)
+{
ixp4xx_sys_init();
nslu2_flash_resource.start = IXP4XX_EXP_BUS_BASE(0);
@@ -185,6 +197,6 @@
.boot_params = 0x00000100,
.map_io = ixp4xx_map_io,
.init_irq = ixp4xx_init_irq,
- .timer = &ixp4xx_timer,
+ .timer = &nslu2_timer,
.init_machine = nslu2_init,
MACHINE_END
Index: linux-2.6.21-arm/arch/arm/mach-ixp4xx/common.c
===================================================================
--- linux-2.6.21-arm.orig/arch/arm/mach-ixp4xx/common.c 2007-05-07 12:05:40.000000000 -0700
+++ linux-2.6.21-arm/arch/arm/mach-ixp4xx/common.c 2007-05-07 12:15:16.000000000 -0700
@@ -269,7 +269,7 @@
.handler = ixp4xx_timer_interrupt,
};
-static void __init ixp4xx_timer_init(void)
+void __init ixp4xx_timer_init(void)
{
/* Clear Pending Interrupt by writing '1' to it */
*IXP4XX_OSST = IXP4XX_OSST_TIMER_1_PEND;
Index: linux-2.6.21-arm/include/asm-arm/arch-ixp4xx/platform.h
===================================================================
--- linux-2.6.21-arm.orig/include/asm-arm/arch-ixp4xx/platform.h 2007-05-07 12:05:40.000000000 -0700
+++ linux-2.6.21-arm/include/asm-arm/arch-ixp4xx/platform.h 2007-05-07 12:15:16.000000000 -0700
@@ -113,6 +113,7 @@
extern void ixp4xx_map_io(void);
extern void ixp4xx_init_irq(void);
extern void ixp4xx_sys_init(void);
+extern void ixp4xx_timer_init(void);
extern struct sys_timer ixp4xx_timer;
extern void ixp4xx_pci_preinit(void);
struct pci_sys_data;
Index: linux-2.6.21-arm/arch/arm/mach-ixp4xx/dsmg600-setup.c
===================================================================
--- linux-2.6.21-arm.orig/arch/arm/mach-ixp4xx/dsmg600-setup.c 2007-05-07 12:05:42.000000000 -0700
+++ linux-2.6.21-arm/arch/arm/mach-ixp4xx/dsmg600-setup.c 2007-05-07 12:16:07.000000000 -0700
@@ -18,6 +18,7 @@
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
#include <asm/mach/flash.h>
+#include <asm/mach/time.h>
static struct flash_platform_data dsmg600_flash_data = {
.map_name = "cfi_probe",
@@ -128,6 +129,19 @@
gpio_line_set(DSMG600_PO_GPIO, IXP4XX_GPIO_HIGH);
}
+static void __init dsmg600_timer_init(void)
+{
+ /* The xtal on this machine is non-standard. */
+ ixp4xx_timer_freq = DSMG600_FREQ;
+
+ /* Call standard timer_init function. */
+ ixp4xx_timer_init();
+}
+
+static struct sys_timer dsmg600_timer = {
+ .init = dsmg600_timer_init,
+};
+
static void __init dsmg600_init(void)
{
ixp4xx_sys_init();
@@ -155,21 +169,13 @@
#endif
}
-static void __init dsmg600_fixup(struct machine_desc *desc,
- struct tag *tags, char **cmdline, struct meminfo *mi)
-{
- /* The xtal on this machine is non-standard. */
- ixp4xx_timer_freq = DSMG600_FREQ;
-}
-
MACHINE_START(DSMG600, "D-Link DSM-G600 RevA")
/* Maintainer: www.nslu2-linux.org */
.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 = &ixp4xx_timer,
+ .timer = &dsmg600_timer,
.init_machine = dsmg600_init,
MACHINE_END

View File

@@ -0,0 +1,196 @@
This trivial patch updates the nslu2 and nas-100d headers to
remove pointless GPIO defines, and updates nslu2-setup.c
accordingly. In addition minor style cleanups to some comments
are included.
Signed-off-by: Michael-Luke Jones <mlj28@cam.ac.uk>
Index: linux-2.6.21-armeb/arch/arm/mach-ixp4xx/nslu2-setup.c
===================================================================
--- linux-2.6.21-armeb.orig/arch/arm/mach-ixp4xx/nslu2-setup.c 2007-05-09 07:32:43.000000000 -0700
+++ linux-2.6.21-armeb/arch/arm/mach-ixp4xx/nslu2-setup.c 2007-05-09 07:32:46.000000000 -0700
@@ -50,26 +50,26 @@
static struct resource nslu2_led_resources[] = {
{
.name = "ready", /* green led */
- .start = NSLU2_LED_GRN,
- .end = NSLU2_LED_GRN,
+ .start = NSLU2_LED_GRN_GPIO,
+ .end = NSLU2_LED_GRN_GPIO,
.flags = IXP4XX_GPIO_HIGH,
},
{
.name = "status", /* red led */
- .start = NSLU2_LED_RED,
- .end = NSLU2_LED_RED,
+ .start = NSLU2_LED_RED_GPIO,
+ .end = NSLU2_LED_RED_GPIO,
.flags = IXP4XX_GPIO_HIGH,
},
{
.name = "disk-1",
- .start = NSLU2_LED_DISK1,
- .end = NSLU2_LED_DISK1,
+ .start = NSLU2_LED_DISK1_GPIO,
+ .end = NSLU2_LED_DISK1_GPIO,
.flags = IXP4XX_GPIO_LOW,
},
{
.name = "disk-2",
- .start = NSLU2_LED_DISK2,
- .end = NSLU2_LED_DISK2,
+ .start = NSLU2_LED_DISK2_GPIO,
+ .end = NSLU2_LED_DISK2_GPIO,
.flags = IXP4XX_GPIO_LOW,
},
};
@@ -181,7 +181,8 @@
pm_power_off = nslu2_power_off;
- /* This is only useful on a modified machine, but it is valuable
+ /*
+ * 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!
*/
Index: linux-2.6.21-armeb/include/asm-arm/arch-ixp4xx/nslu2.h
===================================================================
--- linux-2.6.21-armeb.orig/include/asm-arm/arch-ixp4xx/nslu2.h 2007-05-09 07:32:43.000000000 -0700
+++ linux-2.6.21-armeb/include/asm-arm/arch-ixp4xx/nslu2.h 2007-05-09 07:32:46.000000000 -0700
@@ -9,7 +9,7 @@
* based on ixdp425.h:
* Copyright 2004 (c) MontaVista, Software, Inc.
*
- * This file is licensed under the terms of the GNU General Public
+ * 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.
*/
@@ -34,36 +34,14 @@
#define NSLU2_PCI_INTC_PIN 9
#define NSLU2_PCI_INTD_PIN 8
-
/* NSLU2 Timer */
#define NSLU2_FREQ 66000000
-#define NSLU2_CLOCK_TICK_RATE (((NSLU2_FREQ / HZ & ~IXP4XX_OST_RELOAD_MASK) + 1) * HZ)
-#define NSLU2_CLOCK_TICKS_PER_USEC ((NSLU2_CLOCK_TICK_RATE + USEC_PER_SEC/2) / USEC_PER_SEC)
-
-/* GPIO */
-
-#define NSLU2_GPIO0 0
-#define NSLU2_GPIO1 1
-#define NSLU2_GPIO2 2
-#define NSLU2_GPIO3 3
-#define NSLU2_GPIO4 4
-#define NSLU2_GPIO5 5
-#define NSLU2_GPIO6 6
-#define NSLU2_GPIO7 7
-#define NSLU2_GPIO8 8
-#define NSLU2_GPIO9 9
-#define NSLU2_GPIO10 10
-#define NSLU2_GPIO11 11
-#define NSLU2_GPIO12 12
-#define NSLU2_GPIO13 13
-#define NSLU2_GPIO14 14
-#define NSLU2_GPIO15 15
/* Buttons */
-#define NSLU2_PB_GPIO NSLU2_GPIO5
-#define NSLU2_PO_GPIO NSLU2_GPIO8 /* power off */
-#define NSLU2_RB_GPIO NSLU2_GPIO12
+#define NSLU2_PB_GPIO 5
+#define NSLU2_PO_GPIO 8 /* power off */
+#define NSLU2_RB_GPIO 12
#define NSLU2_PB_IRQ IRQ_IXP4XX_GPIO5
#define NSLU2_RB_IRQ IRQ_IXP4XX_GPIO12
@@ -79,16 +57,16 @@
/* LEDs */
-#define NSLU2_LED_RED NSLU2_GPIO0
-#define NSLU2_LED_GRN NSLU2_GPIO1
+#define NSLU2_LED_RED_GPIO 0
+#define NSLU2_LED_GRN_GPIO 1
-#define NSLU2_LED_RED_BM (1L << NSLU2_LED_RED)
-#define NSLU2_LED_GRN_BM (1L << NSLU2_LED_GRN)
+#define NSLU2_LED_RED_BM (1L << NSLU2_LED_RED_GPIO)
+#define NSLU2_LED_GRN_BM (1L << NSLU2_LED_GRN_GPIO)
-#define NSLU2_LED_DISK1 NSLU2_GPIO3
-#define NSLU2_LED_DISK2 NSLU2_GPIO2
+#define NSLU2_LED_DISK1_GPIO 3
+#define NSLU2_LED_DISK2_GPIO 2
-#define NSLU2_LED_DISK1_BM (1L << NSLU2_GPIO2)
-#define NSLU2_LED_DISK2_BM (1L << NSLU2_GPIO3)
+#define NSLU2_LED_DISK1_BM (1L << NSLU2_LED_DISK1_GPIO)
+#define NSLU2_LED_DISK2_BM (1L << NSLU2_LED_DISK2_GPIO)
Index: linux-2.6.21-armeb/include/asm-arm/arch-ixp4xx/nas100d.h
===================================================================
--- linux-2.6.21-armeb.orig/include/asm-arm/arch-ixp4xx/nas100d.h 2007-04-25 20:08:32.000000000 -0700
+++ linux-2.6.21-armeb/include/asm-arm/arch-ixp4xx/nas100d.h 2007-05-09 07:34:14.000000000 -0700
@@ -10,7 +10,7 @@
* based on ixdp425.h:
* Copyright 2004 (c) MontaVista, Software, Inc.
*
- * This file is licensed under the terms of the GNU General Public
+ * 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.
*/
@@ -36,31 +36,11 @@
#define NAS100D_PCI_INTD_PIN 8
#define NAS100D_PCI_INTE_PIN 7
-/* GPIO */
-
-#define NAS100D_GPIO0 0
-#define NAS100D_GPIO1 1
-#define NAS100D_GPIO2 2
-#define NAS100D_GPIO3 3
-#define NAS100D_GPIO4 4
-#define NAS100D_GPIO5 5
-#define NAS100D_GPIO6 6
-#define NAS100D_GPIO7 7
-#define NAS100D_GPIO8 8
-#define NAS100D_GPIO9 9
-#define NAS100D_GPIO10 10
-#define NAS100D_GPIO11 11
-#define NAS100D_GPIO12 12
-#define NAS100D_GPIO13 13
-#define NAS100D_GPIO14 14
-#define NAS100D_GPIO15 15
-
-
/* Buttons */
-#define NAS100D_PB_GPIO NAS100D_GPIO14
-#define NAS100D_RB_GPIO NAS100D_GPIO4
-#define NAS100D_PO_GPIO NAS100D_GPIO12 /* power off */
+#define NAS100D_PB_GPIO 14
+#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
Index: linux-2.6.21-armeb/arch/arm/mach-ixp4xx/nas100d-setup.c
===================================================================
--- linux-2.6.21-armeb.orig/arch/arm/mach-ixp4xx/nas100d-setup.c 2007-05-09 07:32:43.000000000 -0700
+++ linux-2.6.21-armeb/arch/arm/mach-ixp4xx/nas100d-setup.c 2007-05-09 07:34:55.000000000 -0700
@@ -155,7 +155,8 @@
pm_power_off = nas100d_power_off;
- /* This is only useful on a modified machine, but it is valuable
+ /*
+ * 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!
*/

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,17 @@
---
drivers/net/ixp4xx/mac_driver.c | 24 ++++++++++--------------
1 file changed, 10 insertions(+), 14 deletions(-)
Index: linux-2.6.21-rc4-git6-arm/drivers/net/ixp4xx/mac_driver.c
===================================================================
--- linux-2.6.21-rc4-git6-arm.orig/drivers/net/ixp4xx/mac_driver.c 2007-03-22 10:32:20.735684085 +0000
+++ linux-2.6.21-rc4-git6-arm/drivers/net/ixp4xx/mac_driver.c 2007-03-22 10:33:29.355972584 +0000
@@ -842,7 +842,7 @@
}
}
-module_init(init_mac);
+late_initcall(init_mac);
module_exit(finish_mac);
MODULE_LICENSE("GPL");

View File

@@ -0,0 +1,392 @@
---
drivers/net/ixp4xx/Kconfig | 10 +
drivers/net/ixp4xx/Makefile | 1
drivers/net/ixp4xx/npe_ucode.c | 185 +++++++++++++++++++++++++++++++++
drivers/net/ixp4xx/ucode_dl.c | 43 ++++---
include/asm-arm/arch-ixp4xx/platform.h | 19 +++
include/linux/ixp_npe.h | 1
6 files changed, 239 insertions(+), 20 deletions(-)
Index: linux-2.6.20-rc3/drivers/net/ixp4xx/Kconfig
===================================================================
--- linux-2.6.20-rc3.orig/drivers/net/ixp4xx/Kconfig
+++ linux-2.6.20-rc3/drivers/net/ixp4xx/Kconfig
@@ -11,6 +11,7 @@
tristate "IXP4xx NPE support"
depends on ARCH_IXP4XX
depends on NET_ETHERNET
+ select CRC16
help
The IXP4XX NPE driver supports the 3 CPU co-processors called
"Network Processing Engines" (NPE). It adds support fo downloading
@@ -18,7 +19,7 @@
More about this at: Documentation/networking/ixp4xx/README.
You can either use this OR the Intel Access Library (IAL)
-config IXP4XX_FW_LOAD
+config IXP4XX_NPE_FW_LOAD
bool "Use Firmware hotplug for Microcode download"
depends on IXP4XX_NPE
select HOTPLUG
@@ -28,6 +29,13 @@
/usr/lib/hotplug/firmware/NPE-[ABC]
see Documentation/firmware_class/hotplug-script
+config IXP4XX_NPE_FW_MTD
+ bool "Load firmware from an mtd partition"
+ depends on IXP4XX_NPE && MTD_IXP4XX
+ help
+ With this option, the driver will search for
+ the firmware into an MTD partition.
+
config IXP4XX_MAC
tristate "IXP4xx MAC support"
depends on IXP4XX_NPE
Index: linux-2.6.20-rc3/drivers/net/ixp4xx/Makefile
===================================================================
--- linux-2.6.20-rc3.orig/drivers/net/ixp4xx/Makefile
+++ linux-2.6.20-rc3/drivers/net/ixp4xx/Makefile
@@ -1,5 +1,6 @@
obj-$(CONFIG_IXP4XX_QMGR) += ixp4xx_qmgr.o
obj-$(CONFIG_IXP4XX_NPE) += ixp4xx_npe.o
+obj-$(CONFIG_IXP4XX_NPE_FW_MTD) += npe_ucode.o
obj-$(CONFIG_IXP4XX_MAC) += ixp4xx_mac.o
obj-$(CONFIG_IXP4XX_CRYPTO) += ixp4xx_crypto.o
Index: linux-2.6.20-rc3/drivers/net/ixp4xx/npe_ucode.c
===================================================================
--- /dev/null
+++ linux-2.6.20-rc3/drivers/net/ixp4xx/npe_ucode.c
@@ -0,0 +1,185 @@
+/*
+ * Provide an NPE platform device for microcode handling
+ *
+ * Copyright (C) 2006 Christian Hohnstaedt <chohnstaedt@innominate.com>
+ *
+ * This file is released under the GPLv2
+ */
+
+#include <linux/kernel.h>
+#include <linux/platform_device.h>
+#include <linux/init.h>
+#include <linux/slab.h>
+#include <linux/firmware.h>
+#include <linux/mtd/mtd.h>
+
+#include <linux/ixp_npe.h>
+
+#define DL_MAGIC 0xfeedf00d
+#define DL_MAGIC_SWAP 0x0df0edfe
+
+#define IMG_SIZE(image) (((image)->size * sizeof(u32)) + \
+ sizeof(struct dl_image))
+
+#define IMG_REV_MAJOR(id) (((id) >> 8) & 0x0f)
+#define IMG_REV_MINOR(id) ((id) & 0x0f)
+#define IMG_FUNC(id) (((id) >> 16) & 0xff)
+#define IMG_NPE(id) (((id) >> 24) & 0x0f)
+#define IMG_IXP(id) (((id) >> 28) & 0x0f)
+
+static struct platform_driver ixp4xx_npe_ucode_driver;
+static unsigned char *partition_name = NULL;
+
+static void print_image_info(u32 id, u32 offset, u32 size)
+{
+ unsigned char idx;
+ const char *names[] = { "IXP425", "IXP465", "unknown" };
+
+ idx = IMG_IXP(id) < 2 ? IMG_IXP(id) : 2;
+
+ printk(KERN_INFO "npe: found at 0x%x, %s/NPE-%c func: %02x, rev: %x.%x, "
+ "size: %5d, id: %08x\n", offset, names[idx], IMG_NPE(id) + 'A',
+ IMG_FUNC(id), IMG_REV_MAJOR(id), IMG_REV_MINOR(id), size, id);
+}
+
+void npe_swap_image(struct dl_image *image)
+{
+ unsigned int i;
+
+ image->magic = swab32(image->magic);
+ image->id = swab32(image->id);
+ image->size = swab32(image->size);
+
+ for (i = 0; i < image->size; i++)
+ image->u.data[i] = swab32(image->u.data[i]);
+}
+
+static void npe_find_microcode(struct mtd_info *mtd)
+{
+ u32 buf;
+ u32 magic = htonl(DL_MAGIC);
+ u32 id, size;
+ size_t retlen;
+ int err;
+ unsigned int offset = 0;
+
+ printk("npe: searching for firmware...\n");
+
+ while (offset < mtd->size) {
+
+ err = mtd->read(mtd, offset, 4, &retlen, (u_char *) &buf);
+ offset += retlen;
+
+ if (buf != magic)
+ continue;
+
+ err = mtd->read(mtd, offset, 4, &retlen, (u_char *) &id);
+ offset += retlen;
+
+ if (id == magic)
+ break;
+
+ id = ntohl(id);
+
+ err = mtd->read(mtd, offset, 4, &retlen, (u_char *) &size);
+ offset += retlen;
+
+ size = (ntohl(size) * 4) + 12;
+
+ print_image_info(id, offset - 12, size);
+
+ if (size < 24000 && ( IMG_FUNC(id) == 0x01 || IMG_FUNC(id) == 0x00) || IMG_FUNC(id) == 0x05 ) { // XXX fix size/detection
+
+ struct dl_image *image = kmalloc(size, GFP_KERNEL);
+
+ /* we are going to load it, rewind offset */
+ offset -= 12;
+
+ if (image) {
+ err = mtd->read(mtd, offset, size, &retlen, (u_char *) image);
+
+ if (err == 0 && retlen == size) {
+ if (image->magic == DL_MAGIC_SWAP)
+ npe_swap_image(image);
+
+ store_npe_image(image, NULL);
+ } else {
+ printk(KERN_ERR "unable to read firmware\n");
+ }
+
+ kfree(image);
+ }
+
+ offset += size;
+ }
+ }
+}
+
+static void npe_flash_add(struct mtd_info *mtd)
+{
+ if (partition_name == NULL)
+ return;
+
+ if (strcmp(mtd->name, partition_name) == 0) {
+ npe_find_microcode(mtd);
+ }
+}
+
+static void npe_flash_remove(struct mtd_info *mtd) {
+}
+
+static struct mtd_notifier npe_flash_notifier = {
+ .add = npe_flash_add,
+ .remove = npe_flash_remove,
+};
+
+static int npe_ucode_probe(struct platform_device *pdev)
+{
+ struct npe_ucode_platform_data *data = pdev->dev.platform_data;
+
+ if (partition_name)
+ return -EEXIST;
+
+ if (data && data->mtd_partition) {
+ partition_name = data->mtd_partition;
+ return 0;
+ }
+
+ return -EINVAL;
+}
+
+static int npe_ucode_remove(struct platform_device *pdev)
+{
+ return 0;
+}
+
+static struct platform_driver ixp4xx_npe_ucode_driver = {
+ .driver = {
+ .name = "ixp4xx_npe_ucode",
+ .owner = THIS_MODULE,
+ },
+ .probe = npe_ucode_probe,
+ .remove = npe_ucode_remove,
+};
+
+static int __init npe_ucode_init(void)
+{
+ int ret;
+
+ ret = platform_driver_register(&ixp4xx_npe_ucode_driver);
+ register_mtd_user(&npe_flash_notifier);
+
+ return ret;
+}
+
+static void __exit npe_ucode_exit(void)
+{
+ unregister_mtd_user(&npe_flash_notifier);
+ platform_driver_unregister(&ixp4xx_npe_ucode_driver);
+}
+
+module_init(npe_ucode_init);
+module_exit(npe_ucode_exit);
+
+MODULE_LICENSE("GPL");
+MODULE_AUTHOR("Alessandro Zummo <a.zummo@towertech.it>");
Index: linux-2.6.20-rc3/drivers/net/ixp4xx/ucode_dl.c
===================================================================
--- linux-2.6.20-rc3.orig/drivers/net/ixp4xx/ucode_dl.c
+++ linux-2.6.20-rc3/drivers/net/ixp4xx/ucode_dl.c
@@ -16,6 +16,7 @@
#include <linux/firmware.h>
#include <linux/dma-mapping.h>
#include <linux/byteorder/swab.h>
+#include <linux/crc16.h>
#include <asm/uaccess.h>
#include <asm/io.h>
@@ -26,6 +27,12 @@
#define DL_MAGIC 0xfeedf00d
#define DL_MAGIC_SWAP 0x0df0edfe
+#define IMG_REV_MAJOR(id) (((id) >> 8) & 0x0f)
+#define IMG_REV_MINOR(id) ((id) & 0x0f)
+#define IMG_FUNC(id) (((id) >> 16) & 0xff)
+#define IMG_NPE(id) (((id) >> 24) & 0x0f)
+#define IMG_IXP(id) (((id) >> 28) & 0x0f)
+
#define EOF_BLOCK 0xf
#define IMG_SIZE(image) (((image)->size * sizeof(u32)) + \
sizeof(struct dl_image))
@@ -38,21 +45,6 @@
data,
};
-struct dl_block {
- u32 type;
- u32 offset;
-};
-
-struct dl_image {
- u32 magic;
- u32 id;
- u32 size;
- union {
- u32 data[0];
- struct dl_block block[0];
- } u;
-};
-
struct dl_codeblock {
u32 npe_addr;
u32 size;
@@ -127,20 +119,33 @@
return 0;
}
-static int store_npe_image(struct dl_image *image, struct device *dev)
+int store_npe_image(struct dl_image *image, struct device *dev)
{
struct dl_block *blk;
struct dl_codeblock *cb;
struct npe_info *npe;
int ret=0;
+ u16 crc;
if (!dev) {
- dev = get_npe_by_id( (image->id >> 24) & 0xf);
+ dev = get_npe_by_id(IMG_NPE(image->id));
return_npe_dev(dev);
}
if (!dev)
return -ENODEV;
+ if (image->size > 24000) { // XXX fix max size
+ printk(KERN_ERR "npe: firmware too large\n");
+ return -EFBIG;
+ }
+
+ if (IMG_REV_MAJOR(image->id) != 2) {
+ printk(KERN_ERR "npe: only revision 2 is supported at this time\n");
+ return -EINVAL;
+ }
+
+ crc = crc16(0, (u8 *) image, IMG_SIZE(image));
+
npe = dev_get_drvdata(dev);
if (npe->loaded && (npe->usage > 0)) {
printk(KERN_INFO "Cowardly refusing to reload an Image "
@@ -267,8 +272,7 @@
static void npe_firmware_probe(struct device *dev)
{
-#if (defined(CONFIG_FW_LOADER) || defined(CONFIG_FW_LOADER_MODULE)) \
- && defined(MODULE)
+#ifdef CONFIG_IXP4XX_NPE_FW_LOADER
const struct firmware *fw_entry;
struct npe_info *npe = dev_get_drvdata(dev);
struct dl_image *image;
@@ -477,3 +481,4 @@
EXPORT_SYMBOL(get_npe_by_id);
EXPORT_SYMBOL(return_npe_dev);
+EXPORT_SYMBOL(store_npe_image);
Index: linux-2.6.20-rc3/include/asm-arm/arch-ixp4xx/platform.h
===================================================================
--- linux-2.6.20-rc3.orig/include/asm-arm/arch-ixp4xx/platform.h
+++ linux-2.6.20-rc3/include/asm-arm/arch-ixp4xx/platform.h
@@ -86,6 +86,21 @@
unsigned long scl_pin;
};
+struct dl_block {
+ u32 type;
+ u32 offset;
+};
+
+struct dl_image {
+ u32 magic;
+ u32 id;
+ u32 size;
+ union {
+ u32 data[0];
+ struct dl_block block[0];
+ } u;
+};
+
struct npe_plat_data {
const char *name;
int data_size;
@@ -105,6 +120,10 @@
};
+struct npe_ucode_platform_data {
+ unsigned char *mtd_partition;
+};
+
/*
* This structure provide a means for the board setup code
* to give information to th pata_ixp4xx driver. It is
Index: linux-2.6.20-rc3/include/linux/ixp_npe.h
===================================================================
--- linux-2.6.20-rc3.orig/include/linux/ixp_npe.h
+++ linux-2.6.20-rc3/include/linux/ixp_npe.h
@@ -99,6 +99,7 @@
extern struct device *get_npe_by_id(int id);
extern void return_npe_dev(struct device *dev);
+extern int store_npe_image(struct dl_image *image, struct device *dev);
/* NPE Messages */
extern int

View File

@@ -0,0 +1,73 @@
diff -Nur linux-2.6.19.2/drivers/net/ixp4xx/mac_driver.c linux-2.6.19.2-owrt/drivers/net/ixp4xx/mac_driver.c
--- linux-2.6.19.2/drivers/net/ixp4xx/mac_driver.c 2007-04-15 14:26:54.000000000 +0200
+++ linux-2.6.19.2-owrt/drivers/net/ixp4xx/mac_driver.c 2007-04-15 14:33:44.000000000 +0200
@@ -161,6 +161,16 @@
{
struct mac_info *mac = netdev_priv(dev);
+ if ( mac->mii.phy_id < 0 ) {
+ if ( init ) {
+ netif_carrier_on(mac->mii.dev);
+ mac->mii.full_duplex = 1;
+ update_duplex_mode(dev);
+ return 1;
+ }
+ return 0;
+ }
+
if (mii_check_media(&mac->mii, netif_msg_link(mac), init)) {
update_duplex_mode(dev);
return 1;
@@ -458,7 +468,12 @@
return -EINVAL;
if (!try_module_get(THIS_MODULE))
return -ENODEV;
- rc = generic_mii_ioctl(&mac->mii, if_mii(rq), cmd, &duplex_changed);
+ if ( mac->mii.phy_id < 0 ) {
+ duplex_changed = 0;
+ rc = -EOPNOTSUPP;
+ } else {
+ rc = generic_mii_ioctl(&mac->mii, if_mii(rq), cmd, &duplex_changed);
+ }
module_put(THIS_MODULE);
if (duplex_changed)
update_duplex_mode(dev);
@@ -488,6 +503,9 @@
static int ixmac_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
{
struct mac_info *mac = netdev_priv(dev);
+ if ( mac->mii.phy_id < 0 ) {
+ return 0;
+ }
mii_ethtool_gset(&mac->mii, cmd);
return 0;
}
@@ -496,6 +514,9 @@
{
struct mac_info *mac = netdev_priv(dev);
int rc;
+ if ( mac->mii.phy_id < 0 ) {
+ return -EOPNOTSUPP;
+ }
rc = mii_ethtool_sset(&mac->mii, cmd);
return rc;
}
@@ -503,12 +524,18 @@
static int ixmac_nway_reset(struct net_device *dev)
{
struct mac_info *mac = netdev_priv(dev);
+ if ( mac->mii.phy_id < 0 ) {
+ return -EOPNOTSUPP;
+ }
return mii_nway_restart(&mac->mii);
}
static u32 ixmac_get_link(struct net_device *dev)
{
struct mac_info *mac = netdev_priv(dev);
+ if ( mac->mii.phy_id < 0 ) {
+ return 1;
+ }
return mii_link_ok(&mac->mii);
}

View File

@@ -0,0 +1,42 @@
Index: linux-2.6.19/arch/arm/mach-ixp4xx/nslu2-setup.c
===================================================================
--- linux-2.6.19.orig/arch/arm/mach-ixp4xx/nslu2-setup.c
+++ linux-2.6.19/arch/arm/mach-ixp4xx/nslu2-setup.c
@@ -137,6 +137,29 @@ static struct platform_device nslu2_uart
.resource = nslu2_uart_resources,
};
+static struct resource res_mac0 = {
+ .start = IXP4XX_EthB_BASE_PHYS,
+ .end = IXP4XX_EthB_BASE_PHYS + 0x1ff,
+ .flags = IORESOURCE_MEM,
+};
+
+static struct mac_plat_info plat_mac0 = {
+ .npe_id = 1,
+ .phy_id = 1,
+ .eth_id = 0,
+ .rxq_id = 27,
+ .txq_id = 24,
+ .rxdoneq_id = 4,
+};
+
+static struct platform_device mac0 = {
+ .name = "ixp4xx_mac",
+ .id = 0,
+ .dev.platform_data = &plat_mac0,
+ .num_resources = 1,
+ .resource = &res_mac0,
+};
+
static struct platform_device *nslu2_devices[] __initdata = {
&nslu2_i2c_controller,
&nslu2_flash,
@@ -144,6 +166,7 @@ static struct platform_device *nslu2_dev
#ifdef CONFIG_LEDS_IXP4XX
&nslu2_leds,
#endif
+ &mac0
};
static void nslu2_power_off(void)

View File

@@ -0,0 +1,41 @@
Index: linux-2.6.19/arch/arm/mach-ixp4xx/nas100d-setup.c
===================================================================
--- linux-2.6.19.orig/arch/arm/mach-ixp4xx/nas100d-setup.c
+++ linux-2.6.19/arch/arm/mach-ixp4xx/nas100d-setup.c
@@ -123,12 +123,36 @@ static struct platform_device nas100d_ua
.resource = nas100d_uart_resources,
};
+static struct resource res_mac0 = {
+ .start = IXP4XX_EthB_BASE_PHYS,
+ .end = IXP4XX_EthB_BASE_PHYS + 0x1ff,
+ .flags = IORESOURCE_MEM,
+};
+
+static struct mac_plat_info plat_mac0 = {
+ .npe_id = 1,
+ .phy_id = 0,
+ .eth_id = 0,
+ .rxq_id = 27,
+ .txq_id = 24,
+ .rxdoneq_id = 4,
+};
+
+static struct platform_device mac0 = {
+ .name = "ixp4xx_mac",
+ .id = 0,
+ .dev.platform_data = &plat_mac0,
+ .num_resources = 1,
+ .resource = &res_mac0,
+};
+
static struct platform_device *nas100d_devices[] __initdata = {
&nas100d_i2c_controller,
&nas100d_flash,
#ifdef CONFIG_LEDS_IXP4XX
&nas100d_leds,
#endif
+ &mac0
};
static void nas100d_power_off(void)

View File

@@ -0,0 +1,35 @@
---
arch/arm/mach-ixp4xx/nslu2-setup.c | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
Index: linux-2.6.19/arch/arm/mach-ixp4xx/nslu2-setup.c
===================================================================
--- linux-2.6.19.orig/arch/arm/mach-ixp4xx/nslu2-setup.c
+++ linux-2.6.19/arch/arm/mach-ixp4xx/nslu2-setup.c
@@ -159,6 +159,16 @@ static struct platform_device mac0 = {
.resource = &res_mac0,
};
+struct npe_ucode_platform_data nslu2_npe_ucode_data = {
+ .mtd_partition = "FIS directory",
+};
+
+static struct platform_device nslu2_npe_ucode = {
+ .name = "ixp4xx_npe_ucode",
+ .id = 0,
+ .dev.platform_data = &nslu2_npe_ucode_data,
+};
+
static struct platform_device *nslu2_devices[] __initdata = {
&nslu2_i2c_controller,
&nslu2_flash,
@@ -166,7 +176,8 @@ static struct platform_device *nslu2_dev
#ifdef CONFIG_LEDS_IXP4XX
&nslu2_leds,
#endif
- &mac0
+ &mac0,
+ &nslu2_npe_ucode,
};
static void nslu2_power_off(void)

View File

@@ -0,0 +1,34 @@
---
arch/arm/mach-ixp4xx/nas100d-setup.c | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
Index: linux-2.6.19/arch/arm/mach-ixp4xx/nas100d-setup.c
===================================================================
--- linux-2.6.19.orig/arch/arm/mach-ixp4xx/nas100d-setup.c
+++ linux-2.6.19/arch/arm/mach-ixp4xx/nas100d-setup.c
@@ -145,13 +145,24 @@ static struct platform_device mac0 = {
.resource = &res_mac0,
};
+struct npe_ucode_platform_data nas100d_npe_ucode_data = {
+ .mtd_partition = "microcode",
+};
+
+static struct platform_device nas100d_npe_ucode = {
+ .name = "ixp4xx_npe_ucode",
+ .id = 0,
+ .dev.platform_data = &nas100d_npe_ucode_data,
+};
+
static struct platform_device *nas100d_devices[] __initdata = {
&nas100d_i2c_controller,
&nas100d_flash,
#ifdef CONFIG_LEDS_IXP4XX
&nas100d_leds,
#endif
- &mac0
+ &mac0,
+ &nas100d_npe_ucode,
};
static void nas100d_power_off(void)

View File

@@ -0,0 +1,56 @@
---
arch/arm/mach-ixp4xx/nas100d-setup.c | 27 +++++++++++++++++++++++++++
1 file changed, 27 insertions(+)
Index: linux-2.6.19/arch/arm/mach-ixp4xx/nas100d-setup.c
===================================================================
--- linux-2.6.19.orig/arch/arm/mach-ixp4xx/nas100d-setup.c
+++ linux-2.6.19/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/mtd/mtd.h>
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
@@ -165,6 +166,30 @@ static struct platform_device *nas100d_d
&nas100d_npe_ucode,
};
+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(plat_mac0.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. */
@@ -196,6 +221,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 @@
---
arch/arm/mach-ixp4xx/nslu2-setup.c | 27 +++++++++++++++++++++++++++
1 file changed, 27 insertions(+)
Index: linux-2.6.19/arch/arm/mach-ixp4xx/nslu2-setup.c
===================================================================
--- linux-2.6.19.orig/arch/arm/mach-ixp4xx/nslu2-setup.c
+++ linux-2.6.19/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/mtd/mtd.h>
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
@@ -180,6 +181,30 @@ static struct platform_device *nslu2_dev
&nslu2_npe_ucode,
};
+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(plat_mac0.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. */
@@ -210,6 +235,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,49 @@
From: Alan Cox <alan@redhat.com>
To: Alessandro Zummo <alessandro.zummo@towertech.it>
Cc: Jeff Garzik <jgarzik@redhat.com>, Alan Cox <alan@redhat.com>
Subject: Re: drivers/ata/pata_artop.c
Date: Sun, 15 Oct 2006 14:25:16 -0400
User-Agent: Mutt/1.4.1i
On Sun, Oct 15, 2006 at 07:18:31PM +0200, Alessandro Zummo wrote:
> In the discovery phase there's a lot of time spent in the detection
> of the second port.
The error recovery is a bit determined right now - Tejun's been doing some
work on SRST behaviour and also for the worst cases polled detect so it
should come out ok
> What's the correct way to inform the driver
> to avoid checking the second port?
Set the number of ports to 1 in your own tree for now. The real fix is
not to go poking at pata ports if the ret is 0xFF
---
drivers/ata/pata_artop.c | 6 ++++++
1 file changed, 6 insertions(+)
Index: linux-2.6.19/drivers/ata/pata_artop.c
===================================================================
--- linux-2.6.19.orig/drivers/ata/pata_artop.c
+++ linux-2.6.19/drivers/ata/pata_artop.c
@@ -26,6 +26,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.2"
@@ -469,6 +470,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 */
+#ifdef CONFIG_MACH_NAS100D
+ if (machine_is_nas100d())
+ ports = 1;
+#endif
}
BUG_ON(info == NULL);

View File

@@ -0,0 +1,927 @@
Index: linux-2.6.20-rc3/drivers/net/via-velocity.c
===================================================================
--- linux-2.6.20-rc3.orig/drivers/net/via-velocity.c 2007-01-02 10:30:25.892465963 +0000
+++ linux-2.6.20-rc3/drivers/net/via-velocity.c 2007-01-02 10:30:36.261113964 +0000
@@ -96,11 +96,31 @@
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 @@
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 @@
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_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 @@
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 @@
{
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 @@
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 @@
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 @@
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 @@
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 @@
*/
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 @@
* 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 @@
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 @@
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 @@
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 @@
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;
}
@@ -935,6 +977,7 @@
dma_addr_t pool_dma;
u8 *pool;
+ HAIL("velocity_init_rings");
/*
* Allocate all RD/TD rings a single pool
*/
@@ -997,6 +1040,7 @@
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;
@@ -1013,6 +1057,7 @@
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)
@@ -1026,7 +1071,8 @@
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);
@@ -1036,12 +1082,14 @@
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) {
@@ -1076,6 +1124,7 @@
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;
@@ -1105,6 +1154,7 @@
{
int i;
+ HAIL("velocity_free_rd_ring");
if (vptr->rd_info == NULL)
return;
@@ -1146,6 +1196,7 @@
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];
@@ -1182,6 +1233,7 @@
struct velocity_td_info * td_info = &(vptr->td_infos[q][n]);
int i;
+ HAIL("velocity_free_td_ring_entry");
if (td_info == NULL)
return;
@@ -1211,6 +1263,7 @@
{
int i, j;
+ HAIL("velocity_free_td_ring");
for (j = 0; j < vptr->num_txq; j++) {
if (vptr->td_infos[j] == NULL)
continue;
@@ -1238,34 +1291,42 @@
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;
@@ -1296,13 +1357,21 @@
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;
}
}
@@ -1328,9 +1397,11 @@
{
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 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 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;
@@ -1408,7 +1489,8 @@
*/
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;
}
@@ -1452,6 +1534,7 @@
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;
@@ -1469,10 +1552,14 @@
*/
*((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;
}
@@ -1493,9 +1580,11 @@
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) {
@@ -1506,22 +1595,29 @@
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++;
@@ -1610,6 +1706,7 @@
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;
@@ -1699,6 +1796,7 @@
struct sk_buff *skb = tdinfo->skb;
int i;
+ HAIL("velocity_free_tx_buf");
/*
* Don't unmap the pre-allocated tx_bufs
*/
@@ -1902,6 +2000,7 @@
struct velocity_td_info *tdinfo;
unsigned long flags;
int index;
+ u32 lbufsz; /* BE */
int pktlen = skb->len;
@@ -1918,9 +2017,18 @@
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.
@@ -1932,20 +2040,35 @@
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) {
memcpy(tdinfo->buf, skb->data, 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;
@@ -1962,6 +2085,7 @@
/* 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++) {
@@ -1979,7 +2103,7 @@
}
} else
-#endif
+#endif /* (broken) VELOCITY_ZERO_COPY_SUPPORT */
{
/*
* Map the linear network buffer into PCI space and
@@ -1987,19 +2111,30 @@
*/
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 */
}
/*
@@ -2009,26 +2144,34 @@
&& (skb->ip_summed == CHECKSUM_PARTIAL)) {
struct iphdr *ip = skb->nh.iph;
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;
@@ -2054,7 +2197,7 @@
u32 isr_status;
int max_count = 0;
-
+ HAIL("velocity_intr");
spin_lock(&vptr->lock);
isr_status = mac_read_isr(vptr->mac_regs);
@@ -2073,7 +2216,10 @@
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);
@@ -2111,6 +2257,7 @@
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]);
@@ -2154,6 +2301,7 @@
{
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;
@@ -2198,6 +2346,7 @@
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 */
@@ -2416,6 +2565,7 @@
{
u16 ww;
+ HAIL("velocity_mii_read");
/*
* Disable MIICR_MAUTO, so that mii addr can be set normally
*/
@@ -2452,6 +2602,7 @@
{
u16 ww;
+ HAIL("velocity_mii_write");
/*
* Disable MIICR_MAUTO, so that mii addr can be set normally
*/
Index: linux-2.6.20-rc3/drivers/net/via-velocity.h
===================================================================
--- linux-2.6.20-rc3.orig/drivers/net/via-velocity.h 2006-11-29 21:57:37.000000000 +0000
+++ linux-2.6.20-rc3/drivers/net/via-velocity.h 2007-01-02 10:30:36.265114211 +0000
@@ -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 @@
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 @@
};
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,54 @@
Index: linux-2.6.19/arch/arm/mach-ixp4xx/nslu2-setup.c
===================================================================
--- linux-2.6.19.orig/arch/arm/mach-ixp4xx/nslu2-setup.c
+++ linux-2.6.19/arch/arm/mach-ixp4xx/nslu2-setup.c
@@ -20,6 +20,7 @@
#include <linux/leds.h>
#include <linux/mtd/mtd.h>
+#include <asm/setup.h>
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
#include <asm/mach/flash.h>
@@ -239,11 +240,41 @@ static void __init nslu2_init(void)
register_mtd_user(&nslu2_flash_notifier);
}
+static char nslu2_rtc_probe[] __initdata = "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;
+}
+
MACHINE_START(NSLU2, "Linksys NSLU2")
/* Maintainer: www.nslu2-linux.org */
.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 = &ixp4xx_timer,

View File

@@ -0,0 +1,55 @@
Index: linux-2.6.19/arch/arm/mach-ixp4xx/nas100d-setup.c
===================================================================
--- linux-2.6.19.orig/arch/arm/mach-ixp4xx/nas100d-setup.c
+++ linux-2.6.19/arch/arm/mach-ixp4xx/nas100d-setup.c
@@ -18,6 +18,7 @@
#include <linux/leds.h>
#include <linux/mtd/mtd.h>
+#include <asm/setup.h>
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
#include <asm/mach/flash.h>
@@ -225,11 +226,42 @@ static void __init nas100d_init(void)
register_mtd_user(&nas100d_flash_notifier);
}
+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;
+}
+
MACHINE_START(NAS100D, "Iomega NAS 100d")
/* Maintainer: www.nslu2-linux.org */
.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,57 @@
Index: linux-2.6.21-arm/arch/arm/mach-ixp4xx/dsmg600-setup.c
===================================================================
--- linux-2.6.21-arm.orig/arch/arm/mach-ixp4xx/dsmg600-setup.c 2007-05-07 11:29:44.000000000 -0700
+++ linux-2.6.21-arm/arch/arm/mach-ixp4xx/dsmg600-setup.c 2007-05-07 11:31:15.000000000 -0700
@@ -15,6 +15,7 @@
#include <linux/serial.h>
#include <linux/serial_8250.h>
+#include <asm/setup.h>
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
#include <asm/mach/flash.h>
@@ -142,6 +143,36 @@
.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();
@@ -174,6 +205,7 @@
.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,250 @@
diff -Nur linux-2.6.19.2/arch/arm/boot/compressed/head-xscale.S linux-2.6.19.2-owrt/arch/arm/boot/compressed/head-xscale.S
--- linux-2.6.19.2/arch/arm/boot/compressed/head-xscale.S 2007-01-10 20:10:37.000000000 +0100
+++ linux-2.6.19.2-owrt/arch/arm/boot/compressed/head-xscale.S 2007-04-02 15:39:28.000000000 +0200
@@ -46,6 +46,11 @@
orr r7, r7, #(MACH_TYPE_GTWX5715 & 0xff00)
#endif
+#ifdef CONFIG_MACH_GATEWAY7001
+ mov r7, #(MACH_TYPE_GATEWAY7001 & 0xff)
+ orr r7, r7, #(MACH_TYPE_GATEWAY7001 & 0xff00)
+#endif
+
#ifdef CONFIG_ARCH_IXP2000
mov r1, #-1
mov r0, #0xd6000000
diff -Nur linux-2.6.19.2/arch/arm/mach-ixp4xx/gateway7001-pci.c linux-2.6.19.2-owrt/arch/arm/mach-ixp4xx/gateway7001-pci.c
--- linux-2.6.19.2/arch/arm/mach-ixp4xx/gateway7001-pci.c 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.19.2-owrt/arch/arm/mach-ixp4xx/gateway7001-pci.c 2007-04-02 15:39:28.000000000 +0200
@@ -0,0 +1,68 @@
+/*
+ * arch/arch/mach-ixp4xx/gateway7001-pci.c
+ *
+ * PCI setup routines for Gateway 7001
+ *
+ * Copyright (C) 2006 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 gateway7001_pci_preinit(void)
+{
+ set_irq_type(IRQ_IXP4XX_GPIO10, IRQT_LOW);
+ set_irq_type(IRQ_IXP4XX_GPIO11, IRQT_LOW);
+
+ ixp4xx_pci_preinit();
+}
+
+static int __init gateway7001_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 return -1;
+}
+
+struct hw_pci gateway7001_pci __initdata = {
+ .nr_controllers = 1,
+ .preinit = gateway7001_pci_preinit,
+ .swizzle = pci_std_swizzle,
+ .setup = ixp4xx_setup,
+ .scan = ixp4xx_scan_bus,
+ .map_irq = gateway7001_map_irq,
+};
+
+int __init gateway7001_pci_init(void)
+{
+ if (machine_is_gateway7001())
+ pci_common_init(&gateway7001_pci);
+ return 0;
+}
+
+subsys_initcall(gateway7001_pci_init);
diff -Nur linux-2.6.19.2/arch/arm/mach-ixp4xx/gateway7001-setup.c linux-2.6.19.2-owrt/arch/arm/mach-ixp4xx/gateway7001-setup.c
--- linux-2.6.19.2/arch/arm/mach-ixp4xx/gateway7001-setup.c 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.19.2-owrt/arch/arm/mach-ixp4xx/gateway7001-setup.c 2007-04-02 15:49:28.000000000 +0200
@@ -0,0 +1,108 @@
+/*
+ * arch/arm/mach-ixp4xx/gateway7001-setup.c
+ *
+ * Board setup for the Gateway 7001 board
+ *
+ * Copyright (C) 2006 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 gateway7001_flash_data = {
+ .map_name = "cfi_probe",
+ .width = 2,
+};
+
+static struct resource gateway7001_flash_resource = {
+ .flags = IORESOURCE_MEM,
+};
+
+static struct platform_device gateway7001_flash = {
+ .name = "IXP4XX-Flash",
+ .id = 0,
+ .dev = {
+ .platform_data = &gateway7001_flash_data,
+ },
+ .num_resources = 1,
+ .resource = &gateway7001_flash_resource,
+};
+
+static struct resource gateway7001_uart_resource = {
+ .start = IXP4XX_UART2_BASE_PHYS,
+ .end = IXP4XX_UART2_BASE_PHYS + 0x0fff,
+ .flags = IORESOURCE_MEM,
+};
+
+static struct plat_serial8250_port gateway7001_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 gateway7001_uart = {
+ .name = "serial8250",
+ .id = PLAT8250_DEV_PLATFORM,
+ .dev = {
+ .platform_data = gateway7001_uart_data,
+ },
+ .num_resources = 1,
+ .resource = &gateway7001_uart_resource,
+};
+
+static struct platform_device *gateway7001_devices[] __initdata = {
+ &gateway7001_flash,
+ &gateway7001_uart
+};
+
+static void __init gateway7001_init(void)
+{
+ ixp4xx_sys_init();
+
+ gateway7001_flash_resource.start = IXP4XX_EXP_BUS_BASE(0);
+ gateway7001_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(gateway7001_devices, ARRAY_SIZE(gateway7001_devices));
+}
+
+#ifdef CONFIG_MACH_GATEWAY7001
+MACHINE_START(GATEWAY7001, "Gateway 7001 AP")
+ /* 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 = gateway7001_init,
+MACHINE_END
+#endif
diff -Nur linux-2.6.19.2/arch/arm/mach-ixp4xx/Kconfig linux-2.6.19.2-owrt/arch/arm/mach-ixp4xx/Kconfig
--- linux-2.6.19.2/arch/arm/mach-ixp4xx/Kconfig 2007-01-10 20:10:37.000000000 +0100
+++ linux-2.6.19.2-owrt/arch/arm/mach-ixp4xx/Kconfig 2007-04-02 15:39:28.000000000 +0200
@@ -33,6 +33,14 @@
Engineering Coyote Gateway Reference Platform. For more
information on this platform, see <file:Documentation/arm/IXP4xx>.
+config MACH_GATEWAY7001
+ bool "Gateway 7001"
+ select PCI
+ help
+ Say 'Y' here if you want your kernel to support Gateway's
+ 7001 Access Point. For more information on this platform,
+ see http://openwrt.org
+
config ARCH_IXDP425
bool "IXDP425"
help
diff -Nur linux-2.6.19.2/arch/arm/mach-ixp4xx/Makefile linux-2.6.19.2-owrt/arch/arm/mach-ixp4xx/Makefile
--- linux-2.6.19.2/arch/arm/mach-ixp4xx/Makefile 2007-01-10 20:10:37.000000000 +0100
+++ linux-2.6.19.2-owrt/arch/arm/mach-ixp4xx/Makefile 2007-04-02 15:49:49.000000000 +0200
@@ -11,6 +11,7 @@
obj-pci-$(CONFIG_MACH_NSLU2) += nslu2-pci.o
obj-pci-$(CONFIG_MACH_NAS100D) += nas100d-pci.o
obj-pci-$(CONFIG_MACH_DSMG600) += dsmg600-pci.o
+obj-pci-$(CONFIG_MACH_GATEWAY7001) += gateway7001-pci.o
obj-y += common.o
@@ -20,5 +21,6 @@
obj-$(CONFIG_MACH_NSLU2) += nslu2-setup.o nslu2-power.o
obj-$(CONFIG_MACH_NAS100D) += nas100d-setup.o nas100d-power.o
obj-$(CONFIG_MACH_DSMG600) += dsmg600-setup.o dsmg600-power.o
+obj-$(CONFIG_MACH_GATEWAY7001) += gateway7001-setup.o
obj-$(CONFIG_PCI) += $(obj-pci-$(CONFIG_PCI)) common-pci.o
diff -Nur linux-2.6.19.2/include/asm-arm/arch-ixp4xx/uncompress.h linux-2.6.19.2-owrt/include/asm-arm/arch-ixp4xx/uncompress.h
--- linux-2.6.19.2/include/asm-arm/arch-ixp4xx/uncompress.h 2007-01-10 20:10:37.000000000 +0100
+++ linux-2.6.19.2-owrt/include/asm-arm/arch-ixp4xx/uncompress.h 2007-04-02 15:42:04.000000000 +0200
@@ -38,9 +38,9 @@
static __inline__ void __arch_decomp_setup(unsigned long arch_id)
{
/*
- * Coyote and gtwx5715 only have UART2 connected
+ * Some boards are using UART2 as console
*/
- if (machine_is_adi_coyote() || machine_is_gtwx5715())
+ if (machine_is_adi_coyote() || machine_is_gtwx5715() || machine_is_gateway7001())
uart_base = (volatile u32*) IXP4XX_UART2_BASE_PHYS;
else
uart_base = (volatile u32*) IXP4XX_UART1_BASE_PHYS;

View File

@@ -0,0 +1,62 @@
diff -Nur linux-2.6.19.2/arch/arm/mach-ixp4xx/gateway7001-setup.c linux-2.6.19.2-owrt/arch/arm/mach-ixp4xx/gateway7001-setup.c
--- linux-2.6.19.2/arch/arm/mach-ixp4xx/gateway7001-setup.c 2007-04-02 15:56:39.000000000 +0200
+++ linux-2.6.19.2-owrt/arch/arm/mach-ixp4xx/gateway7001-setup.c 2007-04-02 15:57:38.000000000 +0200
@@ -76,9 +76,57 @@
.resource = &gateway7001_uart_resource,
};
+static struct resource res_mac0 = {
+ .start = IXP4XX_EthB_BASE_PHYS,
+ .end = IXP4XX_EthB_BASE_PHYS + 0x1ff,
+ .flags = IORESOURCE_MEM,
+};
+
+static struct resource res_mac1 = {
+ .start = IXP4XX_EthC_BASE_PHYS,
+ .end = IXP4XX_EthC_BASE_PHYS + 0x1ff,
+ .flags = IORESOURCE_MEM,
+};
+
+static struct mac_plat_info plat_mac0 = {
+ .npe_id = 1,
+ .phy_id = 1,
+ .eth_id = 0,
+ .rxq_id = 27,
+ .txq_id = 24,
+ .rxdoneq_id = 4,
+};
+
+static struct mac_plat_info plat_mac1 = {
+ .npe_id = 2,
+ .phy_id = 2,
+ .eth_id = 1,
+ .rxq_id = 28,
+ .txq_id = 25,
+ .rxdoneq_id = 5,
+};
+
+static struct platform_device mac0 = {
+ .name = "ixp4xx_mac",
+ .id = 0,
+ .dev.platform_data = &plat_mac0,
+ .num_resources = 1,
+ .resource = &res_mac0,
+};
+
+static struct platform_device mac1 = {
+ .name = "ixp4xx_mac",
+ .id = 1,
+ .dev.platform_data = &plat_mac1,
+ .num_resources = 1,
+ .resource = &res_mac1,
+};
+
static struct platform_device *gateway7001_devices[] __initdata = {
&gateway7001_flash,
- &gateway7001_uart
+ &gateway7001_uart,
+ &mac0,
+ &mac1,
};
static void __init gateway7001_init(void)

View File

@@ -0,0 +1,67 @@
--- linux-2.6.21.5/arch/arm/mach-ixp4xx/gateway7001-setup.c.orig 2007-06-19 18:03:37.202848276 +0100
+++ linux-2.6.21.5/arch/arm/mach-ixp4xx/gateway7001-setup.c 2007-06-19 18:09:04.152969985 +0100
@@ -16,6 +16,7 @@
#include <linux/device.h>
#include <linux/serial.h>
#include <linux/tty.h>
+#include <linux/mtd/mtd.h>
#include <linux/serial_8250.h>
#include <linux/slab.h>
@@ -122,11 +123,48 @@
.resource = &res_mac1,
};
+struct npe_ucode_platform_data gateway7001_npe_ucode_data = {
+ .mtd_partition = "microcode",
+};
+
+static struct platform_device gateway7001_npe_ucode = {
+ .name = "ixp4xx_npe_ucode",
+ .id = 0,
+ .dev.platform_data = &gateway7001_npe_ucode_data,
+};
+
static struct platform_device *gateway7001_devices[] __initdata = {
&gateway7001_flash,
&gateway7001_uart,
&mac0,
&mac1,
+ &gateway7001_npe_ucode,
+};
+
+static void gateway7001_flash_add(struct mtd_info *mtd)
+{
+ if (strcmp(mtd->name, "RedBoot config") == 0) {
+ size_t retlen;
+ u_char mac0[6], mac1[6];
+ if (mtd->read(mtd, 0x0422, 6, &retlen, mac0) == 0 && retlen == 6) {
+ printk(KERN_INFO "gateway 7001 mac0: %.2x:%.2x:%.2x:%.2x:%.2x:%.2x\n",
+ mac0[0], mac0[1], mac0[2], mac0[3], mac0[4], mac0[5]);
+ memcpy(plat_mac0.hwaddr, mac0, 6);
+ }
+ if (mtd->read(mtd, 0x043B, 6, &retlen, mac1) == 0 && retlen == 6) {
+ printk(KERN_INFO "gateway 7001 mac1: %.2x:%.2x:%.2x:%.2x:%.2x:%.2x\n",
+ mac1[0], mac1[1], mac1[2], mac1[3], mac1[4], mac1[5]);
+ memcpy(plat_mac1.hwaddr, mac1, 6);
+ }
+ }
+}
+
+static void gateway7001_flash_remove(struct mtd_info *mtd) {
+}
+
+static struct mtd_notifier gateway7001_flash_notifier = {
+ .add = gateway7001_flash_add,
+ .remove = gateway7001_flash_remove,
};
static void __init gateway7001_init(void)
@@ -140,6 +178,7 @@
*IXP4XX_EXP_CS1 = *IXP4XX_EXP_CS0;
platform_add_devices(gateway7001_devices, ARRAY_SIZE(gateway7001_devices));
+ register_mtd_user(&gateway7001_flash_notifier);
}
#ifdef CONFIG_MACH_GATEWAY7001

View File

@@ -0,0 +1,231 @@
diff -Nur linux-2.6.19.2/arch/arm/mach-ixp4xx/Kconfig linux-2.6.19.2-owrt/arch/arm/mach-ixp4xx/Kconfig
--- linux-2.6.19.2/arch/arm/mach-ixp4xx/Kconfig 2007-04-02 16:09:06.000000000 +0200
+++ linux-2.6.19.2-owrt/arch/arm/mach-ixp4xx/Kconfig 2007-04-02 16:01:25.000000000 +0200
@@ -41,6 +41,14 @@
7001 Access Point. For more information on this platform,
see http://openwrt.org
+config MACH_WG302V2
+ bool "Netgear WG302 v2 / WAG302 v2"
+ select PCI
+ help
+ Say 'Y' here if you want your kernel to support Netgear's
+ WG302 v2 or WAG302 v2 Access Points. For more information
+ on this platform, see http://openwrt.org
+
config ARCH_IXDP425
bool "IXDP425"
help
diff -Nur linux-2.6.19.2/arch/arm/mach-ixp4xx/Makefile linux-2.6.19.2-owrt/arch/arm/mach-ixp4xx/Makefile
--- linux-2.6.19.2/arch/arm/mach-ixp4xx/Makefile 2007-04-02 16:09:06.000000000 +0200
+++ linux-2.6.19.2-owrt/arch/arm/mach-ixp4xx/Makefile 2007-04-02 16:09:25.000000000 +0200
@@ -12,6 +12,7 @@
obj-pci-$(CONFIG_MACH_NSLU2) += nslu2-pci.o
obj-pci-$(CONFIG_MACH_NAS100D) += nas100d-pci.o
obj-pci-$(CONFIG_MACH_GATEWAY7001) += gateway7001-pci.o
+obj-pci-$(CONFIG_MACH_WG302V2) += wg302v2-pci.o
obj-y += common.o
@@ -22,5 +23,6 @@
obj-$(CONFIG_MACH_NSLU2) += nslu2-setup.o nslu2-power.o
obj-$(CONFIG_MACH_NAS100D) += nas100d-setup.o nas100d-power.o
obj-$(CONFIG_MACH_GATEWAY7001) += gateway7001-setup.o
+obj-$(CONFIG_MACH_WG302V2) += wg302v2-setup.o
obj-$(CONFIG_PCI) += $(obj-pci-$(CONFIG_PCI)) common-pci.o
diff -Nur linux-2.6.19.2/arch/arm/mach-ixp4xx/wg302v2-pci.c linux-2.6.19.2-owrt/arch/arm/mach-ixp4xx/wg302v2-pci.c
--- linux-2.6.19.2/arch/arm/mach-ixp4xx/wg302v2-pci.c 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.19.2-owrt/arch/arm/mach-ixp4xx/wg302v2-pci.c 2007-04-02 16:00:12.000000000 +0200
@@ -0,0 +1,68 @@
+/*
+ * arch/arch/mach-ixp4xx/wg302v2-pci.c
+ *
+ * PCI setup routines for the Netgear WG302 v2 and WAG302 v2
+ *
+ * Copyright (C) 2006 Imre Kaloz <kaloz@openwrt.org>
+ *
+ * based on coyote-pci.c:
+ * Copyright (C) 2002 Jungo Software Technologies.
+ * Copyright (C) 2003 MontaVista Software, 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 wg302v2_pci_preinit(void)
+{
+ set_irq_type(IRQ_IXP4XX_GPIO8, IRQT_LOW);
+ set_irq_type(IRQ_IXP4XX_GPIO9, IRQT_LOW);
+
+ ixp4xx_pci_preinit();
+}
+
+static int __init wg302v2_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
+{
+ if (slot == 1)
+ return IRQ_IXP4XX_GPIO8;
+ else if (slot == 2)
+ return IRQ_IXP4XX_GPIO9;
+ else return -1;
+}
+
+struct hw_pci wg302v2_pci __initdata = {
+ .nr_controllers = 1,
+ .preinit = wg302v2_pci_preinit,
+ .swizzle = pci_std_swizzle,
+ .setup = ixp4xx_setup,
+ .scan = ixp4xx_scan_bus,
+ .map_irq = wg302v2_map_irq,
+};
+
+int __init wg302v2_pci_init(void)
+{
+ if (machine_is_wg302v2())
+ pci_common_init(&wg302v2_pci);
+ return 0;
+}
+
+subsys_initcall(wg302v2_pci_init);
diff -Nur linux-2.6.19.2/arch/arm/mach-ixp4xx/wg302v2-setup.c linux-2.6.19.2-owrt/arch/arm/mach-ixp4xx/wg302v2-setup.c
--- linux-2.6.19.2/arch/arm/mach-ixp4xx/wg302v2-setup.c 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.19.2-owrt/arch/arm/mach-ixp4xx/wg302v2-setup.c 2007-04-02 16:08:57.000000000 +0200
@@ -0,0 +1,107 @@
+/*
+ * arch/arm/mach-ixp4xx/wg302-setup.c
+ *
+ * Board setup for the Netgear WG302 v2 and WAG302 v2
+ *
+ * based on coyote-setup.c:
+ * Copyright (C) 2003-2005 MontaVista Software, Inc.
+ *
+ * Maintainer: 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 wg302v2_flash_data = {
+ .map_name = "cfi_probe",
+ .width = 2,
+};
+
+static struct resource wg302v2_flash_resource = {
+ .flags = IORESOURCE_MEM,
+};
+
+static struct platform_device wg302v2_flash = {
+ .name = "IXP4XX-Flash",
+ .id = 0,
+ .dev = {
+ .platform_data = &wg302v2_flash_data,
+ },
+ .num_resources = 1,
+ .resource = &wg302v2_flash_resource,
+};
+
+static struct resource wg302v2_uart_resource = {
+ .start = IXP4XX_UART2_BASE_PHYS,
+ .end = IXP4XX_UART2_BASE_PHYS + 0x0fff,
+ .flags = IORESOURCE_MEM,
+};
+
+static struct plat_serial8250_port wg302v2_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 wg302v2_uart = {
+ .name = "serial8250",
+ .id = PLAT8250_DEV_PLATFORM,
+ .dev = {
+ .platform_data = wg302v2_uart_data,
+ },
+ .num_resources = 1,
+ .resource = &wg302v2_uart_resource,
+};
+
+static struct platform_device *wg302v2_devices[] __initdata = {
+ &wg302v2_flash,
+ &wg302v2_uart,
+};
+
+static void __init wg302v2_init(void)
+{
+ ixp4xx_sys_init();
+
+ wg302v2_flash_resource.start = IXP4XX_EXP_BUS_BASE(0);
+ wg302v2_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(wg302v2_devices, ARRAY_SIZE(wg302v2_devices));
+}
+
+#ifdef CONFIG_MACH_WG302V2
+MACHINE_START(WG302V2, "Netgear WG302 v2 / WAG302 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 = wg302v2_init,
+MACHINE_END
+#endif
diff -Nur linux-2.6.19.2/include/asm-arm/arch-ixp4xx/uncompress.h linux-2.6.19.2-owrt/include/asm-arm/arch-ixp4xx/uncompress.h
--- linux-2.6.19.2/include/asm-arm/arch-ixp4xx/uncompress.h 2007-04-02 16:09:06.000000000 +0200
+++ linux-2.6.19.2-owrt/include/asm-arm/arch-ixp4xx/uncompress.h 2007-04-02 16:02:04.000000000 +0200
@@ -40,7 +40,7 @@
/*
* Some boards are using UART2 as console
*/
- if (machine_is_adi_coyote() || machine_is_gtwx5715() || machine_is_gateway7001())
+ if (machine_is_adi_coyote() || machine_is_gtwx5715() || machine_is_gateway7001() || machine_is_wg302v2())
uart_base = (volatile u32*) IXP4XX_UART2_BASE_PHYS;
else
uart_base = (volatile u32*) IXP4XX_UART1_BASE_PHYS;

View File

@@ -0,0 +1,37 @@
diff -Nur linux-2.6.19.2/arch/arm/mach-ixp4xx/wg302v2-setup.c linux-2.6.19.2-owrt/arch/arm/mach-ixp4xx/wg302v2-setup.c
--- linux-2.6.19.2/arch/arm/mach-ixp4xx/wg302v2-setup.c 2007-04-02 16:06:02.000000000 +0200
+++ linux-2.6.19.2-owrt/arch/arm/mach-ixp4xx/wg302v2-setup.c 2007-03-05 11:57:24.000000000 +0100
@@ -75,9 +75,33 @@
.resource = &wg302v2_uart_resource,
};
+static struct resource res_mac0 = {
+ .start = IXP4XX_EthB_BASE_PHYS,
+ .end = IXP4XX_EthB_BASE_PHYS + 0x1ff,
+ .flags = IORESOURCE_MEM,
+};
+
+static struct mac_plat_info plat_mac0 = {
+ .npe_id = 1,
+ .phy_id = 8,
+ .eth_id = 0,
+ .rxq_id = 27,
+ .txq_id = 24,
+ .rxdoneq_id = 4,
+};
+
+static struct platform_device mac0 = {
+ .name = "ixp4xx_mac",
+ .id = 0,
+ .dev.platform_data = &plat_mac0,
+ .num_resources = 1,
+ .resource = &res_mac0,
+};
+
static struct platform_device *wg302v2_devices[] __initdata = {
&wg302v2_flash,
&wg302v2_uart,
+ &mac0,
};
static void __init wg302v2_init(void)

View File

@@ -0,0 +1,251 @@
diff -Nur linux-2.6.21.1/Documentation/arm/IXP4xx linux-2.6.21.1-owrt/Documentation/arm/IXP4xx
--- linux-2.6.21.1/Documentation/arm/IXP4xx 2007-06-10 13:54:49.000000000 +0200
+++ linux-2.6.21.1-owrt/Documentation/arm/IXP4xx 2007-06-10 13:46:37.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.21.1/arch/arm/mach-ixp4xx/Kconfig linux-2.6.21.1-owrt/arch/arm/mach-ixp4xx/Kconfig
--- linux-2.6.21.1/arch/arm/mach-ixp4xx/Kconfig 2007-06-10 13:54:47.000000000 +0200
+++ linux-2.6.21.1-owrt/arch/arm/mach-ixp4xx/Kconfig 2007-06-10 13:46:37.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.21.1/arch/arm/mach-ixp4xx/Makefile linux-2.6.21.1-owrt/arch/arm/mach-ixp4xx/Makefile
--- linux-2.6.21.1/arch/arm/mach-ixp4xx/Makefile 2007-06-10 13:54:47.000000000 +0200
+++ linux-2.6.21.1-owrt/arch/arm/mach-ixp4xx/Makefile 2007-06-10 13:46:37.000000000 +0200
@@ -14,6 +14,7 @@
obj-pci-$(CONFIG_MACH_NAS100D) += nas100d-pci.o
obj-pci-$(CONFIG_MACH_GATEWAY7001) += gateway7001-pci.o
obj-pci-$(CONFIG_MACH_WG302V2) += wg302v2-pci.o
+obj-pci-$(CONFIG_MACH_PRONGHORNMETRO) += pronghornmetro-pci.o
obj-y += common.o
@@ -26,5 +27,6 @@
obj-$(CONFIG_MACH_NAS100D) += nas100d-setup.o nas100d-power.o
obj-$(CONFIG_MACH_GATEWAY7001) += gateway7001-setup.o
obj-$(CONFIG_MACH_WG302V2) += wg302v2-setup.o
+obj-$(CONFIG_MACH_PRONGHORNMETRO) += pronghornmetro-setup.o
obj-$(CONFIG_PCI) += $(obj-pci-$(CONFIG_PCI)) common-pci.o
diff -Nur linux-2.6.21.1/arch/arm/mach-ixp4xx/pronghornmetro-pci.c linux-2.6.21.1-owrt/arch/arm/mach-ixp4xx/pronghornmetro-pci.c
--- linux-2.6.21.1/arch/arm/mach-ixp4xx/pronghornmetro-pci.c 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.21.1-owrt/arch/arm/mach-ixp4xx/pronghornmetro-pci.c 2007-06-10 13:50:08.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.21.1/arch/arm/mach-ixp4xx/pronghornmetro-setup.c linux-2.6.21.1-owrt/arch/arm/mach-ixp4xx/pronghornmetro-setup.c
--- linux-2.6.21.1/arch/arm/mach-ixp4xx/pronghornmetro-setup.c 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.21.1-owrt/arch/arm/mach-ixp4xx/pronghornmetro-setup.c 2007-06-10 13:51:51.000000000 +0200
@@ -0,0 +1,108 @@
+/*
+ * 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 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));
+}
+
+#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.21.1/include/asm-arm/arch-ixp4xx/uncompress.h linux-2.6.21.1-owrt/include/asm-arm/arch-ixp4xx/uncompress.h
--- linux-2.6.21.1/include/asm-arm/arch-ixp4xx/uncompress.h 2007-06-10 13:54:52.000000000 +0200
+++ linux-2.6.21.1-owrt/include/asm-arm/arch-ixp4xx/uncompress.h 2007-06-10 13:49:37.000000000 +0200
@@ -40,7 +40,7 @@
/*
* Some boards are using UART2 as console
*/
- if (machine_is_adi_coyote() || machine_is_gtwx5715() || machine_is_gateway7001() || machine_is_wg302v2())
+ if (machine_is_adi_coyote() || machine_is_gtwx5715() || 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,61 @@
diff -Nur linux-2.6.21.1/arch/arm/mach-ixp4xx/pronghornmetro-setup.c linux-2.6.21.1-owrt/arch/arm/mach-ixp4xx/pronghornmetro-setup.c
--- linux-2.6.21.1/arch/arm/mach-ixp4xx/pronghornmetro-setup.c 2007-06-10 14:05:47.000000000 +0200
+++ linux-2.6.21.1-owrt/arch/arm/mach-ixp4xx/pronghornmetro-setup.c 2007-06-10 14:05:38.000000000 +0200
@@ -76,9 +76,57 @@
.resource = &pronghornmetro_uart_resource,
};
+static struct resource res_mac0 = {
+ .start = IXP4XX_EthB_BASE_PHYS,
+ .end = IXP4XX_EthB_BASE_PHYS + 0x1ff,
+ .flags = IORESOURCE_MEM,
+};
+
+static struct resource res_mac1 = {
+ .start = IXP4XX_EthC_BASE_PHYS,
+ .end = IXP4XX_EthC_BASE_PHYS + 0x1ff,
+ .flags = IORESOURCE_MEM,
+};
+
+static struct mac_plat_info plat_mac0 = {
+ .npe_id = 1,
+ .phy_id = 0,
+ .eth_id = 0,
+ .rxq_id = 27,
+ .txq_id = 24,
+ .rxdoneq_id = 4,
+};
+
+static struct mac_plat_info plat_mac1 = {
+ .npe_id = 2,
+ .phy_id = 1,
+ .eth_id = 1,
+ .rxq_id = 28,
+ .txq_id = 25,
+ .rxdoneq_id = 5,
+};
+
+static struct platform_device mac0 = {
+ .name = "ixp4xx_mac",
+ .id = 0,
+ .dev.platform_data = &plat_mac0,
+ .num_resources = 1,
+ .resource = &res_mac0,
+};
+
+static struct platform_device mac1 = {
+ .name = "ixp4xx_mac",
+ .id = 1,
+ .dev.platform_data = &plat_mac1,
+ .num_resources = 1,
+ .resource = &res_mac1,
+};
+
static struct platform_device *pronghornmetro_devices[] __initdata = {
&pronghornmetro_flash,
&pronghornmetro_uart,
+ &mac0,
+ &mac1,
};
static void __init pronghornmetro_init(void)

View File

@@ -0,0 +1,55 @@
diff -Nur linux-2.6.21.1/arch/arm/mach-ixp4xx/pronghornmetro-setup.c linux-2.6.21.1-owrt/arch/arm/mach-ixp4xx/pronghornmetro-setup.c
--- linux-2.6.21.1/arch/arm/mach-ixp4xx/pronghornmetro-setup.c 2007-06-10 14:10:24.000000000 +0200
+++ linux-2.6.21.1-owrt/arch/arm/mach-ixp4xx/pronghornmetro-setup.c 2007-06-10 14:10:15.000000000 +0200
@@ -17,6 +17,7 @@
#include <linux/serial.h>
#include <linux/tty.h>
#include <linux/serial_8250.h>
+#include <linux/mtd/mtd.h>
#include <linux/slab.h>
#include <asm/types.h>
@@ -122,11 +123,34 @@
.resource = &res_mac1,
};
+struct npe_ucode_platform_data pronghornmetro_npe_ucode_data = {
+ .mtd_partition = "RedBoot",
+};
+
+static struct platform_device pronghornmetro_npe_ucode = {
+ .name = "ixp4xx_npe_ucode",
+ .id = 0,
+ .dev.platform_data = &pronghornmetro_npe_ucode_data,
+};
+
static struct platform_device *pronghornmetro_devices[] __initdata = {
&pronghornmetro_flash,
&pronghornmetro_uart,
&mac0,
&mac1,
+ &pronghornmetro_npe_ucode,
+};
+
+static void pronghornmetro_flash_add(struct mtd_info *mtd)
+{
+}
+
+static void pronghornmetro_flash_remove(struct mtd_info *mtd) {
+}
+
+static struct mtd_notifier pronghornmetro_flash_notifier = {
+ .add = pronghornmetro_flash_add,
+ .remove = pronghornmetro_flash_remove,
};
static void __init pronghornmetro_init(void)
@@ -140,6 +164,8 @@
*IXP4XX_EXP_CS1 = *IXP4XX_EXP_CS0;
platform_add_devices(pronghornmetro_devices, ARRAY_SIZE(pronghornmetro_devices));
+
+ register_mtd_user(&pronghornmetro_flash_notifier);
}
#ifdef CONFIG_MACH_PRONGHORNMETRO

View File

@@ -0,0 +1,57 @@
diff -Nur linux-2.6.21.1/arch/arm/mach-ixp4xx/pronghornmetro-setup.c linux-2.6.21.1-owrt/arch/arm/mach-ixp4xx/pronghornmetro-setup.c
--- linux-2.6.21.1/arch/arm/mach-ixp4xx/pronghornmetro-setup.c 2007-06-10 14:31:27.000000000 +0200
+++ linux-2.6.21.1-owrt/arch/arm/mach-ixp4xx/pronghornmetro-setup.c 2007-06-10 14:36:23.000000000 +0200
@@ -77,6 +77,35 @@
.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 resource res_mac0 = {
.start = IXP4XX_EthB_BASE_PHYS,
.end = IXP4XX_EthB_BASE_PHYS + 0x1ff,
@@ -165,6 +194,17 @@
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);
+
register_mtd_user(&pronghornmetro_flash_notifier);
}

View File

@@ -0,0 +1,184 @@
diff -Nur linux-2.6.19.2/arch/arm/mach-ixp4xx/compex-setup.c linux-2.6.19.2-owrt/arch/arm/mach-ixp4xx/compex-setup.c
--- linux-2.6.19.2/arch/arm/mach-ixp4xx/compex-setup.c 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.19.2-owrt/arch/arm/mach-ixp4xx/compex-setup.c 2007-04-10 01:56:21.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) + ixp4xx_exp_bus_size - 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.19.2/arch/arm/mach-ixp4xx/ixdp425-pci.c linux-2.6.19.2-owrt/arch/arm/mach-ixp4xx/ixdp425-pci.c
--- linux-2.6.19.2/arch/arm/mach-ixp4xx/ixdp425-pci.c 2007-01-10 20:10:37.000000000 +0100
+++ linux-2.6.19.2-owrt/arch/arm/mach-ixp4xx/ixdp425-pci.c 2007-04-10 00:22:16.000000000 +0200
@@ -66,7 +66,7 @@
int __init ixdp425_pci_init(void)
{
if (machine_is_ixdp425() || machine_is_ixcdp1100() ||
- machine_is_ixdp465())
+ machine_is_ixdp465() || machine_is_compex())
pci_common_init(&ixdp425_pci);
return 0;
}
diff -Nur linux-2.6.19.2/arch/arm/mach-ixp4xx/Kconfig linux-2.6.19.2-owrt/arch/arm/mach-ixp4xx/Kconfig
--- linux-2.6.19.2/arch/arm/mach-ixp4xx/Kconfig 2007-04-10 00:33:31.000000000 +0200
+++ linux-2.6.19.2-owrt/arch/arm/mach-ixp4xx/Kconfig 2007-04-10 00:48:37.000000000 +0200
@@ -57,6 +57,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.19.2/arch/arm/mach-ixp4xx/Makefile linux-2.6.19.2-owrt/arch/arm/mach-ixp4xx/Makefile
--- linux-2.6.19.2/arch/arm/mach-ixp4xx/Makefile 2007-04-10 00:33:39.000000000 +0200
+++ linux-2.6.19.2-owrt/arch/arm/mach-ixp4xx/Makefile 2007-04-09 20:23:06.000000000 +0200
@@ -14,6 +14,7 @@
obj-pci-$(CONFIG_MACH_GATEWAY7001) += gateway7001-pci.o
obj-pci-$(CONFIG_MACH_WG302V2) += wg302v2-pci.o
obj-pci-$(CONFIG_MACH_PRONGHORNMETRO) += pronghornmetro-pci.o
+obj-pci-$(CONFIG_MACH_COMPEX) += ixdp425-pci.o
obj-y += common.o
@@ -26,5 +27,6 @@
obj-$(CONFIG_MACH_GATEWAY7001) += gateway7001-setup.o
obj-$(CONFIG_MACH_WG302V2) += wg302v2-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
diff -Nur linux-2.6.19.2/arch/arm/tools/mach-types linux-2.6.19.2-owrt/arch/arm/tools/mach-types
--- linux-2.6.19.2/arch/arm/tools/mach-types 2007-04-10 01:27:55.000000000 +0200
+++ linux-2.6.19.2-owrt/arch/arm/tools/mach-types 2007-04-09 20:22:33.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,62 @@
diff -Nur linux-2.6.19.2/arch/arm/mach-ixp4xx/compex-setup.c linux-2.6.19.2-owrt/arch/arm/mach-ixp4xx/compex-setup.c
--- linux-2.6.19.2/arch/arm/mach-ixp4xx/compex-setup.c 2007-04-09 20:30:37.000000000 +0200
+++ linux-2.6.19.2-owrt/arch/arm/mach-ixp4xx/compex-setup.c 2007-04-09 20:36:23.000000000 +0200
@@ -90,9 +90,57 @@
.resource = compex_uart_resources
};
+static struct resource res_mac0 = {
+ .start = IXP4XX_EthB_BASE_PHYS,
+ .end = IXP4XX_EthB_BASE_PHYS + 0x1ff,
+ .flags = IORESOURCE_MEM,
+};
+
+static struct resource res_mac1 = {
+ .start = IXP4XX_EthC_BASE_PHYS,
+ .end = IXP4XX_EthC_BASE_PHYS + 0x1ff,
+ .flags = IORESOURCE_MEM,
+};
+
+static struct mac_plat_info plat_mac0 = {
+ .npe_id = 1,
+ .phy_id = -1,
+ .eth_id = 0,
+ .rxq_id = 27,
+ .txq_id = 24,
+ .rxdoneq_id = 4,
+};
+
+static struct mac_plat_info plat_mac1 = {
+ .npe_id = 2,
+ .phy_id = 3,
+ .eth_id = 1,
+ .rxq_id = 28,
+ .txq_id = 25,
+ .rxdoneq_id = 5,
+};
+
+static struct platform_device mac0 = {
+ .name = "ixp4xx_mac",
+ .id = 0,
+ .dev.platform_data = &plat_mac0,
+ .num_resources = 1,
+ .resource = &res_mac0,
+};
+
+static struct platform_device mac1 = {
+ .name = "ixp4xx_mac",
+ .id = 1,
+ .dev.platform_data = &plat_mac1,
+ .num_resources = 1,
+ .resource = &res_mac1,
+};
+
static struct platform_device *compex_devices[] __initdata = {
&compex_flash,
- &compex_uart
+ &compex_uart,
+ &mac0,
+ &mac1,
};
static void __init compex_init(void)

View File

@@ -0,0 +1,55 @@
diff -Nur linux-2.6.19.2/arch/arm/mach-ixp4xx/compex-setup.c linux-2.6.19.2-owrt/arch/arm/mach-ixp4xx/compex-setup.c
--- linux-2.6.19.2/arch/arm/mach-ixp4xx/compex-setup.c 2007-04-09 20:51:57.000000000 +0200
+++ linux-2.6.19.2-owrt/arch/arm/mach-ixp4xx/compex-setup.c 2007-04-09 21:48:22.000000000 +0200
@@ -17,6 +17,7 @@
#include <linux/serial.h>
#include <linux/tty.h>
#include <linux/serial_8250.h>
+#include <linux/mtd/mtd.h>
#include <linux/slab.h>
#include <asm/types.h>
@@ -136,11 +137,34 @@
.resource = &res_mac1,
};
+struct npe_ucode_platform_data compex_npe_ucode_data = {
+ .mtd_partition = "RedBoot",
+};
+
+static struct platform_device compex_npe_ucode = {
+ .name = "ixp4xx_npe_ucode",
+ .id = 0,
+ .dev.platform_data = &compex_npe_ucode_data,
+};
+
static struct platform_device *compex_devices[] __initdata = {
&compex_flash,
&compex_uart,
&mac0,
&mac1,
+ &compex_npe_ucode,
+};
+
+static void compex_flash_add(struct mtd_info *mtd)
+{
+}
+
+static void compex_flash_remove(struct mtd_info *mtd) {
+}
+
+static struct mtd_notifier compex_flash_notifier = {
+ .add = compex_flash_add,
+ .remove = compex_flash_remove,
};
static void __init compex_init(void)
@@ -152,6 +176,8 @@
IXP4XX_EXP_BUS_BASE(0) + ixp4xx_exp_bus_size - 1;
platform_add_devices(compex_devices, ARRAY_SIZE(compex_devices));
+
+ register_mtd_user(&compex_flash_notifier);
}
#ifdef CONFIG_ARCH_COMPEX

View File

@@ -0,0 +1,229 @@
diff -Nur linux-2.6.19.2/arch/arm/mach-ixp4xx/Kconfig linux-2.6.19.2-owrt/arch/arm/mach-ixp4xx/Kconfig
--- linux-2.6.19.2/arch/arm/mach-ixp4xx/Kconfig 2007-05-03 23:17:47.000000000 +0200
+++ linux-2.6.19.2-owrt/arch/arm/mach-ixp4xx/Kconfig 2007-04-24 14:25:02.000000000 +0200
@@ -65,6 +65,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.19.2/arch/arm/mach-ixp4xx/Makefile linux-2.6.19.2-owrt/arch/arm/mach-ixp4xx/Makefile
--- linux-2.6.19.2/arch/arm/mach-ixp4xx/Makefile 2007-05-03 23:17:47.000000000 +0200
+++ linux-2.6.19.2-owrt/arch/arm/mach-ixp4xx/Makefile 2007-04-24 14:25:02.000000000 +0200
@@ -15,6 +15,7 @@
obj-pci-$(CONFIG_MACH_WG302V2) += wg302v2-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
@@ -28,5 +29,6 @@
obj-$(CONFIG_MACH_WG302V2) += wg302v2-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
diff -Nur linux-2.6.19.2/arch/arm/mach-ixp4xx/wrt300nv2-pci.c linux-2.6.19.2-owrt/arch/arm/mach-ixp4xx/wrt300nv2-pci.c
--- linux-2.6.19.2/arch/arm/mach-ixp4xx/wrt300nv2-pci.c 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.19.2-owrt/arch/arm/mach-ixp4xx/wrt300nv2-pci.c 2007-05-10 10:40:54.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.19.2/arch/arm/mach-ixp4xx/wrt300nv2-setup.c linux-2.6.19.2-owrt/arch/arm/mach-ixp4xx/wrt300nv2-setup.c
--- linux-2.6.19.2/arch/arm/mach-ixp4xx/wrt300nv2-setup.c 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.19.2-owrt/arch/arm/mach-ixp4xx/wrt300nv2-setup.c 2007-05-03 23:16:53.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.19.2/include/asm-arm/arch-ixp4xx/uncompress.h linux-2.6.19.2-owrt/include/asm-arm/arch-ixp4xx/uncompress.h
--- linux-2.6.19.2/include/asm-arm/arch-ixp4xx/uncompress.h 2007-05-03 23:17:48.000000000 +0200
+++ linux-2.6.19.2-owrt/include/asm-arm/arch-ixp4xx/uncompress.h 2007-04-24 14:25:02.000000000 +0200
@@ -40,7 +40,7 @@
/*
* Some boards are using UART2 as console
*/
- if (machine_is_adi_coyote() || machine_is_gtwx5715() || machine_is_gateway7001() || machine_is_wg302v2() || machine_is_pronghorn_metro())
+ if (machine_is_adi_coyote() || machine_is_gtwx5715() || machine_is_gateway7001() || machine_is_wg302v2() || 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,62 @@
diff -Nur linux-2.6.19.2/arch/arm/mach-ixp4xx/wrt300nv2-setup.c linux-2.6.19.2-owrt/arch/arm/mach-ixp4xx/wrt300nv2-setup.c
--- linux-2.6.19.2/arch/arm/mach-ixp4xx/wrt300nv2-setup.c 2007-04-24 14:25:02.000000000 +0200
+++ linux-2.6.19.2-owrt/arch/arm/mach-ixp4xx/wrt300nv2-setup.c 2007-04-24 14:31:09.000000000 +0200
@@ -76,9 +76,57 @@
.resource = &wrt300nv2_uart_resource,
};
+static struct resource res_mac0 = {
+ .start = IXP4XX_EthB_BASE_PHYS,
+ .end = IXP4XX_EthB_BASE_PHYS + 0x1ff,
+ .flags = IORESOURCE_MEM,
+};
+
+static struct resource res_mac1 = {
+ .start = IXP4XX_EthC_BASE_PHYS,
+ .end = IXP4XX_EthC_BASE_PHYS + 0x1ff,
+ .flags = IORESOURCE_MEM,
+};
+
+static struct mac_plat_info plat_mac0 = {
+ .npe_id = 1,
+ .phy_id = -1,
+ .eth_id = 0,
+ .rxq_id = 27,
+ .txq_id = 24,
+ .rxdoneq_id = 4,
+};
+
+static struct mac_plat_info plat_mac1 = {
+ .npe_id = 2,
+ .phy_id = 1,
+ .eth_id = 1,
+ .rxq_id = 28,
+ .txq_id = 25,
+ .rxdoneq_id = 5,
+};
+
+static struct platform_device mac0 = {
+ .name = "ixp4xx_mac",
+ .id = 0,
+ .dev.platform_data = &plat_mac0,
+ .num_resources = 1,
+ .resource = &res_mac0,
+};
+
+static struct platform_device mac1 = {
+ .name = "ixp4xx_mac",
+ .id = 1,
+ .dev.platform_data = &plat_mac1,
+ .num_resources = 1,
+ .resource = &res_mac1,
+};
+
static struct platform_device *wrt300nv2_devices[] __initdata = {
&wrt300nv2_flash,
- &wrt300nv2_uart
+ &wrt300nv2_uart,
+ &mac0,
+ &mac1,
};
static void __init wrt300nv2_init(void)

View File

@@ -0,0 +1,70 @@
---
arch/arm/mach-ixp4xx/avila-setup.c | 50 ++++++++++++++++++++++++++++++++++++-
1 file changed, 49 insertions(+), 1 deletion(-)
Index: linux-2.6.19/arch/arm/mach-ixp4xx/avila-setup.c
===================================================================
--- linux-2.6.19.orig/arch/arm/mach-ixp4xx/avila-setup.c
+++ linux-2.6.19/arch/arm/mach-ixp4xx/avila-setup.c
@@ -104,10 +104,60 @@ static struct platform_device avila_uart
.resource = avila_uart_resources
};
+/* MACs */
+static struct resource res_mac0 = {
+ .start = IXP4XX_EthB_BASE_PHYS,
+ .end = IXP4XX_EthB_BASE_PHYS + 0x1ff,
+ .flags = IORESOURCE_MEM,
+};
+
+static struct resource res_mac1 = {
+ .start = IXP4XX_EthC_BASE_PHYS,
+ .end = IXP4XX_EthC_BASE_PHYS + 0x1ff,
+ .flags = IORESOURCE_MEM,
+};
+
+static struct mac_plat_info plat_mac0 = {
+ .npe_id = 1,
+ .phy_id = 0,
+ .eth_id = 0,
+ .rxq_id = 27,
+ .txq_id = 24,
+ .rxdoneq_id = 4,
+};
+
+static struct mac_plat_info plat_mac1 = {
+ .npe_id = 2,
+ .phy_id = 1,
+ .eth_id = 1,
+ .rxq_id = 28,
+ .txq_id = 25,
+ .rxdoneq_id = 5,
+};
+
+static struct platform_device mac0 = {
+ .name = "ixp4xx_mac",
+ .id = 0,
+ .dev.platform_data = &plat_mac0,
+ .num_resources = 1,
+ .resource = &res_mac0,
+};
+
+static struct platform_device mac1 = {
+ .name = "ixp4xx_mac",
+ .id = 1,
+ .dev.platform_data = &plat_mac1,
+ .num_resources = 1,
+ .resource = &res_mac1,
+};
+
static struct platform_device *avila_devices[] __initdata = {
&avila_i2c_controller,
&avila_flash,
- &avila_uart
+ &avila_uart,
+ &mac0,
+ &mac1,
+
};
static void __init avila_init(void)

View File

@@ -0,0 +1,50 @@
Index: linux-2.6.19/arch/arm/mach-ixp4xx/avila-setup.c
===================================================================
--- linux-2.6.19.orig/arch/arm/mach-ixp4xx/avila-setup.c 2007-01-23 03:12:36.000000000 -0800
+++ linux-2.6.19/arch/arm/mach-ixp4xx/avila-setup.c 2007-01-23 03:12:47.000000000 -0800
@@ -18,6 +18,10 @@
#include <linux/tty.h>
#include <linux/serial_8250.h>
#include <linux/slab.h>
+#ifdef CONFIG_SENSORS_EEPROM
+#include <linux/i2c.h>
+#include <linux/eeprom.h>
+#endif
#include <asm/types.h>
#include <asm/setup.h>
@@ -198,9 +202,34 @@
&avila_npe_ucode,
};
+#ifdef CONFIG_SENSORS_EEPROM
+static int loft_eeprom_do(struct notifier_block *self, unsigned long event, void *t)
+{
+ struct eeprom_data *data = t;
+
+ char macs[12];
+
+ /* The MACs are the first 12 bytes in the eeprom at address 0x51 */
+ if (event == EEPROM_REGISTER && data->client.addr == 0x51) {
+ data->attr->read(&data->client.dev.kobj, macs, 0, 12);
+ memcpy(&plat_mac0.hwaddr, macs, 6);
+ memcpy(&plat_mac1.hwaddr, macs + 6, 6);
+ }
+
+ return NOTIFY_DONE;
+}
+
+static struct notifier_block loft_eeprom_notifier = {
+ .notifier_call = loft_eeprom_do
+};
+#endif
+
static void __init avila_init(void)
{
ixp4xx_sys_init();
+#ifdef CONFIG_SENSORS_EEPROM
+ register_eeprom_notifier(&loft_eeprom_notifier);
+#endif
avila_flash_resource.start = IXP4XX_EXP_BUS_BASE(0);
avila_flash_resource.end =

View File

@@ -0,0 +1,28 @@
diff -Nur linux-2.6.19.2/arch/arm/mach-ixp4xx/avila-setup.c linux-2.6.19.2-owrt/arch/arm/mach-ixp4xx/avila-setup.c
--- linux-2.6.19.2/arch/arm/mach-ixp4xx/avila-setup.c 2007-05-10 12:30:54.000000000 +0200
+++ linux-2.6.19.2-owrt/arch/arm/mach-ixp4xx/avila-setup.c 2007-05-10 12:33:08.000000000 +0200
@@ -155,13 +155,23 @@
.resource = &res_mac1,
};
+struct npe_ucode_platform_data avila_npe_ucode_data = {
+ .mtd_partition = "RedBoot",
+};
+
+static struct platform_device avila_npe_ucode = {
+ .name = "ixp4xx_npe_ucode",
+ .id = 0,
+ .dev.platform_data = &avila_npe_ucode_data,
+};
+
static struct platform_device *avila_devices[] __initdata = {
&avila_i2c_controller,
&avila_flash,
&avila_uart,
&mac0,
&mac1,
-
+ &avila_npe_ucode,
};
#ifdef CONFIG_SENSORS_EEPROM

View File

@@ -0,0 +1,201 @@
Add EEPROM notifiers
These help board level code by allowing a callback when EEPROMs are
loaded, this permits system level configuration to be loaded from the
EEPROM. This is particularly useful when the ethernet MAC ids are
stored in EEPROM and when the ethernet hardware is generic (so it
has no board level knowledge), then the MACs can be loaded into
the 'maclist' code and read out by the ethernet config.
Signed-off-by: John Bowler <jbowler@acm.org>
Index: linux-2.6.21-rc1-arm/drivers/i2c/chips/eeprom.c
===================================================================
--- linux-2.6.21-rc1-arm.orig/drivers/i2c/chips/eeprom.c 2007-02-21 02:24:14.000000000 -0800
+++ linux-2.6.21-rc1-arm/drivers/i2c/chips/eeprom.c 2007-02-21 02:25:01.000000000 -0800
@@ -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 @@
/* 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);
@@ -189,6 +172,7 @@
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)))
@@ -212,6 +196,9 @@
if (err)
goto exit_detach;
+ /* call the notifier chain */
+ atomic_notifier_call_chain(&eeprom_chain, EEPROM_REGISTER, data);
+
return 0;
exit_detach:
@@ -237,6 +224,41 @@
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);
Index: linux-2.6.21-rc1-arm/include/linux/eeprom.h
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ linux-2.6.21-rc1-arm/include/linux/eeprom.h 2007-02-21 02:25:01.000000000 -0800
@@ -0,0 +1,71 @@
+#ifndef _LINUX_EEPROM_H
+#define _LINUX_EEPROM_H
+/*
+ * $Id: 45-eeprom-new-notifier.patch,v 1.2 2006/03/27 11:10:19 azummo Exp $
+ *
+ * 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 */
Index: linux-2.6.21-rc1-arm/include/linux/notifier.h
===================================================================
--- linux-2.6.21-rc1-arm.orig/include/linux/notifier.h 2007-02-21 02:24:14.000000000 -0800
+++ linux-2.6.21-rc1-arm/include/linux/notifier.h 2007-02-21 02:25:01.000000000 -0800
@@ -187,5 +187,8 @@
#define CPU_DOWN_FAILED 0x0006 /* CPU (unsigned)v NOT going down */
#define CPU_DEAD 0x0007 /* CPU (unsigned)v dead */
+/* eeprom notifier chain */
+#define EEPROM_REGISTER 0x0001
+
#endif /* __KERNEL__ */
#endif /* _LINUX_NOTIFIER_H */

View File

@@ -0,0 +1,19 @@
diff -Nur linux-2.6.19/arch/arm/boot/compressed/head-xscale.S linux-2.6.19-owrt/arch/arm/boot/compressed/head-xscale.S
--- linux-2.6.19/arch/arm/boot/compressed/head-xscale.S 2006-12-19 12:56:21.000000000 +0100
+++ linux-2.6.19-owrt/arch/arm/boot/compressed/head-xscale.S 2006-12-19 12:58:15.000000000 +0100
@@ -41,6 +41,7 @@
mov r7, #MACH_TYPE_COTULLA_IDP
#endif
+/* let the arm-magic.sh script do the dirty work
#ifdef CONFIG_MACH_GTWX5715
mov r7, #(MACH_TYPE_GTWX5715 & 0xff)
orr r7, r7, #(MACH_TYPE_GTWX5715 & 0xff00)
@@ -50,6 +51,7 @@
mov r7, #(MACH_TYPE_GATEWAY7001 & 0xff)
orr r7, r7, #(MACH_TYPE_GATEWAY7001 & 0xff00)
#endif
+ */
#ifdef CONFIG_ARCH_IXP2000
mov r1, #-1

View File

@@ -0,0 +1,429 @@
Index: linux-2.6.21.5-armeb/arch/arm/mach-ixp4xx/fsg-pci.c
===================================================================
--- /dev/null
+++ linux-2.6.21.5-armeb/arch/arm/mach-ixp4xx/fsg-pci.c
@@ -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);
Index: linux-2.6.21.5-armeb/arch/arm/mach-ixp4xx/fsg-setup.c
===================================================================
--- /dev/null
+++ linux-2.6.21.5-armeb/arch/arm/mach-ixp4xx/fsg-setup.c
@@ -0,0 +1,223 @@
+/*
+ * 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/mtd/mtd.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 ixp4xx_i2c_pins fsg_i2c_gpio_pins = {
+ .sda_pin = FSG_SDA_PIN,
+ .scl_pin = FSG_SCL_PIN,
+};
+
+static struct platform_device fsg_i2c_controller = {
+ .name = "IXP4XX-I2C",
+ .id = 0,
+ .dev.platform_data = &fsg_i2c_gpio_pins,
+ .num_resources = 0,
+};
+
+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,
+};
+
+/* Built-in 10/100 Ethernet MAC interfaces */
+static struct resource res_mac0 = {
+ .start = IXP4XX_EthB_BASE_PHYS,
+ .end = IXP4XX_EthB_BASE_PHYS + 0x1ff,
+ .flags = IORESOURCE_MEM,
+};
+
+static struct resource res_mac1 = {
+ .start = IXP4XX_EthC_BASE_PHYS,
+ .end = IXP4XX_EthC_BASE_PHYS + 0x1ff,
+ .flags = IORESOURCE_MEM,
+};
+
+static struct mac_plat_info plat_mac0 = {
+ .npe_id = 1,
+ .phy_id = 5,
+ .eth_id = 0,
+ .rxq_id = 27,
+ .txq_id = 24,
+ .rxdoneq_id = 4,
+};
+
+static struct mac_plat_info plat_mac1 = {
+ .npe_id = 2,
+ .phy_id = 4,
+ .eth_id = 1,
+ .rxq_id = 28,
+ .txq_id = 25,
+ .rxdoneq_id = 5,
+};
+
+static struct platform_device mac0 = {
+ .name = "ixp4xx_mac",
+ .id = 0,
+ .dev.platform_data = &plat_mac0,
+ .num_resources = 1,
+ .resource = &res_mac0,
+};
+
+static struct platform_device mac1 = {
+ .name = "ixp4xx_mac",
+ .id = 1,
+ .dev.platform_data = &plat_mac1,
+ .num_resources = 1,
+ .resource = &res_mac1,
+};
+
+struct npe_ucode_platform_data fsg_npe_ucode_data = {
+ .mtd_partition = "microcode",
+};
+
+static struct platform_device fsg_npe_ucode = {
+ .name = "ixp4xx_npe_ucode",
+ .id = 0,
+ .dev.platform_data = &fsg_npe_ucode_data,
+};
+
+static struct platform_device *fsg_devices[] __initdata = {
+ &fsg_i2c_controller,
+ &fsg_flash,
+ &mac0,
+ &mac1,
+ &fsg_npe_ucode,
+};
+
+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(plat_mac0.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(plat_mac1.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();
+
+ 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));
+
+ register_mtd_user(&fsg_flash_notifier);
+}
+
+MACHINE_START(FSG, "Freecom FSG-3")
+ .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
+
Index: linux-2.6.21.5-armeb/include/asm-arm/arch-ixp4xx/fsg.h
===================================================================
--- /dev/null
+++ linux-2.6.21.5-armeb/include/asm-arm/arch-ixp4xx/fsg.h
@@ -0,0 +1,58 @@
+/*
+ * 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_BIT 0
+#define FSG_LED_SYNC_BIT 1
+#define FSG_LED_USB_BIT 2
+#define FSG_LED_SATA_BIT 3
+#define FSG_LED_WAN_BIT 4
+#define FSG_LED_WLAN_BIT 5
Index: linux-2.6.21.5-armeb/include/asm-arm/arch-ixp4xx/hardware.h
===================================================================
--- linux-2.6.21.5-armeb.orig/include/asm-arm/arch-ixp4xx/hardware.h
+++ linux-2.6.21.5-armeb/include/asm-arm/arch-ixp4xx/hardware.h
@@ -48,5 +48,6 @@ extern unsigned int processor_id;
#include "nslu2.h"
#include "nas100d.h"
#include "dsmg600.h"
+#include "fsg.h"
#endif /* _ASM_ARCH_HARDWARE_H */
Index: linux-2.6.21.5-armeb/include/asm-arm/arch-ixp4xx/irqs.h
===================================================================
--- linux-2.6.21.5-armeb.orig/include/asm-arm/arch-ixp4xx/irqs.h
+++ linux-2.6.21.5-armeb/include/asm-arm/arch-ixp4xx/irqs.h
@@ -128,4 +128,11 @@
#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
+
#endif
--- linux-2.6.21.6/arch/arm/mach-ixp4xx/Makefile~ 2007-07-11 22:20:52.000000000 +0930
+++ linux-2.6.21.6/arch/arm/mach-ixp4xx/Makefile 2007-07-11 22:22:02.000000000 +0930
@@ -13,6 +13,7 @@
obj-pci-$(CONFIG_MACH_NSLU2) += nslu2-pci.o
obj-pci-$(CONFIG_MACH_NAS100D) += nas100d-pci.o
obj-pci-$(CONFIG_MACH_DSMG600) += dsmg600-pci.o
+obj-pci-$(CONFIG_MACH_FSG) += fsg-pci.o
obj-pci-$(CONFIG_MACH_GATEWAY7001) += gateway7001-pci.o
obj-pci-$(CONFIG_MACH_WG302V2) += wg302v2-pci.o
obj-pci-$(CONFIG_MACH_PRONGHORNMETRO) += pronghornmetro-pci.o
@@ -29,6 +30,7 @@
obj-$(CONFIG_MACH_NSLU2) += nslu2-setup.o nslu2-power.o
obj-$(CONFIG_MACH_NAS100D) += nas100d-setup.o nas100d-power.o
obj-$(CONFIG_MACH_DSMG600) += dsmg600-setup.o dsmg600-power.o
+obj-$(CONFIG_MACH_FSG) += fsg-setup.o
obj-$(CONFIG_MACH_GATEWAY7001) += gateway7001-setup.o
obj-$(CONFIG_MACH_WG302V2) += wg302v2-setup.o
obj-$(CONFIG_MACH_PRONGHORNMETRO) += pronghornmetro-setup.o
--- linux-2.6.21.6/arch/arm/mach-ixp4xx/Kconfig~ 2007-07-11 22:23:24.000000000 +0930
+++ linux-2.6.21.6/arch/arm/mach-ixp4xx/Kconfig 2007-07-11 22:23:47.000000000 +0930
@@ -138,6 +138,14 @@
DSM-G600 RevA device. For more information on this platform,
see http://www.nslu2-linux.org/wiki/DSMG600/HomePage
+config MACH_FSG
+ bool
+ prompt "Freecom FSG-3"
+ 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.openfsg.com/
+
#
# Avila and IXDP share the same source for now. Will change in future
#

View File

@@ -0,0 +1,17 @@
#
# Copyright (C) 2006 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
define Profile/Default
NAME:=Default Profile
PACKAGES:=kmod-madwifi
endef
define Profile/Default/Description
Default IXP4xx Profile
endef
$(eval $(call Profile,Default))

View File

@@ -0,0 +1,20 @@
#
# Copyright (C) 2006 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
define Profile/NSLU2
NAME:=Linksys NSLU2
PACKAGES:=kmod-ixp4xx-npe \
kmod-scsi-core \
kmod-usb-core kmod-usb-ohci kmod-usb2 kmod-usb-storage \
kmod-fs-ext2 kmod-fs-ext3
endef
define Profile/NSLU2/Description
Package set optimized for the Linksys NSLU2
endef
$(eval $(call Profile,NSLU2))

View File

@@ -0,0 +1,21 @@
#
# Copyright (C) 2006 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
define Profile/NAS100d
NAME:=Iomega NAS 100d
PACKAGES:=kmod-ixp4xx-npe \
kmod-madwifi wireless-tools \
kmod-scsi-core kmod-libata kmod-pata-artop \
kmod-usb-core kmod-usb2 kmod-usb-storage \
kmod-fs-ext2 kmod-fs-ext3
endef
define Profile/NAS100d/Description
Package set optimized for the Iomega NAS 100d
endef
$(eval $(call Profile,NAS100d))

View File

@@ -0,0 +1,21 @@
#
# Copyright (C) 2006 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
define Profile/DSMG600RevA
NAME:=DSM-G600 Rev A
PACKAGES:=kmod-via-velocity \
kmod-madwifi wireless-tools \
kmod-scsi-core kmod-libata kmod-pata-artop \
kmod-usb-core kmod-usb-uhci kmod-usb2 kmod-usb-storage \
kmod-fs-ext2 kmod-fs-ext3
endef
define Profile/DSMG600RevA/Description
Package set optimized for the DSM-G600 Rev A
endef
$(eval $(call Profile,DSMG600RevA))

View File

@@ -0,0 +1,20 @@
#
# Copyright (C) 2006 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
define Profile/FSG3
NAME:=Freecom FSG-3
PACKAGES:= \
kmod-madwifi wireless-tools \
kmod-usb-core kmod-usb-uhci kmod-usb2 kmod-usb-storage \
kmod-fs-ext2
endef
define Profile/FSG3/Description
Package set optimized for the Freecom FSG-3
endef
$(eval $(call Profile,FSG3))