adsp_helper.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * Copyright (c) 2021 MediaTek Corporation. All rights reserved.
  4. */
  5. #ifndef __MTK_ADSP_HELPER_H__
  6. #define __MTK_ADSP_HELPER_H__
  7. #include <linux/firmware/mediatek/mtk-adsp-ipc.h>
  8. /*
  9. * Global important adsp data structure.
  10. */
  11. struct mtk_adsp_chip_info {
  12. phys_addr_t pa_sram;
  13. phys_addr_t pa_dram; /* adsp dram physical base */
  14. phys_addr_t pa_cfgreg;
  15. u32 sramsize;
  16. u32 dramsize;
  17. u32 cfgregsize;
  18. void __iomem *va_sram; /* corresponding to pa_sram */
  19. void __iomem *va_dram; /* corresponding to pa_dram */
  20. void __iomem *va_cfgreg;
  21. phys_addr_t adsp_bootup_addr;
  22. int dram_offset; /*dram offset between system and dsp view*/
  23. phys_addr_t pa_secreg;
  24. u32 secregsize;
  25. void __iomem *va_secreg;
  26. phys_addr_t pa_busreg;
  27. u32 busregsize;
  28. void __iomem *va_busreg;
  29. };
  30. struct adsp_priv {
  31. struct device *dev;
  32. struct snd_sof_dev *sdev;
  33. struct mtk_adsp_ipc *dsp_ipc;
  34. struct platform_device *ipc_dev;
  35. struct mtk_adsp_chip_info *adsp;
  36. struct clk **clk;
  37. u32 (*ap2adsp_addr)(u32 addr, void *data);
  38. u32 (*adsp2ap_addr)(u32 addr, void *data);
  39. void *private_data;
  40. };
  41. #endif