1384740dcSRalf Baechle /* 2384740dcSRalf Baechle * This file is subject to the terms and conditions of the GNU General Public 3384740dcSRalf Baechle * License. See the file COPYING in the main directory of this archive 4384740dcSRalf Baechle * for more details. 5384740dcSRalf Baechle * 6384740dcSRalf Baechle * Copyright (C) 1995, 1996, 2003 by Ralf Baechle 7384740dcSRalf Baechle * Copyright (C) 1995, 1996 Andreas Busse 8384740dcSRalf Baechle * Copyright (C) 1995, 1996 Stoned Elipot 9384740dcSRalf Baechle * Copyright (C) 1995, 1996 Paul M. Antoine. 103209e70eSWu Zhangjin * Copyright (C) 2009 Zhang Le 11384740dcSRalf Baechle */ 12384740dcSRalf Baechle #ifndef _ASM_BOOTINFO_H 13384740dcSRalf Baechle #define _ASM_BOOTINFO_H 14384740dcSRalf Baechle 15384740dcSRalf Baechle #include <linux/types.h> 16384740dcSRalf Baechle #include <asm/setup.h> 17384740dcSRalf Baechle 18384740dcSRalf Baechle /* 19384740dcSRalf Baechle * The MACH_ IDs are sort of equivalent to PCI product IDs. As such the 20384740dcSRalf Baechle * numbers do not necessarily reflect technical relations or similarities 21384740dcSRalf Baechle * between systems. 22384740dcSRalf Baechle */ 23384740dcSRalf Baechle 24384740dcSRalf Baechle /* 25384740dcSRalf Baechle * Valid machtype values for group unknown 26384740dcSRalf Baechle */ 27384740dcSRalf Baechle #define MACH_UNKNOWN 0 /* whatever... */ 28384740dcSRalf Baechle 29384740dcSRalf Baechle /* 30384740dcSRalf Baechle * Valid machtype for group DEC 31384740dcSRalf Baechle */ 32384740dcSRalf Baechle #define MACH_DSUNKNOWN 0 33384740dcSRalf Baechle #define MACH_DS23100 1 /* DECstation 2100 or 3100 */ 34384740dcSRalf Baechle #define MACH_DS5100 2 /* DECsystem 5100 */ 35384740dcSRalf Baechle #define MACH_DS5000_200 3 /* DECstation 5000/200 */ 36384740dcSRalf Baechle #define MACH_DS5000_1XX 4 /* DECstation 5000/120, 125, 133, 150 */ 37384740dcSRalf Baechle #define MACH_DS5000_XX 5 /* DECstation 5000/20, 25, 33, 50 */ 38384740dcSRalf Baechle #define MACH_DS5000_2X0 6 /* DECstation 5000/240, 260 */ 39384740dcSRalf Baechle #define MACH_DS5400 7 /* DECsystem 5400 */ 40384740dcSRalf Baechle #define MACH_DS5500 8 /* DECsystem 5500 */ 41384740dcSRalf Baechle #define MACH_DS5800 9 /* DECsystem 5800 */ 42384740dcSRalf Baechle #define MACH_DS5900 10 /* DECsystem 5900 */ 43384740dcSRalf Baechle 44384740dcSRalf Baechle /* 45384740dcSRalf Baechle * Valid machtype for group PMC-MSP 46384740dcSRalf Baechle */ 47384740dcSRalf Baechle #define MACH_MSP4200_EVAL 0 /* PMC-Sierra MSP4200 Evaluation */ 48384740dcSRalf Baechle #define MACH_MSP4200_GW 1 /* PMC-Sierra MSP4200 Gateway demo */ 49384740dcSRalf Baechle #define MACH_MSP4200_FPGA 2 /* PMC-Sierra MSP4200 Emulation */ 50384740dcSRalf Baechle #define MACH_MSP7120_EVAL 3 /* PMC-Sierra MSP7120 Evaluation */ 51384740dcSRalf Baechle #define MACH_MSP7120_GW 4 /* PMC-Sierra MSP7120 Residential GW */ 52384740dcSRalf Baechle #define MACH_MSP7120_FPGA 5 /* PMC-Sierra MSP7120 Emulation */ 53384740dcSRalf Baechle #define MACH_MSP_OTHER 255 /* PMC-Sierra unknown board type */ 54384740dcSRalf Baechle 55384740dcSRalf Baechle /* 56384740dcSRalf Baechle * Valid machtype for group Mikrotik 57384740dcSRalf Baechle */ 58384740dcSRalf Baechle #define MACH_MIKROTIK_RB532 0 /* Mikrotik RouterBoard 532 */ 59384740dcSRalf Baechle #define MACH_MIKROTIK_RB532A 1 /* Mikrotik RouterBoard 532A */ 60384740dcSRalf Baechle 613209e70eSWu Zhangjin /* 623209e70eSWu Zhangjin * Valid machtype for Loongson family 633209e70eSWu Zhangjin */ 64*5f6d693eSHuacai Chen enum loongson_machine_type { 65*5f6d693eSHuacai Chen MACH_LOONGSON_UNKNOWN, 66*5f6d693eSHuacai Chen MACH_LEMOTE_FL2E, 67*5f6d693eSHuacai Chen MACH_LEMOTE_FL2F, 68*5f6d693eSHuacai Chen MACH_LEMOTE_ML2F7, 69*5f6d693eSHuacai Chen MACH_LEMOTE_YL2F89, 70*5f6d693eSHuacai Chen MACH_DEXXON_GDIUM2F10, 71*5f6d693eSHuacai Chen MACH_LEMOTE_NAS, 72*5f6d693eSHuacai Chen MACH_LEMOTE_LL2F, 73*5f6d693eSHuacai Chen MACH_LEMOTE_A1004, 74*5f6d693eSHuacai Chen MACH_LEMOTE_A1101, 75*5f6d693eSHuacai Chen MACH_LEMOTE_A1201, 76*5f6d693eSHuacai Chen MACH_LEMOTE_A1205, 77*5f6d693eSHuacai Chen MACH_LOONGSON_END 78*5f6d693eSHuacai Chen }; 793209e70eSWu Zhangjin 8083ccf69dSLars-Peter Clausen /* 8183ccf69dSLars-Peter Clausen * Valid machtype for group INGENIC 8283ccf69dSLars-Peter Clausen */ 8383ccf69dSLars-Peter Clausen #define MACH_INGENIC_JZ4730 0 /* JZ4730 SOC */ 8483ccf69dSLars-Peter Clausen #define MACH_INGENIC_JZ4740 1 /* JZ4740 SOC */ 8583ccf69dSLars-Peter Clausen 86384740dcSRalf Baechle extern char *system_type; 87384740dcSRalf Baechle const char *get_system_type(void); 88384740dcSRalf Baechle 89384740dcSRalf Baechle extern unsigned long mips_machtype; 90384740dcSRalf Baechle 91384740dcSRalf Baechle #define BOOT_MEM_MAP_MAX 32 92384740dcSRalf Baechle #define BOOT_MEM_RAM 1 93384740dcSRalf Baechle #define BOOT_MEM_ROM_DATA 2 94384740dcSRalf Baechle #define BOOT_MEM_RESERVED 3 9543064c0cSDavid Daney #define BOOT_MEM_INIT_RAM 4 96384740dcSRalf Baechle 97384740dcSRalf Baechle /* 98384740dcSRalf Baechle * A memory map that's built upon what was determined 99384740dcSRalf Baechle * or specified on the command line. 100384740dcSRalf Baechle */ 101384740dcSRalf Baechle struct boot_mem_map { 102384740dcSRalf Baechle int nr_map; 103384740dcSRalf Baechle struct boot_mem_map_entry { 104384740dcSRalf Baechle phys_t addr; /* start of memory segment */ 105384740dcSRalf Baechle phys_t size; /* size of memory segment */ 106384740dcSRalf Baechle long type; /* type of memory segment */ 107384740dcSRalf Baechle } map[BOOT_MEM_MAP_MAX]; 108384740dcSRalf Baechle }; 109384740dcSRalf Baechle 110384740dcSRalf Baechle extern struct boot_mem_map boot_mem_map; 111384740dcSRalf Baechle 112384740dcSRalf Baechle extern void add_memory_region(phys_t start, phys_t size, long type); 1134d9f77d2SJohn Crispin extern void detect_memory_region(phys_t start, phys_t sz_min, phys_t sz_max); 114384740dcSRalf Baechle 115384740dcSRalf Baechle extern void prom_init(void); 116384740dcSRalf Baechle extern void prom_free_prom_memory(void); 117384740dcSRalf Baechle 118384740dcSRalf Baechle extern void free_init_pages(const char *what, 119384740dcSRalf Baechle unsigned long begin, unsigned long end); 120384740dcSRalf Baechle 1210893d3fbSMarkos Chandras extern void (*free_init_pages_eva)(void *begin, void *end); 1220893d3fbSMarkos Chandras 123384740dcSRalf Baechle /* 124384740dcSRalf Baechle * Initial kernel command line, usually setup by prom_init() 125384740dcSRalf Baechle */ 1267580c9c3SDmitri Vorobiev extern char arcs_cmdline[COMMAND_LINE_SIZE]; 127384740dcSRalf Baechle 128384740dcSRalf Baechle /* 129384740dcSRalf Baechle * Registers a0, a1, a3 and a4 as passed to the kernel entry by firmware 130384740dcSRalf Baechle */ 131384740dcSRalf Baechle extern unsigned long fw_arg0, fw_arg1, fw_arg2, fw_arg3; 132384740dcSRalf Baechle 133384740dcSRalf Baechle /* 134384740dcSRalf Baechle * Platform memory detection hook called by setup_arch 135384740dcSRalf Baechle */ 136384740dcSRalf Baechle extern void plat_mem_setup(void); 137384740dcSRalf Baechle 138ee71b7d2SDavid Daney #ifdef CONFIG_SWIOTLB 139ee71b7d2SDavid Daney /* 140ee71b7d2SDavid Daney * Optional platform hook to call swiotlb_setup(). 141ee71b7d2SDavid Daney */ 142ee71b7d2SDavid Daney extern void plat_swiotlb_setup(void); 143ee71b7d2SDavid Daney 144ee71b7d2SDavid Daney #else 145ee71b7d2SDavid Daney 146ee71b7d2SDavid Daney static inline void plat_swiotlb_setup(void) {} 147ee71b7d2SDavid Daney 148ee71b7d2SDavid Daney #endif /* CONFIG_SWIOTLB */ 149ee71b7d2SDavid Daney 150384740dcSRalf Baechle #endif /* _ASM_BOOTINFO_H */ 151