Use bus_space_map(9) to get bus_space_handle_t on each driver
and remove bogus bus_space_handle_t member from mainbus_attach_args.
This commit is contained in:
parent
c988ba8700
commit
bc4a0707e8
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: mainbus.c,v 1.14 2006/04/05 15:03:27 tsutsui Exp $ */
|
||||
/* $NetBSD: mainbus.c,v 1.15 2006/04/06 11:50:19 tsutsui Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2000 Soren S. Jorvang. All rights reserved.
|
||||
@ -26,7 +26,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.14 2006/04/05 15:03:27 tsutsui Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.15 2006/04/06 11:50:19 tsutsui Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
@ -77,7 +77,6 @@ mainbus_search(struct device *parent, struct cfdata *cf, const int *ldesc,
|
||||
do {
|
||||
ma->ma_addr = cf->cf_loc[MAINBUSCF_ADDR];
|
||||
ma->ma_iot = 0;
|
||||
ma->ma_ioh = MIPS_PHYS_TO_KSEG1(ma->ma_addr);
|
||||
ma->ma_level = cf->cf_loc[MAINBUSCF_LEVEL];
|
||||
if (config_match(parent, cf, ma) > 0)
|
||||
config_attach(parent, cf, ma, mainbus_print);
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: com_mainbus.c,v 1.10 2005/12/11 12:17:06 christos Exp $ */
|
||||
/* $NetBSD: com_mainbus.c,v 1.11 2006/04/06 11:50:19 tsutsui Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2000 Soren S. Jorvang. All rights reserved.
|
||||
@ -26,7 +26,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: com_mainbus.c,v 1.10 2005/12/11 12:17:06 christos Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: com_mainbus.c,v 1.11 2006/04/06 11:50:19 tsutsui Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
@ -77,16 +77,12 @@ com_mainbus_attach(struct device *parent, struct device *self, void *aux)
|
||||
sc->sc_iot = maa->ma_iot;
|
||||
sc->sc_iobase = maa->ma_addr;
|
||||
|
||||
#if 0 /* XXX */
|
||||
if (!com_is_console(sc->sc_iot, sc->sc_iobase, &sc->sc_ioh) &&
|
||||
bus_space_map(sc->sc_iot, sc->sc_iobase, COM_NPORTS, 0,
|
||||
&sc->sc_ioh)) {
|
||||
printf(": can't map i/o space\n");
|
||||
return;
|
||||
}
|
||||
#else
|
||||
sc->sc_ioh = maa->ma_ioh;
|
||||
#endif
|
||||
|
||||
sc->sc_frequency = COM_MAINBUS_FREQ;
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: panel.c,v 1.9 2006/04/05 15:14:49 tsutsui Exp $ */
|
||||
/* $NetBSD: panel.c,v 1.10 2006/04/06 11:50:19 tsutsui Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2002 Dennis I. Chernoivanov
|
||||
@ -28,7 +28,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: panel.c,v 1.9 2006/04/05 15:14:49 tsutsui Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: panel.c,v 1.10 2006/04/06 11:50:19 tsutsui Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
@ -53,6 +53,7 @@ __KERNEL_RCSID(0, "$NetBSD: panel.c,v 1.9 2006/04/05 15:14:49 tsutsui Exp $");
|
||||
#include "ioconf.h"
|
||||
|
||||
#define PANEL_POLLRATE (hz / 10)
|
||||
#define PANEL_REGION 0x20
|
||||
#define DATA_OFFSET 0x10
|
||||
|
||||
struct panel_softc {
|
||||
@ -113,7 +114,11 @@ panel_attach(struct device *parent, struct device *self, void *aux)
|
||||
};
|
||||
|
||||
sc->sc_lcd.sc_iot = maa->ma_iot;
|
||||
sc->sc_lcd.sc_ioir = maa->ma_ioh;
|
||||
if (bus_space_map(sc->sc_lcd.sc_iot, maa->ma_addr, PANEL_REGION,
|
||||
0, &sc->sc_lcd.sc_ioir)) {
|
||||
printf(": unable to map registers\n");
|
||||
return;
|
||||
}
|
||||
bus_space_subregion(sc->sc_lcd.sc_iot, sc->sc_lcd.sc_ioir, DATA_OFFSET,
|
||||
1, &sc->sc_lcd.sc_iodr);
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: autoconf.h,v 1.2 2000/05/05 03:27:22 soren Exp $ */
|
||||
/* $NetBSD: autoconf.h,v 1.3 2006/04/06 11:50:20 tsutsui Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2000 Soren S. Jorvang. All rights reserved.
|
||||
@ -31,6 +31,5 @@ struct mainbus_attach_args {
|
||||
char *ma_name;
|
||||
unsigned long ma_addr;
|
||||
bus_space_tag_t ma_iot;
|
||||
bus_space_handle_t ma_ioh;
|
||||
int ma_level;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user