1 /*
2  * Copyright (c) 2019-2020, ARM Limited and Contributors. All rights reserved.
3  *
4  * SPDX-License-Identifier: BSD-3-Clause
5  */
6 
7 #ifndef FDT_FIXUP_H
8 #define FDT_FIXUP_H
9 
10 #include <stdbool.h>
11 #include <stddef.h>
12 #include <stdint.h>
13 
14 #define INVALID_BASE_ADDR	((uintptr_t)~0UL)
15 
16 struct 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 
26 int dt_add_psci_node(void *fdt);
27 int dt_add_psci_cpu_enable_methods(void *fdt);
28 int fdt_add_reserved_memory(void *dtb, const char *node_name,
29 			    uintptr_t base, size_t size);
30 int fdt_add_cpus_node(void *dtb, unsigned int afflv0,
31 		      unsigned int afflv1, unsigned int afflv2);
32 int fdt_add_cpu_idle_states(void *dtb, const struct psci_cpu_idle_state *state);
33 int fdt_adjust_gic_redist(void *dtb, unsigned int nr_cores, uintptr_t gicr_base,
34 			  unsigned int gicr_frame_size);
35 int fdt_set_mac_address(void *dtb, unsigned int ethernet_idx,
36 			const uint8_t *mac_addr);
37 
38 #endif /* FDT_FIXUP_H */
39