Subject: Re: Fwd: Located problem in pcn driver...
To: None <john_94501@yahoo.com>
From: Ben Harris <bjh21@netbsd.org>
List: tech-kern
Date: 04/18/2003 12:42:22
In article <20030418073953.32086.qmail@web41402.mail.yahoo.com> you write:
>> So, how do I fix this? Is the problem in this piece of code, or should
>> the ds_addr value already have been translated to a PCI-view address?
Jason will probably be along with a definitive answer at some point, but
bus_dma(9) says "The values in ds_addr and ds_len are suitable for
programming into DMA controller address and length registers," which sounds
to me like ds_addr should already contain a PCI-view address.
>> Obviously, for my testing it is simple to just set the top bit on the
>> address, but how do I do this correctly, and where (in the driver here,
>> or in the DMA code that sets up the ds_addr value in the first place)?
I don't really understand bus_dma, but I think that's the job of
bus_dmamap_load() and friends. Looking through
sys/arch/powerpc/powerpc/bus_dma.c, it looks like the PHYS_TO_BUS_MEM()
macro is what you want.
--
Ben Harris <bjh21@netbsd.org>
Portmaster, NetBSD/acorn26 <URL:http://www.netbsd.org/Ports/acorn26/>