public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot-Users] GT-64120 PCI init
@ 2008-08-07 12:05 Richard Danter
  2008-08-08  2:31 ` Jerry Van Baren
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Richard Danter @ 2008-08-07 12:05 UTC (permalink / raw)
  To: u-boot

Hi all,

I have an old MIPS board with a GT-64120 that I would like to port
U-Boot to. I have so far got it to boot from flash, init SDRAM and a
serial console and give me a prompt so I can run some commands. I am
also able to write flash for saving env vars, etc. To make this really
useful however I need to get PCI working and then Ethernet.

I don't see any 64120 driver/init code in the sources so unless I have
missed something I guess I am going to have to write some.

Having not done this before can anyone suggest where to start?

Thanks
Rich

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [U-Boot-Users] GT-64120 PCI init
  2008-08-07 12:05 [U-Boot-Users] GT-64120 PCI init Richard Danter
@ 2008-08-08  2:31 ` Jerry Van Baren
  2008-08-08  2:44 ` [U-Boot] " Jerry Van Baren
  2008-08-08 14:39 ` Richard Danter
  2 siblings, 0 replies; 8+ messages in thread
From: Jerry Van Baren @ 2008-08-08  2:31 UTC (permalink / raw)
  To: u-boot

Richard Danter wrote:
> Hi all,
> 
> I have an old MIPS board with a GT-64120 that I would like to port
> U-Boot to. I have so far got it to boot from flash, init SDRAM and a
> serial console and give me a prompt so I can run some commands. I am
> also able to write flash for saving env vars, etc. To make this really
> useful however I need to get PCI working and then Ethernet.
> 
> I don't see any 64120 driver/init code in the sources so unless I have
> missed something I guess I am going to have to write some.

Looks like it.

> Having not done this before can anyone suggest where to start?

Data sheets if you have them.

Google says linux drivers may be a useful reference.
   <http://www.linux-mips.org/archives/linux-mips/2006-12/msg00233.html>

> Thanks
> Rich

Good luck,
gvb

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [U-Boot] [U-Boot-Users] GT-64120 PCI init
  2008-08-07 12:05 [U-Boot-Users] GT-64120 PCI init Richard Danter
  2008-08-08  2:31 ` Jerry Van Baren
@ 2008-08-08  2:44 ` Jerry Van Baren
  2008-08-08 14:39 ` Richard Danter
  2 siblings, 0 replies; 8+ messages in thread
From: Jerry Van Baren @ 2008-08-08  2:44 UTC (permalink / raw)
  To: u-boot

Richard Danter wrote:
> Hi all,
> 
> I have an old MIPS board with a GT-64120 that I would like to port
> U-Boot to. I have so far got it to boot from flash, init SDRAM and a
> serial console and give me a prompt so I can run some commands. I am
> also able to write flash for saving env vars, etc. To make this really
> useful however I need to get PCI working and then Ethernet.
> 
> I don't see any 64120 driver/init code in the sources so unless I have
> missed something I guess I am going to have to write some.

Looks like it.

> Having not done this before can anyone suggest where to start?

Data sheets if you have them.

Google says linux drivers may be a useful reference.
   <http://www.linux-mips.org/archives/linux-mips/2006-12/msg00233.html>

> Thanks
> Rich

Good luck,
gvb

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [U-Boot-Users] GT-64120 PCI init
  2008-08-07 12:05 [U-Boot-Users] GT-64120 PCI init Richard Danter
  2008-08-08  2:31 ` Jerry Van Baren
  2008-08-08  2:44 ` [U-Boot] " Jerry Van Baren
@ 2008-08-08 14:39 ` Richard Danter
  2008-08-08 14:42   ` [U-Boot] " Richard Danter
  2 siblings, 1 reply; 8+ messages in thread
From: Richard Danter @ 2008-08-08 14:39 UTC (permalink / raw)
  To: u-boot

2008/8/7 Richard Danter <radanter@googlemail.com>:
> I have an old MIPS board with a GT-64120 that I would like to port
> U-Boot to. I have so far got it to boot from flash, init SDRAM and a
> serial console and give me a prompt so I can run some commands. I am
> also able to write flash for saving env vars, etc. To make this really
> useful however I need to get PCI working and then Ethernet.
>
> I don't see any 64120 driver/init code in the sources so unless I have
> missed something I guess I am going to have to write some.

I now have a driver that initialises the 64120 and U-Boot sees the
bridge and Ethernet card. So far so good! But the Ethernet card can
not ping anything on my network.

This is what I see...

--8<--
U-Boot 1.3.3-svn19 (Aug  8 2008 - 15:32:31)

Board: PPMC MIPS
DRAM:  64 MB
Flash:  4 MB
In:    serial
Out:   serial
Err:   serial
Net:   i82559#0
=> pci
Scanning PCI devices on bus 0
BusDevFun  VendorId   DeviceId   Device Class       Sub-Class
_____________________________________________________________
00.00.00   0x11ab     0x4620     Bridge device           0x00
00.07.00   0x8086     0x1030     Network controller      0x00
00.08.00   0x1011     0x0026     Bridge device           0x04
=> printenv
baudrate=9600
ethact=i82559#0
ipaddr=192.168.1.84
netmask=255.255.255.0
stdin=serial
stdout=serial
stderr=serial

Environment size: 113/32764 bytes
=> ping 192.168.1.1
i82559#0: Tx error buffer not ready
ping failed; host 192.168.1.1 is not alive
--8<--

My guess is that there is probably still something I did not do in the
PCI init code, but I have looked@as many examples as I can find and
I can't see anything amiss. Any thoughts on what would case the buffer
not to work even though the Ethernet card itself is seen and appears
to be detected correctly?

Thanks again!
Rich

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [U-Boot] GT-64120 PCI init
  2008-08-08 14:39 ` Richard Danter
