4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License version 2 as published
6 * by the Free Software Foundation.
10 #include <linux/string.h>
11 #include <linux/slab.h>
13 #include <asm/mips_machine.h>
16 static struct mips_machine *mips_machine __initdata;
18 #define for_each_machine(mach) \
19 for ((mach) = (struct mips_machine *)&__mips_machines_start; \
21 (unsigned long)(mach) < (unsigned long)&__mips_machines_end; \
24 __init int mips_machtype_setup(char *id)
26 struct mips_machine *mach;
28 for_each_machine(mach) {
29 if (mach->mach_id == NULL)
32 if (strcmp(mach->mach_id, id) == 0) {
33 mips_machtype = mach->mach_type;
38 pr_err("MIPS: no machine found for id '%s', supported machines:\n", id);
39 pr_err("%-24s %s\n", "id", "name");
40 for_each_machine(mach)
41 pr_err("%-24s %s\n", mach->mach_id, mach->mach_name);
46 __setup("machtype=", mips_machtype_setup);
48 __init void mips_machine_setup(void)
50 struct mips_machine *mach;
52 for_each_machine(mach) {
53 if (mips_machtype == mach->mach_type) {
62 mips_set_machine_name(mips_machine->mach_name);
64 if (mips_machine->mach_setup)
65 mips_machine->mach_setup();