summaryrefslogtreecommitdiff
path: root/sys/arch/armv7/omap
diff options
context:
space:
mode:
authorSylvestre Gallon <syl@cvs.openbsd.org>2013-10-28 20:45:21 +0000
committerSylvestre Gallon <syl@cvs.openbsd.org>2013-10-28 20:45:21 +0000
commit96b745b1e742cb7858f8a57f664b8bb8cbed86ea (patch)
treee8f5906408f766078629e8b626d4d6598c00f7f0 /sys/arch/armv7/omap
parentbf6719da86acc4afde944a0a203eb06968a4d6f8 (diff)
Enable blocksize > 512 and cleanup ommmc_attach().
ok patrick@. With some input from Dale Rahn, Thanks!
Diffstat (limited to 'sys/arch/armv7/omap')
-rw-r--r--sys/arch/armv7/omap/ommmc.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/sys/arch/armv7/omap/ommmc.c b/sys/arch/armv7/omap/ommmc.c
index 67584ff3e83..770e3541839 100644
--- a/sys/arch/armv7/omap/ommmc.c
+++ b/sys/arch/armv7/omap/ommmc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ommmc.c,v 1.8 2013/10/24 19:39:46 syl Exp $ */
+/* $OpenBSD: ommmc.c,v 1.9 2013/10/28 20:45:20 syl Exp $ */
/*
* Copyright (c) 2009 Dale Rahn <drahn@openbsd.org>
@@ -280,7 +280,6 @@ ommmc_attach(struct device *parent, struct device *self, void *args)
struct ommmc_softc *sc = (struct ommmc_softc *) self;
struct omap_attach_args *oa = args;
struct sdmmcbus_attach_args saa;
- int error = 1;
uint32_t caps;
sc->sc_iot = oa->oa_iot;
@@ -295,6 +294,10 @@ ommmc_attach(struct device *parent, struct device *self, void *args)
sc->sc_ih = arm_intr_establish(oa->oa_dev->irq[0], IPL_SDMMC,
ommmc_intr, sc, DEVNAME(sc));
+ if (sc->sc_ih == NULL) {
+ printf("%s: cannot map interrupt\n", DEVNAME(sc));
+ goto err;
+ }
#if 0
/* XXX - IIRC firmware should set this */
@@ -309,7 +312,7 @@ ommmc_attach(struct device *parent, struct device *self, void *args)
/*
* Reset the host controller and enable interrupts.
*/
- (void)ommmc_host_reset(sc);
+ ommmc_host_reset(sc);
/* Determine host capabilities. */
caps = HREAD4(sc, MMCHS_CAPA);
@@ -377,9 +380,6 @@ ommmc_attach(struct device *parent, struct device *self, void *args)
printf("invalid capability blocksize in capa %08x,"
" trying 512\n", HREAD4(sc, MMCHS_CAPA));
}
-
- sc->maxblklen = 512; /* XXX */
-
/*
* Attach the generic SD/MMC bus driver. (The bus driver must
* not invoke any chipset functions before it is attached.)
@@ -394,14 +394,15 @@ ommmc_attach(struct device *parent, struct device *self, void *args)
sc->sdmmc = config_found(&sc->sc_dev, &saa, NULL);
if (sc->sdmmc == NULL) {
- error = 0;
+ printf("%s: can't attach sdmmc\n", DEVNAME(sc));
goto err;
}
return;
-
err:
- return;
+ if (sc->sc_ih != NULL)
+ arm_intr_disestablish(sc->sc_ih);
+ bus_space_unmap(sc->sc_iot, sc->sc_ioh, oa->oa_dev->mem[0].size);
}