sst-dsp-priv.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Intel Smart Sound Technology
  4. *
  5. * Copyright (C) 2013, Intel Corporation. All rights reserved.
  6. */
  7. #ifndef __SOUND_SOC_SST_DSP_PRIV_H
  8. #define __SOUND_SOC_SST_DSP_PRIV_H
  9. #include <linux/kernel.h>
  10. #include <linux/types.h>
  11. #include <linux/interrupt.h>
  12. #include <linux/firmware.h>
  13. #include "../skylake/skl-sst-dsp.h"
  14. /*
  15. * DSP Operations exported by platform Audio DSP driver.
  16. */
  17. struct sst_ops {
  18. /* Shim IO */
  19. void (*write)(void __iomem *addr, u32 offset, u32 value);
  20. u32 (*read)(void __iomem *addr, u32 offset);
  21. /* IRQ handlers */
  22. irqreturn_t (*irq_handler)(int irq, void *context);
  23. /* SST init and free */
  24. int (*init)(struct sst_dsp *sst);
  25. void (*free)(struct sst_dsp *sst);
  26. };
  27. /*
  28. * Audio DSP memory offsets and addresses.
  29. */
  30. struct sst_addr {
  31. u32 sram0_base;
  32. u32 sram1_base;
  33. u32 w0_stat_sz;
  34. u32 w0_up_sz;
  35. void __iomem *lpe;
  36. void __iomem *shim;
  37. };
  38. /*
  39. * Audio DSP Mailbox configuration.
  40. */
  41. struct sst_mailbox {
  42. void __iomem *in_base;
  43. void __iomem *out_base;
  44. size_t in_size;
  45. size_t out_size;
  46. };
  47. /*
  48. * Generic SST Shim Interface.
  49. */
  50. struct sst_dsp {
  51. /* Shared for all platforms */
  52. /* runtime */
  53. struct sst_dsp_device *sst_dev;
  54. spinlock_t spinlock; /* IPC locking */
  55. struct mutex mutex; /* DSP FW lock */
  56. struct device *dev;
  57. void *thread_context;
  58. int irq;
  59. u32 id;
  60. /* operations */
  61. struct sst_ops *ops;
  62. /* debug FS */
  63. struct dentry *debugfs_root;
  64. /* base addresses */
  65. struct sst_addr addr;
  66. /* mailbox */
  67. struct sst_mailbox mailbox;
  68. /* SST FW files loaded and their modules */
  69. struct list_head module_list;
  70. /* SKL data */
  71. const char *fw_name;
  72. /* To allocate CL dma buffers */
  73. struct skl_dsp_loader_ops dsp_ops;
  74. struct skl_dsp_fw_ops fw_ops;
  75. int sst_state;
  76. struct skl_cl_dev cl_dev;
  77. u32 intr_status;
  78. const struct firmware *fw;
  79. struct snd_dma_buffer dmab;
  80. };
  81. #endif