svn commit: r188015 - projects/cambria/sys/dev/cfi
Sam Leffler
sam at FreeBSD.org
Mon Feb 2 10:30:16 PST 2009
Author: sam
Date: Mon Feb 2 18:30:15 2009
New Revision: 188015
URL: http://svn.freebsd.org/changeset/base/188015
Log:
allow bus shims to force the interface width; probing can be problematic
with the current design
Modified:
projects/cambria/sys/dev/cfi/cfi_core.c
Modified: projects/cambria/sys/dev/cfi/cfi_core.c
==============================================================================
--- projects/cambria/sys/dev/cfi/cfi_core.c Mon Feb 2 18:10:51 2009 (r188014)
+++ projects/cambria/sys/dev/cfi/cfi_core.c Mon Feb 2 18:30:15 2009 (r188015)
@@ -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;
More information about the svn-src-projects
mailing list