blob: 8cf3a4a7dc39ee402d8bf12b4798d5c10ad455d1 [file] [log] [blame]
Andrew Scull18834872018-10-12 11:48:09 +01001/*
Andrew Walbran692b3252019-03-07 15:51:31 +00002 * Copyright 2018 The Hafnium Authors.
Andrew Scull18834872018-10-12 11:48:09 +01003 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * https://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
Andrew Scullfbc938a2018-08-20 14:09:28 +010017#pragma once
Wedson Almeida Filhofdf4afc2018-07-19 15:45:21 +010018
Andrew Scull18c78fc2018-08-20 12:57:41 +010019#include "hf/boot_params.h"
20#include "hf/fdt.h"
21#include "hf/mm.h"
Wedson Almeida Filho22d5eaa2018-12-16 00:38:49 +000022#include "hf/mpool.h"
Andrew Scull6c9a4ab2020-01-27 17:09:12 +000023#include "hf/string.h"
Wedson Almeida Filhofdf4afc2018-07-19 15:45:21 +010024
David Brazdilb856be62020-03-25 10:14:55 +000025#define FDT_PROP_INITRD_START "linux,initrd-start"
26#define FDT_PROP_INITRD_END "linux,initrd-end"
27
28bool fdt_map(struct fdt *fdt, struct mm_stage1_locked stage1_locked,
29 paddr_t fdt_addr, struct mpool *ppool);
30bool fdt_unmap(struct fdt *fdt, struct mm_stage1_locked stage1_locked,
Andrew Scull3c0a90a2019-07-01 11:55:53 +010031 struct mpool *ppool);
David Brazdilb856be62020-03-25 10:14:55 +000032bool fdt_find_cpus(const struct fdt *fdt, cpu_id_t *cpu_ids, size_t *cpu_count);
33bool fdt_find_memory_ranges(const struct fdt *fdt, struct string *device_type,
Andrew Scull6c9a4ab2020-01-27 17:09:12 +000034 struct mem_range *mem_ranges,
35 size_t *mem_ranges_count, size_t mem_range_limit);
David Brazdilb856be62020-03-25 10:14:55 +000036bool fdt_find_initrd(const struct fdt *fdt, paddr_t *begin, paddr_t *end);