Skip to content

Commit 6510992

Browse files
committed
SFDP: Set region count to 1 for no sector map
A flash device with no sector map table has uniform sectors, and we treat the whole flash as one region. In this case the function `sfdp_parse_sector_map_table()` sets the single region's size and high boundary accordingly, but it lacks setting of region count to 1, so users of the SFDP parser may not get the correct number of regions. This commit fixes the issue.
1 parent 6869425 commit 6510992

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

storage/blockdevice/source/SFDP.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,7 @@ int sfdp_parse_sector_map_table(Callback<int(bd_addr_t, void *, bd_size_t)> sfdp
243243
tr_debug("No Sector Map Table");
244244

245245
// If there's no sector map, we have a single region sized the entire device size
246+
sfdp_info.smptbl.region_cnt = 1;
246247
sfdp_info.smptbl.region_size[0] = sfdp_info.bptbl.device_size_bytes;
247248
sfdp_info.smptbl.region_high_boundary[0] = sfdp_info.bptbl.device_size_bytes - 1;
248249

0 commit comments

Comments
 (0)