From 93dd53ae14a8b8a29a974c23bd107bca8f582186 Mon Sep 17 00:00:00 2001 From: tsutsui Date: Sun, 27 Feb 2005 09:27:31 +0000 Subject: [PATCH] LANCE chip actually requires PA of shared mem rather than VA. Fortunately, lower bytes of PA and VA for intio devices were identical on -current pmap, but the problem appears on new yamt-km which has differnt address layout. Ummmmm. --- sys/arch/news68k/dev/if_le.c | 11 ++++++----- sys/arch/news68k/news68k/machdep.c | 11 ++++++----- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/sys/arch/news68k/dev/if_le.c b/sys/arch/news68k/dev/if_le.c index 55dff4275baf..413fc6b88c5f 100644 --- a/sys/arch/news68k/dev/if_le.c +++ b/sys/arch/news68k/dev/if_le.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_le.c,v 1.11 2004/12/11 03:32:27 tsutsui Exp $ */ +/* $NetBSD: if_le.c,v 1.12 2005/02/27 09:27:31 tsutsui Exp $ */ /*- * Copyright (c) 1996 The NetBSD Foundation, Inc. @@ -41,7 +41,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_le.c,v 1.11 2004/12/11 03:32:27 tsutsui Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_le.c,v 1.12 2005/02/27 09:27:31 tsutsui Exp $"); #include "opt_inet.h" #include "bpfilter.h" @@ -97,7 +97,8 @@ static void le_attach(struct device *, struct device *, void *); CFATTACH_DECL(le, sizeof(struct le_softc), le_match, le_attach, NULL, NULL); -extern volatile u_char *lance_mem, *idrom_addr; +extern volatile u_char *idrom_addr; +extern uint32_t lance_mem_phys; #if defined(_KERNEL_OPT) #include "opt_ddb.h" @@ -163,7 +164,7 @@ le_attach(struct device *parent, struct device *self, void *aux) lesc->sc_r1 = (void *)IIOV(ha->ha_address); if (ISIIOPA(ha->ha_address)) { - sc->sc_mem = (u_char *)lance_mem; + sc->sc_mem = (u_char *)IIOV(lance_mem_phys); p = (u_char *)(idrom_addr + 0x10); } else { sc->sc_mem = lesc->sc_r1 - 0x10000; @@ -171,7 +172,7 @@ le_attach(struct device *parent, struct device *self, void *aux) } sc->sc_memsize = 0x4000; /* 16K */ - sc->sc_addr = (int)sc->sc_mem & 0x00ffffff; + sc->sc_addr = lance_mem_phys & 0x00ffffff; sc->sc_conf3 = LE_C3_BSWP|LE_C3_BCON; sc->sc_enaddr[0] = (*p++ << 4); diff --git a/sys/arch/news68k/news68k/machdep.c b/sys/arch/news68k/news68k/machdep.c index 7b090af7355c..4d4739cef346 100644 --- a/sys/arch/news68k/news68k/machdep.c +++ b/sys/arch/news68k/news68k/machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.57 2005/02/27 08:02:43 tsutsui Exp $ */ +/* $NetBSD: machdep.c,v 1.58 2005/02/27 09:27:32 tsutsui Exp $ */ /* * Copyright (c) 1982, 1986, 1990, 1993 @@ -77,7 +77,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.57 2005/02/27 08:02:43 tsutsui Exp $"); +__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.58 2005/02/27 09:27:32 tsutsui Exp $"); #include "opt_ddb.h" #include "opt_compat_netbsd.h" @@ -809,7 +809,8 @@ cpu_exec_aout_makecmds(struct proc *p, struct exec_package *epp) static volatile u_char *dip_switch, *int_status; volatile u_char *idrom_addr, *ctrl_ast, *ctrl_int2; -volatile u_char *lance_mem, *ctrl_led, *sccport0a; +volatile u_char *ctrl_led, *sccport0a; +uint32_t lance_mem_phys; #ifdef news1700 static volatile u_char *ctrl_parity, *ctrl_parity_clr, *parity_vector; @@ -879,9 +880,9 @@ news1700_init(void) ctrl_ast = (u_char *)IIOV(0xe1280000); ctrl_int2 = (u_char *)IIOV(0xe1180000); - lance_mem = (u_char *)IIOV(0xe0e00000); sccport0a = (u_char *)IIOV(0xe0d40002); ctrl_led = (u_char *)IIOV(ctrl_led_phys); + lance_mem_phys = 0xe0e00000; p = (u_char *)idrom_addr; q = (u_char *)&idrom; @@ -970,9 +971,9 @@ news1200_init(void) ctrl_ast = (u_char *)IIOV(0xe1100000); ctrl_int2 = (u_char *)IIOV(0xe10c0000); - lance_mem = (u_char *)IIOV(0xe1a00000); sccport0a = (u_char *)IIOV(0xe1780002); ctrl_led = (u_char *)IIOV(ctrl_led_phys); + lance_mem_phys = 0xe1a00000; p = (u_char *)idrom_addr; q = (u_char *)&idrom;