scw%netbsd.org@localhost wrote: On a 405 you are more likey to use #define PHYS_TO_BUS_MEM(t, addr) (*(t)->_dma_phys_to_bus_mem)((t), (addr))On Friday 19 March 2004 9:49 pm, Fraser Douglas wrote:It needs (for the ev64260 port) to define macros for: PHYS_TO_BUS_MEM and BUS_MEM_TO_PHYS[in <evbppc/bus.h>]which I am afraid will most likely break other evbppc based ports if they are using that bus.h. Can anyone suggest a place to invoke those macros other than in that particular header? Possibly as an option in the config? (though that seems 'brutish')I can't think of any other way to specify this. I've rattled up an evbppc-specific defflag "EVBPPC_BUS_DMA_NEEDS_P2B" which DTRT if specified in the kernel config file. If there are no objections, I'll commit this. As I recall, you just need the following definitions for the macros: #define PHYS_TO_BUS_MEM(t, addr) (addr) #define BUS_MEM_TO_PHYS(t, addr) (addr) and have that set depending on how you have set up you PT*BAR to map you PCI devices verses PLB devices. If you have other 405 based devices on your PCI bus then you are likely to be "bootstraping" across the PCI bus and using PT*BAR's to maps its "eeprom" 0xfffffffffc to wherever and (addr-0x8000.0000) more likely in general - there again pehaps your system is 1:1 if not 1:1 you will also need this in arch/powerp/powerpc/bus_dma.c: bus_dma.c /usr/src_current/src/sys/arch/powerpc/powerpc/bus_dma.c 483c483 < bus_addr_t addr = BUS_MEM_TO_PHYS(t, ds->ds_addr) + offset; --- > bus_addr_t addr = ds->ds_addr + offset; Cheers, Steve |