linux-m68k.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* EtherNat drivers (was: Re: Atari ROM port ISA)
@ 2012-05-17 14:49 David Gálvez
  2012-05-18  7:43 ` Michael Schmitz
  0 siblings, 1 reply; 6+ messages in thread
From: David Gálvez @ 2012-05-17 14:49 UTC (permalink / raw)
  To: Michael Schmitz; +Cc: Geert Uytterhoeven, Thorsten Glaser, linux-m68k

2012/5/17 Michael Schmitz <schmitzmic@googlemail.com>:
> On 17/05/12 18:10, David Gálvez wrote:
>>
>> EtherNat's nertwork driver is working fine.
>
> That's good to know. Well, not entirely - it does mean my EtherNAT is dead
> ...
>
> What interrupt does it report it uses? Do you see the card interrupts
> accumulate in /proc/interrupts?
>

smc91x: IOADDR 0902c000 doesn't match configuration (300).
smc91x.c: v1.1, sep 22 2004 by Nicolas Pitre <nico@fluxnic.net>
eth0: SMC91C11xFD (rev 2) at 0902c000 IRQ 140 [nowait]

/proc/interrupts has this entry:

140:        68       atari    eth0

>> When loading the USB driver I'm getting this:
>>
>> usbcore: registered new interface driver usbfs
>> usbcore: registered new interface driver hub
>> usbcore: registered new device driver usb
>> isp116x-hcd isp116x-hcd: ISP116x Host Controller
>> isp116x-hcd isp116x-hcd: new USB bus registered, assigned bus number 1
>> 116x: Clock not ready after 15ms
>> 116x: Please make sure that the H_WAKEUP pin is pulled low!
>> isp116x-hcd isp116x-hcd: can't setup
>> isp116x-hcd isp116x-hcd: USB bus 1 deregistered
>> 116x: init error, -19
>
> Just what I'm getting as well. Back to the drawing board. I'll have to get
> confirmation on the exact addresses being used from the EtherNAT designer.
>

The addresses are these:

ISP116X_HCD_ADDR	0x80000016
ISP116X_HCD_DATA 	0x80000012

Regards

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

* Re: EtherNat drivers (was: Re: Atari ROM port ISA)
  2012-05-17 14:49 EtherNat drivers (was: Re: Atari ROM port ISA) David Gálvez
@ 2012-05-18  7:43 ` Michael Schmitz
  2012-05-18 19:26   ` David Gálvez
  0 siblings, 1 reply; 6+ messages in thread
From: Michael Schmitz @ 2012-05-18  7:43 UTC (permalink / raw)
  To: David Gálvez
  Cc: Michael Schmitz, Geert Uytterhoeven, Thorsten Glaser, linux-m68k

On 18/05/12 02:49, David Gálvez wrote:
> What interrupt does it report it uses? Do you see the card interrupts
> accumulate in /proc/interrupts?
>
> smc91x: IOADDR 0902c000 doesn't match configuration (300).
> smc91x.c: v1.1, sep 22 2004 by Nicolas Pitre<nico@fluxnic.net>
> eth0: SMC91C11xFD (rev 2) at 0902c000 IRQ 140 [nowait]
>
> /proc/interrupts has this entry:
>
> 140:        68       atari    eth0
That's good - now what is the transmit/receive speed you get with this 
driver on a large file transfer?
>> Just what I'm getting as well. Back to the drawing board. I'll have to get
>> confirmation on the exact addresses being used from the EtherNAT designer.
>>
> The addresses are these:
>
> ISP116X_HCD_ADDR	0x80000016
> ISP116X_HCD_DATA 	0x80000012
I don't think I tried that combination - where did you find that?

Anyway, new test kernel on the way. Won't do anything useful with the 
USB chipset other than hopefully probe it OK.

Thanks,

   Michael

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

* Re: EtherNat drivers (was: Re: Atari ROM port ISA)
  2012-05-18  7:43 ` Michael Schmitz
@ 2012-05-18 19:26   ` David Gálvez
  2012-05-19  4:06     ` Michael Schmitz
  0 siblings, 1 reply; 6+ messages in thread
