Skip to content

Commit f68f7b2

Browse files
pi-anlandrewleech
authored andcommitted
stm32/spiflash: Update definitions for mboot and boards using spi flash.
1 parent 1c04d8a commit f68f7b2

File tree

3 files changed

+4
-11
lines changed

3 files changed

+4
-11
lines changed

ports/stm32/boards/STM32F769DISC/board_init.c

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,13 @@
11
#include "drivers/memory/spiflash.h"
2-
#include "qspi.h"
2+
#include "drivers/bus/qspi.h"
33

44
// This configuration is needed for mboot to be able to write to the external QSPI flash
5+
extern const mp_qspi_proto_t qspi_proto;
56

6-
const mp_spiflash_config_t spiflash_config = {
7-
.bus_kind = MP_SPIFLASH_BUS_QSPI,
8-
.bus.u_qspi.data = NULL,
9-
.bus.u_qspi.proto = &qspi_proto,
10-
.cache = NULL,
7+
mp_spiflash_t spiflash_instance = {
8+
.qspi_proto = &qspi_proto
119
};
1210

13-
mp_spiflash_t spiflash_instance;
14-
1511
// This init function is needed to memory map the QSPI flash early in the boot process
1612

1713
void board_early_init(void) {

ports/stm32/boards/STM32F769DISC/mpconfigboard.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,5 +205,4 @@ extern struct _mp_spiflash_t spiflash_instance;
205205
#define MBOOT_SPIFLASH_BYTE_SIZE (512 * 128 * 1024)
206206
#define MBOOT_SPIFLASH_LAYOUT "/0x90000000/512*128Kg"
207207
#define MBOOT_SPIFLASH_ERASE_BLOCKS_PER_PAGE (128 / 4) // 128k page, 4k erase block
208-
#define MBOOT_SPIFLASH_CONFIG (&spiflash_config)
209208
#define MBOOT_SPIFLASH_SPIFLASH (&spiflash_instance)

ports/stm32/mboot/main.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1485,12 +1485,10 @@ void stm32_main(int initial_r0) {
14851485
#endif
14861486

14871487
#if defined(MBOOT_SPIFLASH_ADDR)
1488-
MBOOT_SPIFLASH_SPIFLASH->config = MBOOT_SPIFLASH_CONFIG;
14891488
mp_spiflash_init(MBOOT_SPIFLASH_SPIFLASH);
14901489
#endif
14911490

14921491
#if defined(MBOOT_SPIFLASH2_ADDR)
1493-
MBOOT_SPIFLASH2_SPIFLASH->config = MBOOT_SPIFLASH2_CONFIG;
14941492
mp_spiflash_init(MBOOT_SPIFLASH2_SPIFLASH);
14951493
#endif
14961494

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy