Exemple #1
0
void
mcclock_mace_attach(struct device *parent, struct device *self, void *aux)
{
	struct mcclock_mace_softc *sc = (void *)self;
	struct mace_attach_args *maa = aux;

	sc->sc_st = maa->maa_st;
	/* XXX should be bus_space_map() */
	if (bus_space_subregion(maa->maa_st, maa->maa_sh,
	    maa->maa_offset, 0, &sc->sc_sh))
		panic("mcclock_mace_attach: couldn't map");

	/*
	 * We want a fixed format: 24-hour, BCD data, so just force the
	 * RTC to this mode; if there was junk there we'll be able to
	 * fix things up later when we discover the time read back is
	 * no good.
	 */
	ds1687_write(sc, DS1687_CONTROLA, DS1687_DV1 | DS1687_BANK1);
	ds1687_write(sc, DS1687_CONTROLB, DS1687_24HRS);

	/* XXXrkb: init kickstart/wakeup stuff */

	if (!(ds1687_read(sc, DS1687_CONTROLD) & DS1687_VRT))
		printf(": lithium cell is dead, RTC unreliable");

	printf("\n");
	clockattach(&sc->sc_dev, &mcclock_mace_clockfns);
}
Exemple #2
0
void
aurtc_attach(struct device *parent, struct device *self, void *aux)
{

	printf(": Au1X00 programmable clock");	/* \n in clockattach */
	clockattach(self, &aurtc_clockfns);
}
Exemple #3
0
void
mcclock_attach(device_t dev)
{
	/* Turn interrupts off, just in case. */
	MCCLOCK_WRITE(dev, MC_REGB, MC_REGB_BINARY | MC_REGB_24HR);

	clockattach(dev);
}
Exemple #4
0
static void
eficlock_create(void *arg)
{
	kobj_t clock;
	clock = (kobj_t)
		kobj_create(&eficlock_class, M_TEMP, M_NOWAIT);
	clockattach(clock);
}
Exemple #5
0
void
mcclock_attach(struct mcclock_softc *sc, const struct mcclock_busfns *busfns)
{

    printf(": mc146818 or compatible\n");

    sc->sc_busfns = busfns;

    /*
     * Turn interrupts off, just in case.  Need to leave the SQWE
     * set, because that's the DRAM refresh signal on Rev. B boards.
     */
    mc146818_write(sc, MC_REGB, MC_REGB_SQWE | MC_REGB_BINARY |
                   MC_REGB_24HR);

    clockattach(&sc->sc_dev, &mcclock_clockfns);
}
void
mcclock_attach(struct mcclock_softc *sc, const struct mcclock_busfns *busfns)
{

	printf(": mc146818 or compatible");

	sc->sc_busfns = busfns;

	/* Turn interrupts off, just in case. */
	mc146818_write(sc, MC_REGB, MC_REGB_BINARY | MC_REGB_24HR);

	clockattach(sc->sc_dev, &mcclock_clockfns);

	sc->sc_todr.todr_gettime = mcclock_get;
	sc->sc_todr.todr_settime = mcclock_set;
	sc->sc_todr.cookie = sc;
	todr_attach(&sc->sc_todr);
}
void
mcclock_attach(struct mc146818_softc *sc)
{

	sc->sc_year0 = 1900 + UNIX_YEAR_OFFSET;
	sc->sc_flag = 0;	/* BINARY, 24HR */

	mc146818_attach(sc);

	aprint_normal("\n");

	/* Turn interrupts off, just in case. */
	(*sc->sc_mcwrite)(sc, MC_REGB, MC_REGB_BINARY | MC_REGB_24HR);

	mcclock_set_pcc_freq(sc);

	clockattach(mcclock_init, (void *)sc);
}
Exemple #8
0
void
mkclock_isa_attach(struct device *parent, struct device *self, void *aux)
{
	struct isa_attach_args *ia = aux;
	struct mkclock_isa_softc *sc = (struct mkclock_isa_softc *)self;

	/* Map I/O space. */
	sc->sc_iot = ia->ia_iot;
	if (bus_space_map(sc->sc_iot, ia->ia_io[0].ir_addr,
	    ia->ia_io[0].ir_size, 0, &sc->sc_ioh))
		panic("mkclock_isa_attach: couldn't map clock I/O space");

	/* Attach to MI mk48txx driver. */
	sc->sc_todr = mk48txx_attach(sc->sc_iot, sc->sc_ioh, "mk48t18", 1900,
	    mkclock_isa_nvrd, mkclock_isa_nvwr);
	if (sc->sc_todr == NULL)
		panic("\nmkclock_isa_attach: mk48txx attach failed");

	clockattach(self, &mkclock_isa_clockfns);
}