aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/mti-malta
diff options
context:
space:
mode:
Diffstat (limited to 'arch/mips/mti-malta')
-rw-r--r--arch/mips/mti-malta/Makefile2
-rw-r--r--arch/mips/mti-malta/malta-amon.c49
-rw-r--r--arch/mips/mti-malta/malta-console.c47
-rw-r--r--arch/mips/mti-malta/malta-init.c58
-rw-r--r--arch/mips/mti-malta/malta-int.c127
-rw-r--r--arch/mips/mti-malta/malta-platform.c2
-rw-r--r--arch/mips/mti-malta/malta-time.c16
7 files changed, 144 insertions, 157 deletions
diff --git a/arch/mips/mti-malta/Makefile b/arch/mips/mti-malta/Makefile
index 72fdedbf76db..eae0ba3876d9 100644
--- a/arch/mips/mti-malta/Makefile
+++ b/arch/mips/mti-malta/Makefile
@@ -9,7 +9,5 @@ obj-y := malta-amon.o malta-display.o malta-init.o \
9 malta-int.o malta-memory.o malta-platform.o \ 9 malta-int.o malta-memory.o malta-platform.o \
10 malta-reset.o malta-setup.o malta-time.o 10 malta-reset.o malta-setup.o malta-time.o
11 11
12obj-$(CONFIG_EARLY_PRINTK) += malta-console.o
13
14# FIXME FIXME FIXME 12# FIXME FIXME FIXME
15obj-$(CONFIG_MIPS_MT_SMTC) += malta-smtc.o 13obj-$(CONFIG_MIPS_MT_SMTC) += malta-smtc.o
diff --git a/arch/mips/mti-malta/malta-amon.c b/arch/mips/mti-malta/malta-amon.c
index 1e4784458016..592ac0427426 100644
--- a/arch/mips/mti-malta/malta-amon.c
+++ b/arch/mips/mti-malta/malta-amon.c
@@ -1,30 +1,20 @@
1/* 1/*
2 * Copyright (C) 2007 MIPS Technologies, Inc. 2 * This file is subject to the terms and conditions of the GNU General Public
3 * All rights reserved. 3 * License. See the file "COPYING" in the main directory of this archive
4 4 * for more details.
5 * This program is free software; you can distribute it and/or modify it
6 * under the terms of the GNU General Public License (Version 2) as
7 * published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * for more details.
13 * 5 *
14 * You should have received a copy of the GNU General Public License along 6 * Copyright (C) 2007 MIPS Technologies, Inc. All rights reserved.
15 * with this program; if not, write to the Free Software Foundation, Inc., 7 * Copyright (C) 2013 Imagination Technologies Ltd.
16 * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
17 * 8 *
18 * Arbitrary Monitor interface 9 * Arbitrary Monitor Interface
19 */ 10 */
20
21#include <linux/kernel.h> 11#include <linux/kernel.h>
22#include <linux/init.h>
23#include <linux/smp.h> 12#include <linux/smp.h>
24 13
25#include <asm/addrspace.h> 14#include <asm/addrspace.h>
26#include <asm/mips-boards/launch.h>
27#include <asm/mipsmtregs.h> 15#include <asm/mipsmtregs.h>
16#include <asm/mips-boards/launch.h>
17#include <asm/vpe.h>
28 18
29int amon_cpu_avail(int cpu) 19int amon_cpu_avail(int cpu)
30{ 20{
@@ -48,7 +38,7 @@ int amon_cpu_avail(int cpu)
48 return 1; 38 return 1;
49} 39}
50 40
51void amon_cpu_start(int cpu, 41int amon_cpu_start(int cpu,
52 unsigned long pc, unsigned long sp, 42 unsigned long pc, unsigned long sp,
53 unsigned long gp, unsigned long a0) 43 unsigned long gp, unsigned long a0)
54{ 44{
@@ -56,10 +46,10 @@ void amon_cpu_start(int cpu,
56 (struct cpulaunch *)CKSEG0ADDR(CPULAUNCH); 46 (struct cpulaunch *)CKSEG0ADDR(CPULAUNCH);
57 47
58 if (!amon_cpu_avail(cpu)) 48 if (!amon_cpu_avail(cpu))
59 return; 49 return -1;
60 if (cpu == smp_processor_id()) { 50 if (cpu == smp_processor_id()) {
61 pr_debug("launch: I am cpu%d!\n", cpu); 51 pr_debug("launch: I am cpu%d!\n", cpu);
62 return; 52 return -1;
63 } 53 }
64 launch += cpu; 54 launch += cpu;
65 55
@@ -78,4 +68,21 @@ void amon_cpu_start(int cpu,
78 ; 68 ;
79 smp_rmb(); /* Target will be updating flags soon */ 69 smp_rmb(); /* Target will be updating flags soon */
80 pr_debug("launch: cpu%d gone!\n", cpu); 70 pr_debug("launch: cpu%d gone!\n", cpu);
71
72 return 0;
73}
74
75#ifdef CONFIG_MIPS_VPE_LOADER
76int vpe_run(struct vpe *v)
77{
78 struct vpe_notifications *n;
79
80 if (amon_cpu_start(aprp_cpu_index(), v->__start, 0, 0, 0) < 0)
81 return -1;
82
83 list_for_each_entry(n, &v->notify, list)
84 n->start(VPE_MODULE_MINOR);
85
86 return 0;
81} 87}
88#endif
diff --git a/arch/mips/mti-malta/malta-console.c b/arch/mips/mti-malta/malta-console.c
deleted file mode 100644
index 43bcfb4f8167..000000000000
--- a/arch/mips/mti-malta/malta-console.c
+++ /dev/null
@@ -1,47 +0,0 @@
1/*
2 * Carsten Langgaard, carstenl@mips.com
3 * Copyright (C) 1999,2000 MIPS Technologies, Inc. All rights reserved.
4 *
5 * This program is free software; you can distribute it and/or modify it
6 * under the terms of the GNU General Public License (Version 2) as
7 * published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * for more details.
13 *
14 * You should have received a copy of the GNU General Public License along
15 * with this program; if not, write to the Free Software Foundation, Inc.,
16 * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
17 *
18 * Putting things on the screen/serial line using YAMONs facilities.
19 */
20#include <linux/console.h>
21#include <linux/init.h>
22#include <linux/serial_reg.h>
23#include <asm/io.h>
24
25
26#define PORT(offset) (0x3f8 + (offset))
27
28
29static inline unsigned int serial_in(int offset)
30{
31 return inb(PORT(offset));
32}
33
34static inline void serial_out(int offset, int value)
35{
36 outb(value, PORT(offset));
37}
38
39int prom_putchar(char c)
40{
41 while ((serial_in(UART_LSR) & UART_LSR_THRE) == 0)
42 ;
43
44 serial_out(UART_TX, c);
45
46 return 1;
47}
diff --git a/arch/mips/mti-malta/malta-init.c b/arch/mips/mti-malta/malta-init.c
index ff8caffd3266..fcebfced26d0 100644
--- a/arch/mips/mti-malta/malta-init.c
+++ b/arch/mips/mti-malta/malta-init.c
@@ -14,6 +14,7 @@
14#include <linux/init.h> 14#include <linux/init.h>
15#include <linux/string.h> 15#include <linux/string.h>
16#include <linux/kernel.h> 16#include <linux/kernel.h>
17#include <linux/serial_8250.h>
17 18
18#include <asm/cacheflush.h> 19#include <asm/cacheflush.h>
19#include <asm/smp-ops.h> 20#include <asm/smp-ops.h>
@@ -44,32 +45,39 @@ static void __init console_config(void)
44 char parity = '\0', bits = '\0', flow = '\0'; 45 char parity = '\0', bits = '\0', flow = '\0';
45 char *s; 46 char *s;
46 47
47 if ((strstr(fw_getcmdline(), "console=")) == NULL) { 48 s = fw_getenv("modetty0");
48 s = fw_getenv("modetty0"); 49 if (s) {
49 if (s) { 50 while (*s >= '0' && *s <= '9')
50 while (*s >= '0' && *s <= '9') 51 baud = baud*10 + *s++ - '0';
51 baud = baud*10 + *s++ - '0'; 52 if (*s == ',')
52 if (*s == ',') 53 s++;
53 s++; 54 if (*s)
54 if (*s) 55 parity = *s++;
55 parity = *s++; 56 if (*s == ',')
56 if (*s == ',') 57 s++;
57 s++; 58 if (*s)
58 if (*s) 59 bits = *s++;
59 bits = *s++; 60 if (*s == ',')
60 if (*s == ',') 61 s++;
61 s++; 62 if (*s == 'h')
62 if (*s == 'h')
63 flow = 'r';
64 }
65 if (baud == 0)
66 baud = 38400;
67 if (parity != 'n' && parity != 'o' && parity != 'e')
68 parity = 'n';
69 if (bits != '7' && bits != '8')
70 bits = '8';
71 if (flow == '\0')
72 flow = 'r'; 63 flow = 'r';
64 }
65 if (baud == 0)
66 baud = 38400;
67 if (parity != 'n' && parity != 'o' && parity != 'e')
68 parity = 'n';
69 if (bits != '7' && bits != '8')
70 bits = '8';
71 if (flow == '\0')
72 flow = 'r';
73
74 if ((strstr(fw_getcmdline(), "earlycon=")) == NULL) {
75 sprintf(console_string, "uart8250,io,0x3f8,%d%c%c", baud,
76 parity, bits);
77 setup_early_serial8250_console(console_string);
78 }
79
80 if ((strstr(fw_getcmdline(), "console=")) == NULL) {
73 sprintf(console_string, " console=ttyS0,%d%c%c%c", baud, 81 sprintf(console_string, " console=ttyS0,%d%c%c%c", baud,
74 parity, bits, flow); 82 parity, bits, flow);
75 strcat(fw_getcmdline(), console_string); 83 strcat(fw_getcmdline(), console_string);
diff --git a/arch/mips/mti-malta/malta-int.c b/arch/mips/mti-malta/malta-int.c
index 0892575f829d..ca3e3a46a42f 100644
--- a/arch/mips/mti-malta/malta-int.c
+++ b/arch/mips/mti-malta/malta-int.c
@@ -1,25 +1,16 @@
1/* 1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
2 * Carsten Langgaard, carstenl@mips.com 6 * Carsten Langgaard, carstenl@mips.com
3 * Copyright (C) 2000, 2001, 2004 MIPS Technologies, Inc. 7 * Copyright (C) 2000, 2001, 2004 MIPS Technologies, Inc.
4 * Copyright (C) 2001 Ralf Baechle 8 * Copyright (C) 2001 Ralf Baechle
5 * 9 * Copyright (C) 2013 Imagination Technologies Ltd.
6 * This program is free software; you can distribute it and/or modify it
7 * under the terms of the GNU General Public License (Version 2) as
8 * published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13 * for more details.
14 *
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
18 * 10 *
19 * Routines for generic manipulation of the interrupts found on the MIPS 11 * Routines for generic manipulation of the interrupts found on the MIPS
20 * Malta board. 12 * Malta board. The interrupt controller is located in the South Bridge
21 * The interrupt controller is located in the South Bridge a PIIX4 device 13 * a PIIX4 device with two internal 82C95 interrupt controllers.
22 * with two internal 82C95 interrupt controllers.
23 */ 14 */
24#include <linux/init.h> 15#include <linux/init.h>
25#include <linux/irq.h> 16#include <linux/irq.h>
@@ -44,6 +35,7 @@
44#include <asm/gic.h> 35#include <asm/gic.h>
45#include <asm/gcmpregs.h> 36#include <asm/gcmpregs.h>
46#include <asm/setup.h> 37#include <asm/setup.h>
38#include <asm/rtlx.h>
47 39
48int gcmp_present = -1; 40int gcmp_present = -1;
49static unsigned long _msc01_biu_base; 41static unsigned long _msc01_biu_base;
@@ -90,7 +82,7 @@ static inline int mips_pcibios_iack(void)
90 BONITO_PCIMAP_CFG = 0; 82 BONITO_PCIMAP_CFG = 0;
91 break; 83 break;
92 default: 84 default:
93 printk(KERN_WARNING "Unknown system controller.\n"); 85 pr_emerg("Unknown system controller.\n");
94 return -1; 86 return -1;
95 } 87 }
96 return irq; 88 return irq;
@@ -126,6 +118,11 @@ static void malta_hw0_irqdispatch(void)
126 } 118 }
127 119
128 do_IRQ(MALTA_INT_BASE + irq); 120 do_IRQ(MALTA_INT_BASE + irq);
121
122#ifdef MIPS_VPE_APSP_API
123 if (aprp_hook)
124 aprp_hook();
125#endif
129} 126}
130 127
131static void malta_ipi_irqdispatch(void) 128static void malta_ipi_irqdispatch(void)
@@ -149,11 +146,11 @@ static void corehi_irqdispatch(void)
149 unsigned int intrcause, datalo, datahi; 146 unsigned int intrcause, datalo, datahi;
150 struct pt_regs *regs = get_irq_regs(); 147 struct pt_regs *regs = get_irq_regs();
151 148
152 printk(KERN_EMERG "CoreHI interrupt, shouldn't happen, we die here!\n"); 149 pr_emerg("CoreHI interrupt, shouldn't happen, we die here!\n");
153 printk(KERN_EMERG "epc : %08lx\nStatus: %08lx\n" 150 pr_emerg("epc : %08lx\nStatus: %08lx\n"
154 "Cause : %08lx\nbadVaddr : %08lx\n", 151 "Cause : %08lx\nbadVaddr : %08lx\n",
155 regs->cp0_epc, regs->cp0_status, 152 regs->cp0_epc, regs->cp0_status,
156 regs->cp0_cause, regs->cp0_badvaddr); 153 regs->cp0_cause, regs->cp0_badvaddr);
157 154
158 /* Read all the registers and then print them as there is a 155 /* Read all the registers and then print them as there is a
159 problem with interspersed printk's upsetting the Bonito controller. 156 problem with interspersed printk's upsetting the Bonito controller.
@@ -171,8 +168,8 @@ static void corehi_irqdispatch(void)
171 intrcause = GT_READ(GT_INTRCAUSE_OFS); 168 intrcause = GT_READ(GT_INTRCAUSE_OFS);
172 datalo = GT_READ(GT_CPUERR_ADDRLO_OFS); 169 datalo = GT_READ(GT_CPUERR_ADDRLO_OFS);
173 datahi = GT_READ(GT_CPUERR_ADDRHI_OFS); 170 datahi = GT_READ(GT_CPUERR_ADDRHI_OFS);
174 printk(KERN_EMERG "GT_INTRCAUSE = %08x\n", intrcause); 171 pr_emerg("GT_INTRCAUSE = %08x\n", intrcause);
175 printk(KERN_EMERG "GT_CPUERR_ADDR = %02x%08x\n", 172 pr_emerg("GT_CPUERR_ADDR = %02x%08x\n",
176 datahi, datalo); 173 datahi, datalo);
177 break; 174 break;
178 case MIPS_REVISION_SCON_BONITO: 175 case MIPS_REVISION_SCON_BONITO:
@@ -184,14 +181,14 @@ static void corehi_irqdispatch(void)
184 intedge = BONITO_INTEDGE; 181 intedge = BONITO_INTEDGE;
185 intsteer = BONITO_INTSTEER; 182 intsteer = BONITO_INTSTEER;
186 pcicmd = BONITO_PCICMD; 183 pcicmd = BONITO_PCICMD;
187 printk(KERN_EMERG "BONITO_INTISR = %08x\n", intisr); 184 pr_emerg("BONITO_INTISR = %08x\n", intisr);
188 printk(KERN_EMERG "BONITO_INTEN = %08x\n", inten); 185 pr_emerg("BONITO_INTEN = %08x\n", inten);
189 printk(KERN_EMERG "BONITO_INTPOL = %08x\n", intpol); 186 pr_emerg("BONITO_INTPOL = %08x\n", intpol);
190 printk(KERN_EMERG "BONITO_INTEDGE = %08x\n", intedge); 187 pr_emerg("BONITO_INTEDGE = %08x\n", intedge);
191 printk(KERN_EMERG "BONITO_INTSTEER = %08x\n", intsteer); 188 pr_emerg("BONITO_INTSTEER = %08x\n", intsteer);
192 printk(KERN_EMERG "BONITO_PCICMD = %08x\n", pcicmd); 189 pr_emerg("BONITO_PCICMD = %08x\n", pcicmd);
193 printk(KERN_EMERG "BONITO_PCIBADADDR = %08x\n", pcibadaddr); 190 pr_emerg("BONITO_PCIBADADDR = %08x\n", pcibadaddr);
194 printk(KERN_EMERG "BONITO_PCIMSTAT = %08x\n", pcimstat); 191 pr_emerg("BONITO_PCIMSTAT = %08x\n", pcimstat);
195 break; 192 break;
196 } 193 }
197 194
@@ -313,6 +310,11 @@ static void ipi_call_dispatch(void)
313 310
314static irqreturn_t ipi_resched_interrupt(int irq, void *dev_id) 311static irqreturn_t ipi_resched_interrupt(int irq, void *dev_id)
315{ 312{
313#ifdef MIPS_VPE_APSP_API
314 if (aprp_hook)
315 aprp_hook();
316#endif
317
316 scheduler_ipi(); 318 scheduler_ipi();
317 319
318 return IRQ_HANDLED; 320 return IRQ_HANDLED;
@@ -365,13 +367,13 @@ static struct irqaction corehi_irqaction = {
365 .flags = IRQF_NO_THREAD, 367 .flags = IRQF_NO_THREAD,
366}; 368};
367 369
368static msc_irqmap_t __initdata msc_irqmap[] = { 370static msc_irqmap_t msc_irqmap[] __initdata = {
369 {MSC01C_INT_TMR, MSC01_IRQ_EDGE, 0}, 371 {MSC01C_INT_TMR, MSC01_IRQ_EDGE, 0},
370 {MSC01C_INT_PCI, MSC01_IRQ_LEVEL, 0}, 372 {MSC01C_INT_PCI, MSC01_IRQ_LEVEL, 0},
371}; 373};
372static int __initdata msc_nr_irqs = ARRAY_SIZE(msc_irqmap); 374static int msc_nr_irqs __initdata = ARRAY_SIZE(msc_irqmap);
373 375
374static msc_irqmap_t __initdata msc_eicirqmap[] = { 376static msc_irqmap_t msc_eicirqmap[] __initdata = {
375 {MSC01E_INT_SW0, MSC01_IRQ_LEVEL, 0}, 377 {MSC01E_INT_SW0, MSC01_IRQ_LEVEL, 0},
376 {MSC01E_INT_SW1, MSC01_IRQ_LEVEL, 0}, 378 {MSC01E_INT_SW1, MSC01_IRQ_LEVEL, 0},
377 {MSC01E_INT_I8259A, MSC01_IRQ_LEVEL, 0}, 379 {MSC01E_INT_I8259A, MSC01_IRQ_LEVEL, 0},
@@ -384,7 +386,7 @@ static msc_irqmap_t __initdata msc_eicirqmap[] = {
384 {MSC01E_INT_CPUCTR, MSC01_IRQ_LEVEL, 0} 386 {MSC01E_INT_CPUCTR, MSC01_IRQ_LEVEL, 0}
385}; 387};
386 388
387static int __initdata msc_nr_eicirqs = ARRAY_SIZE(msc_eicirqmap); 389static int msc_nr_eicirqs __initdata = ARRAY_SIZE(msc_eicirqmap);
388 390
389/* 391/*
390 * This GIC specific tabular array defines the association between External 392 * This GIC specific tabular array defines the association between External
@@ -431,9 +433,12 @@ int __init gcmp_probe(unsigned long addr, unsigned long size)
431 if (gcmp_present >= 0) 433 if (gcmp_present >= 0)
432 return gcmp_present; 434 return gcmp_present;
433 435
434 _gcmp_base = (unsigned long) ioremap_nocache(GCMP_BASE_ADDR, GCMP_ADDRSPACE_SZ); 436 _gcmp_base = (unsigned long) ioremap_nocache(GCMP_BASE_ADDR,
435 _msc01_biu_base = (unsigned long) ioremap_nocache(MSC01_BIU_REG_BASE, MSC01_BIU_ADDRSPACE_SZ); 437 GCMP_ADDRSPACE_SZ);
436 gcmp_present = (GCMPGCB(GCMPB) & GCMP_GCB_GCMPB_GCMPBASE_MSK) == GCMP_BASE_ADDR; 438 _msc01_biu_base = (unsigned long) ioremap_nocache(MSC01_BIU_REG_BASE,
439 MSC01_BIU_ADDRSPACE_SZ);
440 gcmp_present = ((GCMPGCB(GCMPB) & GCMP_GCB_GCMPB_GCMPBASE_MSK) ==
441 GCMP_BASE_ADDR);
437 442
438 if (gcmp_present) 443 if (gcmp_present)
439 pr_debug("GCMP present\n"); 444 pr_debug("GCMP present\n");
@@ -443,9 +448,8 @@ int __init gcmp_probe(unsigned long addr, unsigned long size)
443/* Return the number of IOCU's present */ 448/* Return the number of IOCU's present */
444int __init gcmp_niocu(void) 449int __init gcmp_niocu(void)
445{ 450{
446 return gcmp_present ? 451 return gcmp_present ? ((GCMPGCB(GC) & GCMP_GCB_GC_NUMIOCU_MSK) >>
447 (GCMPGCB(GC) & GCMP_GCB_GC_NUMIOCU_MSK) >> GCMP_GCB_GC_NUMIOCU_SHF : 452 GCMP_GCB_GC_NUMIOCU_SHF) : 0;
448 0;
449} 453}
450 454
451/* Set GCMP region attributes */ 455/* Set GCMP region attributes */
@@ -594,11 +598,14 @@ void __init arch_init_irq(void)
594 set_vi_handler(MIPSCPU_INT_IPI1, malta_ipi_irqdispatch); 598 set_vi_handler(MIPSCPU_INT_IPI1, malta_ipi_irqdispatch);
595 } 599 }
596 /* Argh.. this really needs sorting out.. */ 600 /* Argh.. this really needs sorting out.. */
597 printk("CPU%d: status register was %08x\n", smp_processor_id(), read_c0_status()); 601 pr_info("CPU%d: status register was %08x\n",
602 smp_processor_id(), read_c0_status());
598 write_c0_status(read_c0_status() | STATUSF_IP3 | STATUSF_IP4); 603 write_c0_status(read_c0_status() | STATUSF_IP3 | STATUSF_IP4);
599 printk("CPU%d: status register now %08x\n", smp_processor_id(), read_c0_status()); 604 pr_info("CPU%d: status register now %08x\n",
605 smp_processor_id(), read_c0_status());
600 write_c0_status(0x1100dc00); 606 write_c0_status(0x1100dc00);
601 printk("CPU%d: status register frc %08x\n", smp_processor_id(), read_c0_status()); 607 pr_info("CPU%d: status register frc %08x\n",
608 smp_processor_id(), read_c0_status());
602 for (i = 0; i < nr_cpu_ids; i++) { 609 for (i = 0; i < nr_cpu_ids; i++) {
603 arch_init_ipiirq(MIPS_GIC_IRQ_BASE + 610 arch_init_ipiirq(MIPS_GIC_IRQ_BASE +
604 GIC_RESCHED_INT(i), &irq_resched); 611 GIC_RESCHED_INT(i), &irq_resched);
@@ -616,11 +623,15 @@ void __init arch_init_irq(void)
616 cpu_ipi_call_irq = MSC01E_INT_SW1; 623 cpu_ipi_call_irq = MSC01E_INT_SW1;
617 } else { 624 } else {
618 if (cpu_has_vint) { 625 if (cpu_has_vint) {
619 set_vi_handler (MIPS_CPU_IPI_RESCHED_IRQ, ipi_resched_dispatch); 626 set_vi_handler (MIPS_CPU_IPI_RESCHED_IRQ,
620 set_vi_handler (MIPS_CPU_IPI_CALL_IRQ, ipi_call_dispatch); 627 ipi_resched_dispatch);
628 set_vi_handler (MIPS_CPU_IPI_CALL_IRQ,
629 ipi_call_dispatch);
621 } 630 }
622 cpu_ipi_resched_irq = MIPS_CPU_IRQ_BASE + MIPS_CPU_IPI_RESCHED_IRQ; 631 cpu_ipi_resched_irq = MIPS_CPU_IRQ_BASE +
623 cpu_ipi_call_irq = MIPS_CPU_IRQ_BASE + MIPS_CPU_IPI_CALL_IRQ; 632 MIPS_CPU_IPI_RESCHED_IRQ;
633 cpu_ipi_call_irq = MIPS_CPU_IRQ_BASE +
634 MIPS_CPU_IPI_CALL_IRQ;
624 } 635 }
625 arch_init_ipiirq(cpu_ipi_resched_irq, &irq_resched); 636 arch_init_ipiirq(cpu_ipi_resched_irq, &irq_resched);
626 arch_init_ipiirq(cpu_ipi_call_irq, &irq_call); 637 arch_init_ipiirq(cpu_ipi_call_irq, &irq_call);
@@ -630,9 +641,7 @@ void __init arch_init_irq(void)
630 641
631void malta_be_init(void) 642void malta_be_init(void)
632{ 643{
633 if (gcmp_present) { 644 /* Could change CM error mask register. */
634 /* Could change CM error mask register */
635 }
636} 645}
637 646
638 647
@@ -712,14 +721,14 @@ int malta_be_handler(struct pt_regs *regs, int is_fixup)
712 if (cause < 16) { 721 if (cause < 16) {
713 unsigned long cca_bits = (cm_error >> 15) & 7; 722 unsigned long cca_bits = (cm_error >> 15) & 7;
714 unsigned long tr_bits = (cm_error >> 12) & 7; 723 unsigned long tr_bits = (cm_error >> 12) & 7;
715 unsigned long mcmd_bits = (cm_error >> 7) & 0x1f; 724 unsigned long cmd_bits = (cm_error >> 7) & 0x1f;
716 unsigned long stag_bits = (cm_error >> 3) & 15; 725 unsigned long stag_bits = (cm_error >> 3) & 15;
717 unsigned long sport_bits = (cm_error >> 0) & 7; 726 unsigned long sport_bits = (cm_error >> 0) & 7;
718 727
719 snprintf(buf, sizeof(buf), 728 snprintf(buf, sizeof(buf),
720 "CCA=%lu TR=%s MCmd=%s STag=%lu " 729 "CCA=%lu TR=%s MCmd=%s STag=%lu "
721 "SPort=%lu\n", 730 "SPort=%lu\n",
722 cca_bits, tr[tr_bits], mcmd[mcmd_bits], 731 cca_bits, tr[tr_bits], mcmd[cmd_bits],
723 stag_bits, sport_bits); 732 stag_bits, sport_bits);
724 } else { 733 } else {
725 /* glob state & sresp together */ 734 /* glob state & sresp together */
@@ -728,7 +737,7 @@ int malta_be_handler(struct pt_regs *regs, int is_fixup)
728 unsigned long c1_bits = (cm_error >> 12) & 7; 737 unsigned long c1_bits = (cm_error >> 12) & 7;
729 unsigned long c0_bits = (cm_error >> 9) & 7; 738 unsigned long c0_bits = (cm_error >> 9) & 7;
730 unsigned long sc_bit = (cm_error >> 8) & 1; 739 unsigned long sc_bit = (cm_error >> 8) & 1;
731 unsigned long mcmd_bits = (cm_error >> 3) & 0x1f; 740 unsigned long cmd_bits = (cm_error >> 3) & 0x1f;
732 unsigned long sport_bits = (cm_error >> 0) & 7; 741 unsigned long sport_bits = (cm_error >> 0) & 7;
733 snprintf(buf, sizeof(buf), 742 snprintf(buf, sizeof(buf),
734 "C3=%s C2=%s C1=%s C0=%s SC=%s " 743 "C3=%s C2=%s C1=%s C0=%s SC=%s "
@@ -736,16 +745,16 @@ int malta_be_handler(struct pt_regs *regs, int is_fixup)
736 core[c3_bits], core[c2_bits], 745 core[c3_bits], core[c2_bits],
737 core[c1_bits], core[c0_bits], 746 core[c1_bits], core[c0_bits],
738 sc_bit ? "True" : "False", 747 sc_bit ? "True" : "False",
739 mcmd[mcmd_bits], sport_bits); 748 mcmd[cmd_bits], sport_bits);
740 } 749 }
741 750
742 ocause = (cm_other & GCMP_GCB_GMEO_ERROR_2ND_MSK) >> 751 ocause = (cm_other & GCMP_GCB_GMEO_ERROR_2ND_MSK) >>
743 GCMP_GCB_GMEO_ERROR_2ND_SHF; 752 GCMP_GCB_GMEO_ERROR_2ND_SHF;
744 753
745 printk("CM_ERROR=%08lx %s <%s>\n", cm_error, 754 pr_err("CM_ERROR=%08lx %s <%s>\n", cm_error,
746 causes[cause], buf); 755 causes[cause], buf);
747 printk("CM_ADDR =%08lx\n", cm_addr); 756 pr_err("CM_ADDR =%08lx\n", cm_addr);
748 printk("CM_OTHER=%08lx %s\n", cm_other, causes[ocause]); 757 pr_err("CM_OTHER=%08lx %s\n", cm_other, causes[ocause]);
749 758
750 /* reprime cause register */ 759 /* reprime cause register */
751 GCMPGCB(GCMEC) = 0; 760 GCMPGCB(GCMEC) = 0;
diff --git a/arch/mips/mti-malta/malta-platform.c b/arch/mips/mti-malta/malta-platform.c
index 132f8663825e..e1dd1c1d3fde 100644
--- a/arch/mips/mti-malta/malta-platform.c
+++ b/arch/mips/mti-malta/malta-platform.c
@@ -47,6 +47,7 @@
47static struct plat_serial8250_port uart8250_data[] = { 47static struct plat_serial8250_port uart8250_data[] = {
48 SMC_PORT(0x3F8, 4), 48 SMC_PORT(0x3F8, 4),
49 SMC_PORT(0x2F8, 3), 49 SMC_PORT(0x2F8, 3),
50#ifndef CONFIG_MIPS_CMP
50 { 51 {
51 .mapbase = 0x1f000900, /* The CBUS UART */ 52 .mapbase = 0x1f000900, /* The CBUS UART */
52 .irq = MIPS_CPU_IRQ_BASE + MIPSCPU_INT_MB2, 53 .irq = MIPS_CPU_IRQ_BASE + MIPSCPU_INT_MB2,
@@ -55,6 +56,7 @@ static struct plat_serial8250_port uart8250_data[] = {
55 .flags = CBUS_UART_FLAGS, 56 .flags = CBUS_UART_FLAGS,
56 .regshift = 3, 57 .regshift = 3,
57 }, 58 },
59#endif
58 { }, 60 { },
59}; 61};
60 62
diff --git a/arch/mips/mti-malta/malta-time.c b/arch/mips/mti-malta/malta-time.c
index a18af5fce67e..319009912142 100644
--- a/arch/mips/mti-malta/malta-time.c
+++ b/arch/mips/mti-malta/malta-time.c
@@ -42,8 +42,6 @@
42#include <asm/mips-boards/generic.h> 42#include <asm/mips-boards/generic.h>
43#include <asm/mips-boards/maltaint.h> 43#include <asm/mips-boards/maltaint.h>
44 44
45unsigned long cpu_khz;
46
47static int mips_cpu_timer_irq; 45static int mips_cpu_timer_irq;
48static int mips_cpu_perf_irq; 46static int mips_cpu_perf_irq;
49extern int cp0_perfcount_irq; 47extern int cp0_perfcount_irq;
@@ -168,11 +166,24 @@ unsigned int get_c0_compare_int(void)
168 return mips_cpu_timer_irq; 166 return mips_cpu_timer_irq;
169} 167}
170 168
169static void __init init_rtc(void)
170{
171 /* stop the clock whilst setting it up */
172 CMOS_WRITE(RTC_SET | RTC_24H, RTC_CONTROL);
173
174 /* 32KHz time base */
175 CMOS_WRITE(RTC_REF_CLCK_32KHZ, RTC_FREQ_SELECT);
176
177 /* start the clock */
178 CMOS_WRITE(RTC_24H, RTC_CONTROL);
179}
180
171void __init plat_time_init(void) 181void __init plat_time_init(void)
172{ 182{
173 unsigned int prid = read_c0_prid() & (PRID_COMP_MASK | PRID_IMP_MASK); 183 unsigned int prid = read_c0_prid() & (PRID_COMP_MASK | PRID_IMP_MASK);
174 unsigned int freq; 184 unsigned int freq;
175 185
186 init_rtc();
176 estimate_frequencies(); 187 estimate_frequencies();
177 188
178 freq = mips_hpt_frequency; 189 freq = mips_hpt_frequency;
@@ -182,7 +193,6 @@ void __init plat_time_init(void)
182 freq = freqround(freq, 5000); 193 freq = freqround(freq, 5000);
183 printk("CPU frequency %d.%02d MHz\n", freq/1000000, 194 printk("CPU frequency %d.%02d MHz\n", freq/1000000,
184 (freq%1000000)*100/1000000); 195 (freq%1000000)*100/1000000);
185 cpu_khz = freq / 1000;
186 196
187 mips_scroll_message(); 197 mips_scroll_message();
188 198