aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-01-12 23:55:31 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2010-01-12 23:55:31 -0500
commitf25bb39f8adfe980df223f415f3b845953ca1147 (patch)
tree720e9a95d36061d133867d07282654dc9825b570 /arch
parent7113578a8a930259d6497976208e5b3e57141c5c (diff)
parent9a3065c942d59afcc1b71bb75743d9f37fcc2954 (diff)
Merge branch 'upstream' of git://ftp.linux-mips.org/pub/scm/upstream-linus
* 'upstream' of git://ftp.linux-mips.org/pub/scm/upstream-linus: (22 commits) MIPS: Ignore vmlinux.* MIPS: Move vmlinux.ecoff to arch/mips/boot MIPS: cpumask_of_node() should handle -1 as a node MIPS: Octeon: Use non-overflowing arithmetic in sched_clock MIPS: Malta, PowerTV: Remove unnecessary "Linux started" MIPS: BCM63xx: Remove duplicate CONFIG_CMDLINE. MIPS: AR7: Remove unused prom_getchar() MIPS: PowerTV: Remove extra r4k_clockevent_init() call MIPS: Cobalt use strlcat() for the command line arguments MIPS: Octeon: Add sched_clock() to csrc-octeon.c MIPS: TXx9: Cleanup builtin-cmdline processing MIPS: PowerTV: simplify prom_init_cmdline() and merge into prom_init() MIPS: PowerTV: Remove unused platform_die() MIPS: PowerTV: Remove mips_machine_halt() MIPS: PowerTV: Remove unused ptv_memsize MIPS: PowerTV: Remove unused prom_getcmdline() MIPS: AR7: Remove kgdb_enabled MIPS: Alchemy: Correct code taking the size of a pointer MIPS: BCM63xx: Fix whitespace damaged board_bcm963xx.c MIPS: VR41xx: Use strlcat() for the command line arguments ...
Diffstat (limited to 'arch')
-rw-r--r--arch/mips/alchemy/common/dbdma.c4
-rw-r--r--arch/mips/ar7/prom.c15
-rw-r--r--arch/mips/bcm63xx/boards/board_bcm963xx.c33
-rw-r--r--arch/mips/bcm63xx/prom.c3
-rw-r--r--arch/mips/boot/.gitignore1
-rw-r--r--arch/mips/boot/Makefile2
-rw-r--r--arch/mips/boot/compressed/Makefile9
-rw-r--r--arch/mips/boot/compressed/decompress.c10
-rw-r--r--arch/mips/boot/compressed/ld.script195
-rw-r--r--arch/mips/cavium-octeon/csrc-octeon.c32
-rw-r--r--arch/mips/cobalt/setup.c24
-rw-r--r--arch/mips/include/asm/mach-ip27/topology.h4
-rw-r--r--arch/mips/mipssim/sim_setup.c4
-rw-r--r--arch/mips/mm/tlbex.c8
-rw-r--r--arch/mips/mti-malta/malta-init.c1
-rw-r--r--arch/mips/powertv/Makefile2
-rw-r--r--arch/mips/powertv/cmdline.c52
-rw-r--r--arch/mips/powertv/init.c15
-rw-r--r--arch/mips/powertv/init.h2
-rw-r--r--arch/mips/powertv/memory.c5
-rw-r--r--arch/mips/powertv/powertv_setup.c21
-rw-r--r--arch/mips/powertv/reset.c18
-rw-r--r--arch/mips/powertv/time.c1
-rw-r--r--arch/mips/txx9/generic/setup.c21
-rw-r--r--arch/mips/vr41xx/common/init.c6
25 files changed, 134 insertions, 354 deletions
diff --git a/arch/mips/alchemy/common/dbdma.c b/arch/mips/alchemy/common/dbdma.c
index 19c1c82849f..5c68569344c 100644
--- a/arch/mips/alchemy/common/dbdma.c
+++ b/arch/mips/alchemy/common/dbdma.c
@@ -613,7 +613,7 @@ u32 _au1xxx_dbdma_put_source(u32 chanid, void *buf, int nbytes, u32 flags)
613 dma_cache_wback_inv((unsigned long)buf, nbytes); 613 dma_cache_wback_inv((unsigned long)buf, nbytes);
614 dp->dscr_cmd0 |= DSCR_CMD0_V; /* Let it rip */ 614 dp->dscr_cmd0 |= DSCR_CMD0_V; /* Let it rip */
615 au_sync(); 615 au_sync();
616 dma_cache_wback_inv((unsigned long)dp, sizeof(dp)); 616 dma_cache_wback_inv((unsigned long)dp, sizeof(*dp));
617 ctp->chan_ptr->ddma_dbell = 0; 617 ctp->chan_ptr->ddma_dbell = 0;
618 618
619 /* Get next descriptor pointer. */ 619 /* Get next descriptor pointer. */
@@ -676,7 +676,7 @@ _au1xxx_dbdma_put_dest(u32 chanid, void *buf, int nbytes, u32 flags)
676 dma_cache_inv((unsigned long)buf, nbytes); 676 dma_cache_inv((unsigned long)buf, nbytes);
677 dp->dscr_cmd0 |= DSCR_CMD0_V; /* Let it rip */ 677 dp->dscr_cmd0 |= DSCR_CMD0_V; /* Let it rip */
678 au_sync(); 678 au_sync();
679 dma_cache_wback_inv((unsigned long)dp, sizeof(dp)); 679 dma_cache_wback_inv((unsigned long)dp, sizeof(*dp));
680 ctp->chan_ptr->ddma_dbell = 0; 680 ctp->chan_ptr->ddma_dbell = 0;
681 681
682 /* Get next descriptor pointer. */ 682 /* Get next descriptor pointer. */
diff --git a/arch/mips/ar7/prom.c b/arch/mips/ar7/prom.c
index 5ad6f1db656..c1fdd368281 100644
--- a/arch/mips/ar7/prom.c
+++ b/arch/mips/ar7/prom.c
@@ -219,14 +219,6 @@ static void __init console_config(void)
219 if (strstr(prom_getcmdline(), "console=")) 219 if (strstr(prom_getcmdline(), "console="))
220 return; 220 return;
221 221
222#ifdef CONFIG_KGDB
223 if (!strstr(prom_getcmdline(), "nokgdb")) {
224 strcat(prom_getcmdline(), " console=kgdb");
225 kgdb_enabled = 1;
226 return;
227 }
228#endif
229
230 s = prom_getenv("modetty0"); 222 s = prom_getenv("modetty0");
231 if (s) { 223 if (s) {
232 baud = simple_strtoul(s, &p, 10); 224 baud = simple_strtoul(s, &p, 10);
@@ -280,13 +272,6 @@ static inline void serial_out(int offset, int value)
280 writel(value, (void *)PORT(offset)); 272 writel(value, (void *)PORT(offset));
281} 273}
282 274
283char prom_getchar(void)
284{
285 while (!(serial_in(UART_LSR) & UART_LSR_DR))
286 ;
287 return serial_in(UART_RX);
288}
289
290int prom_putchar(char c) 275int prom_putchar(char c)
291{ 276{
292 while ((serial_in(UART_LSR) & UART_LSR_TEMT) == 0) 277 while ((serial_in(UART_LSR) & UART_LSR_TEMT) == 0)
diff --git a/arch/mips/bcm63xx/boards/board_bcm963xx.c b/arch/mips/bcm63xx/boards/board_bcm963xx.c
index 05a35cf5963..1fe412c4317 100644
--- a/arch/mips/bcm63xx/boards/board_bcm963xx.c
+++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c
@@ -346,27 +346,26 @@ static struct board_info __initdata board_96348gw = {
346}; 346};
347 347
348static struct board_info __initdata board_FAST2404 = { 348static struct board_info __initdata board_FAST2404 = {
349 .name = "F@ST2404", 349 .name = "F@ST2404",
350 .expected_cpu_id = 0x6348, 350 .expected_cpu_id = 0x6348,
351
352 .has_enet0 = 1,
353 .has_enet1 = 1,
354 .has_pci = 1,
355 351
356 .enet0 = { 352 .has_enet0 = 1,
357 .has_phy = 1, 353 .has_enet1 = 1,
358 .use_internal_phy = 1, 354 .has_pci = 1,
359 },
360 355
361 .enet1 = { 356 .enet0 = {
362 .force_speed_100 = 1, 357 .has_phy = 1,
363 .force_duplex_full = 1, 358 .use_internal_phy = 1,
364 }, 359 },
365 360
361 .enet1 = {
362 .force_speed_100 = 1,
363 .force_duplex_full = 1,
364 },
366 365
367 .has_ohci0 = 1, 366 .has_ohci0 = 1,
368 .has_pccard = 1, 367 .has_pccard = 1,
369 .has_ehci0 = 1, 368 .has_ehci0 = 1,
370}; 369};
371 370
372static struct board_info __initdata board_DV201AMR = { 371static struct board_info __initdata board_DV201AMR = {
diff --git a/arch/mips/bcm63xx/prom.c b/arch/mips/bcm63xx/prom.c
index fb284fbc585..be252efa075 100644
--- a/arch/mips/bcm63xx/prom.c
+++ b/arch/mips/bcm63xx/prom.c
@@ -40,9 +40,6 @@ void __init prom_init(void)
40 reg &= ~mask; 40 reg &= ~mask;
41 bcm_perf_writel(reg, PERF_CKCTL_REG); 41 bcm_perf_writel(reg, PERF_CKCTL_REG);
42 42
43 /* assign command line from kernel config */
44 strcpy(arcs_cmdline, CONFIG_CMDLINE);
45
46 /* register gpiochip */ 43 /* register gpiochip */
47 bcm63xx_gpio_init(); 44 bcm63xx_gpio_init();
48 45
diff --git a/arch/mips/boot/.gitignore b/arch/mips/boot/.gitignore
index ba63401c6e1..4667a5f9280 100644
--- a/arch/mips/boot/.gitignore
+++ b/arch/mips/boot/.gitignore
@@ -1,4 +1,5 @@
1mkboot 1mkboot
2elf2ecoff 2elf2ecoff
3vmlinux.*
3zImage 4zImage
4zImage.tmp 5zImage.tmp
diff --git a/arch/mips/boot/Makefile b/arch/mips/boot/Makefile
index 094bc84765a..e39a08edcaa 100644
--- a/arch/mips/boot/Makefile
+++ b/arch/mips/boot/Makefile
@@ -28,7 +28,7 @@ VMLINUX = vmlinux
28all: vmlinux.ecoff vmlinux.srec 28all: vmlinux.ecoff vmlinux.srec
29 29
30vmlinux.ecoff: $(obj)/elf2ecoff $(VMLINUX) 30vmlinux.ecoff: $(obj)/elf2ecoff $(VMLINUX)
31 $(obj)/elf2ecoff $(VMLINUX) vmlinux.ecoff $(E2EFLAGS) 31 $(obj)/elf2ecoff $(VMLINUX) $(obj)/vmlinux.ecoff $(E2EFLAGS)
32 32
33$(obj)/elf2ecoff: $(obj)/elf2ecoff.c 33$(obj)/elf2ecoff: $(obj)/elf2ecoff.c
34 $(HOSTCC) -o $@ $^ 34 $(HOSTCC) -o $@ $^
diff --git a/arch/mips/boot/compressed/Makefile b/arch/mips/boot/compressed/Makefile
index e27f40bbd4e..671d3448fad 100644
--- a/arch/mips/boot/compressed/Makefile
+++ b/arch/mips/boot/compressed/Makefile
@@ -56,7 +56,7 @@ $(obj)/piggy.o: $(obj)/vmlinux.$(suffix_y) $(obj)/dummy.o
56LDFLAGS_vmlinuz := $(LDFLAGS) -Ttext $(VMLINUZ_LOAD_ADDRESS) -T 56LDFLAGS_vmlinuz := $(LDFLAGS) -Ttext $(VMLINUZ_LOAD_ADDRESS) -T
57vmlinuz: $(src)/ld.script $(obj-y) $(obj)/piggy.o 57vmlinuz: $(src)/ld.script $(obj-y) $(obj)/piggy.o
58 $(call if_changed,ld) 58 $(call if_changed,ld)
59 $(Q)$(OBJCOPY) $(OBJCOPYFLAGS) -R .comment -R .stab -R .stabstr -R .initrd -R .sysmap $@ 59 $(Q)$(OBJCOPY) $(OBJCOPYFLAGS) $@
60 60
61# 61#
62# Some DECstations need all possible sections of an ECOFF executable 62# Some DECstations need all possible sections of an ECOFF executable
@@ -84,14 +84,11 @@ vmlinuz.ecoff: $(obj)/../elf2ecoff $(VMLINUZ)
84$(obj)/../elf2ecoff: $(src)/../elf2ecoff.c 84$(obj)/../elf2ecoff: $(src)/../elf2ecoff.c
85 $(Q)$(HOSTCC) -o $@ $^ 85 $(Q)$(HOSTCC) -o $@ $^
86 86
87drop-sections = .reginfo .mdebug .comment .note .pdr .options .MIPS.options 87OBJCOPYFLAGS_vmlinuz.bin := $(OBJCOPYFLAGS) -O binary
88strip-flags = $(addprefix --remove-section=,$(drop-sections))
89
90OBJCOPYFLAGS_vmlinuz.bin := $(OBJCOPYFLAGS) -O binary $(strip-flags)
91vmlinuz.bin: vmlinuz 88vmlinuz.bin: vmlinuz
92 $(call if_changed,objcopy) 89 $(call if_changed,objcopy)
93 90
94OBJCOPYFLAGS_vmlinuz.srec := $(OBJCOPYFLAGS) -S -O srec $(strip-flags) 91OBJCOPYFLAGS_vmlinuz.srec := $(OBJCOPYFLAGS) -S -O srec
95vmlinuz.srec: vmlinuz 92vmlinuz.srec: vmlinuz
96 $(call if_changed,objcopy) 93 $(call if_changed,objcopy)
97 94
diff --git a/arch/mips/boot/compressed/decompress.c b/arch/mips/boot/compressed/decompress.c
index 67330c2f731..e48fd72898a 100644
--- a/arch/mips/boot/compressed/decompress.c
+++ b/arch/mips/boot/compressed/decompress.c
@@ -28,8 +28,6 @@ char *zimage_start;
28 28
29/* The linker tells us where the image is. */ 29/* The linker tells us where the image is. */
30extern unsigned char __image_begin, __image_end; 30extern unsigned char __image_begin, __image_end;
31extern unsigned char __ramdisk_begin, __ramdisk_end;
32unsigned long initrd_size;
33 31
34/* debug interfaces */ 32/* debug interfaces */
35extern void puts(const char *s); 33extern void puts(const char *s);
@@ -102,14 +100,6 @@ void decompress_kernel(unsigned long boot_heap_start)
102 puthex((unsigned long)(zimage_size + zimage_start)); 100 puthex((unsigned long)(zimage_size + zimage_start));
103 puts("\n"); 101 puts("\n");
104 102
105 if (initrd_size) {
106 puts("initrd at: ");
107 puthex((unsigned long)(&__ramdisk_begin));
108 puts(" ");
109 puthex((unsigned long)(&__ramdisk_end));
110 puts("\n");
111 }
112
113 /* this area are prepared for mallocing when decompressing */ 103 /* this area are prepared for mallocing when decompressing */
114 free_mem_ptr = boot_heap_start; 104 free_mem_ptr = boot_heap_start;
115 free_mem_end_ptr = boot_heap_start + BOOT_HEAP_SIZE; 105 free_mem_end_ptr = boot_heap_start + BOOT_HEAP_SIZE;
diff --git a/arch/mips/boot/compressed/ld.script b/arch/mips/boot/compressed/ld.script
index 29e9f4c0d5d..613a35b02f5 100644
--- a/arch/mips/boot/compressed/ld.script
+++ b/arch/mips/boot/compressed/ld.script
@@ -1,150 +1,67 @@
1/*
2 * ld.script for compressed kernel support of MIPS
3 *
4 * Copyright (C) 2009 Lemote Inc.
5 * Author: Wu Zhangjin <wuzj@lemote.com>
6 */
7
1OUTPUT_ARCH(mips) 8OUTPUT_ARCH(mips)
2ENTRY(start) 9ENTRY(start)
3SECTIONS 10SECTIONS
4{ 11{
5 /* Read-only sections, merged into text segment: */ 12 /* . = VMLINUZ_LOAD_ADDRESS */
6 .init : { *(.init) } =0 13 /* read-only */
7 .text : 14 _text = .; /* Text and read-only data */
8 { 15 .text : {
9 _ftext = . ; 16 _ftext = . ;
10 *(.text) 17 *(.text)
11 *(.rodata) 18 *(.rodata)
12 *(.rodata1) 19 } = 0
13 /* .gnu.warning sections are handled specially by elf32.em. */ 20 _etext = .; /* End of text section */
14 *(.gnu.warning)
15 } =0
16 .kstrtab : { *(.kstrtab) }
17
18 . = ALIGN(16); /* Exception table */
19 __start___ex_table = .;
20 __ex_table : { *(__ex_table) }
21 __stop___ex_table = .;
22
23 __start___dbe_table = .; /* Exception table for data bus errors */
24 __dbe_table : { *(__dbe_table) }
25 __stop___dbe_table = .;
26
27 __start___ksymtab = .; /* Kernel symbol table */
28 __ksymtab : { *(__ksymtab) }
29 __stop___ksymtab = .;
30
31 _etext = .;
32
33 . = ALIGN(8192);
34 .data.init_task : { *(.data.init_task) }
35
36 /* Startup code */
37 . = ALIGN(4096);
38 __init_begin = .;
39 .text.init : { *(.text.init) }
40 .data.init : { *(.data.init) }
41 . = ALIGN(16);
42 __setup_start = .;
43 .setup.init : { *(.setup.init) }
44 __setup_end = .;
45 __initcall_start = .;
46 .initcall.init : { *(.initcall.init) }
47 __initcall_end = .;
48 . = ALIGN(4096); /* Align double page for init_task_union */
49 __init_end = .;
50
51 . = ALIGN(4096);
52 .data.page_aligned : { *(.data.idt) }
53
54 . = ALIGN(32);
55 .data.cacheline_aligned : { *(.data.cacheline_aligned) }
56 21
57 .fini : { *(.fini) } =0 22 /* writable */
58 .reginfo : { *(.reginfo) } 23 .data : { /* Data */
59 /* Adjust the address for the data segment. We want to adjust up to 24 _fdata = . ;
60 the same address within the page on the next page up. It would 25 *(.data)
61 be more correct to do this: 26 /* Put the compressed image here, so bss is on the end. */
62 . = .; 27 __image_begin = .;
63 The current expression does not correctly handle the case of a 28 *(.image)
64 text segment ending precisely at the end of a page; it causes the 29 __image_end = .;
65 data segment to skip a page. The above expression does not have 30 CONSTRUCTORS
66 this problem, but it will currently (2/95) cause BFD to allocate 31 }
67 a single segment, combining both text and data, for this case. 32 .sdata : { *(.sdata) }
68 This will prevent the text segment from being shared among 33 . = ALIGN(4);
69 multiple executions of the program; I think that is more 34 _edata = .; /* End of data section */
70 important than losing a page of the virtual address space (note
71 that no actual memory is lost; the page which is skipped can not
72 be referenced). */
73 . = .;
74 .data :
75 {
76 _fdata = . ;
77 *(.data)
78 35
79 /* Put the compressed image here, so bss is on the end. */ 36 /* BSS */
80 __image_begin = .; 37 __bss_start = .;
81 *(.image) 38 _fbss = .;
82 __image_end = .; 39 .sbss : { *(.sbss) *(.scommon) }
83 /* Align the initial ramdisk image (INITRD) on page boundaries. */ 40 .bss : {
84 . = ALIGN(4096); 41 *(.dynbss)
85 __ramdisk_begin = .; 42 *(.bss)
86 *(.initrd) 43 *(COMMON)
87 __ramdisk_end = .; 44 }
88 . = ALIGN(4096); 45 . = ALIGN(4);
46 _end = . ;
89 47
90 CONSTRUCTORS 48 /* These are needed for ELF backends which have not yet been converted
91 } 49 * to the new style linker. */
92 .data1 : { *(.data1) }
93 _gp = . + 0x8000;
94 .lit8 : { *(.lit8) }
95 .lit4 : { *(.lit4) }
96 .ctors : { *(.ctors) }
97 .dtors : { *(.dtors) }
98 .got : { *(.got.plt) *(.got) }
99 .dynamic : { *(.dynamic) }
100 /* We want the small data sections together, so single-instruction offsets
101 can access them all, and initialized data all before uninitialized, so
102 we can shorten the on-disk segment size. */
103 .sdata : { *(.sdata) }
104 . = ALIGN(4);
105 _edata = .;
106 PROVIDE (edata = .);
107 50
108 __bss_start = .; 51 .stab 0 : { *(.stab) }
109 _fbss = .; 52 .stabstr 0 : { *(.stabstr) }
110 .sbss : { *(.sbss) *(.scommon) }
111 .bss :
112 {
113 *(.dynbss)
114 *(.bss)
115 *(COMMON)
116 . = ALIGN(4);
117 _end = . ;
118 PROVIDE (end = .);
119 }
120 53
121 /* Sections to be discarded */ 54 /* These must appear regardless of . */
122 /DISCARD/ : 55 .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }
123 { 56 .gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }
124 *(.text.exit)
125 *(.data.exit)
126 *(.exitcall.exit)
127 }
128 57
129 /* This is the MIPS specific mdebug section. */ 58 /* Sections to be discarded */
130 .mdebug : { *(.mdebug) } 59 /DISCARD/ : {
131 /* These are needed for ELF backends which have not yet been 60 *(.MIPS.options)
132 converted to the new style linker. */ 61 *(.options)
133 .stab 0 : { *(.stab) } 62 *(.pdr)
134 .stabstr 0 : { *(.stabstr) } 63 *(.reginfo)
135 /* DWARF debug sections. 64 *(.comment)
136 Symbols in the .debug DWARF section are relative to the beginning of the 65 *(.note)
137 section so we begin .debug at 0. It's not clear yet what needs to happen 66 }
138 for the others. */
139 .debug 0 : { *(.debug) }
140 .debug_srcinfo 0 : { *(.debug_srcinfo) }
141 .debug_aranges 0 : { *(.debug_aranges) }
142 .debug_pubnames 0 : { *(.debug_pubnames) }
143 .debug_sfnames 0 : { *(.debug_sfnames) }
144 .line 0 : { *(.line) }
145 /* These must appear regardless of . */
146 .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }
147 .gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }
148 .comment : { *(.comment) }
149 .note : { *(.note) }
150} 67}
diff --git a/arch/mips/cavium-octeon/csrc-octeon.c b/arch/mips/cavium-octeon/csrc-octeon.c
index 96110f217dc..0bf4bbe04ae 100644
--- a/arch/mips/cavium-octeon/csrc-octeon.c
+++ b/arch/mips/cavium-octeon/csrc-octeon.c
@@ -50,6 +50,38 @@ static struct clocksource clocksource_mips = {
50 .flags = CLOCK_SOURCE_IS_CONTINUOUS, 50 .flags = CLOCK_SOURCE_IS_CONTINUOUS,
51}; 51};
52 52
53unsigned long long notrace sched_clock(void)
54{
55 /* 64-bit arithmatic can overflow, so use 128-bit. */
56#if (__GNUC__ < 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ <= 3))
57 u64 t1, t2, t3;
58 unsigned long long rv;
59 u64 mult = clocksource_mips.mult;
60 u64 shift = clocksource_mips.shift;
61 u64 cnt = read_c0_cvmcount();
62
63 asm (
64 "dmultu\t%[cnt],%[mult]\n\t"
65 "nor\t%[t1],$0,%[shift]\n\t"
66 "mfhi\t%[t2]\n\t"
67 "mflo\t%[t3]\n\t"
68 "dsll\t%[t2],%[t2],1\n\t"
69 "dsrlv\t%[rv],%[t3],%[shift]\n\t"
70 "dsllv\t%[t1],%[t2],%[t1]\n\t"
71 "or\t%[rv],%[t1],%[rv]\n\t"
72 : [rv] "=&r" (rv), [t1] "=&r" (t1), [t2] "=&r" (t2), [t3] "=&r" (t3)
73 : [cnt] "r" (cnt), [mult] "r" (mult), [shift] "r" (shift)
74 : "hi", "lo");
75 return rv;
76#else
77 /* GCC > 4.3 do it the easy way. */
78 unsigned int __attribute__((mode(TI))) t;
79 t = read_c0_cvmcount();
80 t = t * clocksource_mips.mult;
81 return (unsigned long long)(t >> clocksource_mips.shift);
82#endif
83}
84
53void __init plat_time_init(void) 85void __init plat_time_init(void)
54{ 86{
55 clocksource_mips.rating = 300; 87 clocksource_mips.rating = 300;
diff --git a/arch/mips/cobalt/setup.c b/arch/mips/cobalt/setup.c
index b5164422724..ec3b2c417f7 100644
--- a/arch/mips/cobalt/setup.c
+++ b/arch/mips/cobalt/setup.c
@@ -97,26 +97,18 @@ void __init plat_mem_setup(void)
97 97
98void __init prom_init(void) 98void __init prom_init(void)
99{ 99{
100 int narg, indx, posn, nchr;
101 unsigned long memsz; 100 unsigned long memsz;
101 int argc, i;
102 char **argv; 102 char **argv;
103 103
104 memsz = fw_arg0 & 0x7fff0000; 104 memsz = fw_arg0 & 0x7fff0000;
105 narg = fw_arg0 & 0x0000ffff; 105 argc = fw_arg0 & 0x0000ffff;
106 106 argv = (char **)fw_arg1;
107 if (narg) { 107
108 arcs_cmdline[0] = '\0'; 108 for (i = 1; i < argc; i++) {
109 argv = (char **) fw_arg1; 109 strlcat(arcs_cmdline, argv[i], COMMAND_LINE_SIZE);
110 posn = 0; 110 if (i < (argc - 1))
111 for (indx = 1; indx < narg; ++indx) { 111 strlcat(arcs_cmdline, " ", COMMAND_LINE_SIZE);
112 nchr = strlen(argv[indx]);
113 if (posn + 1 + nchr + 1 > sizeof(arcs_cmdline))
114 break;
115 if (posn)
116 arcs_cmdline[posn++] = ' ';
117 strcpy(arcs_cmdline + posn, argv[indx]);
118 posn += nchr;
119 }
120 } 112 }
121 113
122 add_memory_region(0x0, memsz, BOOT_MEM_RAM); 114 add_memory_region(0x0, memsz, BOOT_MEM_RAM);
diff --git a/arch/mips/include/asm/mach-ip27/topology.h b/arch/mips/include/asm/mach-ip27/topology.h
index 09a59bcc1b0..1b1a7d1632b 100644
--- a/arch/mips/include/asm/mach-ip27/topology.h
+++ b/arch/mips/include/asm/mach-ip27/topology.h
@@ -24,7 +24,9 @@ extern struct cpuinfo_ip27 sn_cpu_info[NR_CPUS];
24 24
25#define cpu_to_node(cpu) (sn_cpu_info[(cpu)].p_nodeid) 25#define cpu_to_node(cpu) (sn_cpu_info[(cpu)].p_nodeid)
26#define parent_node(node) (node) 26#define parent_node(node) (node)
27#define cpumask_of_node(node) (&hub_data(node)->h_cpus) 27#define cpumask_of_node(node) ((node) == -1 ? \
28 cpu_all_mask : \
29 &hub_data(node)->h_cpus)
28struct pci_bus; 30struct pci_bus;
29extern int pcibus_to_node(struct pci_bus *); 31extern int pcibus_to_node(struct pci_bus *);
30 32
diff --git a/arch/mips/mipssim/sim_setup.c b/arch/mips/mipssim/sim_setup.c
index 0824f6af477..55f22a3afe6 100644
--- a/arch/mips/mipssim/sim_setup.c
+++ b/arch/mips/mipssim/sim_setup.c
@@ -49,9 +49,6 @@ void __init plat_mem_setup(void)
49 set_io_port_base(0xbfd00000); 49 set_io_port_base(0xbfd00000);
50 50
51 serial_init(); 51 serial_init();
52
53 pr_info("Linux started...\n");
54
55} 52}
56 53
57extern struct plat_smp_ops ssmtc_smp_ops; 54extern struct plat_smp_ops ssmtc_smp_ops;
@@ -60,7 +57,6 @@ void __init prom_init(void)
60{ 57{
61 set_io_port_base(0xbfd00000); 58 set_io_port_base(0xbfd00000);
62 59
63 pr_info("\nLINUX started...\n");
64 prom_meminit(); 60 prom_meminit();
65 61
66#ifdef CONFIG_MIPS_MT_SMP 62#ifdef CONFIG_MIPS_MT_SMP
diff --git a/arch/mips/mm/tlbex.c b/arch/mips/mm/tlbex.c
index 3d0baa4a842..badcf5e8d69 100644
--- a/arch/mips/mm/tlbex.c
+++ b/arch/mips/mm/tlbex.c
@@ -73,9 +73,6 @@ static int __cpuinit m4kc_tlbp_war(void)
73enum label_id { 73enum label_id {
74 label_second_part = 1, 74 label_second_part = 1,
75 label_leave, 75 label_leave,
76#ifdef MODULE_START
77 label_module_alloc,
78#endif
79 label_vmalloc, 76 label_vmalloc,
80 label_vmalloc_done, 77 label_vmalloc_done,
81 label_tlbw_hazard, 78 label_tlbw_hazard,
@@ -92,9 +89,6 @@ enum label_id {
92 89
93UASM_L_LA(_second_part) 90UASM_L_LA(_second_part)
94UASM_L_LA(_leave) 91UASM_L_LA(_leave)
95#ifdef MODULE_START
96UASM_L_LA(_module_alloc)
97#endif
98UASM_L_LA(_vmalloc) 92UASM_L_LA(_vmalloc)
99UASM_L_LA(_vmalloc_done) 93UASM_L_LA(_vmalloc_done)
100UASM_L_LA(_tlbw_hazard) 94UASM_L_LA(_tlbw_hazard)
@@ -818,8 +812,6 @@ static void __cpuinit build_r4000_tlb_refill_handler(void)
818 } else { 812 } else {
819#if defined(CONFIG_HUGETLB_PAGE) 813#if defined(CONFIG_HUGETLB_PAGE)
820 const enum label_id ls = label_tlb_huge_update; 814 const enum label_id ls = label_tlb_huge_update;
821#elif defined(MODULE_START)
822 const enum label_id ls = label_module_alloc;
823#else 815#else
824 const enum label_id ls = label_vmalloc; 816 const enum label_id ls = label_vmalloc;
825#endif 817#endif
diff --git a/arch/mips/mti-malta/malta-init.c b/arch/mips/mti-malta/malta-init.c
index f1b14c8a4a1..414f0c99b19 100644
--- a/arch/mips/mti-malta/malta-init.c
+++ b/arch/mips/mti-malta/malta-init.c
@@ -355,7 +355,6 @@ void __init prom_init(void)
355 board_nmi_handler_setup = mips_nmi_setup; 355 board_nmi_handler_setup = mips_nmi_setup;
356 board_ejtag_handler_setup = mips_ejtag_setup; 356 board_ejtag_handler_setup = mips_ejtag_setup;
357 357
358 pr_info("\nLINUX started...\n");
359 prom_init_cmdline(); 358 prom_init_cmdline();
360 prom_meminit(); 359 prom_meminit();
361#ifdef CONFIG_SERIAL_8250_CONSOLE 360#ifdef CONFIG_SERIAL_8250_CONSOLE
diff --git a/arch/mips/powertv/Makefile b/arch/mips/powertv/Makefile
index 2c516718aff..0a0d73c0564 100644
--- a/arch/mips/powertv/Makefile
+++ b/arch/mips/powertv/Makefile
@@ -23,6 +23,6 @@
23# under Linux. 23# under Linux.
24# 24#
25 25
26obj-y += cmdline.o init.o memory.o reset.o time.o powertv_setup.o asic/ pci/ 26obj-y += init.o memory.o reset.o time.o powertv_setup.o asic/ pci/
27 27
28EXTRA_CFLAGS += -Wall -Werror 28EXTRA_CFLAGS += -Wall -Werror
diff --git a/arch/mips/powertv/cmdline.c b/arch/mips/powertv/cmdline.c
deleted file mode 100644
index 98d73cb0d45..00000000000
--- a/arch/mips/powertv/cmdline.c
+++ /dev/null
@@ -1,52 +0,0 @@
1/*
2 * Carsten Langgaard, carstenl@mips.com
3 * Copyright (C) 1999,2000 MIPS Technologies, Inc. All rights reserved.
4 * Portions copyright (C) 2009 Cisco Systems, Inc.
5 *
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 *
19 * Kernel command line creation using the prom monitor (YAMON) argc/argv.
20 */
21#include <linux/init.h>
22#include <linux/string.h>
23
24#include <asm/bootinfo.h>
25
26#include "init.h"
27
28/*
29 * YAMON (32-bit PROM) pass arguments and environment as 32-bit pointer.
30 * This macro take care of sign extension.
31 */
32#define prom_argv(index) ((char *)(long)_prom_argv[(index)])
33
34char * __init prom_getcmdline(void)
35{
36 return &(arcs_cmdline[0]);
37}
38
39void __init prom_init_cmdline(void)
40{
41 int len;
42
43 if (prom_argc != 1)
44 return;
45
46 len = strlen(arcs_cmdline);
47
48 arcs_cmdline[len] = ' ';
49
50 strlcpy(arcs_cmdline + len + 1, (char *)_prom_argv,
51 COMMAND_LINE_SIZE - len - 1);
52}
diff --git a/arch/mips/powertv/init.c b/arch/mips/powertv/init.c
index 5f4e4c304e4..0afe227f1d0 100644
--- a/arch/mips/powertv/init.c
+++ b/arch/mips/powertv/init.c
@@ -34,10 +34,7 @@
34#include <asm/mips-boards/generic.h> 34#include <asm/mips-boards/generic.h>
35#include <asm/mach-powertv/asic.h> 35#include <asm/mach-powertv/asic.h>
36 36
37#include "init.h" 37static int *_prom_envp;
38
39int prom_argc;
40int *_prom_argv, *_prom_envp;
41unsigned long _prom_memsize; 38unsigned long _prom_memsize;
42 39
43/* 40/*
@@ -109,16 +106,20 @@ static void __init mips_ejtag_setup(void)
109 106
110void __init prom_init(void) 107void __init prom_init(void)
111{ 108{
109 int prom_argc;
110 char *prom_argv;
111
112 prom_argc = fw_arg0; 112 prom_argc = fw_arg0;
113 _prom_argv = (int *) fw_arg1; 113 prom_argv = (char *) fw_arg1;
114 _prom_envp = (int *) fw_arg2; 114 _prom_envp = (int *) fw_arg2;
115 _prom_memsize = (unsigned long) fw_arg3; 115 _prom_memsize = (unsigned long) fw_arg3;
116 116
117 board_nmi_handler_setup = mips_nmi_setup; 117 board_nmi_handler_setup = mips_nmi_setup;
118 board_ejtag_handler_setup = mips_ejtag_setup; 118 board_ejtag_handler_setup = mips_ejtag_setup;
119 119
120 pr_info("\nLINUX started...\n"); 120 if (prom_argc == 1)
121 prom_init_cmdline(); 121 strlcat(arcs_cmdline, prom_argv, COMMAND_LINE_SIZE);
122
122 configure_platform(); 123 configure_platform();
123 prom_meminit(); 124 prom_meminit();
124 125
diff --git a/arch/mips/powertv/init.h b/arch/mips/powertv/init.h
index 7af6bf25008..b194c34ca96 100644
--- a/arch/mips/powertv/init.h
+++ b/arch/mips/powertv/init.h
@@ -22,7 +22,5 @@
22 22
23#ifndef _POWERTV_INIT_H 23#ifndef _POWERTV_INIT_H
24#define _POWERTV_INIT_H 24#define _POWERTV_INIT_H
25extern int prom_argc;
26extern int *_prom_argv;
27extern unsigned long _prom_memsize; 25extern unsigned long _prom_memsize;
28#endif 26#endif
diff --git a/arch/mips/powertv/memory.c b/arch/mips/powertv/memory.c
index 28d06605fff..f49eb3d0358 100644
--- a/arch/mips/powertv/memory.c
+++ b/arch/mips/powertv/memory.c
@@ -42,8 +42,6 @@
42#define BOOT_MEM_SIZE KIBIBYTE(256) /* Memory reserved for bldr */ 42#define BOOT_MEM_SIZE KIBIBYTE(256) /* Memory reserved for bldr */
43#define PHYS_MEM_START 0x10000000 /* Start of physical memory */ 43#define PHYS_MEM_START 0x10000000 /* Start of physical memory */
44 44
45unsigned long ptv_memsize;
46
47char __initdata cmdline[COMMAND_LINE_SIZE]; 45char __initdata cmdline[COMMAND_LINE_SIZE];
48 46
49void __init prom_meminit(void) 47void __init prom_meminit(void)
@@ -87,9 +85,6 @@ void __init prom_meminit(void)
87 } 85 }
88 } 86 }
89 87
90 /* Store memsize for diagnostic purposes */
91 ptv_memsize = memsize;
92
93 physend = PFN_ALIGN(&_end) - 0x80000000; 88 physend = PFN_ALIGN(&_end) - 0x80000000;
94 if (memsize > LOW_MEM_MAX) { 89 if (memsize > LOW_MEM_MAX) {
95 low_mem = LOW_MEM_MAX; 90 low_mem = LOW_MEM_MAX;
diff --git a/arch/mips/powertv/powertv_setup.c b/arch/mips/powertv/powertv_setup.c
index bd8ebf128f2..698b1eafbe9 100644
--- a/arch/mips/powertv/powertv_setup.c
+++ b/arch/mips/powertv/powertv_setup.c
@@ -64,9 +64,6 @@
64#define REG_SIZE "4" /* In bytes */ 64#define REG_SIZE "4" /* In bytes */
65#endif 65#endif
66 66
67static struct pt_regs die_regs;
68static bool have_die_regs;
69
70static void register_panic_notifier(void); 67static void register_panic_notifier(void);
71static int panic_handler(struct notifier_block *notifier_block, 68static int panic_handler(struct notifier_block *notifier_block,
72 unsigned long event, void *cause_string); 69 unsigned long event, void *cause_string);
@@ -218,24 +215,6 @@ static int panic_handler(struct notifier_block *notifier_block,
218 return NOTIFY_DONE; 215 return NOTIFY_DONE;
219} 216}
220 217
221/**
222 * Platform-specific handling of oops
223 * @str: Pointer to the oops string
224 * @regs: Pointer to the oops registers
225 * All we do here is to save the registers for subsequent printing through
226 * the panic notifier.
227 */
228void platform_die(const char *str, const struct pt_regs *regs)
229{
230 /* If we already have saved registers, don't overwrite them as they
231 * they apply to the initial fault */
232
233 if (!have_die_regs) {
234 have_die_regs = true;
235 die_regs = *regs;
236 }
237}
238
239/* Information about the RF MAC address, if one was supplied on the 218/* Information about the RF MAC address, if one was supplied on the
240 * command line. */ 219 * command line. */
241static bool have_rfmac; 220static bool have_rfmac;
diff --git a/arch/mips/powertv/reset.c b/arch/mips/powertv/reset.c
index 494c652c984..0007652cb77 100644
--- a/arch/mips/powertv/reset.c
+++ b/arch/mips/powertv/reset.c
@@ -28,9 +28,6 @@
28#include <asm/mach-powertv/asic_regs.h> 28#include <asm/mach-powertv/asic_regs.h>
29#include "reset.h" 29#include "reset.h"
30 30
31static void mips_machine_restart(char *command);
32static void mips_machine_halt(void);
33
34static void mips_machine_restart(char *command) 31static void mips_machine_restart(char *command)
35{ 32{
36#ifdef CONFIG_BOOTLOADER_DRIVER 33#ifdef CONFIG_BOOTLOADER_DRIVER
@@ -44,22 +41,7 @@ static void mips_machine_restart(char *command)
44#endif 41#endif
45} 42}
46 43
47static void mips_machine_halt(void)
48{
49#ifdef CONFIG_BOOTLOADER_DRIVER
50 /*
51 * Call the bootloader's reset function to ensure
52 * that persistent data is flushed before hard reset
53 */
54 kbldr_SetCauseAndReset();
55#else
56 writel(0x1, asic_reg_addr(watchdog));
57#endif
58}
59
60void mips_reboot_setup(void) 44void mips_reboot_setup(void)
61{ 45{
62 _machine_restart = mips_machine_restart; 46 _machine_restart = mips_machine_restart;
63 _machine_halt = mips_machine_halt;
64 pm_power_off = mips_machine_halt;
65} 47}
diff --git a/arch/mips/powertv/time.c b/arch/mips/powertv/time.c
index 1e0a5ef4c8c..9fd7b67f2af 100644
--- a/arch/mips/powertv/time.c
+++ b/arch/mips/powertv/time.c
@@ -33,5 +33,4 @@ unsigned int __cpuinit get_c0_compare_int(void)
33void __init plat_time_init(void) 33void __init plat_time_init(void)
34{ 34{
35 powertv_clocksource_init(); 35 powertv_clocksource_init();
36 r4k_clockevent_init();
37} 36}
diff --git a/arch/mips/txx9/generic/setup.c b/arch/mips/txx9/generic/setup.c
index 06e801c7e25..e27809b6d04 100644
--- a/arch/mips/txx9/generic/setup.c
+++ b/arch/mips/txx9/generic/setup.c
@@ -160,7 +160,6 @@ static void __init prom_init_cmdline(void)
160 int argc; 160 int argc;
161 int *argv32; 161 int *argv32;
162 int i; /* Always ignore the "-c" at argv[0] */ 162 int i; /* Always ignore the "-c" at argv[0] */
163 static char builtin[COMMAND_LINE_SIZE] __initdata;
164 163
165 if (fw_arg0 >= CKSEG0 || fw_arg1 < CKSEG0) { 164 if (fw_arg0 >= CKSEG0 || fw_arg1 < CKSEG0) {
166 /* 165 /*
@@ -174,20 +173,6 @@ static void __init prom_init_cmdline(void)
174 argv32 = (int *)fw_arg1; 173 argv32 = (int *)fw_arg1;
175 } 174 }
176 175
177 /* ignore all built-in args if any f/w args given */
178 /*
179 * But if built-in strings was started with '+', append them
180 * to command line args. If built-in was started with '-',
181 * ignore all f/w args.
182 */
183 builtin[0] = '\0';
184 if (arcs_cmdline[0] == '+')
185 strcpy(builtin, arcs_cmdline + 1);
186 else if (arcs_cmdline[0] == '-') {
187 strcpy(builtin, arcs_cmdline + 1);
188 argc = 0;
189 } else if (argc <= 1)
190 strcpy(builtin, arcs_cmdline);
191 arcs_cmdline[0] = '\0'; 176 arcs_cmdline[0] = '\0';
192 177
193 for (i = 1; i < argc; i++) { 178 for (i = 1; i < argc; i++) {
@@ -201,12 +186,6 @@ static void __init prom_init_cmdline(void)
201 } else 186 } else
202 strcat(arcs_cmdline, str); 187 strcat(arcs_cmdline, str);
203 } 188 }
204 /* append saved builtin args */
205 if (builtin[0]) {
206 if (arcs_cmdline[0])
207 strcat(arcs_cmdline, " ");
208 strcat(arcs_cmdline, builtin);
209 }
210} 189}
211 190
212static int txx9_ic_disable __initdata; 191static int txx9_ic_disable __initdata;
diff --git a/arch/mips/vr41xx/common/init.c b/arch/mips/vr41xx/common/init.c
index 1386e6f081c..23916321cc1 100644
--- a/arch/mips/vr41xx/common/init.c
+++ b/arch/mips/vr41xx/common/init.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * init.c, Common initialization routines for NEC VR4100 series. 2 * init.c, Common initialization routines for NEC VR4100 series.
3 * 3 *
4 * Copyright (C) 2003-2008 Yoichi Yuasa <yuasa@linux-mips.org> 4 * Copyright (C) 2003-2009 Yoichi Yuasa <yuasa@linux-mips.org>
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify 6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by 7 * it under the terms of the GNU General Public License as published by
@@ -66,9 +66,9 @@ void __init prom_init(void)
66 argv = (char **)fw_arg1; 66 argv = (char **)fw_arg1;
67 67
68 for (i = 1; i < argc; i++) { 68 for (i = 1; i < argc; i++) {
69 strcat(arcs_cmdline, argv[i]); 69 strlcat(arcs_cmdline, argv[i], COMMAND_LINE_SIZE);
70 if (i < (argc - 1)) 70 if (i < (argc - 1))
71 strcat(arcs_cmdline, " "); 71 strlcat(arcs_cmdline, " ", COMMAND_LINE_SIZE);
72 } 72 }
73} 73}
74 74