Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 182065
b: refs/heads/master
c: eb11df4
h: refs/heads/master
i:
  182063: 2bc59f9
v: v3
  • Loading branch information
Wu Zhangjin authored and Ralf Baechle committed Feb 27, 2010
1 parent a8a4531 commit e88f19a
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 97e6a89634befaf5bd66d3044d36961c887cd98c
refs/heads/master: eb11df472d8491fcb28534b59017e1b5465997fa
2 changes: 1 addition & 1 deletion trunk/arch/mips/include/asm/mach-loongson/loongson.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ extern void mach_prepare_reboot(void);
extern void mach_prepare_shutdown(void);

/* environment arguments from bootloader */
extern unsigned long bus_clock, cpu_clock_freq;
extern unsigned long cpu_clock_freq;
extern unsigned long memsize, highmemsize;

/* loongson-specific command line, env and memory initialization */
Expand Down
25 changes: 21 additions & 4 deletions trunk/arch/mips/loongson/common/env.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,10 @@

#include <loongson.h>

unsigned long bus_clock, cpu_clock_freq;
unsigned long cpu_clock_freq;
EXPORT_SYMBOL(cpu_clock_freq);
unsigned long memsize, highmemsize;

/* pmon passes arguments in 32bit pointers */
int *_prom_envp;

#define parse_even_earlier(res, option, p) \
do { \
if (strncmp(option, (char *)p, strlen(option)) == 0) \
Expand All @@ -39,6 +36,10 @@ do { \

void __init prom_init_env(void)
{
/* pmon passes arguments in 32bit pointers */
int *_prom_envp;
unsigned long bus_clock;
unsigned int processor_id;
long l;

/* firmware arguments are initialized in head.S */
Expand All @@ -55,6 +56,22 @@ void __init prom_init_env(void)
}
if (memsize == 0)
memsize = 256;
if (bus_clock == 0)
bus_clock = 66000000;
if (cpu_clock_freq == 0) {
processor_id = (&current_cpu_data)->processor_id;
switch (processor_id & PRID_REV_MASK) {
case PRID_REV_LOONGSON2E:
cpu_clock_freq = 533080000;
break;
case PRID_REV_LOONGSON2F:
cpu_clock_freq = 797000000;
break;
default:
cpu_clock_freq = 100000000;
break;
}
}

pr_info("busclock=%ld, cpuclock=%ld, memsize=%ld, highmemsize=%ld\n",
bus_clock, cpu_clock_freq, memsize, highmemsize);
Expand Down

0 comments on commit e88f19a

Please sign in to comment.