Index: head/sys/dev/cfi/cfi_core.c =================================================================== --- head/sys/dev/cfi/cfi_core.c +++ head/sys/dev/cfi/cfi_core.c @@ -145,6 +145,17 @@ } } +/* + * This is same workaound as NetBSD sys/dev/nor/cfi.c cfi_reset_default() + */ +static void +cfi_reset_default(struct cfi_softc *sc) +{ + + cfi_write(sc, 0, CFI_BCS_READ_ARRAY2); + cfi_write(sc, 0, CFI_BCS_READ_ARRAY); +} + uint8_t cfi_read_qry(struct cfi_softc *sc, u_int ofs) { @@ -152,7 +163,7 @@ cfi_write(sc, CFI_QRY_CMD_ADDR * sc->sc_width, CFI_QRY_CMD_DATA); val = cfi_read(sc, ofs * sc->sc_width); - cfi_write(sc, 0, CFI_BCS_READ_ARRAY); + cfi_reset_default(sc); return (val); } @@ -745,7 +756,7 @@ /* error is 0. */ out: - cfi_write(sc, 0, CFI_BCS_READ_ARRAY); + cfi_reset_default(sc); /* Relock Intel flash */ switch (sc->sc_cmdset) { Index: head/sys/dev/cfi/cfi_reg.h =================================================================== --- head/sys/dev/cfi/cfi_reg.h +++ head/sys/dev/cfi/cfi_reg.h @@ -113,6 +113,7 @@ #define CFI_BCS_CONFIRM 0xd0 #define CFI_BCS_BUF_PROG_SETUP 0xe8 #define CFI_BCS_READ_ARRAY 0xff +#define CFI_BCS_READ_ARRAY2 0xf0 /* Intel commands. */ #define CFI_INTEL_LB 0x01 /* Lock Block */