1 /*
2  * Copyright 2018 The Hafnium Authors.
3  *
4  * Use of this source code is governed by a BSD-style
5  * license that can be found in the LICENSE file or at
6  * https://opensource.org/licenses/BSD-3-Clause.
7  */
8 
9 #pragma once
10 
11 #include <stdbool.h>
12 
13 #include "hf/arch/cpu.h"
14 
15 #include "hf/fdt.h"
16 #include "hf/mm.h"
17 #include "hf/mpool.h"
18 
19 #define MAX_MEM_RANGES 20
20 #define MAX_DEVICE_MEM_RANGES 10
21 
22 struct mem_range {
23 	paddr_t begin;
24 	paddr_t end;
25 };
26 
27 struct boot_params {
28 	cpu_id_t cpu_ids[MAX_CPUS];
29 	size_t cpu_count;
30 	struct mem_range mem_ranges[MAX_MEM_RANGES];
31 	size_t mem_ranges_count;
32 	struct mem_range ns_mem_ranges[MAX_MEM_RANGES];
33 	size_t ns_mem_ranges_count;
34 	struct mem_range device_mem_ranges[MAX_DEVICE_MEM_RANGES];
35 	size_t device_mem_ranges_count;
36 	struct mem_range ns_device_mem_ranges[MAX_DEVICE_MEM_RANGES];
37 	size_t ns_device_mem_ranges_count;
38 
39 	paddr_t initrd_begin;
40 	paddr_t initrd_end;
41 	uintreg_t kernel_arg;
42 };
43 
44 struct boot_params_update {
45 	struct mem_range reserved_ranges[MAX_MEM_RANGES];
46 	size_t reserved_ranges_count;
47 	paddr_t initrd_begin;
48 	paddr_t initrd_end;
49 };
50