Date: Mon, 2 Feb 2009 18:30:15 +0000 (UTC) From: Sam Leffler <sam@FreeBSD.org> To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r188015 - projects/cambria/sys/dev/cfi Message-ID: <200902021830.n12IUFGd004116@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200902021830.n12IUFGd004116>