From 126a87196ce4e7ea80c71692c22514f6cb549820 Mon Sep 17 00:00:00 2001 From: hauke Date: Sun, 10 Apr 2011 15:08:28 +0000 Subject: 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. git-svn-id: svn://svn.openwrt.org/openwrt/trunk@26576 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- .../patches-2.6.37/000-mips-bad-intctl.patch | 33 +++++++++++++ .../010-mips_clocksource_init_war.patch | 33 +++++++++++++ .../amazon/patches-2.6.37/017-wdt-driver.patch | 10 ++++ target/linux/amazon/patches-2.6.37/100-board.patch | 53 ++++++++++++++++++++ .../amazon/patches-2.6.37/130-mtd_drivers.patch | 7 +++ .../amazon/patches-2.6.37/140-net_drivers.patch | 9 ++++ .../amazon/patches-2.6.37/150-serial_driver.patch | 10 ++++ .../linux/amazon/patches-2.6.37/160-cfi-swap.patch | 56 ++++++++++++++++++++++ 8 files changed, 211 insertions(+) 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 (limited to 'target/linux/amazon/patches-2.6.37') 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 000000000..f89e078e7 --- /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 000000000..7078b3743 --- /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 000000000..63da655f6 --- /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 000000000..15f367feb --- /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 000000000..b13a8374f --- /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 000000000..49dc3c813 --- /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 000000000..8b7741c93 --- /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 000000000..65ce6616d --- /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) -- cgit v1.2.3