blob: 001b18bc067833d8c1ef512218a6daf5550e2d29 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
#include "storage.h"
#include "qspi.h"
// This configuration is needed for mboot to be able to write to the external QSPI flash
#define QSPI_QREAD_NUM_DUMMY (2)
#if MICROPY_HW_SPIFLASH_ENABLE_CACHE
static mp_spiflash_cache_t spi_bdev_cache;
#endif
const mp_spiflash_config_t spiflash_config = {
.bus_kind = MP_SPIFLASH_BUS_QSPI,
.bus.u_qspi.data = NULL,
.bus.u_qspi.proto = &qspi_proto,
#if MICROPY_HW_SPIFLASH_ENABLE_CACHE
.cache = &spi_bdev_cache,
#endif
};
spi_bdev_t spi_bdev;
// This init function is needed to memory map the QSPI flash early in the boot process
void board_early_init(void) {
qspi_init(QSPI_QREAD_NUM_DUMMY);
qspi_memory_map();
}
|