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