18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-only */
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci *  arch/arm/include/asm/mach/arch.h
48c2ecf20Sopenharmony_ci *
58c2ecf20Sopenharmony_ci *  Copyright (C) 2000 Russell King
68c2ecf20Sopenharmony_ci */
78c2ecf20Sopenharmony_ci
88c2ecf20Sopenharmony_ci#include <linux/types.h>
98c2ecf20Sopenharmony_ci
108c2ecf20Sopenharmony_ci#ifndef __ASSEMBLY__
118c2ecf20Sopenharmony_ci#include <linux/reboot.h>
128c2ecf20Sopenharmony_ci
138c2ecf20Sopenharmony_cistruct tag;
148c2ecf20Sopenharmony_cistruct pt_regs;
158c2ecf20Sopenharmony_cistruct smp_operations;
168c2ecf20Sopenharmony_ci#ifdef CONFIG_SMP
178c2ecf20Sopenharmony_ci#define smp_ops(ops) (&(ops))
188c2ecf20Sopenharmony_ci#define smp_init_ops(ops) (&(ops))
198c2ecf20Sopenharmony_ci#else
208c2ecf20Sopenharmony_ci#define smp_ops(ops) (struct smp_operations *)NULL
218c2ecf20Sopenharmony_ci#define smp_init_ops(ops) (bool (*)(void))NULL
228c2ecf20Sopenharmony_ci#endif
238c2ecf20Sopenharmony_ci
248c2ecf20Sopenharmony_cistruct machine_desc {
258c2ecf20Sopenharmony_ci	unsigned int		nr;		/* architecture number	*/
268c2ecf20Sopenharmony_ci	const char		*name;		/* architecture name	*/
278c2ecf20Sopenharmony_ci	unsigned long		atag_offset;	/* tagged list (relative) */
288c2ecf20Sopenharmony_ci	const char *const 	*dt_compat;	/* array of device tree
298c2ecf20Sopenharmony_ci						 * 'compatible' strings	*/
308c2ecf20Sopenharmony_ci
318c2ecf20Sopenharmony_ci	unsigned int		nr_irqs;	/* number of IRQs */
328c2ecf20Sopenharmony_ci
338c2ecf20Sopenharmony_ci#ifdef CONFIG_ZONE_DMA
348c2ecf20Sopenharmony_ci	phys_addr_t		dma_zone_size;	/* size of DMA-able area */
358c2ecf20Sopenharmony_ci#endif
368c2ecf20Sopenharmony_ci
378c2ecf20Sopenharmony_ci	unsigned int		video_start;	/* start of video RAM	*/
388c2ecf20Sopenharmony_ci	unsigned int		video_end;	/* end of video RAM	*/
398c2ecf20Sopenharmony_ci
408c2ecf20Sopenharmony_ci	unsigned char		reserve_lp0 :1;	/* never has lp0	*/
418c2ecf20Sopenharmony_ci	unsigned char		reserve_lp1 :1;	/* never has lp1	*/
428c2ecf20Sopenharmony_ci	unsigned char		reserve_lp2 :1;	/* never has lp2	*/
438c2ecf20Sopenharmony_ci	enum reboot_mode	reboot_mode;	/* default restart mode	*/
448c2ecf20Sopenharmony_ci	unsigned		l2c_aux_val;	/* L2 cache aux value	*/
458c2ecf20Sopenharmony_ci	unsigned		l2c_aux_mask;	/* L2 cache aux mask	*/
468c2ecf20Sopenharmony_ci	void			(*l2c_write_sec)(unsigned long, unsigned);
478c2ecf20Sopenharmony_ci	const struct smp_operations	*smp;	/* SMP operations	*/
488c2ecf20Sopenharmony_ci	bool			(*smp_init)(void);
498c2ecf20Sopenharmony_ci	void			(*fixup)(struct tag *, char **);
508c2ecf20Sopenharmony_ci	void			(*dt_fixup)(void);
518c2ecf20Sopenharmony_ci	long long		(*pv_fixup)(void);
528c2ecf20Sopenharmony_ci	void			(*reserve)(void);/* reserve mem blocks	*/
538c2ecf20Sopenharmony_ci	void			(*map_io)(void);/* IO mapping function	*/
548c2ecf20Sopenharmony_ci	void			(*init_early)(void);
558c2ecf20Sopenharmony_ci	void			(*init_irq)(void);
568c2ecf20Sopenharmony_ci	void			(*init_time)(void);
578c2ecf20Sopenharmony_ci	void			(*init_machine)(void);
588c2ecf20Sopenharmony_ci	void			(*init_late)(void);
598c2ecf20Sopenharmony_ci#ifdef CONFIG_GENERIC_IRQ_MULTI_HANDLER
608c2ecf20Sopenharmony_ci	void			(*handle_irq)(struct pt_regs *);
618c2ecf20Sopenharmony_ci#endif
628c2ecf20Sopenharmony_ci	void			(*restart)(enum reboot_mode, const char *);
638c2ecf20Sopenharmony_ci};
648c2ecf20Sopenharmony_ci
658c2ecf20Sopenharmony_ci/*
668c2ecf20Sopenharmony_ci * Current machine - only accessible during boot.
678c2ecf20Sopenharmony_ci */
688c2ecf20Sopenharmony_ciextern const struct machine_desc *machine_desc;
698c2ecf20Sopenharmony_ci
708c2ecf20Sopenharmony_ci/*
718c2ecf20Sopenharmony_ci * Machine type table - also only accessible during boot
728c2ecf20Sopenharmony_ci */
738c2ecf20Sopenharmony_ciextern const struct machine_desc __arch_info_begin[], __arch_info_end[];
748c2ecf20Sopenharmony_ci#define for_each_machine_desc(p)			\
758c2ecf20Sopenharmony_ci	for (p = __arch_info_begin; p < __arch_info_end; p++)
768c2ecf20Sopenharmony_ci
778c2ecf20Sopenharmony_ci/*
788c2ecf20Sopenharmony_ci * Set of macros to define architecture features.  This is built into
798c2ecf20Sopenharmony_ci * a table by the linker.
808c2ecf20Sopenharmony_ci */
818c2ecf20Sopenharmony_ci#define MACHINE_START(_type,_name)			\
828c2ecf20Sopenharmony_cistatic const struct machine_desc __mach_desc_##_type	\
838c2ecf20Sopenharmony_ci __used							\
848c2ecf20Sopenharmony_ci __section(".arch.info.init") = {			\
858c2ecf20Sopenharmony_ci	.nr		= MACH_TYPE_##_type,		\
868c2ecf20Sopenharmony_ci	.name		= _name,
878c2ecf20Sopenharmony_ci
888c2ecf20Sopenharmony_ci#define MACHINE_END				\
898c2ecf20Sopenharmony_ci};
908c2ecf20Sopenharmony_ci
918c2ecf20Sopenharmony_ci#define DT_MACHINE_START(_name, _namestr)		\
928c2ecf20Sopenharmony_cistatic const struct machine_desc __mach_desc_##_name	\
938c2ecf20Sopenharmony_ci __used							\
948c2ecf20Sopenharmony_ci __section(".arch.info.init") = {			\
958c2ecf20Sopenharmony_ci	.nr		= ~0,				\
968c2ecf20Sopenharmony_ci	.name		= _namestr,
978c2ecf20Sopenharmony_ci
988c2ecf20Sopenharmony_ci#endif
99