Linux Audio

Check our new training course

Loading...
v6.8
 1/* SPDX-License-Identifier: GPL-2.0-only */
 2/*
 3 * Copyright (C) 2012 Synopsys, Inc. (www.synopsys.com)
 4 *
 5 * based on METAG mach/arch.h (which in turn was based on ARM)
 
 
 
 
 6 */
 7
 8#ifndef _ASM_ARC_MACH_DESC_H_
 9#define _ASM_ARC_MACH_DESC_H_
10
11/**
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.
18 *
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
28 *
29 */
30struct machine_desc {
31	const char		*name;
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);
37
38};
39
40/*
41 * Current machine - only accessible during boot.
42 */
43extern const struct machine_desc *machine_desc;
44
45/*
46 * Machine type table - also only accessible during boot
47 */
48extern const struct machine_desc __arch_info_begin[], __arch_info_end[];
49
50/*
51 * Set of macros to define architecture features.
52 * This is built into a table by the linker.
53 */
54#define MACHINE_START(_type, _name)			\
55static const struct machine_desc __mach_desc_##_type	\
56__used __section(".arch.info.init") = {			\
 
57	.name		= _name,
58
59#define MACHINE_END				\
60};
61
62extern const struct machine_desc *setup_machine_fdt(void *dt);
63
64#endif
v3.15
 
 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 *
 6 * This program is free software; you can redistribute it and/or modify
 7 * it under the terms of the GNU General Public License version 2 as
 8 * published by the Free Software Foundation.
 9 */
10
11#ifndef _ASM_ARC_MACH_DESC_H_
12#define _ASM_ARC_MACH_DESC_H_
13
14/**
15 * struct machine_desc - Board specific callbacks, called from ARC common code
16 *	Provided by each ARC board using MACHINE_START()/MACHINE_END(), so
17 *	a multi-platform kernel builds with array of such descriptors.
18 *	We extend the early DT scan to also match the DT's "compatible" string
19 *	against the @dt_compat of all such descriptors, and one with highest
20 *	"DT score" is selected as global @machine_desc.
21 *
22 * @name:		Board/SoC name
23 * @dt_compat:		Array of device tree 'compatible' strings
24 * 			(XXX: although only 1st entry is looked at)
25 * @init_early:		Very early callback [called from setup_arch()]
26 * @init_irq:		setup external IRQ controllers [called from init_IRQ()]
27 * @init_smp:		for each CPU (e.g. setup IPI)
28 * 			[(M):init_IRQ(), (o):start_kernel_secondary()]
29 * @init_time:		platform specific clocksource/clockevent registration
30 * 			[called from time_init()]
31 * @init_machine:	arch initcall level callback (e.g. populate static
32 * 			platform devices or parse Devicetree)
33 * @init_late:		Late initcall level callback
34 *
35 */
36struct machine_desc {
37	const char		*name;
38	const char		**dt_compat;
39
40	void			(*init_early)(void);
41	void			(*init_irq)(void);
42#ifdef CONFIG_SMP
43	void			(*init_smp)(unsigned int);
44#endif
45	void			(*init_time)(void);
46	void			(*init_machine)(void);
47	void			(*init_late)(void);
48
49};
50
51/*
52 * Current machine - only accessible during boot.
53 */
54extern const struct machine_desc *machine_desc;
55
56/*
57 * Machine type table - also only accessible during boot
58 */
59extern const struct machine_desc __arch_info_begin[], __arch_info_end[];
60
61/*
62 * Set of macros to define architecture features.
63 * This is built into a table by the linker.
64 */
65#define MACHINE_START(_type, _name)			\
66static const struct machine_desc __mach_desc_##_type	\
67__used							\
68__attribute__((__section__(".arch.info.init"))) = {	\
69	.name		= _name,
70
71#define MACHINE_END				\
72};
73
74extern const struct machine_desc *setup_machine_fdt(void *dt);
75
76#endif