Adapt MI mk48txx(4) changes. Tested on NWS-1750.

This commit is contained in:
tsutsui 2003-11-01 22:49:38 +00:00
parent 97717cc9f4
commit 164022f59e
1 changed files with 12 additions and 15 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: mkclock_hb.c,v 1.7 2003/07/19 02:25:21 tsutsui Exp $ */
/* $NetBSD: mkclock_hb.c,v 1.8 2003/11/01 22:49:38 tsutsui Exp $ */
/*-
* Copyright (c) 1996 The NetBSD Foundation, Inc.
@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: mkclock_hb.c,v 1.7 2003/07/19 02:25:21 tsutsui Exp $");
__KERNEL_RCSID(0, "$NetBSD: mkclock_hb.c,v 1.8 2003/11/01 22:49:38 tsutsui Exp $");
#include <sys/param.h>
#include <sys/kernel.h>
@ -49,6 +49,7 @@ __KERNEL_RCSID(0, "$NetBSD: mkclock_hb.c,v 1.7 2003/07/19 02:25:21 tsutsui Exp $
#include <dev/clock_subr.h>
#include <dev/ic/mk48txxreg.h>
#include <dev/ic/mk48txxvar.h>
#include <news68k/news68k/clockvar.h>
@ -57,7 +58,7 @@ __KERNEL_RCSID(0, "$NetBSD: mkclock_hb.c,v 1.7 2003/07/19 02:25:21 tsutsui Exp $
int mkclock_hb_match(struct device *, struct cfdata *, void *);
void mkclock_hb_attach(struct device *, struct device *, void *);
CFATTACH_DECL(mkclock_hb, sizeof(struct device),
CFATTACH_DECL(mkclock_hb, sizeof(struct mk48txx_softc),
mkclock_hb_match, mkclock_hb_attach, NULL, NULL);
extern struct cfdriver mkclock_cd;
@ -90,23 +91,19 @@ mkclock_hb_attach(parent, self, aux)
struct device *parent, *self;
void *aux;
{
struct mk48txx_softc *sc = (void *)self;
struct hb_attach_args *ha = aux;
bus_space_tag_t bst = ha->ha_bust;
bus_space_handle_t bsh;
todr_chip_handle_t handle;
if (bus_space_map(bst, (bus_addr_t)ha->ha_address, ha->ha_size,
0, &bsh) != 0)
sc->sc_bst = ha->ha_bust;
if (bus_space_map(sc->sc_bst, (bus_addr_t)ha->ha_address, ha->ha_size,
0, &sc->sc_bsh) != 0)
printf("can't map device space\n");
handle = mk48txx_attach(bst, bsh, "mk48t02", 1900, NULL, NULL);
if (handle == NULL)
panic("can't attach tod clock");
sc->sc_model = "mk48t02";
sc->sc_year0 = 1900;
mk48txx_attach(sc);
printf("\n");
handle->bus_cookie = NULL;
handle->todr_setwen = NULL;
todr_attach(handle);
todr_attach(&sc->sc_handle);
}