Konstantin Porotchkin | e7be6e2 | 2018-10-08 16:53:09 +0300 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2016 Marvell International Ltd. |
| 3 | * |
| 4 | * SPDX-License-Identifier: BSD-3-Clause |
| 5 | * https://spdx.org/licenses |
| 6 | */ |
| 7 | |
Antonio Nino Diaz | 5eb8837 | 2018-11-08 10:20:19 +0000 | [diff] [blame] | 8 | #ifndef PLAT_MARVELL_H |
| 9 | #define PLAT_MARVELL_H |
Konstantin Porotchkin | e7be6e2 | 2018-10-08 16:53:09 +0300 | [diff] [blame] | 10 | |
| 11 | #include <bl_common.h> |
| 12 | #include <cassert.h> |
| 13 | #include <cpu_data.h> |
| 14 | #include <stdint.h> |
| 15 | #include <xlat_tables.h> |
| 16 | |
| 17 | /* |
| 18 | * Extern declarations common to Marvell standard platforms |
| 19 | */ |
| 20 | extern const mmap_region_t plat_marvell_mmap[]; |
| 21 | |
| 22 | #define MARVELL_CASSERT_MMAP \ |
| 23 | CASSERT((ARRAY_SIZE(plat_marvell_mmap) + MARVELL_BL_REGIONS) \ |
| 24 | <= MAX_MMAP_REGIONS, \ |
| 25 | assert_max_mmap_regions) |
| 26 | |
| 27 | /* |
| 28 | * Utility functions common to Marvell standard platforms |
| 29 | */ |
| 30 | void marvell_setup_page_tables(uintptr_t total_base, |
| 31 | size_t total_size, |
| 32 | uintptr_t code_start, |
| 33 | uintptr_t code_limit, |
| 34 | uintptr_t rodata_start, |
| 35 | uintptr_t rodata_limit |
| 36 | #if USE_COHERENT_MEM |
| 37 | , uintptr_t coh_start, |
| 38 | uintptr_t coh_limit |
| 39 | #endif |
| 40 | ); |
| 41 | |
| 42 | /* IO storage utility functions */ |
| 43 | void marvell_io_setup(void); |
| 44 | |
| 45 | /* Systimer utility function */ |
| 46 | void marvell_configure_sys_timer(void); |
| 47 | |
| 48 | /* Topology utility function */ |
| 49 | int marvell_check_mpidr(u_register_t mpidr); |
| 50 | |
| 51 | /* BL1 utility functions */ |
| 52 | void marvell_bl1_early_platform_setup(void); |
| 53 | void marvell_bl1_platform_setup(void); |
| 54 | void marvell_bl1_plat_arch_setup(void); |
| 55 | |
| 56 | /* BL2 utility functions */ |
| 57 | void marvell_bl2_early_platform_setup(meminfo_t *mem_layout); |
| 58 | void marvell_bl2_platform_setup(void); |
| 59 | void marvell_bl2_plat_arch_setup(void); |
| 60 | uint32_t marvell_get_spsr_for_bl32_entry(void); |
| 61 | uint32_t marvell_get_spsr_for_bl33_entry(void); |
| 62 | |
| 63 | /* BL31 utility functions */ |
| 64 | void marvell_bl31_early_platform_setup(void *from_bl2, |
| 65 | uintptr_t soc_fw_config, |
| 66 | uintptr_t hw_config, |
| 67 | void *plat_params_from_bl2); |
| 68 | void marvell_bl31_platform_setup(void); |
| 69 | void marvell_bl31_plat_runtime_setup(void); |
| 70 | void marvell_bl31_plat_arch_setup(void); |
| 71 | |
| 72 | /* FIP TOC validity check */ |
| 73 | int marvell_io_is_toc_valid(void); |
| 74 | |
| 75 | /* |
| 76 | * PSCI functionality |
| 77 | */ |
| 78 | void marvell_psci_arch_init(int idx); |
| 79 | void plat_marvell_system_reset(void); |
| 80 | |
| 81 | /* |
| 82 | * Optional functions required in Marvell standard platforms |
| 83 | */ |
| 84 | void plat_marvell_io_setup(void); |
| 85 | int plat_marvell_get_alt_image_source( |
| 86 | unsigned int image_id, |
| 87 | uintptr_t *dev_handle, |
| 88 | uintptr_t *image_spec); |
| 89 | unsigned int plat_marvell_calc_core_pos(u_register_t mpidr); |
| 90 | |
| 91 | void plat_marvell_interconnect_init(void); |
| 92 | void plat_marvell_interconnect_enter_coherency(void); |
| 93 | |
| 94 | const mmap_region_t *plat_marvell_get_mmap(void); |
| 95 | |
Antonio Nino Diaz | 5eb8837 | 2018-11-08 10:20:19 +0000 | [diff] [blame] | 96 | #endif /* PLAT_MARVELL_H */ |