@ 2008-08-08 14:42   ` Richard Danter
  2008-08-12  2:20     ` Richard Danter
  0 siblings, 1 reply; 8+ messages in thread
From: Richard Danter @ 2008-08-08 14:42 UTC (permalink / raw)
  To: u-boot

2008/8/7 Richard Danter <radanter@googlemail.com>:
> I have an old MIPS board with a GT-64120 that I would like to port
> U-Boot to. I have so far got it to boot from flash, init SDRAM and a
> serial console and give me a prompt so I can run some commands. I am
> also able to write flash for saving env vars, etc. To make this really
> useful however I need to get PCI working and then Ethernet.
>
> I don't see any 64120 driver/init code in the sources so unless I have
> missed something I guess I am going to have to write some.

I now have a driver that initialises the 64120 and U-Boot sees the
bridge and Ethernet card. So far so good! But the Ethernet card can
not ping anything on my network.

This is what I see...

--8<--
U-Boot 1.3.3-svn19 (Aug  8 2008 - 15:32:31)

Board: PPMC MIPS
DRAM:  64 MB
Flash:  4 MB
In:    serial
Out:   serial
Err:   serial
Net:   i82559#0
=> pci
Scanning PCI devices on bus 0
BusDevFun  VendorId   DeviceId   Device Class       Sub-Class
_____________________________________________________________
00.00.00   0x11ab     0x4620     Bridge device           0x00
00.07.00   0x8086     0x1030     Network controller      0x00
00.08.00   0x1011     0x0026     Bridge device           0x04
=> printenv
baudrate=9600
ethact=i82559#0
ipaddr=192.168.1.84
netmask=255.255.255.0
stdin=serial
stdout=serial
stderr=serial

Environment size: 113/32764 bytes
=> ping 192.168.1.1
i82559#0: Tx error buffer not ready
ping failed; host 192.168.1.1 is not alive
--8<--

My guess is that there is probably still something I did not do in the
PCI init code, but I have looked@as many examples as I can find and
I can't see anything amiss. Any thoughts on what would case the buffer
not to work even though the Ethernet card itself is seen and appears
to be detected correctly?

