Merge pull request #447 from pu-cc/spiflashdb-mx25r643f

spiFlashdb: add MX25R6435F and fix SPIFlash::bp_to_len
This commit is contained in:
Gwenhael Goavec-Merou 2024-03-15 07:00:12 +01:00 committed by GitHub
commit 41ecac5d0c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 17 additions and 0 deletions

View File

@ -895,6 +895,9 @@ std::map<std::string, uint32_t> SPIFlash::bp_to_len(uint8_t bp, uint8_t tb)
for (int i = 0; i < 4; i++)
if ((bp & _flash_model->bp_offset[i]))
tmp |= (1 << i);
/* 0 -> no block protected */
if (tmp == 0)
return protect_area;
/* bp code is 2^(bp-1) blocks */
uint16_t nr_sectors = (1 << (tmp-1));
printf("nr_sectors : %d\n", nr_sectors);

View File

@ -354,6 +354,20 @@ static std::map <uint32_t, flash_t> flash_list = {
.bp_len = 5,
.bp_offset = {(1 << 2), (1 << 3), (1 << 4), (1 << 5)}}
},
{0xc22817, {
/* https://www.macronix.com/Lists/Datasheet/Attachments/8868/MX25R6435F,%20Wide%20Range,%2064Mb,%20v1.6.pdf */
.manufacturer = "Macronix",
.model = "MX25R6435F",
.nr_sector = 128,
.sector_erase = true,
.subsector_erase = true,
.has_extended = false,
.tb_otp = true,
.tb_offset = (1 << 3),
.tb_register = CONFR,
.bp_len = 4,
.bp_offset = {(1 << 2), (1 << 3), (1 << 4), 0}}
},
{0xef4014, {
/* https://cdn-shop.adafruit.com/datasheets/W25Q80BV.pdf */
.manufacturer = "Winbond",