blob: 9531bdb77061ac8d76feed612f1461aff434cacd [file] [log] [blame]
Andre Przywaraffbacb02019-07-10 17:27:17 +01001/*
Javier Almansa Sobrino40f49842020-08-25 16:16:29 +01002 * Copyright (c) 2019-2020, ARM Limited and Contributors. All rights reserved.
Andre Przywaraffbacb02019-07-10 17:27:17 +01003 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
7#ifndef FDT_FIXUP_H
8#define FDT_FIXUP_H
9
Samuel Hollandad0dae72022-01-23 17:12:26 -060010#include <stdbool.h>
11#include <stddef.h>
12#include <stdint.h>
13
Andre Przywaraf2a78fe2021-05-19 09:37:21 +010014#define INVALID_BASE_ADDR ((uintptr_t)~0UL)
15
Samuel Hollandad0dae72022-01-23 17:12:26 -060016struct psci_cpu_idle_state {
17 const char *name;
18 uint32_t power_state;
19 bool local_timer_stop;
20 uint32_t entry_latency_us;
21 uint32_t exit_latency_us;
22 uint32_t min_residency_us;
23 uint32_t wakeup_latency_us;
24};
25
Andre Przywaraffbacb02019-07-10 17:27:17 +010026int dt_add_psci_node(void *fdt);
27int dt_add_psci_cpu_enable_methods(void *fdt);
Andre Przywara83fc8392019-07-15 09:00:23 +010028int fdt_add_reserved_memory(void *dtb, const char *node_name,
29 uintptr_t base, size_t size);
Javier Almansa Sobrino40f49842020-08-25 16:16:29 +010030int fdt_add_cpus_node(void *dtb, unsigned int afflv0,
31 unsigned int afflv1, unsigned int afflv2);
Samuel Hollandad0dae72022-01-23 17:12:26 -060032int fdt_add_cpu_idle_states(void *dtb, const struct psci_cpu_idle_state *state);
Andre Przywaraf2a78fe2021-05-19 09:37:21 +010033int fdt_adjust_gic_redist(void *dtb, unsigned int nr_cores, uintptr_t gicr_base,
Andre Przywara64b9e142020-08-24 18:28:44 +010034 unsigned int gicr_frame_size);
Andre Przywara3e8c7ec2021-12-19 13:55:33 +000035int fdt_set_mac_address(void *dtb, unsigned int ethernet_idx,
36 const uint8_t *mac_addr);
Andre Przywaraffbacb02019-07-10 17:27:17 +010037
38#endif /* FDT_FIXUP_H */