Thanks again!
Rich

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [U-Boot] GT-64120 PCI init
  2008-08-08 14:42   ` [U-Boot] " Richard Danter
@ 2008-08-12  2:20     ` Richard Danter
  2008-08-12  4:33       ` Richard Danter
  0 siblings, 1 reply; 8+ messages in thread
From: Richard Danter @ 2008-08-12  2:20 UTC (permalink / raw)
  To: u-boot

2008/8/8 Richard Danter <radanter@googlemail.com>:
> I now have a driver that initialises the 64120 and U-Boot sees the
> bridge and Ethernet card. So far so good! But the Ethernet card can
> not ping anything on my network.
>
> This is what I see...
>
> --8<--
> U-Boot 1.3.3-svn19 (Aug  8 2008 - 15:32:31)
>
> Board: PPMC MIPS
> DRAM:  64 MB
> Flash:  4 MB
> In:    serial
> Out:   serial
> Err:   serial
> Net:   i82559#0
> => pci
> Scanning PCI devices on bus 0
> BusDevFun  VendorId   DeviceId   Device Class       Sub-Class
> _____________________________________________________________
> 00.00.00   0x11ab     0x4620     Bridge device           0x00
> 00.07.00   0x8086     0x1030     Network controller      0x00
> 00.08.00   0x1011     0x0026     Bridge device           0x04
> => printenv
> baudrate=9600
> ethact=i82559#0
> ipaddr=192.168.1.84
> netmask=255.255.255.0
> stdin=serial
> stdout=serial
> stderr=serial
>
> Environment size: 113/32764 bytes
> => ping 192.168.1.1
> i82559#0: Tx error buffer not ready
> ping failed; host 192.168.1.1 is not alive
> --8<--
>
> My guess is that there is probably still something I did not do in the
> PCI init code, but I have looked at as many examples as I can find and
> I can't see anything amiss. Any thoughts on what would case the buffer
> not to work even though the Ethernet card itself is seen and appears
> to be detected correctly?

OK, I think I figured this out but still not sure what the correct
solution is...

The tx_ring and rx_ring buffers are being placed in SDRAM accessed via
kseg0 (cached) at 0x8nnnnnnn. After trying to ping and getting the
timeout I see the following at this location...

83ff8d30: 00000240 308dff03 16080001 00002203    ... at 0.........".
83ff8d40: 01002e00 60088868 0040f284 31050000    ....`..h. at ..1...

But if I look at the same physical address via kseg1 (uncached) at
0xAnnnnnnn then I see...

a3ff8d30: 00a00240 308dff03 16080001 00002203    ... at 0.........".
a3ff8d40: 01002e00 60088868 0040f284 31050000    ....`..h. at ..1...

I think the 00a0 at the start is the correct value (Tx done). Can
anyone confirm this?

If so then the problem seems to be that I need to read/write the Tx/Rx
buffers via kseg1 and not kseg0. But in general I want as much data
and code in kseg0 as possible to get the best performance.

What is the correct way to do this?

Thanks
Rich

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [U-Boot] GT-64120 PCI init
  2008-08-12  2:20     ` Richard Danter
@ 2008-08-12  4:33       ` Richard Danter
  2008-08-12  6:02         ` Shinya Kuribayashi
  0 siblings, 1 reply; 8+ messages in thread
From: Richard Danter @ 2008-08-12  4:33 UTC (permalink / raw)
  To: u-boot

