Change in flashrom[master]: Add support for Fudan SPI flash chips

Angel Pons has uploaded this change for review. ( https://review.coreboot.org/c/flashrom/+/38919 ) Change subject: Add support for Fudan SPI flash chips ...................................................................... Add support for Fudan SPI flash chips This includes the following chips: - FM25F005 - FM25F01 - FM25F02 and FM25F02A - FM25F04 and FM25F04A - FM25Q08 - FM25Q16 - FM25Q32 Change-Id: I11dd82f8c4003cc6f974981cb92dca084f1df1f0 Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at> --- M flashchips.c M flashchips.h 2 files changed, 282 insertions(+), 0 deletions(-) git pull ssh://review.coreboot.org:29418/flashrom refs/changes/19/38919/1 diff --git a/flashchips.c b/flashchips.c index 58dd4f3..7ba3840 100644 --- a/flashchips.c +++ b/flashchips.c @@ -5691,6 +5691,278 @@ }, { + .vendor = "Fudan", + .name = "FM25F005", + .bustype = BUS_SPI, + .manufacture_id = FUDAN_ID_NOPREFIX, + .model_id = FUDAN_FM25F005, + .total_size = 64, + .page_size = 256, + /* OTP: 256B total; enter 0x3A */ + .feature_bits = FEATURE_WRSR_WREN | FEATURE_OTP, + .tested = TEST_UNTESTED, + .probe = probe_spi_rdid, + .probe_timing = TIMING_ZERO, + .block_erasers = { + { + .eraseblocks = { {4 * 1024, 16} }, + .block_erase = spi_block_erase_20, + }, { + .eraseblocks = { {32 * 1024, 2} }, + .block_erase = spi_block_erase_52, + }, { + .eraseblocks = { {64 * 1024, 1} }, + .block_erase = spi_block_erase_d8, + }, { + .eraseblocks = { {64 * 1024, 1} }, + .block_erase = spi_block_erase_60, + }, { + .eraseblocks = { {64 * 1024, 1} }, + .block_erase = spi_block_erase_c7, + } + }, + .printlock = spi_prettyprint_status_register_bp2_tb_bpl, + .unlock = spi_disable_blockprotect_bp2_srwd, + .write = spi_chip_write_256, + .read = spi_chip_read, /* Fast read (0x0B), dual I/O (0x3B) supported */ + .voltage = {2700, 3600}, /* 2.3-2.7V acceptable results in lower performance */ + }, + + { + .vendor = "Fudan", + .name = "FM25F01", + .bustype = BUS_SPI, + .manufacture_id = FUDAN_ID_NOPREFIX, + .model_id = FUDAN_FM25F01, + .total_size = 128, + .page_size = 256, + /* OTP: 256B total; enter 0x3A */ + .feature_bits = FEATURE_WRSR_WREN | FEATURE_OTP, + .tested = TEST_UNTESTED, + .probe = probe_spi_rdid, + .probe_timing = TIMING_ZERO, + .block_erasers = { + { + .eraseblocks = { {4 * 1024, 32} }, + .block_erase = spi_block_erase_20, + }, { + .eraseblocks = { {32 * 1024, 4} }, + .block_erase = spi_block_erase_52, + }, { + .eraseblocks = { {64 * 1024, 2} }, + .block_erase = spi_block_erase_d8, + }, { + .eraseblocks = { {128 * 1024, 1} }, + .block_erase = spi_block_erase_60, + }, { + .eraseblocks = { {128 * 1024, 1} }, + .block_erase = spi_block_erase_c7, + } + }, + .printlock = spi_prettyprint_status_register_bp2_tb_bpl, + .unlock = spi_disable_blockprotect_bp2_srwd, + .write = spi_chip_write_256, + .read = spi_chip_read, /* Fast read (0x0B), dual I/O (0x3B) supported */ + .voltage = {2700, 3600}, /* 2.3-2.7V acceptable results in lower performance */ + }, + + { + .vendor = "Fudan", + .name = "FM25F02(A)", + .bustype = BUS_SPI, + .manufacture_id = FUDAN_ID_NOPREFIX, + .model_id = FUDAN_FM25F02, + .total_size = 256, + .page_size = 256, + /* OTP: 256B total; enter 0x3A, (A version only:) read ID 0x4B */ + .feature_bits = FEATURE_WRSR_WREN | FEATURE_OTP, + .tested = TEST_UNTESTED, + .probe = probe_spi_rdid, + .probe_timing = TIMING_ZERO, + .block_erasers = { + { + .eraseblocks = { {4 * 1024, 64} }, + .block_erase = spi_block_erase_20, + }, { + .eraseblocks = { {32 * 1024, 8} }, + .block_erase = spi_block_erase_52, + }, { + .eraseblocks = { {64 * 1024, 4} }, + .block_erase = spi_block_erase_d8, + }, { + .eraseblocks = { {1024 * 256, 1} }, + .block_erase = spi_block_erase_60, + }, { + .eraseblocks = { {1024 * 256, 1} }, + .block_erase = spi_block_erase_c7, + }, + }, + .printlock = spi_prettyprint_status_register_bp2_tb_bpl, + .unlock = spi_disable_blockprotect_bp2_srwd, + .write = spi_chip_write_256, + .read = spi_chip_read, /* Fast read (0x0B), dual I/O (0x3B) supported */ + .voltage = {2700, 3600}, /* 2.3-2.7V acceptable results in lower performance */ + }, + + { + .vendor = "Fudan", + .name = "FM25F04(A)", + .bustype = BUS_SPI, + .manufacture_id = FUDAN_ID_NOPREFIX, + .model_id = FUDAN_FM25F04, + .total_size = 512, + .page_size = 256, + /* OTP: 256B total; enter 0x3A, (A version only:) read ID 0x4B */ + .feature_bits = FEATURE_WRSR_WREN | FEATURE_OTP, + .tested = TEST_UNTESTED, + .probe = probe_spi_rdid, + .probe_timing = TIMING_ZERO, + .block_erasers = { + { + .eraseblocks = { {4 * 1024, 128} }, + .block_erase = spi_block_erase_20, + }, { + .eraseblocks = { {32 * 1024, 16} }, + .block_erase = spi_block_erase_52, + }, { + .eraseblocks = { {64 * 1024, 8} }, + .block_erase = spi_block_erase_d8, + }, { + .eraseblocks = { {1024 * 512, 1} }, + .block_erase = spi_block_erase_60, + }, { + .eraseblocks = { {1024 * 512, 1} }, + .block_erase = spi_block_erase_c7, + }, + }, + .printlock = spi_prettyprint_status_register_bp2_tb_bpl, + .unlock = spi_disable_blockprotect_bp2_srwd, + .write = spi_chip_write_256, + .read = spi_chip_read, /* Fast read (0x0B), dual I/O (0x3B) supported */ + .voltage = {2700, 3600}, + }, + + { + .vendor = "Fudan", + .name = "FM25Q08", + .bustype = BUS_SPI, + .manufacture_id = FUDAN_ID_NOPREFIX, + .model_id = FUDAN_FM25Q08, + .total_size = 1024, + .page_size = 256, + /* supports SFDP */ + /* OTP: 1024B total; read 0x48; write 0x42, erase 0x44, read ID 0x4B */ + /* QPI enable 0x38, disable 0xFF */ + .feature_bits = FEATURE_WRSR_WREN | FEATURE_OTP | FEATURE_QPI, + .tested = TEST_UNTESTED, + .probe = probe_spi_rdid, + .probe_timing = TIMING_ZERO, + .block_erasers = { + { + .eraseblocks = { {4 * 1024, 256} }, + .block_erase = spi_block_erase_20, + }, { + .eraseblocks = { {32 * 1024, 32} }, + .block_erase = spi_block_erase_52, + }, { + .eraseblocks = { {64 * 1024, 16} }, + .block_erase = spi_block_erase_d8, + }, { + .eraseblocks = { {1024 * 1024, 1} }, + .block_erase = spi_block_erase_60, + }, { + .eraseblocks = { {1024 * 1024, 1} }, + .block_erase = spi_block_erase_c7, + }, + }, + .printlock = spi_prettyprint_status_register_bp2_tb_bpl, /* bit6 selects size of protected blocks; TODO: SR2 */ + .unlock = spi_disable_blockprotect_bp2_srwd, + .write = spi_chip_write_256, + .read = spi_chip_read, /* Fast read (0x0B) and multi I/O supported */ + .voltage = {2700, 3600}, + }, + + { + .vendor = "Fudan", + .name = "FM25Q16", + .bustype = BUS_SPI, + .manufacture_id = FUDAN_ID_NOPREFIX, + .model_id = FUDAN_FM25Q16, + .total_size = 2048, + .page_size = 256, + /* supports SFDP */ + /* OTP: 1024B total; read 0x48; write 0x42, erase 0x44, read ID 0x4B */ + /* QPI enable 0x38, disable 0xFF */ + .feature_bits = FEATURE_WRSR_WREN | FEATURE_OTP | FEATURE_QPI, + .tested = TEST_UNTESTED, + .probe = probe_spi_rdid, + .probe_timing = TIMING_ZERO, + .block_erasers = { + { + .eraseblocks = { {4 * 1024, 512} }, + .block_erase = spi_block_erase_20, + }, { + .eraseblocks = { {32 * 1024, 64} }, + .block_erase = spi_block_erase_52, + }, { + .eraseblocks = { {64 * 1024, 32} }, + .block_erase = spi_block_erase_d8, + }, { + .eraseblocks = { {2 * 1024 * 1024, 1} }, + .block_erase = spi_block_erase_60, + }, { + .eraseblocks = { {2 * 1024 * 1024, 1} }, + .block_erase = spi_block_erase_c7, + } + }, + .printlock = spi_prettyprint_status_register_bp2_tb_bpl, /* bit6 selects size of protected blocks; TODO: SR2 */ + .unlock = spi_disable_blockprotect_bp2_srwd, + .write = spi_chip_write_256, + .read = spi_chip_read, /* Fast read (0x0B) and multi I/O supported */ + .voltage = {2700, 3600}, + }, + + { + .vendor = "Fudan", + .name = "FM25Q32", + .bustype = BUS_SPI, + .manufacture_id = FUDAN_ID_NOPREFIX, + .model_id = FUDAN_FM25Q32, + .total_size = 4096, + .page_size = 256, + /* supports SFDP */ + /* OTP: 1024B total; read 0x48; write 0x42, erase 0x44, read ID 0x4B */ + /* QPI enable 0x38, disable 0xFF */ + .feature_bits = FEATURE_WRSR_WREN | FEATURE_OTP | FEATURE_QPI, + .tested = TEST_UNTESTED, + .probe = probe_spi_rdid, + .probe_timing = TIMING_ZERO, + .block_erasers = { + { + .eraseblocks = { {4 * 1024, 1024} }, + .block_erase = spi_block_erase_20, + }, { + .eraseblocks = { {32 * 1024, 128} }, + .block_erase = spi_block_erase_52, + }, { + .eraseblocks = { {64 * 1024, 64} }, + .block_erase = spi_block_erase_d8, + }, { + .eraseblocks = { {4 * 1024 * 1024, 1} }, + .block_erase = spi_block_erase_60, + }, { + .eraseblocks = { {4 * 1024 * 1024, 1} }, + .block_erase = spi_block_erase_c7, + }, + }, + .printlock = spi_prettyprint_status_register_bp2_tb_bpl, /* bit6 selects size of protected blocks; TODO: SR2 */ + .unlock = spi_disable_blockprotect_bp2_srwd, + .write = spi_chip_write_256, + .read = spi_chip_read, /* Fast read (0x0B) and multi I/O supported */ + .voltage = {2700, 3600}, + }, + + { .vendor = "Fujitsu", .name = "MBM29F004BC", .bustype = BUS_PARALLEL, diff --git a/flashchips.h b/flashchips.h index 14ab6de..bcd612c 100644 --- a/flashchips.h +++ b/flashchips.h @@ -329,6 +329,16 @@ #define FIDELIX_FM25Q32 0x3216 #define FIDELIX_FM25Q64 0x3217 +#define FUDAN_ID 0x7F7F7F7F7F7F7F4A /* Shanghai Fudan Microelectronics resides in bank 8 */ +#define FUDAN_ID_NOPREFIX 0x04 /* Fudan, missing 0x7F prefix */ +#define FUDAN_FM25F005 0x3110 +#define FUDAN_FM25F01 0x3111 +#define FUDAN_FM25F02 0x3112 /* Same as FM25F02A */ +#define FUDAN_FM25F04 0x3113 /* Same as FM25F04A */ +#define FUDAN_FM25Q08 0x4014 +#define FUDAN_FM25Q16 0x4015 +#define FUDAN_FM25Q32 0x4016 + #define FUJITSU_ID 0x04 /* Fujitsu */ #define FUJITSU_MBM29DL400BC 0x0F #define FUJITSU_MBM29DL400TC 0x0C -- To view, visit https://review.coreboot.org/c/flashrom/+/38919 To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings Gerrit-Project: flashrom Gerrit-Branch: master Gerrit-Change-Id: I11dd82f8c4003cc6f974981cb92dca084f1df1f0 Gerrit-Change-Number: 38919 Gerrit-PatchSet: 1 Gerrit-Owner: Angel Pons <th3fanbus@gmail.com> Gerrit-MessageType: newchange

Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/38919 ) Change subject: Add support for Fudan SPI flash chips ...................................................................... Patch Set 1: This change comes from this place: https://patchwork.ozlabs.org/patch/628834/ -- To view, visit https://review.coreboot.org/c/flashrom/+/38919 To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings Gerrit-Project: flashrom Gerrit-Branch: master Gerrit-Change-Id: I11dd82f8c4003cc6f974981cb92dca084f1df1f0 Gerrit-Change-Number: 38919 Gerrit-PatchSet: 1 Gerrit-Owner: Angel Pons <th3fanbus@gmail.com> Gerrit-Reviewer: Angel Pons <th3fanbus@gmail.com> Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org> Gerrit-Comment-Date: Sat, 15 Feb 2020 15:24:37 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: No Gerrit-MessageType: comment

