From 4f65c0beaad1a73e45919eb0b450a86c4f58de27 Mon Sep 17 00:00:00 2001 From: Leo Yan Date: Wed, 22 May 2024 15:42:46 +0100 Subject: [PATCH] feat(tc): add MHUv3 doorbell support on TC3 Enables the doorbell channels in MHUv3 for TC3. Change-Id: Ib4f47df3e54f9182939ea6c1d8bc1a66a3c03094 Signed-off-by: Boyan Karatotev Signed-off-by: Leo Yan --- include/drivers/arm/css/css_mhu_doorbell.h | 6 +++++- plat/arm/board/tc/tc_bl31_setup.c | 10 ++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/include/drivers/arm/css/css_mhu_doorbell.h b/include/drivers/arm/css/css_mhu_doorbell.h index 88302fd7b..d6c1a2a81 100644 --- a/include/drivers/arm/css/css_mhu_doorbell.h +++ b/include/drivers/arm/css/css_mhu_doorbell.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2020, ARM Limited and Contributors. All rights reserved. + * Copyright (c) 2014-2024, Arm Limited and Contributors. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ @@ -22,6 +22,10 @@ #define SENDER_REG_STAT(_channel) (0x20 * (_channel)) #define SENDER_REG_SET(_channel) ((0x20 * (_channel)) + 0xC) +#define MHU_V3_PBX_PDBCW_PAGE_OFFSET UL(0x1000) +#define MHU_V3_SENDER_REG_SET(_channel) (MHU_V3_PBX_PDBCW_PAGE_OFFSET + \ + SENDER_REG_SET(_channel)) + /* Helper macro to ring doorbell */ #define MHU_RING_DOORBELL(addr, modify_mask, preserve_mask) do { \ uint32_t db = mmio_read_32(addr) & (preserve_mask); \ diff --git a/plat/arm/board/tc/tc_bl31_setup.c b/plat/arm/board/tc/tc_bl31_setup.c index 909a8b56a..d6b0311db 100644 --- a/plat/arm/board/tc/tc_bl31_setup.c +++ b/plat/arm/board/tc/tc_bl31_setup.c @@ -50,6 +50,7 @@ psa_status_t mbedtls_psa_external_get_random( } #endif /* PLATFORM_TEST_TFM_TESTSUITE */ +#if TARGET_PLATFORM <= 2 static scmi_channel_plat_info_t tc_scmi_plat_info = { .scmi_mbx_mem = CSS_SCMI_PAYLOAD_BASE, .db_reg_addr = PLAT_CSS_MHU_BASE + SENDER_REG_SET(0), @@ -57,6 +58,15 @@ static scmi_channel_plat_info_t tc_scmi_plat_info = { .db_modify_mask = 0x1, .ring_doorbell = &mhuv2_ring_doorbell, }; +#elif TARGET_PLATFORM == 3 +static scmi_channel_plat_info_t tc_scmi_plat_info = { + .scmi_mbx_mem = CSS_SCMI_PAYLOAD_BASE, + .db_reg_addr = PLAT_CSS_MHU_BASE + MHU_V3_SENDER_REG_SET(0), + .db_preserve_mask = 0xfffffffe, + .db_modify_mask = 0x1, + .ring_doorbell = &mhu_ring_doorbell, +}; +#endif void bl31_platform_setup(void) {