[cfi] fix CFI flash reset command for MX29LV320T/B.
MX flash MX29LV320T/B datasheet say reset is 0xf0. Submitted by: Hiroki Mori <yamori813@yahoo.co.jp> Approved by: mizhka Differential Revision: https://reviews.freebsd.org/D10177
This commit is contained in:
parent
4aa177430c
commit
6bf13692f9
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=317865
@ -145,6 +145,17 @@ cfi_write(struct cfi_softc *sc, u_int ofs, u_int val)
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* 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_read_qry(struct cfi_softc *sc, u_int ofs)
|
||||
|
||||
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 @@ cfi_write_block(struct cfi_softc *sc)
|
||||
/* error is 0. */
|
||||
|
||||
out:
|
||||
cfi_write(sc, 0, CFI_BCS_READ_ARRAY);
|
||||
cfi_reset_default(sc);
|
||||
|
||||
/* Relock Intel flash */
|
||||
switch (sc->sc_cmdset) {
|
||||
|
@ -113,6 +113,7 @@ struct cfi_qry {
|
||||
#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 */
|
||||
|
Loading…
Reference in New Issue
Block a user