mirror of
https://github.com/openmv/openmv.git
synced 2025-11-04 14:49:50 +08:00
bootloader: Add special flash recovery partition.
Can be used by ports to implement flash recovery needed by some chips.
This commit is contained in:
parent
10d180becb
commit
3f4273c4dc
@ -35,10 +35,11 @@
|
||||
int axi_flash_read(uint32_t addr, uint8_t *buf, size_t size);
|
||||
int axi_flash_write(uint32_t addr, const uint8_t *buf, size_t size);
|
||||
|
||||
int spi_flash_deinit();
|
||||
int spi_flash_memory_map(bool dtr);
|
||||
int spi_flash_read(uint32_t addr, uint8_t *buf, uint32_t size);
|
||||
int spi_flash_write(uint32_t addr, const uint8_t *buf, uint32_t size);
|
||||
int spi_flash_memory_map(bool dtr);
|
||||
int spi_flash_recovery(uint32_t addr, const uint8_t *buf, uint32_t size);
|
||||
int spi_flash_deinit();
|
||||
|
||||
static inline int flash_read(uint32_t ptype, uint32_t addr, uint8_t *buf, uint32_t size) {
|
||||
#if OMV_BOOT_AXI_FLASH_ENABLE
|
||||
@ -65,6 +66,11 @@ static inline int flash_write(uint32_t ptype, uint32_t addr, const uint8_t *buf,
|
||||
return spi_flash_write(addr, buf, size);
|
||||
}
|
||||
#endif
|
||||
#if OMV_BOOT_REC_FLASH_ENABLE
|
||||
if (ptype == PTYPE_REC_FLASH) {
|
||||
return spi_flash_recovery(addr, buf, size);
|
||||
}
|
||||
#endif
|
||||
return -1;
|
||||
}
|
||||
#endif //__BOOT_FLASH_H__
|
||||
|
||||
@ -74,6 +74,7 @@ typedef enum {
|
||||
PTYPE_AXI_FLASH,
|
||||
PTYPE_SPI_FLASH,
|
||||
PTYPE_XIP_FLASH,
|
||||
PTYPE_REC_FLASH,
|
||||
} partition_type_t;
|
||||
|
||||
// Common MPU memory attributes.
|
||||
|
||||
Loading…
Reference in New Issue
Block a user