all devices / spiInterface / main: added method / infra to detect flash chip with --detect -f

This commit is contained in:
Gwenhael Goavec-Merou
2024-06-09 09:28:52 +02:00
parent d0dd71a28a
commit c468a69fc9
11 changed files with 126 additions and 2 deletions
+15
View File
@@ -1152,6 +1152,21 @@ bool Xilinx::dumpFlash(uint32_t base_addr, uint32_t len)
return true;
}
bool Xilinx::detect_flash()
{
if (_flash_chips & PRIMARY_FLASH) {
select_flash_chip(PRIMARY_FLASH);
if (!SPIInterface::detect_flash())
return false;
}
if (_flash_chips & SECONDARY_FLASH) {
select_flash_chip(SECONDARY_FLASH);
if (!SPIInterface::detect_flash())
return false;
}
return true;
}
bool Xilinx::protect_flash(uint32_t len)
{
if (_flash_chips & PRIMARY_FLASH) {