Re: [PATCH 5/7 v2] dma: sh: use an integer slave ID to improve APIcompatibility

From: Guennadi Liakhovetski
Date: Mon Jul 16 2012 - 06:01:24 EST


On Mon, 16 Jul 2012, Vinod Koul wrote:

> On Mon, 2012-07-16 at 10:47 +0200, Guennadi Liakhovetski wrote:
> > > I want to know what does ccr and mid_rid mean to dmac here?
> >
> > CHCR contains a few fields, some enable various interrupt sources, some
> > specify repeat- and renew-modes, others yet specify transfer size, source
> > and destination address-modes (incrementing, constant, decrementing),
> > others yet select a DMA client category (slave / memcpy / ...), and a
> > transfer flag. Some of these fields could be calculated, others are
> > pre-defined for various slaves, the exact layout of those fields can also
> > vary between SoCs.
> I do not understand how clients would provide these values.
> For pre-defined values, they should be dmac property why should client
> like spi or mmc have clue about it?
>
> For others like you mentioned, i guess they could be easily calculated,
> right?
>
> > MID_RID is actually a slave-selector, it contains a magic value, that
> > cannot be calculated.
> and again, how does client know this?

I might be misunderstanding you, but from earlier discussions I got an
impression, that the DMAC should know nothing about clients, i.e., should
receive no client-specific information from its platform data. Instead
clients should provide it when configuring the channel. If this is
correct, then the preferred way would be to specify these values in client
platform data and then pass it to the DMAC with slave-config calls? Or
have I misunderstood you and this per-client information should be kept in
DMAC platform data?

I.e., in both cases magic values are provided by platforms, the only
difference is - either keep them in DMAC platform data or move them in
each individual DMA client platform data.

Yes, some CHCR fields can be calculated, but location and width of those
fields might vary between DMAC versions, so, they will have to be passed
with DMAC platform data. But this definitely can be done in the future.

Thanks
Guennadi
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/