aboutsummaryrefslogtreecommitdiff
path: root/plat/arm/css/drivers/mhu/css_mhu_doorbell.c
blob: b3203c2a75dde08575086f6a6d8c2e35b7836eed (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/*
 * Copyright (c) 2014-2018, ARM Limited and Contributors. All rights reserved.
 *
 * SPDX-License-Identifier: BSD-3-Clause
 */

#include <platform_def.h>

#include <arch_helpers.h>

#include "css_mhu_doorbell.h"
#include "../scmi/scmi.h"

void mhu_ring_doorbell(struct scmi_channel_plat_info *plat_info)
{
	MHU_RING_DOORBELL(plat_info->db_reg_addr,
			plat_info->db_modify_mask,
			plat_info->db_preserve_mask);
	return;
}

void mhuv2_ring_doorbell(struct scmi_channel_plat_info *plat_info)
{
	/* 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);

	/* clear the access request for the recevier */
	MHU_V2_CLEAR_REQUEST(MHUV2_BASE_ADDR);

	return;
}