blob: a62a7cb0899168b740caa6aa385584f9f8418492 [file] [log] [blame]
Konstantin Porotchkinf69ec582018-06-07 18:31:14 +03001/*
2 * Copyright (C) 2018 Marvell International Ltd.
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 * https://spdx.org/licenses
6 */
7
8#ifndef __PLAT_MARVELL_H__
9#define __PLAT_MARVELL_H__
10
11#include <cassert.h>
12#include <cpu_data.h>
13#include <stdint.h>
14#include <utils.h>
15#include <xlat_tables.h>
16
17/*
18 * Extern declarations common to Marvell standard platforms
19 */
20extern 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
Antonio Nino Diaz79662212018-09-24 17:15:46 +010027struct marvell_bl31_params {
28 param_header_t h;
29 image_info_t *bl31_image_info;
30 entry_point_info_t *bl32_ep_info;
31 image_info_t *bl32_image_info;
32 entry_point_info_t *bl33_ep_info;
33 image_info_t *bl33_image_info;
34};
35
Konstantin Porotchkinf69ec582018-06-07 18:31:14 +030036/*
37 * Utility functions common to Marvell standard platforms
38 */
39void marvell_setup_page_tables(uintptr_t total_base,
40 size_t total_size,
41 uintptr_t code_start,
42 uintptr_t code_limit,
43 uintptr_t rodata_start,
44 uintptr_t rodata_limit
45#if USE_COHERENT_MEM
46 , uintptr_t coh_start,
47 uintptr_t coh_limit
48#endif
49);
50
51/* IO storage utility functions */
52void marvell_io_setup(void);
53
54/* Systimer utility function */
55void marvell_configure_sys_timer(void);
56
57/* Topology utility function */
58int marvell_check_mpidr(u_register_t mpidr);
59
60/* BLE utility functions */
61int ble_plat_setup(int *skip);
62void plat_marvell_dram_update_topology(void);
63void ble_plat_pcie_ep_setup(void);
64struct pci_hw_cfg *plat_get_pcie_hw_data(void);
65
66/* BL1 utility functions */
67void marvell_bl1_early_platform_setup(void);
68void marvell_bl1_platform_setup(void);
69void marvell_bl1_plat_arch_setup(void);
70
71/* BL2 utility functions */
72void marvell_bl2_early_platform_setup(meminfo_t *mem_layout);
73void marvell_bl2_platform_setup(void);
74void marvell_bl2_plat_arch_setup(void);
75uint32_t marvell_get_spsr_for_bl32_entry(void);
76uint32_t marvell_get_spsr_for_bl33_entry(void);
77
78/* BL31 utility functions */
Antonio Nino Diaz79662212018-09-24 17:15:46 +010079void marvell_bl31_early_platform_setup(void *from_bl2,
Konstantin Porotchkinacb1dc12018-08-19 10:07:35 +030080 uintptr_t soc_fw_config,
81 uintptr_t hw_config,
82 void *plat_params_from_bl2);
Konstantin Porotchkinf69ec582018-06-07 18:31:14 +030083void marvell_bl31_platform_setup(void);
84void marvell_bl31_plat_runtime_setup(void);
85void marvell_bl31_plat_arch_setup(void);
86
87/* Power management config to power off the SoC */
88void *plat_marvell_get_pm_cfg(void);
89
90/* Check if MSS AP CM3 firmware contains PM support */
91_Bool is_pm_fw_running(void);
92
93/* Bootrom image recovery utility functions */
94void *plat_marvell_get_skip_image_data(void);
95
96/* FIP TOC validity check */
97int marvell_io_is_toc_valid(void);
98
99/*
100 * PSCI functionality
101 */
102void marvell_psci_arch_init(int ap_idx);
103void plat_marvell_system_reset(void);
104
105/*
Marcin Wojtas0c60c2f2018-03-21 09:59:59 +0100106 * Miscellaneous platform SMC routines
107 */
108#ifdef MVEBU_PMU_IRQ_WA
109void mvebu_pmu_interrupt_enable(void);
110void mvebu_pmu_interrupt_disable(void);
111#endif
112
113/*
Konstantin Porotchkinf69ec582018-06-07 18:31:14 +0300114 * Optional functions required in Marvell standard platforms
115 */
116void plat_marvell_io_setup(void);
117int plat_marvell_get_alt_image_source(
118 unsigned int image_id,
119 uintptr_t *dev_handle,
120 uintptr_t *image_spec);
121unsigned int plat_marvell_calc_core_pos(u_register_t mpidr);
122
123const mmap_region_t *plat_marvell_get_mmap(void);
124void marvell_ble_prepare_exit(void);
125void marvell_exit_bootrom(uintptr_t base);
126
127int plat_marvell_early_cpu_powerdown(void);
128#endif /* __PLAT_MARVELL_H__ */