RE: [PATCH 2/4] dmaengine: vdma: Add support for mulit-channel dma mode

2016-06-28 Thread Appana Durga Kedareswara Rao
Hi Vinod,


 
> > > > > > >  /**
> > > > > > > + * struct xilinx_mcdma_config - DMA Multi channel
> > > > > > > +configuration structure
> > > > > > > + * @tdest: Channel to operate on
> > > > > > > + * @tid:   Channel configuration
> > > > > > > + * @tuser: Tuser configuration
> > > > > > > + * @ax_user: ax_user value
> > > > > > > + * @ax_cache: ax_cache value  */ struct xilinx_mcdma_config
> > > > > > > +{
> > > > > > > + u8 tdest;
> > > > > > > + u8 tid;
> > > > > > > + u8 tuser;
> > > > > > > + u8 ax_user;
> > > > > > > + u8 ax_cache;
> > > > > >
> > > > > > can you describe these in details, what do these do, what are
> > > > > > the values to be programmed?
> > > > >
> > > > > As said above In Multi-Channel Mode each Stream interface can be
> > > > > Configured up to 16 channels each channel is differentiated
> > > > > based on the tdest
> > > > and tid values.
> > > >
> > > > Then why are you not registering 16 channels for this? That should
> > > > give you channel to operate on!
> > >
> > > The number of channels are configurable.
> > > We are registering number of Channels that h/w configured for.
> > >
> > > Will fix in the next version. Will remove this config.
> > > And based on the channel type will configure the h/w.
> >
> > Looking at this you should redesign!
> >
> > The vchan was designed to operate on 'virtual' channels. The hardware
> > channels can be independent of that.
> >
> > Your IP seems to be a good fit for that approach. Do not link the two
> > and separate them. User can have a virtual channel. In your driver,
> > you can manage hardware channels...
> 
> Fixed it in the v2 and posted the v2 series.
> Please go thought it...

Sorry forgot to write explanation.
Without the need of virtual channels fixed it in the driver itself.
During probe based on the number of channels configuring the h/w
Accordingly user no need to aware of this configuration. User can request DMA
Channel in normal way the using dma_request_slave_channel or dma_request_channel
 Posted v2 series please go through it.

Regards,
Kedar.



RE: [PATCH 2/4] dmaengine: vdma: Add support for mulit-channel dma mode

2016-06-28 Thread Appana Durga Kedareswara Rao
Hi Vinod,


 
> > > > > > >  /**
> > > > > > > + * struct xilinx_mcdma_config - DMA Multi channel
> > > > > > > +configuration structure
> > > > > > > + * @tdest: Channel to operate on
> > > > > > > + * @tid:   Channel configuration
> > > > > > > + * @tuser: Tuser configuration
> > > > > > > + * @ax_user: ax_user value
> > > > > > > + * @ax_cache: ax_cache value  */ struct xilinx_mcdma_config
> > > > > > > +{
> > > > > > > + u8 tdest;
> > > > > > > + u8 tid;
> > > > > > > + u8 tuser;
> > > > > > > + u8 ax_user;
> > > > > > > + u8 ax_cache;
> > > > > >
> > > > > > can you describe these in details, what do these do, what are
> > > > > > the values to be programmed?
> > > > >
> > > > > As said above In Multi-Channel Mode each Stream interface can be
> > > > > Configured up to 16 channels each channel is differentiated
> > > > > based on the tdest
> > > > and tid values.
> > > >
> > > > Then why are you not registering 16 channels for this? That should
> > > > give you channel to operate on!
> > >
> > > The number of channels are configurable.
> > > We are registering number of Channels that h/w configured for.
> > >
> > > Will fix in the next version. Will remove this config.
> > > And based on the channel type will configure the h/w.
> >
> > Looking at this you should redesign!
> >
> > The vchan was designed to operate on 'virtual' channels. The hardware
> > channels can be independent of that.
> >
> > Your IP seems to be a good fit for that approach. Do not link the two
> > and separate them. User can have a virtual channel. In your driver,
> > you can manage hardware channels...
> 
> Fixed it in the v2 and posted the v2 series.
> Please go thought it...

Sorry forgot to write explanation.
Without the need of virtual channels fixed it in the driver itself.
During probe based on the number of channels configuring the h/w
Accordingly user no need to aware of this configuration. User can request DMA
Channel in normal way the using dma_request_slave_channel or dma_request_channel
 Posted v2 series please go through it.

Regards,
Kedar.



RE: [PATCH 2/4] dmaengine: vdma: Add support for mulit-channel dma mode

2016-06-27 Thread Appana Durga Kedareswara Rao
Hi Vinod,

Thanks for the review...

> > > > > >  /**
> > > > > > + * struct xilinx_mcdma_config - DMA Multi channel
> > > > > > +configuration structure
> > > > > > + * @tdest: Channel to operate on
> > > > > > + * @tid:   Channel configuration
> > > > > > + * @tuser: Tuser configuration
> > > > > > + * @ax_user: ax_user value
> > > > > > + * @ax_cache: ax_cache value
> > > > > > + */
> > > > > > +struct xilinx_mcdma_config {
> > > > > > +   u8 tdest;
> > > > > > +   u8 tid;
> > > > > > +   u8 tuser;
> > > > > > +   u8 ax_user;
> > > > > > +   u8 ax_cache;
> > > > >
> > > > > can you describe these in details, what do these do, what are
> > > > > the values to be programmed?
> > > >
> > > > As said above In Multi-Channel Mode each Stream interface can be
> > > > Configured up to 16 channels each channel is differentiated based
> > > > on the tdest
> > > and tid values.
> > >
> > > Then why are you not registering 16 channels for this? That should
> > > give you channel to operate on!
> >
> > The number of channels are configurable.
> > We are registering number of Channels that h/w configured for.
> >
> > Will fix in the next version. Will remove this config.
> > And based on the channel type will configure the h/w.
> 
> Looking at this you should redesign!
> 
> The vchan was designed to operate on 'virtual' channels. The hardware channels
> can be independent of that.
> 
> Your IP seems to be a good fit for that approach. Do not link the two and
> separate them. User can have a virtual channel. In your driver, you can manage
> hardware channels...

Fixed it in the v2 and posted the v2 series.
Please go thought it...

> 
> >
> > >
> > > >
> > > > tdest:
> > > > TDEST provides routing information for the data stream.
> > >
> > > pls elobrate
> >
> > Need to configure this with the channel number that We would like to
> > transfer data.
> 
> This should be internal to driver...

Fixed it in the v2 and posted the v2 series.
Please go thought it...

Regards,
Kedar.

> 
> --
> ~Vinod


RE: [PATCH 2/4] dmaengine: vdma: Add support for mulit-channel dma mode

2016-06-27 Thread Appana Durga Kedareswara Rao
Hi Vinod,

Thanks for the review...

> > > > > >  /**
> > > > > > + * struct xilinx_mcdma_config - DMA Multi channel
> > > > > > +configuration structure
> > > > > > + * @tdest: Channel to operate on
> > > > > > + * @tid:   Channel configuration
> > > > > > + * @tuser: Tuser configuration
> > > > > > + * @ax_user: ax_user value
> > > > > > + * @ax_cache: ax_cache value
> > > > > > + */
> > > > > > +struct xilinx_mcdma_config {
> > > > > > +   u8 tdest;
> > > > > > +   u8 tid;
> > > > > > +   u8 tuser;
> > > > > > +   u8 ax_user;
> > > > > > +   u8 ax_cache;
> > > > >
> > > > > can you describe these in details, what do these do, what are
> > > > > the values to be programmed?
> > > >
> > > > As said above In Multi-Channel Mode each Stream interface can be
> > > > Configured up to 16 channels each channel is differentiated based
> > > > on the tdest
> > > and tid values.
> > >
> > > Then why are you not registering 16 channels for this? That should
> > > give you channel to operate on!
> >
> > The number of channels are configurable.
> > We are registering number of Channels that h/w configured for.
> >
> > Will fix in the next version. Will remove this config.
> > And based on the channel type will configure the h/w.
> 
> Looking at this you should redesign!
> 
> The vchan was designed to operate on 'virtual' channels. The hardware channels
> can be independent of that.
> 
> Your IP seems to be a good fit for that approach. Do not link the two and
> separate them. User can have a virtual channel. In your driver, you can manage
> hardware channels...

Fixed it in the v2 and posted the v2 series.
Please go thought it...

> 
> >
> > >
> > > >
> > > > tdest:
> > > > TDEST provides routing information for the data stream.
> > >
> > > pls elobrate
> >
> > Need to configure this with the channel number that We would like to
> > transfer data.
> 
> This should be internal to driver...

Fixed it in the v2 and posted the v2 series.
Please go thought it...

Regards,
Kedar.

> 
> --
> ~Vinod


Re: [PATCH 2/4] dmaengine: vdma: Add support for mulit-channel dma mode

2016-06-27 Thread Vinod Koul
On Wed, Jun 22, 2016 at 07:04:28AM +, Appana Durga Kedareswara Rao wrote:
> > > >
> > > > Can you elobrate what you meant by Multichannel mode? This patch
> > > > seems to do two things, one is to add interleaved dma support and
> > > > something else. Can you explain the latter part?
> > >
> > > AXI DMA has two Stream interfaces (Memory to Stream MM2S and Stream to
> > > Memory S2MM)
> > 
> > what is a stream in this context?
> 
> Stream means I/O transfer (Memory to I/O and I/O to Memory).
> Sorry if I confused you.
> 
> > 
> > > In Multi-Channel dma mode each stream interface can be configured up to 16
> > channels.
> > > In Multi-channel DMA mode IP supports only interleaved transfers (2-D
> > transfers).
> > 
> > 
> > >
> > > >
> > > > >  /**
> > > > > + * struct xilinx_mcdma_config - DMA Multi channel configuration
> > > > > +structure
> > > > > + * @tdest: Channel to operate on
> > > > > + * @tid:   Channel configuration
> > > > > + * @tuser: Tuser configuration
> > > > > + * @ax_user: ax_user value
> > > > > + * @ax_cache: ax_cache value
> > > > > + */
> > > > > +struct xilinx_mcdma_config {
> > > > > + u8 tdest;
> > > > > + u8 tid;
> > > > > + u8 tuser;
> > > > > + u8 ax_user;
> > > > > + u8 ax_cache;
> > > >
> > > > can you describe these in details, what do these do, what are the
> > > > values to be programmed?
> > >
> > > As said above In Multi-Channel Mode each Stream interface can be
> > > Configured up to 16 channels each channel is differentiated based on the 
> > > tdest
> > and tid values.
> > 
> > Then why are you not registering 16 channels for this? That should give you
> > channel to operate on!
> 
> The number of channels are configurable.
> We are registering number of Channels that h/w configured for.
> 
> Will fix in the next version. Will remove this config.
> And based on the channel type will configure the h/w.

Looking at this you should redesign!

The vchan was designed to operate on 'virtual' channels. The hardware
channels can be independent of that.

Your IP seems to be a good fit for that approach. Do not link the two and
separate them. User can have a virtual channel. In your driver, you can
manage hardware channels...

> 
> > 
> > >
> > > tdest:
> > > TDEST provides routing information for the data stream.
> > 
> > pls elobrate
> 
> Need to configure this with the channel number that
> We would like to transfer data.

This should be internal to driver...

-- 
~Vinod


Re: [PATCH 2/4] dmaengine: vdma: Add support for mulit-channel dma mode

2016-06-27 Thread Vinod Koul
On Wed, Jun 22, 2016 at 07:04:28AM +, Appana Durga Kedareswara Rao wrote:
> > > >
> > > > Can you elobrate what you meant by Multichannel mode? This patch
> > > > seems to do two things, one is to add interleaved dma support and
> > > > something else. Can you explain the latter part?
> > >
> > > AXI DMA has two Stream interfaces (Memory to Stream MM2S and Stream to
> > > Memory S2MM)
> > 
> > what is a stream in this context?
> 
> Stream means I/O transfer (Memory to I/O and I/O to Memory).
> Sorry if I confused you.
> 
> > 
> > > In Multi-Channel dma mode each stream interface can be configured up to 16
> > channels.
> > > In Multi-channel DMA mode IP supports only interleaved transfers (2-D
> > transfers).
> > 
> > 
> > >
> > > >
> > > > >  /**
> > > > > + * struct xilinx_mcdma_config - DMA Multi channel configuration
> > > > > +structure
> > > > > + * @tdest: Channel to operate on
> > > > > + * @tid:   Channel configuration
> > > > > + * @tuser: Tuser configuration
> > > > > + * @ax_user: ax_user value
> > > > > + * @ax_cache: ax_cache value
> > > > > + */
> > > > > +struct xilinx_mcdma_config {
> > > > > + u8 tdest;
> > > > > + u8 tid;
> > > > > + u8 tuser;
> > > > > + u8 ax_user;
> > > > > + u8 ax_cache;
> > > >
> > > > can you describe these in details, what do these do, what are the
> > > > values to be programmed?
> > >
> > > As said above In Multi-Channel Mode each Stream interface can be
> > > Configured up to 16 channels each channel is differentiated based on the 
> > > tdest
> > and tid values.
> > 
> > Then why are you not registering 16 channels for this? That should give you
> > channel to operate on!
> 
> The number of channels are configurable.
> We are registering number of Channels that h/w configured for.
> 
> Will fix in the next version. Will remove this config.
> And based on the channel type will configure the h/w.

Looking at this you should redesign!

The vchan was designed to operate on 'virtual' channels. The hardware
channels can be independent of that.

Your IP seems to be a good fit for that approach. Do not link the two and
separate them. User can have a virtual channel. In your driver, you can
manage hardware channels...

> 
> > 
> > >
> > > tdest:
> > > TDEST provides routing information for the data stream.
> > 
> > pls elobrate
> 
> Need to configure this with the channel number that
> We would like to transfer data.

This should be internal to driver...

-- 
~Vinod


RE: [PATCH 2/4] dmaengine: vdma: Add support for mulit-channel dma mode

2016-06-22 Thread Appana Durga Kedareswara Rao
Hi Vinod,

> 
> On Tue, Jun 21, 2016 at 04:02:05PM +, Appana Durga Kedareswara Rao
> wrote:
> > Hi Vinod,
> >
> > Thanks for the review...
> >
> > >
> > > On Fri, Jun 10, 2016 at 02:42:32PM +0530, Kedareswara rao Appana wrote:
> > > > This patch adds support for AXI DMA multi-channel dma mode
> > > > Multichannel mode enables DMA to connect to multiple masters And
> > > > slaves on the streaming side.
> > > > In Multichannel mode AXI DMA supports 2D transfers.
> > >
> > > Funny formatting!
> >
> > Will fix in next version...
> >
> > >
> > > Can you elobrate what you meant by Multichannel mode? This patch
> > > seems to do two things, one is to add interleaved dma support and
> > > something else. Can you explain the latter part?
> >
> > AXI DMA has two Stream interfaces (Memory to Stream MM2S and Stream to
> > Memory S2MM)
> 
> what is a stream in this context?

Stream means I/O transfer (Memory to I/O and I/O to Memory).
Sorry if I confused you.

> 
> > In Multi-Channel dma mode each stream interface can be configured up to 16
> channels.
> > In Multi-channel DMA mode IP supports only interleaved transfers (2-D
> transfers).
> 
> 
> >
> > >
> > > >  /**
> > > > + * struct xilinx_mcdma_config - DMA Multi channel configuration
> > > > +structure
> > > > + * @tdest: Channel to operate on
> > > > + * @tid:   Channel configuration
> > > > + * @tuser: Tuser configuration
> > > > + * @ax_user: ax_user value
> > > > + * @ax_cache: ax_cache value
> > > > + */
> > > > +struct xilinx_mcdma_config {
> > > > +   u8 tdest;
> > > > +   u8 tid;
> > > > +   u8 tuser;
> > > > +   u8 ax_user;
> > > > +   u8 ax_cache;
> > >
> > > can you describe these in details, what do these do, what are the
> > > values to be programmed?
> >
> > As said above In Multi-Channel Mode each Stream interface can be
> > Configured up to 16 channels each channel is differentiated based on the 
> > tdest
> and tid values.
> 
> Then why are you not registering 16 channels for this? That should give you
> channel to operate on!

The number of channels are configurable.
We are registering number of Channels that h/w configured for.

Will fix in the next version. Will remove this config.
And based on the channel type will configure the h/w.

> 
> >
> > tdest:
> > TDEST provides routing information for the data stream.
> 
> pls elobrate

Need to configure this with the channel number that
We would like to transfer data.

> 
> > TDEST values are static for the entire packet.
> 
> what do these mean

We shouldn't modify this value when a transfer is going on...
Providing it in the config option user may not aware of all this possibilities.
Will remove this config and will handle this in the driver itself.

> 
> >
> > tid:
> > Provides a stream identifier. TID values are static for entire packet.
> > TID values provided in the TX descriptor field are presented on TID
> > signals of the streaming side.
> 
> what is this used for?

Currently I am not using this parameter will remove this config.
But usually it is used as a packet identifier.

> 
> >
> > tuser:
> > Sideband signals used for user-defined information.
> > TUSER values are static for entire packet. TUSER values provided in
> > the TX Descriptor field are presented on TUSER signals of streaming side.
> 
> what is this used for?

Used for user-defined information.
Currently I am not using it will remove this in the next version...

> 
> >
> > ax_user:
> > Sideband signals used for user-defined information ARUSER values and
> > their interpretations are user-defined
> 
> How is it used by client?

Currently I am not using it will remove this in the next version...

> 
> >
> > ax_cache:
> > Cache type this signal provides additional information about the
> > cacheable Characteristics of the transfer.
> 
> and what are those...

It is a 4-bit filed.
Bit 0: Bufferable
Bit 1: Modifiable
Bit 2: Non-cacheable
Bit 3: Normal

Currently I am not using it will remove this in the next version...

> 
> >
> > In the above parameters tdest and tid are mandatory to differentiate
> > b/w different channels Other parameters are optional please let me
> > know if you don't want me to Include other optional parameters will remove 
> > in
> the next version.
> 
> dmaengine provides channel as an argument so it is quite odd that you need to
> differentiate b/w different channels. This only makes me worry that things are
> not standard and fishy

Will fix in the next version will handle
Based on the channel type only.

Regards,
Kedar.

> 
> --
> ~Vinod


RE: [PATCH 2/4] dmaengine: vdma: Add support for mulit-channel dma mode

2016-06-22 Thread Appana Durga Kedareswara Rao
Hi Vinod,

> 
> On Tue, Jun 21, 2016 at 04:02:05PM +, Appana Durga Kedareswara Rao
> wrote:
> > Hi Vinod,
> >
> > Thanks for the review...
> >
> > >
> > > On Fri, Jun 10, 2016 at 02:42:32PM +0530, Kedareswara rao Appana wrote:
> > > > This patch adds support for AXI DMA multi-channel dma mode
> > > > Multichannel mode enables DMA to connect to multiple masters And
> > > > slaves on the streaming side.
> > > > In Multichannel mode AXI DMA supports 2D transfers.
> > >
> > > Funny formatting!
> >
> > Will fix in next version...
> >
> > >
> > > Can you elobrate what you meant by Multichannel mode? This patch
> > > seems to do two things, one is to add interleaved dma support and
> > > something else. Can you explain the latter part?
> >
> > AXI DMA has two Stream interfaces (Memory to Stream MM2S and Stream to
> > Memory S2MM)
> 
> what is a stream in this context?

Stream means I/O transfer (Memory to I/O and I/O to Memory).
Sorry if I confused you.

> 
> > In Multi-Channel dma mode each stream interface can be configured up to 16
> channels.
> > In Multi-channel DMA mode IP supports only interleaved transfers (2-D
> transfers).
> 
> 
> >
> > >
> > > >  /**
> > > > + * struct xilinx_mcdma_config - DMA Multi channel configuration
> > > > +structure
> > > > + * @tdest: Channel to operate on
> > > > + * @tid:   Channel configuration
> > > > + * @tuser: Tuser configuration
> > > > + * @ax_user: ax_user value
> > > > + * @ax_cache: ax_cache value
> > > > + */
> > > > +struct xilinx_mcdma_config {
> > > > +   u8 tdest;
> > > > +   u8 tid;
> > > > +   u8 tuser;
> > > > +   u8 ax_user;
> > > > +   u8 ax_cache;
> > >
> > > can you describe these in details, what do these do, what are the
> > > values to be programmed?
> >
> > As said above In Multi-Channel Mode each Stream interface can be
> > Configured up to 16 channels each channel is differentiated based on the 
> > tdest
> and tid values.
> 
> Then why are you not registering 16 channels for this? That should give you
> channel to operate on!

The number of channels are configurable.
We are registering number of Channels that h/w configured for.

Will fix in the next version. Will remove this config.
And based on the channel type will configure the h/w.

> 
> >
> > tdest:
> > TDEST provides routing information for the data stream.
> 
> pls elobrate

Need to configure this with the channel number that
We would like to transfer data.

> 
> > TDEST values are static for the entire packet.
> 
> what do these mean

We shouldn't modify this value when a transfer is going on...
Providing it in the config option user may not aware of all this possibilities.
Will remove this config and will handle this in the driver itself.

> 
> >
> > tid:
> > Provides a stream identifier. TID values are static for entire packet.
> > TID values provided in the TX descriptor field are presented on TID
> > signals of the streaming side.
> 
> what is this used for?

Currently I am not using this parameter will remove this config.
But usually it is used as a packet identifier.

> 
> >
> > tuser:
> > Sideband signals used for user-defined information.
> > TUSER values are static for entire packet. TUSER values provided in
> > the TX Descriptor field are presented on TUSER signals of streaming side.
> 
> what is this used for?

Used for user-defined information.
Currently I am not using it will remove this in the next version...

> 
> >
> > ax_user:
> > Sideband signals used for user-defined information ARUSER values and
> > their interpretations are user-defined
> 
> How is it used by client?

Currently I am not using it will remove this in the next version...

> 
> >
> > ax_cache:
> > Cache type this signal provides additional information about the
> > cacheable Characteristics of the transfer.
> 
> and what are those...

It is a 4-bit filed.
Bit 0: Bufferable
Bit 1: Modifiable
Bit 2: Non-cacheable
Bit 3: Normal

Currently I am not using it will remove this in the next version...

> 
> >
> > In the above parameters tdest and tid are mandatory to differentiate
> > b/w different channels Other parameters are optional please let me
> > know if you don't want me to Include other optional parameters will remove 
> > in
> the next version.
> 
> dmaengine provides channel as an argument so it is quite odd that you need to
> differentiate b/w different channels. This only makes me worry that things are
> not standard and fishy

Will fix in the next version will handle
Based on the channel type only.

Regards,
Kedar.

> 
> --
> ~Vinod


RE: [PATCH 2/4] dmaengine: vdma: Add support for mulit-channel dma mode

2016-06-21 Thread Appana Durga Kedareswara Rao
Hi Vinod,

Thanks for the review...

> 
> On Fri, Jun 10, 2016 at 02:42:32PM +0530, Kedareswara rao Appana wrote:
> > This patch adds support for AXI DMA multi-channel dma mode
> > Multichannel mode enables DMA to connect to multiple masters And
> > slaves on the streaming side.
> > In Multichannel mode AXI DMA supports 2D transfers.
> 
> Funny formatting!

Will fix in next version...

> 
> Can you elobrate what you meant by Multichannel mode? This patch seems to
> do two things, one is to add interleaved dma support and something else. Can
> you explain the latter part?

AXI DMA has two Stream interfaces (Memory to Stream MM2S and Stream to Memory 
S2MM)
In Multi-Channel dma mode each stream interface can be configured up to 16 
channels.
In Multi-channel DMA mode IP supports only interleaved transfers (2-D 
transfers).

> 
> >  /**
> > + * struct xilinx_mcdma_config - DMA Multi channel configuration
> > +structure
> > + * @tdest: Channel to operate on
> > + * @tid:   Channel configuration
> > + * @tuser: Tuser configuration
> > + * @ax_user: ax_user value
> > + * @ax_cache: ax_cache value
> > + */
> > +struct xilinx_mcdma_config {
> > +   u8 tdest;
> > +   u8 tid;
> > +   u8 tuser;
> > +   u8 ax_user;
> > +   u8 ax_cache;
> 
> can you describe these in details, what do these do, what are the values to be
> programmed?

As said above In Multi-Channel Mode each Stream interface can be 
Configured up to 16 channels each channel is differentiated based on the tdest 
and tid values.

tdest:
TDEST provides routing information for the data stream.
TDEST values are static for the entire packet.

tid:
Provides a stream identifier. TID values are static for entire packet.
TID values provided in the TX descriptor field are presented on
TID signals of the streaming side.

tuser:
Sideband signals used for user-defined information.
TUSER values are static for entire packet. TUSER values provided in the TX
Descriptor field are presented on TUSER signals of streaming side.

ax_user: 
Sideband signals used for user-defined information
ARUSER values and their interpretations are user-defined

ax_cache:
Cache type this signal provides additional information about the cacheable
Characteristics of the transfer.

In the above parameters tdest and tid are mandatory to differentiate b/w 
different channels
Other parameters are optional please let me know if you don't want me to 
Include other optional parameters will remove in the next version.

Regards,
Kedar.

> 
> --
> ~Vinod


RE: [PATCH 2/4] dmaengine: vdma: Add support for mulit-channel dma mode

2016-06-21 Thread Appana Durga Kedareswara Rao
Hi Vinod,

Thanks for the review...

> 
> On Fri, Jun 10, 2016 at 02:42:32PM +0530, Kedareswara rao Appana wrote:
> > This patch adds support for AXI DMA multi-channel dma mode
> > Multichannel mode enables DMA to connect to multiple masters And
> > slaves on the streaming side.
> > In Multichannel mode AXI DMA supports 2D transfers.
> 
> Funny formatting!

Will fix in next version...

> 
> Can you elobrate what you meant by Multichannel mode? This patch seems to
> do two things, one is to add interleaved dma support and something else. Can
> you explain the latter part?

AXI DMA has two Stream interfaces (Memory to Stream MM2S and Stream to Memory 
S2MM)
In Multi-Channel dma mode each stream interface can be configured up to 16 
channels.
In Multi-channel DMA mode IP supports only interleaved transfers (2-D 
transfers).

> 
> >  /**
> > + * struct xilinx_mcdma_config - DMA Multi channel configuration
> > +structure
> > + * @tdest: Channel to operate on
> > + * @tid:   Channel configuration
> > + * @tuser: Tuser configuration
> > + * @ax_user: ax_user value
> > + * @ax_cache: ax_cache value
> > + */
> > +struct xilinx_mcdma_config {
> > +   u8 tdest;
> > +   u8 tid;
> > +   u8 tuser;
> > +   u8 ax_user;
> > +   u8 ax_cache;
> 
> can you describe these in details, what do these do, what are the values to be
> programmed?

As said above In Multi-Channel Mode each Stream interface can be 
Configured up to 16 channels each channel is differentiated based on the tdest 
and tid values.

tdest:
TDEST provides routing information for the data stream.
TDEST values are static for the entire packet.

tid:
Provides a stream identifier. TID values are static for entire packet.
TID values provided in the TX descriptor field are presented on
TID signals of the streaming side.

tuser:
Sideband signals used for user-defined information.
TUSER values are static for entire packet. TUSER values provided in the TX
Descriptor field are presented on TUSER signals of streaming side.

ax_user: 
Sideband signals used for user-defined information
ARUSER values and their interpretations are user-defined

ax_cache:
Cache type this signal provides additional information about the cacheable
Characteristics of the transfer.

In the above parameters tdest and tid are mandatory to differentiate b/w 
different channels
Other parameters are optional please let me know if you don't want me to 
Include other optional parameters will remove in the next version.

Regards,
Kedar.

> 
> --
> ~Vinod


Re: [PATCH 2/4] dmaengine: vdma: Add support for mulit-channel dma mode

2016-06-21 Thread Vinod Koul
On Tue, Jun 21, 2016 at 04:02:05PM +, Appana Durga Kedareswara Rao wrote:
> Hi Vinod,
> 
>   Thanks for the review...
> 
> > 
> > On Fri, Jun 10, 2016 at 02:42:32PM +0530, Kedareswara rao Appana wrote:
> > > This patch adds support for AXI DMA multi-channel dma mode
> > > Multichannel mode enables DMA to connect to multiple masters And
> > > slaves on the streaming side.
> > > In Multichannel mode AXI DMA supports 2D transfers.
> > 
> > Funny formatting!
> 
> Will fix in next version...
> 
> > 
> > Can you elobrate what you meant by Multichannel mode? This patch seems to
> > do two things, one is to add interleaved dma support and something else. Can
> > you explain the latter part?
> 
> AXI DMA has two Stream interfaces (Memory to Stream MM2S and Stream to Memory 
> S2MM)

what is a stream in this context?

> In Multi-Channel dma mode each stream interface can be configured up to 16 
> channels.
> In Multi-channel DMA mode IP supports only interleaved transfers (2-D 
> transfers).


> 
> > 
> > >  /**
> > > + * struct xilinx_mcdma_config - DMA Multi channel configuration
> > > +structure
> > > + * @tdest: Channel to operate on
> > > + * @tid:   Channel configuration
> > > + * @tuser: Tuser configuration
> > > + * @ax_user: ax_user value
> > > + * @ax_cache: ax_cache value
> > > + */
> > > +struct xilinx_mcdma_config {
> > > + u8 tdest;
> > > + u8 tid;
> > > + u8 tuser;
> > > + u8 ax_user;
> > > + u8 ax_cache;
> > 
> > can you describe these in details, what do these do, what are the values to 
> > be
> > programmed?
> 
> As said above In Multi-Channel Mode each Stream interface can be 
> Configured up to 16 channels each channel is differentiated based on the 
> tdest and tid values.

Then why are you not registering 16 channels for this? That should give you
channel to operate on!

> 
> tdest:
> TDEST provides routing information for the data stream.

pls elobrate

> TDEST values are static for the entire packet.

what do these mean

> 
> tid:
> Provides a stream identifier. TID values are static for entire packet.
> TID values provided in the TX descriptor field are presented on
> TID signals of the streaming side.

what is this used for?

> 
> tuser:
> Sideband signals used for user-defined information.
> TUSER values are static for entire packet. TUSER values provided in the TX
> Descriptor field are presented on TUSER signals of streaming side.

what is this used for?

> 
> ax_user: 
> Sideband signals used for user-defined information
> ARUSER values and their interpretations are user-defined

How is it used by client?

> 
> ax_cache:
> Cache type this signal provides additional information about the cacheable
> Characteristics of the transfer.

and what are those...

> 
> In the above parameters tdest and tid are mandatory to differentiate b/w 
> different channels
> Other parameters are optional please let me know if you don't want me to 
> Include other optional parameters will remove in the next version.

dmaengine provides channel as an argument so it is quite odd that you need
to differentiate b/w different channels. This only makes me worry that
things are not standard and fishy

-- 
~Vinod


Re: [PATCH 2/4] dmaengine: vdma: Add support for mulit-channel dma mode

2016-06-21 Thread Vinod Koul
On Tue, Jun 21, 2016 at 04:02:05PM +, Appana Durga Kedareswara Rao wrote:
> Hi Vinod,
> 
>   Thanks for the review...
> 
> > 
> > On Fri, Jun 10, 2016 at 02:42:32PM +0530, Kedareswara rao Appana wrote:
> > > This patch adds support for AXI DMA multi-channel dma mode
> > > Multichannel mode enables DMA to connect to multiple masters And
> > > slaves on the streaming side.
> > > In Multichannel mode AXI DMA supports 2D transfers.
> > 
> > Funny formatting!
> 
> Will fix in next version...
> 
> > 
> > Can you elobrate what you meant by Multichannel mode? This patch seems to
> > do two things, one is to add interleaved dma support and something else. Can
> > you explain the latter part?
> 
> AXI DMA has two Stream interfaces (Memory to Stream MM2S and Stream to Memory 
> S2MM)

what is a stream in this context?

> In Multi-Channel dma mode each stream interface can be configured up to 16 
> channels.
> In Multi-channel DMA mode IP supports only interleaved transfers (2-D 
> transfers).


> 
> > 
> > >  /**
> > > + * struct xilinx_mcdma_config - DMA Multi channel configuration
> > > +structure
> > > + * @tdest: Channel to operate on
> > > + * @tid:   Channel configuration
> > > + * @tuser: Tuser configuration
> > > + * @ax_user: ax_user value
> > > + * @ax_cache: ax_cache value
> > > + */
> > > +struct xilinx_mcdma_config {
> > > + u8 tdest;
> > > + u8 tid;
> > > + u8 tuser;
> > > + u8 ax_user;
> > > + u8 ax_cache;
> > 
> > can you describe these in details, what do these do, what are the values to 
> > be
> > programmed?
> 
> As said above In Multi-Channel Mode each Stream interface can be 
> Configured up to 16 channels each channel is differentiated based on the 
> tdest and tid values.

Then why are you not registering 16 channels for this? That should give you
channel to operate on!

> 
> tdest:
> TDEST provides routing information for the data stream.

pls elobrate

> TDEST values are static for the entire packet.

what do these mean

> 
> tid:
> Provides a stream identifier. TID values are static for entire packet.
> TID values provided in the TX descriptor field are presented on
> TID signals of the streaming side.

what is this used for?

> 
> tuser:
> Sideband signals used for user-defined information.
> TUSER values are static for entire packet. TUSER values provided in the TX
> Descriptor field are presented on TUSER signals of streaming side.

what is this used for?

> 
> ax_user: 
> Sideband signals used for user-defined information
> ARUSER values and their interpretations are user-defined

How is it used by client?

> 
> ax_cache:
> Cache type this signal provides additional information about the cacheable
> Characteristics of the transfer.

and what are those...

> 
> In the above parameters tdest and tid are mandatory to differentiate b/w 
> different channels
> Other parameters are optional please let me know if you don't want me to 
> Include other optional parameters will remove in the next version.

dmaengine provides channel as an argument so it is quite odd that you need
to differentiate b/w different channels. This only makes me worry that
things are not standard and fishy

-- 
~Vinod


Re: [PATCH 2/4] dmaengine: vdma: Add support for mulit-channel dma mode

2016-06-21 Thread Vinod Koul
On Fri, Jun 10, 2016 at 02:42:32PM +0530, Kedareswara rao Appana wrote:
> This patch adds support for AXI DMA multi-channel dma mode
> Multichannel mode enables DMA to connect to multiple masters
> And slaves on the streaming side.
> In Multichannel mode AXI DMA supports 2D transfers.

Funny formatting!

Can you elobrate what you meant by Multichannel mode? This patch seems to do
two things, one is to add interleaved dma support and something else. Can
you explain the latter part?

>  /**
> + * struct xilinx_mcdma_config - DMA Multi channel configuration structure
> + * @tdest: Channel to operate on
> + * @tid:   Channel configuration
> + * @tuser: Tuser configuration
> + * @ax_user: ax_user value
> + * @ax_cache: ax_cache value
> + */
> +struct xilinx_mcdma_config {
> + u8 tdest;
> + u8 tid;
> + u8 tuser;
> + u8 ax_user;
> + u8 ax_cache;

can you describe these in details, what do these do, what are the values to
be programmed?

-- 
~Vinod


Re: [PATCH 2/4] dmaengine: vdma: Add support for mulit-channel dma mode

2016-06-21 Thread Vinod Koul
On Fri, Jun 10, 2016 at 02:42:32PM +0530, Kedareswara rao Appana wrote:
> This patch adds support for AXI DMA multi-channel dma mode
> Multichannel mode enables DMA to connect to multiple masters
> And slaves on the streaming side.
> In Multichannel mode AXI DMA supports 2D transfers.

Funny formatting!

Can you elobrate what you meant by Multichannel mode? This patch seems to do
two things, one is to add interleaved dma support and something else. Can
you explain the latter part?

>  /**
> + * struct xilinx_mcdma_config - DMA Multi channel configuration structure
> + * @tdest: Channel to operate on
> + * @tid:   Channel configuration
> + * @tuser: Tuser configuration
> + * @ax_user: ax_user value
> + * @ax_cache: ax_cache value
> + */
> +struct xilinx_mcdma_config {
> + u8 tdest;
> + u8 tid;
> + u8 tuser;
> + u8 ax_user;
> + u8 ax_cache;

can you describe these in details, what do these do, what are the values to
be programmed?

-- 
~Vinod


[PATCH 2/4] dmaengine: vdma: Add support for mulit-channel dma mode

2016-06-10 Thread Kedareswara rao Appana
This patch adds support for AXI DMA multi-channel dma mode
Multichannel mode enables DMA to connect to multiple masters
And slaves on the streaming side.
In Multichannel mode AXI DMA supports 2D transfers.

Signed-off-by: Kedareswara rao Appana 
---
 drivers/dma/xilinx/xilinx_vdma.c |  242 ++
 include/linux/dma/xilinx_dma.h   |   18 +++
 2 files changed, 237 insertions(+), 23 deletions(-)

diff --git a/drivers/dma/xilinx/xilinx_vdma.c b/drivers/dma/xilinx/xilinx_vdma.c
index 20fe5ea..480b0ba 100644
--- a/drivers/dma/xilinx/xilinx_vdma.c
+++ b/drivers/dma/xilinx/xilinx_vdma.c
@@ -114,7 +114,7 @@
 #define XILINX_VDMA_REG_START_ADDRESS_64(n)(0x000c + 8 * (n))
 
 /* HW specific definitions */
-#define XILINX_DMA_MAX_CHANS_PER_DEVICE0x2
+#define XILINX_DMA_MAX_CHANS_PER_DEVICE0x20
 
 #define XILINX_DMA_DMAXR_ALL_IRQ_MASK  \
(XILINX_DMA_DMASR_FRM_CNT_IRQ | \
@@ -165,6 +165,17 @@
 #define XILINX_DMA_COALESCE_MAX255
 #define XILINX_DMA_NUM_APP_WORDS   5
 
+/* Multi-Channel DMA Descriptor offsets*/
+#define XILINX_DMA_MCRX_CDESC(x)   (0x40 + (x-1) * 0x20)
+#define XILINX_DMA_MCRX_TDESC(x)   (0x48 + (x-1) * 0x20)
+
+/* Multi-Channel DMA Masks/Shifts */
+#define XILINX_DMA_BD_HSIZE_MASK   GENMASK(15, 0)
+#define XILINX_DMA_BD_STRIDE_MASK  GENMASK(15, 0)
+#define XILINX_DMA_BD_VSIZE_MASK   GENMASK(31, 19)
+#define XILINX_DMA_BD_STRIDE_SHIFT 0
+#define XILINX_DMA_BD_VSIZE_SHIFT  19
+
 /* AXI CDMA Specific Registers/Offsets */
 #define XILINX_CDMA_REG_SRCADDR0x18
 #define XILINX_CDMA_REG_DSTADDR0x20
@@ -172,6 +183,13 @@
 /* AXI CDMA Specific Masks */
 #define XILINX_CDMA_CR_SGMODE  BIT(3)
 
+#define mm2s_mcdmatx_control(tdest, tid, tuser, axcache, aruser) \
+((aruser << 28) | (axcache << 24) | \
+(tuser << 16) | (tid << 8) | (tdest))
+
+#define mm2s_mcdmarx_control(axcache, aruser) \
+((aruser << 28) | (axcache << 24))
+
 /**
  * struct xilinx_vdma_desc_hw - Hardware Descriptor
  * @next_desc: Next Descriptor Pointer @0x00
@@ -210,8 +228,8 @@ struct xilinx_axidma_desc_hw {
u32 next_desc_msb;
u32 buf_addr;
u32 buf_addr_msb;
-   u32 pad1;
-   u32 pad2;
+   u32 mcdma_fields;
+   u32 vsize_stride;
u32 control;
u32 status;
u32 app[XILINX_DMA_NUM_APP_WORDS];
@@ -318,6 +336,7 @@ struct xilinx_dma_tx_descriptor {
  * @residue: Residue for AXI DMA
  * @seg_v: Statically allocated segments base
  * @cyclic_seg_v: Statically allocated segment base for cyclic transfers
+ * @mcdma_config: Device configuration info for MCDMA
  * @start_transfer: Differentiate b/w DMA IP's transfer
  */
 struct xilinx_dma_chan {
@@ -348,6 +367,7 @@ struct xilinx_dma_chan {
u32 residue;
struct xilinx_axidma_tx_segment *seg_v;
struct xilinx_axidma_tx_segment *cyclic_seg_v;
+   struct xilinx_mcdma_config mcdma_config;
void (*start_transfer)(struct xilinx_dma_chan *chan);
 };
 
@@ -365,6 +385,7 @@ struct xilinx_dma_config {
  * @common: DMA device structure
  * @chan: Driver specific DMA channel
  * @has_sg: Specifies whether Scatter-Gather is present or not
+ * @mcdma: Specifies whether Multi-Channel is present or not
  * @flush_on_fsync: Flush on frame sync
  * @ext_addr: Indicates 64 bit addressing is supported by dma device
  * @pdev: Platform device structure pointer
@@ -374,6 +395,8 @@ struct xilinx_dma_config {
  * @txs_clk: DMA mm2s stream clock
  * @rx_clk: DMA s2mm clock
  * @rxs_clk: DMA s2mm stream clock
+ * @nr_channels: Number of channels DMA device supports
+ * @chan_id: DMA channel identifier
  */
 struct xilinx_dma_device {
void __iomem *regs;
@@ -381,6 +404,7 @@ struct xilinx_dma_device {
struct dma_device common;
struct xilinx_dma_chan *chan[XILINX_DMA_MAX_CHANS_PER_DEVICE];
bool has_sg;
+   bool mcdma;
u32 flush_on_fsync;
bool ext_addr;
struct platform_device  *pdev;
@@ -390,6 +414,8 @@ struct xilinx_dma_device {
struct clk *txs_clk;
struct clk *rx_clk;
struct clk *rxs_clk;
+   u32 nr_channels;
+   u32 chan_id;
 };
 
 /* Macros */
@@ -1174,6 +1200,7 @@ static void xilinx_dma_start_transfer(struct 
xilinx_dma_chan *chan)
 {
struct xilinx_dma_tx_descriptor *head_desc, *tail_desc;
struct xilinx_axidma_tx_segment *tail_segment, *old_head, *new_head;
+   struct xilinx_mcdma_config *config = >mcdma_config;
u32 reg;
 
if (chan->err)
@@ -1196,18 +1223,20 @@ static void xilinx_dma_start_transfer(struct 
xilinx_dma_chan *chan)
tail_segment = list_last_entry(_desc->segments,
   struct xilinx_axidma_tx_segment, node);
 
-   old_head = list_first_entry(_desc->segments,
-   struct 

[PATCH 2/4] dmaengine: vdma: Add support for mulit-channel dma mode

2016-06-10 Thread Kedareswara rao Appana
This patch adds support for AXI DMA multi-channel dma mode
Multichannel mode enables DMA to connect to multiple masters
And slaves on the streaming side.
In Multichannel mode AXI DMA supports 2D transfers.

Signed-off-by: Kedareswara rao Appana 
---
 drivers/dma/xilinx/xilinx_vdma.c |  242 ++
 include/linux/dma/xilinx_dma.h   |   18 +++
 2 files changed, 237 insertions(+), 23 deletions(-)

diff --git a/drivers/dma/xilinx/xilinx_vdma.c b/drivers/dma/xilinx/xilinx_vdma.c
index 20fe5ea..480b0ba 100644
--- a/drivers/dma/xilinx/xilinx_vdma.c
+++ b/drivers/dma/xilinx/xilinx_vdma.c
@@ -114,7 +114,7 @@
 #define XILINX_VDMA_REG_START_ADDRESS_64(n)(0x000c + 8 * (n))
 
 /* HW specific definitions */
-#define XILINX_DMA_MAX_CHANS_PER_DEVICE0x2
+#define XILINX_DMA_MAX_CHANS_PER_DEVICE0x20
 
 #define XILINX_DMA_DMAXR_ALL_IRQ_MASK  \
(XILINX_DMA_DMASR_FRM_CNT_IRQ | \
@@ -165,6 +165,17 @@
 #define XILINX_DMA_COALESCE_MAX255
 #define XILINX_DMA_NUM_APP_WORDS   5
 
+/* Multi-Channel DMA Descriptor offsets*/
+#define XILINX_DMA_MCRX_CDESC(x)   (0x40 + (x-1) * 0x20)
+#define XILINX_DMA_MCRX_TDESC(x)   (0x48 + (x-1) * 0x20)
+
+/* Multi-Channel DMA Masks/Shifts */
+#define XILINX_DMA_BD_HSIZE_MASK   GENMASK(15, 0)
+#define XILINX_DMA_BD_STRIDE_MASK  GENMASK(15, 0)
+#define XILINX_DMA_BD_VSIZE_MASK   GENMASK(31, 19)
+#define XILINX_DMA_BD_STRIDE_SHIFT 0
+#define XILINX_DMA_BD_VSIZE_SHIFT  19
+
 /* AXI CDMA Specific Registers/Offsets */
 #define XILINX_CDMA_REG_SRCADDR0x18
 #define XILINX_CDMA_REG_DSTADDR0x20
@@ -172,6 +183,13 @@
 /* AXI CDMA Specific Masks */
 #define XILINX_CDMA_CR_SGMODE  BIT(3)
 
+#define mm2s_mcdmatx_control(tdest, tid, tuser, axcache, aruser) \
+((aruser << 28) | (axcache << 24) | \
+(tuser << 16) | (tid << 8) | (tdest))
+
+#define mm2s_mcdmarx_control(axcache, aruser) \
+((aruser << 28) | (axcache << 24))
+
 /**
  * struct xilinx_vdma_desc_hw - Hardware Descriptor
  * @next_desc: Next Descriptor Pointer @0x00
@@ -210,8 +228,8 @@ struct xilinx_axidma_desc_hw {
u32 next_desc_msb;
u32 buf_addr;
u32 buf_addr_msb;
-   u32 pad1;
-   u32 pad2;
+   u32 mcdma_fields;
+   u32 vsize_stride;
u32 control;
u32 status;
u32 app[XILINX_DMA_NUM_APP_WORDS];
@@ -318,6 +336,7 @@ struct xilinx_dma_tx_descriptor {
  * @residue: Residue for AXI DMA
  * @seg_v: Statically allocated segments base
  * @cyclic_seg_v: Statically allocated segment base for cyclic transfers
+ * @mcdma_config: Device configuration info for MCDMA
  * @start_transfer: Differentiate b/w DMA IP's transfer
  */
 struct xilinx_dma_chan {
@@ -348,6 +367,7 @@ struct xilinx_dma_chan {
u32 residue;
struct xilinx_axidma_tx_segment *seg_v;
struct xilinx_axidma_tx_segment *cyclic_seg_v;
+   struct xilinx_mcdma_config mcdma_config;
void (*start_transfer)(struct xilinx_dma_chan *chan);
 };
 
@@ -365,6 +385,7 @@ struct xilinx_dma_config {
  * @common: DMA device structure
  * @chan: Driver specific DMA channel
  * @has_sg: Specifies whether Scatter-Gather is present or not
+ * @mcdma: Specifies whether Multi-Channel is present or not
  * @flush_on_fsync: Flush on frame sync
  * @ext_addr: Indicates 64 bit addressing is supported by dma device
  * @pdev: Platform device structure pointer
@@ -374,6 +395,8 @@ struct xilinx_dma_config {
  * @txs_clk: DMA mm2s stream clock
  * @rx_clk: DMA s2mm clock
  * @rxs_clk: DMA s2mm stream clock
+ * @nr_channels: Number of channels DMA device supports
+ * @chan_id: DMA channel identifier
  */
 struct xilinx_dma_device {
void __iomem *regs;
@@ -381,6 +404,7 @@ struct xilinx_dma_device {
struct dma_device common;
struct xilinx_dma_chan *chan[XILINX_DMA_MAX_CHANS_PER_DEVICE];
bool has_sg;
+   bool mcdma;
u32 flush_on_fsync;
bool ext_addr;
struct platform_device  *pdev;
@@ -390,6 +414,8 @@ struct xilinx_dma_device {
struct clk *txs_clk;
struct clk *rx_clk;
struct clk *rxs_clk;
+   u32 nr_channels;
+   u32 chan_id;
 };
 
 /* Macros */
@@ -1174,6 +1200,7 @@ static void xilinx_dma_start_transfer(struct 
xilinx_dma_chan *chan)
 {
struct xilinx_dma_tx_descriptor *head_desc, *tail_desc;
struct xilinx_axidma_tx_segment *tail_segment, *old_head, *new_head;
+   struct xilinx_mcdma_config *config = >mcdma_config;
u32 reg;
 
if (chan->err)
@@ -1196,18 +1223,20 @@ static void xilinx_dma_start_transfer(struct 
xilinx_dma_chan *chan)
tail_segment = list_last_entry(_desc->segments,
   struct xilinx_axidma_tx_segment, node);
 
-   old_head = list_first_entry(_desc->segments,
-   struct xilinx_axidma_tx_segment,