提交 cf9026de 编写于 作者: A Armando Visconti 提交者: Albert ARIBAUD

st_smi: Fix bug in flash_print_info()

If the flash size was smaller than 1MB then flash_print_info()
was erroneously reporting 0 MB.
Signed-off-by: NArmando Visconti <armando.visconti@st.com>
Signed-off-by: NAmit Virdi <amit.virdi@st.com>
Signed-off-by: NStefan Roese <sr@denx.de>
上级 6d6d23c1
......@@ -471,8 +471,13 @@ void flash_print_info(flash_info_t *info)
puts("missing or unknown FLASH type\n");
return;
}
printf(" Size: %ld MB in %d Sectors\n",
info->size >> 20, info->sector_count);
if (info->size >= 0x100000)
printf(" Size: %ld MB in %d Sectors\n",
info->size >> 20, info->sector_count);
else
printf(" Size: %ld KB in %d Sectors\n",
info->size >> 10, info->sector_count);
puts(" Sector Start Addresses:");
for (i = 0; i < info->sector_count; ++i) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册