Dave Baukus writes:
> __virt_to_phys() et.al. make sense; however, I loose it on __virt_to_bus()
> et.al. I can't see anything mapped in at 0xe0000000.
Read on...
> Can somebody explain the difference between these 2 sets of macros.
You may want to read Documentation/IO-mapping.txt. Basically:
virt_to_phys converts an address as seen from the CPU
(ie, 0xc0004000 - the address of the kernel page directory)
to an address that is seen 'the other side of the page tables'
(ie, 0x00004000 - the address that the CPU has to put on it's
address pins to get the contents of that location.
virt_to_bus converts an address as seen from the CPI
to an address that is seen on the machine's IO bus
Note: All of these translation functions are only valid on the
kernel's mapping of the SDRAM.
> I have an AMD driver that is using __virt_to_bus on addresses
> returned from kmalloc(). Thus, I get address manipulation such as:
> 0xc000fxxx - 0xe0000000
> This is either broken or way too slick for me.
It's slick.
The situation currently is:
1. The SDRAM is mapped into PCI memory space at 0xe0000000
This means that virtual address 0xc0000000 = PCI address 0xe0000000.
Adding 0x20000000 or subtracting 0xe0000000 performs this
translation.
2. The PCI memory space is mapped into virtual address space at
0xe0000000. This is merely for compatability with some currently
broken drivers, however, the same translation is true:
PCI address 0 == virtual address space 0xe0000000.
But note! This should *not* be used!
_____
|_____| ------------------------------------------------- ---+---+-
| | Russell King [EMAIL PROTECTED] --- ---
| | | | http://www.arm.linux.org.uk/~rmk/armlinux.html / / |
| +-+-+ --- -+-
/ | THE developer of ARM Linux |+| /|\
/ | | | --- |
+-+-+ ------------------------------------------------- /\\\ |
unsubscribe: body of `unsubscribe linux-arm' to [EMAIL PROTECTED]