Re: Any plans for 8-bit SMC8xxx network card driver?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Marc,

Finally I managed to reach my old flat where I keep my old XT. I did 
modifications to ELKS as in the attachment and booted it from floppy 
(still don't know how to boot it over XT-IDE from HD image! I managed to 
buy, just for ELKS experiments, 32MB CF card in 2018 from some on-line 
store in Japan! dd to /dev/sdb1 doesn't seem to copy bootstrap code to 
the boot sector, dd directly to /dev/sdb creates whole of a mess in place 
of partition table, and it still doesn't boot).

As I booted newly built ELKS, this time there was no interrupt acquisition 
error, frankly no errors at all, brief message that ne2k driver was 
initialized properly.

I tried to ping it by mac address (found some macping script on 
stackoverflow: https://stackoverflow.com/a/43478858) unfortunately, no 
reply (alhough the diodes on the RJ-45 socket were blinking during that). 
It would be easier to have IP address set, but I couldn't find anything 
like that in menuconfig. I guess more progress will be possible when I get 
there next time.

Thanks,
Paul

On Thu, 12 Apr 2018, Paul Osmialowski wrote:

> Hi Marc,
> 
> Thanks for the hint, it saved me a lot of effort, I'll do 
> further experiments with N2K driver as soon as I'll be able to run this 
> machine again.
> 
> Thanks,
> Paul
> 
> On Thu, 12 Apr 2018, Marc-François Lucca-Daniau wrote:
> 
> > Thanks for the snapshot, it helped a lot.
> > 
> > The main chip of your card is the WD83C690, that is a clone of the
> > DP8390D (same packaging with the first pin in the middle of one side).
> > After reading the PD8390D datasheet, I suddenly remembered that this
> > chip is part of the NE1K / NE2K reference design.
> > 
> > So, to answer your question, it would be easy to tune the existing
> > ELKS N2K driver for your card, without any challenge. You would have
> > only to tune the IRQ and the I/O base, and address the usual tricks of
> > the NE2K implementations. As the ROM slot is not populated, I guess
> > you could forget the MEM base.
> > 
> > MFLD
> > 
> > 
> > 2018-04-12 17:34 GMT+02:00 Paul Osmialowski <pawelo@xxxxxxxxxxx>:
> > > Hi Guys,
> > >
> > > Attached is the requested snapshot. Unfortunately, some change occured in
> > > the meantime, and now I need to postpone activities on this until summer
> > > cos nowadays I have very limited access to the place where this stuff is
> > > kept.
> > >
> > > Other than that, under FreeDOS it's configured as such:
> > >
> > > Packet driver for SMC8xxx adapters
> > > Packet driver interrupt 0x60 (96)
> > > Adapter: 8003WC
> > > I/O port: 0x240 (576)
> > > Interrupt number: 0x2 (2)
> > > Memory address: 0xCCE00 (839168)
> > > MAC: 00:00:c0:xx:xx:xx (so it's https://www.macvendorlookup.com/browse/192
> > > - Western Digital)
> > >
> > > Thanks,
> > > Paul
> > >
> > > On Mon, 9 Apr 2018, Marc-François Lucca-Daniau wrote:
> > >
> > >> Could you at least take one or two snapshots of your card, to be able
> > >> to see the ICs references ?
> > >>
> > >> MFLD
> > >>
> > >>
> > >> 2018-04-09 15:00 GMT+02:00 Paul Osmialowski <pawelo@xxxxxxxxxxx>:
> > >> > Unfortunately, I'm afraid only Donald Becker may have in-depth knowledge
> > >> > abot the interior of such a card.
> > >> >
> > >> > On Mon, 9 Apr 2018, Marc-François Lucca-Daniau wrote:
> > >> >
> > >> >> Hello Paul,
> > >> >>
> > >> >> The SMC8003WC looks like to be an ISA card, so I see no big challenge
> > >> >> to implement its driver in ELKS.
> > >> >> The problem would be to test that driver, as I got no such card, and
> > >> >> QEMU does not emulate this one.
> > >> >> Do you have the WD8003 datasheet ?
> > >> >>
> > >> >> MFLD
> > >> >>
> > >> >>
> > >> >> 2018-04-08 21:18 GMT+02:00 Paul Osmialowski <pawelo@xxxxxxxxxxx>:
> > >> >> > Hello,
> > >> >> >
> > >> >> > I've found SMC8003WC an extremly useful card as it has normal RJ-45 socket
> > >> >> > and it can 'talk' to my modern era machines (ping and telnet them by
> > >> >> > their IP addresses from FreeDOS). I believe that under Linux it is
> > >> >> > operated by 1993-94's drivers/net/ethernet/8390/wd.c driver ('This is a
> > >> >> > driver for WD8003 and WD8013 "compatible" ethercards'). What are the
> > >> >> > possible challenges in porting such an driver from 'full' Linux to ELKS?
> > >> >> >
> > >> >> > Best regards,
> > >> >> > Paul
> > >> >> > --
> > >> >> > To unsubscribe from this list: send the line "unsubscribe linux-8086" in
> > >> >> > the body of a message to majordomo@xxxxxxxxxxxxxxx
> > >> >> > More majordomo info at  http://vger.kernel.org/majordomo-info.html
> > >> >> --
> > >> >> To unsubscribe from this list: send the line "unsubscribe linux-8086" in
> > >> >> the body of a message to majordomo@xxxxxxxxxxxxxxx
> > >> >> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> > >> >>
> > >> --
> > >> To unsubscribe from this list: send the line "unsubscribe linux-8086" in
> > >> the body of a message to majordomo@xxxxxxxxxxxxxxx
> > >> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> > >>
> > --
> > To unsubscribe from this list: send the line "unsubscribe linux-8086" in
> > the body of a message to majordomo@xxxxxxxxxxxxxxx
> > More majordomo info at  http://vger.kernel.org/majordomo-info.html
> > 
diff --git a/elks/arch/i86/drivers/net/ne2k-low.s b/elks/arch/i86/drivers/net/ne2k-low.s
index 1733f709..72a90474 100644
--- a/elks/arch/i86/drivers/net/ne2k-low.s
+++ b/elks/arch/i86/drivers/net/ne2k-low.s
@@ -7,7 +7,7 @@
 
 ; On Advantech SNMP-1000 SBC, the ethernet interrupt is INT0 (0Ch)
 
-int_vect    EQU $0C
+int_vect    EQU $60
 
 
 	.TEXT
diff --git a/elks/arch/i86/drivers/net/ne2k-mac.s b/elks/arch/i86/drivers/net/ne2k-mac.s
index e5e2884c..9c46478e 100644
--- a/elks/arch/i86/drivers/net/ne2k-mac.s
+++ b/elks/arch/i86/drivers/net/ne2k-mac.s
@@ -6,42 +6,42 @@
 
 // TODO: move definitions to ne2k-defs.s
 
-// I/O base @ 300h
+// I/O base @ 240h
 
-io_ne2k_command    = 0x0300
+io_ne2k_command    = 0x0240
 
-io_ne2k_rx_first   = 0x0301  // page 0
-io_ne2k_rx_last    = 0x0302  // page 0
-io_ne2k_rx_get     = 0x0303  // page 0
+io_ne2k_rx_first   = 0x0241  // page 0
+io_ne2k_rx_last    = 0x0242  // page 0
+io_ne2k_rx_get     = 0x0243  // page 0
 
 // This is not a true NE2K register
-//io_ne2k_rx_put1    = 0x0306  // page 0 - read
+//io_ne2k_rx_put1    = 0x0246  // page 0 - read
 
-io_ne2k_tx_start   = 0x0304  // page 0 - write
-io_ne2k_tx_len1    = 0x0305  // page 0 - write
-io_ne2k_tx_len2    = 0x0306  // page 0 - write
+io_ne2k_tx_start   = 0x0244  // page 0 - write
+io_ne2k_tx_len1    = 0x0245  // page 0 - write
+io_ne2k_tx_len2    = 0x0246  // page 0 - write
 
-io_ne2k_int_stat   = 0x0307  // page 0
+io_ne2k_int_stat   = 0x0247  // page 0
 
-io_ne2k_dma_addr1  = 0x0308  // page 0
-io_ne2k_dma_addr2  = 0x0309  // page 0
-io_ne2k_dma_len1   = 0x030A  // page 0 - write
-io_ne2k_dma_len2   = 0x030B  // page 0 - write
+io_ne2k_dma_addr1  = 0x0248  // page 0
+io_ne2k_dma_addr2  = 0x0249  // page 0
+io_ne2k_dma_len1   = 0x024A  // page 0 - write
+io_ne2k_dma_len2   = 0x024B  // page 0 - write
 
-io_ne2k_rx_stat    = 0x030C  // page 0 - read
+io_ne2k_rx_stat    = 0x024C  // page 0 - read
 
-io_ne2k_rx_conf    = 0x030C  // page 0 - write
-io_ne2k_tx_conf    = 0x030D  // page 0 - write
-io_ne2k_data_conf  = 0x030E  // page 0 - write
-io_ne2k_int_mask   = 0x030F  // page 0 - write
+io_ne2k_rx_conf    = 0x024C  // page 0 - write
+io_ne2k_tx_conf    = 0x024D  // page 0 - write
+io_ne2k_data_conf  = 0x024E  // page 0 - write
+io_ne2k_int_mask   = 0x024F  // page 0 - write
 
-io_ne2k_unicast    = 0x0301  // page 1 - 6 bytes
-io_ne2k_rx_put     = 0x0307  // page 1
-io_ne2k_multicast  = 0x0308  // page 1 - 8 bytes
+io_ne2k_unicast    = 0x0241  // page 1 - 6 bytes
+io_ne2k_rx_put     = 0x0247  // page 1
+io_ne2k_multicast  = 0x0248  // page 1 - 8 bytes
 
-io_ne2k_data_io    = 0x0310  // 2 bytes
+io_ne2k_data_io    = 0x0250  // 2 bytes
 
-io_ne2k_reset      = 0x031F
+io_ne2k_reset      = 0x025F
 
 
 // Ring segmentation
diff --git a/elks/arch/i86/drivers/net/ne2k-main.c b/elks/arch/i86/drivers/net/ne2k-main.c
index 6e66e544..4c0517eb 100644
--- a/elks/arch/i86/drivers/net/ne2k-main.c
+++ b/elks/arch/i86/drivers/net/ne2k-main.c
@@ -21,7 +21,7 @@
 
 static byte_t ne2k_inuse = 0;
 
-static byte_t mac_addr [6] = {0x52, 0x54, 0x00, 0x12, 0x34, 0x56};  // QEMU default
+static byte_t mac_addr [6] = {0x00, 0x00, 0xc0, 0x16, 0x8f, 0x43};  // WDC
 
 static struct wait_queue rx_queue;
 static struct wait_queue tx_queue;
@@ -314,14 +314,14 @@ void ne2k_drv_init ()
 		err = ne2k_probe ();
 		if (err)
 			{
-			printk ("[eth] NE2K not detected @ IO 300h\n");
+			printk ("[eth] NE2K not detected @ IO 240h\n");
 			break;
 			}
 
 		err = request_irq (NE2K_IRQ, ne2k_int, NULL);
 		if (err)
 			{
-			printk ("[eth] IRQ 9 request error: %i\n", err);
+			printk ("[eth] IRQ 2 request error: %i\n", err);
 			break;
 			}
 
diff --git a/elks/arch/i86/drivers/net/ne2k-phy.s b/elks/arch/i86/drivers/net/ne2k-phy.s
index acbd673f..3b55b70c 100644
--- a/elks/arch/i86/drivers/net/ne2k-phy.s
+++ b/elks/arch/i86/drivers/net/ne2k-phy.s
@@ -5,10 +5,10 @@
 
 ; TODO: move definitions to ne2k.h
 
-; I/O base @ 300h
+; I/O base @ 240h
 
-io_ne2k_mdio     EQU $314
-io_ne2k_gpio     EQU $317
+io_ne2k_mdio     EQU $254
+io_ne2k_gpio     EQU $257
 
 ; MDIO register
 
diff --git a/elks/arch/i86/drivers/net/ne2k.h b/elks/arch/i86/drivers/net/ne2k.h
index 98e64b8f..cc97aaaa 100644
--- a/elks/arch/i86/drivers/net/ne2k.h
+++ b/elks/arch/i86/drivers/net/ne2k.h
@@ -4,7 +4,7 @@
 
 // Default in QEMU
 
-#define NE2K_IRQ 9
+#define NE2K_IRQ 2
 
 
 // NE2K status

[Index of Archives]     [Kernel]     [Linux ia64]     [DCCP]     [Linux for ARM]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux