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.
This commit is contained in:
tsutsui 2005-02-27 09:27:31 +00:00
parent 81e257d906
commit 93dd53ae14
2 changed files with 12 additions and 10 deletions

View File

@ -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 <sys/cdefs.h>
__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);

View File

@ -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 <sys/cdefs.h>
__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;