Re: PATA_ARTOP reads byte from PCI IO port without mapping it to the right address.

From: Arnd Bergmann
Date: Wed Mar 30 2011 - 16:01:10 EST


On Wednesday 30 March 2011 21:48:26 Daniel Palmer wrote:
> > That is the PCI port address.
>
> I don't pretend to understand most of this fully.
> On the board the PCI address space/PCI controller is apparently at
> 0xfe240000
> So I guess that when that byte is read it should read from 0xfe240000 +
> 0x1400?
> That doesn't happen and a read happens at 0x1400 and an oops results.
> I don't know enough to point the finger really.
>
> There are probably only 2 people using this board still too. So I doubt
> it really matters. :)

Is this an ARM machine? The platform specific mach/io.h header file
in that case defines an __io() macro that is responsible for mapping
port numbers to virtual addresses.

You have to ioremap() the physical address 0xfe240000 to a virtual
address, and then add the base address to the number inside of the
__io macro, e.g.

/* in mach/io.h: */
extern void __iomem *this_board_pci_iospace;
#define __io(x) ((x & 0xffff) + this_board_pci_iospace)

/* in pci controller setup code: */
this_board_pci_iospace = ioremap(0xfe240000, 0x10000);

Arnd
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/