14f2b9848SAndre Przywara /* 2*97ef5305SMario 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 104f2b9848SAndre Przywara #include <stdint.h> 114f2b9848SAndre Przywara 124f2b9848SAndre Przywara /******************************************************************************* 134f2b9848SAndre Przywara * Function and variable prototypes 144f2b9848SAndre Przywara ******************************************************************************/ 154f2b9848SAndre Przywara 164f2b9848SAndre Przywara /* Utility functions */ 17795aefe5SAndre Przywara void rpi3_console_init(void); 184f2b9848SAndre Przywara void rpi3_setup_page_tables(uintptr_t total_base, size_t total_size, 194f2b9848SAndre Przywara uintptr_t code_start, uintptr_t code_limit, 204f2b9848SAndre Przywara uintptr_t rodata_start, uintptr_t rodata_limit 214f2b9848SAndre Przywara #if USE_COHERENT_MEM 224f2b9848SAndre Przywara , uintptr_t coh_start, uintptr_t coh_limit 234f2b9848SAndre Przywara #endif 244f2b9848SAndre Przywara ); 254f2b9848SAndre Przywara 26*97ef5305SMario Bălănică uintptr_t rpi4_get_dtb_address(void); 27*97ef5305SMario Bălănică 284f2b9848SAndre Przywara /* Optional functions required in the Raspberry Pi 3 port */ 294f2b9848SAndre Przywara unsigned int plat_rpi3_calc_core_pos(u_register_t mpidr); 304f2b9848SAndre Przywara 314f2b9848SAndre Przywara /* BL2 utility functions */ 324f2b9848SAndre Przywara uint32_t rpi3_get_spsr_for_bl32_entry(void); 334f2b9848SAndre Przywara uint32_t rpi3_get_spsr_for_bl33_entry(void); 344f2b9848SAndre Przywara 354f2b9848SAndre Przywara /* IO storage utility functions */ 364f2b9848SAndre Przywara void plat_rpi3_io_setup(void); 374f2b9848SAndre Przywara 384f2b9848SAndre Przywara /* VideoCore firmware commands */ 394f2b9848SAndre Przywara int rpi3_vc_hardware_get_board_revision(uint32_t *revision); 404f2b9848SAndre Przywara 4107aa0c7eSAndre Przywara int plat_rpi_get_model(void); 4207aa0c7eSAndre Przywara 43*97ef5305SMario Bălănică /******************************************************************************* 44*97ef5305SMario Bălănică * Platform implemented functions 45*97ef5305SMario Bălănică ******************************************************************************/ 46*97ef5305SMario Bălănică 47*97ef5305SMario Bălănică void plat_rpi_bl31_custom_setup(void); 48*97ef5305SMario Bălănică 494f2b9848SAndre Przywara #endif /* RPI3_PRIVATE_H */ 50