Andre Przywara | ffbacb0 | 2019-07-10 17:27:17 +0100 | [diff] [blame] | 1 | /* |
Javier Almansa Sobrino | 40f4984 | 2020-08-25 16:16:29 +0100 | [diff] [blame] | 2 | * Copyright (c) 2019-2020, ARM Limited and Contributors. All rights reserved. |
Andre Przywara | ffbacb0 | 2019-07-10 17:27:17 +0100 | [diff] [blame] | 3 | * |
| 4 | * SPDX-License-Identifier: BSD-3-Clause |
| 5 | */ |
| 6 | |
| 7 | #ifndef FDT_FIXUP_H |
| 8 | #define FDT_FIXUP_H |
| 9 | |
Samuel Holland | ad0dae7 | 2022-01-23 17:12:26 -0600 | [diff] [blame] | 10 | #include <stdbool.h> |
| 11 | #include <stddef.h> |
| 12 | #include <stdint.h> |
| 13 | |
Andre Przywara | f2a78fe | 2021-05-19 09:37:21 +0100 | [diff] [blame] | 14 | #define INVALID_BASE_ADDR ((uintptr_t)~0UL) |
| 15 | |
Samuel Holland | ad0dae7 | 2022-01-23 17:12:26 -0600 | [diff] [blame] | 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 | |
Andre Przywara | ffbacb0 | 2019-07-10 17:27:17 +0100 | [diff] [blame] | 26 | int dt_add_psci_node(void *fdt); |
| 27 | int dt_add_psci_cpu_enable_methods(void *fdt); |
Andre Przywara | 83fc839 | 2019-07-15 09:00:23 +0100 | [diff] [blame] | 28 | int fdt_add_reserved_memory(void *dtb, const char *node_name, |
| 29 | uintptr_t base, size_t size); |
Javier Almansa Sobrino | 40f4984 | 2020-08-25 16:16:29 +0100 | [diff] [blame] | 30 | int fdt_add_cpus_node(void *dtb, unsigned int afflv0, |
| 31 | unsigned int afflv1, unsigned int afflv2); |
Samuel Holland | ad0dae7 | 2022-01-23 17:12:26 -0600 | [diff] [blame] | 32 | int fdt_add_cpu_idle_states(void *dtb, const struct psci_cpu_idle_state *state); |
Andre Przywara | f2a78fe | 2021-05-19 09:37:21 +0100 | [diff] [blame] | 33 | int fdt_adjust_gic_redist(void *dtb, unsigned int nr_cores, uintptr_t gicr_base, |
Andre Przywara | 64b9e14 | 2020-08-24 18:28:44 +0100 | [diff] [blame] | 34 | unsigned int gicr_frame_size); |
Andre Przywara | 3e8c7ec | 2021-12-19 13:55:33 +0000 | [diff] [blame] | 35 | int fdt_set_mac_address(void *dtb, unsigned int ethernet_idx, |
| 36 | const uint8_t *mac_addr); |
Andre Przywara | ffbacb0 | 2019-07-10 17:27:17 +0100 | [diff] [blame] | 37 | |
| 38 | #endif /* FDT_FIXUP_H */ |