audio_domain.c 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /*
  2. * Copyright (c) 2022, Mediatek Inc. All rights reserved.
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #include <errno.h>
  7. #include <common/debug.h>
  8. #include <audio.h>
  9. #include <mt_audio_private.h>
  10. #include <mtk_mmap_pool.h>
  11. #include <platform_def.h>
  12. #include <spm_reg.h>
  13. #define MODULE_TAG "[AUDIO_DOMAIN]"
  14. int32_t set_audio_domain_sidebands(void)
  15. {
  16. uint32_t val = mmio_read_32(PWR_STATUS);
  17. if ((val & BIT(SPM_PWR_STATUS_AUDIO_BIT)) == 0) {
  18. ERROR("%s: %s, pwr_status=0x%x, w/o [%d]AUDIO!\n",
  19. MODULE_TAG, __func__, val, SPM_PWR_STATUS_AUDIO_BIT);
  20. return -EIO;
  21. }
  22. mmio_write_32(AFE_SE_SECURE_CON, 0x0);
  23. mmio_write_32(AFE_SECURE_SIDEBAND0, 0x0);
  24. mmio_write_32(AFE_SECURE_SIDEBAND1, 0x0);
  25. mmio_write_32(AFE_SECURE_SIDEBAND2, 0x0);
  26. mmio_write_32(AFE_SECURE_SIDEBAND3, 0x0);
  27. VERBOSE("%s: %s, SE_SECURE_CON=0x%x, SIDEBAND0/1/2/3=0x%x/0x%x/0x%x/0x%x\n",
  28. MODULE_TAG, __func__,
  29. mmio_read_32(AFE_SE_SECURE_CON),
  30. mmio_read_32(AFE_SECURE_SIDEBAND0),
  31. mmio_read_32(AFE_SECURE_SIDEBAND1),
  32. mmio_read_32(AFE_SECURE_SIDEBAND2),
  33. mmio_read_32(AFE_SECURE_SIDEBAND3));
  34. return 0;
  35. }