xref: /kvm-unit-tests/lib/arm/asm/setup.h (revision 0c4e631ecaf30f8065dec5cc589d5894c961e6ee)
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 <alloc.h>	/* phys_addr_t */
10 #include <asm/page.h>
11 #include <asm/pgtable-hwdef.h>
12 
13 #define NR_CPUS			8
14 extern u32 cpus[NR_CPUS];
15 extern int nr_cpus;
16 
17 #define NR_MEM_REGIONS		8
18 #define MR_F_PRIMARY		(1U << 0)
19 struct mem_region {
20 	phys_addr_t start;
21 	phys_addr_t end;
22 	unsigned int flags;
23 };
24 extern struct mem_region mem_regions[NR_MEM_REGIONS];
25 extern phys_addr_t __phys_offset, __phys_end;
26 
27 #define PHYS_OFFSET		(__phys_offset)
28 #define PHYS_END		(__phys_end)
29 /* mach-virt reserves the first 1G section for I/O */
30 #define PHYS_IO_OFFSET		(0UL)
31 #define PHYS_IO_END		(1UL << 30)
32 
33 #define L1_CACHE_SHIFT		6
34 #define L1_CACHE_BYTES		(1 << L1_CACHE_SHIFT)
35 #define SMP_CACHE_BYTES		L1_CACHE_BYTES
36 
37 #endif /* _ASMARM_SETUP_H_ */
38