1 #ifndef __ARM_SETUP_H_ 2 #define __ARM_SETUP_H_ 3 4 #include <public/version.h> 5 6 #define MIN_FDT_ALIGN 8 7 #define MAX_FDT_SIZE SZ_2M 8 9 #define NR_MEM_BANKS 128 10 11 #define MAX_MODULES 32 /* Current maximum useful modules */ 12 13 typedef enum { 14 BOOTMOD_XEN, 15 BOOTMOD_FDT, 16 BOOTMOD_KERNEL, 17 BOOTMOD_RAMDISK, 18 BOOTMOD_XSM, 19 BOOTMOD_GUEST_DTB, 20 BOOTMOD_UNKNOWN 21 } bootmodule_kind; 22 23 24 struct membank { 25 paddr_t start; 26 paddr_t size; 27 }; 28 29 struct meminfo { 30 int nr_banks; 31 struct membank bank[NR_MEM_BANKS]; 32 }; 33 34 /* 35 * The domU flag is set for kernels and ramdisks of "xen,domain" nodes. 36 * The purpose of the domU flag is to avoid getting confused in 37 * kernel_probe, where we try to guess which is the dom0 kernel and 38 * initrd to be compatible with all versions of the multiboot spec. 39 */ 40 #define BOOTMOD_MAX_CMDLINE 1024 41 struct bootmodule { 42 bootmodule_kind kind; 43 bool domU; 44 paddr_t start; 45 paddr_t size; 46 }; 47 48 /* DT_MAX_NAME is the node name max length according the DT spec */ 49 #define DT_MAX_NAME 41 50 struct bootcmdline { 51 bootmodule_kind kind; 52 bool domU; 53 paddr_t start; 54 char dt_name[DT_MAX_NAME]; 55 char cmdline[BOOTMOD_MAX_CMDLINE]; 56 }; 57 58 struct bootmodules { 59 int nr_mods; 60 struct bootmodule module[MAX_MODULES]; 61 }; 62 63 struct bootcmdlines { 64 unsigned int nr_mods; 65 struct bootcmdline cmdline[MAX_MODULES]; 66 }; 67 68 struct bootinfo { 69 struct meminfo mem; 70 struct meminfo reserved_mem; 71 struct bootmodules modules; 72 struct bootcmdlines cmdlines; 73 #ifdef CONFIG_ACPI 74 struct meminfo acpi; 75 #endif 76 }; 77 78 extern struct bootinfo bootinfo; 79 80 extern domid_t max_init_domid; 81 82 void copy_from_paddr(void *dst, paddr_t paddr, unsigned long len); 83 84 size_t estimate_efi_size(int mem_nr_banks); 85 86 void acpi_create_efi_system_table(struct domain *d, 87 struct membank tbl_add[]); 88 89 void acpi_create_efi_mmap_table(struct domain *d, 90 const struct meminfo *mem, 91 struct membank tbl_add[]); 92 93 int acpi_make_efi_nodes(void *fdt, struct membank tbl_add[]); 94 95 int construct_dom0(struct domain *d); 96 void create_domUs(void); 97 98 void discard_initial_modules(void); 99 void dt_unreserved_regions(paddr_t s, paddr_t e, 100 void (*cb)(paddr_t, paddr_t), int first); 101 102 size_t boot_fdt_info(const void *fdt, paddr_t paddr); 103 const char *boot_fdt_cmdline(const void *fdt); 104 105 struct bootmodule *add_boot_module(bootmodule_kind kind, 106 paddr_t start, paddr_t size, bool domU); 107 struct bootmodule *boot_module_find_by_kind(bootmodule_kind kind); 108 struct bootmodule * boot_module_find_by_addr_and_kind(bootmodule_kind kind, 109 paddr_t start); 110 void add_boot_cmdline(const char *name, const char *cmdline, 111 bootmodule_kind kind, paddr_t start, bool domU); 112 struct bootcmdline *boot_cmdline_find_by_kind(bootmodule_kind kind); 113 struct bootcmdline * boot_cmdline_find_by_name(const char *name); 114 const char *boot_module_kind_as_string(bootmodule_kind kind); 115 116 extern uint32_t hyp_traps_vector[]; 117 void init_traps(void); 118 119 void device_tree_get_reg(const __be32 **cell, u32 address_cells, 120 u32 size_cells, u64 *start, u64 *size); 121 122 u32 device_tree_get_u32(const void *fdt, int node, 123 const char *prop_name, u32 dflt); 124 125 #endif 126 /* 127 * Local variables: 128 * mode: C 129 * c-file-style: "BSD" 130 * c-basic-offset: 4 131 * indent-tabs-mode: nil 132 * End: 133 */ 134