
Hi Ben,
Thanks for having a look at this
On Mon, Apr 5, 2010 at 3:32 PM, Ben Warren biggerbadderben@gmail.com wrote:
HI Graeme,
On 3/25/2010 4:23 AM, Graeme Russ wrote:
I simply do not know why PCI_BASE_ADDRESS_1 has to be changed to PCI_BASE_ADDRESS_0 - Please comment
<snip>
}
+int board_eth_init(bd_t *bis) +{
int adapters;
adapters = pci_eth_init(bis);
if (adapters> 0)
eth_init(bis);
I'm not sure why you're calling eth_init() here. Are you sure that's what you want to do? Keep in mind that board_eth_init() gets called by eth_initialize() in the common net code.
I'll have a look at this and respin this patch
return adapters;
diff --git a/drivers/net/rtl8139.c b/drivers/net/rtl8139.c index db8a727..a3df564 100644 --- a/drivers/net/rtl8139.c +++ b/drivers/net/rtl8139.c @@ -214,7 +214,7 @@ int rtl8139_initialize(bd_t *bis) if ((devno = pci_find_devices(supported, idx++))< 0) break;
pci_read_config_dword(devno, PCI_BASE_ADDRESS_1,&iobase);
pci_read_config_dword(devno, PCI_BASE_ADDRESS_0,&iobase);
Are you fixing a bug here? This seems like a change that would have fairly wide-ranging implications beyond your board.
<snip>
If I use PCI_BASE_ADDRESS_1 I simply cannot get the Ethernet adapters to work (I get complete rubbish when accessing the registers). It took me a long time to figure this out and in the end I simply ran out of logical adjustments and started hacking around and this worked.
Maybe there is some special initialisation of the PCI host in the SC520 that would make this work. I really don't know the inner workings of talking to PCI devices and am taking a lot of what I am doing here on blind faith. If it gives you any more of an idea as to why this change is needed, I have to use PIO instead of MMIO for the Linux driver
Regards,
Graeme