diff options
author | Patrick Wildt <patrick@cvs.openbsd.org> | 2016-07-27 11:45:03 +0000 |
---|---|---|
committer | Patrick Wildt <patrick@cvs.openbsd.org> | 2016-07-27 11:45:03 +0000 |
commit | 1fd68993a9a5fbb0307078e17eb6ede551aedddf (patch) | |
tree | 4d88596a74b88d513c2557c21203fcfc1bac3dbe /sys/arch/armv7/omap/ommmc.c | |
parent | 786148d7afd0301a999f964879ef4bb28778e6d9 (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/ommmc.c')
-rw-r--r-- | sys/arch/armv7/omap/ommmc.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/sys/arch/armv7/omap/ommmc.c b/sys/arch/armv7/omap/ommmc.c index c6f530d0127..bf0451cae88 100644 --- a/sys/arch/armv7/omap/ommmc.c +++ b/sys/arch/armv7/omap/ommmc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ommmc.c,v 1.26 2016/07/17 02:45:05 jsg Exp $ */ +/* $OpenBSD: ommmc.c,v 1.27 2016/07/27 11:45:02 patrick Exp $ */ /* * Copyright (c) 2009 Dale Rahn <drahn@openbsd.org> @@ -37,6 +37,7 @@ #include <armv7/omap/sitara_cm.h> #include <dev/ofw/openfirm.h> +#include <dev/ofw/fdt.h> /* * NOTE: on OMAP4430/AM335x these registers skew by 0x100 @@ -302,18 +303,18 @@ ommmc_attach(struct device *parent, struct device *self, void *aux) int len, unit; char hwmods[128]; - if (faa->fa_nreg != 2 || (faa->fa_nintr != 1 && faa->fa_nintr != 3)) + if (faa->fa_nreg != 1 || (faa->fa_nintr != 1 && faa->fa_nintr != 3)) return; - if (faa->fa_reg[1] <= 0x100) + if (faa->fa_reg[0].size <= 0x100) return; if (OF_is_compatible(faa->fa_node, "ti,omap4-hsmmc")) { - addr = faa->fa_reg[0] + 0x100; - size = faa->fa_reg[1] - 0x100; + addr = faa->fa_reg[0].addr + 0x100; + size = faa->fa_reg[0].size - 0x100; } else { - addr = faa->fa_reg[0]; - size = faa->fa_reg[1]; + addr = faa->fa_reg[0].addr; + size = faa->fa_reg[0].size; } if (faa->fa_nintr == 1) |