Some problems with IO/Mem-mapping

Dag Brattli dagb en cs.uit.no
Vie Ene 28 22:02:10 CST 2000


Hi,

I'm helping out a friend who is developing a Linux driver for a AD/DA PCI
card. The card has a shared memory region, which he wants to mmap() to
user-space.

dub ~/ > lspci -vv
00:0e.0 Class ff00: Ultraview Corporation ADDA 1280 DX
        Subsystem: Unknown device febd:0067
        Control: I/O- Mem+ BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B-
        Status: Cap- 66Mhz- UDF- FastB2B- ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR-
        Interrupt: pin A routed to IRQ 9
        Region 0: Memory at 42000000 (32-bit, non-prefetchable)

The problem is how to get the physical address which we need to feed to
remap_page_range(). If we use phys = virt_to_phys(bus_to_virt(mem_addr)) to
make the driver portable to non i386 platforms, then it will strip off the
highest bit because of the PAGE_OFFSET. Using virt_to_phys() on whats
returned from ioremap() does not produce the correct physical address
either. Recompiling the kernel for 2GB phys mem is probably not the
"correct" solution. Using the base_address (0x42000000) directly will of
course give the correct result, but we would really like the driver to work
on non-i386 platforms as well. 

I guess we are not understanding this issue at all, so any hints would be
appreciated!

Thanks

-- Dag

-- 
   / Dag Brattli                   | The Linux-IrDA Project               /
  // University of Tromsoe, Norway | Infrared communication for Linux    //
 /// http://www.cs.uit.no/~dagb    | http://www.cs.uit.no/linux-irda/   ///

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo en vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



Más información sobre la lista de distribución Ayuda