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.
pull/14983/head
Lingkai Dong 2021-08-04 15:51:43 +01:00
parent 68694255b5
commit 651099225e
1 changed files with 1 additions and 0 deletions

View File

@ -243,6 +243,7 @@ int sfdp_parse_sector_map_table(Callback<int(bd_addr_t, void *, bd_size_t)> sfdp
tr_debug("No Sector Map Table");
// If there's no sector map, we have a single region sized the entire device size
sfdp_info.smptbl.region_cnt = 1;
sfdp_info.smptbl.region_size[0] = sfdp_info.bptbl.device_size_bytes;
sfdp_info.smptbl.region_high_boundary[0] = sfdp_info.bptbl.device_size_bytes - 1;