Changeset View
Changeset View
Standalone View
Standalone View
sys/arm/broadcom/bcm2835/bcm2835_rng.c
Show First 20 Lines • Show All 103 Lines • ▼ Show 20 Lines | #if defined(BCM2835_RNG_USE_CALLOUT) | ||||
struct callout sc_rngto; | struct callout sc_rngto; | ||||
int sc_rnghz; | int sc_rnghz; | ||||
#endif | #endif | ||||
int sc_stall_count; | int sc_stall_count; | ||||
int sc_rbg2x; | int sc_rbg2x; | ||||
long sc_underrun; | long sc_underrun; | ||||
}; | }; | ||||
static struct ofw_compat_data compat_data[] = { | |||||
{"broadcom,bcm2835-rng", 1}, | |||||
{"brcm,bcm2835-rng", 1}, | |||||
{NULL, 0} | |||||
}; | |||||
static __inline void | static __inline void | ||||
bcm2835_rng_stat_inc_underrun(struct bcm2835_rng_softc *sc) | bcm2835_rng_stat_inc_underrun(struct bcm2835_rng_softc *sc) | ||||
{ | { | ||||
atomic_add_long(&sc->sc_underrun, 1); | atomic_add_long(&sc->sc_underrun, 1); | ||||
} | } | ||||
static __inline uint32_t | static __inline uint32_t | ||||
▲ Show 20 Lines • Show All 239 Lines • ▼ Show 20 Lines | |||||
static int | static int | ||||
bcm2835_rng_probe(device_t dev) | bcm2835_rng_probe(device_t dev) | ||||
{ | { | ||||
if (!ofw_bus_status_okay(dev)) | if (!ofw_bus_status_okay(dev)) | ||||
return (ENXIO); | return (ENXIO); | ||||
if (!ofw_bus_is_compatible(dev, "broadcom,bcm2835-rng")) | if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0) | ||||
return (ENXIO); | return (ENXIO); | ||||
device_set_desc(dev, "Broadcom BCM2835 RNG"); | device_set_desc(dev, "Broadcom BCM2835 RNG"); | ||||
return (BUS_PROBE_DEFAULT); | return (BUS_PROBE_DEFAULT); | ||||
} | } | ||||
static int | static int | ||||
▲ Show 20 Lines • Show All 159 Lines • Show Last 20 Lines |