/*1* This file is subject to the terms and conditions of the GNU General Public2* License. See the file COPYING in the main directory of this archive3* for more details.4*5* Copyright (C) 1995, 1996, 2003 by Ralf Baechle6* Copyright (C) 1995, 1996 Andreas Busse7* Copyright (C) 1995, 1996 Stoned Elipot8* Copyright (C) 1995, 1996 Paul M. Antoine.9* Copyright (C) 2009 Zhang Le10*/11#ifndef _ASM_BOOTINFO_H12#define _ASM_BOOTINFO_H1314#include <linux/types.h>15#include <asm/setup.h>1617/*18* The MACH_ IDs are sort of equivalent to PCI product IDs. As such the19* numbers do not necessarily reflect technical relations or similarities20* between systems.21*/2223/*24* Valid machtype values for group unknown25*/26#define MACH_UNKNOWN 0 /* whatever... */2728/*29* Valid machtype for group DEC30*/31#define MACH_DSUNKNOWN 032#define MACH_DS23100 1 /* DECstation 2100 or 3100 */33#define MACH_DS5100 2 /* DECsystem 5100 */34#define MACH_DS5000_200 3 /* DECstation 5000/200 */35#define MACH_DS5000_1XX 4 /* DECstation 5000/120, 125, 133, 150 */36#define MACH_DS5000_XX 5 /* DECstation 5000/20, 25, 33, 50 */37#define MACH_DS5000_2X0 6 /* DECstation 5000/240, 260 */38#define MACH_DS5400 7 /* DECsystem 5400 */39#define MACH_DS5500 8 /* DECsystem 5500 */40#define MACH_DS5800 9 /* DECsystem 5800 */41#define MACH_DS5900 10 /* DECsystem 5900 */4243/*44* Valid machtype for group Mikrotik45*/46#define MACH_MIKROTIK_RB532 0 /* Mikrotik RouterBoard 532 */47#define MACH_MIKROTIK_RB532A 1 /* Mikrotik RouterBoard 532A */4849/*50* Valid machtype for Loongson family51*/52enum loongson2ef_machine_type {53MACH_LOONGSON_UNKNOWN,54MACH_LEMOTE_FL2E,55MACH_LEMOTE_FL2F,56MACH_LEMOTE_ML2F7,57MACH_LEMOTE_YL2F89,58MACH_DEXXON_GDIUM2F10,59MACH_LEMOTE_NAS,60MACH_LEMOTE_LL2F,61MACH_LOONGSON_END62};6364/*65* Valid machtype for group INGENIC66*/67enum ingenic_machine_type {68MACH_INGENIC_UNKNOWN,69MACH_INGENIC_JZ4720,70MACH_INGENIC_JZ4725,71MACH_INGENIC_JZ4725B,72MACH_INGENIC_JZ4730,73MACH_INGENIC_JZ4740,74MACH_INGENIC_JZ4750,75MACH_INGENIC_JZ4755,76MACH_INGENIC_JZ4760,77MACH_INGENIC_JZ4760B,78MACH_INGENIC_JZ4770,79MACH_INGENIC_JZ4775,80MACH_INGENIC_JZ4780,81MACH_INGENIC_X1000,82MACH_INGENIC_X1000E,83MACH_INGENIC_X1830,84MACH_INGENIC_X2000,85MACH_INGENIC_X2000E,86MACH_INGENIC_X2000H,87MACH_INGENIC_X2100,88};8990extern char *system_type;91const char *get_system_type(void);9293extern unsigned long mips_machtype;9495extern void detect_memory_region(phys_addr_t start, phys_addr_t sz_min, phys_addr_t sz_max);9697extern void prom_init(void);98extern void prom_free_prom_memory(void);99extern void prom_cleanup(void);100101extern void free_init_pages(const char *what,102unsigned long begin, unsigned long end);103104extern void (*free_init_pages_eva)(void *begin, void *end);105106/*107* Initial kernel command line, usually setup by prom_init()108*/109extern char arcs_cmdline[COMMAND_LINE_SIZE];110111/*112* Registers a0, a1, a2 and a3 as passed to the kernel entry by firmware113*/114extern unsigned long fw_arg0, fw_arg1, fw_arg2, fw_arg3;115116#ifdef CONFIG_USE_OF117#include <linux/libfdt.h>118#include <linux/of_fdt.h>119120extern char __appended_dtb[];121122static inline void *get_fdt(void)123{124if (IS_ENABLED(CONFIG_MIPS_RAW_APPENDED_DTB) ||125IS_ENABLED(CONFIG_MIPS_ELF_APPENDED_DTB))126if (fdt_magic(&__appended_dtb) == FDT_MAGIC)127return &__appended_dtb;128129if (fw_arg0 == -2) /* UHI interface */130return (void *)fw_arg1;131132if (IS_ENABLED(CONFIG_BUILTIN_DTB))133if (&__dtb_start != &__dtb_end)134return &__dtb_start;135136return NULL;137}138#endif139140/*141* Platform memory detection hook called by arch_mem_init()142*/143extern void plat_mem_setup(void);144145#ifdef CONFIG_SWIOTLB146/*147* Optional platform hook to call swiotlb_setup().148*/149extern void plat_swiotlb_setup(void);150151#else152153static inline void plat_swiotlb_setup(void) {}154155#endif /* CONFIG_SWIOTLB */156157#ifdef CONFIG_USE_OF158/**159* plat_get_fdt() - Return a pointer to the platform's device tree blob160*161* This function provides a platform independent API to get a pointer to the162* flattened device tree blob. The interface between bootloader and kernel163* is not consistent across platforms so it is necessary to provide this164* API such that common startup code can locate the FDT.165*166* This is used by the KASLR code to get command line arguments and random167* seed from the device tree. Any platform wishing to use KASLR should168* provide this API and select SYS_SUPPORTS_RELOCATABLE.169*170* Return: Pointer to the flattened device tree blob.171*/172extern void *plat_get_fdt(void);173174#ifdef CONFIG_RELOCATABLE175176/**177* plat_fdt_relocated() - Update platform's information about relocated dtb178*179* This function provides a platform-independent API to set platform's180* information about relocated DTB if it needs to be moved due to kernel181* relocation occurring at boot.182*/183void plat_fdt_relocated(void *new_location);184185#endif /* CONFIG_RELOCATABLE */186#endif /* CONFIG_USE_OF */187188#endif /* _ASM_BOOTINFO_H */189190191