From 79894c7b47f78decaa3511f1d6646aa06e2c6bed Mon Sep 17 00:00:00 2001 From: Ralf Baechle Date: Wed, 16 May 2007 17:54:08 +0200 Subject: [PATCH 01/11] [MIPS] Atlas, Malta, SEAD: Remove scroll from interrupt handler. Aside of being handy for debugging this has never been a particularly good idea but is now getting in the way of dyntick / tickless kernels and general cleanups. Signed-off-by: Ralf Baechle --- arch/mips/mips-boards/atlas/atlas_setup.c | 2 ++ arch/mips/mips-boards/generic/display.c | 24 ++++++++++++++++++ arch/mips/mips-boards/generic/time.c | 31 ++--------------------- arch/mips/mips-boards/malta/malta_setup.c | 6 +++++ arch/mips/mips-boards/sead/sead_setup.c | 2 ++ include/asm-mips/mips-boards/prom.h | 1 + 6 files changed, 37 insertions(+), 29 deletions(-) diff --git a/arch/mips/mips-boards/atlas/atlas_setup.c b/arch/mips/mips-boards/atlas/atlas_setup.c index 0c6b0ce15028..1cc6ebbedfdd 100644 --- a/arch/mips/mips-boards/atlas/atlas_setup.c +++ b/arch/mips/mips-boards/atlas/atlas_setup.c @@ -48,6 +48,8 @@ const char *get_system_type(void) return "MIPS Atlas"; } +const char display_string[] = " LINUX ON ATLAS "; + void __init plat_mem_setup(void) { mips_pcibios_init(); diff --git a/arch/mips/mips-boards/generic/display.c b/arch/mips/mips-boards/generic/display.c index 548dbe5ce7c8..5d600054090a 100644 --- a/arch/mips/mips-boards/generic/display.c +++ b/arch/mips/mips-boards/generic/display.c @@ -19,9 +19,14 @@ */ #include +#include #include #include +extern const char display_string[]; +static unsigned int display_count; +static unsigned int max_display_count; + void mips_display_message(const char *str) { static unsigned int __iomem *display = NULL; @@ -37,3 +42,22 @@ void mips_display_message(const char *str) writel(' ', display + i); } } + +static void scroll_display_message(unsigned long data); +static DEFINE_TIMER(mips_scroll_timer, scroll_display_message, HZ, 0); + +static void scroll_display_message(unsigned long data) +{ + mips_display_message(&display_string[display_count++]); + if (display_count == max_display_count) + display_count = 0; + + mod_timer(&mips_scroll_timer, jiffies + HZ); +} + +void mips_scroll_message(void) +{ + del_timer_sync(&mips_scroll_timer); + max_display_count = strlen(display_string) + 1 - 8; + mod_timer(&mips_scroll_timer, jiffies + 1); +} diff --git a/arch/mips/mips-boards/generic/time.c b/arch/mips/mips-boards/generic/time.c index df2a2bd3aa5d..37735bfc3afd 100644 --- a/arch/mips/mips-boards/generic/time.c +++ b/arch/mips/mips-boards/generic/time.c @@ -53,37 +53,11 @@ unsigned long cpu_khz; -#if defined(CONFIG_MIPS_ATLAS) -static char display_string[] = " LINUX ON ATLAS "; -#endif -#if defined(CONFIG_MIPS_MALTA) -#if defined(CONFIG_MIPS_MT_SMTC) -static char display_string[] = " SMTC LINUX ON MALTA "; -#else -static char display_string[] = " LINUX ON MALTA "; -#endif /* CONFIG_MIPS_MT_SMTC */ -#endif -#if defined(CONFIG_MIPS_SEAD) -static char display_string[] = " LINUX ON SEAD "; -#endif -static unsigned int display_count; -#define MAX_DISPLAY_COUNT (sizeof(display_string) - 8) - #define CPUCTR_IMASKBIT (0x100 << MIPSCPU_INT_CPUCTR) -static unsigned int timer_tick_count; static int mips_cpu_timer_irq; extern void smtc_timer_broadcast(int); -static inline void scroll_display_message(void) -{ - if ((timer_tick_count++ % HZ) == 0) { - mips_display_message(&display_string[display_count++]); - if (display_count == MAX_DISPLAY_COUNT) - display_count = 0; - } -} - static void mips_timer_dispatch(void) { do_IRQ(mips_cpu_timer_irq); @@ -143,7 +117,6 @@ irqreturn_t mips_timer_interrupt(int irq, void *dev_id) if (cpu_data[cpu].vpe_id == 0) { timer_interrupt(irq, NULL); smtc_timer_broadcast(cpu_data[cpu].vpe_id); - scroll_display_message(); } else { write_c0_compare(read_c0_count() + (mips_hpt_frequency/HZ)); @@ -167,8 +140,6 @@ irqreturn_t mips_timer_interrupt(int irq, void *dev_id) /* we keep interrupt disabled all the time */ if (!r2 || (read_c0_cause() & (1 << 30))) timer_interrupt(irq, NULL); - - scroll_display_message(); } else { /* Everyone else needs to reset the timer int here as ll_local_timer_interrupt doesn't */ @@ -262,6 +233,8 @@ void __init mips_time_init(void) (est_freq%1000000)*100/1000000); cpu_khz = est_freq / 1000; + + mips_scroll_message(); } void __init plat_timer_setup(struct irqaction *irq) diff --git a/arch/mips/mips-boards/malta/malta_setup.c b/arch/mips/mips-boards/malta/malta_setup.c index 7873932532a1..c14b7bf89950 100644 --- a/arch/mips/mips-boards/malta/malta_setup.c +++ b/arch/mips/mips-boards/malta/malta_setup.c @@ -56,6 +56,12 @@ const char *get_system_type(void) return "MIPS Malta"; } +#if defined(CONFIG_MIPS_MT_SMTC) +const char display_string[] = " SMTC LINUX ON MALTA "; +#else +const char display_string[] = " LINUX ON MALTA "; +#endif /* CONFIG_MIPS_MT_SMTC */ + #ifdef CONFIG_BLK_DEV_FD void __init fd_activate(void) { diff --git a/arch/mips/mips-boards/sead/sead_setup.c b/arch/mips/mips-boards/sead/sead_setup.c index a189dec7c7bc..811aba100605 100644 --- a/arch/mips/mips-boards/sead/sead_setup.c +++ b/arch/mips/mips-boards/sead/sead_setup.c @@ -43,6 +43,8 @@ const char *get_system_type(void) return "MIPS SEAD"; } +const char display_string[] = " LINUX ON SEAD "; + void __init plat_mem_setup(void) { ioport_resource.end = 0x7fffffff; diff --git a/include/asm-mips/mips-boards/prom.h b/include/asm-mips/mips-boards/prom.h index daaf9f98fc63..a9db576a9768 100644 --- a/include/asm-mips/mips-boards/prom.h +++ b/include/asm-mips/mips-boards/prom.h @@ -33,6 +33,7 @@ extern void prom_meminit(void); extern void prom_fixup_mem_map(unsigned long start_mem, unsigned long end_mem); extern void mips_display_message(const char *str); extern void mips_display_word(unsigned int num); +extern void mips_scroll_message(void); extern int get_ethernet_addr(char *ethernet_addr); /* Memory descriptor management. */ From f9509c84d8d9451ecd1731e922e7094b38ee336a Mon Sep 17 00:00:00 2001 From: Chris Dearman Date: Thu, 17 May 2007 21:36:55 +0100 Subject: [PATCH 02/11] [MIPS] Remove duplicate fpu enable hazard code. Use common code from hazards.h instead. Signed-off-by: Chris Dearman Signed-off-by: Ralf Baechle --- arch/mips/kernel/r4k_switch.S | 2 +- include/asm-mips/asmmacro.h | 15 --------------- 2 files changed, 1 insertion(+), 16 deletions(-) diff --git a/arch/mips/kernel/r4k_switch.S b/arch/mips/kernel/r4k_switch.S index cc566cf12246..06729596812f 100644 --- a/arch/mips/kernel/r4k_switch.S +++ b/arch/mips/kernel/r4k_switch.S @@ -174,7 +174,7 @@ LEAF(_init_fpu) or t0, t1 mtc0 t0, CP0_STATUS #endif /* CONFIG_MIPS_MT_SMTC */ - fpu_enable_hazard + enable_fpu_hazard li t1, FPU_DEFAULT ctc1 t1, fcr31 diff --git a/include/asm-mips/asmmacro.h b/include/asm-mips/asmmacro.h index 92e62ef711ed..c5f20df780e9 100644 --- a/include/asm-mips/asmmacro.h +++ b/include/asm-mips/asmmacro.h @@ -52,21 +52,6 @@ .endm #endif /* CONFIG_MIPS_MT_SMTC */ -#ifdef CONFIG_CPU_SB1 - .macro fpu_enable_hazard - .set push - .set noreorder - .set mips2 - SSNOP - bnezl $0, .+4 - SSNOP - .set pop - .endm -#else - .macro fpu_enable_hazard - .endm -#endif - /* * Temporary until all gas have MT ASE support */ From d73d420708f456a63d7db2c504c62cd713381d7d Mon Sep 17 00:00:00 2001 From: Sergei Shtylyov Date: Wed, 16 May 2007 20:35:13 +0400 Subject: [PATCH 03/11] [MIPS] EMMA2RH: remove dead KGDB code Get rid of the cross-arch KGDB specific code which shouldn't have been there in the first place... Signed-off-by: Sergey Shtylyov Signed-off-by: Ralf Baechle --- arch/mips/emma2rh/markeins/setup.c | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/arch/mips/emma2rh/markeins/setup.c b/arch/mips/emma2rh/markeins/setup.c index b29a44739230..2f060e1ed36c 100644 --- a/arch/mips/emma2rh/markeins/setup.c +++ b/arch/mips/emma2rh/markeins/setup.c @@ -115,30 +115,6 @@ extern void markeins_irq_setup(void); static void inline __init markeins_sio_setup(void) { -#ifdef CONFIG_KGDB_8250 - struct uart_port emma_port; - - memset(&emma_port, 0, sizeof(emma_port)); - - emma_port.flags = - UPF_BOOT_AUTOCONF | UPF_SKIP_TEST; - emma_port.iotype = UPIO_MEM; - emma_port.regshift = 4; /* I/O addresses are every 8 bytes */ - emma_port.uartclk = 18544000; /* Clock rate of the chip */ - - emma_port.line = 0; - emma_port.mapbase = KSEG1ADDR(EMMA2RH_PFUR0_BASE + 3); - emma_port.membase = (u8*)emma_port.mapbase; - early_serial_setup(&emma_port); - - emma_port.line = 1; - emma_port.mapbase = KSEG1ADDR(EMMA2RH_PFUR1_BASE + 3); - emma_port.membase = (u8*)emma_port.mapbase; - early_serial_setup(&emma_port); - - emma_port.irq = EMMA2RH_IRQ_PFUR1; - kgdb8250_add_port(1, &emma_port); -#endif } void __init plat_mem_setup(void) From 0c2bf745f9bdef7243ef5f04e6b05f592abead06 Mon Sep 17 00:00:00 2001 From: Thomas Bogendoerfer Date: Thu, 17 May 2007 14:51:47 +0200 Subject: [PATCH 04/11] [MIPS] RM300: Fix MMIO problems by marking the PCI INT ACK region busy Signed-off-by: Thomas Bogendoerfer Signed-off-by: Ralf Baechle --- arch/mips/sni/pcimt.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/arch/mips/sni/pcimt.c b/arch/mips/sni/pcimt.c index 9ee208daa8b1..97b234361b4d 100644 --- a/arch/mips/sni/pcimt.c +++ b/arch/mips/sni/pcimt.c @@ -6,7 +6,7 @@ * for more details. * * Copyright (C) 1996, 97, 98, 2000, 03, 04, 06 Ralf Baechle (ralf@linux-mips.org) - * Copyright (C) 2006 Thomas Bogendoerfer (tsbogend@alpha.franken.de) + * Copyright (C) 2006,2007 Thomas Bogendoerfer (tsbogend@alpha.franken.de) */ #include @@ -131,6 +131,19 @@ static struct resource pcimt_io_resources[] = { } }; +static struct resource pcimt_mem_resources[] = { + { + /* + * this region should only be 4 bytes long, + * but it's 16MB on all RM300C I've checked + */ + .start = 0x1a000000, + .end = 0x1affffff, + .name = "PCI INT ACK", + .flags = IORESOURCE_BUSY + } +}; + static struct resource sni_mem_resource = { .start = 0x18000000UL, .end = 0x1fbfffffUL, @@ -145,6 +158,9 @@ static void __init sni_pcimt_resource_init(void) /* request I/O space for devices used on all i[345]86 PCs */ for (i = 0; i < ARRAY_SIZE(pcimt_io_resources); i++) request_resource(&sni_io_resource, pcimt_io_resources + i); + /* request MEM space for devices used on all i[345]86 PCs */ + for (i = 0; i < ARRAY_SIZE(pcimt_mem_resources); i++) + request_resource(&sni_mem_resource, pcimt_mem_resources + i); } extern struct pci_ops sni_pcimt_ops; From 22df5bc591ea2d0dbe8240fe8af0816b8a6533b9 Mon Sep 17 00:00:00 2001 From: Thomas Bogendoerfer Date: Thu, 17 May 2007 14:53:12 +0200 Subject: [PATCH 05/11] [MIPS] Fix VGA corruption on RM300C ... by setting DRAM config to 2MB (SNI always used that size). This also fixes video dram size detection in cirrusfb. Signed-off-by: Thomas Bogendoerfer Signed-off-by: Ralf Baechle --- arch/mips/sni/setup.c | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/arch/mips/sni/setup.c b/arch/mips/sni/setup.c index 68d7cf609b4f..4fedfbda0c79 100644 --- a/arch/mips/sni/setup.c +++ b/arch/mips/sni/setup.c @@ -6,7 +6,7 @@ * for more details. * * Copyright (C) 1996, 97, 98, 2000, 03, 04, 06 Ralf Baechle (ralf@linux-mips.org) - * Copyright (C) 2006 Thomas Bogendoerfer (tsbogend@alpha.franken.de) + * Copyright (C) 2006,2007 Thomas Bogendoerfer (tsbogend@alpha.franken.de) */ #include #include @@ -92,3 +92,34 @@ void __init plat_mem_setup(void) sni_display_setup(); } + +#if CONFIG_PCI + +#include +#include