diff options
-rw-r--r-- | mk/image.mk | 6 | ||||
-rw-r--r-- | target/wag54g/Makefile | 10 | ||||
-rw-r--r-- | target/wag54g/kernel.config | 82 | ||||
-rw-r--r-- | target/wag54g/patches/ar7.patch | 1676 |
4 files changed, 255 insertions, 1519 deletions
diff --git a/mk/image.mk b/mk/image.mk index 5b0408aa3..e80ac5d1e 100644 --- a/mk/image.mk +++ b/mk/image.mk @@ -43,7 +43,7 @@ image-prepare-post: chmod 1777 ${TARGET_DIR}/tmp INITRAMFS= ${DEVICE}-${ARCH}-${FS} -ROOTFSSQUASHFS= ${DEVICE}-${ARCH}-${FS}.fimage +ROOTFSSQUASHFS= ${DEVICE}-${ARCH}-${FS}.img ROOTFSTARBALL= ${DEVICE}-${ARCH}-${FS}.tar.gz ${BIN_DIR}/${ROOTFSTARBALL}: ${TARGET_DIR} @@ -56,12 +56,10 @@ ${BIN_DIR}/${INITRAMFS}: ${TARGET_DIR} ${BIN_DIR}/${ROOTFSSQUASHFS}: ${TARGET_DIR} PATH='${TARGET_PATH}' \ mksquashfs ${TARGET_DIR} ${BUILD_DIR}/root.squashfs \ - -nopad -noappend -root-owned -le $(MAKE_TRACE) + -nopad -noappend -root-owned $(MAKE_TRACE) # padding of images is required cat ${BIN_DIR}/${DEVICE}-${ARCH}-kernel ${BUILD_DIR}/root.squashfs > \ ${BUILD_DIR}/${ROOTFSSQUASHFS} - dd if=${BUILD_DIR}/${ROOTFSSQUASHFS} of=${BIN_DIR}/${ROOTFSSQUASHFS} \ - bs=4063232 conv=sync $(MAKE_TRACE) imageclean: rm -f $(BIN_DIR)/$(DEVICE)-* diff --git a/target/wag54g/Makefile b/target/wag54g/Makefile index 2c7f1581b..65a6f5475 100644 --- a/target/wag54g/Makefile +++ b/target/wag54g/Makefile @@ -30,14 +30,14 @@ kernel-install: tools-compile -o $(BIN_DIR)/${DEVICE}-${ARCH}-kernel ifeq ($(FS),squashfs) -imageinstall: $(BIN_DIR)/$(ROOTFSTARBALL) +imageinstall: $(BIN_DIR)/$(ROOTFSSQUASHFS) + ${CP} ${BUILD_DIR}/${ROOTFSSQUASHFS} $(BIN_DIR)/$(ROOTFSSQUASHFS) @echo - @echo 'The kernel file is: ${BIN_DIR}/${DEVICE}-${ARCH}-kernel' - @echo 'The nfs root tarball is: ${BIN_DIR}/${ROOTFSTARBALL}' - @echo 'You can flash the kernel via tftp:' + @echo The image file is $(ROOTFSSQUASHFS) + @echo 'You can flash the image via tftp:' @echo 'tftp 192.168.1.1' @echo 'tftp> binary' - @echo 'tftp> put wag54g-mips-kernel upgrade_code.bin' + @echo "tftp> put $(ROOTFSSQUASHFS) upgrade_code.bin" endif diff --git a/target/wag54g/kernel.config b/target/wag54g/kernel.config index 684c2065b..525dba591 100644 --- a/target/wag54g/kernel.config +++ b/target/wag54g/kernel.config @@ -1,7 +1,7 @@ # # Automatically generated make config: don't edit # Linux kernel version: 2.6.29.1 -# Mon Jun 1 20:30:47 2009 +# Thu Jun 11 14:39:35 2009 # CONFIG_MIPS=y @@ -142,9 +142,10 @@ CONFIG_SPLIT_PTLOCK_CPUS=4 # CONFIG_PHYS_ADDR_T_64BIT is not set CONFIG_ZONE_DMA_FLAG=0 CONFIG_VIRT_TO_BUS=y -CONFIG_UNEVICTABLE_LRU=y +# CONFIG_UNEVICTABLE_LRU is not set +CONFIG_TICK_ONESHOT=y # CONFIG_NO_HZ is not set -# CONFIG_HIGH_RES_TIMERS is not set +CONFIG_HIGH_RES_TIMERS=y CONFIG_GENERIC_CLOCKEVENTS_BUILD=y # CONFIG_HZ_48 is not set CONFIG_HZ_100=y @@ -172,9 +173,10 @@ CONFIG_BROKEN_ON_SMP=y CONFIG_INIT_ENV_ARG_LIMIT=32 CONFIG_LOCALVERSION="" # CONFIG_LOCALVERSION_AUTO is not set -CONFIG_SWAP=y -# CONFIG_SYSVIPC is not set -# CONFIG_POSIX_MQUEUE is not set +# CONFIG_SWAP is not set +CONFIG_SYSVIPC=y +CONFIG_SYSVIPC_SYSCTL=y +CONFIG_POSIX_MQUEUE=y # CONFIG_BSD_PROCESS_ACCT is not set # CONFIG_TASKSTATS is not set # CONFIG_AUDIT is not set @@ -208,14 +210,14 @@ CONFIG_BUG=y # CONFIG_ELF_CORE is not set # CONFIG_PCSPKR_PLATFORM is not set CONFIG_BASE_FULL=y -CONFIG_FUTEX=y +# CONFIG_FUTEX is not set CONFIG_EPOLL=y CONFIG_SIGNALFD=y CONFIG_TIMERFD=y CONFIG_EVENTFD=y CONFIG_SHMEM=y -CONFIG_AIO=y -CONFIG_VM_EVENT_COUNTERS=y +# CONFIG_AIO is not set +# CONFIG_VM_EVENT_COUNTERS is not set # CONFIG_COMPAT_BRK is not set CONFIG_SLAB=y # CONFIG_SLUB is not set @@ -224,7 +226,6 @@ CONFIG_SLAB=y CONFIG_HAVE_OPROFILE=y # CONFIG_HAVE_GENERIC_DMA_COHERENT is not set CONFIG_SLABINFO=y -CONFIG_RT_MUTEXES=y CONFIG_BASE_SMALL=0 CONFIG_MODULES=y # CONFIG_MODULE_FORCE_LOAD is not set @@ -279,7 +280,7 @@ CONFIG_NET=y # CONFIG_COMPAT_NET_DEV_OPS=y CONFIG_PACKET=y -# CONFIG_PACKET_MMAP is not set +CONFIG_PACKET_MMAP=y CONFIG_UNIX=y # CONFIG_NET_KEY is not set CONFIG_INET=y @@ -391,8 +392,10 @@ CONFIG_MTD_BLOCK=y # # RAM/ROM/Flash chip drivers # -# CONFIG_MTD_CFI is not set +CONFIG_MTD_CFI=y # CONFIG_MTD_JEDECPROBE is not set +CONFIG_MTD_GEN_PROBE=y +# CONFIG_MTD_CFI_ADV_OPTIONS is not set CONFIG_MTD_MAP_BANK_WIDTH_1=y CONFIG_MTD_MAP_BANK_WIDTH_2=y CONFIG_MTD_MAP_BANK_WIDTH_4=y @@ -403,6 +406,10 @@ 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 is not set +CONFIG_MTD_CFI_AMDSTD=y +# CONFIG_MTD_CFI_STAA is not set +CONFIG_MTD_CFI_UTIL=y # CONFIG_MTD_RAM is not set # CONFIG_MTD_ROM is not set # CONFIG_MTD_ABSENT is not set @@ -410,7 +417,9 @@ CONFIG_MTD_CFI_I2=y # # Mapping drivers for chip access # -# CONFIG_MTD_COMPLEX_MAPPINGS is not set +CONFIG_MTD_COMPLEX_MAPPINGS=y +CONFIG_MTD_PHYSMAP=y +# CONFIG_MTD_PHYSMAP_COMPAT is not set # CONFIG_MTD_PLATRAM is not set # @@ -487,7 +496,7 @@ CONFIG_PHYLIB=y # CONFIG_NATIONAL_PHY is not set # CONFIG_STE10XP is not set # CONFIG_LSI_ET1011C_PHY is not set -# CONFIG_FIXED_PHY is not set +CONFIG_FIXED_PHY=y # CONFIG_MDIO_BITBANG is not set CONFIG_NET_ETHERNET=y CONFIG_MII=y @@ -529,46 +538,18 @@ CONFIG_CPMAC=y # # Input device support # -CONFIG_INPUT=y -# CONFIG_INPUT_FF_MEMLESS is not set -# CONFIG_INPUT_POLLDEV is not set - -# -# Userland interfaces -# -# CONFIG_INPUT_MOUSEDEV is not set -# CONFIG_INPUT_JOYDEV is not set -# CONFIG_INPUT_EVDEV is not set -# CONFIG_INPUT_EVBUG is not set - -# -# Input Device Drivers -# -# CONFIG_INPUT_KEYBOARD is not set -# CONFIG_INPUT_MOUSE is not set -# CONFIG_INPUT_JOYSTICK is not set -# CONFIG_INPUT_TABLET is not set -# CONFIG_INPUT_TOUCHSCREEN is not set -# CONFIG_INPUT_MISC is not set +# CONFIG_INPUT is not set # # Hardware I/O ports # -CONFIG_SERIO=y -CONFIG_SERIO_I8042=y -# CONFIG_SERIO_SERPORT is not set -CONFIG_SERIO_LIBPS2=y -# CONFIG_SERIO_RAW is not set +# CONFIG_SERIO is not set # CONFIG_GAMEPORT is not set # # Character devices # -CONFIG_VT=y -CONFIG_CONSOLE_TRANSLATIONS=y -CONFIG_VT_CONSOLE=y -CONFIG_HW_CONSOLE=y -# CONFIG_VT_HW_CONSOLE_BINDING is not set +# CONFIG_VT is not set # CONFIG_DEVKMEM is not set # CONFIG_SERIAL_NONSTANDARD is not set @@ -654,17 +635,7 @@ CONFIG_SSB_POSSIBLE=y # Display device support # # CONFIG_DISPLAY_SUPPORT is not set - -# -# Console display driver support -# -CONFIG_VGA_CONSOLE=y -# CONFIG_VGACON_SOFT_SCROLLBACK is not set -CONFIG_DUMMY_CONSOLE=y # CONFIG_SOUND is not set -CONFIG_HID_SUPPORT=y -# CONFIG_HID is not set -# CONFIG_HID_PID is not set # CONFIG_USB_SUPPORT is not set # CONFIG_MMC is not set # CONFIG_MEMSTICK is not set @@ -898,7 +869,6 @@ CONFIG_GENERIC_FIND_LAST_BIT=y # CONFIG_CRC32 is not set # CONFIG_CRC7 is not set # CONFIG_LIBCRC32C is not set -CONFIG_PLIST=y CONFIG_HAS_IOMEM=y CONFIG_HAS_IOPORT=y CONFIG_HAS_DMA=y diff --git a/target/wag54g/patches/ar7.patch b/target/wag54g/patches/ar7.patch index 1398c5e71..adf7c5abd 100644 --- a/target/wag54g/patches/ar7.patch +++ b/target/wag54g/patches/ar7.patch @@ -1,6 +1,65 @@ +diff -Nur linux-2.6.29.1.orig/arch/mips/Kconfig linux-2.6.29.1/arch/mips/Kconfig +--- linux-2.6.29.1.orig/arch/mips/Kconfig 2009-04-02 22:55:27.000000000 +0200 ++++ linux-2.6.29.1/arch/mips/Kconfig 2009-06-05 23:38:22.964942366 +0200 +@@ -19,6 +19,24 @@ + prompt "System type" + default SGI_IP22 + ++config AR7 ++ bool "Texas Instruments AR7" ++ select BOOT_ELF32 ++ select DMA_NONCOHERENT ++ select CEVT_R4K ++ select CSRC_R4K ++ select IRQ_CPU ++ select NO_EXCEPT_FILL ++ select SWAP_IO_SPACE ++ select SYS_HAS_CPU_MIPS32_R1 ++ select SYS_HAS_EARLY_PRINTK ++ select SYS_SUPPORTS_32BIT_KERNEL ++ select SYS_SUPPORTS_KGDB ++ select SYS_SUPPORTS_LITTLE_ENDIAN ++ select SYS_SUPPORTS_BIG_ENDIAN ++ select GENERIC_GPIO ++ select GENERIC_HARDIRQS_NO__DO_IRQ ++ + config MACH_ALCHEMY + bool "Alchemy processor based machines" + +diff -Nur linux-2.6.29.1.orig/arch/mips/Makefile linux-2.6.29.1/arch/mips/Makefile +--- linux-2.6.29.1.orig/arch/mips/Makefile 2009-04-02 22:55:27.000000000 +0200 ++++ linux-2.6.29.1/arch/mips/Makefile 2009-06-05 23:38:22.972943665 +0200 +@@ -173,6 +173,13 @@ + # + + # ++# Texas Instruments AR7 ++# ++core-$(CONFIG_AR7) += arch/mips/ar7/ ++cflags-$(CONFIG_AR7) += -I$(srctree)/arch/mips/include/asm/mach-ar7 ++load-$(CONFIG_AR7) += 0xffffffff94100000 ++ ++# + # Acer PICA 61, Mips Magnum 4000 and Olivetti M700. + # + core-$(CONFIG_MACH_JAZZ) += arch/mips/jazz/ +diff -Nur linux-2.6.29.1.orig/arch/mips/ar7/Makefile linux-2.6.29.1/arch/mips/ar7/Makefile +--- linux-2.6.29.1.orig/arch/mips/ar7/Makefile 1970-01-01 01:00:00.000000000 +0100 ++++ linux-2.6.29.1/arch/mips/ar7/Makefile 2009-06-05 23:38:22.900939237 +0200 +@@ -0,0 +1,10 @@ ++ ++obj-y := \ ++ prom.o \ ++ setup.o \ ++ memory.o \ ++ irq.o \ ++ time.o \ ++ platform.o \ ++ gpio.o \ ++ clock.o diff -Nur linux-2.6.29.1.orig/arch/mips/ar7/clock.c linux-2.6.29.1/arch/mips/ar7/clock.c --- linux-2.6.29.1.orig/arch/mips/ar7/clock.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-2.6.29.1/arch/mips/ar7/clock.c 2009-05-31 20:19:17.000000000 +0200 ++++ linux-2.6.29.1/arch/mips/ar7/clock.c 2009-06-05 23:38:22.890200159 +0200 @@ -0,0 +1,483 @@ +/* + * Copyright (C) 2007 Felix Fietkau <nbd@openwrt.org> @@ -487,7 +546,7 @@ diff -Nur linux-2.6.29.1.orig/arch/mips/ar7/clock.c linux-2.6.29.1/arch/mips/ar7 +} diff -Nur linux-2.6.29.1.orig/arch/mips/ar7/gpio.c linux-2.6.29.1/arch/mips/ar7/gpio.c --- linux-2.6.29.1.orig/arch/mips/ar7/gpio.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-2.6.29.1/arch/mips/ar7/gpio.c 2009-05-31 20:19:27.000000000 +0200 ++++ linux-2.6.29.1/arch/mips/ar7/gpio.c 2009-06-05 23:38:22.896939006 +0200 @@ -0,0 +1,49 @@ +/* + * Copyright (C) 2007 Felix Fietkau <nbd@openwrt.org> @@ -540,7 +599,7 @@ diff -Nur linux-2.6.29.1.orig/arch/mips/ar7/gpio.c linux-2.6.29.1/arch/mips/ar7/ +EXPORT_SYMBOL(gpio_free); diff -Nur linux-2.6.29.1.orig/arch/mips/ar7/irq.c linux-2.6.29.1/arch/mips/ar7/irq.c --- linux-2.6.29.1.orig/arch/mips/ar7/irq.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-2.6.29.1/arch/mips/ar7/irq.c 2009-05-31 20:19:35.000000000 +0200 ++++ linux-2.6.29.1/arch/mips/ar7/irq.c 2009-06-05 23:38:22.896939006 +0200 @@ -0,0 +1,183 @@ +/* + * Copyright (C) 2006,2007 Felix Fietkau <nbd@openwrt.org> @@ -725,23 +784,9 @@ diff -Nur linux-2.6.29.1.orig/arch/mips/ar7/irq.c linux-2.6.29.1/arch/mips/ar7/i + else + spurious_interrupt(); +} -diff -Nur linux-2.6.29.1.orig/arch/mips/ar7/Makefile linux-2.6.29.1/arch/mips/ar7/Makefile ---- linux-2.6.29.1.orig/arch/mips/ar7/Makefile 1970-01-01 01:00:00.000000000 +0100 -+++ linux-2.6.29.1/arch/mips/ar7/Makefile 2009-05-31 19:50:05.000000000 +0200 -@@ -0,0 +1,10 @@ -+ -+obj-y := \ -+ prom.o \ -+ setup.o \ -+ memory.o \ -+ irq.o \ -+ time.o \ -+ platform.o \ -+ gpio.o \ -+ clock.o diff -Nur linux-2.6.29.1.orig/arch/mips/ar7/memory.c linux-2.6.29.1/arch/mips/ar7/memory.c --- linux-2.6.29.1.orig/arch/mips/ar7/memory.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-2.6.29.1/arch/mips/ar7/memory.c 2009-05-31 19:50:05.000000000 +0200 ++++ linux-2.6.29.1/arch/mips/ar7/memory.c 2009-06-05 23:38:22.900939237 +0200 @@ -0,0 +1,74 @@ +/* + * Based on arch/mips/mm/init.c @@ -819,8 +864,8 @@ diff -Nur linux-2.6.29.1.orig/arch/mips/ar7/memory.c linux-2.6.29.1/arch/mips/ar +} diff -Nur linux-2.6.29.1.orig/arch/mips/ar7/platform.c linux-2.6.29.1/arch/mips/ar7/platform.c --- linux-2.6.29.1.orig/arch/mips/ar7/platform.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-2.6.29.1/arch/mips/ar7/platform.c 2009-06-01 13:34:18.000000000 +0200 -@@ -0,0 +1,535 @@ ++++ linux-2.6.29.1/arch/mips/ar7/platform.c 2009-06-11 11:03:47.318484670 +0200 +@@ -0,0 +1,554 @@ +/* + * Copyright (C) 2006,2007 Felix Fietkau <nbd@openwrt.org> + * Copyright (C) 2006,2007 Eugene Konev <ejka@openwrt.org> @@ -856,6 +901,9 @@ diff -Nur linux-2.6.29.1.orig/arch/mips/ar7/platform.c linux-2.6.29.1/arch/mips/ +#include <linux/vlynq.h> +#include <linux/leds.h> +#include <linux/string.h> ++#include <linux/phy.h> ++#include <linux/phy_fixed.h> ++ + +#include <asm/addrspace.h> +#include <asm/mach-ar7/ar7.h> @@ -1028,6 +1076,13 @@ diff -Nur linux-2.6.29.1.orig/arch/mips/ar7/platform.c linux-2.6.29.1/arch/mips/ + .width = 2, +}; + ++/* lets assume this is suitable for both high and low cpmacs links */ ++static struct fixed_phy_status fixed_phy_status __initdata = { ++ .link = 1, ++ .speed = 100, ++ .duplex = 1, ++}; ++ +static struct plat_cpmac_data cpmac_low_data = { + .reset_bit = 17, + .power_bit = 20, @@ -1331,6 +1386,10 @@ diff -Nur linux-2.6.29.1.orig/arch/mips/ar7/platform.c linux-2.6.29.1/arch/mips/ + } + + if (ar7_has_high_cpmac()) { ++ res = fixed_phy_add(PHY_POLL, cpmac_high.id, &fixed_phy_status); ++ if (res && res != -ENODEV) { ++ return res; ++ } + cpmac_get_mac(1, cpmac_high_data.dev_addr); + res = platform_device_register(&cpmac_high); + if (res) @@ -1339,6 +1398,11 @@ diff -Nur linux-2.6.29.1.orig/arch/mips/ar7/platform.c linux-2.6.29.1/arch/mips/ + cpmac_low_data.phy_mask = 0xffffffff; + } + ++ res = fixed_phy_add(PHY_POLL, cpmac_low.id, &fixed_phy_status); ++ if (res && res != -ENODEV) { ++ return res; ++ } ++ + cpmac_get_mac(0, cpmac_low_data.dev_addr); + res = platform_device_register(&cpmac_low); + if (res) @@ -1358,7 +1422,7 @@ diff -Nur linux-2.6.29.1.orig/arch/mips/ar7/platform.c linux-2.6.29.1/arch/mips/ +arch_initcall(ar7_register_devices); diff -Nur linux-2.6.29.1.orig/arch/mips/ar7/prom.c linux-2.6.29.1/arch/mips/ar7/prom.c --- linux-2.6.29.1.orig/arch/mips/ar7/prom.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-2.6.29.1/arch/mips/ar7/prom.c 2009-05-31 20:18:44.000000000 +0200 ++++ linux-2.6.29.1/arch/mips/ar7/prom.c 2009-06-05 23:38:22.904938908 +0200 @@ -0,0 +1,321 @@ +/* + * Carsten Langgaard, carstenl@mips.com @@ -1683,7 +1747,7 @@ diff -Nur linux-2.6.29.1.orig/arch/mips/ar7/prom.c linux-2.6.29.1/arch/mips/ar7/ +#endif diff -Nur linux-2.6.29.1.orig/arch/mips/ar7/setup.c linux-2.6.29.1/arch/mips/ar7/setup.c --- linux-2.6.29.1.orig/arch/mips/ar7/setup.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-2.6.29.1/arch/mips/ar7/setup.c 2009-06-01 12:36:33.000000000 +0200 ++++ linux-2.6.29.1/arch/mips/ar7/setup.c 2009-06-05 23:38:22.908939139 +0200 @@ -0,0 +1,105 @@ +/* + * Carsten Langgaard, carstenl@mips.com @@ -1792,7 +1856,7 @@ diff -Nur linux-2.6.29.1.orig/arch/mips/ar7/setup.c linux-2.6.29.1/arch/mips/ar7 +console_initcall(ar7_init_console); diff -Nur linux-2.6.29.1.orig/arch/mips/ar7/time.c linux-2.6.29.1/arch/mips/ar7/time.c --- linux-2.6.29.1.orig/arch/mips/ar7/time.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-2.6.29.1/arch/mips/ar7/time.c 2009-06-01 12:37:00.000000000 +0200 ++++ linux-2.6.29.1/arch/mips/ar7/time.c 2009-06-05 23:38:22.908939139 +0200 @@ -0,0 +1,28 @@ +/* + * Carsten Langgaard, carstenl@mips.com @@ -1824,7 +1888,7 @@ diff -Nur linux-2.6.29.1.orig/arch/mips/ar7/time.c linux-2.6.29.1/arch/mips/ar7/ +} diff -Nur linux-2.6.29.1.orig/arch/mips/include/asm/mach-ar7/ar7.h linux-2.6.29.1/arch/mips/include/asm/mach-ar7/ar7.h --- linux-2.6.29.1.orig/arch/mips/include/asm/mach-ar7/ar7.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-2.6.29.1/arch/mips/include/asm/mach-ar7/ar7.h 2009-05-31 19:50:04.000000000 +0200 ++++ linux-2.6.29.1/arch/mips/include/asm/mach-ar7/ar7.h 2009-06-05 23:38:22.912938811 +0200 @@ -0,0 +1,170 @@ +/* + * Copyright (C) 2006,2007 Felix Fietkau <nbd@openwrt.org> @@ -1998,7 +2062,7 @@ diff -Nur linux-2.6.29.1.orig/arch/mips/include/asm/mach-ar7/ar7.h linux-2.6.29. +#endif /* __AR7_H__ */ diff -Nur linux-2.6.29.1.orig/arch/mips/include/asm/mach-ar7/gpio.h linux-2.6.29.1/arch/mips/include/asm/mach-ar7/gpio.h --- linux-2.6.29.1.orig/arch/mips/include/asm/mach-ar7/gpio.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-2.6.29.1/arch/mips/include/asm/mach-ar7/gpio.h 2009-05-31 20:26:23.000000000 +0200 ++++ linux-2.6.29.1/arch/mips/include/asm/mach-ar7/gpio.h 2009-06-05 23:38:22.920939272 +0200 @@ -0,0 +1,109 @@ +/* + * Copyright (C) 2007 Florian Fainelli <florian@openwrt.org> @@ -2111,7 +2175,7 @@ diff -Nur linux-2.6.29.1.orig/arch/mips/include/asm/mach-ar7/gpio.h linux-2.6.29 +#endif diff -Nur linux-2.6.29.1.orig/arch/mips/include/asm/mach-ar7/irq.h linux-2.6.29.1/arch/mips/include/asm/mach-ar7/irq.h --- linux-2.6.29.1.orig/arch/mips/include/asm/mach-ar7/irq.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-2.6.29.1/arch/mips/include/asm/mach-ar7/irq.h 2009-05-31 19:50:04.000000000 +0200 ++++ linux-2.6.29.1/arch/mips/include/asm/mach-ar7/irq.h 2009-06-05 23:38:22.957186350 +0200 @@ -0,0 +1,16 @@ +/* + * This file is subject to the terms and conditions of the GNU General Public @@ -2131,7 +2195,7 @@ diff -Nur linux-2.6.29.1.orig/arch/mips/include/asm/mach-ar7/irq.h linux-2.6.29. +#endif /* __ASM_AR7_IRQ_H */ diff -Nur linux-2.6.29.1.orig/arch/mips/include/asm/mach-ar7/prom.h linux-2.6.29.1/arch/mips/include/asm/mach-ar7/prom.h --- linux-2.6.29.1.orig/arch/mips/include/asm/mach-ar7/prom.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-2.6.29.1/arch/mips/include/asm/mach-ar7/prom.h 2009-05-31 19:50:04.000000000 +0200 ++++ linux-2.6.29.1/arch/mips/include/asm/mach-ar7/prom.h 2009-06-05 23:38:22.957186350 +0200 @@ -0,0 +1,26 @@ +/* + * Copyright (C) 2006, 2007 Florian Fainelli <florian@openwrt.org> @@ -2161,7 +2225,7 @@ diff -Nur linux-2.6.29.1.orig/arch/mips/include/asm/mach-ar7/prom.h linux-2.6.29 +#endif /* __PROM_H__ */ diff -Nur linux-2.6.29.1.orig/arch/mips/include/asm/mach-ar7/spaces.h linux-2.6.29.1/arch/mips/include/asm/mach-ar7/spaces.h --- linux-2.6.29.1.orig/arch/mips/include/asm/mach-ar7/spaces.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-2.6.29.1/arch/mips/include/asm/mach-ar7/spaces.h 2009-05-31 19:50:04.000000000 +0200 ++++ linux-2.6.29.1/arch/mips/include/asm/mach-ar7/spaces.h 2009-06-05 23:38:22.957186350 +0200 @@ -0,0 +1,32 @@ +/* + * This file is subject to the terms and conditions of the GNU General Public @@ -2197,7 +2261,7 @@ diff -Nur linux-2.6.29.1.orig/arch/mips/include/asm/mach-ar7/spaces.h linux-2.6. +#endif /* __ASM_AR7_SPACES_H */ diff -Nur linux-2.6.29.1.orig/arch/mips/include/asm/mach-ar7/war.h linux-2.6.29.1/arch/mips/include/asm/mach-ar7/war.h --- linux-2.6.29.1.orig/arch/mips/include/asm/mach-ar7/war.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-2.6.29.1/arch/mips/include/asm/mach-ar7/war.h 2009-05-31 19:50:04.000000000 +0200 ++++ linux-2.6.29.1/arch/mips/include/asm/mach-ar7/war.h 2009-06-05 23:38:22.957186350 +0200 @@ -0,0 +1,25 @@ +/* + * This file is subject to the terms and conditions of the GNU General Public @@ -2226,7 +2290,7 @@ diff -Nur linux-2.6.29.1.orig/arch/mips/include/asm/mach-ar7/war.h linux-2.6.29. +#endif /* __ASM_MIPS_MACH_BCM947XX_WAR_H */ diff -Nur linux-2.6.29.1.orig/arch/mips/include/asm/page.h linux-2.6.29.1/arch/mips/include/asm/page.h --- linux-2.6.29.1.orig/arch/mips/include/asm/page.h 2009-04-02 22:55:27.000000000 +0200 -+++ linux-2.6.29.1/arch/mips/include/asm/page.h 2009-05-31 19:57:06.000000000 +0200 ++++ linux-2.6.29.1/arch/mips/include/asm/page.h 2009-06-05 23:38:22.964942366 +0200 @@ -182,8 +182,11 @@ #define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \ VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC) @@ -2241,37 +2305,9 @@ diff -Nur linux-2.6.29.1.orig/arch/mips/include/asm/page.h linux-2.6.29.1/arch/m #include <asm-generic/memory_model.h> #include <asm-generic/page.h> -diff -Nur linux-2.6.29.1.orig/arch/mips/Kconfig linux-2.6.29.1/arch/mips/Kconfig ---- linux-2.6.29.1.orig/arch/mips/Kconfig 2009-04-02 22:55:27.000000000 +0200 -+++ linux-2.6.29.1/arch/mips/Kconfig 2009-05-31 19:55:40.000000000 +0200 -@@ -19,6 +19,24 @@ - prompt "System type" - default SGI_IP22 - -+config AR7 -+ bool "Texas Instruments AR7" -+ select BOOT_ELF32 -+ select DMA_NONCOHERENT -+ select CEVT_R4K -+ select CSRC_R4K -+ select IRQ_CPU -+ select NO_EXCEPT_FILL -+ select SWAP_IO_SPACE -+ select SYS_HAS_CPU_MIPS32_R1 -+ select SYS_HAS_EARLY_PRINTK -+ select SYS_SUPPORTS_32BIT_KERNEL -+ select SYS_SUPPORTS_KGDB -+ select SYS_SUPPORTS_LITTLE_ENDIAN -+ select SYS_SUPPORTS_BIG_ENDIAN -+ select GENERIC_GPIO -+ select GENERIC_HARDIRQS_NO__DO_IRQ -+ - config MACH_ALCHEMY - bool "Alchemy processor based machines" - diff -Nur linux-2.6.29.1.orig/arch/mips/kernel/traps.c linux-2.6.29.1/arch/mips/kernel/traps.c --- linux-2.6.29.1.orig/arch/mips/kernel/traps.c 2009-04-02 22:55:27.000000000 +0200 -+++ linux-2.6.29.1/arch/mips/kernel/traps.c 2009-05-31 23:46:49.000000000 +0200 ++++ linux-2.6.29.1/arch/mips/kernel/traps.c 2009-06-05 23:38:22.972943665 +0200 @@ -1256,9 +1256,22 @@ exception_handlers[n] = handler; @@ -2298,26 +2334,62 @@ diff -Nur linux-2.6.29.1.orig/arch/mips/kernel/traps.c linux-2.6.29.1/arch/mips/ } return (void *)old_handler; } -diff -Nur linux-2.6.29.1.orig/arch/mips/Makefile linux-2.6.29.1/arch/mips/Makefile ---- linux-2.6.29.1.orig/arch/mips/Makefile 2009-04-02 22:55:27.000000000 +0200 -+++ linux-2.6.29.1/arch/mips/Makefile 2009-05-31 20:01:45.000000000 +0200 -@@ -173,6 +173,13 @@ - # +diff -Nur linux-2.6.29.1.orig/drivers/Kconfig linux-2.6.29.1/drivers/Kconfig +--- linux-2.6.29.1.orig/drivers/Kconfig 2009-04-02 22:55:27.000000000 +0200 ++++ linux-2.6.29.1/drivers/Kconfig 2009-06-05 23:38:22.988945146 +0200 +@@ -104,6 +104,8 @@ - # -+# Texas Instruments AR7 -+# -+core-$(CONFIG_AR7) += arch/mips/ar7/ -+cflags-$(CONFIG_AR7) += -I$(srctree)/arch/mips/include/asm/mach-ar7 -+load-$(CONFIG_AR7) += 0xffffffff94100000 + source "drivers/uio/Kconfig" + ++source "drivers/vlynq/Kconfig" + -+# - # Acer PICA 61, Mips Magnum 4000 and Olivetti M700. - # - core-$(CONFIG_MACH_JAZZ) += arch/mips/jazz/ + source "drivers/xen/Kconfig" + + source "drivers/staging/Kconfig" +diff -Nur linux-2.6.29.1.orig/drivers/Makefile linux-2.6.29.1/drivers/Makefile +--- linux-2.6.29.1.orig/drivers/Makefile 2009-04-02 22:55:27.000000000 +0200 ++++ linux-2.6.29.1/drivers/Makefile 2009-06-05 23:38:22.988945146 +0200 +@@ -102,6 +102,7 @@ + obj-$(CONFIG_HID) += hid/ + obj-$(CONFIG_PPC_PS3) += ps3/ + obj-$(CONFIG_OF) += of/ ++obj-$(CONFIG_VLYNQ) += vlynq/ + obj-$(CONFIG_SSB) += ssb/ + obj-$(CONFIG_VIRTIO) += virtio/ + obj-$(CONFIG_STAGING) += staging/ +diff -Nur linux-2.6.29.1.orig/drivers/char/Kconfig linux-2.6.29.1/drivers/char/Kconfig +--- linux-2.6.29.1.orig/drivers/char/Kconfig 2009-04-02 22:55:27.000000000 +0200 ++++ linux-2.6.29.1/drivers/char/Kconfig 2009-06-05 23:38:22.984944077 +0200 +@@ -974,6 +974,15 @@ + To compile this driver as a module, choose M here: the + module will be called mwave. + ++config AR7_GPIO ++ tristate "TI AR7 GPIO Support" ++ depends on AR7 ++ help ++ Give userspace access to the GPIO pins on the Texas Instruments AR7 ++ processors. ++ ++ If compiled as a module, it will be called ar7_gpio. ++ + config SCx200_GPIO + tristate "NatSemi SCx200 GPIO Support" + depends on SCx200 +diff -Nur linux-2.6.29.1.orig/drivers/char/Makefile linux-2.6.29.1/drivers/char/Makefile +--- linux-2.6.29.1.orig/drivers/char/Makefile 2009-04-02 22:55:27.000000000 +0200 ++++ linux-2.6.29.1/drivers/char/Makefile 2009-06-05 23:38:22.984944077 +0200 +@@ -90,6 +90,7 @@ + obj-$(CONFIG_PPDEV) += ppdev.o + obj-$(CONFIG_NWBUTTON) += nwbutton.o + obj-$(CONFIG_NWFLASH) += nwflash.o ++obj-$(CONFIG_AR7_GPIO) += ar7_gpio.o + obj-$(CONFIG_SCx200_GPIO) += scx200_gpio.o + obj-$(CONFIG_PC8736x_GPIO) += pc8736x_gpio.o + obj-$(CONFIG_NSC_GPIO) += nsc_gpio.o diff -Nur linux-2.6.29.1.orig/drivers/char/ar7_gpio.c linux-2.6.29.1/drivers/char/ar7_gpio.c --- linux-2.6.29.1.orig/drivers/char/ar7_gpio.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-2.6.29.1/drivers/char/ar7_gpio.c 2009-05-31 19:53:09.000000000 +0200 ++++ linux-2.6.29.1/drivers/char/ar7_gpio.c 2009-06-05 23:38:22.980943288 +0200 @@ -0,0 +1,158 @@ +/* + * Copyright (C) 2007 Nicolas Thill <nico@openwrt.org> @@ -2477,62 +2549,9 @@ diff -Nur linux-2.6.29.1.orig/drivers/char/ar7_gpio.c linux-2.6.29.1/drivers/cha + +module_init(ar7_gpio_init); +module_exit(ar7_gpio_exit); -diff -Nur linux-2.6.29.1.orig/drivers/char/Kconfig linux-2.6.29.1/drivers/char/Kconfig ---- linux-2.6.29.1.orig/drivers/char/Kconfig 2009-04-02 22:55:27.000000000 +0200 -+++ linux-2.6.29.1/drivers/char/Kconfig 2009-05-31 20:03:22.000000000 +0200 -@@ -974,6 +974,15 @@ - To compile this driver as a module, choose M here: the - module will be called mwave. - -+config AR7_GPIO -+ tristate "TI AR7 GPIO Support" -+ depends on AR7 -+ help -+ Give userspace access to the GPIO pins on the Texas Instruments AR7 -+ processors. -+ -+ If compiled as a module, it will be called ar7_gpio. -+ - config SCx200_GPIO - tristate "NatSemi SCx200 GPIO Support" - depends on SCx200 -diff -Nur linux-2.6.29.1.orig/drivers/char/Makefile linux-2.6.29.1/drivers/char/Makefile ---- linux-2.6.29.1.orig/drivers/char/Makefile 2009-04-02 22:55:27.000000000 +0200 -+++ linux-2.6.29.1/drivers/char/Makefile 2009-05-31 20:03:22.000000000 +0200 -@@ -90,6 +90,7 @@ - obj-$(CONFIG_PPDEV) += ppdev.o - obj-$(CONFIG_NWBUTTON) += nwbutton.o - obj-$(CONFIG_NWFLASH) += nwflash.o -+obj-$(CONFIG_AR7_GPIO) += ar7_gpio.o - obj-$(CONFIG_SCx200_GPIO) += scx200_gpio.o - obj-$(CONFIG_PC8736x_GPIO) += pc8736x_gpio.o - obj-$(CONFIG_NSC_GPIO) += nsc_gpio.o -diff -Nur linux-2.6.29.1.orig/drivers/Kconfig linux-2.6.29.1/drivers/Kconfig ---- linux-2.6.29.1.orig/drivers/Kconfig 2009-04-02 22:55:27.000000000 +0200 -+++ linux-2.6.29.1/drivers/Kconfig 2009-05-31 20:03:35.000000000 +0200 -@@ -104,6 +104,8 @@ - - source "drivers/uio/Kconfig" - -+source "drivers/vlynq/Kconfig" -+ - source "drivers/xen/Kconfig" - - source "drivers/staging/Kconfig" -diff -Nur linux-2.6.29.1.orig/drivers/Makefile linux-2.6.29.1/drivers/Makefile ---- linux-2.6.29.1.orig/drivers/Makefile 2009-04-02 22:55:27.000000000 +0200 -+++ linux-2.6.29.1/drivers/Makefile 2009-05-31 20:03:35.000000000 +0200 -@@ -102,6 +102,7 @@ - obj-$(CONFIG_HID) += hid/ - obj-$(CONFIG_PPC_PS3) += ps3/ - obj-$(CONFIG_OF) += of/ -+obj-$(CONFIG_VLYNQ) += vlynq/ - obj-$(CONFIG_SSB) += ssb/ - obj-$(CONFIG_VIRTIO) += virtio/ - obj-$(CONFIG_STAGING) += staging/ diff -Nur linux-2.6.29.1.orig/drivers/mtd/maps/physmap.c linux-2.6.29.1/drivers/mtd/maps/physmap.c --- linux-2.6.29.1.orig/drivers/mtd/maps/physmap.c 2009-04-02 22:55:27.000000000 +0200 -+++ linux-2.6.29.1/drivers/mtd/maps/physmap.c 2009-05-31 20:02:55.000000000 +0200 ++++ linux-2.6.29.1/drivers/mtd/maps/physmap.c 2009-06-05 23:38:22.996945327 +0200 @@ -80,7 +80,7 @@ "map_rom", NULL }; @@ -2542,9 +2561,21 @@ diff -Nur linux-2.6.29.1.orig/drivers/mtd/maps/physmap.c linux-2.6.29.1/drivers/ #endif static int physmap_flash_probe(struct platform_device *dev) +diff -Nur linux-2.6.29.1.orig/drivers/net/Kconfig linux-2.6.29.1/drivers/net/Kconfig +--- linux-2.6.29.1.orig/drivers/net/Kconfig 2009-04-02 22:55:27.000000000 +0200 ++++ linux-2.6.29.1/drivers/net/Kconfig 2009-06-05 23:38:23.012945970 +0200 +@@ -1741,7 +1741,7 @@ + + config CPMAC + tristate "TI AR7 CPMAC Ethernet support (EXPERIMENTAL)" +- depends on NET_ETHERNET && EXPERIMENTAL && AR7 && BROKEN ++ depends on NET_ETHERNET && EXPERIMENTAL && AR7 + select PHYLIB + help + TI AR7 CPMAC Ethernet support diff -Nur linux-2.6.29.1.orig/drivers/net/cpmac.c linux-2.6.29.1/drivers/net/cpmac.c --- linux-2.6.29.1.orig/drivers/net/cpmac.c 2009-04-02 22:55:27.000000000 +0200 -+++ linux-2.6.29.1/drivers/net/cpmac.c 2009-06-01 15:23:14.000000000 +0200 ++++ linux-2.6.29.1/drivers/net/cpmac.c 2009-06-11 11:03:25.823065413 +0200 @@ -615,13 +615,13 @@ dev_kfree_skb_irq(desc->skb); @@ -2577,12 +2608,8 @@ diff -Nur linux-2.6.29.1.orig/drivers/net/cpmac.c linux-2.6.29.1/drivers/net/cpm struct cpmac_priv *priv = netdev_priv(dev); spin_lock(&priv->lock); -@@ -1093,12 +1091,10 @@ - return 0; - } +@@ -1097,15 +1095,18 @@ --static int external_switch; -- static int __devinit cpmac_probe(struct platform_device *pdev) { - int rc, phy_id, i; @@ -2592,25 +2619,53 @@ diff -Nur linux-2.6.29.1.orig/drivers/net/cpmac.c linux-2.6.29.1/drivers/net/cpm struct resource *mem; struct cpmac_priv *priv; struct net_device *dev; -@@ -1115,16 +1111,13 @@ - } + struct plat_cpmac_data *pdata; + + pdata = pdev->dev.platform_data; ++ strncpy(mdio_bus_id, "0", BUS_ID_SIZE); ++ phy_id = pdev->id; + ++ /* + for (phy_id = 0; phy_id < PHY_MAX_ADDR; phy_id++) { + if (!(pdata->phy_mask & (1 << phy_id))) + continue; +@@ -1116,15 +1117,17 @@ if (phy_id == PHY_MAX_ADDR) { -- if (external_switch || dumb_switch) { + if (external_switch || dumb_switch) { - mdio_bus_id = 0; /* fixed phys bus */ -- phy_id = pdev->id; -- } else { ++ mdio_bus_id = 0; + phy_id = pdev->id; + } else { dev_err(&pdev->dev, "no PHY present\n"); return -ENODEV; } } ++ */ dev = alloc_etherdev_mq(sizeof(*priv), CPMAC_QUEUES); + //~ dev = alloc_etherdev(sizeof(*priv)); if (!dev) { printk(KERN_ERR "cpmac: Unable to allocate net_device\n"); -@@ -1236,17 +1229,11 @@ +@@ -1161,7 +1164,8 @@ + priv->msg_enable = netif_msg_init(debug_level, 0xff); + memcpy(dev->dev_addr, pdata->dev_addr, sizeof(dev->dev_addr)); + +- priv->phy = phy_connect(dev, cpmac_mii->phy_map[phy_id]->dev.bus_id, ++ snprintf(priv->phy_name, BUS_ID_SIZE, PHY_ID_FMT, mdio_bus_id, phy_id); ++ priv->phy = phy_connect(dev, priv->phy_name, + &cpmac_adjust_link, 0, PHY_INTERFACE_MODE_MII); + if (IS_ERR(priv->phy)) { + if (netif_msg_drv(priv)) +@@ -1230,31 +1234,34 @@ + #warning FIXME: unhardcode gpio&reset bits + ar7_gpio_disable(26); + ar7_gpio_disable(27); +- ar7_device_reset(AR7_RESET_BIT_CPMAC_LO); + ar7_device_reset(AR7_RESET_BIT_CPMAC_HI); ++ ar7_device_reset(AR7_RESET_BIT_CPMAC_LO); + ar7_device_reset(AR7_RESET_BIT_EPHY); cpmac_mii->reset(cpmac_mii); @@ -2620,1320 +2675,33 @@ diff -Nur linux-2.6.29.1.orig/drivers/net/cpmac.c linux-2.6.29.1/drivers/net/cpm break; else - cpu_relax(); -- -- mask &= 0x7fffffff; ++ msleep(10); + + mask &= 0x7fffffff; - if (mask & (mask - 1)) { -- external_switch = 1; -- mask = 0; ++ ++ //if (mask & (mask - 1)) { + external_switch = 1; + mask = 0; - } -+ msleep(10); ++ //} ++ /* cpmac_mii->phy_mask = ~(mask | 0x80000000); - snprintf(cpmac_mii->id, MII_BUS_ID_SIZE, "0"); -diff -Nur linux-2.6.29.1.orig/drivers/net/cpmac.c.orig linux-2.6.29.1/drivers/net/cpmac.c.orig ---- linux-2.6.29.1.orig/drivers/net/cpmac.c.orig 1970-01-01 01:00:00.000000000 +0100 -+++ linux-2.6.29.1/drivers/net/cpmac.c.orig 2009-06-01 14:37:40.000000000 +0200 -@@ -0,0 +1,1285 @@ -+/* -+ * Copyright (C) 2006, 2007 Eugene Konev -+ * -+ * 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -+ */ -+ -+#include <linux/module.h> -+#include <linux/init.h> -+#include <linux/moduleparam.h> -+ -+#include <linux/sched.h> -+#include <linux/kernel.h> -+#include <linux/slab.h> -+#include <linux/errno.h> -+#include <linux/types.h> -+#include <linux/delay.h> -+ -+#include <linux/netdevice.h> -+#include <linux/etherdevice.h> -+#include <linux/ethtool.h> -+#include <linux/skbuff.h> -+#include <linux/mii.h> -+#include <linux/phy.h> -+#include <linux/phy_fixed.h> -+#include <linux/platform_device.h> -+#include <linux/dma-mapping.h> -+#include <asm/gpio.h> -+#include <asm/atomic.h> -+ -+MODULE_AUTHOR("Eugene Konev <ejka@imfi.kspu.ru>"); -+MODULE_DESCRIPTION("TI AR7 ethernet driver (CPMAC)"); -+MODULE_LICENSE("GPL"); -+MODULE_ALIAS("platform:cpmac"); -+ -+static int debug_level = 8; -+static int dumb_switch; -+ -+/* Next 2 are only used in cpmac_probe, so it's pointless to change them */ -+module_param(debug_level, int, 0444); -+module_param(dumb_switch, int, 0444); -+ -+MODULE_PARM_DESC(debug_level, "Number of NETIF_MSG bits to enable"); -+MODULE_PARM_DESC(dumb_switch, "Assume switch is not connected to MDIO bus"); -+ -+#define CPMAC_VERSION "0.5.0" -+/* frame size + 802.1q tag */ -+#define CPMAC_SKB_SIZE (ETH_FRAME_LEN + 4) -+#define CPMAC_QUEUES 8 -+ -+/* Ethernet registers */ -+#define CPMAC_TX_CONTROL 0x0004 -+#define CPMAC_TX_TEARDOWN 0x0008 -+#define CPMAC_RX_CONTROL 0x0014 -+#define CPMAC_RX_TEARDOWN 0x0018 -+#define CPMAC_MBP 0x0100 -+# define MBP_RXPASSCRC 0x40000000 -+# define MBP_RXQOS 0x20000000 -+# define MBP_RXNOCHAIN 0x10000000 -+# define MBP_RXCMF 0x01000000 -+# define MBP_RXSHORT 0x00800000 -+# define MBP_RXCEF 0x00400000 -+# define MBP_RXPROMISC 0x00200000 -+# define MBP_PROMISCCHAN(channel) (((channel) & 0x7) << 16) -+# define MBP_RXBCAST 0x00002000 -+# define MBP_BCASTCHAN(channel) (((channel) & 0x7) << 8) -+# define MBP_RXMCAST 0x00000020 -+# define MBP_MCASTCHAN(channel) ((channel) & 0x7) -+#define CPMAC_UNICAST_ENABLE 0x0104 -+#define CPMAC_UNICAST_CLEAR 0x0108 -+#define CPMAC_MAX_LENGTH 0x010c -+#define CPMAC_BUFFER_OFFSET 0x0110 -+#define CPMAC_MAC_CONTROL 0x0160 -+# define MAC_TXPTYPE 0x00000200 -+# define MAC_TXPACE 0x00000040 -+# define MAC_MII 0x00000020 -+# define MAC_TXFLOW 0x00000010 -+# define MAC_RXFLOW 0x00000008 -+# define MAC_MTEST 0x00000004 -+# define MAC_LOOPBACK 0x00000002 -+# define MAC_FDX 0x00000001 -+#define CPMAC_MAC_STATUS 0x0164 -+# define MAC_STATUS_QOS 0x00000004 -+# define MAC_STATUS_RXFLOW 0x00000002 -+# define MAC_STATUS_TXFLOW 0x00000001 -+#define CPMAC_TX_INT_ENABLE 0x0178 -+#define CPMAC_TX_INT_CLEAR 0x017c -+#define CPMAC_MAC_INT_VECTOR 0x0180 -+# define MAC_INT_STATUS 0x00080000 -+# define MAC_INT_HOST 0x00040000 -+# define MAC_INT_RX 0x00020000 -+# define MAC_INT_TX 0x00010000 -+#define CPMAC_MAC_EOI_VECTOR 0x0184 -+#define CPMAC_RX_INT_ENABLE 0x0198 -+#define CPMAC_RX_INT_CLEAR 0x019c -+#define CPMAC_MAC_INT_ENABLE 0x01a8 -+#define CPMAC_MAC_INT_CLEAR 0x01ac -+#define CPMAC_MAC_ADDR_LO(channel) (0x01b0 + (channel) * 4) -+#define CPMAC_MAC_ADDR_MID 0x01d0 -+#define CPMAC_MAC_ADDR_HI 0x01d4 -+#define CPMAC_MAC_HASH_LO 0x01d8 -+#define CPMAC_MAC_HASH_HI 0x01dc -+#define CPMAC_TX_PTR(channel) (0x0600 + (channel) * 4) -+#define CPMAC_RX_PTR(channel) (0x0620 + (channel) * 4) -+#define CPMAC_TX_ACK(channel) (0x0640 + (channel) * 4) -+#define CPMAC_RX_ACK(channel) (0x0660 + (channel) * 4) -+#define CPMAC_REG_END 0x0680 -+/* -+ * Rx/Tx statistics -+ * TODO: use some of them to fill stats in cpmac_stats() -+ */ -+#define CPMAC_STATS_RX_GOOD 0x0200 -+#define CPMAC_STATS_RX_BCAST 0x0204 -+#define CPMAC_STATS_RX_MCAST 0x0208 -+#define CPMAC_STATS_RX_PAUSE 0x020c -+#define CPMAC_STATS_RX_CRC 0x0210 -+#define CPMAC_STATS_RX_ALIGN 0x0214 -+#define CPMAC_STATS_RX_OVER 0x0218 -+#define CPMAC_STATS_RX_JABBER 0x021c -+#define CPMAC_STATS_RX_UNDER 0x0220 -+#define CPMAC_STATS_RX_FRAG 0x0224 -+#define CPMAC_STATS_RX_FILTER 0x0228 -+#define CPMAC_STATS_RX_QOSFILTER 0x022c -+#define CPMAC_STATS_RX_OCTETS 0x0230 -+ -+#define CPMAC_STATS_TX_GOOD 0x0234 -+#define CPMAC_STATS_TX_BCAST 0x0238 -+#define CPMAC_STATS_TX_MCAST 0x023c -+#define CPMAC_STATS_TX_PAUSE 0x0240 -+#define CPMAC_STATS_TX_DEFER 0x0244 -+#define CPMAC_STATS_TX_COLLISION 0x0248 -+#define CPMAC_STATS_TX_SINGLECOLL 0x024c -+#define CPMAC_STATS_TX_MULTICOLL 0x0250 -+#define CPMAC_STATS_TX_EXCESSCOLL 0x0254 -+#define CPMAC_STATS_TX_LATECOLL 0x0258 -+#define CPMAC_STATS_TX_UNDERRUN 0x025c -+#define CPMAC_STATS_TX_CARRIERSENSE 0x0260 -+#define CPMAC_STATS_TX_OCTETS 0x0264 -+ -+#define cpmac_read(base, reg) (readl((void __iomem *)(base) + (reg))) -+#define cpmac_write(base, reg, val) (writel(val, (void __iomem *)(base) + \ -+ (reg))) -+ -+/* MDIO bus */ -+#define CPMAC_MDIO_VERSION 0x0000 -+#define CPMAC_MDIO_CONTROL 0x0004 -+# define MDIOC_IDLE 0x80000000 -+# define MDIOC_ENABLE 0x40000000 -+# define MDIOC_PREAMBLE 0x00100000 -+# define MDIOC_FAULT 0x00080000 -+# define MDIOC_FAULTDETECT 0x00040000 -+# define MDIOC_INTTEST 0x00020000 -+# define MDIOC_CLKDIV(div) ((div) & 0xff) -+#define CPMAC_MDIO_ALIVE 0x0008 |