blob: 4efecb70c24ea8b768175603ca2b0fa2d27e9ba6 [file] [log] [blame]
Thomas Gleixnerd2912cb2019-06-04 10:11:33 +02001/* SPDX-License-Identifier: GPL-2.0-only */
Gabor Juhos487d70d2010-11-23 16:06:25 +01002/*
3 * Copyright (C) 2008-2010 Gabor Juhos <juhosg@openwrt.org>
Gabor Juhos487d70d2010-11-23 16:06:25 +01004 */
5
6#ifndef __ASM_MIPS_MACHINE_H
7#define __ASM_MIPS_MACHINE_H
8
9#include <linux/init.h>
10#include <linux/stddef.h>
11
12#include <asm/bootinfo.h>
13
14struct mips_machine {
15 unsigned long mach_type;
16 const char *mach_id;
17 const char *mach_name;
18 void (*mach_setup)(void);
19};
20
21#define MIPS_MACHINE(_type, _id, _name, _setup) \
22static const char machine_name_##_type[] __initconst \
23 __aligned(1) = _name; \
24static const char machine_id_##_type[] __initconst \
25 __aligned(1) = _id; \
26static struct mips_machine machine_##_type \
27 __used __section(.mips.machines.init) = \
28{ \
29 .mach_type = _type, \
30 .mach_id = machine_id_##_type, \
31 .mach_name = machine_name_##_type, \
32 .mach_setup = _setup, \
33};
34
35extern long __mips_machines_start;
36extern long __mips_machines_end;
37
38#ifdef CONFIG_MIPS_MACHINE
39int mips_machtype_setup(char *id) __init;
40void mips_machine_setup(void) __init;
Gabor Juhos487d70d2010-11-23 16:06:25 +010041#else
42static inline int mips_machtype_setup(char *id) { return 1; }
43static inline void mips_machine_setup(void) { }
Gabor Juhos487d70d2010-11-23 16:06:25 +010044#endif /* CONFIG_MIPS_MACHINE */
45
46#endif /* __ASM_MIPS_MACHINE_H */