Andrew Scull | 1883487 | 2018-10-12 11:48:09 +0100 | [diff] [blame] | 1 | /* |
Andrew Walbran | 692b325 | 2019-03-07 15:51:31 +0000 | [diff] [blame] | 2 | * Copyright 2018 The Hafnium Authors. |
Andrew Scull | 1883487 | 2018-10-12 11:48:09 +0100 | [diff] [blame] | 3 | * |
Andrew Walbran | e959ec1 | 2020-06-17 15:01:09 +0100 | [diff] [blame] | 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. |
Andrew Scull | 1883487 | 2018-10-12 11:48:09 +0100 | [diff] [blame] | 7 | */ |
| 8 | |
Andrew Scull | fbc938a | 2018-08-20 14:09:28 +0100 | [diff] [blame] | 9 | #pragma once |
Wedson Almeida Filho | fdf4afc | 2018-07-19 15:45:21 +0100 | [diff] [blame] | 10 | |
Andrew Scull | 18c78fc | 2018-08-20 12:57:41 +0100 | [diff] [blame] | 11 | #include "hf/boot_params.h" |
| 12 | #include "hf/fdt.h" |
| 13 | #include "hf/mm.h" |
Wedson Almeida Filho | 22d5eaa | 2018-12-16 00:38:49 +0000 | [diff] [blame] | 14 | #include "hf/mpool.h" |
Andrew Scull | 6c9a4ab | 2020-01-27 17:09:12 +0000 | [diff] [blame] | 15 | #include "hf/string.h" |
Wedson Almeida Filho | fdf4afc | 2018-07-19 15:45:21 +0100 | [diff] [blame] | 16 | |
David Brazdil | b856be6 | 2020-03-25 10:14:55 +0000 | [diff] [blame] | 17 | #define FDT_PROP_INITRD_START "linux,initrd-start" |
| 18 | #define FDT_PROP_INITRD_END "linux,initrd-end" |
| 19 | |
Fuad Tabba | 50469e0 | 2020-06-30 15:14:28 +0100 | [diff] [blame] | 20 | bool fdt_struct_from_ptr(const void *fdt_ptr, struct fdt *fdt); |
David Brazdil | b856be6 | 2020-03-25 10:14:55 +0000 | [diff] [blame] | 21 | bool fdt_map(struct fdt *fdt, struct mm_stage1_locked stage1_locked, |
| 22 | paddr_t fdt_addr, struct mpool *ppool); |
| 23 | bool fdt_unmap(struct fdt *fdt, struct mm_stage1_locked stage1_locked, |
Andrew Scull | 3c0a90a | 2019-07-01 11:55:53 +0100 | [diff] [blame] | 24 | struct mpool *ppool); |
David Brazdil | b856be6 | 2020-03-25 10:14:55 +0000 | [diff] [blame] | 25 | bool fdt_find_cpus(const struct fdt *fdt, cpu_id_t *cpu_ids, size_t *cpu_count); |
Fuad Tabba | 50469e0 | 2020-06-30 15:14:28 +0100 | [diff] [blame] | 26 | bool fdt_find_memory_ranges(const struct fdt *fdt, |
| 27 | const struct string *device_type, |
Andrew Scull | 6c9a4ab | 2020-01-27 17:09:12 +0000 | [diff] [blame] | 28 | struct mem_range *mem_ranges, |
| 29 | size_t *mem_ranges_count, size_t mem_range_limit); |
David Brazdil | b856be6 | 2020-03-25 10:14:55 +0000 | [diff] [blame] | 30 | bool fdt_find_initrd(const struct fdt *fdt, paddr_t *begin, paddr_t *end); |
Fuad Tabba | 50469e0 | 2020-06-30 15:14:28 +0100 | [diff] [blame] | 31 | bool fdt_get_memory_size(const struct fdt *fdt, size_t *size); |