xref: /rk3399_ARM-atf/plat/rpi/common/include/rpi_shared.h (revision 87e9ee87ed09ef711377aa40e7f086633436da3b)
14f2b9848SAndre Przywara /*
297ef5305SMario Bălănică  * Copyright (c) 2015-2024, Arm Limited and Contributors. All rights reserved.
34f2b9848SAndre Przywara  *
44f2b9848SAndre Przywara  * SPDX-License-Identifier: BSD-3-Clause
54f2b9848SAndre Przywara  */
64f2b9848SAndre Przywara 
74f2b9848SAndre Przywara #ifndef RPI_SHARED_H
84f2b9848SAndre Przywara #define RPI_SHARED_H
94f2b9848SAndre Przywara 
10b5029782SMario Bălănică #include <stddef.h>
114f2b9848SAndre Przywara #include <stdint.h>
124f2b9848SAndre Przywara 
13b5029782SMario Bălănică #include <drivers/console.h>
14b5029782SMario Bălănică 
154f2b9848SAndre Przywara /*******************************************************************************
164f2b9848SAndre Przywara  * Function and variable prototypes
174f2b9848SAndre Przywara  ******************************************************************************/
184f2b9848SAndre Przywara 
19b5029782SMario Bălănică /* Serial console functions */
20795aefe5SAndre Przywara void rpi3_console_init(void);
21b5029782SMario Bălănică int rpi3_register_used_uart(console_t *console);
22b5029782SMario Bălănică 
23b5029782SMario Bălănică /* Utility functions */
244f2b9848SAndre Przywara void rpi3_setup_page_tables(uintptr_t total_base, size_t total_size,
254f2b9848SAndre Przywara 			    uintptr_t code_start, uintptr_t code_limit,
264f2b9848SAndre Przywara 			    uintptr_t rodata_start, uintptr_t rodata_limit
274f2b9848SAndre Przywara #if USE_COHERENT_MEM
284f2b9848SAndre Przywara 			    , uintptr_t coh_start, uintptr_t coh_limit
294f2b9848SAndre Przywara #endif
304f2b9848SAndre Przywara 			    );
314f2b9848SAndre Przywara 
3297ef5305SMario Bălănică uintptr_t rpi4_get_dtb_address(void);
3397ef5305SMario Bălănică 
344f2b9848SAndre Przywara /* Optional functions required in the Raspberry Pi 3 port */
354f2b9848SAndre Przywara unsigned int plat_rpi3_calc_core_pos(u_register_t mpidr);
364f2b9848SAndre Przywara 
374f2b9848SAndre Przywara /* BL2 utility functions */
384f2b9848SAndre Przywara uint32_t rpi3_get_spsr_for_bl32_entry(void);
394f2b9848SAndre Przywara uint32_t rpi3_get_spsr_for_bl33_entry(void);
404f2b9848SAndre Przywara 
414f2b9848SAndre Przywara /* IO storage utility functions */
424f2b9848SAndre Przywara void plat_rpi3_io_setup(void);
434f2b9848SAndre Przywara 
444f2b9848SAndre Przywara /* VideoCore firmware commands */
454f2b9848SAndre Przywara int rpi3_vc_hardware_get_board_revision(uint32_t *revision);
464f2b9848SAndre Przywara 
4707aa0c7eSAndre Przywara int plat_rpi_get_model(void);
4807aa0c7eSAndre Przywara 
4997ef5305SMario Bălănică /*******************************************************************************
5097ef5305SMario Bălănică  * Platform implemented functions
5197ef5305SMario Bălănică  ******************************************************************************/
5297ef5305SMario Bălănică 
5397ef5305SMario Bălănică void plat_rpi_bl31_custom_setup(void);
5497ef5305SMario Bălănică 
55*5c0cbb2fSAbhi Singh #endif /* RPI3_SHARED_H */
56