Kinsey Moore started a new discussion on bsps/shared/dev/nor/config-parser.c: 
https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/823#note_135623

 > +      return RTEMS_INVALID_ADDRESS;
 > +    }
 > +
 > +    if (data->SectorSize < (sector_base * 256UL)) {
 > +      data->NumSectors = num_sectors_sub + 1;
 > +      data->SectorSize = sector_base * 256UL;
 > +    }
 >    }
 > -  data->SectorSize = sector_base * 256UL;
 >  
 > -  data->DeviceSize = data->NumSectors * data->SectorSize;
 > +  if (num_regions == 1) {
 > +    /* Device size for at least s25fl512s is off by 1, calculate with 
 > sectors */
 > +    data->DeviceSize = data->NumSectors * data->SectorSize;
 > +  } else {
 > +    data->NumSectors = data->DeviceSize / data->SectorSize;

NumSectors has already been derived directly from the data in the CFI table. 
There is no reason to recalculate it here.

-- 
View it on GitLab: 
https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/823#note_135623
You're receiving this email because of your account on gitlab.rtems.org.


_______________________________________________
bugs mailing list
[email protected]
http://lists.rtems.org/mailman/listinfo/bugs

Reply via email to