2017-11-23 08:53:21 +00:00
|
|
|
/*
|
2019-12-31 04:44:32 +00:00
|
|
|
* Copyright (c) 2014-2020, ARM Limited and Contributors. All rights reserved.
|
2017-11-23 08:53:21 +00:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <platform_def.h>
|
2018-12-14 00:18:21 +00:00
|
|
|
|
|
|
|
#include <arch_helpers.h>
|
2019-01-23 21:08:43 +00:00
|
|
|
#include <drivers/arm/css/css_mhu_doorbell.h>
|
2019-01-23 20:37:32 +00:00
|
|
|
#include <drivers/arm/css/scmi.h>
|
2018-12-14 00:18:21 +00:00
|
|
|
|
2018-02-12 12:36:17 +00:00
|
|
|
void mhu_ring_doorbell(struct scmi_channel_plat_info *plat_info)
|
2017-11-23 08:53:21 +00:00
|
|
|
{
|
|
|
|
MHU_RING_DOORBELL(plat_info->db_reg_addr,
|
|
|
|
plat_info->db_modify_mask,
|
|
|
|
plat_info->db_preserve_mask);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2018-02-12 12:36:17 +00:00
|
|
|
void mhuv2_ring_doorbell(struct scmi_channel_plat_info *plat_info)
|
2017-11-23 08:53:21 +00:00
|
|
|
{
|
2019-12-31 04:44:32 +00:00
|
|
|
uintptr_t mhuv2_base = plat_info->db_reg_addr & MHU_V2_FRAME_BASE_MASK;
|
|
|
|
|
2017-11-23 08:53:21 +00:00
|
|
|
/* wake receiver */
|
2019-12-31 04:44:32 +00:00
|
|
|
MHU_V2_ACCESS_REQUEST(mhuv2_base);
|
2017-11-23 08:53:21 +00:00
|
|
|
|
|
|
|
/* wait for receiver to acknowledge its ready */
|
2019-12-31 04:44:32 +00:00
|
|
|
while (MHU_V2_IS_ACCESS_READY(mhuv2_base) == 0)
|
2017-11-23 08:53:21 +00:00
|
|
|
;
|
|
|
|
|
|
|
|
MHU_RING_DOORBELL(plat_info->db_reg_addr,
|
|
|
|
plat_info->db_modify_mask,
|
|
|
|
plat_info->db_preserve_mask);
|
|
|
|
|
2019-01-11 18:26:51 +00:00
|
|
|
/* clear the access request for the receiver */
|
2019-12-31 04:44:32 +00:00
|
|
|
MHU_V2_CLEAR_REQUEST(mhuv2_base);
|
2017-11-23 08:53:21 +00:00
|
|
|
|
|
|
|
return;
|
|
|
|
}
|