1 /*
2  * Copyright (c) 2015-2024, Arm Limited and Contributors. All rights reserved.
3  *
4  * SPDX-License-Identifier: BSD-3-Clause
5  */
6 
7 #ifndef RPI_SHARED_H
8 #define RPI_SHARED_H
9 
10 #include <stddef.h>
11 #include <stdint.h>
12 
13 #include <drivers/console.h>
14 
15 /*******************************************************************************
16  * Function and variable prototypes
17  ******************************************************************************/
18 
19 /* Serial console functions */
20 void rpi3_console_init(void);
21 int rpi3_register_used_uart(console_t *console);
22 
23 /* Utility functions */
24 void rpi3_setup_page_tables(uintptr_t total_base, size_t total_size,
25 			    uintptr_t code_start, uintptr_t code_limit,
26 			    uintptr_t rodata_start, uintptr_t rodata_limit
27 #if USE_COHERENT_MEM
28 			    , uintptr_t coh_start, uintptr_t coh_limit
29 #endif
30 			    );
31 
32 uintptr_t rpi4_get_dtb_address(void);
33 
34 /* Optional functions required in the Raspberry Pi 3 port */
35 unsigned int plat_rpi3_calc_core_pos(u_register_t mpidr);
36 
37 /* BL2 utility functions */
38 uint32_t rpi3_get_spsr_for_bl32_entry(void);
39 uint32_t rpi3_get_spsr_for_bl33_entry(void);
40 
41 /* IO storage utility functions */
42 void plat_rpi3_io_setup(void);
43 
44 /* VideoCore firmware commands */
45 int rpi3_vc_hardware_get_board_revision(uint32_t *revision);
46 
47 int plat_rpi_get_model(void);
48 
49 /*******************************************************************************
50  * Platform implemented functions
51  ******************************************************************************/
52 
53 void plat_rpi_bl31_custom_setup(void);
54 
55 #endif /* RPI3_PRIVATE_H */
56