aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/loongson/lemote-2f
diff options
context:
space:
mode:
Diffstat (limited to 'arch/mips/loongson/lemote-2f')
-rw-r--r--arch/mips/loongson/lemote-2f/Makefile2
-rw-r--r--arch/mips/loongson/lemote-2f/machtype.c45
2 files changed, 46 insertions, 1 deletions
diff --git a/arch/mips/loongson/lemote-2f/Makefile b/arch/mips/loongson/lemote-2f/Makefile
index 4d84b27dc41b..8699a53f0477 100644
--- a/arch/mips/loongson/lemote-2f/Makefile
+++ b/arch/mips/loongson/lemote-2f/Makefile
@@ -2,7 +2,7 @@
2# Makefile for lemote loongson2f family machines 2# Makefile for lemote loongson2f family machines
3# 3#
4 4
5obj-y += irq.o reset.o ec_kb3310b.o 5obj-y += machtype.o irq.o reset.o ec_kb3310b.o
6 6
7# 7#
8# Suspend Support 8# Suspend Support
diff --git a/arch/mips/loongson/lemote-2f/machtype.c b/arch/mips/loongson/lemote-2f/machtype.c
new file mode 100644
index 000000000000..610f43173148
--- /dev/null
+++ b/arch/mips/loongson/lemote-2f/machtype.c
@@ -0,0 +1,45 @@
1/*
2 * Copyright (C) 2009 Lemote Inc.
3 * Author: Wu Zhangjin, wuzj@lemote.com
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the
7 * Free Software Foundation; either version 2 of the License, or (at your
8 * option) any later version.
9 */
10#include <asm/bootinfo.h>
11
12#include <loongson.h>
13
14void __init mach_prom_init_machtype(void)
15{
16 /* We share the same kernel image file among Lemote 2F family
17 * of machines, and provide the machtype= kernel command line
18 * to users to indicate their machine, this command line will
19 * be passed by the latest PMON automatically. and fortunately,
20 * up to now, we can get the machine type from the PMON_VER=
21 * commandline directly except the NAS machine, In the old
22 * machines, this will help the users a lot.
23 *
24 * If no "machtype=" passed, get machine type from "PMON_VER=".
25 * PMON_VER=LM8089 Lemote 8.9'' netbook
26 * LM8101 Lemote 10.1'' netbook
27 * (The above two netbooks have the same kernel support)
28 * LM6XXX Lemote FuLoong(2F) box series
29 * LM9XXX Lemote LynLoong PC series
30 */
31 if (strstr(arcs_cmdline, "PMON_VER=LM")) {
32 if (strstr(arcs_cmdline, "PMON_VER=LM8"))
33 mips_machtype = MACH_LEMOTE_YL2F89;
34 else if (strstr(arcs_cmdline, "PMON_VER=LM6"))
35 mips_machtype = MACH_LEMOTE_FL2F;
36 else if (strstr(arcs_cmdline, "PMON_VER=LM9"))
37 mips_machtype = MACH_LEMOTE_LL2F;
38 else
39 mips_machtype = MACH_LEMOTE_NAS;
40
41 strcat(arcs_cmdline, " machtype=");
42 strcat(arcs_cmdline, get_system_type());
43 strcat(arcs_cmdline, " ");
44 }
45}