From: <ge...@op...> - 2025-10-14 16:24:37
|
This is an automated email from Gerrit. "Jonathan Steinert <ha...@ku...>" just uploaded a new patch set to Gerrit, which you can find at https://review.openocd.org/c/openocd/+/9172 -- gerrit commit fcad6ab5142d176061861d6a40b93abdcc633e87 Author: Jonathan Steinert <ha...@ku...> Date: Tue Oct 14 09:06:33 2025 -0700 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: ha...@ku... CC: ka...@tw... Change-Id: Ic3cff75ba21f6bc6ac440dfb30e24c328c7cd47c diff --git a/src/flash/nor/xmc4xxx.c b/src/flash/nor/xmc4xxx.c index 54fd5a5867..bf41cc7eb1 100644 --- a/src/flash/nor/xmc4xxx.c +++ b/src/flash/nor/xmc4xxx.c @@ -231,12 +231,12 @@ struct xmc4xxx_command_seq { }; /* Sector capacities. See section 8 of xmc4x00_rm */ -static const unsigned int sector_capacity_8[8] = { - 16, 16, 16, 16, 16, 16, 16, 128 +static const unsigned int sector_capacity_9[9] = { + 16, 16, 16, 16, 16, 16, 16, 16, 128 }; -static const unsigned int sector_capacity_9[9] = { - 16, 16, 16, 16, 16, 16, 16, 128, 256 +static const unsigned int sector_capacity_10[10] = { + 16, 16, 16, 16, 16, 16, 16, 16, 128, 256 }; 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); switch (bank->num_sectors) { - case 8: - capacity = sector_capacity_8; - break; case 9: capacity = sector_capacity_9; break; + case 10: + capacity = sector_capacity_10; + break; case 12: capacity = sector_capacity_12; break; @@ -361,11 +361,11 @@ static int xmc4xxx_probe(struct flash_bank *bank) * we understand the type of controller we're dealing with */ switch (flash_id) { case FLASH_ID_XMC4100_4200: - bank->num_sectors = 8; + bank->num_sectors = 9; LOG_DEBUG("XMC4xxx: XMC4100/4200 detected."); break; case FLASH_ID_XMC4400: - bank->num_sectors = 9; + bank->num_sectors = 10; LOG_DEBUG("XMC4xxx: XMC4400 detected."); break; case FLASH_ID_XMC4500: -- |