Use the complete ethernet address stored in nvram on mvme162/mvme167

instead of faking the first 5 nibbles a'la mvme147.

Apparently recent mvme16x boards have a new 5 nibble prefix...
This commit is contained in:
scw 2000-09-15 08:50:24 +00:00
parent bdad8bae5b
commit 53d57897d0
5 changed files with 28 additions and 35 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_ie.c,v 1.7 2000/09/06 19:51:43 scw Exp $ */
/* $NetBSD: if_ie.c,v 1.8 2000/09/15 08:50:24 scw Exp $ */
/*-
* Copyright (c) 1999 The NetBSD Foundation, Inc.
@ -269,7 +269,6 @@ ie_pcctwo_attach(parent, self, args)
struct pcctwo_attach_args *pa;
struct ie_pcctwo_softc *ps;
struct ie_softc *sc;
u_int8_t ethaddr[ETHER_ADDR_LEN];
bus_dma_segment_t seg;
int rseg;
@ -277,8 +276,6 @@ ie_pcctwo_attach(parent, self, args)
ps = (struct ie_pcctwo_softc *) self;
sc = (struct ie_softc *) self;
myetheraddr(ethaddr);
/* Map the MPU controller registers in PCCTWO space */
ps->ps_bust = pa->pa_bust;
bus_space_map(pa->pa_bust, pa->pa_offset, IE_MPUREG_SIZE,
@ -336,7 +333,7 @@ ie_pcctwo_attach(parent, self, args)
i82586_proberam(sc);
/* Attach the MI back-end */
i82586_attach(sc, "onboard", ethaddr, NULL, 0, 0);
i82586_attach(sc, "onboard", mvme_ea, NULL, 0, 0);
/* Finally, hook the hardware interrupt */
pcctwointr_establish(PCCTWOV_LANC_IRQ, i82586_intr, pa->pa_ipl, sc);

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_le.c,v 1.22 2000/07/25 20:52:27 scw Exp $ */
/* $NetBSD: if_le.c,v 1.23 2000/09/15 08:50:24 scw Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@ -210,7 +210,7 @@ le_pcc_attach(parent, self, aux)
sc->sc_memsize = ether_data_buff_size;
sc->sc_conf3 = LE_C3_BSWP;
myetheraddr(sc->sc_enaddr);
memcpy(sc->sc_enaddr, mvme_ea, ETHER_ADDR_LEN);
sc->sc_copytodesc = lance_copytobuf_contig;
sc->sc_copyfromdesc = lance_copyfrombuf_contig;

View File

@ -1,4 +1,4 @@
/* $NetBSD: cpu.h,v 1.18 2000/08/25 01:04:08 thorpej Exp $ */
/* $NetBSD: cpu.h,v 1.19 2000/09/15 08:50:24 scw Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@ -184,6 +184,7 @@ extern int cpuspeed;
extern char *intiobase, *intiolimit;
extern u_int intiobase_phys, intiotop_phys;
extern u_long ether_data_buff_size;
extern u_char mvme_ea[6];
struct frame;
void doboot __P((int))
@ -198,7 +199,6 @@ void iounmap __P((void *, size_t));
paddr_t kvtop __P((caddr_t));
void loadustp __P((paddr_t));
void child_return __P((void *));
void myetheraddr __P((u_char *));
/* Prototypes from sys_machdep.c: */
int cachectl1 __P((unsigned long, vaddr_t, size_t, struct proc *));

View File

@ -1,4 +1,4 @@
/* $NetBSD: locore.s,v 1.64 2000/09/06 19:51:44 scw Exp $ */
/* $NetBSD: locore.s,v 1.65 2000/09/15 08:50:24 scw Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@ -193,8 +193,17 @@ ASENTRY_NOPROFILE(start)
/* XXXCDC SHUTUP 147 CALL */
/* Save our ethernet address */
RELOC(myea, a0)
movl 0xfffe0778,a0@ | XXXCDC -- HARDWIRED HEX
RELOC(mvme_ea, a0)
lea 0xfffe0778,a1 | XXXCDC -- HARDWIRED HEX
movb #0x08,a0@+
clrb a0@+
movb #0x3e,a0@+
movql #0x0f,d0
andb a1@+,d0
orb #0x20,d0
movb d0,a0@+
movb a1@+,a0@+
movb a1@,a0@
/*
* Fix up the physical addresses of the MVME147's onboard
@ -369,10 +378,14 @@ Lmemcquery:
Lis16x_common:
/* Save our ethernet address */
movel 0xfffc1f2e,d0
lsll #8,d0
RELOC(myea, a0)
movl d0,a0@
RELOC(mvme_ea, a0)
lea 0xfffc1f2c,a1
movb a1@+,a0@+
movb a1@+,a0@+
movb a1@+,a0@+
movb a1@+,a0@+
movb a1@+,a0@+
movb a1@,a0@
/*
* Fix up the physical addresses of the MVME167's onboard

View File

@ -1,4 +1,4 @@
/* $NetBSD: machdep.c,v 1.73 2000/09/13 15:00:20 thorpej Exp $ */
/* $NetBSD: machdep.c,v 1.74 2000/09/15 08:50:25 scw Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@ -134,7 +134,7 @@ int safepri = PSL_LOWIPL;
#define ETHER_DATA_BUFF_PAGES 4
#endif
u_long ether_data_buff_size = ETHER_DATA_BUFF_PAGES * NBPG;
u_long myea;
u_char mvme_ea[6];
extern u_int lowram;
extern short exframesize[];
@ -1194,20 +1194,3 @@ cpu_exec_aout_makecmds(p, epp)
{
return ENOEXEC;
}
void
myetheraddr(ether)
u_char *ether;
{
int e = myea;
ether[0] = 0x08;
ether[1] = 0x00;
ether[2] = 0x3e;
e = e >> 8;
ether[5] = (u_char)(e & 0xff);
e = e >> 8;
ether[4] = (u_char)(e & 0xff);
e = e >> 8;
ether[3] = (u_char)(e & 0x0f) | 0x20;
}