From: David Gálvez @ 2012-05-18 19:26 UTC (permalink / raw)
  To: Michael Schmitz; +Cc: Geert Uytterhoeven, Thorsten Glaser, linux-m68k

2012/5/18 Michael Schmitz <schmitzmic@googlemail.com>:
> On 18/05/12 02:49, David Gálvez wrote:
>>
>> What interrupt does it report it uses? Do you see the card interrupts
>> accumulate in /proc/interrupts?
>>
>> smc91x: IOADDR 0902c000 doesn't match configuration (300).
>> smc91x.c: v1.1, sep 22 2004 by Nicolas Pitre<nico@fluxnic.net>
>> eth0: SMC91C11xFD (rev 2) at 0902c000 IRQ 140 [nowait]
>>
>> /proc/interrupts has this entry:
>>
>> 140:        68       atari    eth0
>
> That's good - now what is the transmit/receive speed you get with this
> driver on a large file transfer?
>

Transfer by ftp of a 230 MB file, CT060 Falcon is the server, and my
Ubuntu machine the client.
Receiving the file the speed stabilizes around 85 KB/s.
Transmitting the speed stabilizes around 105 KB/s


>> The addresses are these:
>>
>> ISP116X_HCD_ADDR        0x80000016
>> ISP116X_HCD_DATA        0x80000012
>
> I don't think I tried that combination - where did you find that?
>

Those addresses are used by the Ethernat USB driver for MiNT, which
it's working quite well.


> Anyway, new test kernel on the way. Won't do anything useful with the USB
> chipset other than hopefully probe it OK.
>

Below, you can find what I'm getting with this new kernel and module.
One important thing, ISP116x data bus has 16 bits, the EtherNat
hardware swaps both bytes before writing them to the bus or after
reading from it. I'm sure the driver doesn't consider this, so I think
this is the reason why an ivalid chip ID is gotten.


usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
isp116x-hcd isp116x-hcd: ISP116x Host Controller
isp116x-hcd isp116x-hcd: new USB bus registered, assigned bus number 1
116x: Clock not ready after 15ms
116x: Please make sure that the H_WAKEUP pin is pulled low!
isp116x-hcd isp116x-hcd: irq 139, io base 0x80000012
116x: Invalid chip ID 1000
isp116x-hcd isp116x-hcd: startup error -19
isp116x-hcd isp116x-hcd: USB bus 1 deregistered
116x: init error, -19

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

* Re: EtherNat drivers (was: Re: Atari ROM port ISA)
  2012-05-18 19:26   ` David Gálvez
@ 2012-05-19  4:06     ` Michael Schmitz
  2012-05-19  9:30       ` David Gálvez
  0 siblings, 1 reply; 6+ messages in thread
From: Michael Schmitz @ 2012-05-19  4:06 UTC (permalink / raw)
  To: David Gálvez; +Cc: Michael Schmitz, Geert Uytterhoeven, linux-m68k

Hi David,
>> That's good - now what is the transmit/receive speed you get with this
>> driver on a large file transfer?
>>
> Transfer by ftp of a 230 MB file, CT060 Falcon is the server, and my
> Ubuntu machine the client.
> Receiving the file the speed stabilizes around 85 KB/s.
> Transmitting the speed stabilizes around 105 KB/s
That's not that great - I think I can get similar speeds with the 
EtherNEC. Do you know how to use netcat?
>
>
>>> The addresses are these:
>>>
>>> ISP116X_HCD_ADDR        0x80000016
>>> ISP116X_HCD_DATA        0x80000012
>> I don't think I tried that combination - where did you find that?
>>
> Those addresses are used by the Ethernat USB driver for MiNT, which
> it's working quite well.
I've never seen MiNT sources for the EtherNAT USB. Can I download that 
somewhere to check how the register access is done there?
>
>
>> Anyway, new test kernel on the way. Won't do anything useful with the USB
>> chipset other than hopefully probe it OK.
>>
> Below, you can find what I'm getting with this new kernel and module.
> One important thing, ISP116x data bus has 16 bits, the EtherNat
> hardware swaps both bytes before writing them to the bus or after
> reading from it. I'm sure the driver doesn't consider this, so I think
> this is the reason why an ivalid chip ID is gotten.
The ISP1160 is a little endian device, as is the SMC91C111. For the 
91C111, the driver swaps bytes in word or longword transfers; there's no 
hardware byte swap apparently. For the ISP116x driver, the bus is 
assumed to be little endian and the driver swaps all word transfers.

I'll change that to use non-swapped accessors, let's see how that goes.
> usbcore: registered new interface driver usbfs
> usbcore: registered new interface driver hub
> usbcore: registered new device driver usb
> isp116x-hcd isp116x-hcd: ISP116x Host Controller
> isp116x-hcd isp116x-hcd: new USB bus registered, assigned bus number 1
> 116x: Clock not ready after 15ms
> 116x: Please make sure that the H_WAKEUP pin is pulled low!
> isp116x-hcd isp116x-hcd: irq 139, io base 0x80000012
> 116x: Invalid chip ID 1000
> isp116x-hcd isp116x-hcd: startup error -19
> isp116x-hcd isp116x-hcd: USB bus 1 deregistered
> 116x: init error, -19
Seems I've left my debug hacks in the driver :-) My Falcon reports the 
exact same thing so maybe the USB part of the EtherNAT is still working.

Byte swapping makes the chip ID come out as 0010. It should be something 
like 61xx. I'll send the new module anyway, maybe your result is different.

Thanks,

   Michael

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

* Re: EtherNat drivers (was: Re: Atari ROM port ISA)
  2012-05-19  4:06     ` Michael Schmitz
