1*4882a593Smuzhiyun /*
2*4882a593Smuzhiyun * This file is subject to the terms and conditions of the GNU General Public
3*4882a593Smuzhiyun * License. See the file COPYING in the main directory of this archive
4*4882a593Smuzhiyun * for more details.
5*4882a593Smuzhiyun *
6*4882a593Smuzhiyun * Copyright (C) 1995, 1996, 2003 by Ralf Baechle
7*4882a593Smuzhiyun * Copyright (C) 1995, 1996 Andreas Busse
8*4882a593Smuzhiyun * Copyright (C) 1995, 1996 Stoned Elipot
9*4882a593Smuzhiyun * Copyright (C) 1995, 1996 Paul M. Antoine.
10*4882a593Smuzhiyun * Copyright (C) 2009 Zhang Le
11*4882a593Smuzhiyun */
12*4882a593Smuzhiyun #ifndef _ASM_BOOTINFO_H
13*4882a593Smuzhiyun #define _ASM_BOOTINFO_H
14*4882a593Smuzhiyun
15*4882a593Smuzhiyun #include <linux/types.h>
16*4882a593Smuzhiyun #include <asm/setup.h>
17*4882a593Smuzhiyun
18*4882a593Smuzhiyun /*
19*4882a593Smuzhiyun * The MACH_ IDs are sort of equivalent to PCI product IDs. As such the
20*4882a593Smuzhiyun * numbers do not necessarily reflect technical relations or similarities
21*4882a593Smuzhiyun * between systems.
22*4882a593Smuzhiyun */
23*4882a593Smuzhiyun
24*4882a593Smuzhiyun /*
25*4882a593Smuzhiyun * Valid machtype values for group unknown
26*4882a593Smuzhiyun */
27*4882a593Smuzhiyun #define MACH_UNKNOWN 0 /* whatever... */
28*4882a593Smuzhiyun
29*4882a593Smuzhiyun /*
30*4882a593Smuzhiyun * Valid machtype for group DEC
31*4882a593Smuzhiyun */
32*4882a593Smuzhiyun #define MACH_DSUNKNOWN 0
33*4882a593Smuzhiyun #define MACH_DS23100 1 /* DECstation 2100 or 3100 */
34*4882a593Smuzhiyun #define MACH_DS5100 2 /* DECsystem 5100 */
35*4882a593Smuzhiyun #define MACH_DS5000_200 3 /* DECstation 5000/200 */
36*4882a593Smuzhiyun #define MACH_DS5000_1XX 4 /* DECstation 5000/120, 125, 133, 150 */
37*4882a593Smuzhiyun #define MACH_DS5000_XX 5 /* DECstation 5000/20, 25, 33, 50 */
38*4882a593Smuzhiyun #define MACH_DS5000_2X0 6 /* DECstation 5000/240, 260 */
39*4882a593Smuzhiyun #define MACH_DS5400 7 /* DECsystem 5400 */
40*4882a593Smuzhiyun #define MACH_DS5500 8 /* DECsystem 5500 */
41*4882a593Smuzhiyun #define MACH_DS5800 9 /* DECsystem 5800 */
42*4882a593Smuzhiyun #define MACH_DS5900 10 /* DECsystem 5900 */
43*4882a593Smuzhiyun
44*4882a593Smuzhiyun /*
45*4882a593Smuzhiyun * Valid machtype for group Mikrotik
46*4882a593Smuzhiyun */
47*4882a593Smuzhiyun #define MACH_MIKROTIK_RB532 0 /* Mikrotik RouterBoard 532 */
48*4882a593Smuzhiyun #define MACH_MIKROTIK_RB532A 1 /* Mikrotik RouterBoard 532A */
49*4882a593Smuzhiyun
50*4882a593Smuzhiyun /*
51*4882a593Smuzhiyun * Valid machtype for Loongson family
52*4882a593Smuzhiyun */
53*4882a593Smuzhiyun enum loongson2ef_machine_type {
54*4882a593Smuzhiyun MACH_LOONGSON_UNKNOWN,
55*4882a593Smuzhiyun MACH_LEMOTE_FL2E,
56*4882a593Smuzhiyun MACH_LEMOTE_FL2F,
57*4882a593Smuzhiyun MACH_LEMOTE_ML2F7,
58*4882a593Smuzhiyun MACH_LEMOTE_YL2F89,
59*4882a593Smuzhiyun MACH_DEXXON_GDIUM2F10,
60*4882a593Smuzhiyun MACH_LEMOTE_NAS,
61*4882a593Smuzhiyun MACH_LEMOTE_LL2F,
62*4882a593Smuzhiyun MACH_LOONGSON_END
63*4882a593Smuzhiyun };
64*4882a593Smuzhiyun
65*4882a593Smuzhiyun /*
66*4882a593Smuzhiyun * Valid machtype for group INGENIC
67*4882a593Smuzhiyun */
68*4882a593Smuzhiyun enum ingenic_machine_type {
69*4882a593Smuzhiyun MACH_INGENIC_UNKNOWN,
70*4882a593Smuzhiyun MACH_INGENIC_JZ4720,
71*4882a593Smuzhiyun MACH_INGENIC_JZ4725,
72*4882a593Smuzhiyun MACH_INGENIC_JZ4725B,
73*4882a593Smuzhiyun MACH_INGENIC_JZ4730,
74*4882a593Smuzhiyun MACH_INGENIC_JZ4740,
75*4882a593Smuzhiyun MACH_INGENIC_JZ4750,
76*4882a593Smuzhiyun MACH_INGENIC_JZ4755,
77*4882a593Smuzhiyun MACH_INGENIC_JZ4760,
78*4882a593Smuzhiyun MACH_INGENIC_JZ4770,
79*4882a593Smuzhiyun MACH_INGENIC_JZ4775,
80*4882a593Smuzhiyun MACH_INGENIC_JZ4780,
81*4882a593Smuzhiyun MACH_INGENIC_X1000,
82*4882a593Smuzhiyun MACH_INGENIC_X1000E,
83*4882a593Smuzhiyun MACH_INGENIC_X1830,
84*4882a593Smuzhiyun MACH_INGENIC_X2000,
85*4882a593Smuzhiyun MACH_INGENIC_X2000E,
86*4882a593Smuzhiyun };
87*4882a593Smuzhiyun
88*4882a593Smuzhiyun extern char *system_type;
89*4882a593Smuzhiyun const char *get_system_type(void);
90*4882a593Smuzhiyun
91*4882a593Smuzhiyun extern unsigned long mips_machtype;
92*4882a593Smuzhiyun
93*4882a593Smuzhiyun extern void detect_memory_region(phys_addr_t start, phys_addr_t sz_min, phys_addr_t sz_max);
94*4882a593Smuzhiyun
95*4882a593Smuzhiyun extern void prom_init(void);
96*4882a593Smuzhiyun extern void prom_free_prom_memory(void);
97*4882a593Smuzhiyun extern void prom_cleanup(void);
98*4882a593Smuzhiyun
99*4882a593Smuzhiyun extern void free_init_pages(const char *what,
100*4882a593Smuzhiyun unsigned long begin, unsigned long end);
101*4882a593Smuzhiyun
102*4882a593Smuzhiyun extern void (*free_init_pages_eva)(void *begin, void *end);
103*4882a593Smuzhiyun
104*4882a593Smuzhiyun /*
105*4882a593Smuzhiyun * Initial kernel command line, usually setup by prom_init()
106*4882a593Smuzhiyun */
107*4882a593Smuzhiyun extern char arcs_cmdline[COMMAND_LINE_SIZE];
108*4882a593Smuzhiyun
109*4882a593Smuzhiyun /*
110*4882a593Smuzhiyun * Registers a0, a1, a3 and a4 as passed to the kernel entry by firmware
111*4882a593Smuzhiyun */
112*4882a593Smuzhiyun extern unsigned long fw_arg0, fw_arg1, fw_arg2, fw_arg3;
113*4882a593Smuzhiyun
114*4882a593Smuzhiyun #ifdef CONFIG_USE_OF
115*4882a593Smuzhiyun extern unsigned long fw_passed_dtb;
116*4882a593Smuzhiyun #endif
117*4882a593Smuzhiyun
118*4882a593Smuzhiyun /*
119*4882a593Smuzhiyun * Platform memory detection hook called by arch_mem_init()
120*4882a593Smuzhiyun */
121*4882a593Smuzhiyun extern void plat_mem_setup(void);
122*4882a593Smuzhiyun
123*4882a593Smuzhiyun #ifdef CONFIG_SWIOTLB
124*4882a593Smuzhiyun /*
125*4882a593Smuzhiyun * Optional platform hook to call swiotlb_setup().
126*4882a593Smuzhiyun */
127*4882a593Smuzhiyun extern void plat_swiotlb_setup(void);
128*4882a593Smuzhiyun
129*4882a593Smuzhiyun #else
130*4882a593Smuzhiyun
plat_swiotlb_setup(void)131*4882a593Smuzhiyun static inline void plat_swiotlb_setup(void) {}
132*4882a593Smuzhiyun
133*4882a593Smuzhiyun #endif /* CONFIG_SWIOTLB */
134*4882a593Smuzhiyun
135*4882a593Smuzhiyun #ifdef CONFIG_USE_OF
136*4882a593Smuzhiyun /**
137*4882a593Smuzhiyun * plat_get_fdt() - Return a pointer to the platform's device tree blob
138*4882a593Smuzhiyun *
139*4882a593Smuzhiyun * This function provides a platform independent API to get a pointer to the
140*4882a593Smuzhiyun * flattened device tree blob. The interface between bootloader and kernel
141*4882a593Smuzhiyun * is not consistent across platforms so it is necessary to provide this
142*4882a593Smuzhiyun * API such that common startup code can locate the FDT.
143*4882a593Smuzhiyun *
144*4882a593Smuzhiyun * This is used by the KASLR code to get command line arguments and random
145*4882a593Smuzhiyun * seed from the device tree. Any platform wishing to use KASLR should
146*4882a593Smuzhiyun * provide this API and select SYS_SUPPORTS_RELOCATABLE.
147*4882a593Smuzhiyun *
148*4882a593Smuzhiyun * Return: Pointer to the flattened device tree blob.
149*4882a593Smuzhiyun */
150*4882a593Smuzhiyun extern void *plat_get_fdt(void);
151*4882a593Smuzhiyun
152*4882a593Smuzhiyun #ifdef CONFIG_RELOCATABLE
153*4882a593Smuzhiyun
154*4882a593Smuzhiyun /**
155*4882a593Smuzhiyun * plat_fdt_relocated() - Update platform's information about relocated dtb
156*4882a593Smuzhiyun *
157*4882a593Smuzhiyun * This function provides a platform-independent API to set platform's
158*4882a593Smuzhiyun * information about relocated DTB if it needs to be moved due to kernel
159*4882a593Smuzhiyun * relocation occurring at boot.
160*4882a593Smuzhiyun */
161*4882a593Smuzhiyun void plat_fdt_relocated(void *new_location);
162*4882a593Smuzhiyun
163*4882a593Smuzhiyun #endif /* CONFIG_RELOCATABLE */
164*4882a593Smuzhiyun #endif /* CONFIG_USE_OF */
165*4882a593Smuzhiyun
166*4882a593Smuzhiyun #endif /* _ASM_BOOTINFO_H */
167