Commit a9aa6fb3 authored by Cezary Rojewski's avatar Cezary Rojewski Committed by Mark Brown

ASoC: Intel: catpt: Firmware loading and context restore

For Lynxpoint and Wildcat Point solution, is it host's responsibility to
allocate SRAM regions and ensure those already taken are not overwritten
with other data until released. Blocks are transferred to SRAM - either
IRAM or DRAM - via DW DMA controller. Once basefw is booted, ownership
of DMA transfer is lost in favour of DSP.

Hosts reponsibilities don't end on initial block allocation and binary
transfer. During Dx transitions host must store FW runtime context from
DRAM before putting AudioDSP subsystem into lower power state. Said
context gets flashed after D0 entry to bring DSP right where it was just
before suspending.

Load and restore procedures are finalized with SRAM power gating and
adequate clock level selection. This power gates unused EBBs and clock
speed effectively reducing power consumption.
Signed-off-by: default avatarCezary Rojewski <cezary.rojewski@intel.com>
Reviewed-by: default avatarAndy Shevchenko <andriy.shevchenko@intel.com>
Reviewed-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20200929141247.8058-6-cezary.rojewski@intel.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent ba202a7b
...@@ -100,9 +100,16 @@ struct catpt_dev { ...@@ -100,9 +100,16 @@ struct catpt_dev {
struct resource iram; struct resource iram;
struct resource *scratch; struct resource *scratch;
struct catpt_mixer_stream_info mixer;
struct catpt_module_type modules[CATPT_MODULE_COUNT];
struct catpt_ssp_device_format devfmt[CATPT_SSP_COUNT];
struct list_head stream_list; struct list_head stream_list;
spinlock_t list_lock; spinlock_t list_lock;
struct mutex clk_mutex; struct mutex clk_mutex;
struct catpt_dx_context dx_ctx;
void *dxbuf_vaddr;
dma_addr_t dxbuf_paddr;
}; };
int catpt_dmac_probe(struct catpt_dev *cdev); int catpt_dmac_probe(struct catpt_dev *cdev);
...@@ -141,6 +148,11 @@ int catpt_dsp_send_msg_timeout(struct catpt_dev *cdev, ...@@ -141,6 +148,11 @@ int catpt_dsp_send_msg_timeout(struct catpt_dev *cdev,
int catpt_dsp_send_msg(struct catpt_dev *cdev, struct catpt_ipc_msg request, int catpt_dsp_send_msg(struct catpt_dev *cdev, struct catpt_ipc_msg request,
struct catpt_ipc_msg *reply); struct catpt_ipc_msg *reply);
int catpt_first_boot_firmware(struct catpt_dev *cdev);
int catpt_boot_firmware(struct catpt_dev *cdev, bool restore);
int catpt_store_streams_context(struct catpt_dev *cdev, struct dma_chan *chan);
int catpt_store_module_states(struct catpt_dev *cdev, struct dma_chan *chan);
int catpt_store_memdumps(struct catpt_dev *cdev, struct dma_chan *chan);
int catpt_coredump(struct catpt_dev *cdev); int catpt_coredump(struct catpt_dev *cdev);
#include <sound/memalloc.h> #include <sound/memalloc.h>
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment