diff options
author | Wu Zhangjin <wuzhangjin@gmail.com> | 2009-07-02 11:26:08 -0400 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2009-09-17 14:07:47 -0400 |
commit | 8e4971175acc910eb4258df82a6bd8f2c4e4e5b5 (patch) | |
tree | 921d53308d0a8a8e9119ec6b262a01fe0ccd1fd5 /arch/mips/loongson/fuloong-2e/env.c | |
parent | 67b35e5d01aba7a83f2161b0c90acb08afa01e3e (diff) |
MIPS: Loongson: Change naming methods
To make source code of loongson sharable to the machines(such as gdium)
made by the other companies, we rename arch/mips/lemote to
arch/mips/loongson, asm/mach-lemote to asm/mach-loongson, and rename lm2e
to the name of the machine: fuloong-2e. accordingly, FULONG are renamed to
FULOONG2E to make it distinguishable to the future FULOONG2F. and also,
some other relative tuning is needed.
Signed-off-by: Wu Zhangjin <wuzhangjin@gmail.com>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/loongson/fuloong-2e/env.c')
-rw-r--r-- | arch/mips/loongson/fuloong-2e/env.c | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/arch/mips/loongson/fuloong-2e/env.c b/arch/mips/loongson/fuloong-2e/env.c new file mode 100644 index 000000000000..b9ef50385541 --- /dev/null +++ b/arch/mips/loongson/fuloong-2e/env.c | |||
@@ -0,0 +1,58 @@ | |||
1 | /* | ||
2 | * Based on Ocelot Linux port, which is | ||
3 | * Copyright 2001 MontaVista Software Inc. | ||
4 | * Author: jsun@mvista.com or jsun@junsun.net | ||
5 | * | ||
6 | * Copyright 2003 ICT CAS | ||
7 | * Author: Michael Guo <guoyi@ict.ac.cn> | ||
8 | * | ||
9 | * Copyright (C) 2007 Lemote Inc. & Insititute of Computing Technology | ||
10 | * Author: Fuxin Zhang, zhangfx@lemote.com | ||
11 | * | ||
12 | * Copyright (C) 2009 Lemote Inc. & Insititute of Computing Technology | ||
13 | * Author: Wu Zhangjin, wuzj@lemote.com | ||
14 | * | ||
15 | * This program is free software; you can redistribute it and/or modify it | ||
16 | * under the terms of the GNU General Public License as published by the | ||
17 | * Free Software Foundation; either version 2 of the License, or (at your | ||
18 | * option) any later version. | ||
19 | */ | ||
20 | #include <asm/bootinfo.h> | ||
21 | |||
22 | #include <loongson.h> | ||
23 | |||
24 | unsigned long bus_clock, cpu_clock_freq; | ||
25 | unsigned long memsize, highmemsize; | ||
26 | |||
27 | /* pmon passes arguments in 32bit pointers */ | ||
28 | int *_prom_envp; | ||
29 | |||
30 | #define parse_even_earlier(res, option, p) \ | ||
31 | do { \ | ||
32 | if (strncmp(option, (char *)p, strlen(option)) == 0) \ | ||
33 | strict_strtol((char *)p + strlen(option"="), \ | ||
34 | 10, &res); \ | ||
35 | } while (0) | ||
36 | |||
37 | void __init prom_init_env(void) | ||
38 | { | ||
39 | long l; | ||
40 | |||
41 | /* firmware arguments are initialized in head.S */ | ||
42 | _prom_envp = (int *)fw_arg2; | ||
43 | |||
44 | l = (long)*_prom_envp; | ||
45 | while (l != 0) { | ||
46 | parse_even_earlier(bus_clock, "busclock", l); | ||
47 | parse_even_earlier(cpu_clock_freq, "cpuclock", l); | ||
48 | parse_even_earlier(memsize, "memsize", l); | ||
49 | parse_even_earlier(highmemsize, "highmemsize", l); | ||
50 | _prom_envp++; | ||
51 | l = (long)*_prom_envp; | ||
52 | } | ||
53 | if (memsize == 0) | ||
54 | memsize = 256; | ||
55 | |||
56 | pr_info("busclock=%ld, cpuclock=%ld, memsize=%ld, highmemsize=%ld\n", | ||
57 | bus_clock, cpu_clock_freq, memsize, highmemsize); | ||
58 | } | ||