1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * Copyright (C) 2012 Synopsys, Inc. (www.synopsys.com)
5 * based on METAG mach/arch.h (which in turn was based on ARM)
8 #ifndef _ASM_ARC_MACH_DESC_H_
9 #define _ASM_ARC_MACH_DESC_H_
12 * struct machine_desc - Board specific callbacks, called from ARC common code
13 * Provided by each ARC board using MACHINE_START()/MACHINE_END(), so
14 * a multi-platform kernel builds with array of such descriptors.
15 * We extend the early DT scan to also match the DT's "compatible" string
16 * against the @dt_compat of all such descriptors, and one with highest
17 * "DT score" is selected as global @machine_desc.
19 * @name: Board/SoC name
20 * @dt_compat: Array of device tree 'compatible' strings
21 * (XXX: although only 1st entry is looked at)
22 * @init_early: Very early callback [called from setup_arch()]
23 * @init_per_cpu: for each CPU as it is coming up (SMP as well as UP)
24 * [(M):init_IRQ(), (o):start_kernel_secondary()]
25 * @init_machine: arch initcall level callback (e.g. populate static
26 * platform devices or parse Devicetree)
27 * @init_late: Late initcall level callback
32 const char **dt_compat
;
33 void (*init_early
)(void);
34 void (*init_per_cpu
)(unsigned int);
35 void (*init_machine
)(void);
36 void (*init_late
)(void);
41 * Current machine - only accessible during boot.
43 extern const struct machine_desc
*machine_desc
;
46 * Machine type table - also only accessible during boot
48 extern const struct machine_desc __arch_info_begin
[], __arch_info_end
[];
51 * Set of macros to define architecture features.
52 * This is built into a table by the linker.
54 #define MACHINE_START(_type, _name) \
55 static const struct machine_desc __mach_desc_##_type \
56 __used __section(".arch.info.init") = { \
62 extern const struct machine_desc
*setup_machine_fdt(void *dt
);