@ 2012-05-19  9:30       ` David Gálvez
  2012-05-19 21:50         ` Michael Schmitz
  0 siblings, 1 reply; 6+ messages in thread
From: David Gálvez @ 2012-05-19  9:30 UTC (permalink / raw)
  To: Michael Schmitz; +Cc: Geert Uytterhoeven, linux-m68k

Hi Michael,

2012/5/19 Michael Schmitz <schmitzmic@googlemail.com>:
> Hi David,
>> Transfer by ftp of a 230 MB file, CT060 Falcon is the server, and my
>> Ubuntu machine the client.
>> Receiving the file the speed stabilizes around 85 KB/s.
>> Transmitting the speed stabilizes around 105 KB/s
>
> That's not that great - I think I can get similar speeds with the EtherNEC.
> Do you know how to use netcat?
>

No, I've never used it, but I can learn :-)

To have something to be compared to, these are the speed values under
MiNT with the same file, MiNT as ftp server:

Transferring is around 1.1 MB/s
Receiving is around 630 KB/s

I wonder if the culprit of the low transfer values under Linux is the
driver. I mean, for me here under Linux everything seems very slow,
long booting time, install a packet with apt-get also takes very long.
Don't you think that this issue of kernel only able to be run from
ST-Ram is the culprit here? When a module is installed  where is
loaded into the ST-Ram or TT-Ram?

>
> I've never seen MiNT sources for the EtherNAT USB. Can I download that
> somewhere to check how the register access is done there?
>

http://sparemint.org/cgi-bin/cvsweb/freemint/sys/usb/src.km/ucd/ethernat/#dirlist

The good news is that the routines to access the data bus of the
ISP116x chip are almost the same in both drivers.
Take a look at the changes I did in the functions
write_ptddata_to_fifo and read_ptddata_from_fifo in the MiNT driver.
Also in functions pack_fifo and unpack_fifo there are changes
regarding swapping bytes

>> Below, you can find what I'm getting with this new kernel and module.
>> One important thing, ISP116x data bus has 16 bits, the EtherNat
>> hardware swaps both bytes before writing them to the bus or after
>> reading from it. I'm sure the driver doesn't consider this, so I think
>> this is the reason why an ivalid chip ID is gotten.
>
> The ISP1160 is a little endian device, as is the SMC91C111. For the 91C111,
> the driver swaps bytes in word or longword transfers; there's no hardware
> byte swap apparently. For the ISP116x driver, the bus is assumed to be
> little endian and the driver swaps all word transfers.
>
> I'll change that to use non-swapped accessors, let's see how that goes.
>

Consider also the function isp116x_write_addr in isp116x.h, this
function shouldn't swap the bytes to write the register addresses to
the bus because is going to be done by EtherNat hardware. I think
Linux driver is writing wrong register addresses because this.


