18c2ecf20Sopenharmony_ci/*
28c2ecf20Sopenharmony_ci * This file is subject to the terms and conditions of the GNU General Public
38c2ecf20Sopenharmony_ci * License.  See the file COPYING in the main directory of this archive
48c2ecf20Sopenharmony_ci * for more details.
58c2ecf20Sopenharmony_ci *
68c2ecf20Sopenharmony_ci * Copyright (C) 1995, 1996, 2003 by Ralf Baechle
78c2ecf20Sopenharmony_ci * Copyright (C) 1995, 1996 Andreas Busse
88c2ecf20Sopenharmony_ci * Copyright (C) 1995, 1996 Stoned Elipot
98c2ecf20Sopenharmony_ci * Copyright (C) 1995, 1996 Paul M. Antoine.
108c2ecf20Sopenharmony_ci * Copyright (C) 2009       Zhang Le
118c2ecf20Sopenharmony_ci */
128c2ecf20Sopenharmony_ci#ifndef _ASM_BOOTINFO_H
138c2ecf20Sopenharmony_ci#define _ASM_BOOTINFO_H
148c2ecf20Sopenharmony_ci
158c2ecf20Sopenharmony_ci#include <linux/types.h>
168c2ecf20Sopenharmony_ci#include <asm/setup.h>
178c2ecf20Sopenharmony_ci
188c2ecf20Sopenharmony_ci/*
198c2ecf20Sopenharmony_ci * The MACH_ IDs are sort of equivalent to PCI product IDs.  As such the
208c2ecf20Sopenharmony_ci * numbers do not necessarily reflect technical relations or similarities
218c2ecf20Sopenharmony_ci * between systems.
228c2ecf20Sopenharmony_ci */
238c2ecf20Sopenharmony_ci
248c2ecf20Sopenharmony_ci/*
258c2ecf20Sopenharmony_ci * Valid machtype values for group unknown
268c2ecf20Sopenharmony_ci */
278c2ecf20Sopenharmony_ci#define  MACH_UNKNOWN		0	/* whatever...			*/
288c2ecf20Sopenharmony_ci
298c2ecf20Sopenharmony_ci/*
308c2ecf20Sopenharmony_ci * Valid machtype for group DEC
318c2ecf20Sopenharmony_ci */
328c2ecf20Sopenharmony_ci#define  MACH_DSUNKNOWN		0
338c2ecf20Sopenharmony_ci#define  MACH_DS23100		1	/* DECstation 2100 or 3100	*/
348c2ecf20Sopenharmony_ci#define  MACH_DS5100		2	/* DECsystem 5100		*/
358c2ecf20Sopenharmony_ci#define  MACH_DS5000_200	3	/* DECstation 5000/200		*/
368c2ecf20Sopenharmony_ci#define  MACH_DS5000_1XX	4	/* DECstation 5000/120, 125, 133, 150 */
378c2ecf20Sopenharmony_ci#define  MACH_DS5000_XX		5	/* DECstation 5000/20, 25, 33, 50 */
388c2ecf20Sopenharmony_ci#define  MACH_DS5000_2X0	6	/* DECstation 5000/240, 260	*/
398c2ecf20Sopenharmony_ci#define  MACH_DS5400		7	/* DECsystem 5400		*/
408c2ecf20Sopenharmony_ci#define  MACH_DS5500		8	/* DECsystem 5500		*/
418c2ecf20Sopenharmony_ci#define  MACH_DS5800		9	/* DECsystem 5800		*/
428c2ecf20Sopenharmony_ci#define  MACH_DS5900		10	/* DECsystem 5900		*/
438c2ecf20Sopenharmony_ci
448c2ecf20Sopenharmony_ci/*
458c2ecf20Sopenharmony_ci * Valid machtype for group Mikrotik
468c2ecf20Sopenharmony_ci */
478c2ecf20Sopenharmony_ci#define MACH_MIKROTIK_RB532	0	/* Mikrotik RouterBoard 532	*/
488c2ecf20Sopenharmony_ci#define MACH_MIKROTIK_RB532A	1	/* Mikrotik RouterBoard 532A	*/
498c2ecf20Sopenharmony_ci
508c2ecf20Sopenharmony_ci/*
518c2ecf20Sopenharmony_ci * Valid machtype for Loongson family
528c2ecf20Sopenharmony_ci */
538c2ecf20Sopenharmony_cienum loongson2ef_machine_type {
548c2ecf20Sopenharmony_ci	MACH_LOONGSON_UNKNOWN,
558c2ecf20Sopenharmony_ci	MACH_LEMOTE_FL2E,
568c2ecf20Sopenharmony_ci	MACH_LEMOTE_FL2F,
578c2ecf20Sopenharmony_ci	MACH_LEMOTE_ML2F7,
588c2ecf20Sopenharmony_ci	MACH_LEMOTE_YL2F89,
598c2ecf20Sopenharmony_ci	MACH_DEXXON_GDIUM2F10,
608c2ecf20Sopenharmony_ci	MACH_LEMOTE_NAS,
618c2ecf20Sopenharmony_ci	MACH_LEMOTE_LL2F,
628c2ecf20Sopenharmony_ci	MACH_LOONGSON_END
638c2ecf20Sopenharmony_ci};
648c2ecf20Sopenharmony_ci
658c2ecf20Sopenharmony_ci/*
668c2ecf20Sopenharmony_ci * Valid machtype for group INGENIC
678c2ecf20Sopenharmony_ci */
688c2ecf20Sopenharmony_cienum ingenic_machine_type {
698c2ecf20Sopenharmony_ci	MACH_INGENIC_UNKNOWN,
708c2ecf20Sopenharmony_ci	MACH_INGENIC_JZ4720,
718c2ecf20Sopenharmony_ci	MACH_INGENIC_JZ4725,
728c2ecf20Sopenharmony_ci	MACH_INGENIC_JZ4725B,
738c2ecf20Sopenharmony_ci	MACH_INGENIC_JZ4730,
748c2ecf20Sopenharmony_ci	MACH_INGENIC_JZ4740,
758c2ecf20Sopenharmony_ci	MACH_INGENIC_JZ4750,
768c2ecf20Sopenharmony_ci	MACH_INGENIC_JZ4755,
778c2ecf20Sopenharmony_ci	MACH_INGENIC_JZ4760,
788c2ecf20Sopenharmony_ci	MACH_INGENIC_JZ4770,
798c2ecf20Sopenharmony_ci	MACH_INGENIC_JZ4775,
808c2ecf20Sopenharmony_ci	MACH_INGENIC_JZ4780,
818c2ecf20Sopenharmony_ci	MACH_INGENIC_X1000,
828c2ecf20Sopenharmony_ci	MACH_INGENIC_X1000E,
838c2ecf20Sopenharmony_ci	MACH_INGENIC_X1830,
848c2ecf20Sopenharmony_ci	MACH_INGENIC_X2000,
858c2ecf20Sopenharmony_ci	MACH_INGENIC_X2000E,
868c2ecf20Sopenharmony_ci};
878c2ecf20Sopenharmony_ci
888c2ecf20Sopenharmony_ciextern char *system_type;
898c2ecf20Sopenharmony_ciconst char *get_system_type(void);
908c2ecf20Sopenharmony_ci
918c2ecf20Sopenharmony_ciextern unsigned long mips_machtype;
928c2ecf20Sopenharmony_ci
938c2ecf20Sopenharmony_ciextern void detect_memory_region(phys_addr_t start, phys_addr_t sz_min,  phys_addr_t sz_max);
948c2ecf20Sopenharmony_ci
958c2ecf20Sopenharmony_ciextern void prom_init(void);
968c2ecf20Sopenharmony_ciextern void prom_free_prom_memory(void);
978c2ecf20Sopenharmony_ciextern void prom_cleanup(void);
988c2ecf20Sopenharmony_ci
998c2ecf20Sopenharmony_ciextern void free_init_pages(const char *what,
1008c2ecf20Sopenharmony_ci			    unsigned long begin, unsigned long end);
1018c2ecf20Sopenharmony_ci
1028c2ecf20Sopenharmony_ciextern void (*free_init_pages_eva)(void *begin, void *end);
1038c2ecf20Sopenharmony_ci
1048c2ecf20Sopenharmony_ci/*
1058c2ecf20Sopenharmony_ci * Initial kernel command line, usually setup by prom_init()
1068c2ecf20Sopenharmony_ci */
1078c2ecf20Sopenharmony_ciextern char arcs_cmdline[COMMAND_LINE_SIZE];
1088c2ecf20Sopenharmony_ci
1098c2ecf20Sopenharmony_ci/*
1108c2ecf20Sopenharmony_ci * Registers a0, a1, a3 and a4 as passed to the kernel entry by firmware
1118c2ecf20Sopenharmony_ci */
1128c2ecf20Sopenharmony_ciextern unsigned long fw_arg0, fw_arg1, fw_arg2, fw_arg3;
1138c2ecf20Sopenharmony_ci
1148c2ecf20Sopenharmony_ci#ifdef CONFIG_USE_OF
1158c2ecf20Sopenharmony_ciextern unsigned long fw_passed_dtb;
1168c2ecf20Sopenharmony_ci#endif
1178c2ecf20Sopenharmony_ci
1188c2ecf20Sopenharmony_ci/*
1198c2ecf20Sopenharmony_ci * Platform memory detection hook called by arch_mem_init()
1208c2ecf20Sopenharmony_ci */
1218c2ecf20Sopenharmony_ciextern void plat_mem_setup(void);
1228c2ecf20Sopenharmony_ci
1238c2ecf20Sopenharmony_ci#ifdef CONFIG_SWIOTLB
1248c2ecf20Sopenharmony_ci/*
1258c2ecf20Sopenharmony_ci * Optional platform hook to call swiotlb_setup().
1268c2ecf20Sopenharmony_ci */
1278c2ecf20Sopenharmony_ciextern void plat_swiotlb_setup(void);
1288c2ecf20Sopenharmony_ci
1298c2ecf20Sopenharmony_ci#else
1308c2ecf20Sopenharmony_ci
1318c2ecf20Sopenharmony_cistatic inline void plat_swiotlb_setup(void) {}
1328c2ecf20Sopenharmony_ci
1338c2ecf20Sopenharmony_ci#endif /* CONFIG_SWIOTLB */
1348c2ecf20Sopenharmony_ci
1358c2ecf20Sopenharmony_ci#ifdef CONFIG_USE_OF
1368c2ecf20Sopenharmony_ci/**
1378c2ecf20Sopenharmony_ci * plat_get_fdt() - Return a pointer to the platform's device tree blob
1388c2ecf20Sopenharmony_ci *
1398c2ecf20Sopenharmony_ci * This function provides a platform independent API to get a pointer to the
1408c2ecf20Sopenharmony_ci * flattened device tree blob. The interface between bootloader and kernel
1418c2ecf20Sopenharmony_ci * is not consistent across platforms so it is necessary to provide this
1428c2ecf20Sopenharmony_ci * API such that common startup code can locate the FDT.
1438c2ecf20Sopenharmony_ci *
1448c2ecf20Sopenharmony_ci * This is used by the KASLR code to get command line arguments and random
1458c2ecf20Sopenharmony_ci * seed from the device tree. Any platform wishing to use KASLR should
1468c2ecf20Sopenharmony_ci * provide this API and select SYS_SUPPORTS_RELOCATABLE.
1478c2ecf20Sopenharmony_ci *
1488c2ecf20Sopenharmony_ci * Return: Pointer to the flattened device tree blob.
1498c2ecf20Sopenharmony_ci */
1508c2ecf20Sopenharmony_ciextern void *plat_get_fdt(void);
1518c2ecf20Sopenharmony_ci
1528c2ecf20Sopenharmony_ci#ifdef CONFIG_RELOCATABLE
1538c2ecf20Sopenharmony_ci
1548c2ecf20Sopenharmony_ci/**
1558c2ecf20Sopenharmony_ci * plat_fdt_relocated() - Update platform's information about relocated dtb
1568c2ecf20Sopenharmony_ci *
1578c2ecf20Sopenharmony_ci * This function provides a platform-independent API to set platform's
1588c2ecf20Sopenharmony_ci * information about relocated DTB if it needs to be moved due to kernel
1598c2ecf20Sopenharmony_ci * relocation occurring at boot.
1608c2ecf20Sopenharmony_ci */
1618c2ecf20Sopenharmony_civoid plat_fdt_relocated(void *new_location);
1628c2ecf20Sopenharmony_ci
1638c2ecf20Sopenharmony_ci#endif /* CONFIG_RELOCATABLE */
1648c2ecf20Sopenharmony_ci#endif /* CONFIG_USE_OF */
1658c2ecf20Sopenharmony_ci
1668c2ecf20Sopenharmony_ci#endif /* _ASM_BOOTINFO_H */
167