summaryrefslogtreecommitdiffstats
path: root/sys/dev/cfi/cfi_core.c
diff options
context:
space:
mode:
authorsam <sam@FreeBSD.org>2009-02-03 19:09:16 +0000
committersam <sam@FreeBSD.org>2009-02-03 19:09:16 +0000
commit1c7231d291dc8bdb06b0a0035fcf508625ce2abb (patch)
treeaf734714a1b70e30043be6a468e07da4683b15b7 /sys/dev/cfi/cfi_core.c
parent1e53abb0ad62f1814d2b07c4d51b8ba304995500 (diff)
downloadFreeBSD-src-1c7231d291dc8bdb06b0a0035fcf508625ce2abb.zip
FreeBSD-src-1c7231d291dc8bdb06b0a0035fcf508625ce2abb.tar.gz
honor any interface width (e.g. setup by the bus shim) and don't probe;
this is needed for the moment to workaround bus shim issues
Diffstat (limited to 'sys/dev/cfi/cfi_core.c')
-rw-r--r--sys/dev/cfi/cfi_core.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/sys/dev/cfi/cfi_core.c b/sys/dev/cfi/cfi_core.c
index 4df3190..c25e446f 100644
--- a/sys/dev/cfi/cfi_core.c
+++ b/sys/dev/cfi/cfi_core.c
@@ -150,11 +150,16 @@ cfi_probe(device_t dev)
sc->sc_tag = rman_get_bustag(sc->sc_res);
sc->sc_handle = rman_get_bushandle(sc->sc_res);
- sc->sc_width = 1;
- while (sc->sc_width <= 4) {
- if (cfi_read_qry(sc, CFI_QRY_IDENT) == 'Q')
- break;
- sc->sc_width <<= 1;
+ if (sc->sc_width == 0) {
+ sc->sc_width = 1;
+ while (sc->sc_width <= 4) {
+ if (cfi_read_qry(sc, CFI_QRY_IDENT) == 'Q')
+ break;
+ sc->sc_width <<= 1;
+ }
+ } else if (cfi_read_qry(sc, CFI_QRY_IDENT) != 'Q') {
+ error = ENXIO;
+ goto out;
}
if (sc->sc_width > 4) {
error = ENXIO;
OpenPOWER on IntegriCloud