blob: c828d07c1f05488b98935c2eb241e59b0fc66085 [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
11#include <stdbool.h>
12
Andrew Scull37402872018-10-24 14:23:06 +010013#include "hf/arch/cpu.h"
14
David Brazdil0dbb41f2019-09-09 18:03:35 +010015#include "hf/fdt.h"
Andrew Scull18c78fc2018-08-20 12:57:41 +010016#include "hf/mm.h"
Wedson Almeida Filho22d5eaa2018-12-16 00:38:49 +000017#include "hf/mpool.h"
Wedson Almeida Filhofdf4afc2018-07-19 15:45:21 +010018
Andrew Walbran34ce72e2018-09-13 16:47:44 +010019#define MAX_MEM_RANGES 20
Andrew Scull48929fd2020-01-28 10:39:10 +000020#define MAX_DEVICE_MEM_RANGES 10
Andrew Walbran34ce72e2018-09-13 16:47:44 +010021
22struct mem_range {
23 paddr_t begin;
24 paddr_t end;
25};
26
Wedson Almeida Filhofdf4afc2018-07-19 15:45:21 +010027struct boot_params {
Andrew Walbran4d3fa282019-06-26 13:31:15 +010028 cpu_id_t cpu_ids[MAX_CPUS];
Andrew Scullbb3ab6c2018-11-26 20:38:49 +000029 size_t cpu_count;
Andrew Walbran34ce72e2018-09-13 16:47:44 +010030 struct mem_range mem_ranges[MAX_MEM_RANGES];
31 size_t mem_ranges_count;
Olivier Deprez05046922023-03-09 15:48:40 +010032 struct mem_range ns_mem_ranges[MAX_MEM_RANGES];
33 size_t ns_mem_ranges_count;
Andrew Scull48929fd2020-01-28 10:39:10 +000034 struct mem_range device_mem_ranges[MAX_DEVICE_MEM_RANGES];
35 size_t device_mem_ranges_count;
Wedson Almeida Filhofdf4afc2018-07-19 15:45:21 +010036 paddr_t initrd_begin;
37 paddr_t initrd_end;
Andrew Scull37402872018-10-24 14:23:06 +010038 uintreg_t kernel_arg;
Wedson Almeida Filhofdf4afc2018-07-19 15:45:21 +010039};
40
41struct boot_params_update {
Andrew Walbran34ce72e2018-09-13 16:47:44 +010042 struct mem_range reserved_ranges[MAX_MEM_RANGES];
43 size_t reserved_ranges_count;
Wedson Almeida Filhofdf4afc2018-07-19 15:45:21 +010044 paddr_t initrd_begin;
45 paddr_t initrd_end;
46};