Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0-or-later
0002 /*
0003  * Copyright (C) 2009 Lemote Inc.
0004  * Author: Wu Zhangjin, wuzhangjin@gmail.com
0005  */
0006 #include <asm/bootinfo.h>
0007 
0008 #include <loongson.h>
0009 
0010 void __init mach_prom_init_machtype(void)
0011 {
0012     /* We share the same kernel image file among Lemote 2F family
0013      * of machines, and provide the machtype= kernel command line
0014      * to users to indicate their machine, this command line will
0015      * be passed by the latest PMON automatically. and fortunately,
0016      * up to now, we can get the machine type from the PMON_VER=
0017      * commandline directly except the NAS machine, In the old
0018      * machines, this will help the users a lot.
0019      *
0020      * If no "machtype=" passed, get machine type from "PMON_VER=".
0021      *  PMON_VER=LM8089     Lemote 8.9'' netbook
0022      *       LM8101     Lemote 10.1'' netbook
0023      *  (The above two netbooks have the same kernel support)
0024      *       LM6XXX     Lemote FuLoong(2F) box series
0025      *       LM9XXX     Lemote LynLoong PC series
0026      */
0027     if (strstr(arcs_cmdline, "PMON_VER=LM")) {
0028         if (strstr(arcs_cmdline, "PMON_VER=LM8"))
0029             mips_machtype = MACH_LEMOTE_YL2F89;
0030         else if (strstr(arcs_cmdline, "PMON_VER=LM6"))
0031             mips_machtype = MACH_LEMOTE_FL2F;
0032         else if (strstr(arcs_cmdline, "PMON_VER=LM9"))
0033             mips_machtype = MACH_LEMOTE_LL2F;
0034         else
0035             mips_machtype = MACH_LEMOTE_NAS;
0036 
0037         strcat(arcs_cmdline, " machtype=");
0038         strcat(arcs_cmdline, get_system_type());
0039         strcat(arcs_cmdline, " ");
0040     }
0041 }