aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/mips-boards/generic
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2006-07-13 19:57:04 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-07-13 19:57:04 -0400
commitab6cf0d0cb96417ef65cc2c2120c0e879edf7a4a (patch)
tree97e85188397967013783aba57907fd85bc63cbf2 /arch/mips/mips-boards/generic
parent0d10e47f9635ecafe5a9dc6e10cb056a87a4daa2 (diff)
parentf4dee85e2c6a7d7adf7ea4d6d3053a41c78175b7 (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: (53 commits) [MIPS] sparsemem: fix crash in show_mem [MIPS] vr41xx: Update workpad setup function [MIPS] vr41xx: Update e55 setup function [MIPS] vr41xx: Removed old v2.4 VRC4173 driver [MIPS] vr41xx: Move IRQ numbers to asm-mips/vr41xx/irq.h [MIPS] MIPSsim: Build fix, rename sim_timer_setup -> plat_timer_setup. [MIPS] Remove unused code. [MIPS] IP22 Fix brown paper bag in RTC code. [MIPS] Atlas, Malta, SEAD: Don't disable interrupts in mips_time_init(). [MIPS] Replace board_timer_setup function pointer by plat_timer_setup. [MIPS] Nuke redeclarations of board_time_init. [MIPS] Remove redeclarations of setup_irq(). [MIPS] Nuke redeclarations of board_timer_setup. [MIPS] Print out TLB handler assembly for debugging. [MIPS] SMTC: Reformat to Linux style. [MIPS] MIPSsim: Delete redeclaration of ll_local_timer_interrupt. [MIPS] IP27: Reformatting. [MIPS] IP27: Invoke setup_irq for timer interrupt so proc stats will be shown. [MIPS] IP27: irq_chip startup method returns unsigned int. [MIPS] IP27: struct irq_desc member handler was renamed to chip. ...
Diffstat (limited to 'arch/mips/mips-boards/generic')
-rw-r--r--arch/mips/mips-boards/generic/memory.c50
-rw-r--r--arch/mips/mips-boards/generic/time.c8
2 files changed, 28 insertions, 30 deletions
diff --git a/arch/mips/mips-boards/generic/memory.c b/arch/mips/mips-boards/generic/memory.c
index c89fcf9e9c22..be80c5dd4a0c 100644
--- a/arch/mips/mips-boards/generic/memory.c
+++ b/arch/mips/mips-boards/generic/memory.c
@@ -47,43 +47,45 @@ static char *mtypes[3] = {
47}; 47};
48#endif 48#endif
49 49
50/* determined physical memory size, not overridden by command line args */
51unsigned long physical_memsize = 0L;
52
50struct prom_pmemblock * __init prom_getmdesc(void) 53struct prom_pmemblock * __init prom_getmdesc(void)
51{ 54{
52 char *memsize_str; 55 char *memsize_str;
53 unsigned int memsize; 56 unsigned int memsize;
54 char cmdline[CL_SIZE], *ptr; 57 char cmdline[CL_SIZE], *ptr;
55 58
56 /* Check the command line first for a memsize directive */ 59 /* otherwise look in the environment */
57 strcpy(cmdline, arcs_cmdline); 60 memsize_str = prom_getenv("memsize");
58 ptr = strstr(cmdline, "memsize="); 61 if (!memsize_str) {
59 if (ptr && (ptr != cmdline) && (*(ptr - 1) != ' ')) 62 prom_printf("memsize not set in boot prom, set to default (32Mb)\n");
60 ptr = strstr(ptr, " memsize="); 63 physical_memsize = 0x02000000;
61 64 } else {
62 if (ptr) {
63 memsize = memparse(ptr + 8, &ptr);
64 }
65 else {
66 /* otherwise look in the environment */
67 memsize_str = prom_getenv("memsize");
68 if (!memsize_str) {
69 prom_printf("memsize not set in boot prom, set to default (32Mb)\n");
70 memsize = 0x02000000;
71 } else {
72#ifdef DEBUG 65#ifdef DEBUG
73 prom_printf("prom_memsize = %s\n", memsize_str); 66 prom_printf("prom_memsize = %s\n", memsize_str);
74#endif 67#endif
75 memsize = simple_strtol(memsize_str, NULL, 0); 68 physical_memsize = simple_strtol(memsize_str, NULL, 0);
76 }
77 } 69 }
78 70
79#ifdef CONFIG_CPU_BIG_ENDIAN 71#ifdef CONFIG_CPU_BIG_ENDIAN
80 /* 72 /* SOC-it swaps, or perhaps doesn't swap, when DMA'ing the last
81 * SOC-it swaps, or perhaps doesn't swap, when DMA'ing the last 73 word of physical memory */
82 * word of physical memory 74 physical_memsize -= PAGE_SIZE;
83 */
84 memsize -= PAGE_SIZE;
85#endif 75#endif
86 76
77 /* Check the command line for a memsize directive that overrides
78 the physical/default amount */
79 strcpy(cmdline, arcs_cmdline);
80 ptr = strstr(cmdline, "memsize=");
81 if (ptr && (ptr != cmdline) && (*(ptr - 1) != ' '))
82 ptr = strstr(ptr, " memsize=");
83
84 if (ptr)
85 memsize = memparse(ptr + 8, &ptr);
86 else
87 memsize = physical_memsize;
88
87 memset(mdesc, 0, sizeof(mdesc)); 89 memset(mdesc, 0, sizeof(mdesc));
88 90
89 mdesc[0].type = yamon_dontuse; 91 mdesc[0].type = yamon_dontuse;
diff --git a/arch/mips/mips-boards/generic/time.c b/arch/mips/mips-boards/generic/time.c
index 5e207760826b..557bf961f36a 100644
--- a/arch/mips/mips-boards/generic/time.c
+++ b/arch/mips/mips-boards/generic/time.c
@@ -228,9 +228,7 @@ unsigned long __init mips_rtc_get_time(void)
228 228
229void __init mips_time_init(void) 229void __init mips_time_init(void)
230{ 230{
231 unsigned int est_freq, flags; 231 unsigned int est_freq;
232
233 local_irq_save(flags);
234 232
235 /* Set Data mode - binary. */ 233 /* Set Data mode - binary. */
236 CMOS_WRITE(CMOS_READ(RTC_CONTROL) | RTC_DM_BINARY, RTC_CONTROL); 234 CMOS_WRITE(CMOS_READ(RTC_CONTROL) | RTC_DM_BINARY, RTC_CONTROL);
@@ -241,11 +239,9 @@ void __init mips_time_init(void)
241 (est_freq%1000000)*100/1000000); 239 (est_freq%1000000)*100/1000000);
242 240
243 cpu_khz = est_freq / 1000; 241 cpu_khz = est_freq / 1000;
244
245 local_irq_restore(flags);
246} 242}
247 243
248void __init mips_timer_setup(struct irqaction *irq) 244void __init plat_timer_setup(struct irqaction *irq)
249{ 245{
250 if (cpu_has_veic) { 246 if (cpu_has_veic) {
251 set_vi_handler (MSC01E_INT_CPUCTR, mips_timer_dispatch); 247 set_vi_handler (MSC01E_INT_CPUCTR, mips_timer_dispatch);