Re: FOR COMMENT: void __iomem * and similar casts are Bad News

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



* Russell King - ARM Linux <linux@xxxxxxxxxxxxxxxx> [080903 13:46]:
> On Wed, Sep 03, 2008 at 04:04:11PM -0400, Eduardo Valentin wrote:
> > Hi Russell,
> > 
> > On Wed, Sep 3, 2008 at 3:48 PM, Russell King - ARM Linux
> > <linux@xxxxxxxxxxxxxxxx> wrote:
> > > Yes, that will be virtual.  But what does it mean to call:
> > >
> > >        omap_set_dma_dest_params()
> > >
> > > specifying a virtual address?  Can the DMA controller cope with DMAing
> > > to virtual addresses?  My hunch is that the DMA controller can't cope
> > > with that, so giving it a virtual address is a bug.
> > >
> > > Let me change the question: does omap_set_dma_dest_params()'s 4th
> > > argument take a virtual or a physical address?  If the former, it's
> > > prototype is wrong, and its 4th argument needs to be typed as
> > > 'void __iomem *' rather than 'unsigned long'.  If the latter, the code
> > > above is wrong.
> > >
> > > Do you see what I'm getting at now?
> > 
> > Ok. I got your point. I took a look at it and it expects a virtual address
> > on its 4th argument.
> 
> I'm sorry, but I don't think you have.
> 
> > I uses it with dma_write() macro, which uses it with __raw_write()
> > (arch/arm/plat-omap/dma.c).
> 
> That's true, but probably not in the way which would require it to be
> a virtual address that you're thinking.
> 
> void omap_set_dma_dest_params(int lch, int dest_port, int dest_amode,
>                               unsigned long dest_start,
>                               int dst_ei, int dst_fi)
> {
>         if (cpu_class_is_omap1()) {
>                 dma_write(dest_start >> 16, CDSA_U(lch));
>                 dma_write(dest_start, CDSA_L(lch));
>         }
> 
>         if (cpu_class_is_omap2())
>                 dma_write(dest_start, CDSA(lch));
> }
> 
> 'dest_start' is a value to be written to the hardware registers in
> the DMA controller.  So, the question now is: do the CDSA registers
> expect a virtual or a physical address to be written to them?

C[DS][DS]A register need physical addresses for the DMA. The DMA
controller does not know anything about virtual addresses.

> I would look up this CDSA register in the OMAP manuals, if they were
> accessible... Are they not publically available?  (Google isn't
> helping, neither is searching on ti.com...)

There is a 3450 public TRM somewhere AFAIK, anybody got a link for that?
At least 5912 TRM is available somewhere.

Tony
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux