Samarth Parikh | 59cfa13 | 2017-11-23 14:23:21 +0530 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2014-2018, ARM Limited and Contributors. All rights reserved. |
| 3 | * |
| 4 | * SPDX-License-Identifier: BSD-3-Clause |
| 5 | */ |
| 6 | |
| 7 | #include <arch_helpers.h> |
| 8 | #include <platform_def.h> |
| 9 | #include "css_mhu_doorbell.h" |
| 10 | #include "../scmi/scmi.h" |
| 11 | |
Roberto Vargas | 85664f5 | 2018-02-12 12:36:17 +0000 | [diff] [blame] | 12 | void mhu_ring_doorbell(struct scmi_channel_plat_info *plat_info) |
Samarth Parikh | 59cfa13 | 2017-11-23 14:23:21 +0530 | [diff] [blame] | 13 | { |
| 14 | MHU_RING_DOORBELL(plat_info->db_reg_addr, |
| 15 | plat_info->db_modify_mask, |
| 16 | plat_info->db_preserve_mask); |
| 17 | return; |
| 18 | } |
| 19 | |
Roberto Vargas | 85664f5 | 2018-02-12 12:36:17 +0000 | [diff] [blame] | 20 | void mhuv2_ring_doorbell(struct scmi_channel_plat_info *plat_info) |
Samarth Parikh | 59cfa13 | 2017-11-23 14:23:21 +0530 | [diff] [blame] | 21 | { |
| 22 | /* wake receiver */ |
| 23 | MHU_V2_ACCESS_REQUEST(MHUV2_BASE_ADDR); |
| 24 | |
| 25 | /* wait for receiver to acknowledge its ready */ |
| 26 | while (MHU_V2_IS_ACCESS_READY(MHUV2_BASE_ADDR) == 0) |
| 27 | ; |
| 28 | |
| 29 | MHU_RING_DOORBELL(plat_info->db_reg_addr, |
| 30 | plat_info->db_modify_mask, |
| 31 | plat_info->db_preserve_mask); |
| 32 | |
| 33 | /* clear the access request for the recevier */ |
| 34 | MHU_V2_CLEAR_REQUEST(MHUV2_BASE_ADDR); |
| 35 | |
| 36 | return; |
| 37 | } |