diff --git a/product/neoverse-rd/rdn2/module/apremap/CMakeLists.txt b/product/neoverse-rd/rdn2/module/apremap/CMakeLists.txt index 735d7aa59..1b73e0d1e 100644 --- a/product/neoverse-rd/rdn2/module/apremap/CMakeLists.txt +++ b/product/neoverse-rd/rdn2/module/apremap/CMakeLists.txt @@ -1,6 +1,6 @@ # # Arm SCP/MCP Software -# Copyright (c) 2021, Arm Limited and Contributors. All rights reserved. +# Copyright (c) 2021-2024, Arm Limited and Contributors. All rights reserved. # # SPDX-License-Identifier: BSD-3-Clause # @@ -8,7 +8,8 @@ add_library(${SCP_MODULE_TARGET} SCP_MODULE) target_include_directories(${SCP_MODULE_TARGET} - PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include") + PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include" + PUBLIC "${CMAKE_SOURCE_DIR}/product/neoverse-rd/interface/address_remapper/") target_sources(${SCP_MODULE_TARGET} PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/src/mod_apremap.c") diff --git a/product/neoverse-rd/rdn2/module/apremap/include/mod_apremap.h b/product/neoverse-rd/rdn2/module/apremap/include/mod_apremap.h index 5f547eddc..d0431afbb 100644 --- a/product/neoverse-rd/rdn2/module/apremap/include/mod_apremap.h +++ b/product/neoverse-rd/rdn2/module/apremap/include/mod_apremap.h @@ -1,6 +1,6 @@ /* * Arm SCP/MCP Software - * Copyright (c) 2020-2021, Arm Limited and Contributors. All rights reserved. + * Copyright (c) 2020-2024, Arm Limited and Contributors. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause * @@ -11,6 +11,8 @@ #ifndef MOD_APREMAP_H #define MOD_APREMAP_H +#include + #include #include @@ -50,79 +52,6 @@ struct mod_apremap_config { uintptr_t base; }; -/*! - * \brief API to read/write the AP memory space. - */ -struct mod_apremap_rw_api { - /*! - * \brief Read a byte from Application Processor's address - * - * \param addr Address of the AP address space - * - * \return Byte value from the AP address - */ - uint8_t (*mmio_ap_mem_read_8)(uint64_t addr); - - /*! - * \brief Read a halfword from Application Processor's address - * - * \param addr Address of the AP address space - * - * \return Halfword value from the AP address - */ - uint16_t (*mmio_ap_mem_read_16)(uint64_t addr); - - /*! - * \brief Read a word from Application Processor's address - * - * \param addr Address of the AP address space - * - * \return Word value from the AP address - */ - uint32_t (*mmio_ap_mem_read_32)(uint64_t addr); - - /*! - * \brief Read doubleword from Application Processor's address - * - * \param addr Address of the AP address space - * - * \return Doubleword value from the AP address - */ - uint64_t (*mmio_ap_mem_read_64)(uint64_t addr); - - /*! - * \brief Write a byte to Application Processor's address - * - * \param addr Address of the AP address space - * \param value Byte value to be written - */ - void (*mmio_ap_mem_write_8)(uint64_t addr, uint8_t value); - - /*! - * \brief Write a halfword to Application Processor's address - * - * \param addr Address of the AP address space - * \param value Halfword value to be written - */ - void (*mmio_ap_mem_write_16)(uint64_t addr, uint16_t value); - - /*! - * \brief Write a word to Application Processor's address - * - * \param addr Address of the AP address space - * \param value Word value to be written - */ - void (*mmio_ap_mem_write_32)(uint64_t addr, uint32_t value); - - /*! - * \brief Write doubleword to Application Processor's address - * - * \param addr Address of the AP address space - * \param value Doubleword value to be written - */ - void (*mmio_ap_mem_write_64)(uint64_t addr, uint64_t value); -}; - /*! * \brief API to enable/disable the CMN address translation. */ diff --git a/product/neoverse-rd/rdn2/module/apremap/src/mod_apremap.c b/product/neoverse-rd/rdn2/module/apremap/src/mod_apremap.c index 32007570a..026b0e942 100644 --- a/product/neoverse-rd/rdn2/module/apremap/src/mod_apremap.c +++ b/product/neoverse-rd/rdn2/module/apremap/src/mod_apremap.c @@ -1,6 +1,6 @@ /* * Arm SCP/MCP Software - * Copyright (c) 2020-2023, Arm Limited and Contributors. All rights reserved. + * Copyright (c) 2020-2024, Arm Limited and Contributors. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause * @@ -419,15 +419,15 @@ static void mmio_ap_mem_write_64(uint64_t addr, uint64_t value) /* * API to be used by a module that needs to read/write AP memory region. */ -static struct mod_apremap_rw_api apremap_mem_api = { - .mmio_ap_mem_read_8 = mmio_ap_mem_read_8, - .mmio_ap_mem_read_16 = mmio_ap_mem_read_16, - .mmio_ap_mem_read_32 = mmio_ap_mem_read_32, - .mmio_ap_mem_read_64 = mmio_ap_mem_read_64, - .mmio_ap_mem_write_8 = mmio_ap_mem_write_8, - .mmio_ap_mem_write_16 = mmio_ap_mem_write_16, - .mmio_ap_mem_write_32 = mmio_ap_mem_write_32, - .mmio_ap_mem_write_64 = mmio_ap_mem_write_64, +static struct interface_address_remapper_rw_api apremap_mem_api = { + .read8 = mmio_ap_mem_read_8, + .read16 = mmio_ap_mem_read_16, + .read32 = mmio_ap_mem_read_32, + .read64 = mmio_ap_mem_read_64, + .write8 = mmio_ap_mem_write_8, + .write16 = mmio_ap_mem_write_16, + .write32 = mmio_ap_mem_write_32, + .write64 = mmio_ap_mem_write_64, }; /* API to enable/disable CMN Address Translation */