James has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/38919 ) Change subject: Add support for Fudan SPI flash chips ...................................................................... Patch Set 1: I tested this with a FM25F01 (0x3111). The Manufacturer ID is 0xa1 and not 0x04. Otherwise, read, write and erase appear to work as expected. -- To view, visit https://review.coreboot.org/c/flashrom/+/38919 To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings Gerrit-Project: flashrom Gerrit-Branch: master Gerrit-Change-Id: I11dd82f8c4003cc6f974981cb92dca084f1df1f0 Gerrit-Change-Number: 38919 Gerrit-PatchSet: 1 Gerrit-Owner: Angel Pons <th3fanbus@gmail.com> Gerrit-Reviewer: Angel Pons <th3fanbus@gmail.com> Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org> Gerrit-CC: James <jye836@gmail.com> Gerrit-CC: Paul Menzel <paulepanter@users.sourceforge.net> Gerrit-Comment-Date: Fri, 21 Feb 2020 03:14:55 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: No Gerrit-MessageType: comment

David Hendricks has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/38919 ) Change subject: Add support for Fudan SPI flash chips ...................................................................... Patch Set 1: Code-Review-1 (1 comment) I just checked the datasheets and the JEDEC spec as well and I think James is correct about the manufacturer ID. Otherwise this looks good! https://review.coreboot.org/c/flashrom/+/38919/1/flashchips.h File flashchips.h: https://review.coreboot.org/c/flashrom/+/38919/1/flashchips.h@333 PS1, Line 333: #define FUDAN_ID_NOPREFIX 0x04 /* Fudan, missing 0x7F prefix */ This should be A1, according to the datasheets (I'm looking at FM25Q32 and FM25F005) and JEP106. -- To view, visit https://review.coreboot.org/c/flashrom/+/38919 To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings Gerrit-Project: flashrom Gerrit-Branch: master Gerrit-Change-Id: I11dd82f8c4003cc6f974981cb92dca084f1df1f0 Gerrit-Change-Number: 38919 Gerrit-PatchSet: 1 Gerrit-Owner: Angel Pons <th3fanbus@gmail.com> Gerrit-Reviewer: Angel Pons <th3fanbus@gmail.com> Gerrit-Reviewer: David Hendricks <david.hendricks@gmail.com> Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org> Gerrit-CC: James <jye836@gmail.com> Gerrit-CC: Paul Menzel <paulepanter@users.sourceforge.net> Gerrit-Comment-Date: Sun, 23 Feb 2020 19:27:19 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: Yes Gerrit-MessageType: comment

