From 1fd68993a9a5fbb0307078e17eb6ede551aedddf Mon Sep 17 00:00:00 2001 From: Patrick Wildt Date: Wed, 27 Jul 2016 11:45:03 +0000 Subject: 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@ --- sys/arch/armv7/omap/ommmc.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'sys/arch/armv7/omap/ommmc.c') 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 @@ -37,6 +37,7 @@ #include #include +#include /* * 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) -- cgit v1.2.3