xref: /OK3568_Linux_fs/kernel/arch/mips/loongson32/common/setup.c (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun // SPDX-License-Identifier: GPL-2.0-or-later
2*4882a593Smuzhiyun /*
3*4882a593Smuzhiyun  * Copyright (c) 2011 Zhang, Keguang <keguang.zhang@gmail.com>
4*4882a593Smuzhiyun  */
5*4882a593Smuzhiyun 
6*4882a593Smuzhiyun #include <linux/io.h>
7*4882a593Smuzhiyun #include <linux/init.h>
8*4882a593Smuzhiyun #include <linux/smp.h>
9*4882a593Smuzhiyun #include <asm/cpu-info.h>
10*4882a593Smuzhiyun #include <asm/bootinfo.h>
11*4882a593Smuzhiyun 
get_system_type(void)12*4882a593Smuzhiyun const char *get_system_type(void)
13*4882a593Smuzhiyun {
14*4882a593Smuzhiyun 	unsigned int processor_id = (&current_cpu_data)->processor_id;
15*4882a593Smuzhiyun 
16*4882a593Smuzhiyun 	switch (processor_id & PRID_REV_MASK) {
17*4882a593Smuzhiyun 	case PRID_REV_LOONGSON1B:
18*4882a593Smuzhiyun #if defined(CONFIG_LOONGSON1_LS1B)
19*4882a593Smuzhiyun 		return "LOONGSON LS1B";
20*4882a593Smuzhiyun #elif defined(CONFIG_LOONGSON1_LS1C)
21*4882a593Smuzhiyun 		return "LOONGSON LS1C";
22*4882a593Smuzhiyun #endif
23*4882a593Smuzhiyun 	default:
24*4882a593Smuzhiyun 		return "LOONGSON (unknown)";
25*4882a593Smuzhiyun 	}
26*4882a593Smuzhiyun }
27