From aed622fd2cccaac076436139e74fe408f6f1d9d7 Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Sun, 10 Apr 2011 15:08:28 +0000 Subject: [PATCH] amazon: Upgrade amazon target to kernel 2.6.37 This was just a little bit tested on an SAMSUNG SMT-G3020 and pci and usb do not work like before. SVN-Revision: 26576 --- target/linux/amazon/Makefile | 8 +- target/linux/amazon/config-2.6.30 | 12 +- target/linux/amazon/config-2.6.32 | 13 +- target/linux/amazon/config-2.6.37 | 111 ++++++++++++++++++ .../amazon/files/arch/mips/amazon/dma-core.c | 15 ++- .../linux/amazon/files/drivers/net/admmod.c | 12 +- .../files/drivers/watchdog/amazon_wdt.c | 9 ++ .../patches-2.6.30/140-net_drivers.patch | 2 +- .../amazon/patches-2.6.32/100-board.patch | 2 +- .../patches-2.6.32/140-net_drivers.patch | 2 +- .../amazon/patches-2.6.32/160-cfi-swap.patch | 10 +- .../patches-2.6.37/000-mips-bad-intctl.patch | 33 ++++++ .../010-mips_clocksource_init_war.patch | 33 ++++++ .../patches-2.6.37/017-wdt-driver.patch | 10 ++ .../amazon/patches-2.6.37/100-board.patch | 53 +++++++++ .../patches-2.6.37/130-mtd_drivers.patch | 7 ++ .../patches-2.6.37/140-net_drivers.patch | 9 ++ .../patches-2.6.37/150-serial_driver.patch | 10 ++ .../amazon/patches-2.6.37/160-cfi-swap.patch | 56 +++++++++ 19 files changed, 380 insertions(+), 27 deletions(-) create mode 100644 target/linux/amazon/config-2.6.37 create mode 100644 target/linux/amazon/patches-2.6.37/000-mips-bad-intctl.patch create mode 100644 target/linux/amazon/patches-2.6.37/010-mips_clocksource_init_war.patch create mode 100644 target/linux/amazon/patches-2.6.37/017-wdt-driver.patch create mode 100644 target/linux/amazon/patches-2.6.37/100-board.patch create mode 100644 target/linux/amazon/patches-2.6.37/130-mtd_drivers.patch create mode 100644 target/linux/amazon/patches-2.6.37/140-net_drivers.patch create mode 100644 target/linux/amazon/patches-2.6.37/150-serial_driver.patch create mode 100644 target/linux/amazon/patches-2.6.37/160-cfi-swap.patch diff --git a/target/linux/amazon/Makefile b/target/linux/amazon/Makefile index aae39a00e9..e90fc4c8bd 100644 --- a/target/linux/amazon/Makefile +++ b/target/linux/amazon/Makefile @@ -10,7 +10,7 @@ ARCH:=mips BOARD:=amazon BOARDNAME:=Infineon Amazon FEATURES:=squashfs jffs2 broken -LINUX_VERSION:=2.6.30.10 +LINUX_VERSION:=2.6.37.6 include $(INCLUDE_DIR)/target.mk @@ -18,4 +18,10 @@ define Target/Description Build firmware images for Infineon Amazon boards endef +define Kernel/Prepare + $(call Kernel/Prepare/Default) + mkdir -p $(LINUX_DIR)/arch/mips/include/asm/amazon + $(CP) $(LINUX_DIR)/include/asm-mips/amazon/*.h $(LINUX_DIR)/arch/mips/include/asm/amazon +endef + $(eval $(call BuildTarget)) diff --git a/target/linux/amazon/config-2.6.30 b/target/linux/amazon/config-2.6.30 index 45f2e6366e..398976ac1a 100644 --- a/target/linux/amazon/config-2.6.30 +++ b/target/linux/amazon/config-2.6.30 @@ -1,12 +1,12 @@ CONFIG_32BIT=y # CONFIG_64BIT is not set CONFIG_ADM6996_SUPPORT=y +CONFIG_AMAZON=y CONFIG_AMAZON_ASC_UART=y CONFIG_AMAZON_MTD=y CONFIG_AMAZON_NET_SW=y CONFIG_AMAZON_PCI=y CONFIG_AMAZON_WDT=y -CONFIG_AMAZON=y # CONFIG_ARCH_HAS_ILOG2_U32 is not set # CONFIG_ARCH_HAS_ILOG2_U64 is not set CONFIG_ARCH_POPULATES_NODE_MAP=y @@ -18,8 +18,8 @@ CONFIG_ARCH_SUSPEND_POSSIBLE=y CONFIG_BITREVERSE=y # CONFIG_CAVIUM_OCTEON_REFERENCE_BOARD is not set # CONFIG_CAVIUM_OCTEON_SIMULATOR is not set -CONFIG_CEVT_R4K_LIB=y CONFIG_CEVT_R4K=y +CONFIG_CEVT_R4K_LIB=y CONFIG_CMDLINE="console=ttyS0,115200 rootfstype=squashfs,jffs2 init=/bin/sh" CONFIG_CPU_BIG_ENDIAN=y # CONFIG_CPU_CAVIUM_OCTEON is not set @@ -28,9 +28,9 @@ CONFIG_CPU_HAS_PREFETCH=y CONFIG_CPU_HAS_SYNC=y # CONFIG_CPU_LITTLE_ENDIAN is not set # CONFIG_CPU_LOONGSON2 is not set +CONFIG_CPU_MIPS32=y # CONFIG_CPU_MIPS32_R1 is not set CONFIG_CPU_MIPS32_R2=y -CONFIG_CPU_MIPS32=y # CONFIG_CPU_MIPS64_R1 is not set # CONFIG_CPU_MIPS64_R2 is not set CONFIG_CPU_MIPSR2=y @@ -52,16 +52,16 @@ CONFIG_CPU_SUPPORTS_HIGHMEM=y # CONFIG_CPU_TX39XX is not set # CONFIG_CPU_TX49XX is not set # CONFIG_CPU_VR41XX is not set -CONFIG_CSRC_R4K_LIB=y CONFIG_CSRC_R4K=y +CONFIG_CSRC_R4K_LIB=y CONFIG_DECOMPRESS_LZMA=y CONFIG_DEVPORT=y # CONFIG_DM9000 is not set CONFIG_DMA_NEED_PCI_MAP_STATE=y CONFIG_DMA_NONCOHERENT=y CONFIG_EARLY_PRINTK=y -CONFIG_GENERIC_CLOCKEVENTS_BUILD=y CONFIG_GENERIC_CLOCKEVENTS=y +CONFIG_GENERIC_CLOCKEVENTS_BUILD=y CONFIG_GENERIC_CMOS_UPDATE=y CONFIG_GENERIC_FIND_LAST_BIT=y CONFIG_GENERIC_FIND_NEXT_BIT=y @@ -89,6 +89,7 @@ CONFIG_KALLSYMS=y # CONFIG_MACH_TX49XX is not set # CONFIG_MACH_VR41XX is not set # CONFIG_MIKROTIK_RB532 is not set +CONFIG_MIPS=y # CONFIG_MIPS_COBALT is not set CONFIG_MIPS_L1_CACHE_SHIFT=5 # CONFIG_MIPS_MACHINE is not set @@ -97,7 +98,6 @@ CONFIG_MIPS_MT_DISABLED=y # CONFIG_MIPS_MT_SMP is not set # CONFIG_MIPS_MT_SMTC is not set # CONFIG_MIPS_SIM is not set -CONFIG_MIPS=y CONFIG_MTD_AMAZON_BUS_WIDTH_16=y # CONFIG_MTD_AMAZON_BUS_WIDTH_32 is not set # CONFIG_MTD_AMAZON_BUS_WIDTH_8 is not set diff --git a/target/linux/amazon/config-2.6.32 b/target/linux/amazon/config-2.6.32 index 9239dabc21..1a2cd16ca6 100644 --- a/target/linux/amazon/config-2.6.32 +++ b/target/linux/amazon/config-2.6.32 @@ -2,12 +2,12 @@ CONFIG_32BIT=y # CONFIG_64BIT is not set CONFIG_ADM6996_SUPPORT=y # CONFIG_ALCHEMY_GPIO_INDIRECT is not set +CONFIG_AMAZON=y CONFIG_AMAZON_ASC_UART=y CONFIG_AMAZON_MTD=y CONFIG_AMAZON_NET_SW=y CONFIG_AMAZON_PCI=y CONFIG_AMAZON_WDT=y -CONFIG_AMAZON=y # CONFIG_AR7 is not set # CONFIG_ARCH_HAS_ILOG2_U32 is not set # CONFIG_ARCH_HAS_ILOG2_U64 is not set @@ -21,8 +21,8 @@ CONFIG_ARCH_SUSPEND_POSSIBLE=y CONFIG_BITREVERSE=y # CONFIG_CAVIUM_OCTEON_REFERENCE_BOARD is not set # CONFIG_CAVIUM_OCTEON_SIMULATOR is not set -CONFIG_CEVT_R4K_LIB=y CONFIG_CEVT_R4K=y +CONFIG_CEVT_R4K_LIB=y CONFIG_CFG80211_DEFAULT_PS_VALUE=0 CONFIG_CMDLINE="console=ttyS0,115200 rootfstype=squashfs,jffs2 init=/bin/sh" CONFIG_CPU_BIG_ENDIAN=y @@ -31,9 +31,9 @@ CONFIG_CPU_HAS_PREFETCH=y CONFIG_CPU_HAS_SYNC=y # CONFIG_CPU_LITTLE_ENDIAN is not set # CONFIG_CPU_LOONGSON2E is not set +CONFIG_CPU_MIPS32=y # CONFIG_CPU_MIPS32_R1 is not set CONFIG_CPU_MIPS32_R2=y -CONFIG_CPU_MIPS32=y # CONFIG_CPU_MIPS64_R1 is not set # CONFIG_CPU_MIPS64_R2 is not set CONFIG_CPU_MIPSR2=y @@ -55,8 +55,8 @@ CONFIG_CPU_SUPPORTS_HIGHMEM=y # CONFIG_CPU_TX39XX is not set # CONFIG_CPU_TX49XX is not set # CONFIG_CPU_VR41XX is not set -CONFIG_CSRC_R4K_LIB=y CONFIG_CSRC_R4K=y +CONFIG_CSRC_R4K_LIB=y CONFIG_DECOMPRESS_LZMA=y CONFIG_DEVPORT=y # CONFIG_DM9000 is not set @@ -64,8 +64,8 @@ CONFIG_DMA_NEED_PCI_MAP_STATE=y CONFIG_DMA_NONCOHERENT=y CONFIG_EARLY_PRINTK=y # CONFIG_FSNOTIFY is not set -CONFIG_GENERIC_CLOCKEVENTS_BUILD=y CONFIG_GENERIC_CLOCKEVENTS=y +CONFIG_GENERIC_CLOCKEVENTS_BUILD=y CONFIG_GENERIC_CMOS_UPDATE=y CONFIG_GENERIC_FIND_LAST_BIT=y CONFIG_GENERIC_FIND_NEXT_BIT=y @@ -92,6 +92,7 @@ CONFIG_KALLSYMS=y # CONFIG_MACH_TX49XX is not set # CONFIG_MACH_VR41XX is not set # CONFIG_MIKROTIK_RB532 is not set +CONFIG_MIPS=y # CONFIG_MIPS_COBALT is not set CONFIG_MIPS_L1_CACHE_SHIFT=5 # CONFIG_MIPS_MACHINE is not set @@ -100,7 +101,6 @@ CONFIG_MIPS_MT_DISABLED=y # CONFIG_MIPS_MT_SMP is not set # CONFIG_MIPS_MT_SMTC is not set # CONFIG_MIPS_SIM is not set -CONFIG_MIPS=y CONFIG_MTD_AMAZON_BUS_WIDTH_16=y # CONFIG_MTD_AMAZON_BUS_WIDTH_32 is not set # CONFIG_MTD_AMAZON_BUS_WIDTH_8 is not set @@ -125,7 +125,6 @@ CONFIG_PCI_DOMAINS=y # CONFIG_PMC_YOSEMITE is not set # CONFIG_PNX8550_JBS is not set # CONFIG_PNX8550_STB810 is not set -# CONFIG_PROBE_INITRD_HEADER is not set CONFIG_SCHED_OMIT_FRAME_POINTER=y # CONFIG_SCSI_DMA is not set # CONFIG_SERIAL_8250 is not set diff --git a/target/linux/amazon/config-2.6.37 b/target/linux/amazon/config-2.6.37 new file mode 100644 index 0000000000..ca76524273 --- /dev/null +++ b/target/linux/amazon/config-2.6.37 @@ -0,0 +1,111 @@ +CONFIG_ADM6996_SUPPORT=y +CONFIG_AMAZON=y +CONFIG_AMAZON_ASC_UART=y +CONFIG_AMAZON_MTD=y +CONFIG_AMAZON_NET_SW=y +CONFIG_AMAZON_PCI=y +CONFIG_AMAZON_WDT=y +# CONFIG_ARCH_HAS_ILOG2_U32 is not set +# CONFIG_ARCH_HAS_ILOG2_U64 is not set +CONFIG_ARCH_HIBERNATION_POSSIBLE=y +# CONFIG_ARCH_PHYS_ADDR_T_64BIT is not set +CONFIG_ARCH_POPULATES_NODE_MAP=y +# CONFIG_ARCH_SUPPORTS_MSI is not set +CONFIG_ARCH_SUPPORTS_OPROFILE=y +CONFIG_ARCH_SUSPEND_POSSIBLE=y +# CONFIG_AUTO_IRQ_AFFINITY is not set +CONFIG_CEVT_R4K=y +CONFIG_CEVT_R4K_LIB=y +CONFIG_CMDLINE="console=ttyS0,115200 rootfstype=squashfs,jffs2 init=/bin/sh" +CONFIG_CMDLINE_BOOL=y +CONFIG_CMDLINE_OVERRIDE=y +CONFIG_CPU_BIG_ENDIAN=y +CONFIG_CPU_HAS_PREFETCH=y +CONFIG_CPU_HAS_SYNC=y +CONFIG_CPU_MIPS32=y +# CONFIG_CPU_MIPS32_R1 is not set +CONFIG_CPU_MIPS32_R2=y +CONFIG_CPU_MIPSR2=y +CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y +CONFIG_CPU_SUPPORTS_HIGHMEM=y +CONFIG_CSRC_R4K=y +CONFIG_CSRC_R4K_LIB=y +CONFIG_DECOMPRESS_LZMA=y +CONFIG_DMA_NONCOHERENT=y +CONFIG_EARLY_PRINTK=y +# CONFIG_FSNOTIFY is not set +CONFIG_GENERIC_ATOMIC64=y +CONFIG_GENERIC_CLOCKEVENTS=y +CONFIG_GENERIC_CLOCKEVENTS_BUILD=y +CONFIG_GENERIC_CMOS_UPDATE=y +CONFIG_GENERIC_FIND_LAST_BIT=y +CONFIG_GENERIC_FIND_NEXT_BIT=y +# CONFIG_GENERIC_HARDIRQS_NO_DEPRECATED is not set +CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y +# CONFIG_GENERIC_PENDING_IRQ is not set +# CONFIG_HARDIRQS_SW_RESEND is not set +CONFIG_HARDWARE_WATCHPOINTS=y +CONFIG_HAS_DMA=y +CONFIG_HAS_IOMEM=y +CONFIG_HAS_IOPORT=y +CONFIG_HAVE_ARCH_KGDB=y +CONFIG_HAVE_C_RECORDMCOUNT=y +CONFIG_HAVE_DMA_API_DEBUG=y +CONFIG_HAVE_DMA_ATTRS=y +CONFIG_HAVE_DYNAMIC_FTRACE=y +CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y +CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y +CONFIG_HAVE_FUNCTION_TRACER=y +CONFIG_HAVE_FUNCTION_TRACE_MCOUNT_TEST=y +CONFIG_HAVE_GENERIC_DMA_COHERENT=y +CONFIG_HAVE_GENERIC_HARDIRQS=y +CONFIG_HAVE_IDE=y +CONFIG_HAVE_OPROFILE=y +CONFIG_HAVE_PERF_EVENTS=y +# CONFIG_HAVE_SPARSE_IRQ is not set +CONFIG_HAVE_STD_PC_SERIAL_PORT=y +CONFIG_HW_HAS_PCI=y +CONFIG_HW_RANDOM=y +CONFIG_INITRAMFS_SOURCE="" +CONFIG_IRQ_CPU=y +# CONFIG_IRQ_PER_CPU is not set +CONFIG_KALLSYMS=y +CONFIG_LOONGSON_UART_BASE=y +CONFIG_MACH_NO_WESTBRIDGE=y +CONFIG_MIPS=y +CONFIG_MIPS_L1_CACHE_SHIFT=5 +# CONFIG_MIPS_MACHINE is not set +CONFIG_MIPS_MT_DISABLED=y +CONFIG_MTD_AMAZON_BUS_WIDTH_16=y +# CONFIG_MTD_AMAZON_BUS_WIDTH_32 is not set +# CONFIG_MTD_AMAZON_BUS_WIDTH_8 is not set +# CONFIG_MTD_AMAZON_FLASH_SIZE_16 is not set +# CONFIG_MTD_AMAZON_FLASH_SIZE_2 is not set +CONFIG_MTD_AMAZON_FLASH_SIZE_4=y +# CONFIG_MTD_AMAZON_FLASH_SIZE_8 is not set +CONFIG_MTD_CFI_ADV_OPTIONS=y +# CONFIG_MTD_CFI_GEOMETRY is not set +# CONFIG_MTD_CFI_INTELEXT is not set +CONFIG_MTD_PHYSMAP=y +CONFIG_MTD_REDBOOT_DIRECTORY_BLOCK=-3 +CONFIG_MTD_REDBOOT_PARTS=y +CONFIG_NEED_DMA_MAP_STATE=y +CONFIG_NEED_PER_CPU_KM=y +# CONFIG_NET_PCI is not set +CONFIG_PAGEFLAGS_EXTENDED=y +CONFIG_PCI=y +CONFIG_PCI_DOMAINS=y +CONFIG_PERF_USE_VMALLOC=y +# CONFIG_PREEMPT_RCU is not set +# CONFIG_QUOTACTL is not set +# CONFIG_SCSI_DMA is not set +# CONFIG_SERIAL_8250 is not set +CONFIG_SWAP_IO_SPACE=y +CONFIG_SYS_HAS_CPU_MIPS32_R1=y +CONFIG_SYS_HAS_CPU_MIPS32_R2=y +CONFIG_SYS_HAS_EARLY_PRINTK=y +CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y +CONFIG_SYS_SUPPORTS_ARBIT_HZ=y +CONFIG_SYS_SUPPORTS_BIG_ENDIAN=y +CONFIG_USB_SUPPORT=y +CONFIG_ZONE_DMA_FLAG=0 diff --git a/target/linux/amazon/files/arch/mips/amazon/dma-core.c b/target/linux/amazon/files/arch/mips/amazon/dma-core.c index 6362895f87..8cb4085202 100644 --- a/target/linux/amazon/files/arch/mips/amazon/dma-core.c +++ b/target/linux/amazon/files/arch/mips/amazon/dma-core.c @@ -73,6 +73,7 @@ int (*tpe_inject) (void); #endif // AMAZON_DMA_TPE_AAL5_RECOVERY +#include #include #include #include @@ -266,7 +267,7 @@ inline void rx_chan_clear_isr(int chan_no) #endif } - +#ifdef AMAZON_DMA_TPE_AAL5_RECOVERY /* Brief: hacking function, this will reset all descriptors back to DMA */ static void dma_reset_all_descriptors(int chan_no) @@ -285,7 +286,6 @@ static void dma_reset_all_descriptors(int chan_no) } } -#ifdef AMAZON_DMA_TPE_AAL5_RECOVERY /* Brief: Reset DMA descriptors */ static void amazon_dma_reset_tpe_rx(int chan_no) @@ -1344,10 +1344,13 @@ static int dma_release(struct inode *inode, struct file *file) return 0; } +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)) +static long dma_ioctl(struct file *file, unsigned int cmd, unsigned long arg) +#else static int dma_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg) +#endif { int value = 0; - int result = 0; int chan_no = 0; switch (cmd) { @@ -1366,7 +1369,7 @@ static int dma_ioctl(struct inode *inode, struct file *file, unsigned int cmd, u default: break; } - return result; + return 0; } @@ -1374,7 +1377,11 @@ static struct file_operations dma_fops = { owner:THIS_MODULE, open:dma_open, release:dma_release, +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)) + unlocked_ioctl:dma_ioctl, +#else ioctl:dma_ioctl, +#endif }; static int dma_init(void) diff --git a/target/linux/amazon/files/drivers/net/admmod.c b/target/linux/amazon/files/drivers/net/admmod.c index 70ba1496a1..473a1f6387 100644 --- a/target/linux/amazon/files/drivers/net/admmod.c +++ b/target/linux/amazon/files/drivers/net/admmod.c @@ -39,6 +39,7 @@ /* 507281:linmars 2005/07/28 support MDIO/EEPROM config mode */ /* 509201:linmars remove driver testing codes */ +#include #include #include #include @@ -948,7 +949,12 @@ int adm_release(struct inode *inode, struct file *filp) } /* IOCTL function */ -int adm_ioctl(struct inode *inode, struct file *filp, unsigned int cmd, unsigned long args) + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)) +static long adm_ioctl(struct file *filp, unsigned int cmd, unsigned long args) +#else +static int adm_ioctl(struct inode *inode, struct file *filp, unsigned int cmd, unsigned long args) +#endif { PREGRW uREGRW; unsigned int rtval; @@ -1346,7 +1352,11 @@ struct file_operations adm_ops = write: adm_write, open: adm_open, release: adm_release, +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)) + unlocked_ioctl: adm_ioctl +#else ioctl: adm_ioctl +#endif }; int adm_proc(char *buf, char **start, off_t offset, int count, int *eof, void *data) diff --git a/target/linux/amazon/files/drivers/watchdog/amazon_wdt.c b/target/linux/amazon/files/drivers/watchdog/amazon_wdt.c index fcf1649d85..89f1e2281c 100644 --- a/target/linux/amazon/files/drivers/watchdog/amazon_wdt.c +++ b/target/linux/amazon/files/drivers/watchdog/amazon_wdt.c @@ -17,6 +17,7 @@ * Copyright (C) 2007 John Crispin */ +#include #include #include #include @@ -118,7 +119,11 @@ void wdt_disable(void) return; } +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)) +static long wdt_ioctl(struct file *file, unsigned int cmd, unsigned long arg) +#else static int wdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg) +#endif { int result=0; static int timeout=-1; @@ -201,7 +206,11 @@ int wdt_register_proc_read(char *buf, char **start, off_t offset, static struct file_operations wdt_fops = { read: wdt_read, write: wdt_write, +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)) + unlocked_ioctl: wdt_ioctl, +#else ioctl: wdt_ioctl, +#endif open: wdt_open, release: wdt_release, }; diff --git a/target/linux/amazon/patches-2.6.30/140-net_drivers.patch b/target/linux/amazon/patches-2.6.30/140-net_drivers.patch index 5c677fd2eb..c7f55bb7f6 100644 --- a/target/linux/amazon/patches-2.6.30/140-net_drivers.patch +++ b/target/linux/amazon/patches-2.6.30/140-net_drivers.patch @@ -1,6 +1,6 @@ --- a/drivers/net/Makefile +++ b/drivers/net/Makefile -@@ -272,3 +272,6 @@ obj-$(CONFIG_VIRTIO_NET) += virtio_net.o +@@ -271,3 +271,6 @@ obj-$(CONFIG_VIRTIO_NET) += virtio_net.o obj-$(CONFIG_SFC) += sfc/ obj-$(CONFIG_WIMAX) += wimax/ diff --git a/target/linux/amazon/patches-2.6.32/100-board.patch b/target/linux/amazon/patches-2.6.32/100-board.patch index d1d9c471a1..b109b13c6b 100644 --- a/target/linux/amazon/patches-2.6.32/100-board.patch +++ b/target/linux/amazon/patches-2.6.32/100-board.patch @@ -33,7 +33,7 @@ source "arch/mips/bcm63xx/Kconfig" --- a/arch/mips/Makefile +++ b/arch/mips/Makefile -@@ -296,6 +296,13 @@ cflags-$(CONFIG_SOC_AU1X00) += -I$(srctr +@@ -298,6 +298,13 @@ cflags-$(CONFIG_SOC_AU1X00) += -I$(srctr # diff --git a/target/linux/amazon/patches-2.6.32/140-net_drivers.patch b/target/linux/amazon/patches-2.6.32/140-net_drivers.patch index e64908c768..322420b8e8 100644 --- a/target/linux/amazon/patches-2.6.32/140-net_drivers.patch +++ b/target/linux/amazon/patches-2.6.32/140-net_drivers.patch @@ -1,6 +1,6 @@ --- a/drivers/net/Makefile +++ b/drivers/net/Makefile -@@ -286,3 +286,6 @@ obj-$(CONFIG_VIRTIO_NET) += virtio_net.o +@@ -285,3 +285,6 @@ obj-$(CONFIG_VIRTIO_NET) += virtio_net.o obj-$(CONFIG_SFC) += sfc/ obj-$(CONFIG_WIMAX) += wimax/ diff --git a/target/linux/amazon/patches-2.6.32/160-cfi-swap.patch b/target/linux/amazon/patches-2.6.32/160-cfi-swap.patch index bb89f6110d..48b84f4c03 100644 --- a/target/linux/amazon/patches-2.6.32/160-cfi-swap.patch +++ b/target/linux/amazon/patches-2.6.32/160-cfi-swap.patch @@ -1,6 +1,6 @@ --- a/drivers/mtd/chips/cfi_cmdset_0002.c +++ b/drivers/mtd/chips/cfi_cmdset_0002.c -@@ -1079,6 +1079,9 @@ static int __xipram do_write_oneword(str +@@ -1107,6 +1107,9 @@ static int __xipram do_write_oneword(str int retry_cnt = 0; adr += chip->start; @@ -10,7 +10,7 @@ spin_lock(chip->mutex); ret = get_chip(map, chip, adr, FL_WRITING); -@@ -1361,7 +1364,11 @@ static int __xipram do_write_buffer(stru +@@ -1389,7 +1392,11 @@ static int __xipram do_write_buffer(stru z = 0; while(z < words * map_bankwidth(map)) { datum = map_word_load(map, buf); @@ -22,7 +22,7 @@ z += map_bankwidth(map); buf += map_bankwidth(map); -@@ -1606,6 +1613,9 @@ static int __xipram do_erase_oneblock(st +@@ -1634,6 +1641,9 @@ static int __xipram do_erase_oneblock(st int ret = 0; adr += chip->start; @@ -32,7 +32,7 @@ spin_lock(chip->mutex); ret = get_chip(map, chip, adr, FL_ERASING); -@@ -1734,6 +1744,10 @@ static int do_atmel_lock(struct map_info +@@ -1762,6 +1772,10 @@ static int do_atmel_lock(struct map_info struct cfi_private *cfi = map->fldrv_priv; int ret; @@ -43,7 +43,7 @@ spin_lock(chip->mutex); ret = get_chip(map, chip, adr + chip->start, FL_LOCKING); if (ret) -@@ -1770,6 +1784,10 @@ static int do_atmel_unlock(struct map_in +@@ -1798,6 +1812,10 @@ static int do_atmel_unlock(struct map_in struct cfi_private *cfi = map->fldrv_priv; int ret; diff --git a/target/linux/amazon/patches-2.6.37/000-mips-bad-intctl.patch b/target/linux/amazon/patches-2.6.37/000-mips-bad-intctl.patch new file mode 100644 index 0000000000..f89e078e70 --- /dev/null +++ b/target/linux/amazon/patches-2.6.37/000-mips-bad-intctl.patch @@ -0,0 +1,33 @@ +--- a/arch/mips/kernel/traps.c ++++ b/arch/mips/kernel/traps.c +@@ -1578,7 +1578,16 @@ void __cpuinit per_cpu_trap_init(void) + if (cpu_has_mips_r2) { + cp0_compare_irq_shift = CAUSEB_TI - CAUSEB_IP; + cp0_compare_irq = (read_c0_intctl() >> INTCTLB_IPTI) & 7; ++ if (!cp0_compare_irq) ++ cp0_compare_irq = CP0_LEGACY_COMPARE_IRQ; ++ + cp0_perfcount_irq = (read_c0_intctl() >> INTCTLB_IPPCI) & 7; ++ if (!cp0_perfcount_irq) ++ cp0_perfcount_irq = CP0_LEGACY_PERFCNT_IRQ; ++ ++ if (arch_fixup_c0_irqs) ++ arch_fixup_c0_irqs(); ++ + if (cp0_perfcount_irq == cp0_compare_irq) + cp0_perfcount_irq = -1; + } else { +--- a/arch/mips/include/asm/irq.h ++++ b/arch/mips/include/asm/irq.h +@@ -138,9 +138,11 @@ extern void free_irqno(unsigned int irq) + * IE7. Since R2 their number has to be read from the c0_intctl register. + */ + #define CP0_LEGACY_COMPARE_IRQ 7 ++#define CP0_LEGACY_PERFCNT_IRQ 7 + + extern int cp0_compare_irq; + extern int cp0_compare_irq_shift; + extern int cp0_perfcount_irq; ++extern void __weak arch_fixup_c0_irqs(void); + + #endif /* _ASM_IRQ_H */ diff --git a/target/linux/amazon/patches-2.6.37/010-mips_clocksource_init_war.patch b/target/linux/amazon/patches-2.6.37/010-mips_clocksource_init_war.patch new file mode 100644 index 0000000000..7078b37437 --- /dev/null +++ b/target/linux/amazon/patches-2.6.37/010-mips_clocksource_init_war.patch @@ -0,0 +1,33 @@ +--- a/arch/mips/kernel/cevt-r4k.c ++++ b/arch/mips/kernel/cevt-r4k.c +@@ -23,6 +23,22 @@ + + #ifndef CONFIG_MIPS_MT_SMTC + ++/* ++ * Compare interrupt can be routed and latched outside the core, ++ * so a single execution hazard barrier may not be enough to give ++ * it time to clear as seen in the Cause register. 4 time the ++ * pipeline depth seems reasonably conservative, and empirically ++ * works better in configurations with high CPU/bus clock ratios. ++ */ ++ ++#define compare_change_hazard() \ ++ do { \ ++ irq_disable_hazard(); \ ++ irq_disable_hazard(); \ ++ irq_disable_hazard(); \ ++ irq_disable_hazard(); \ ++ } while (0) ++ + static int mips_next_event(unsigned long delta, + struct clock_event_device *evt) + { +@@ -32,6 +48,7 @@ static int mips_next_event(unsigned long + cnt = read_c0_count(); + cnt += delta; + write_c0_compare(cnt); ++ compare_change_hazard(); + res = ((int)(read_c0_count() - cnt) >= 0) ? -ETIME : 0; + return res; + } diff --git a/target/linux/amazon/patches-2.6.37/017-wdt-driver.patch b/target/linux/amazon/patches-2.6.37/017-wdt-driver.patch new file mode 100644 index 0000000000..63da655f6e --- /dev/null +++ b/target/linux/amazon/patches-2.6.37/017-wdt-driver.patch @@ -0,0 +1,10 @@ +--- a/drivers/watchdog/Makefile ++++ b/drivers/watchdog/Makefile +@@ -119,6 +119,7 @@ obj-$(CONFIG_AR7_WDT) += ar7_wdt.o + obj-$(CONFIG_TXX9_WDT) += txx9wdt.o + obj-$(CONFIG_OCTEON_WDT) += octeon-wdt.o + octeon-wdt-y := octeon-wdt-main.o octeon-wdt-nmi.o ++obj-$(CONFIG_AMAZON_WDT) += amazon_wdt.o + + # PARISC Architecture + diff --git a/target/linux/amazon/patches-2.6.37/100-board.patch b/target/linux/amazon/patches-2.6.37/100-board.patch new file mode 100644 index 0000000000..15f367feb6 --- /dev/null +++ b/target/linux/amazon/patches-2.6.37/100-board.patch @@ -0,0 +1,53 @@ +--- a/arch/mips/Kconfig ++++ b/arch/mips/Kconfig +@@ -102,6 +102,22 @@ config BCM63XX + help + Support for BCM63XX based boards + ++config AMAZON ++ bool "Amazon support (EXPERIMENTAL)" ++ depends on EXPERIMENTAL ++ select DMA_NONCOHERENT ++ select IRQ_CPU ++ select CEVT_R4K ++ select CSRC_R4K ++ select SYS_HAS_CPU_MIPS32_R1 ++ select SYS_HAS_CPU_MIPS32_R2 ++ select HAVE_STD_PC_SERIAL_PORT ++ select SYS_SUPPORTS_BIG_ENDIAN ++ select SYS_SUPPORTS_32BIT_KERNEL ++ select SYS_HAS_EARLY_PRINTK ++ select HW_HAS_PCI ++ select SWAP_IO_SPACE ++ + config MIPS_COBALT + bool "Cobalt Server" + select CEVT_R4K +@@ -716,6 +732,7 @@ config CAVIUM_OCTEON_REFERENCE_BOARD + + endchoice + ++source "arch/mips/amazon/Kconfig" + source "arch/mips/alchemy/Kconfig" + source "arch/mips/bcm63xx/Kconfig" + source "arch/mips/jazz/Kconfig" +--- a/arch/mips/Kbuild.platforms ++++ b/arch/mips/Kbuild.platforms +@@ -5,6 +5,7 @@ platforms += ar7 + platforms += bcm47xx + platforms += bcm63xx + platforms += cavium-octeon ++platforms += amazon + platforms += cobalt + platforms += dec + platforms += emma +--- /dev/null ++++ b/arch/mips/amazon/Platform +@@ -0,0 +1,7 @@ ++# ++# Infineon AMAZON boards ++# ++platform-$(CONFIG_AMAZON) += amazon/ ++cflags-$(CONFIG_AMAZON) += \ ++ -I$(srctree)/arch/mips/include/asm/mach-amazon ++load-$(CONFIG_AMAZON) := 0xffffffff80002000 diff --git a/target/linux/amazon/patches-2.6.37/130-mtd_drivers.patch b/target/linux/amazon/patches-2.6.37/130-mtd_drivers.patch new file mode 100644 index 0000000000..b13a8374ff --- /dev/null +++ b/target/linux/amazon/patches-2.6.37/130-mtd_drivers.patch @@ -0,0 +1,7 @@ +--- a/drivers/mtd/maps/Makefile ++++ b/drivers/mtd/maps/Makefile +@@ -59,3 +59,4 @@ obj-$(CONFIG_MTD_RBTX4939) += rbtx4939-f + obj-$(CONFIG_MTD_VMU) += vmu-flash.o + obj-$(CONFIG_MTD_GPIO_ADDR) += gpio-addr-flash.o + obj-$(CONFIG_MTD_BCM963XX) += bcm963xx-flash.o ++obj-$(CONFIG_AMAZON_MTD) += amazon.o diff --git a/target/linux/amazon/patches-2.6.37/140-net_drivers.patch b/target/linux/amazon/patches-2.6.37/140-net_drivers.patch new file mode 100644 index 0000000000..49dc3c8138 --- /dev/null +++ b/target/linux/amazon/patches-2.6.37/140-net_drivers.patch @@ -0,0 +1,9 @@ +--- a/drivers/net/Makefile ++++ b/drivers/net/Makefile +@@ -302,3 +302,6 @@ obj-$(CONFIG_CAIF) += caif/ + obj-$(CONFIG_OCTEON_MGMT_ETHERNET) += octeon/ + obj-$(CONFIG_PCH_GBE) += pch_gbe/ + obj-$(CONFIG_TILE_NET) += tile/ ++ ++obj-$(CONFIG_AMAZON_NET_SW) += amazon_sw.o ++obj-$(CONFIG_ADM6996_SUPPORT) += admmod.o diff --git a/target/linux/amazon/patches-2.6.37/150-serial_driver.patch b/target/linux/amazon/patches-2.6.37/150-serial_driver.patch new file mode 100644 index 0000000000..8b7741c93b --- /dev/null +++ b/target/linux/amazon/patches-2.6.37/150-serial_driver.patch @@ -0,0 +1,10 @@ +--- a/drivers/serial/Makefile ++++ b/drivers/serial/Makefile +@@ -3,6 +3,7 @@ + # + + obj-$(CONFIG_SERIAL_CORE) += serial_core.o ++obj-$(CONFIG_AMAZON_ASC_UART) += amazon_asc.o + obj-$(CONFIG_SERIAL_21285) += 21285.o + + # These Sparc drivers have to appear before others such as 8250 diff --git a/target/linux/amazon/patches-2.6.37/160-cfi-swap.patch b/target/linux/amazon/patches-2.6.37/160-cfi-swap.patch new file mode 100644 index 0000000000..65ce6616d3 --- /dev/null +++ b/target/linux/amazon/patches-2.6.37/160-cfi-swap.patch @@ -0,0 +1,56 @@ +--- a/drivers/mtd/chips/cfi_cmdset_0002.c ++++ b/drivers/mtd/chips/cfi_cmdset_0002.c +@@ -1166,6 +1166,9 @@ static int __xipram do_write_oneword(str + int retry_cnt = 0; + + adr += chip->start; ++#ifdef CONFIG_AMAZON ++ adr ^= 2; ++#endif + + mutex_lock(&chip->mutex); + ret = get_chip(map, chip, adr, FL_WRITING); +@@ -1433,7 +1436,11 @@ static int __xipram do_write_buffer(stru + z = 0; + while(z < words * map_bankwidth(map)) { + datum = map_word_load(map, buf); ++#ifdef CONFIG_AMAZON ++ map_write(map, datum, (adr + z) ^ 0x2); ++#else + map_write(map, datum, adr + z); ++#endif + + z += map_bankwidth(map); + buf += map_bankwidth(map); +@@ -1678,6 +1685,9 @@ static int __xipram do_erase_oneblock(st + int ret = 0; + + adr += chip->start; ++#ifdef CONFIG_AMAZON ++ adr ^= 2; ++#endif + + mutex_lock(&chip->mutex); + ret = get_chip(map, chip, adr, FL_ERASING); +@@ -1806,6 +1816,10 @@ static int do_atmel_lock(struct map_info + struct cfi_private *cfi = map->fldrv_priv; + int ret; + ++#ifdef CONFIG_AMAZON ++ adr ^= 2; ++#endif ++ + mutex_lock(&chip->mutex); + ret = get_chip(map, chip, adr + chip->start, FL_LOCKING); + if (ret) +@@ -1842,6 +1856,10 @@ static int do_atmel_unlock(struct map_in + struct cfi_private *cfi = map->fldrv_priv; + int ret; + ++#ifdef CONFIG_AMAZON ++ adr ^= 2; ++#endif ++ + mutex_lock(&chip->mutex); + ret = get_chip(map, chip, adr + chip->start, FL_UNLOCKING); + if (ret) -- 2.30.2