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

Re: Kernel 5.15 Amiga PCMCIA apne driver not working



Hi Carlos,

Am 03.01.2022 um 11:13 schrieb Carlos Milán Figueredo:
Hi Michael,

From: Michael Schmitz <schmitzmic@gmail.com>
Sent: sábado, 1 de enero de 2022 23:36
I was under the impression that you could (cross-)build your own kernel
and initrd? If that's not an option, testing is going to be much harder.

I am afraid not, I am building Debian Installer kernel images and initrd from Aranym following the building instructions here [1]. If there is documentation for installing a cross-compiler toolchain I will gladly give a try.

ARAnyM should work, too. You just need to add the attached patch to the list of patches applied (compile tested on 5.16-rc2) on top of the mainstream kernel source - as far as I remember, Debian applies any number of patches, and there is a file in the kernel image source package that describes which patches are needed for a given architecture. Haven't built a Debian kernel package in many years, so can't be more specific than that, sorry.


In [2] there is a function called ne2000_detect_8bit() that is used
for that. It looks like it reads the card ROM to figure out. I don't
know if the CIS is considered a ROM or not.

No, that only figures out what mode is set in the 8390 chip - AFAIK
needed to support NE1000 type cards. With 16 bit NE2000 type cards, you
can still use 8 bit IO to access the chip, which is what the 10 Mbit
cards supported by the apne driver do. 100 Mbit cards need 16 bit IO.

I see. I seemed to me that useword var controlled the IO size and there was a part on the code where it assumed 16 bit, but later call the ne2000_detect_8bit() to determine if useword should be kept to 8 bit. Again, I am not familiar with this :)
---------------
	/* not an NE1000 - try NE2000 */

	/* try 16 bit mode first */
	useword = 1;

#ifdef NE2000_DETECT_8BIT
	/*
	 * Check bus type in EEPROM first because some NE2000 compatible wedges
	 * on 16 bit DMA access if the chip is configured in 8 bit mode.
	 */
	if (ne2000_detect_8bit(nict, nich, asict, asich))
		useword = 0;
#endif
---------------

That's the access size for ring buffer memory access by the 8390 - even the 8 bit PCMCIA cards use word size 2 (16 bit).

Accessing that ring buffer by the host processor is a different matter.

I'll have to create another patch to look for mem resources in the CIS
data, and get that tested on the already supported cards. Then use that
for new cards.

I will be glad to test on real hardware, provided I have some means to build a kernel and an initrd that allows me at least to boot a BusyBox :)

Let's try with this simple patch - the two cards are treated as NE2000 clones even though they fail the station address PROM signature check. If that doesn't result in a working driver, we'll have to dump the entire station address PROM contents, and the CIS data. The original ne.c driver has a few more 'bad clone' signatures to compare the PROM data to.

Cheers,

	Michael


Regards,
Carlos

[1] https://salsa.debian.org/installer-team/debian-installer/

Carlos Milán Figueredo | HispaMSX System Operator | http://www.hispamsx.org | telnet://bbs.hispamsx.org | https://calnus.com

>From 3cd805e7d76164376dbc728075108a02cb95d573 Mon Sep 17 00:00:00 2001
From: Michael Schmitz <schmitzmic@gmail.com>
Date: Mon, 3 Jan 2022 15:55:07 +1300
Subject: [PATCH] net/8390: add DE-660+ and FL-4680 support to apne.c

Add MAC prefix for DE-660+ and FL-4680 PCMCIA ethernet cards to
the bad signature whitelist in apne.c

Signed-off-by: Michael Schmitz <schmitzmic@gmail.com>
---
 drivers/net/ethernet/8390/apne.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/8390/apne.c b/drivers/net/ethernet/8390/apne.c
index 599f06b9551d..37db2d4fe021 100644
--- a/drivers/net/ethernet/8390/apne.c
+++ b/drivers/net/ethernet/8390/apne.c
@@ -224,7 +224,7 @@ static int __init apne_probe1(struct net_device *dev, int ioaddr)
     const char *name = NULL;
     int start_page, stop_page;
 #ifndef MANUAL_HWADDR0
-    int neX000, ctron;
+    int neX000, ctron, de660, fl4680;
 #endif
     static unsigned version_printed;
 
@@ -302,9 +302,11 @@ static int __init apne_probe1(struct net_device *dev, int ioaddr)
 
     neX000 = (SA_prom[14] == 0x57  &&  SA_prom[15] == 0x57);
     ctron =  (SA_prom[0] == 0x00 && SA_prom[1] == 0x00 && SA_prom[2] == 0x1d);
+    de660 =  (SA_prom[0] == 0x00 && SA_prom[1] == 0x50 && SA_prom[2] == 0xba);
+    fl4680 = (SA_prom[0] == 0x00 && SA_prom[1] == 0xe0 && SA_prom[2] == 0x98);
 
     /* Set up the rest of the parameters. */
-    if (neX000) {
+    if (neX000 || de660 || fl4680) {
 	name = (wordlength == 2) ? "NE2000" : "NE1000";
     } else if (ctron) {
 	name = (wordlength == 2) ? "Ctron-8" : "Ctron-16";
-- 
2.17.1


Reply to: