Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-only */
0002 /*
0003  * Intel Smart Sound Technology
0004  *
0005  * Copyright (C) 2013, Intel Corporation. All rights reserved.
0006  */
0007 
0008 #ifndef __SOUND_SOC_SST_DSP_PRIV_H
0009 #define __SOUND_SOC_SST_DSP_PRIV_H
0010 
0011 #include <linux/kernel.h>
0012 #include <linux/types.h>
0013 #include <linux/interrupt.h>
0014 #include <linux/firmware.h>
0015 
0016 #include "../skylake/skl-sst-dsp.h"
0017 
0018 /*
0019  * DSP Operations exported by platform Audio DSP driver.
0020  */
0021 struct sst_ops {
0022     /* Shim IO */
0023     void (*write)(void __iomem *addr, u32 offset, u32 value);
0024     u32 (*read)(void __iomem *addr, u32 offset);
0025 
0026     /* IRQ handlers */
0027     irqreturn_t (*irq_handler)(int irq, void *context);
0028 
0029     /* SST init and free */
0030     int (*init)(struct sst_dsp *sst);
0031     void (*free)(struct sst_dsp *sst);
0032 };
0033 
0034 /*
0035  * Audio DSP memory offsets and addresses.
0036  */
0037 struct sst_addr {
0038     u32 sram0_base;
0039     u32 sram1_base;
0040     u32 w0_stat_sz;
0041     u32 w0_up_sz;
0042     void __iomem *lpe;
0043     void __iomem *shim;
0044 };
0045 
0046 /*
0047  * Audio DSP Mailbox configuration.
0048  */
0049 struct sst_mailbox {
0050     void __iomem *in_base;
0051     void __iomem *out_base;
0052     size_t in_size;
0053     size_t out_size;
0054 };
0055 
0056 /*
0057  * Generic SST Shim Interface.
0058  */
0059 struct sst_dsp {
0060 
0061     /* Shared for all platforms */
0062 
0063     /* runtime */
0064     struct sst_dsp_device *sst_dev;
0065     spinlock_t spinlock;    /* IPC locking */
0066     struct mutex mutex; /* DSP FW lock */
0067     struct device *dev;
0068     void *thread_context;
0069     int irq;
0070     u32 id;
0071 
0072     /* operations */
0073     struct sst_ops *ops;
0074 
0075     /* debug FS */
0076     struct dentry *debugfs_root;
0077 
0078     /* base addresses */
0079     struct sst_addr addr;
0080 
0081     /* mailbox */
0082     struct sst_mailbox mailbox;
0083 
0084     /* SST FW files loaded and their modules */
0085     struct list_head module_list;
0086 
0087     /* SKL data */
0088 
0089     const char *fw_name;
0090 
0091     /* To allocate CL dma buffers */
0092     struct skl_dsp_loader_ops dsp_ops;
0093     struct skl_dsp_fw_ops fw_ops;
0094     int sst_state;
0095     struct skl_cl_dev cl_dev;
0096     u32 intr_status;
0097     const struct firmware *fw;
0098     struct snd_dma_buffer dmab;
0099 };
0100 
0101 #endif