can't access PCIe card under sbc8548

tiejun.chen tiejun.chen at windriver.com
Thu May 30 15:56:45 EST 2013


On 05/30/2013 11:42 AM, wolfking wrote:
> hi, all
>    I'm doing some developing on the windriver's sbc8548 board. The kernel I
> use
> is 3.6.10 and the u-boot version is 2012-10. I changed the board's
> configuration:
> the board now boot from the 64MB SODIMM Flash (not the default 8MB on-board
> Flash
> memory), and the PCI clock rate is changed to 33MHZ.
>    Now the trouble I am in is that: the PCI card (a NIC card rtl8139) can be
> accessed OK, while the PCIe card can't work, that is, the kernel can't
> access
> its internal register. The kernel can correctly probe the PCIe card. its
> BAR0
> is a I/O mapped register, I use ioport_map to map the BAR0 to kernel's
> address
> space, then use ioread8/iowrite8 to access its internal register, it doesn't
> work.
> I analyse the ioport_map function and find it just add the input parameter
> to
> a fixed _IO_BASE value, below is the function:
> void __iomem *ioport_map(unsigned long port, unsigned int len)
> {
> 	return (void __iomem *) (port + _IO_BASE);
> }
> the _IO_BASE value under sbc8548 is 0xfd7fd000, the value of ioport_map
> paramenter
> "port" is 0xfefff000. Obviously the add overflows, so the follow-up
> operations
> can't succeed. The value of "port" is got from the function
> pci_resource_start.

In PPC case I/O is memory-mapped, so you should use ioremap() instead of 
ioport_map()..

Tiejun


More information about the Linuxppc-dev mailing list