xmc4xxx: Correct some flash sector layouts

I think this may have been a typo/thinko from first implementation, but
for the 4200 the layout is 8 16KB chunks and then 1 128KB chunk. We were
previously only writing 240KB

Signed-off-by: Jonathan Steinert <hachi@kuiki.net>
Change-Id: Ic3cff75ba21f6bc6ac440dfb30e24c328c7cd47c
Reviewed-on: https://review.openocd.org/c/openocd/+/9172
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-by: Karl Palsson <karlp@tweak.au>
Tested-by: jenkins
This commit is contained in:
Jonathan Steinert
2025-10-14 09:06:33 -07:00
committed by Antonio Borneo
parent 165e578d2b
commit 914b855780
+9 -9
View File
@@ -231,12 +231,12 @@ struct xmc4xxx_command_seq {
}; };
/* Sector capacities. See section 8 of xmc4x00_rm */ /* Sector capacities. See section 8 of xmc4x00_rm */
static const unsigned int sector_capacity_8[8] = { static const unsigned int sector_capacity_9[9] = {
16, 16, 16, 16, 16, 16, 16, 128 16, 16, 16, 16, 16, 16, 16, 16, 128
}; };
static const unsigned int sector_capacity_9[9] = { static const unsigned int sector_capacity_10[10] = {
16, 16, 16, 16, 16, 16, 16, 128, 256 16, 16, 16, 16, 16, 16, 16, 16, 128, 256
}; };
static const unsigned int sector_capacity_12[12] = { static const unsigned int sector_capacity_12[12] = {
@@ -272,12 +272,12 @@ static int xmc4xxx_load_bank_layout(struct flash_bank *bank)
LOG_DEBUG("%u sectors", bank->num_sectors); LOG_DEBUG("%u sectors", bank->num_sectors);
switch (bank->num_sectors) { switch (bank->num_sectors) {
case 8:
capacity = sector_capacity_8;
break;
case 9: case 9:
capacity = sector_capacity_9; capacity = sector_capacity_9;
break; break;
case 10:
capacity = sector_capacity_10;
break;
case 12: case 12:
capacity = sector_capacity_12; capacity = sector_capacity_12;
break; break;
@@ -361,11 +361,11 @@ static int xmc4xxx_probe(struct flash_bank *bank)
* we understand the type of controller we're dealing with */ * we understand the type of controller we're dealing with */
switch (flash_id) { switch (flash_id) {
case FLASH_ID_XMC4100_4200: case FLASH_ID_XMC4100_4200:
bank->num_sectors = 8; bank->num_sectors = 9;
LOG_DEBUG("XMC4xxx: XMC4100/4200 detected."); LOG_DEBUG("XMC4xxx: XMC4100/4200 detected.");
break; break;
case FLASH_ID_XMC4400: case FLASH_ID_XMC4400:
bank->num_sectors = 9; bank->num_sectors = 10;
LOG_DEBUG("XMC4xxx: XMC4400 detected."); LOG_DEBUG("XMC4xxx: XMC4400 detected.");
break; break;
case FLASH_ID_XMC4500: case FLASH_ID_XMC4500: