xref: /kvm-unit-tests/lib/arm/asm/setup.h (revision d9de80518112e083dfe412546e422c4e044c31d9)
1 #ifndef _ASMARM_SETUP_H_
2 #define _ASMARM_SETUP_H_
3 /*
4  * Copyright (C) 2014, Red Hat Inc, Andrew Jones <drjones@redhat.com>
5  *
6  * This work is licensed under the terms of the GNU LGPL, version 2.
7  */
8 #include <libcflat.h>
9 #include <asm/page.h>
10 #include <asm/pgtable-hwdef.h>
11 
12 #define NR_CPUS			511
13 extern u64 cpus[NR_CPUS];	/* per-cpu IDs (MPIDRs) */
14 extern int nr_cpus;
15 
16 #define MR_F_IO			(1U << 0)
17 #define MR_F_CODE		(1U << 1)
18 #define MR_F_RESERVED		(1U << 2)
19 #define MR_F_UNKNOWN		(1U << 31)
20 
21 struct mem_region {
22 	phys_addr_t start;
23 	phys_addr_t end;
24 	unsigned int flags;
25 };
26 extern struct mem_region *mem_regions;
27 extern phys_addr_t __phys_offset, __phys_end;
28 
29 extern struct mem_region *mem_region_find(phys_addr_t paddr);
30 extern unsigned int mem_region_get_flags(phys_addr_t paddr);
31 
32 #define PHYS_OFFSET		(__phys_offset)
33 #define PHYS_END		(__phys_end)
34 
35 #define L1_CACHE_SHIFT		6
36 #define L1_CACHE_BYTES		(1 << L1_CACHE_SHIFT)
37 #define SMP_CACHE_BYTES		L1_CACHE_BYTES
38 
39 void setup(const void *fdt, phys_addr_t freemem_start);
40 
41 #ifdef CONFIG_EFI
42 
43 #include <efi.h>
44 
45 efi_status_t setup_efi(efi_bootinfo_t *efi_bootinfo);
46 
47 #endif
48 
49 #endif /* _ASMARM_SETUP_H_ */
50