From 6a9186c322ecad6512f28ef7ef913ab0ebdfa973 Mon Sep 17 00:00:00 2001 From: chopps Date: Mon, 8 May 1995 02:40:51 +0000 Subject: [PATCH] may now work for asdg boards.. offsets obtained months ago but untestable here --- sys/arch/amiga/dev/if_ed.c | 28 ++++++++++++++++++++-------- sys/arch/amiga/dev/if_edreg.h | 7 ++++++- 2 files changed, 26 insertions(+), 9 deletions(-) diff --git a/sys/arch/amiga/dev/if_ed.c b/sys/arch/amiga/dev/if_ed.c index 5da33cd8845e..42c9ea190b8c 100644 --- a/sys/arch/amiga/dev/if_ed.c +++ b/sys/arch/amiga/dev/if_ed.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_ed.c,v 1.8 1995/04/16 15:16:07 chopps Exp $ */ +/* $NetBSD: if_ed.c,v 1.9 1995/05/08 02:40:51 chopps Exp $ */ /* * Device driver for National Semiconductor DS8390/WD83C690 based ethernet @@ -59,7 +59,11 @@ #include #include /* XXX? */ -#define ED_DEBUG +#define HYDRA_MANID 2121 +#define HYDRA_PRODID 1 + +#define ASDG_MANID 1023 +#define ASDG_PRODID 254 /* * ed_softc: per line info and status @@ -165,9 +169,10 @@ edmatch(parent, match, aux) { struct zbus_args *zap = aux; - if (zap->manid == 2121 && zap->prodid == 1) + if (zap->manid == HYDRA_MANID && zap->prodid == HYDRA_PRODID) + return (1); + else if (zap->manid == ASDG_MANID && zap->prodid == ASDG_PRODID) return (1); - return (0); } @@ -180,10 +185,17 @@ edattach(parent, self, aux) struct zbus_args *zap = aux; struct cfdata *cf = sc->sc_dev.dv_cfdata; struct ifnet *ifp = &sc->sc_arpcom.ac_if; - int i; + int i, promoff; - sc->mem_start = zap->va; - sc->nic_addr = sc->mem_start + HYDRA_NIC_BASE; + if (zap->manid == HYDRA_MANID) { + sc->mem_start = zap->va; + sc->nic_addr = sc->mem_start + HYDRA_NIC_BASE; + promoff = HYDRA_ADDRPROM; + } else { + sc->mem_start = zap->va + 0x8000; + sc->nic_addr = sc->mem_start + ASDG_NIC_BASE; + promoff = ASDG_ADDRPROM; + } sc->cr_proto = ED_CR_RD2; sc->tx_page_start = 0; @@ -214,7 +226,7 @@ edattach(parent, self, aux) */ for (i = 0; i < ETHER_ADDR_LEN; i++) sc->sc_arpcom.ac_enaddr[i] = - *((u_char *)(sc->mem_start + HYDRA_ADDRPROM + 2 * i)); + *((u_char *)(sc->mem_start + promoff + 2 * i)); /* Set interface to stopped condition (reset). */ ed_stop(sc); diff --git a/sys/arch/amiga/dev/if_edreg.h b/sys/arch/amiga/dev/if_edreg.h index 97613b165392..10c8c82ebc46 100644 --- a/sys/arch/amiga/dev/if_edreg.h +++ b/sys/arch/amiga/dev/if_edreg.h @@ -1,4 +1,4 @@ -/* $NetBSD: if_edreg.h,v 1.3 1995/04/16 15:16:09 chopps Exp $ */ +/* $NetBSD: if_edreg.h,v 1.4 1995/05/08 02:40:54 chopps Exp $ */ /* * Vendor types @@ -36,3 +36,8 @@ */ #define HYDRA_ADDRPROM 0xffc0 #define HYDRA_NIC_BASE 0xffe1 +/* + * Definitions for ASDG LANRover boards + */ +#define ASDG_ADDRPROM 0xff +#define ASDG_NIC_BASE 0x1