>
> Byte swapping makes the chip ID come out as 0010. It should be something
> like 61xx. I'll send the new module anyway, maybe your result is different.
>

I get the same as you.

isp116x-hcd isp116x-hcd: ISP116x Host Controller
isp116x-hcd isp116x-hcd: new USB bus registered, assigned bus number 1
116x: Clock not ready after 15ms
116x: Please make sure that the H_WAKEUP pin is pulled low!
isp116x-hcd isp116x-hcd: irq 139, io base 0x80000012
116x: Invalid chip ID 0010
isp116x-hcd isp116x-hcd: startup error -19
isp116x-hcd isp116x-hcd: USB bus 1 deregistered
116x: init error, -19


Regards

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

* Re: EtherNat drivers (was: Re: Atari ROM port ISA)
  2012-05-19  9:30       ` David Gálvez
@ 2012-05-19 21:50         ` Michael Schmitz
  0 siblings, 0 replies; 6+ messages in thread
From: Michael Schmitz @ 2012-05-19 21:50 UTC (permalink / raw)
  To: David Gálvez; +Cc: Michael Schmitz, Geert Uytterhoeven, linux-m68k

David,
> That's not that great - I think I can get similar speeds with the EtherNEC.
> Do you know how to use netcat?
>
> No, I've never used it, but I can learn :-)
I'll send you what I used in my tests (reading from /dev/zero on one 
end, writing to /dev/null on the other).

> To have something to be compared to, these are the speed values under
> MiNT with the same file, MiNT as ftp server:
>
> Transferring is around 1.1 MB/s
> Receiving is around 630 KB/s
That's more like it.
> I wonder if the culprit of the low transfer values under Linux is the
> driver. I mean, for me here under Linux everything seems very slow,
> long booting time, install a packet with apt-get also takes very long.
> Don't you think that this issue of kernel only able to be run from
> ST-Ram is the culprit here? When a module is installed  where is
> loaded into the ST-Ram or TT-Ram?
I don't honestly know - I't think it would be TT-RAM though.

Kernel load times and response times have degraded progressively since 
the 2.4 series. On the same hardware.
>> I've never seen MiNT sources for the EtherNAT USB. Can I download that
>> somewhere to check how the register access is done there?
>>
> http://sparemint.org/cgi-bin/cvsweb/freemint/sys/usb/src.km/ucd/ethernat/#dirlist
I'll take a look at that.
> The good news is that the routines to access the data bus of the
> ISP116x chip are almost the same in both drivers.
> Take a look at the changes I did in the functions
> write_ptddata_to_fifo and read_ptddata_from_fifo in the MiNT driver.
> Also in functions pack_fifo and unpack_fifo there are changes
> regarding swapping bytes
Thanks, I don't think we've got to anything in relation to the PTD data 
yet (that uses __raw_inw on Linux which still may have endianness issues).
>> The ISP1160 is a little endian device, as is the SMC91C111. For the 91C111,
>> the driver swaps bytes in word or longword transfers; there's no hardware
>> byte swap apparently. For the ISP116x driver, the bus is assumed to be
>> little endian and the driver swaps all word transfers.
>>
>> I'll change that to use non-swapped accessors, let's see how that goes.
>>
> Consider also the function isp116x_write_addr in isp116x.h, this
> function shouldn't swap the bytes to write the register addresses to
> the bus because is going to be done by EtherNat hardware. I think
> Linux driver is writing wrong register addresses because this.
No, I've removed the byte swapping from both read and write accessors. 
Register numbers should be OK that way.

>> Byte swapping makes the chip ID come out as 0010. It should be something
>> like 61xx. I'll send the new module anyway, maybe your result is different.
>>
> I get the same as you.
Still hope for my EtherNAT then :-)

I'll poke around some more and post what patches I have for USB.

Thanks yet again,

   Michael

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

end of thread, other threads:[~2012-05-19 21:50 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-17 14:49 EtherNat drivers (was: Re: Atari ROM port ISA) David Gálvez
2012-05-18  7:43 ` Michael Schmitz
2012-05-18 19:26   ` David Gálvez
2012-05-19  4:06     ` Michael Schmitz
2012-05-19  9:30       ` David Gálvez
2012-05-19 21:50         ` Michael Schmitz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).