css_mhu_doorbell.c 939 B

12345678910111213141516171819202122232425262728293031323334353637
  1. /*
  2. * Copyright (c) 2014-2020, ARM Limited and Contributors. All rights reserved.
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #include <platform_def.h>
  7. #include <arch_helpers.h>
  8. #include <drivers/arm/css/css_mhu_doorbell.h>
  9. #include <drivers/arm/css/scmi.h>
  10. void mhu_ring_doorbell(struct scmi_channel_plat_info *plat_info)
  11. {
  12. MHU_RING_DOORBELL(plat_info->db_reg_addr,
  13. plat_info->db_modify_mask,
  14. plat_info->db_preserve_mask);
  15. }
  16. void mhuv2_ring_doorbell(struct scmi_channel_plat_info *plat_info)
  17. {
  18. uintptr_t mhuv2_base = plat_info->db_reg_addr & MHU_V2_FRAME_BASE_MASK;
  19. /* wake receiver */
  20. MHU_V2_ACCESS_REQUEST(mhuv2_base);
  21. /* wait for receiver to acknowledge its ready */
  22. while (MHU_V2_IS_ACCESS_READY(mhuv2_base) == 0)
  23. ;
  24. MHU_RING_DOORBELL(plat_info->db_reg_addr,
  25. plat_info->db_modify_mask,
  26. plat_info->db_preserve_mask);
  27. /* clear the access request for the receiver */
  28. MHU_V2_CLEAR_REQUEST(mhuv2_base);
  29. }