1
0
mirror of https://review.coreboot.org/flashrom.git synced 2025-07-01 22:21:16 +02:00

Add support for remaining Numonyx (Micron) N25Q chips

Add...
 - N25Q128..3E
 - N25Q128..1E
 - N25Q256..1E (defunct due to addressing)
 - N25Q256..3E (defunct due to addressing)
 - N25Q512..1E (defunct due to addressing)
 - N25Q512..3E (defunct due to addressing)
 - N25Q00A..3G (defunct due to addressing)

Also, refine existing family members.

Corresponding to flashrom svn r1693.

Signed-off-by: Nikolay Nikolaev <evrinoma@gmail.com>
Reviewed-by: Steven Zakulec <spzakulec@gmail.com>
Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
This commit is contained in:
Nikolay Nikolaev
2013-06-28 21:29:51 +00:00
committed by Stefan Tauner
parent c80c4a35a0
commit 6f59b0bc51
6 changed files with 339 additions and 16 deletions

45
spi25.c
View File

@ -473,6 +473,49 @@ int spi_block_erase_52(struct flashctx *flash, unsigned int addr,
return 0;
}
/* Block size is usually
* 32M (one die) for Micron
*/
int spi_block_erase_c4(struct flashctx *flash, unsigned int addr, unsigned int blocklen)
{
int result;
struct spi_command cmds[] = {
{
.writecnt = JEDEC_WREN_OUTSIZE,
.writearr = (const unsigned char[]){ JEDEC_WREN },
.readcnt = 0,
.readarr = NULL,
}, {
.writecnt = JEDEC_BE_C4_OUTSIZE,
.writearr = (const unsigned char[]){
JEDEC_BE_C4,
(addr >> 16) & 0xff,
(addr >> 8) & 0xff,
(addr & 0xff)
},
.readcnt = 0,
.readarr = NULL,
}, {
.writecnt = 0,
.writearr = NULL,
.readcnt = 0,
.readarr = NULL,
}};
result = spi_send_multicommand(flash, cmds);
if (result) {
msg_cerr("%s failed during command execution at address 0x%x\n", __func__, addr);
return result;
}
/* Wait until the Write-In-Progress bit is cleared.
* This usually takes 240-480 s, so wait in 500 ms steps.
*/
while (spi_read_status_register(flash) & SPI_SR_WIP)
programmer_delay(500 * 1000 * 1000);
/* FIXME: Check the status register for errors. */
return 0;
}
/* Block size is usually
* 64k for Macronix
* 32k for SST
@ -780,6 +823,8 @@ erasefunc_t *spi_get_erasefn_from_opcode(uint8_t opcode)
return &spi_block_erase_62;
case 0x81:
return &spi_block_erase_81;
case 0xc4:
return &spi_block_erase_c4;
case 0xc7:
return &spi_block_erase_c7;
case 0xd7: