summaryrefslogtreecommitdiff
path: root/sys/arch/armv7/omap/omdog.c
diff options
context:
space:
mode:
authorPatrick Wildt <patrick@cvs.openbsd.org>2016-07-27 11:45:03 +0000
committerPatrick Wildt <patrick@cvs.openbsd.org>2016-07-27 11:45:03 +0000
commit1fd68993a9a5fbb0307078e17eb6ede551aedddf (patch)
tree4d88596a74b88d513c2557c21203fcfc1bac3dbe /sys/arch/armv7/omap/omdog.c
parent786148d7afd0301a999f964879ef4bb28778e6d9 (diff)
Instead of passing the raw reg property to simplebus nodes,
pass a pre-processed array of fdt_reg structs. This means that the drivers don't have to understand the cell properties themselves but can rely on the 64-bit addr/size pairs. ok kettenis@
Diffstat (limited to 'sys/arch/armv7/omap/omdog.c')
-rw-r--r--sys/arch/armv7/omap/omdog.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/sys/arch/armv7/omap/omdog.c b/sys/arch/armv7/omap/omdog.c
index f4df5c4452d..376154bd9d7 100644
--- a/sys/arch/armv7/omap/omdog.c
+++ b/sys/arch/armv7/omap/omdog.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: omdog.c,v 1.6 2016/06/26 05:16:33 jsg Exp $ */
+/* $OpenBSD: omdog.c,v 1.7 2016/07/27 11:45:02 patrick Exp $ */
/*
* Copyright (c) 2013 Federico G. Schwindt <fgsch@openbsd.org>
* Copyright (c) 2007,2009 Dale Rahn <drahn@openbsd.org>
@@ -30,6 +30,7 @@
#include <machine/fdt.h>
#include <dev/ofw/openfirm.h>
+#include <dev/ofw/fdt.h>
#include <armv7/armv7/armv7var.h>
@@ -94,12 +95,12 @@ omdog_attach(struct device *parent, struct device *self, void *aux)
struct omdog_softc *sc = (struct omdog_softc *) self;
u_int32_t rev;
- if (faa->fa_nreg < 2)
+ if (faa->fa_nreg < 1)
return;
sc->sc_iot = faa->fa_iot;
- if (bus_space_map(sc->sc_iot, faa->fa_reg[0],
- faa->fa_reg[1], 0, &sc->sc_ioh))
+ if (bus_space_map(sc->sc_iot, faa->fa_reg[0].addr,
+ faa->fa_reg[0].size, 0, &sc->sc_ioh))
panic("%s: bus_space_map failed!", __func__);
rev = bus_space_read_4(sc->sc_iot, sc->sc_ioh, WIDR);