diff options
| author | Brooks Davis <brooks@FreeBSD.org> | 2013-05-30 01:22:50 +0000 |
|---|---|---|
| committer | Brooks Davis <brooks@FreeBSD.org> | 2013-05-30 01:22:50 +0000 |
| commit | 5faf6ff4cc13ebe45fc7235969241166fff19192 (patch) | |
| tree | 6299251079cb994f2371ee493e84aa9bdc111232 /sys/dev/cfi/cfi_core.c | |
| parent | 444e780150341dd02ad735ef7e30912db26e7a55 (diff) | |
Notes
Diffstat (limited to 'sys/dev/cfi/cfi_core.c')
| -rw-r--r-- | sys/dev/cfi/cfi_core.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/sys/dev/cfi/cfi_core.c b/sys/dev/cfi/cfi_core.c index c7d0db99cb9c..083f5fca370f 100644 --- a/sys/dev/cfi/cfi_core.c +++ b/sys/dev/cfi/cfi_core.c @@ -409,6 +409,16 @@ cfi_write_block(struct cfi_softc *sc) register_t intr; int error, i; + /* Intel flash must be unlocked before modification */ + switch (sc->sc_cmdset) { + case CFI_VEND_INTEL_ECS: + case CFI_VEND_INTEL_SCS: + cfi_write(sc, sc->sc_wrofs, CFI_INTEL_LBS); + cfi_write(sc, sc->sc_wrofs, CFI_INTEL_UB); + cfi_write(sc, sc->sc_wrofs, CFI_BCS_READ_ARRAY); + break; + } + /* Erase the block. */ switch (sc->sc_cmdset) { case CFI_VEND_INTEL_ECS: @@ -477,6 +487,16 @@ cfi_write_block(struct cfi_softc *sc) out: cfi_write(sc, 0, CFI_BCS_READ_ARRAY); + + /* Relock Intel flash */ + switch (sc->sc_cmdset) { + case CFI_VEND_INTEL_ECS: + case CFI_VEND_INTEL_SCS: + cfi_write(sc, sc->sc_wrofs, CFI_INTEL_LBS); + cfi_write(sc, sc->sc_wrofs, CFI_INTEL_LB); + cfi_write(sc, sc->sc_wrofs, CFI_BCS_READ_ARRAY); + break; + } return (error); } |