Hello David Hendricks, build bot (Jenkins), I'd like you to reexamine a change. Please visit https://review.coreboot.org/c/flashrom/+/38919 to look at the new patch set (#2). Change subject: Add support for Fudan SPI flash chips ...................................................................... Add support for Fudan SPI flash chips This includes the following chips: - FM25F005 - FM25F01 - FM25F02 and FM25F02A - FM25F04 and FM25F04A - FM25Q08 - FM25Q16 - FM25Q32 Change-Id: I11dd82f8c4003cc6f974981cb92dca084f1df1f0 Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at> --- M flashchips.c M flashchips.h 2 files changed, 282 insertions(+), 0 deletions(-) git pull ssh://review.coreboot.org:29418/flashrom refs/changes/19/38919/2 -- To view, visit https://review.coreboot.org/c/flashrom/+/38919 To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings Gerrit-Project: flashrom Gerrit-Branch: master Gerrit-Change-Id: I11dd82f8c4003cc6f974981cb92dca084f1df1f0 Gerrit-Change-Number: 38919 Gerrit-PatchSet: 2 Gerrit-Owner: Angel Pons <th3fanbus@gmail.com> Gerrit-Reviewer: Angel Pons <th3fanbus@gmail.com> Gerrit-Reviewer: David Hendricks <david.hendricks@gmail.com> Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org> Gerrit-CC: James <jye836@gmail.com> Gerrit-CC: Paul Menzel <paulepanter@users.sourceforge.net> Gerrit-MessageType: newpatchset

