/* SPDX-License-Identifier: GPL-2.0-only */1/*2* Copyright (C) 2012 Synopsys, Inc. (www.synopsys.com)3*4* based on METAG mach/arch.h (which in turn was based on ARM)5*/67#ifndef _ASM_ARC_MACH_DESC_H_8#define _ASM_ARC_MACH_DESC_H_910/**11* struct machine_desc - Board specific callbacks, called from ARC common code12* Provided by each ARC board using MACHINE_START()/MACHINE_END(), so13* a multi-platform kernel builds with array of such descriptors.14* We extend the early DT scan to also match the DT's "compatible" string15* against the @dt_compat of all such descriptors, and one with highest16* "DT score" is selected as global @machine_desc.17*18* @name: Board/SoC name19* @dt_compat: Array of device tree 'compatible' strings20* (XXX: although only 1st entry is looked at)21* @init_early: Very early callback [called from setup_arch()]22* @init_per_cpu: for each CPU as it is coming up (SMP as well as UP)23* [(M):init_IRQ(), (o):start_kernel_secondary()]24* @init_machine: arch initcall level callback (e.g. populate static25* platform devices or parse Devicetree)26* @init_late: Late initcall level callback27*28*/29struct machine_desc {30const char *name;31const char **dt_compat;32void (*init_early)(void);33void (*init_per_cpu)(unsigned int);34void (*init_machine)(void);35void (*init_late)(void);3637};3839/*40* Current machine - only accessible during boot.41*/42extern const struct machine_desc *machine_desc;4344/*45* Machine type table - also only accessible during boot46*/47extern const struct machine_desc __arch_info_begin[], __arch_info_end[];4849/*50* Set of macros to define architecture features.51* This is built into a table by the linker.52*/53#define MACHINE_START(_type, _name) \54static const struct machine_desc __mach_desc_##_type \55__used __section(".arch.info.init") = { \56.name = _name,5758#define MACHINE_END \59};6061extern const struct machine_desc *setup_machine_fdt(void *dt);6263#endif646566