[alsa-devel] [PATCH 06/16] ASoC: Intel: Skylake: Add support for Load/Unload IPCs
Vinod Koul
vinod.koul at intel.com
Wed Dec 2 06:07:02 CET 2015
On Tue, Dec 01, 2015 at 10:58:54PM +0000, Mark Brown wrote:
> On Sat, Nov 28, 2015 at 03:01:51PM +0530, Vinod Koul wrote:
>
> > Some firmware modules can be loaded and unloaded to/from DSP.
> > This can be done by invoking IPCs Load module and unload module
> > respectively. So this patch starts this by adding support for
> > these IPCs
>
> In what way does it do this?
By adding skl_ipc_load_modules and skl_ipc_unload_modules helpers to send
these IPCs to DSP
>
> > +int skl_ipc_load_modules(struct sst_generic_ipc *ipc,
> > + u8 module_cnt, void *data)
> > +{
> > + struct skl_ipc_header header = {0};
> > + u64 *ipc_header = (u64 *)(&header);
> > + int ret;
> > +
> > + header.primary = IPC_MSG_TARGET(IPC_FW_GEN_MSG);
> > + header.primary |= IPC_MSG_DIR(IPC_MSG_REQUEST);
> > + header.primary |= IPC_GLB_TYPE(IPC_GLB_LOAD_MULTIPLE_MODS);
> > + header.primary |= IPC_LOAD_MODULE_CNT(module_cnt);
> > +
> > + ret = sst_ipc_tx_message_wait(ipc, *ipc_header, data,
> > + (sizeof(u16) * module_cnt), NULL, 0);
>
> So the multiple modules are a block of at most 255 16 bit words? That's
> a bit surprising - is it really a count of the number of modules or
> rather the size of the block of data that's being squirted at the DSP?
Nope, as you would think that does not make sense :)
So we do not point to module memory here, we are sending IPC saying module
X, Y and Z are being loaded, data contains the module IDs only. The IDs are
16 bits so sizeof(u16) and number of modules pass as arg
The modules are transfered with Code Loader DMA which invokes this as IPC
after preparing DMA from Host.
This way IPC allows us to load One or multiple modules at one shot
>
> > +int skl_ipc_unload_modules(struct sst_generic_ipc *ipc, u8 module_cnt,
> > + void *data)
> > +{
> > + struct skl_ipc_header header = {0};
> > + u64 *ipc_header = (u64 *)(&header);
> > + int ret;
> > +
> > + header.primary = IPC_MSG_TARGET(IPC_FW_GEN_MSG);
> > + header.primary |= IPC_MSG_DIR(IPC_MSG_REQUEST);
> > + header.primary |= IPC_GLB_TYPE(IPC_GLB_UNLOAD_MULTIPLE_MODS);
> > + header.primary |= IPC_LOAD_MODULE_CNT(module_cnt);
> > +
> > + ret = sst_ipc_tx_message_wait(ipc, *ipc_header, data,
> > + (sizeof(u16) * module_cnt), NULL, 0);
>
> This seems weird... what's the data that's getting passed in? This
> doesn't seem to be actually managing anything, it's just some very basic
> message formatting.
Here we are asking to remove module represented by IDs in data buffer.
Yes this is only messaging part of module load/unload
Thanks
--
~Vinod
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://mailman.alsa-project.org/pipermail/alsa-devel/attachments/20151202/10b161ac/attachment.sig>
More information about the Alsa-devel
mailing list