Hello David Hendricks, build bot (Jenkins), I'd like you to reexamine a change. Please visit https://review.coreboot.org/c/flashrom/+/38919 to look at the new patch set (#3). Change subject: Add support for Fudan SPI flash chips ...................................................................... Add support for Fudan SPI flash chips This includes the following chips: - FM25F005 - FM25F01 - FM25F02 and FM25F02A - FM25F04 and FM25F04A - FM25Q08 - FM25Q16 - FM25Q32 Change-Id: I11dd82f8c4003cc6f974981cb92dca084f1df1f0 Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at> --- M flashchips.c M flashchips.h 2 files changed, 282 insertions(+), 0 deletions(-) git pull ssh://review.coreboot.org:29418/flashrom refs/changes/19/38919/3 -- To view, visit https://review.coreboot.org/c/flashrom/+/38919 To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings Gerrit-Project: flashrom Gerrit-Branch: master Gerrit-Change-Id: I11dd82f8c4003cc6f974981cb92dca084f1df1f0 Gerrit-Change-Number: 38919 Gerrit-PatchSet: 3 Gerrit-Owner: Angel Pons <th3fanbus@gmail.com> Gerrit-Reviewer: Angel Pons <th3fanbus@gmail.com> Gerrit-Reviewer: David Hendricks <david.hendricks@gmail.com> Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org> Gerrit-CC: James <jye836@gmail.com> Gerrit-CC: Paul Menzel <paulepanter@users.sourceforge.net> Gerrit-MessageType: newpatchset

Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/38919 ) Change subject: Add support for Fudan SPI flash chips ...................................................................... Patch Set 3: (1 comment) https://review.coreboot.org/c/flashrom/+/38919/1/flashchips.h File flashchips.h: https://review.coreboot.org/c/flashrom/+/38919/1/flashchips.h@333 PS1, Line 333: #define FUDAN_ID_NOPREFIX 0x04 /* Fudan, missing 0x7F prefix */
This should be A1, according to the datasheets (I'm looking at FM25Q32 and FM25F005) and JEP106. Done
-- To view, visit https://review.coreboot.org/c/flashrom/+/38919 To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings Gerrit-Project: flashrom Gerrit-Branch: master Gerrit-Change-Id: I11dd82f8c4003cc6f974981cb92dca084f1df1f0 Gerrit-Change-Number: 38919 Gerrit-PatchSet: 3 Gerrit-Owner: Angel Pons <th3fanbus@gmail.com> Gerrit-Reviewer: Angel Pons <th3fanbus@gmail.com> Gerrit-Reviewer: David Hendricks <david.hendricks@gmail.com> Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org> Gerrit-CC: James <jye836@gmail.com> Gerrit-CC: Paul Menzel <paulepanter@users.sourceforge.net> Gerrit-Comment-Date: Mon, 24 Feb 2020 15:11:18 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: David Hendricks <david.hendricks@gmail.com> Gerrit-MessageType: comment

Angel Pons has abandoned this change. ( https://review.coreboot.org/c/flashrom/+/38919 ) Change subject: Add support for Fudan SPI flash chips ...................................................................... Abandoned Nobody seems to need this -- To view, visit https://review.coreboot.org/c/flashrom/+/38919 To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings Gerrit-Project: flashrom Gerrit-Branch: master Gerrit-Change-Id: I11dd82f8c4003cc6f974981cb92dca084f1df1f0 Gerrit-Change-Number: 38919 Gerrit-PatchSet: 3 Gerrit-Owner: Angel Pons <th3fanbus@gmail.com> Gerrit-Reviewer: Angel Pons <th3fanbus@gmail.com> Gerrit-Reviewer: David Hendricks <david.hendricks@gmail.com> Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org> Gerrit-CC: James <jye836@gmail.com> Gerrit-CC: Paul Menzel <paulepanter@users.sourceforge.net> Gerrit-MessageType: abandon
participants (3)
-
Angel Pons (Code Review)
-
David Hendricks (Code Review)
-
James (Code Review)