2008/8/12 Richard Danter <radanter@googlemail.com>:
> 2008/8/8 Richard Danter <radanter@googlemail.com>:
>> I now have a driver that initialises the 64120 and U-Boot sees the
>> bridge and Ethernet card. So far so good! But the Ethernet card can
>> not ping anything on my network.
>>
>> This is what I see...
>>
>> --8<--
>> U-Boot 1.3.3-svn19 (Aug  8 2008 - 15:32:31)
>>
>> Board: PPMC MIPS
>> DRAM:  64 MB
>> Flash:  4 MB
>> In:    serial
>> Out:   serial
>> Err:   serial
>> Net:   i82559#0
>> => pci
>> Scanning PCI devices on bus 0
>> BusDevFun  VendorId   DeviceId   Device Class       Sub-Class
>> _____________________________________________________________
>> 00.00.00   0x11ab     0x4620     Bridge device           0x00
>> 00.07.00   0x8086     0x1030     Network controller      0x00
>> 00.08.00   0x1011     0x0026     Bridge device           0x04
>> => printenv
>> baudrate=9600
>> ethact=i82559#0
>> ipaddr=192.168.1.84
>> netmask=255.255.255.0
>> stdin=serial
>> stdout=serial
>> stderr=serial
>>
>> Environment size: 113/32764 bytes
>> => ping 192.168.1.1
>> i82559#0: Tx error buffer not ready
>> ping failed; host 192.168.1.1 is not alive
>> --8<--
>>
>> My guess is that there is probably still something I did not do in the
>> PCI init code, but I have looked at as many examples as I can find and
>> I can't see anything amiss. Any thoughts on what would case the buffer
>> not to work even though the Ethernet card itself is seen and appears
>> to be detected correctly?
>
> OK, I think I figured this out but still not sure what the correct
> solution is...
>
> The tx_ring and rx_ring buffers are being placed in SDRAM accessed via
> kseg0 (cached) at 0x8nnnnnnn. After trying to ping and getting the
> timeout I see the following at this location...
>
> 83ff8d30: 00000240 308dff03 16080001 00002203    ... at 0.........".
> 83ff8d40: 01002e00 60088868 0040f284 31050000    ....`..h. at ..1...
>
> But if I look at the same physical address via kseg1 (uncached) at
> 0xAnnnnnnn then I see...
>
> a3ff8d30: 00a00240 308dff03 16080001 00002203    ... at 0.........".
> a3ff8d40: 01002e00 60088868 0040f284 31050000    ....`..h. at ..1...
>
> I think the 00a0 at the start is the correct value (Tx done). Can
> anyone confirm this?

Confirmed myself.

Solution so far is either to run U-Boot from KSeg1 or to pepper the
eepro100 driver with flush_cache() calls. Both seem to work though
running in kseg1 is slower.

Has anyone else used an eepro100 on a MIPS target? Did you hit the same problem?

I can see that some drivers (e.g. rtl8139.c) already have the
flush_cache() calls.

Rich


>
> If so then the problem seems to be that I need to read/write the Tx/Rx
> buffers via kseg1 and not kseg0. But in general I want as much data
> and code in kseg0 as possible to get the best performance.
>
> What is the correct way to do this?
>
> Thanks
> Rich
>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [U-Boot] GT-64120 PCI init
  2008-08-12  4:33       ` Richard Danter
@ 2008-08-12  6:02         ` Shinya Kuribayashi
  0 siblings, 0 replies; 8+ messages in thread
From: Shinya Kuribayashi @ 2008-08-12  6:02 UTC (permalink / raw)
  To: u-boot

Richard Danter wrote:
> Solution so far is either to run U-Boot from KSeg1 or to pepper the
> eepro100 driver with flush_cache() calls. Both seem to work though
> running in kseg1 is slower.
> 
> Has anyone else used an eepro100 on a MIPS target? Did you hit the same problem?
> 
> I can see that some drivers (e.g. rtl8139.c) already have the
> flush_cache() calls.

I added flush_cache()s to rtl8139.c before.

If your system is cache non-coherent, please fix drivers to have proper
cache handlings. Also note that running whole U-Boot in CKSEG1 is not
good idea, at least for me.

  Shinya

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2008-08-12  6:02 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-07 12:05 [U-Boot-Users] GT-64120 PCI init Richard Danter
2008-08-08  2:31 ` Jerry Van Baren
2008-08-08  2:44 ` [U-Boot] " Jerry Van Baren
2008-08-08 14:39 ` Richard Danter
2008-08-08 14:42   ` [U-Boot] " Richard Danter
2008-08-12  2:20     ` Richard Danter
2008-08-12  4:33       ` Richard Danter
2008-08-12  6:02         ` Shinya Kuribayashi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox