diff options
author | Hauke Mehrtens <hauke@hauke-m.de> | 2009-11-28 22:17:37 +0000 |
---|---|---|
committer | Hauke Mehrtens <hauke@hauke-m.de> | 2009-11-28 22:17:37 +0000 |
commit | 2ee2679ac97098e9cf394ca4e78d2cc6ac5fad85 (patch) | |
tree | a94ddbd1439f5a86a7e15ba5c920a1ce039636ba /target/linux/amazon/patches-2.6.30 | |
parent | 9714c8b6425d6fe28b7aac6fbdcb207c05409835 (diff) | |
download | mtk-20170518-2ee2679ac97098e9cf394ca4e78d2cc6ac5fad85.zip mtk-20170518-2ee2679ac97098e9cf394ca4e78d2cc6ac5fad85.tar.gz mtk-20170518-2ee2679ac97098e9cf394ca4e78d2cc6ac5fad85.tar.bz2 |
Add kernel 2.6.30 support
The device is booting and Ethernet is working, but nothing more was tested.
SVN-Revision: 18589
Diffstat (limited to 'target/linux/amazon/patches-2.6.30')
13 files changed, 403 insertions, 0 deletions
diff --git a/target/linux/amazon/patches-2.6.30/000-mips-bad-intctl.patch b/target/linux/amazon/patches-2.6.30/000-mips-bad-intctl.patch new file mode 100644 index 0000000..5de5064 --- /dev/null +++ b/target/linux/amazon/patches-2.6.30/000-mips-bad-intctl.patch @@ -0,0 +1,32 @@ +--- a/arch/mips/kernel/traps.c ++++ b/arch/mips/kernel/traps.c +@@ -1542,7 +1542,16 @@ void __cpuinit per_cpu_trap_init(void) + */ + if (cpu_has_mips_r2) { + cp0_compare_irq = (read_c0_intctl() >> 29) & 7; ++ if (!cp0_compare_irq) ++ cp0_compare_irq = CP0_LEGACY_COMPARE_IRQ; ++ + cp0_perfcount_irq = (read_c0_intctl() >> 26) & 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 +@@ -157,8 +157,10 @@ 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_perfcount_irq; ++extern void __weak arch_fixup_c0_irqs(void); + + #endif /* _ASM_IRQ_H */ diff --git a/target/linux/amazon/patches-2.6.30/010-mips_clocksource_init_war.patch b/target/linux/amazon/patches-2.6.30/010-mips_clocksource_init_war.patch new file mode 100644 index 0000000..ac44c30 --- /dev/null +++ b/target/linux/amazon/patches-2.6.30/010-mips_clocksource_init_war.patch @@ -0,0 +1,33 @@ +--- a/arch/mips/kernel/cevt-r4k.c ++++ b/arch/mips/kernel/cevt-r4k.c +@@ -21,6 +21,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) + { +@@ -30,6 +46,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.30/017-wdt-driver.patch b/target/linux/amazon/patches-2.6.30/017-wdt-driver.patch new file mode 100644 index 0000000..bee390b --- /dev/null +++ b/target/linux/amazon/patches-2.6.30/017-wdt-driver.patch @@ -0,0 +1,10 @@ +--- a/drivers/watchdog/Makefile ++++ b/drivers/watchdog/Makefile +@@ -105,6 +105,7 @@ obj-$(CONFIG_WDT_RM9K_GPI) += rm9k_wdt.o + obj-$(CONFIG_SIBYTE_WDOG) += sb_wdog.o + obj-$(CONFIG_AR7_WDT) += ar7_wdt.o + obj-$(CONFIG_TXX9_WDT) += txx9wdt.o ++obj-$(CONFIG_AMAZON_WDT) += amazon_wdt.o + + # PARISC Architecture + diff --git a/target/linux/amazon/patches-2.6.30/100-board.patch b/target/linux/amazon/patches-2.6.30/100-board.patch new file mode 100644 index 0000000..df813e7 --- /dev/null +++ b/target/linux/amazon/patches-2.6.30/100-board.patch @@ -0,0 +1,48 @@ +--- a/arch/mips/Kconfig ++++ b/arch/mips/Kconfig +@@ -60,6 +60,21 @@ config BCM47XX + help + Support for BCM47XX 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 ++ + config MIPS_COBALT + bool "Cobalt Server" + select CEVT_R4K +@@ -633,6 +648,7 @@ config CAVIUM_OCTEON_REFERENCE_BOARD + + endchoice + ++source "arch/mips/amazon/Kconfig" + source "arch/mips/alchemy/Kconfig" + source "arch/mips/basler/excite/Kconfig" + source "arch/mips/jazz/Kconfig" +--- a/arch/mips/Makefile ++++ b/arch/mips/Makefile +@@ -283,6 +283,13 @@ libs-$(CONFIG_MIPS_XXS1500) += arch/mips + load-$(CONFIG_MIPS_XXS1500) += 0xffffffff80100000 + + # ++# Infineon AMAZON ++# ++core-$(CONFIG_AMAZON) += arch/mips/amazon/ ++cflags-$(CONFIG_AMAZON) += -I$(srctree)/arch/mips/include/asm/mach-amazon ++load-$(CONFIG_AMAZON) += 0xffffffff80002000 ++ ++# + # Cobalt Server + # + core-$(CONFIG_MIPS_COBALT) += arch/mips/cobalt/ diff --git a/target/linux/amazon/patches-2.6.30/130-mtd_drivers.patch b/target/linux/amazon/patches-2.6.30/130-mtd_drivers.patch new file mode 100644 index 0000000..aaf3a8d --- /dev/null +++ b/target/linux/amazon/patches-2.6.30/130-mtd_drivers.patch @@ -0,0 +1,7 @@ +--- a/drivers/mtd/maps/Makefile ++++ b/drivers/mtd/maps/Makefile +@@ -62,3 +62,4 @@ obj-$(CONFIG_MTD_INTEL_VR_NOR) += intel_ + obj-$(CONFIG_MTD_BFIN_ASYNC) += bfin-async-flash.o + obj-$(CONFIG_MTD_RBTX4939) += rbtx4939-flash.o + obj-$(CONFIG_MTD_VMU) += vmu-flash.o ++obj-$(CONFIG_AMAZON_MTD) += amazon.o 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 new file mode 100644 index 0000000..5c677fd --- /dev/null +++ b/target/linux/amazon/patches-2.6.30/140-net_drivers.patch @@ -0,0 +1,9 @@ +--- a/drivers/net/Makefile ++++ b/drivers/net/Makefile +@@ -272,3 +272,6 @@ obj-$(CONFIG_VIRTIO_NET) += virtio_net.o + obj-$(CONFIG_SFC) += sfc/ + + obj-$(CONFIG_WIMAX) += wimax/ ++ ++obj-$(CONFIG_AMAZON_NET_SW) += amazon_sw.o ++obj-$(CONFIG_ADM6996_SUPPORT) += admmod.o diff --git a/target/linux/amazon/patches-2.6.30/150-serial_driver.patch b/target/linux/amazon/patches-2.6.30/150-serial_driver.patch new file mode 100644 index 0000000..8b7741c --- /dev/null +++ b/target/linux/amazon/patches-2.6.30/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.30/160-cfi-swap.patch b/target/linux/amazon/patches-2.6.30/160-cfi-swap.patch new file mode 100644 index 0000000..4809fcc --- /dev/null +++ b/target/linux/amazon/patches-2.6.30/160-cfi-swap.patch @@ -0,0 +1,56 @@ +--- a/drivers/mtd/chips/cfi_cmdset_0002.c ++++ b/drivers/mtd/chips/cfi_cmdset_0002.c +@@ -1090,6 +1090,9 @@ static int __xipram do_write_oneword(str + int retry_cnt = 0; + + adr += chip->start; ++#ifdef CONFIG_AMAZON ++ adr ^= 2; ++#endif + + spin_lock(chip->mutex); + ret = get_chip(map, chip, adr, FL_WRITING); +@@ -1372,7 +1375,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); +@@ -1617,6 +1624,9 @@ static int __xipram do_erase_oneblock(st + int ret = 0; + + adr += chip->start; ++#ifdef CONFIG_AMAZON ++ adr ^= 2; ++#endif + + spin_lock(chip->mutex); + ret = get_chip(map, chip, adr, FL_ERASING); +@@ -1745,6 +1755,10 @@ static int do_atmel_lock(struct map_info + struct cfi_private *cfi = map->fldrv_priv; + int ret; + ++#ifdef CONFIG_AMAZON ++ adr ^= 2; ++#endif ++ + spin_lock(chip->mutex); + ret = get_chip(map, chip, adr + chip->start, FL_LOCKING); + if (ret) +@@ -1781,6 +1795,10 @@ static int do_atmel_unlock(struct map_in + struct cfi_private *cfi = map->fldrv_priv; + int ret; + ++#ifdef CONFIG_AMAZON ++ adr ^= 2; ++#endif ++ + spin_lock(chip->mutex); + ret = get_chip(map, chip, adr + chip->start, FL_UNLOCKING); + if (ret) diff --git a/target/linux/amazon/patches-2.6.30/200-fix_deprecated_interrupt_definations.patch b/target/linux/amazon/patches-2.6.30/200-fix_deprecated_interrupt_definations.patch new file mode 100644 index 0000000..3c683e0 --- /dev/null +++ b/target/linux/amazon/patches-2.6.30/200-fix_deprecated_interrupt_definations.patch @@ -0,0 +1,53 @@ +--- a/arch/mips/amazon/dma-core.c ++++ b/arch/mips/amazon/dma-core.c +@@ -1387,7 +1387,7 @@ static int dma_init(void) + AMAZON_DMA_EMSG("cannot register device dma-core!\n"); + return result; + } +- result = request_irq(AMAZON_DMA_INT, dma_interrupt, SA_INTERRUPT, "dma-core", (void *) &dma_interrupt); ++ result = request_irq(AMAZON_DMA_INT, dma_interrupt, IRQF_DISABLED, "dma-core", (void *) &dma_interrupt); + if (result) { + AMAZON_DMA_EMSG("error, cannot get dma_irq!\n"); + free_irq(AMAZON_DMA_INT, (void *) &dma_interrupt); +--- a/arch/mips/amazon/interrupt.c ++++ b/arch/mips/amazon/interrupt.c +@@ -157,7 +157,7 @@ out: + + static struct irqaction cascade = { + .handler = no_action, +- .flags = SA_INTERRUPT, ++ .flags = IRQF_DISABLED, + .name = "cascade", + }; + +--- a/arch/mips/amazon/setup.c ++++ b/arch/mips/amazon/setup.c +@@ -107,7 +107,7 @@ static void amazon_timer6_interrupt(int + + static struct irqaction hrt_irqaction = { + .handler = amazon_timer6_interrupt, +- .flags = SA_INTERRUPT, ++ .flags = IRQF_DISABLED, + .name = "hrt", + }; + +--- a/drivers/atm/amazon_tpe.c ++++ b/drivers/atm/amazon_tpe.c +@@ -2404,13 +2404,13 @@ amazon_atm_dev_t * amazon_atm_create(voi + + + // Register interrupts for insertion and extraction +- request_irq(AMAZON_SWIE_INT, amazon_atm_swie_isr, SA_INTERRUPT, "tpe_swie", NULL); +- request_irq(AMAZON_CBM_INT, amazon_atm_cbm_isr, SA_INTERRUPT, "tpe_cbm", NULL); ++ request_irq(AMAZON_SWIE_INT, amazon_atm_swie_isr, IRQF_DISABLED, "tpe_swie", NULL); ++ request_irq(AMAZON_CBM_INT, amazon_atm_cbm_isr, IRQF_DISABLED, "tpe_cbm", NULL); + #ifdef AMAZON_ATM_DEBUG +- request_irq(AMAZON_HTU_INT , amazon_atm_htu_isr, SA_INTERRUPT, "tpe_htu", NULL); ++ request_irq(AMAZON_HTU_INT , amazon_atm_htu_isr, IRQF_DISABLED, "tpe_htu", NULL); + #endif + #ifdef AMAZON_TPE_TEST_AAL5_INT +- request_irq(AMAZON_AAL5_INT, amazon_atm_aal5_isr, SA_INTERRUPT, "tpe_aal5", NULL); ++ request_irq(AMAZON_AAL5_INT, amazon_atm_aal5_isr, IRQF_DISABLED, "tpe_aal5", NULL); + #endif + return &g_atm_dev; + } diff --git a/target/linux/amazon/patches-2.6.30/210-remove_unnedded_variables.patch b/target/linux/amazon/patches-2.6.30/210-remove_unnedded_variables.patch new file mode 100644 index 0000000..c2c7fbd --- /dev/null +++ b/target/linux/amazon/patches-2.6.30/210-remove_unnedded_variables.patch @@ -0,0 +1,12 @@ +--- a/arch/mips/amazon/prom.c ++++ b/arch/mips/amazon/prom.c +@@ -59,9 +59,6 @@ void prom_printf(const char * fmt, ...) + + void __init prom_init(void) + { +- mips_machgroup = MACH_GROUP_INFINEON; +- mips_machtype = MACH_INFINEON_AMAZON; +- + strcpy(&(arcs_cmdline[0]), "console=ttyS0,115200 rootfstype=squashfs,jffs2"); + + add_memory_region(0x00000000, 0x1000000, BOOT_MEM_RAM); diff --git a/target/linux/amazon/patches-2.6.30/220-fix_timer.patch b/target/linux/amazon/patches-2.6.30/220-fix_timer.patch new file mode 100644 index 0000000..6408b88 --- /dev/null +++ b/target/linux/amazon/patches-2.6.30/220-fix_timer.patch @@ -0,0 +1,93 @@ +--- a/arch/mips/amazon/setup.c ++++ b/arch/mips/amazon/setup.c +@@ -36,6 +36,12 @@ + #include <asm/amazon/irq.h> + #include <asm/amazon/model.h> + ++static unsigned int r4k_offset; ++static unsigned int r4k_cur; ++ ++/* required in arch/mips/kernel/kspd.c */ ++unsigned long cpu_khz; ++ + extern void prom_printf(const char * fmt, ...); + static void amazon_reboot_setup(void); + +@@ -91,35 +97,32 @@ unsigned int amazon_get_cpu_ver(void) + return cpu_ver; + } + +-void amazon_time_init(void) ++static inline u32 amazon_get_counter_resolution(void) + { +- mips_hpt_frequency = amazon_get_cpu_hz()/2; +- printk("mips_hpt_frequency:%d\n", mips_hpt_frequency); ++ u32 res; ++ __asm__ __volatile__( ++ ".set push\n" ++ ".set mips32r2\n" ++ ".set noreorder\n" ++ "rdhwr %0, $3\n" ++ "ehb\n" ++ ".set pop\n" ++ : "=&r" (res) ++ : /* no input */ ++ : "memory"); ++ instruction_hazard(); ++ return res; + } + +-extern int hr_time_resolution; +- +-/* ISR GPTU Timer 6 for high resolution timer */ +-static void amazon_timer6_interrupt(int irq, void *dev_id) ++void __init plat_time_init(void) + { +- timer_interrupt(AMAZON_TIMER6_INT, NULL); +-} +- +-static struct irqaction hrt_irqaction = { +- .handler = amazon_timer6_interrupt, +- .flags = IRQF_DISABLED, +- .name = "hrt", +-}; ++ mips_hpt_frequency = amazon_get_cpu_hz() / amazon_get_counter_resolution(); ++ r4k_offset = mips_hpt_frequency / HZ; ++ printk("mips_hpt_frequency:%d\n", mips_hpt_frequency); ++ printk("r4k_offset: %08x(%d)\n", r4k_offset, r4k_offset); + +-/* +- * THe CPU counter for System timer, set to HZ +- * GPTU Timer 6 for high resolution timer, set to hr_time_resolution +- * Also misuse this routine to print out the CPU type and clock. +- */ +-void __init plat_timer_setup(struct irqaction *irq) +-{ +- /* cpu counter for timer interrupts */ +- setup_irq(MIPS_CPU_TIMER_IRQ, irq); ++ r4k_cur = (read_c0_count() + r4k_offset); ++ write_c0_compare(r4k_cur); + + /* enable the timer in the PMU */ + amazon_writel(amazon_readl(AMAZON_PMU_PWDCR)| AMAZON_PMU_PWDCR_GPT|AMAZON_PMU_PWDCR_FPI, AMAZON_PMU_PWDCR); +@@ -147,7 +150,6 @@ void __init plat_mem_setup(void) + } + + amazon_reboot_setup(); +- board_time_init = amazon_time_init; + + //stop reset TPE and DFE + amazon_writel(0, AMAZON_RST_REQ); +--- a/arch/mips/amazon/interrupt.c ++++ b/arch/mips/amazon/interrupt.c +@@ -184,3 +184,10 @@ void __init arch_init_irq(void) + set_irq_chip(i, &amazon_irq_type); + } + } ++ ++void __cpuinit arch_fixup_c0_irqs(void) ++{ ++ /* FIXME: check for CPUID and only do fix for specific chips/versions */ ++ cp0_compare_irq = CP0_LEGACY_COMPARE_IRQ; ++ cp0_perfcount_irq = CP0_LEGACY_PERFCNT_IRQ; ++} diff --git a/target/linux/amazon/patches-2.6.30/230-fix_pci.patch b/target/linux/amazon/patches-2.6.30/230-fix_pci.patch new file mode 100644 index 0000000..84d88dd --- /dev/null +++ b/target/linux/amazon/patches-2.6.30/230-fix_pci.patch @@ -0,0 +1,20 @@ +--- a/arch/mips/amazon/pci.c ++++ b/arch/mips/amazon/pci.c +@@ -182,7 +182,7 @@ static struct pci_controller amazon_pci_ + .io_resource = &pci_io_resource + }; + +-int __init pcibios_map_irq(struct pci_dev *dev, u8 slot, u8 pin) ++int __init pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) + { + switch (slot) { + case 13: +@@ -240,7 +240,7 @@ int pcibios_plat_dev_init(struct pci_dev + return 0; + } + +-int amazon_pci_init(void) ++int __init amazon_pci_init(void) + { + u32 temp_buffer; + diff --git a/target/linux/amazon/patches-2.6.30/240-irq_fix.patch b/target/linux/amazon/patches-2.6.30/240-irq_fix.patch new file mode 100644 index 0000000..151f1b4 --- /dev/null +++ b/target/linux/amazon/patches-2.6.30/240-irq_fix.patch @@ -0,0 +1,20 @@ +--- a/arch/mips/amazon/interrupt.c ++++ b/arch/mips/amazon/interrupt.c +@@ -177,12 +177,11 @@ void __init arch_init_irq(void) + setup_irq(i, &cascade); + } + +- for (i = INT_NUM_IRQ0; i <= INT_NUM_IM4_IRL31; i++) { +- irq_desc[i].status = IRQ_DISABLED; +- irq_desc[i].action = 0; +- irq_desc[i].depth = 1; +- set_irq_chip(i, &amazon_irq_type); +- } ++ for (i = INT_NUM_IRQ0; i <= INT_NUM_IM4_IRL31; i++) ++ set_irq_chip_and_handler(i, &amazon_irq_type, ++ handle_level_irq); ++ ++ set_c0_status(IE_IRQ0 | IE_IRQ1 | IE_IRQ2 | IE_IRQ3 | IE_IRQ4 | IE_IRQ5); + } + + void __cpuinit arch_fixup_c0_irqs(void) |