summaryrefslogtreecommitdiff
path: root/sys/arch/aviion
diff options
context:
space:
mode:
Diffstat (limited to 'sys/arch/aviion')
-rw-r--r--sys/arch/aviion/aviion/autoconf.c34
-rw-r--r--sys/arch/aviion/conf/GENERIC10
-rw-r--r--sys/arch/aviion/conf/files.aviion15
-rw-r--r--sys/arch/aviion/dev/if_le_syscon.c203
-rw-r--r--sys/arch/aviion/dev/if_le_vme.c101
-rw-r--r--sys/arch/aviion/include/av400.h8
-rw-r--r--sys/arch/aviion/include/av530.h4
7 files changed, 248 insertions, 127 deletions
diff --git a/sys/arch/aviion/aviion/autoconf.c b/sys/arch/aviion/aviion/autoconf.c
index 083ca8ae3cd..2b3aa3c0011 100644
--- a/sys/arch/aviion/aviion/autoconf.c
+++ b/sys/arch/aviion/aviion/autoconf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: autoconf.c,v 1.13 2011/10/09 17:01:32 miod Exp $ */
+/* $OpenBSD: autoconf.c,v 1.14 2013/09/24 20:14:33 miod Exp $ */
/*
* Copyright (c) 1998 Steve Murphree, Jr.
* Copyright (c) 1996 Nivas Madhur
@@ -42,9 +42,14 @@
#include <machine/asm_macro.h>
#include <machine/autoconf.h>
+#include <machine/board.h>
#include <machine/cpu.h>
#include <machine/vmparam.h>
+#ifdef AV530
+#include <machine/av530.h>
+#endif
+
#include <scsi/scsi_all.h>
#include <scsi/scsiconf.h>
@@ -186,13 +191,15 @@ cmdline_parse(void)
void
device_register(struct device *dev, void *aux)
{
+ struct confargs *ca = (struct confargs *)aux;
+
if (bootdv != NULL)
return;
switch (bootdevtype) {
case BT_INEN:
/*
- * Internal ethernet is le at syscon only, and we do not
+ * Internal LANCE Ethernet is le at syscon only, and we do not
* care about controller and unit numbers.
*/
if (strcmp("le", dev->dv_cfdata->cf_driver->cd_name) == 0 &&
@@ -200,6 +207,29 @@ device_register(struct device *dev, void *aux)
dev->dv_parent->dv_cfdata->cf_driver->cd_name) == 0)
bootdv = dev;
break;
+ case BT_DGEN:
+ /*
+ * Internal ILACC Ethernet is le at syscon only, and need to
+ * match the controller address.
+ */
+ if (strcmp("le", dev->dv_cfdata->cf_driver->cd_name) == 0 &&
+ strcmp("syscon",
+ dev->dv_parent->dv_cfdata->cf_driver->cd_name) == 0) {
+ switch (cpuid) {
+#ifdef AV530
+ case AVIION_4600_530:
+ if ((bootdev == 0 &&
+ ca->ca_paddr == AV530_LAN1) ||
+ (bootdev == 1 &&
+ ca->ca_paddr == AV530_LAN2))
+ bootdv = dev;
+ break;
+#endif
+ default:
+ break;
+ }
+ }
+ break;
}
}
diff --git a/sys/arch/aviion/conf/GENERIC b/sys/arch/aviion/conf/GENERIC
index 379faee26f7..d42322bdc85 100644
--- a/sys/arch/aviion/conf/GENERIC
+++ b/sys/arch/aviion/conf/GENERIC
@@ -1,4 +1,4 @@
-# $OpenBSD: GENERIC,v 1.8 2013/09/16 16:30:50 miod Exp $
+# $OpenBSD: GENERIC,v 1.9 2013/09/24 20:14:36 miod Exp $
#
# For further information on compiling OpenBSD kernels, see the config(8)
# man page.
@@ -62,8 +62,8 @@ dart1 at syscon? offset 0x82040
#ssi0 at syscon? offset 0x8d000
oosiop0 at syscon? offset 0xb0000
oosiop1 at syscon? offset 0xb0080
-#ile0 at syscon? offset 0xb00c0
-#ile1 at syscon? offset 0xb0140
+le0 at syscon? offset 0xb0100
+le1 at syscon? offset 0xb0140
#
# VME devices
@@ -75,10 +75,6 @@ le* at vme? a32 0x55540000 a16 0x8600 ipl 3 # artwork X0B factory settings
le* at vme? a32 0x55900000 a16 0x4000 ipl 3
le* at vme? a32 0x55980000 a16 0x5000 ipl 3
-# AV5000 VME Ethernet
-#ile* at vme? a32 0x55900000 a16 0x4000 ipl 3
-#ile* at vme? a32 0x55980000 a16 0x5000 ipl 3
-
# VDA/255 Serial Host Adapter (on-board on model 4300)
#vda0 at vme? a32 0x60000000
diff --git a/sys/arch/aviion/conf/files.aviion b/sys/arch/aviion/conf/files.aviion
index 2b05b3e4454..1be78251e22 100644
--- a/sys/arch/aviion/conf/files.aviion
+++ b/sys/arch/aviion/conf/files.aviion
@@ -1,4 +1,4 @@
-# $OpenBSD: files.aviion,v 1.11 2013/09/21 20:07:17 miod Exp $
+# $OpenBSD: files.aviion,v 1.12 2013/09/24 20:14:36 miod Exp $
#
maxpartitions 16
@@ -23,15 +23,9 @@ file dev/ic/mc68681.c
attach dart at syscon
file arch/aviion/dev/dart.c dart needs-count
-attach le at syscon with le_syscon
+attach le at syscon with le_syscon: le24, le32
file arch/aviion/dev/if_le_syscon.c le_syscon
-device ile: ether, ifnet, ifmedia
-file arch/aviion/dev/if_ile.c ile
-
-attach ile at syscon with ile_syscon
-file arch/aviion/dev/if_ile_syscon.c ile_syscon
-
attach oosiop at syscon with oosiop_syscon
file arch/aviion/dev/oosiop_syscon.c oosiop_syscon
@@ -51,12 +45,9 @@ device vme {[a16 = -1], [a24 = -1], [a32 = -1], [ipl = -1]}
attach vme at syscon
file arch/aviion/dev/vme.c vme needs-flag
-attach le at vme with le_vme
+attach le at vme with le_vme: le24 #, le32
file arch/aviion/dev/if_le_vme.c le_vme
-attach ile at vme with ile_vme
-file arch/aviion/dev/if_ile_vme.c ile_vme
-
# list of standard files
file dev/cninit.c
diff --git a/sys/arch/aviion/dev/if_le_syscon.c b/sys/arch/aviion/dev/if_le_syscon.c
index 22510896ec1..f24ce9147b0 100644
--- a/sys/arch/aviion/dev/if_le_syscon.c
+++ b/sys/arch/aviion/dev/if_le_syscon.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_le_syscon.c,v 1.13 2013/09/16 16:30:51 miod Exp $ */
+/* $OpenBSD: if_le_syscon.c,v 1.14 2013/09/24 20:14:34 miod Exp $ */
/*-
* Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -51,29 +51,45 @@
#include <machine/board.h>
#include <machine/cpu.h>
+#ifdef AV400
+#include <machine/av400.h>
+#endif
+#ifdef AV530
+#include <machine/av530.h>
+#endif
+
#include <aviion/dev/sysconvar.h>
+#include <dev/ic/lancereg.h>
+#include <dev/ic/lancevar.h>
#include <dev/ic/am7990reg.h>
#include <dev/ic/am7990var.h>
+/* #include <dev/ic/am79900reg.h> */
+#include <dev/ic/am79900var.h>
/*
- * LANCE registers. Although these are 16 bit registers, on the AV400
+ * LANCE or ILACC registers. Although these are 16 bit registers, on the AV400
* design, they need to be accessed as 32 bit registers. Bus magic...
- * The real stuff is in dev/ic/am7990reg.h
*/
struct av_lereg {
volatile uint32_t ler1_rdp; /* data port */
volatile uint32_t ler1_rap; /* register select port */
+
+ /* The following fields are only found on ILACC designs */
+ volatile uint32_t unused[2];
+ volatile uint32_t enaddr[6];
+ volatile uint32_t cksum[2];
};
-/*
- * Ethernet software status per interface.
- * The real stuff is in dev/ic/am7990var.h
- */
-struct le_softc {
- struct am7990_softc sc_am7990; /* glue to MI code */
+struct le_softc {
+ union { /* glue to MI code */
+ struct lance_softc sc_lance;
+ struct am7990_softc sc_am7990;
+ struct am79900_softc sc_am79900;
+ } u;
- struct av_lereg *sc_r1; /* LANCE registers */
+ int sc_ilacc;
+ struct av_lereg *sc_r1; /* LANCE or ILACC registers */
struct intrhand sc_ih;
};
@@ -84,15 +100,22 @@ struct cfattach le_syscon_ca = {
sizeof(struct le_softc), le_syscon_match, le_syscon_attach
};
-int le_syscon_intr(void *);
-uint16_t le_syscon_rdcsr(struct am7990_softc *, uint16_t);
-void le_syscon_wrcsr(struct am7990_softc *, uint16_t, uint16_t);
-void le_syscon_wrcsr_interrupt(struct am7990_softc *, uint16_t, uint16_t);
+int le_syscon_intr_ilacc(void *);
+int le_syscon_intr_lance(void *);
+uint16_t le_syscon_rdcsr(struct lance_softc *, uint16_t);
+void le_syscon_wrcsr(struct lance_softc *, uint16_t, uint16_t);
+void le_syscon_wrcsr_interrupt(struct lance_softc *, uint16_t, uint16_t);
int
le_syscon_match(struct device *parent, void *cf, void *aux)
{
+ struct confargs *ca = aux;
+#ifdef AV530
+ paddr_t fuse = 0;
+#endif
+
switch (cpuid) {
+#ifdef AV400
case AVIION_300_310:
case AVIION_400_4000:
case AVIION_410_4100:
@@ -102,43 +125,97 @@ le_syscon_match(struct device *parent, void *cf, void *aux)
case AVIION_4300_25:
case AVIION_4300_20:
case AVIION_4300_16:
- return 1;
+ switch (ca->ca_paddr) {
+ case AV400_LAN:
+ break;
+ default:
+ return 0;
+ }
+ break;
+#endif
+#ifdef AV530
+ case AVIION_4600_530:
+ switch (ca->ca_paddr) {
+ case AV530_LAN1:
+ fuse = AV530_IOFUSE0;
+ break;
+ case AV530_LAN2:
+ fuse = AV530_IOFUSE1;
+ break;
+ default:
+ return 0;
+ }
+ break;
+#endif
default:
return 0;
}
+
+#ifdef AV530
+ if (fuse != 0) {
+ /* check IOFUSE register */
+ if (badaddr(fuse, 1) != 0)
+ return 0;
+
+ /* check fuse status */
+ return ISSET(*(volatile uint8_t *)fuse, AV530_IOFUSE_LAN);
+ }
+#endif
+
+ return 1;
}
void
le_syscon_attach(struct device *parent, struct device *self, void *aux)
{
struct le_softc *lesc = (struct le_softc *)self;
- struct am7990_softc *sc = &lesc->sc_am7990;
+ struct lance_softc *sc = &lesc->u.sc_lance;
struct confargs *ca = aux;
u_int etherpages;
struct pglist pglist;
vm_page_t pg;
- int rc;
- paddr_t pa;
+ int i, rc;
+ paddr_t pa, pamask;
vaddr_t va;
+ int intsrc;
+ uint8_t *enaddr;
+
+ switch (cpuid) {
+#ifdef AV530
+ case AVIION_4600_530:
+ lesc->sc_ilacc = 1;
+ pamask = 0xffffffff;
+ intsrc = ca->ca_paddr == AV530_LAN1 ?
+ INTSRC_ETHERNET1 : INTSRC_ETHERNET2;
+ break;
+#endif
+ default:
+ lesc->sc_ilacc = 0;
+ pamask = 0x00ffffff;
+ intsrc = INTSRC_ETHERNET1;
+ break;
+ }
/*
- * Allocate contiguous pages in the first 16MB to use as buffers.
+ * Allocate contiguous pages (in the first 16MB if not ILACC)
+ * to use as buffers. We aim towards 256KB, which is as much as
+ * the VME LANCE boards provide.
*/
if (physmem >= atop(32 * 1024 * 1024))
- etherpages = 64;
+ etherpages = atop(256 * 1024);
else if (physmem >= atop(16 * 1024 * 1024))
- etherpages = 32;
+ etherpages = atop(128 * 1024);
else
- etherpages = 16;
+ etherpages = atop(64 * 1024);
for (;;) {
TAILQ_INIT(&pglist);
- rc = uvm_pglistalloc(ptoa(etherpages), 0, (1 << 24) - 1,
+ rc = uvm_pglistalloc(ptoa(etherpages), 0, pamask,
0, 0, &pglist, 1, UVM_PLA_NOWAIT);
if (rc == 0)
break;
etherpages >>= 1;
- if (etherpages == 2) {
+ if (etherpages <= 2) {
printf(": no available memory, kernel is too large\n");
return;
}
@@ -154,7 +231,7 @@ le_syscon_attach(struct device *parent, struct device *self, void *aux)
pa = VM_PAGE_TO_PHYS(TAILQ_FIRST(&pglist));
sc->sc_mem = (void *)va;
- sc->sc_addr = (u_long)pa & 0x00ffffff;
+ sc->sc_addr = (u_long)pa & pamask;
sc->sc_memsize = ptoa(etherpages);
TAILQ_FOREACH(pg, &pglist, pageq) {
@@ -169,40 +246,84 @@ le_syscon_attach(struct device *parent, struct device *self, void *aux)
lesc->sc_r1 = (struct av_lereg *)ca->ca_paddr;
- sc->sc_conf3 = LE_C3_BSWP;
+ /*
+ * Get the device Ethernet address.
+ */
+ enaddr = sc->sc_arpcom.ac_enaddr;
+ if (lesc->sc_ilacc) {
+ for (i = 0; i < ETHER_ADDR_LEN; i++)
+ enaddr[i] = lesc->sc_r1->enaddr[i] >> 24;
+ /*
+ * If the checksum is invalid, don't trust the address,
+ * and force a hopefully unique one to be generated with
+ * ether_fakeaddr() at interface attachment time.
+ */
+ if ((lesc->sc_r1->cksum[0] >> 24) !=
+ ((enaddr[0] + enaddr[2] + enaddr[4]) & 0xff) ||
+ (lesc->sc_r1->cksum[1] >> 24) !=
+ ((enaddr[1] + enaddr[3] + enaddr[5]) & 0xff))
+ enaddr[0] = 0xff;
+ } else
+ myetheraddr(enaddr);
- myetheraddr(sc->sc_arpcom.ac_enaddr);
+ sc->sc_conf3 = LE_C3_BSWP;
- sc->sc_copytodesc = am7990_copytobuf_contig;
- sc->sc_copyfromdesc = am7990_copyfrombuf_contig;
- sc->sc_copytobuf = am7990_copytobuf_contig;
- sc->sc_copyfrombuf = am7990_copyfrombuf_contig;
- sc->sc_zerobuf = am7990_zerobuf_contig;
+ sc->sc_copytodesc = lance_copytobuf_contig;
+ sc->sc_copyfromdesc = lance_copyfrombuf_contig;
+ sc->sc_copytobuf = lance_copytobuf_contig;
+ sc->sc_copyfrombuf = lance_copyfrombuf_contig;
+ sc->sc_zerobuf = lance_zerobuf_contig;
sc->sc_rdcsr = le_syscon_rdcsr;
sc->sc_wrcsr = le_syscon_wrcsr;
sc->sc_hwreset = NULL;
sc->sc_hwinit = NULL;
- am7990_config(sc);
+ if (lesc->sc_ilacc) {
+ le_syscon_wrcsr(sc, LE_CSR4, LE_C4_DMAPLUS | LE_C4_UINT);
+ am79900_config(&lesc->u.sc_am79900);
+ /* Chip is stopped. Set "software style" to 32-bit. */
+ le_syscon_wrcsr(sc, LE_CSR58, 2);
+ } else
+ am7990_config(&lesc->u.sc_am7990);
- lesc->sc_ih.ih_fn = le_syscon_intr;
+ if (lesc->sc_ilacc)
+ lesc->sc_ih.ih_fn = le_syscon_intr_ilacc;
+ else
+ lesc->sc_ih.ih_fn = le_syscon_intr_lance;
lesc->sc_ih.ih_arg = sc;
lesc->sc_ih.ih_flags = 0;
lesc->sc_ih.ih_ipl = IPL_NET;
- sysconintr_establish(INTSRC_ETHERNET1, &lesc->sc_ih, self->dv_xname);
+ sysconintr_establish(intsrc, &lesc->sc_ih, self->dv_xname);
+}
+
+int
+le_syscon_intr_ilacc(void *v)
+{
+ struct le_softc *lesc = (struct le_softc *)v;
+ struct lance_softc *sc = &lesc->u.sc_lance;
+ uint16_t csr4;
+
+ /* Acknowledge TX start. XXX how to disable this? */
+ csr4 = le_syscon_rdcsr(sc, LE_CSR4);
+ if (csr4 & LE_C4_TXSTRT) {
+ le_syscon_wrcsr(sc, LE_CSR4, csr4);
+ return 1;
+ }
+
+ return am79900_intr(v);
}
int
-le_syscon_intr(void *v)
+le_syscon_intr_lance(void *v)
{
struct le_softc *lesc = (struct le_softc *)v;
- struct am7990_softc *sc = &lesc->sc_am7990;
+ struct lance_softc *sc = &lesc->u.sc_lance;
int rc;
/*
- * Syscon expects edge interrupts, while the LANCE does level
+ * Syscon expects edge interrupts, while LANCE does level
* interrupts. To avoid missing interrupts while servicing,
* we disable further device interrupts while servicing.
*
@@ -224,7 +345,7 @@ le_syscon_intr(void *v)
}
uint16_t
-le_syscon_rdcsr(struct am7990_softc *sc, uint16_t port)
+le_syscon_rdcsr(struct lance_softc *sc, uint16_t port)
{
struct av_lereg *ler1 = ((struct le_softc *)sc)->sc_r1;
uint16_t val;
@@ -235,7 +356,7 @@ le_syscon_rdcsr(struct am7990_softc *sc, uint16_t port)
}
void
-le_syscon_wrcsr(struct am7990_softc *sc, uint16_t port, uint16_t val)
+le_syscon_wrcsr(struct lance_softc *sc, uint16_t port, uint16_t val)
{
struct av_lereg *ler1 = ((struct le_softc *)sc)->sc_r1;
@@ -244,7 +365,7 @@ le_syscon_wrcsr(struct am7990_softc *sc, uint16_t port, uint16_t val)
}
void
-le_syscon_wrcsr_interrupt(struct am7990_softc *sc, uint16_t port, uint16_t val)
+le_syscon_wrcsr_interrupt(struct lance_softc *sc, uint16_t port, uint16_t val)
{
if (port == LE_CSR0)
val &= ~LE_C0_INEA;
diff --git a/sys/arch/aviion/dev/if_le_vme.c b/sys/arch/aviion/dev/if_le_vme.c
index d7bba2709b4..149a0140537 100644
--- a/sys/arch/aviion/dev/if_le_vme.c
+++ b/sys/arch/aviion/dev/if_le_vme.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_le_vme.c,v 1.3 2007/12/20 21:16:19 miod Exp $ */
+/* $OpenBSD: if_le_vme.c,v 1.4 2013/09/24 20:14:34 miod Exp $ */
/*-
* Copyright (c) 1982, 1992, 1993
@@ -52,6 +52,8 @@
#include <machine/bus.h>
#include <machine/cpu.h>
+#include <dev/ic/lancereg.h>
+#include <dev/ic/lancevar.h>
#include <dev/ic/am7990reg.h>
#include <dev/ic/am7990var.h>
@@ -80,26 +82,23 @@ struct cfattach le_vme_ca = {
sizeof(struct le_softc), le_vme_match, le_vme_attach
};
-void le_vme_wrcsr(struct am7990_softc *, u_int16_t, u_int16_t);
-u_int16_t le_vme_rdcsr(struct am7990_softc *, u_int16_t);
-void nvram_cmd(struct am7990_softc *, u_int, u_int);
-u_int16_t nvram_read(struct am7990_softc *, u_int);
-void le_vme_etheraddr(struct am7990_softc *);
-void le_vme_init(struct am7990_softc *);
-void le_vme_reset(struct am7990_softc *);
+void le_vme_wrcsr(struct lance_softc *, uint16_t, uint16_t);
+uint16_t le_vme_rdcsr(struct lance_softc *, uint16_t);
+void nvram_cmd(struct lance_softc *, u_int, u_int);
+uint16_t nvram_read(struct lance_softc *, u_int);
+void le_vme_etheraddr(struct lance_softc *);
+void le_vme_init(struct lance_softc *);
+void le_vme_reset(struct lance_softc *);
int le_vme_intr(void *);
#if 0
-void le_vme_copyfrombuf_contig(struct am7990_softc *, void *, int, int);
-void le_vme_copytobuf_contig(struct am7990_softc *, void *, int, int);
-void le_vme_zerobuf_contig(struct am7990_softc *, int, int);
+void le_vme_copyfrombuf_contig(struct lance_softc *, void *, int, int);
+void le_vme_copytobuf_contig(struct lance_softc *, void *, int, int);
+void le_vme_zerobuf_contig(struct lance_softc *, int, int);
#endif
/* send command to the nvram controller */
void
-nvram_cmd(sc, cmd, addr)
- struct am7990_softc *sc;
- u_int cmd;
- u_int addr;
+nvram_cmd(struct lance_softc *sc, u_int cmd, u_int addr)
{
struct le_softc *lesc = (void *)sc;
int i;
@@ -112,14 +111,12 @@ nvram_cmd(sc, cmd, addr)
}
/* read nvram one bit at a time */
-u_int16_t
-nvram_read(sc, nvram_addr)
- struct am7990_softc *sc;
- u_int nvram_addr;
+uint16_t
+nvram_read(struct lance_softc *sc, u_int nvram_addr)
{
struct le_softc *lesc = (void *)sc;
u_int val = 0, mask = 0x04000;
- u_int16_t wbit;
+ uint16_t wbit;
lesc->sc_csr = HW_RS | NVRAM_EN | 0x07;
ENABLE_NVRAM;
@@ -147,11 +144,10 @@ nvram_read(sc, nvram_addr)
}
void
-le_vme_etheraddr(sc)
- struct am7990_softc *sc;
+le_vme_etheraddr(struct lance_softc *sc)
{
u_char *cp = sc->sc_arpcom.ac_enaddr;
- u_int16_t ival[3];
+ uint16_t ival[3];
int i;
for (i = 0; i < 3; i++) {
@@ -161,9 +157,7 @@ le_vme_etheraddr(sc)
}
void
-le_vme_wrcsr(sc, port, val)
- struct am7990_softc *sc;
- u_int16_t port, val;
+le_vme_wrcsr(struct lance_softc *sc, uint16_t port, uint16_t val)
{
struct le_softc *lesc = (void *)sc;
@@ -171,10 +165,8 @@ le_vme_wrcsr(sc, port, val)
bus_space_write_2(lesc->sc_iot, lesc->sc_ioh, LEREG_RDP, val);
}
-u_int16_t
-le_vme_rdcsr(sc, port)
- struct am7990_softc *sc;
- u_int16_t port;
+uint16_t
+le_vme_rdcsr(struct lance_softc *sc, uint16_t port)
{
struct le_softc *lesc = (void *)sc;
@@ -184,8 +176,7 @@ le_vme_rdcsr(sc, port)
/* init board, set ipl and vec */
void
-le_vme_init(sc)
- struct am7990_softc *sc;
+le_vme_init(struct lance_softc *sc)
{
struct le_softc *lesc = (void *)sc;
@@ -197,8 +188,7 @@ le_vme_init(sc)
/* board reset */
void
-le_vme_reset(sc)
- struct am7990_softc *sc;
+le_vme_reset(struct lance_softc *sc)
{
struct le_softc *lesc = (void *)sc;
@@ -211,10 +201,10 @@ le_vme_reset(sc)
}
int
-le_vme_intr(sc)
- void *sc;
+le_vme_intr(void *arg)
{
- struct le_softc *lesc = (void *)sc;
+ struct le_softc *lesc = arg;
+ struct lance_softc *sc = &lesc->sc_am7990.lsc;
int rc;
rc = am7990_intr(sc);
@@ -224,10 +214,7 @@ le_vme_intr(sc)
#if 0
void
-le_vme_copytobuf_contig(sc, from, boff, len)
- struct am7990_softc *sc;
- void *from;
- int boff, len;
+le_vme_copytobuf_contig(struct lance_softc *sc, void *from, int boff, int len)
{
struct le_softc *lesc = (void *)sc;
@@ -235,10 +222,7 @@ le_vme_copytobuf_contig(sc, from, boff, len)
}
void
-le_vme_copyfrombuf_contig(sc, to, boff, len)
- struct am7990_softc *sc;
- void *to;
- int boff, len;
+le_vme_copyfrombuf_contig(struct lance_softc *sc, void *to, int boff, int len)
{
struct le_softc *lesc = (void *)sc;
@@ -246,9 +230,7 @@ le_vme_copyfrombuf_contig(sc, to, boff, len)
}
void
-le_vme_zerobuf_contig(sc, boff, len)
- struct am7990_softc *sc;
- int boff, len;
+le_vme_zerobuf_contig(struct lance_softc *sc, int boff, int len)
{
struct le_softc *lesc = (void *)sc;
@@ -257,9 +239,7 @@ le_vme_zerobuf_contig(sc, boff, len)
#endif
int
-le_vme_match(parent, vcf, args)
- struct device *parent;
- void *vcf, *args;
+le_vme_match(struct device *parent, void *vcf, void *args)
{
struct vme_attach_args *vaa = args;
bus_space_tag_t iot, memt;
@@ -293,13 +273,10 @@ le_vme_match(parent, vcf, args)
}
void
-le_vme_attach(parent, self, aux)
- struct device *parent;
- struct device *self;
- void *aux;
+le_vme_attach(struct device *parent, struct device *self, void *aux)
{
struct le_softc *lesc = (struct le_softc *)self;
- struct am7990_softc *sc = &lesc->sc_am7990;
+ struct lance_softc *sc = &lesc->sc_am7990.lsc;
struct vme_attach_args *vaa = aux;
/*
@@ -354,17 +331,17 @@ le_vme_attach(parent, self, aux)
sc->sc_copyfrombuf = le_vme_copyfrombuf_contig;
sc->sc_zerobuf = le_vme_zerobuf_contig;
#else
- sc->sc_copytodesc = am7990_copytobuf_contig;
- sc->sc_copyfromdesc = am7990_copyfrombuf_contig;
- sc->sc_copytobuf = am7990_copytobuf_contig;
- sc->sc_copyfrombuf = am7990_copyfrombuf_contig;
- sc->sc_zerobuf = am7990_zerobuf_contig;
+ sc->sc_copytodesc = lance_copytobuf_contig;
+ sc->sc_copyfromdesc = lance_copyfrombuf_contig;
+ sc->sc_copytobuf = lance_copytobuf_contig;
+ sc->sc_copyfrombuf = lance_copyfrombuf_contig;
+ sc->sc_zerobuf = lance_zerobuf_contig;
#endif
/* get Ethernet address */
le_vme_etheraddr(sc);
- am7990_config(sc);
+ am7990_config(&lesc->sc_am7990);
/* connect the interrupt */
lesc->sc_ih.ih_fn = le_vme_intr;
diff --git a/sys/arch/aviion/include/av400.h b/sys/arch/aviion/include/av400.h
index f3ff49e3769..e95c8a7fe4e 100644
--- a/sys/arch/aviion/include/av400.h
+++ b/sys/arch/aviion/include/av400.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: av400.h,v 1.8 2011/03/23 16:54:34 pirofti Exp $ */
+/* $OpenBSD: av400.h,v 1.9 2013/09/24 20:14:35 miod Exp $ */
/*
* Copyright (c) 1999 Steve Murphree, Jr.
* All rights reserved.
@@ -127,6 +127,12 @@
"\7IRQ2\6SCI\5IRQ1\2SWI1\1SWI0"
/*
+ * Onboard device addresses
+ */
+
+#define AV400_LAN 0xfff8c000
+
+/*
* CMMU addresses
*/
diff --git a/sys/arch/aviion/include/av530.h b/sys/arch/aviion/include/av530.h
index a601d1bea33..ebe2bf710b4 100644
--- a/sys/arch/aviion/include/av530.h
+++ b/sys/arch/aviion/include/av530.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: av530.h,v 1.4 2011/03/23 16:54:34 pirofti Exp $ */
+/* $OpenBSD: av530.h,v 1.5 2013/09/24 20:14:35 miod Exp $ */
/*
* Copyright (c) 2006, 2010 Miodrag Vallat
*
@@ -217,7 +217,7 @@
#define AV530_SCSI1 0xfffb0000
#define AV530_SCSI2 0xfffb0080
-#define AV530_LAN1 0xfffb00c0
+#define AV530_LAN1 0xfffb0100
#define AV530_LAN2 0xfffb0140
/*