blob: 8fe08319b5afe22f24ba6b800a8776003cb1427e [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 *
Andrew Walbrane959ec12020-06-17 15:01:09 +01004 * 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 Scull18834872018-10-12 11:48:09 +01007 */
8
Andrew Scullfbc938a2018-08-20 14:09:28 +01009#pragma once
Wedson Almeida Filhofdf4afc2018-07-19 15:45:21 +010010
Andrew Scull18c78fc2018-08-20 12:57:41 +010011#include "hf/boot_params.h"
12#include "hf/fdt.h"
13#include "hf/mm.h"
Wedson Almeida Filho22d5eaa2018-12-16 00:38:49 +000014#include "hf/mpool.h"
Andrew Scull6c9a4ab2020-01-27 17:09:12 +000015#include "hf/string.h"
Wedson Almeida Filhofdf4afc2018-07-19 15:45:21 +010016
David Brazdilb856be62020-03-25 10:14:55 +000017#define FDT_PROP_INITRD_START "linux,initrd-start"
18#define FDT_PROP_INITRD_END "linux,initrd-end"
19
20bool fdt_map(struct fdt *fdt, struct mm_stage1_locked stage1_locked,
21 paddr_t fdt_addr, struct mpool *ppool);
22bool fdt_unmap(struct fdt *fdt, struct mm_stage1_locked stage1_locked,
Andrew Scull3c0a90a2019-07-01 11:55:53 +010023 struct mpool *ppool);
David Brazdilb856be62020-03-25 10:14:55 +000024bool fdt_find_cpus(const struct fdt *fdt, cpu_id_t *cpu_ids, size_t *cpu_count);
25bool fdt_find_memory_ranges(const struct fdt *fdt, struct string *device_type,
Andrew Scull6c9a4ab2020-01-27 17:09:12 +000026 struct mem_range *mem_ranges,
27 size_t *mem_ranges_count, size_t mem_range_limit);
David Brazdilb856be62020-03-25 10:14:55 +000028bool fdt_find_initrd(const struct fdt *fdt, paddr_t *begin, paddr_t *end);