diff options
author | Steven J. Hill <Steven.Hill@imgtec.com> | 2013-03-25 16:05:40 -0400 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2013-05-08 06:30:10 -0400 |
commit | 49bffbdc88fdd8f5eac40306a617252625a0fa35 (patch) | |
tree | cc08116bbf4f742f0f8f2d4381182c13586bc187 | |
parent | 270690e00cdb034cd945ab597c24e6aff0227f77 (diff) |
MIPS: FW: malta: Code formatting clean-ups.
Clean-up code according to the 'checkpatch.pl' script.
Signed-off-by: Steven J. Hill <Steven.Hill@imgtec.com>
-rw-r--r-- | arch/mips/mti-malta/malta-display.c | 37 | ||||
-rw-r--r-- | arch/mips/mti-malta/malta-init.c | 58 | ||||
-rw-r--r-- | arch/mips/mti-malta/malta-memory.c | 42 | ||||
-rw-r--r-- | arch/mips/mti-malta/malta-setup.c | 15 |
4 files changed, 64 insertions, 88 deletions
diff --git a/arch/mips/mti-malta/malta-display.c b/arch/mips/mti-malta/malta-display.c index ee623339abab..d4f807191ecd 100644 --- a/arch/mips/mti-malta/malta-display.c +++ b/arch/mips/mti-malta/malta-display.c | |||
@@ -1,26 +1,19 @@ | |||
1 | /* | 1 | /* |
2 | * Carsten Langgaard, carstenl@mips.com | 2 | * This file is subject to the terms and conditions of the GNU General Public |
3 | * Copyright (C) 1999,2000 MIPS Technologies, Inc. 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 | * | ||
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 | * | 5 | * |
18 | * Display routines for display messages in MIPS boards ascii display. | 6 | * Display routines for display messages in MIPS boards ascii display. |
7 | * | ||
8 | * Copyright (C) 1999,2000,2012 MIPS Technologies, Inc. | ||
9 | * All rights reserved. | ||
10 | * Authors: Carsten Langgaard <carstenl@mips.com> | ||
11 | * Steven J. Hill <sjhill@mips.com> | ||
19 | */ | 12 | */ |
20 | |||
21 | #include <linux/compiler.h> | 13 | #include <linux/compiler.h> |
22 | #include <linux/timer.h> | 14 | #include <linux/timer.h> |
23 | #include <asm/io.h> | 15 | #include <linux/io.h> |
16 | |||
24 | #include <asm/mips-boards/generic.h> | 17 | #include <asm/mips-boards/generic.h> |
25 | 18 | ||
26 | extern const char display_string[]; | 19 | extern const char display_string[]; |
@@ -35,11 +28,11 @@ void mips_display_message(const char *str) | |||
35 | if (unlikely(display == NULL)) | 28 | if (unlikely(display == NULL)) |
36 | display = ioremap(ASCII_DISPLAY_POS_BASE, 16*sizeof(int)); | 29 | display = ioremap(ASCII_DISPLAY_POS_BASE, 16*sizeof(int)); |
37 | 30 | ||
38 | for (i = 0; i <= 14; i=i+2) { | 31 | for (i = 0; i <= 14; i += 2) { |
39 | if (*str) | 32 | if (*str) |
40 | __raw_writel(*str++, display + i); | 33 | __raw_writel(*str++, display + i); |
41 | else | 34 | else |
42 | __raw_writel(' ', display + i); | 35 | __raw_writel(' ', display + i); |
43 | } | 36 | } |
44 | } | 37 | } |
45 | 38 | ||
diff --git a/arch/mips/mti-malta/malta-init.c b/arch/mips/mti-malta/malta-init.c index 71d753a6c97d..ff8caffd3266 100644 --- a/arch/mips/mti-malta/malta-init.c +++ b/arch/mips/mti-malta/malta-init.c | |||
@@ -1,43 +1,28 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 1999, 2000, 2004, 2005 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 | * Authors: Carsten Langgaard <carstenl@mips.com> | 4 | * for more details. |
5 | * Maciej W. Rozycki <macro@mips.com> | ||
6 | * | ||
7 | * This program is free software; you can distribute it and/or modify it | ||
8 | * under the terms of the GNU General Public License (Version 2) as | ||
9 | * published by the Free Software Foundation. | ||
10 | * | ||
11 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
14 | * for more details. | ||
15 | * | ||
16 | * You should have received a copy of the GNU General Public License along | ||
17 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
18 | * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. | ||
19 | * | 5 | * |
20 | * PROM library initialisation code. | 6 | * PROM library initialisation code. |
7 | * | ||
8 | * Copyright (C) 1999,2000,2004,2005,2012 MIPS Technologies, Inc. | ||
9 | * All rights reserved. | ||
10 | * Authors: Carsten Langgaard <carstenl@mips.com> | ||
11 | * Maciej W. Rozycki <macro@mips.com> | ||
12 | * Steven J. Hill <sjhill@mips.com> | ||
21 | */ | 13 | */ |
22 | #include <linux/init.h> | 14 | #include <linux/init.h> |
23 | #include <linux/string.h> | 15 | #include <linux/string.h> |
24 | #include <linux/kernel.h> | 16 | #include <linux/kernel.h> |
25 | 17 | ||
26 | #include <asm/gt64120.h> | ||
27 | #include <asm/io.h> | ||
28 | #include <asm/cacheflush.h> | 18 | #include <asm/cacheflush.h> |
29 | #include <asm/smp-ops.h> | 19 | #include <asm/smp-ops.h> |
30 | #include <asm/traps.h> | 20 | #include <asm/traps.h> |
31 | #include <asm/fw/fw.h> | 21 | #include <asm/fw/fw.h> |
32 | #include <asm/gcmpregs.h> | 22 | #include <asm/gcmpregs.h> |
33 | #include <asm/mips-boards/generic.h> | 23 | #include <asm/mips-boards/generic.h> |
34 | #include <asm/mips-boards/bonito64.h> | ||
35 | #include <asm/mips-boards/msc01_pci.h> | ||
36 | |||
37 | #include <asm/mips-boards/malta.h> | 24 | #include <asm/mips-boards/malta.h> |
38 | 25 | ||
39 | int init_debug; | ||
40 | |||
41 | static int mips_revision_corid; | 26 | static int mips_revision_corid; |
42 | int mips_revision_sconid; | 27 | int mips_revision_sconid; |
43 | 28 | ||
@@ -64,12 +49,18 @@ static void __init console_config(void) | |||
64 | if (s) { | 49 | if (s) { |
65 | while (*s >= '0' && *s <= '9') | 50 | while (*s >= '0' && *s <= '9') |
66 | baud = baud*10 + *s++ - '0'; | 51 | baud = baud*10 + *s++ - '0'; |
67 | if (*s == ',') s++; | 52 | if (*s == ',') |
68 | if (*s) parity = *s++; | 53 | s++; |
69 | if (*s == ',') s++; | 54 | if (*s) |
70 | if (*s) bits = *s++; | 55 | parity = *s++; |
71 | if (*s == ',') s++; | 56 | if (*s == ',') |
72 | if (*s == 'h') flow = 'r'; | 57 | s++; |
58 | if (*s) | ||
59 | bits = *s++; | ||
60 | if (*s == ',') | ||
61 | s++; | ||
62 | if (*s == 'h') | ||
63 | flow = 'r'; | ||
73 | } | 64 | } |
74 | if (baud == 0) | 65 | if (baud == 0) |
75 | baud = 38400; | 66 | baud = 38400; |
@@ -79,7 +70,8 @@ static void __init console_config(void) | |||
79 | bits = '8'; | 70 | bits = '8'; |
80 | if (flow == '\0') | 71 | if (flow == '\0') |
81 | flow = 'r'; | 72 | flow = 'r'; |
82 | sprintf(console_string, " console=ttyS0,%d%c%c%c", baud, parity, bits, flow); | 73 | sprintf(console_string, " console=ttyS0,%d%c%c%c", baud, |
74 | parity, bits, flow); | ||
83 | strcat(fw_getcmdline(), console_string); | 75 | strcat(fw_getcmdline(), console_string); |
84 | pr_info("Config serial console:%s\n", console_string); | 76 | pr_info("Config serial console:%s\n", console_string); |
85 | } | 77 | } |
@@ -223,7 +215,7 @@ void __init prom_init(void) | |||
223 | case MIPS_REVISION_SCON_SOCIT: | 215 | case MIPS_REVISION_SCON_SOCIT: |
224 | case MIPS_REVISION_SCON_ROCIT: | 216 | case MIPS_REVISION_SCON_ROCIT: |
225 | _pcictrl_msc = (unsigned long)ioremap(MIPS_MSC01_PCI_REG_BASE, 0x2000); | 217 | _pcictrl_msc = (unsigned long)ioremap(MIPS_MSC01_PCI_REG_BASE, 0x2000); |
226 | mips_pci_controller: | 218 | mips_pci_controller: |
227 | mb(); | 219 | mb(); |
228 | MSC_READ(MSC01_PCI_CFG, data); | 220 | MSC_READ(MSC01_PCI_CFG, data); |
229 | MSC_WRITE(MSC01_PCI_CFG, data & ~MSC01_PCI_CFG_EN_BIT); | 221 | MSC_WRITE(MSC01_PCI_CFG, data & ~MSC01_PCI_CFG_EN_BIT); |
@@ -265,7 +257,7 @@ void __init prom_init(void) | |||
265 | default: | 257 | default: |
266 | /* Unknown system controller */ | 258 | /* Unknown system controller */ |
267 | mips_display_message("SC Error"); | 259 | mips_display_message("SC Error"); |
268 | while (1); /* We die here... */ | 260 | while (1); /* We die here... */ |
269 | } | 261 | } |
270 | board_nmi_handler_setup = mips_nmi_setup; | 262 | board_nmi_handler_setup = mips_nmi_setup; |
271 | board_ejtag_handler_setup = mips_ejtag_setup; | 263 | board_ejtag_handler_setup = mips_ejtag_setup; |
diff --git a/arch/mips/mti-malta/malta-memory.c b/arch/mips/mti-malta/malta-memory.c index 902ba718a717..1f73d63e92a7 100644 --- a/arch/mips/mti-malta/malta-memory.c +++ b/arch/mips/mti-malta/malta-memory.c | |||
@@ -1,31 +1,21 @@ | |||
1 | /* | 1 | /* |
2 | * Carsten Langgaard, carstenl@mips.com | 2 | * This file is subject to the terms and conditions of the GNU General Public |
3 | * Copyright (C) 1999,2000 MIPS Technologies, Inc. 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 | * | ||
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 | * | 5 | * |
18 | * PROM library functions for acquiring/using memory descriptors given to | 6 | * PROM library functions for acquiring/using memory descriptors given to |
19 | * us from the YAMON. | 7 | * us from the YAMON. |
8 | * | ||
9 | * Copyright (C) 1999,2000,2012 MIPS Technologies, Inc. | ||
10 | * All rights reserved. | ||
11 | * Authors: Carsten Langgaard <carstenl@mips.com> | ||
12 | * Steven J. Hill <sjhill@mips.com> | ||
20 | */ | 13 | */ |
21 | #include <linux/init.h> | 14 | #include <linux/init.h> |
22 | #include <linux/mm.h> | ||
23 | #include <linux/bootmem.h> | 15 | #include <linux/bootmem.h> |
24 | #include <linux/pfn.h> | ||
25 | #include <linux/string.h> | 16 | #include <linux/string.h> |
26 | 17 | ||
27 | #include <asm/bootinfo.h> | 18 | #include <asm/bootinfo.h> |
28 | #include <asm/page.h> | ||
29 | #include <asm/sections.h> | 19 | #include <asm/sections.h> |
30 | #include <asm/fw/fw.h> | 20 | #include <asm/fw/fw.h> |
31 | 21 | ||
@@ -36,19 +26,20 @@ unsigned long physical_memsize = 0L; | |||
36 | 26 | ||
37 | fw_memblock_t * __init fw_getmdesc(void) | 27 | fw_memblock_t * __init fw_getmdesc(void) |
38 | { | 28 | { |
39 | char *memsize_str; | 29 | char *memsize_str, *ptr; |
40 | unsigned int memsize; | 30 | unsigned int memsize; |
41 | char *ptr; | ||
42 | static char cmdline[COMMAND_LINE_SIZE] __initdata; | 31 | static char cmdline[COMMAND_LINE_SIZE] __initdata; |
32 | long val; | ||
33 | int tmp; | ||
43 | 34 | ||
44 | /* otherwise look in the environment */ | 35 | /* otherwise look in the environment */ |
45 | memsize_str = fw_getenv("memsize"); | 36 | memsize_str = fw_getenv("memsize"); |
46 | if (!memsize_str) { | 37 | if (!memsize_str) { |
47 | printk(KERN_WARNING | 38 | pr_warn("memsize not set in YAMON, set to default (32Mb)\n"); |
48 | "memsize not set in boot prom, set to default (32Mb)\n"); | ||
49 | physical_memsize = 0x02000000; | 39 | physical_memsize = 0x02000000; |
50 | } else { | 40 | } else { |
51 | physical_memsize = simple_strtol(memsize_str, NULL, 0); | 41 | tmp = kstrtol(memsize_str, 0, &val); |
42 | physical_memsize = (unsigned long)val; | ||
52 | } | 43 | } |
53 | 44 | ||
54 | #ifdef CONFIG_CPU_BIG_ENDIAN | 45 | #ifdef CONFIG_CPU_BIG_ENDIAN |
@@ -92,7 +83,8 @@ fw_memblock_t * __init fw_getmdesc(void) | |||
92 | 83 | ||
93 | mdesc[3].type = fw_dontuse; | 84 | mdesc[3].type = fw_dontuse; |
94 | mdesc[3].base = 0x00100000; | 85 | mdesc[3].base = 0x00100000; |
95 | mdesc[3].size = CPHYSADDR(PFN_ALIGN((unsigned long)&_end)) - mdesc[3].base; | 86 | mdesc[3].size = CPHYSADDR(PFN_ALIGN((unsigned long)&_end)) - |
87 | mdesc[3].base; | ||
96 | 88 | ||
97 | mdesc[4].type = fw_free; | 89 | mdesc[4].type = fw_free; |
98 | mdesc[4].base = CPHYSADDR(PFN_ALIGN(&_end)); | 90 | mdesc[4].base = CPHYSADDR(PFN_ALIGN(&_end)); |
@@ -142,7 +134,7 @@ void __init prom_free_prom_memory(void) | |||
142 | continue; | 134 | continue; |
143 | 135 | ||
144 | addr = boot_mem_map.map[i].addr; | 136 | addr = boot_mem_map.map[i].addr; |
145 | free_init_pages("prom memory", | 137 | free_init_pages("YAMON memory", |
146 | addr, addr + boot_mem_map.map[i].size); | 138 | addr, addr + boot_mem_map.map[i].size); |
147 | } | 139 | } |
148 | } | 140 | } |
diff --git a/arch/mips/mti-malta/malta-setup.c b/arch/mips/mti-malta/malta-setup.c index 9e3937602571..c72a06936781 100644 --- a/arch/mips/mti-malta/malta-setup.c +++ b/arch/mips/mti-malta/malta-setup.c | |||
@@ -178,13 +178,12 @@ static void __init pci_clock_check(void) | |||
178 | char *argptr = fw_getcmdline(); | 178 | char *argptr = fw_getcmdline(); |
179 | 179 | ||
180 | if (pciclock != 33 && !strstr(argptr, "idebus=")) { | 180 | if (pciclock != 33 && !strstr(argptr, "idebus=")) { |
181 | printk(KERN_WARNING "WARNING: PCI clock is %dMHz, " | 181 | pr_warn("WARNING: PCI clock is %dMHz, setting idebus\n", |
182 | "setting idebus\n", pciclock); | 182 | pciclock); |
183 | argptr += strlen(argptr); | 183 | argptr += strlen(argptr); |
184 | sprintf(argptr, " idebus=%d", pciclock); | 184 | sprintf(argptr, " idebus=%d", pciclock); |
185 | if (pciclock < 20 || pciclock > 66) | 185 | if (pciclock < 20 || pciclock > 66) |
186 | printk(KERN_WARNING "WARNING: IDE timing " | 186 | pr_warn("WARNING: IDE timing calculations will be incorrect\n"); |
187 | "calculations will be incorrect\n"); | ||
188 | } | 187 | } |
189 | } | 188 | } |
190 | #endif | 189 | #endif |
@@ -216,14 +215,14 @@ static void __init bonito_quirks_setup(void) | |||
216 | argptr = fw_getcmdline(); | 215 | argptr = fw_getcmdline(); |
217 | if (strstr(argptr, "debug")) { | 216 | if (strstr(argptr, "debug")) { |
218 | BONITO_BONGENCFG |= BONITO_BONGENCFG_DEBUGMODE; | 217 | BONITO_BONGENCFG |= BONITO_BONGENCFG_DEBUGMODE; |
219 | printk(KERN_INFO "Enabled Bonito debug mode\n"); | 218 | pr_info("Enabled Bonito debug mode\n"); |
220 | } else | 219 | } else |
221 | BONITO_BONGENCFG &= ~BONITO_BONGENCFG_DEBUGMODE; | 220 | BONITO_BONGENCFG &= ~BONITO_BONGENCFG_DEBUGMODE; |
222 | 221 | ||
223 | #ifdef CONFIG_DMA_COHERENT | 222 | #ifdef CONFIG_DMA_COHERENT |
224 | if (BONITO_PCICACHECTRL & BONITO_PCICACHECTRL_CPUCOH_PRES) { | 223 | if (BONITO_PCICACHECTRL & BONITO_PCICACHECTRL_CPUCOH_PRES) { |
225 | BONITO_PCICACHECTRL |= BONITO_PCICACHECTRL_CPUCOH_EN; | 224 | BONITO_PCICACHECTRL |= BONITO_PCICACHECTRL_CPUCOH_EN; |
226 | printk(KERN_INFO "Enabled Bonito CPU coherency\n"); | 225 | pr_info("Enabled Bonito CPU coherency\n"); |
227 | 226 | ||
228 | argptr = fw_getcmdline(); | 227 | argptr = fw_getcmdline(); |
229 | if (strstr(argptr, "iobcuncached")) { | 228 | if (strstr(argptr, "iobcuncached")) { |
@@ -231,13 +230,13 @@ static void __init bonito_quirks_setup(void) | |||
231 | BONITO_PCIMEMBASECFG = BONITO_PCIMEMBASECFG & | 230 | BONITO_PCIMEMBASECFG = BONITO_PCIMEMBASECFG & |
232 | ~(BONITO_PCIMEMBASECFG_MEMBASE0_CACHED | | 231 | ~(BONITO_PCIMEMBASECFG_MEMBASE0_CACHED | |
233 | BONITO_PCIMEMBASECFG_MEMBASE1_CACHED); | 232 | BONITO_PCIMEMBASECFG_MEMBASE1_CACHED); |
234 | printk(KERN_INFO "Disabled Bonito IOBC coherency\n"); | 233 | pr_info("Disabled Bonito IOBC coherency\n"); |
235 | } else { | 234 | } else { |
236 | BONITO_PCICACHECTRL |= BONITO_PCICACHECTRL_IOBCCOH_EN; | 235 | BONITO_PCICACHECTRL |= BONITO_PCICACHECTRL_IOBCCOH_EN; |
237 | BONITO_PCIMEMBASECFG |= | 236 | BONITO_PCIMEMBASECFG |= |
238 | (BONITO_PCIMEMBASECFG_MEMBASE0_CACHED | | 237 | (BONITO_PCIMEMBASECFG_MEMBASE0_CACHED | |
239 | BONITO_PCIMEMBASECFG_MEMBASE1_CACHED); | 238 | BONITO_PCIMEMBASECFG_MEMBASE1_CACHED); |
240 | printk(KERN_INFO "Enabled Bonito IOBC coherency\n"); | 239 | pr_info("Enabled Bonito IOBC coherency\n"); |
241 | } | 240 | } |
242 | } else | 241 | } else |
243 | panic("Hardware DMA cache coherency not supported"); | 242 | panic("Hardware DMA cache coherency not supported"); |