diff options
author | Jason Wright <jason@cvs.openbsd.org> | 2001-06-26 06:33:53 +0000 |
---|---|---|
committer | Jason Wright <jason@cvs.openbsd.org> | 2001-06-26 06:33:53 +0000 |
commit | 2f289086501d8e262e4ab515e783c334136bedc0 (patch) | |
tree | a487685b6d5671431611fe3b43f243a5f96dfad4 | |
parent | 38ff9051ba504cfdd1c2e9f02b248b2b71c2e9bf (diff) |
jack up the rng clock prescalar a bit
define the rng address space
-rw-r--r-- | sys/dev/pci/lofn.c | 6 | ||||
-rw-r--r-- | sys/dev/pci/lofnreg.h | 4 | ||||
-rw-r--r-- | sys/dev/pci/lofnvar.h | 6 |
3 files changed, 12 insertions, 4 deletions
diff --git a/sys/dev/pci/lofn.c b/sys/dev/pci/lofn.c index 0e7c5c56cc2..1fc30ec9ef4 100644 --- a/sys/dev/pci/lofn.c +++ b/sys/dev/pci/lofn.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lofn.c,v 1.4 2001/06/26 05:52:53 jason Exp $ */ +/* $OpenBSD: lofn.c,v 1.5 2001/06/26 06:33:51 jason Exp $ */ /* * Copyright (c) 2001 Jason L. Wright (jason@thought.net) @@ -135,6 +135,8 @@ lofn_attach(parent, self, aux) goto fail; } + WRITE_REG_0(sc, LOFN_REL_RNC, LOFN_RNG_SCALAR); + /* Enable RNG */ WRITE_REG_0(sc, LOFN_REL_IER, READ_REG_0(sc, LOFN_REL_IER) | LOFN_IER_RDY); @@ -169,7 +171,7 @@ lofn_intr(vsc) } else if (sr & LOFN_SR_RNG_RDY) { r = 1; - bus_space_read_region_4(sc->sc_st, sc->sc_sh, 0x1080, + bus_space_read_region_4(sc->sc_st, sc->sc_sh, LOFN_REL_RNG, sc->sc_rngbuf, LOFN_RNGBUF_SIZE); for (i = 0; i < LOFN_RNGBUF_SIZE; i++) add_true_randomness(sc->sc_rngbuf[i]); diff --git a/sys/dev/pci/lofnreg.h b/sys/dev/pci/lofnreg.h index 036ce82efbb..8a805031f99 100644 --- a/sys/dev/pci/lofnreg.h +++ b/sys/dev/pci/lofnreg.h @@ -1,4 +1,4 @@ -/* $OpenBSD: lofnreg.h,v 1.5 2001/06/26 05:45:27 jason Exp $ */ +/* $OpenBSD: lofnreg.h,v 1.6 2001/06/26 06:33:52 jason Exp $ */ /* * Copyright (c) 2001 Jason L. Wright (jason@thought.net) @@ -38,6 +38,8 @@ #define LOFN_WIN_2 0x4000 #define LOFN_WIN_3 0x6000 +#define LOFN_REL_RNG 0x1080 /* RNG FIFO start */ +#define LOFN_REL_RNG_END 0x10bf /* RNG FIFO end */ /* Control and status registers, relative to window number */ #define LOFN_REL_CR 0x1fd4 /* Command */ #define LOFN_REL_SR 0x1fd8 /* Status */ diff --git a/sys/dev/pci/lofnvar.h b/sys/dev/pci/lofnvar.h index be24c36d801..fa769f71669 100644 --- a/sys/dev/pci/lofnvar.h +++ b/sys/dev/pci/lofnvar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: lofnvar.h,v 1.3 2001/06/26 05:03:10 jason Exp $ */ +/* $OpenBSD: lofnvar.h,v 1.4 2001/06/26 06:33:52 jason Exp $ */ /* * Copyright (c) 2001 Jason L. Wright (jason@thought.net) @@ -55,3 +55,7 @@ struct lofn_softc { #define WRITE_REG_1(sc,r,v) WRITE_REG((sc), (r) | LOFN_WIN_1, (v)) #define WRITE_REG_2(sc,r,v) WRITE_REG((sc), (r) | LOFN_WIN_2, (v)) #define WRITE_REG_3(sc,r,v) WRITE_REG((sc), (r) | LOFN_WIN_3, (v)) + +#ifndef LOFN_RNG_SCALAR +#define LOFN_RNG_SCALAR 0x00000700 +#endif |