css_mhu_doorbell.c 899 Bytes
Newer Older
1
/*
Paul Beesley's avatar
Paul Beesley committed
2
 * Copyright (c) 2014-2019, ARM Limited and Contributors. All rights reserved.
3
4
5
6
7
 *
 * SPDX-License-Identifier: BSD-3-Clause
 */

#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

Roberto Vargas's avatar
Roberto Vargas committed
13
void mhu_ring_doorbell(struct scmi_channel_plat_info *plat_info)
14
15
16
17
18
19
20
{
	MHU_RING_DOORBELL(plat_info->db_reg_addr,
			plat_info->db_modify_mask,
			plat_info->db_preserve_mask);
	return;
}

Roberto Vargas's avatar
Roberto Vargas committed
21
void mhuv2_ring_doorbell(struct scmi_channel_plat_info *plat_info)
22
23
24
25
26
27
28
29
30
31
32
33
{
	/* wake receiver */
	MHU_V2_ACCESS_REQUEST(MHUV2_BASE_ADDR);

	/* wait for receiver to acknowledge its ready */
	while (MHU_V2_IS_ACCESS_READY(MHUV2_BASE_ADDR) == 0)
		;

	MHU_RING_DOORBELL(plat_info->db_reg_addr,
			plat_info->db_modify_mask,
			plat_info->db_preserve_mask);

Paul Beesley's avatar
Paul Beesley committed
34
	/* clear the access request for the receiver */
35
36
37
38
	MHU_V2_CLEAR_REQUEST(MHUV2_BASE_ADDR);

	return;
}