aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/txx9/rbtx4927/prom.c
diff options
context:
space:
mode:
authorAtsushi Nemoto <anemo@mba.ocn.ne.jp>2008-07-11 10:27:54 -0400
committerRalf Baechle <ralf@linux-mips.org>2008-07-15 13:44:35 -0400
commitedcaf1a6a77315562e9781245cc8e028c9a921dc (patch)
treea20a0a85071fa283c36db87a41d1a7e091a35781 /arch/mips/txx9/rbtx4927/prom.c
parent766891565bdaf605ea4aebe3e75de77e848254d0 (diff)
[MIPS] TXx9: Make single kernel can support multiple boards
Make single kernel can be used on RBTX4927/37/38. Also make some SoC-specific code independent from board-specific code. Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp> Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/txx9/rbtx4927/prom.c')
-rw-r--r--arch/mips/txx9/rbtx4927/prom.c52
1 files changed, 3 insertions, 49 deletions
diff --git a/arch/mips/txx9/rbtx4927/prom.c b/arch/mips/txx9/rbtx4927/prom.c
index 0020bbee838b..942e627d2dc1 100644
--- a/arch/mips/txx9/rbtx4927/prom.c
+++ b/arch/mips/txx9/rbtx4927/prom.c
@@ -30,62 +30,16 @@
30 * 675 Mass Ave, Cambridge, MA 02139, USA. 30 * 675 Mass Ave, Cambridge, MA 02139, USA.
31 */ 31 */
32#include <linux/init.h> 32#include <linux/init.h>
33#include <linux/string.h>
34#include <asm/bootinfo.h> 33#include <asm/bootinfo.h>
35#include <asm/cpu.h> 34#include <asm/txx9/generic.h>
36#include <asm/mipsregs.h> 35#include <asm/txx9/rbtx4927.h>
37#include <asm/txx9/tx4927.h>
38 36
39void __init prom_init_cmdline(void) 37void __init rbtx4927_prom_init(void)
40{
41 int argc = (int) fw_arg0;
42 char **argv = (char **) fw_arg1;
43 int i; /* Always ignore the "-c" at argv[0] */
44
45 /* ignore all built-in args if any f/w args given */
46 if (argc > 1) {
47 *arcs_cmdline = '\0';
48 }
49
50 for (i = 1; i < argc; i++) {
51 if (i != 1) {
52 strcat(arcs_cmdline, " ");
53 }
54 strcat(arcs_cmdline, argv[i]);
55 }
56}
57
58void __init prom_init(void)
59{ 38{
60 extern int tx4927_get_mem_size(void); 39 extern int tx4927_get_mem_size(void);
61 extern char* toshiba_name;
62 int msize; 40 int msize;
63 41
64 prom_init_cmdline(); 42 prom_init_cmdline();
65
66 if ((read_c0_prid() & 0xff) == PRID_REV_TX4927) {
67 mips_machtype = MACH_TOSHIBA_RBTX4927;
68 toshiba_name = "TX4927";
69 } else {
70 mips_machtype = MACH_TOSHIBA_RBTX4937;
71 toshiba_name = "TX4937";
72 }
73
74 msize = tx4927_get_mem_size(); 43 msize = tx4927_get_mem_size();
75 add_memory_region(0, msize << 20, BOOT_MEM_RAM); 44 add_memory_region(0, msize << 20, BOOT_MEM_RAM);
76} 45}
77
78void __init prom_free_prom_memory(void)
79{
80}
81
82const char *get_system_type(void)
83{
84 return "Toshiba RBTX4927/RBTX4937";
85}
86
87char * __init prom_getcmdline(void)
88{
89 return &(arcs_cmdline[0]);
90}
91