2 * arch/metag/include/asm/mach/arch.h
4 * Copyright (C) 2012 Imagination Technologies Ltd.
6 * based on the ARM version:
7 * Copyright (C) 2000 Russell King
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
14 #ifndef _METAG_MACH_ARCH_H_
15 #define _METAG_MACH_ARCH_H_
17 #include <linux/stddef.h>
19 #include <asm/clock.h>
22 * struct machine_desc - Describes a board controlled by a Meta.
23 * @name: Board/SoC name.
24 * @dt_compat: Array of device tree 'compatible' strings.
25 * @clocks: Clock callbacks.
27 * @nr_irqs: Maximum number of IRQs.
28 * If 0, defaults to NR_IRQS in asm-generic/irq.h.
30 * @init_early: Early init callback.
31 * @init_irq: IRQ init callback for setting up IRQ controllers.
32 * @init_machine: Arch init callback for setting up devices.
33 * @init_late: Late init callback.
35 * This structure is provided by each board which can be controlled by a Meta.
36 * It is chosen by matching the compatible strings in the device tree provided
37 * by the bootloader with the strings in @dt_compat, and sets up any aspects of
38 * the machine that aren't configured with device tree (yet).
42 const char **dt_compat;
43 struct meta_clock_desc *clocks;
47 void (*init_early)(void);
48 void (*init_irq)(void);
49 void (*init_machine)(void);
50 void (*init_late)(void);
54 * Current machine - only accessible during boot.
56 extern struct machine_desc *machine_desc;
59 * Machine type table - also only accessible during boot
61 extern struct machine_desc __arch_info_begin[], __arch_info_end[];
62 #define for_each_machine_desc(p) \
63 for (p = __arch_info_begin; p < __arch_info_end; p++)
65 static inline struct machine_desc *default_machine_desc(void)
67 /* the default machine is the last one linked in */
68 if (__arch_info_end - 1 < __arch_info_begin)
70 return __arch_info_end - 1;
74 * Set of macros to define architecture features. This is built into
75 * a table by the linker.
77 #define MACHINE_START(_type, _name) \
78 static const struct machine_desc __mach_desc_##_type \
80 __attribute__((__section__(".arch.info.init"))) = { \
86 #endif /* _METAG_MACH_ARCH_H_ */