• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2014-2019, ARM Limited and Contributors. All rights reserved.
3  *
4  * SPDX-License-Identifier: BSD-3-Clause
5  */
6 
7 #include <platform_def.h>
8 
9 #include <arch_helpers.h>
10 #include <drivers/arm/css/css_mhu_doorbell.h>
11 #include <drivers/arm/css/scmi.h>
12 
mhu_ring_doorbell(struct scmi_channel_plat_info * plat_info)13 void mhu_ring_doorbell(struct scmi_channel_plat_info *plat_info)
14 {
15 	MHU_RING_DOORBELL(plat_info->db_reg_addr,
16 			plat_info->db_modify_mask,
17 			plat_info->db_preserve_mask);
18 	return;
19 }
20 
mhuv2_ring_doorbell(struct scmi_channel_plat_info * plat_info)21 void mhuv2_ring_doorbell(struct scmi_channel_plat_info *plat_info)
22 {
23 	/* wake receiver */
24 	MHU_V2_ACCESS_REQUEST(MHUV2_BASE_ADDR);
25 
26 	/* wait for receiver to acknowledge its ready */
27 	while (MHU_V2_IS_ACCESS_READY(MHUV2_BASE_ADDR) == 0)
28 		;
29 
30 	MHU_RING_DOORBELL(plat_info->db_reg_addr,
31 			plat_info->db_modify_mask,
32 			plat_info->db_preserve_mask);
33 
34 	/* clear the access request for the receiver */
35 	MHU_V2_CLEAR_REQUEST(MHUV2_BASE_ADDR);
36 
37 	return;
38 }
39