[Sound-open-firmware] [PATCH v3 2/6] dma: update platform DMAC definitions with capabilities

Ranjani Sridharan ranjani.sridharan at linux.intel.com
Mon Jun 11 05:27:22 CEST 2018


On Sun, 2018-06-10 at 21:02 +0100, Liam Girdwood wrote:
> On Sun, 2018-06-10 at 20:51 +0100, Liam Girdwood wrote:
> > > diff --git a/src/include/sof/dma.h b/src/include/sof/dma.h
> > > index af15d14..4bc178e 100644
> > > --- a/src/include/sof/dma.h
> > > +++ b/src/include/sof/dma.h
> > > @@ -48,6 +48,21 @@ enum dma_copy_dir {
> > >        DMA_DIR_DEV_TO_DEV,
> > >   };
> 
> Thinking more on this, I think we just need direction mask, caps mask
> and device
> mask.
> 
> We can remove the dir enum too.
> 
> > >   
> > > +
> > > +/* DMA capabilities bitmasks used to define DMA copy direction
> > > */
> > > +#define DMA_CAP_MEM_TO_MEM   (1 << 0)
> > > +#define DMA_CAP_HMEM_TO_LMEM (1 << 1)
> > > +#define DMA_CAP_LMEM_TO_HMEM (1 << 2)
> > > +#define DMA_CAP_MEM_TO_DEV   (1 << 3)
> > > +#define DMA_CAP_DEV_TO_MEM   (1 << 4)
> > > +#define DMA_CAP_DEV_TO_DEV   (1 << 5)
> > > +
> 
> These are direction so would be DMA_DIR_blah
> 
> > > +/* DMA capabilities bitmasks used to define the type of DMA */
> > > +#define DMA_CAP_GP_LP                (1 << 6)
> > > +#define DMA_CAP_GP_HP                (1 << 7)
> 
> These two above are caps.
> 
> > > +#define DMA_CAP_HDA_HOST     (1 << 8)
> > > +#define DMA_CAP_HDA_LINK     (1 << 9)
> > > +
> > 
> > Thinking more, it may be better to have :-
> > 
> > #define DMA_CAP_HDA
> > #define DMA_CAP_SSP
> > #define DMA_CAP_DMIC
> 
> These would be DMAC_DEV_HDA, DMA_DEV_SSP, etc

This makes a lot of sense now. Thanks!
> 
> > 
> > These can be used in conjunction with the other caps when
> > requesting a DMAC
> > since HDA_HOST and HDA_LINK is very Intel specific.
> > 
> > >   /* DMA IRQ types */
> > >   #define DMA_IRQ_TYPE_BLOCK   (1 << 0)
> > >   #define DMA_IRQ_TYPE_LLIST   (1 << 1)
> > > @@ -118,6 +133,7 @@ struct dma_ops {
> > >   /* DMA platform data */
> > >   struct dma_plat_data {
> > >        uint32_t id;
> > > +     uint32_t dma_cap;
> 
> uint32_t dir;	/* bit mask of directions */
> uint32_t caps;  /* bitmask of caps */
> uint32_t devs;	/* bitmask of supported devs */
> 
> > 
> > lets just call this caps (since dma is implied already)
> 
> Liam


More information about the Sound-open-firmware mailing list