You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by je...@apache.org on 2026/10/28 18:37:15 UTC
(mynewt-core) 03/03: hw: Use common hal_bsp_flash_dev
This is an automated email from the ASF dual-hosted git repository.
kasjer pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git
commit 86d1942560aa844a2150349fb9c2ed922c548907
Author: Jerzy Kasenberg <je...@codecoup.pl>
AuthorDate: Sun Oct 25 00:46:26 2026 +0200
hw: Use common hal_bsp_flash_dev
HAL_FLASH_DEV_TABLE is now enabled by default. Flash devices register
themselves in hal_flash_devs with the same ids that BSPs used, so BSP
specific hal_bsp_flash_dev() functions are removed.
Encrypted flash devices defined in frdm-k64f, frdm-k82f, native and
nordic_pca10040 BSPs are registered in hal_bsp.c.
HAL_FLASH_MAX_DEVICE_COUNT was set for nRF5340 boards because of hole
in flash ids when QSPI is not enabled; it is not used by common
hal_flash_init().
native-armv7 has no linker script (so no link tables) and keeps its
own function with HAL_FLASH_DEV_TABLE set to 0.
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Jerzy Kasenberg <je...@apache.org>
---
hw/bsp/ada_feather_nrf52/src/hal_bsp.c | 13 ------------
hw/bsp/ada_feather_stm32f405/src/hal_bsp.c | 13 ------------
hw/bsp/apollo2_evb/src/hal_bsp.c | 9 ---------
hw/bsp/apollo3_evb/src/hal_bsp.c | 9 ---------
hw/bsp/arduino_primo_nrf52/src/hal_bsp.c | 12 -----------
hw/bsp/arduino_zero/src/hal_bsp.c | 13 ------------
hw/bsp/b-l072z-lrwan1/src/hal_bsp.c | 13 ------------
hw/bsp/b-l475e-iot01a/src/hal_bsp.c | 13 ------------
hw/bsp/bbc_microbit/src/hal_bsp.c | 12 -----------
hw/bsp/black_vet6/src/hal_bsp.c | 23 ---------------------
hw/bsp/blackpill401cc/src/hal_bsp.c | 23 ---------------------
hw/bsp/blackpill411ce/src/hal_bsp.c | 23 ---------------------
hw/bsp/ble400/src/hal_bsp.c | 12 -----------
hw/bsp/bluepill/src/hal_bsp.c | 13 ------------
hw/bsp/bmd200/src/hal_bsp.c | 12 -----------
hw/bsp/bmd300eval/src/hal_bsp.c | 12 -----------
hw/bsp/calliope_mini/src/hal_bsp.c | 12 -----------
hw/bsp/dialog_cmac/src/hal_bsp.c | 6 ------
hw/bsp/dialog_da14695-dk-usb/src/hal_bsp.c | 10 ---------
hw/bsp/dialog_da1469x-dk-pro/src/hal_bsp.c | 10 ---------
hw/bsp/dwm1001-dev/src/hal_bsp.c | 12 -----------
hw/bsp/fanstel-ev-bt840/src/hal_bsp.c | 10 ---------
hw/bsp/fanstel_ev_bt40e/net/src/hal_bsp.c | 23 ---------------------
hw/bsp/fanstel_ev_bt40e/src/hal_bsp.c | 24 ----------------------
hw/bsp/fanstel_ev_bt40e/syscfg.yml | 2 --
hw/bsp/frdm-k64f/src/hal_bsp.c | 14 +------------
hw/bsp/frdm-k82f/src/hal_bsp.c | 19 +----------------
hw/bsp/hifive1/src/hal_bsp.c | 17 ----------------
hw/bsp/lpcxpresso55s28/src/hal_bsp.c | 9 ---------
hw/bsp/native-armv7/syscfg.yml | 1 +
hw/bsp/native/src/hal_bsp.c | 13 +-----------
hw/bsp/nina-b1/src/hal_bsp.c | 12 -----------
hw/bsp/nordic_pca10028-16k/src/hal_bsp.c | 12 -----------
hw/bsp/nordic_pca10028/src/hal_bsp.c | 12 -----------
hw/bsp/nordic_pca10040/src/hal_bsp.c | 17 +---------------
hw/bsp/nordic_pca10056/src/hal_bsp.c | 17 ----------------
hw/bsp/nordic_pca10059/src/hal_bsp.c | 17 ----------------
hw/bsp/nordic_pca10090/src/hal_bsp.c | 13 ------------
hw/bsp/nordic_pca10095/src/hal_bsp.c | 24 ----------------------
hw/bsp/nordic_pca10095/syscfg.yml | 2 --
hw/bsp/nordic_pca10095_net/src/hal_bsp.c | 23 ---------------------
hw/bsp/nordic_pca10121/net/src/hal_bsp.c | 23 ---------------------
hw/bsp/nordic_pca10121/src/hal_bsp.c | 22 --------------------
hw/bsp/nordic_pca10156/src/hal_bsp.c | 13 ------------
hw/bsp/nordic_pca20020/src/hal_bsp.c | 13 ------------
hw/bsp/nordic_thingy53/src/hal_bsp.c | 24 ----------------------
hw/bsp/nordic_thingy53/syscfg.yml | 2 --
hw/bsp/nrf51-arduino_101/src/hal_bsp.c | 12 -----------
hw/bsp/nrf51-blenano/src/hal_bsp.c | 12 -----------
hw/bsp/nucleo-f030r8/src/hal_bsp.c | 13 ------------
hw/bsp/nucleo-f072rb/src/hal_bsp.c | 13 ------------
hw/bsp/nucleo-f103rb/src/hal_bsp.c | 21 -------------------
hw/bsp/nucleo-f303k8/src/hal_bsp.c | 13 ------------
hw/bsp/nucleo-f303re/src/hal_bsp.c | 13 ------------
hw/bsp/nucleo-f401re/src/hal_bsp.c | 13 ------------
hw/bsp/nucleo-f411re/src/hal_bsp.c | 13 ------------
hw/bsp/nucleo-f413zh/src/hal_bsp.c | 13 ------------
hw/bsp/nucleo-f439zi/src/hal_bsp.c | 13 ------------
hw/bsp/nucleo-f746zg/src/hal_bsp.c | 13 ------------
hw/bsp/nucleo-f767zi/src/hal_bsp.c | 13 ------------
hw/bsp/nucleo-g0b1re/src/hal_bsp.c | 27 -------------------------
hw/bsp/nucleo-g491re/src/hal_bsp.c | 27 -------------------------
hw/bsp/nucleo-h563zi/src/hal_bsp.c | 23 ---------------------
hw/bsp/nucleo-h723zg/src/hal_bsp.c | 20 ------------------
hw/bsp/nucleo-h753zi/src/hal_bsp.c | 13 ------------
hw/bsp/nucleo-l073rz/src/hal_bsp.c | 21 -------------------
hw/bsp/nucleo-l476rg/src/hal_bsp.c | 13 ------------
hw/bsp/nucleo-u575zi-q/src/hal_bsp.c | 20 ------------------
hw/bsp/olimex-p103/src/hal_bsp.c | 13 ------------
hw/bsp/olimex-pic32-emz64/src/hal_bsp.c | 17 ----------------
hw/bsp/olimex-pic32-hmz144/src/hal_bsp.c | 17 ----------------
hw/bsp/olimex_stm32-e407_devboard/src/hal_bsp.c | 13 ------------
hw/bsp/p-nucleo-wb55-usbdongle/src/hal_bsp.c | 13 ------------
hw/bsp/p-nucleo-wb55/src/hal_bsp.c | 13 ------------
hw/bsp/pinetime/src/hal_bsp.c | 17 ----------------
hw/bsp/puckjs/src/hal_bsp.c | 12 -----------
hw/bsp/rb-blend2/src/hal_bsp.c | 12 -----------
hw/bsp/rb-nano2/src/hal_bsp.c | 12 -----------
hw/bsp/reel_board/src/hal_bsp.c | 10 ---------
hw/bsp/ruuvitag_rev_b/src/hal_bsp.c | 13 ------------
hw/bsp/stm32f3discovery/src/hal_bsp.c | 13 ------------
hw/bsp/stm32f411discovery/src/hal_bsp.c | 13 ------------
hw/bsp/stm32f429discovery/src/hal_bsp.c | 13 ------------
hw/bsp/stm32f4discovery/src/hal_bsp.c | 13 ------------
hw/bsp/stm32f7discovery/src/hal_bsp.c | 16 ---------------
hw/bsp/stm32l152discovery/src/hal_bsp.c | 13 ------------
hw/bsp/telee02/src/hal_bsp.c | 12 -----------
hw/bsp/ublox_bmd_345/src/hal_bsp.c | 17 ----------------
hw/bsp/ublox_mini_nora_b1/net/src/hal_bsp.c | 23 ---------------------
hw/bsp/ublox_mini_nora_b1/src/hal_bsp.c | 24 ----------------------
hw/bsp/ublox_mini_nora_b1/syscfg.yml | 2 --
hw/bsp/usbmkw41z/src/hal_bsp.c | 12 -----------
hw/bsp/vbluno51/src/hal_bsp.c | 12 -----------
hw/bsp/vbluno52/src/hal_bsp.c | 12 -----------
hw/bsp/weact_g431cb/src/hal_bsp.c | 16 ---------------
hw/bsp/weact_h503cb/src/hal_bsp.c | 20 ------------------
hw/hal/syscfg.yml | 2 +-
97 files changed, 6 insertions(+), 1381 deletions(-)
diff --git a/hw/bsp/ada_feather_nrf52/src/hal_bsp.c b/hw/bsp/ada_feather_nrf52/src/hal_bsp.c
index 09d2ae6e2..61eb01270 100644
--- a/hw/bsp/ada_feather_nrf52/src/hal_bsp.c
+++ b/hw/bsp/ada_feather_nrf52/src/hal_bsp.c
@@ -42,19 +42,6 @@ static const struct hal_bsp_mem_dump dump_cfg[] = {
}
};
-const struct hal_flash *
-hal_bsp_flash_dev(uint8_t id)
-{
- /*
- * Internal flash mapped to id 0.
- */
- if (id == 0) {
- return &nrf_flash_dev;
- }
-
- return NULL;
-}
-
const struct hal_bsp_mem_dump *
hal_bsp_core_dump(int *area_cnt)
{
diff --git a/hw/bsp/ada_feather_stm32f405/src/hal_bsp.c b/hw/bsp/ada_feather_stm32f405/src/hal_bsp.c
index 1c7a0e1f8..79206166a 100644
--- a/hw/bsp/ada_feather_stm32f405/src/hal_bsp.c
+++ b/hw/bsp/ada_feather_stm32f405/src/hal_bsp.c
@@ -259,19 +259,6 @@ static const struct hal_bsp_mem_dump dump_cfg[] = {
}
};
-extern const struct hal_flash stm32_flash_dev;
-const struct hal_flash *
-hal_bsp_flash_dev(uint8_t id)
-{
- /*
- * Internal flash mapped to id 0.
- */
- if (id != 0) {
- return NULL;
- }
- return &stm32_flash_dev;
-}
-
const struct hal_bsp_mem_dump *
hal_bsp_core_dump(int *area_cnt)
{
diff --git a/hw/bsp/apollo2_evb/src/hal_bsp.c b/hw/bsp/apollo2_evb/src/hal_bsp.c
index a349e8a19..14e983d2a 100644
--- a/hw/bsp/apollo2_evb/src/hal_bsp.c
+++ b/hw/bsp/apollo2_evb/src/hal_bsp.c
@@ -104,15 +104,6 @@ static const struct apollo2_spi_cfg hal_bsp_spi5m_cfg = {
};
#endif
-const struct hal_flash *
-hal_bsp_flash_dev(uint8_t id)
-{
- if (id != 0) {
- return (NULL);
- }
- return &apollo2_flash_dev;
-}
-
const struct hal_bsp_mem_dump *
hal_bsp_core_dump(int *area_cnt)
{
diff --git a/hw/bsp/apollo3_evb/src/hal_bsp.c b/hw/bsp/apollo3_evb/src/hal_bsp.c
index 78fa1bcf8..f5c5c7055 100644
--- a/hw/bsp/apollo3_evb/src/hal_bsp.c
+++ b/hw/bsp/apollo3_evb/src/hal_bsp.c
@@ -45,15 +45,6 @@ static const struct hal_bsp_mem_dump dump_cfg[] = {
}
};
-const struct hal_flash *
-hal_bsp_flash_dev(uint8_t id)
-{
- if (id != 0) {
- return (NULL);
- }
- return &apollo3_flash_dev;
-}
-
const struct hal_bsp_mem_dump *
hal_bsp_core_dump(int *area_cnt)
{
diff --git a/hw/bsp/arduino_primo_nrf52/src/hal_bsp.c b/hw/bsp/arduino_primo_nrf52/src/hal_bsp.c
index 6ee29a601..8932b259e 100644
--- a/hw/bsp/arduino_primo_nrf52/src/hal_bsp.c
+++ b/hw/bsp/arduino_primo_nrf52/src/hal_bsp.c
@@ -42,18 +42,6 @@ static const struct hal_bsp_mem_dump dump_cfg[] = {
}
};
-const struct hal_flash *
-hal_bsp_flash_dev(uint8_t id)
-{
- /*
- * Internal flash mapped to id 0.
- */
- if (id != 0) {
- return NULL;
- }
- return &nrf_flash_dev;
-}
-
const struct hal_bsp_mem_dump *
hal_bsp_core_dump(int *area_cnt)
{
diff --git a/hw/bsp/arduino_zero/src/hal_bsp.c b/hw/bsp/arduino_zero/src/hal_bsp.c
index 30db63dff..9a98e1305 100644
--- a/hw/bsp/arduino_zero/src/hal_bsp.c
+++ b/hw/bsp/arduino_zero/src/hal_bsp.c
@@ -121,19 +121,6 @@ static const struct hal_bsp_mem_dump dump_cfg[] = {
}
};
-const struct hal_flash *
-hal_bsp_flash_dev(uint8_t id)
-{
- /*
- * Internal flash mapped to id 0.
- */
- if (id != 0) {
- return NULL;
- }
-
- return &samd21_flash_dev;
-}
-
const struct hal_bsp_mem_dump *
hal_bsp_core_dump(int *area_cnt)
{
diff --git a/hw/bsp/b-l072z-lrwan1/src/hal_bsp.c b/hw/bsp/b-l072z-lrwan1/src/hal_bsp.c
index 9631831b7..4125eae58 100644
--- a/hw/bsp/b-l072z-lrwan1/src/hal_bsp.c
+++ b/hw/bsp/b-l072z-lrwan1/src/hal_bsp.c
@@ -108,19 +108,6 @@ static const struct hal_bsp_mem_dump dump_cfg[] = {
},
};
-extern const struct hal_flash stm32_flash_dev;
-const struct hal_flash *
-hal_bsp_flash_dev(uint8_t id)
-{
- /*
- * Internal flash mapped to id 0.
- */
- if (id != 0) {
- return NULL;
- }
- return &stm32_flash_dev;
-}
-
const struct hal_bsp_mem_dump *
hal_bsp_core_dump(int *area_cnt)
{
diff --git a/hw/bsp/b-l475e-iot01a/src/hal_bsp.c b/hw/bsp/b-l475e-iot01a/src/hal_bsp.c
index cf1a8070b..e54dd55f9 100644
--- a/hw/bsp/b-l475e-iot01a/src/hal_bsp.c
+++ b/hw/bsp/b-l475e-iot01a/src/hal_bsp.c
@@ -99,19 +99,6 @@ static const struct hal_bsp_mem_dump dump_cfg[] = {
},
};
-extern const struct hal_flash stm32_flash_dev;
-const struct hal_flash *
-hal_bsp_flash_dev(uint8_t id)
-{
- /*
- * Internal flash mapped to id 0.
- */
- if (id != 0) {
- return NULL;
- }
- return &stm32_flash_dev;
-}
-
const struct hal_bsp_mem_dump *
hal_bsp_core_dump(int *area_cnt)
{
diff --git a/hw/bsp/bbc_microbit/src/hal_bsp.c b/hw/bsp/bbc_microbit/src/hal_bsp.c
index 458484993..0ea1ffe8c 100644
--- a/hw/bsp/bbc_microbit/src/hal_bsp.c
+++ b/hw/bsp/bbc_microbit/src/hal_bsp.c
@@ -106,18 +106,6 @@ static const struct hal_bsp_mem_dump dump_cfg[] = {
}
};
-const struct hal_flash *
-hal_bsp_flash_dev(uint8_t id)
-{
- /*
- * Internal flash mapped to id 0.
- */
- if (id != 0) {
- return NULL;
- }
- return &nrf_flash_dev;
-}
-
const struct hal_bsp_mem_dump *
hal_bsp_core_dump(int *area_cnt)
{
diff --git a/hw/bsp/black_vet6/src/hal_bsp.c b/hw/bsp/black_vet6/src/hal_bsp.c
index 4ae74eb30..9946cd4f4 100644
--- a/hw/bsp/black_vet6/src/hal_bsp.c
+++ b/hw/bsp/black_vet6/src/hal_bsp.c
@@ -43,10 +43,6 @@
#include "adc_stm32f4/adc_stm32f4.h"
#endif
-#if MYNEWT_VAL(SPIFLASH)
-#include <spiflash/spiflash.h>
-#endif
-
const uint32_t stm32_flash_sectors[] = {
0x08000000, /* 16kB */
0x08004000, /* 16kB */
@@ -284,25 +280,6 @@ static const struct hal_bsp_mem_dump dump_cfg[] = {
}
};
-extern const struct hal_flash stm32_flash_dev;
-
-static const struct hal_flash *flash_devs[] = {
- [0] = &stm32_flash_dev,
-#if MYNEWT_VAL(SPIFLASH)
- [1] = &spiflash_dev.hal,
-#endif
-};
-
-const struct hal_flash *
-hal_bsp_flash_dev(uint8_t id)
-{
- if (id >= ARRAY_SIZE(flash_devs)) {
- return NULL;
- }
-
- return flash_devs[id];
-}
-
const struct hal_bsp_mem_dump *
hal_bsp_core_dump(int *area_cnt)
{
diff --git a/hw/bsp/blackpill401cc/src/hal_bsp.c b/hw/bsp/blackpill401cc/src/hal_bsp.c
index adbed9b33..aa707dc0f 100644
--- a/hw/bsp/blackpill401cc/src/hal_bsp.c
+++ b/hw/bsp/blackpill401cc/src/hal_bsp.c
@@ -38,10 +38,6 @@
#include "adc_stm32f4/adc_stm32f4.h"
#endif
-#if MYNEWT_VAL(SPIFLASH)
-#include <spiflash/spiflash.h>
-#endif
-
const uint32_t stm32_flash_sectors[] = {
0x08000000, /* 16kB */
0x08004000, /* 16kB */
@@ -105,8 +101,6 @@ static const struct hal_bsp_mem_dump dump_cfg[] = {
}
};
-extern const struct hal_flash stm32_flash_dev;
-
#if MYNEWT_VAL(I2C_0)
/*
* NOTE: The PB8 and PB9 pins are connected through jumpers in the board to
@@ -152,23 +146,6 @@ const struct stm32_hal_i2c_cfg os_bsp_i2c2_cfg = {
};
#endif
-static const struct hal_flash *flash_devs[] = {
- [0] = &stm32_flash_dev,
-#if MYNEWT_VAL(SPIFLASH)
- [1] = &spiflash_dev.hal,
-#endif
-};
-
-const struct hal_flash *
-hal_bsp_flash_dev(uint8_t id)
-{
- if (id >= ARRAY_SIZE(flash_devs)) {
- return NULL;
- }
-
- return flash_devs[id];
-}
-
const struct hal_bsp_mem_dump *
hal_bsp_core_dump(int *area_cnt)
{
diff --git a/hw/bsp/blackpill411ce/src/hal_bsp.c b/hw/bsp/blackpill411ce/src/hal_bsp.c
index e0d3322f0..57ff04d7e 100644
--- a/hw/bsp/blackpill411ce/src/hal_bsp.c
+++ b/hw/bsp/blackpill411ce/src/hal_bsp.c
@@ -38,10 +38,6 @@
#include "adc_stm32f4/adc_stm32f4.h"
#endif
-#if MYNEWT_VAL(SPIFLASH)
-#include <spiflash/spiflash.h>
-#endif
-
const uint32_t stm32_flash_sectors[] = {
0x08000000, /* 16kB */
0x08004000, /* 16kB */
@@ -107,8 +103,6 @@ static const struct hal_bsp_mem_dump dump_cfg[] = {
}
};
-extern const struct hal_flash stm32_flash_dev;
-
#if MYNEWT_VAL(I2C_0)
/*
* NOTE: The PB8 and PB9 pins are connected through jumpers in the board to
@@ -154,23 +148,6 @@ const struct stm32_hal_i2c_cfg os_bsp_i2c2_cfg = {
};
#endif
-static const struct hal_flash *flash_devs[] = {
- [0] = &stm32_flash_dev,
-#if MYNEWT_VAL(SPIFLASH)
- [1] = &spiflash_dev.hal,
-#endif
-};
-
-const struct hal_flash *
-hal_bsp_flash_dev(uint8_t id)
-{
- if (id >= ARRAY_SIZE(flash_devs)) {
- return NULL;
- }
-
- return flash_devs[id];
-}
-
const struct hal_bsp_mem_dump *
hal_bsp_core_dump(int *area_cnt)
{
diff --git a/hw/bsp/ble400/src/hal_bsp.c b/hw/bsp/ble400/src/hal_bsp.c
index b7949007d..711195009 100644
--- a/hw/bsp/ble400/src/hal_bsp.c
+++ b/hw/bsp/ble400/src/hal_bsp.c
@@ -107,18 +107,6 @@ static const struct hal_bsp_mem_dump dump_cfg[] = {
}
};
-const struct hal_flash *
-hal_bsp_flash_dev(uint8_t id)
-{
- /*
- * Internal flash mapped to id 0.
- */
- if (id != 0) {
- return NULL;
- }
- return &nrf_flash_dev;
-}
-
const struct hal_bsp_mem_dump *
hal_bsp_core_dump(int *area_cnt)
{
diff --git a/hw/bsp/bluepill/src/hal_bsp.c b/hw/bsp/bluepill/src/hal_bsp.c
index 4161f940d..dc3f00cce 100644
--- a/hw/bsp/bluepill/src/hal_bsp.c
+++ b/hw/bsp/bluepill/src/hal_bsp.c
@@ -67,19 +67,6 @@ static const struct hal_bsp_mem_dump dump_cfg[] = {
},
};
-extern const struct hal_flash stm32_flash_dev;
-const struct hal_flash *
-hal_bsp_flash_dev(uint8_t id)
-{
- /*
- * Internal flash mapped to id 0.
- */
- if (id != 0) {
- return NULL;
- }
- return &stm32_flash_dev;
-}
-
const struct hal_bsp_mem_dump *
hal_bsp_core_dump(int *area_cnt)
{
diff --git a/hw/bsp/bmd200/src/hal_bsp.c b/hw/bsp/bmd200/src/hal_bsp.c
index b7949007d..711195009 100644
--- a/hw/bsp/bmd200/src/hal_bsp.c
+++ b/hw/bsp/bmd200/src/hal_bsp.c
@@ -107,18 +107,6 @@ static const struct hal_bsp_mem_dump dump_cfg[] = {
}
};
-const struct hal_flash *
-hal_bsp_flash_dev(uint8_t id)
-{
- /*
- * Internal flash mapped to id 0.
- */
- if (id != 0) {
- return NULL;
- }
- return &nrf_flash_dev;
-}
-
const struct hal_bsp_mem_dump *
hal_bsp_core_dump(int *area_cnt)
{
diff --git a/hw/bsp/bmd300eval/src/hal_bsp.c b/hw/bsp/bmd300eval/src/hal_bsp.c
index 964d774d2..50523dc00 100644
--- a/hw/bsp/bmd300eval/src/hal_bsp.c
+++ b/hw/bsp/bmd300eval/src/hal_bsp.c
@@ -43,18 +43,6 @@ static const struct hal_bsp_mem_dump dump_cfg[] = {
}
};
-const struct hal_flash *
-hal_bsp_flash_dev(uint8_t id)
-{
- /*
- * Internal flash mapped to id 0.
- */
- if (id != 0) {
- return NULL;
- }
- return &nrf_flash_dev;
-}
-
const struct hal_bsp_mem_dump *
hal_bsp_core_dump(int *area_cnt)
{
diff --git a/hw/bsp/calliope_mini/src/hal_bsp.c b/hw/bsp/calliope_mini/src/hal_bsp.c
index deb122c1a..f7d6d3c90 100644
--- a/hw/bsp/calliope_mini/src/hal_bsp.c
+++ b/hw/bsp/calliope_mini/src/hal_bsp.c
@@ -108,18 +108,6 @@ static const struct hal_bsp_mem_dump dump_cfg[] = {
}
};
-const struct hal_flash *
-hal_bsp_flash_dev(uint8_t id)
-{
- /*
- * Internal flash mapped to id 0.
- */
- if (id != 0) {
- return NULL;
- }
- return &nrf_flash_dev;
-}
-
const struct hal_bsp_mem_dump *
hal_bsp_core_dump(int *area_cnt)
{
diff --git a/hw/bsp/dialog_cmac/src/hal_bsp.c b/hw/bsp/dialog_cmac/src/hal_bsp.c
index 236cd3cef..53493df15 100644
--- a/hw/bsp/dialog_cmac/src/hal_bsp.c
+++ b/hw/bsp/dialog_cmac/src/hal_bsp.c
@@ -22,12 +22,6 @@
#include "hal/hal_system.h"
#include "mcu/cmac_periph.h"
-const struct hal_flash *
-hal_bsp_flash_dev(uint8_t id)
-{
- return NULL;
-}
-
void
hal_bsp_init(void)
{
diff --git a/hw/bsp/dialog_da14695-dk-usb/src/hal_bsp.c b/hw/bsp/dialog_da14695-dk-usb/src/hal_bsp.c
index 58fa91f27..254927654 100644
--- a/hw/bsp/dialog_da14695-dk-usb/src/hal_bsp.c
+++ b/hw/bsp/dialog_da14695-dk-usb/src/hal_bsp.c
@@ -57,16 +57,6 @@ const struct qspi_flash_config rdids[] = {
const int qspi_flash_config_array_size = ARRAY_SIZE(rdids);
#endif
-const struct hal_flash *
-hal_bsp_flash_dev(uint8_t id)
-{
- if (id != 0) {
- return NULL;
- }
-
- return &da1469x_flash_dev;
-}
-
const struct hal_bsp_mem_dump *
hal_bsp_core_dump(int *area_cnt)
{
diff --git a/hw/bsp/dialog_da1469x-dk-pro/src/hal_bsp.c b/hw/bsp/dialog_da1469x-dk-pro/src/hal_bsp.c
index 5509a8834..db1a105ed 100644
--- a/hw/bsp/dialog_da1469x-dk-pro/src/hal_bsp.c
+++ b/hw/bsp/dialog_da1469x-dk-pro/src/hal_bsp.c
@@ -58,16 +58,6 @@ const struct qspi_flash_config rdids[] = {
const int qspi_flash_config_array_size = ARRAY_SIZE(rdids);
#endif
-const struct hal_flash *
-hal_bsp_flash_dev(uint8_t id)
-{
- if (id != 0) {
- return NULL;
- }
-
- return &da1469x_flash_dev;
-}
-
const struct hal_bsp_mem_dump *
hal_bsp_core_dump(int *area_cnt)
{
diff --git a/hw/bsp/dwm1001-dev/src/hal_bsp.c b/hw/bsp/dwm1001-dev/src/hal_bsp.c
index 0284e47da..3895068d9 100644
--- a/hw/bsp/dwm1001-dev/src/hal_bsp.c
+++ b/hw/bsp/dwm1001-dev/src/hal_bsp.c
@@ -44,18 +44,6 @@ static const struct hal_bsp_mem_dump dump_cfg[] = {
}
};
-const struct hal_flash *
-hal_bsp_flash_dev(uint8_t id)
-{
- /*
- * Internal flash mapped to id 0.
- */
- if (id != 0) {
- return NULL;
- }
- return &nrf_flash_dev;
-}
-
const struct hal_bsp_mem_dump *
hal_bsp_core_dump(int *area_cnt)
{
diff --git a/hw/bsp/fanstel-ev-bt840/src/hal_bsp.c b/hw/bsp/fanstel-ev-bt840/src/hal_bsp.c
index 69018ca39..25e1b657c 100644
--- a/hw/bsp/fanstel-ev-bt840/src/hal_bsp.c
+++ b/hw/bsp/fanstel-ev-bt840/src/hal_bsp.c
@@ -39,16 +39,6 @@ static const struct hal_bsp_mem_dump hal_bsp_core_dump_cfg[] = {
}
};
-const struct hal_flash *
-hal_bsp_flash_dev(uint8_t id)
-{
- if (id == 0) {
- return &nrf_flash_dev;
- }
-
- return NULL;
-}
-
const struct hal_bsp_mem_dump *
hal_bsp_core_dump(int *area_cnt)
{
diff --git a/hw/bsp/fanstel_ev_bt40e/net/src/hal_bsp.c b/hw/bsp/fanstel_ev_bt40e/net/src/hal_bsp.c
index 2f5a7bc76..65f277660 100644
--- a/hw/bsp/fanstel_ev_bt40e/net/src/hal_bsp.c
+++ b/hw/bsp/fanstel_ev_bt40e/net/src/hal_bsp.c
@@ -48,29 +48,6 @@ extern uint8_t __StackLimit;
extern uint8_t __StackTop;
#endif
-const struct hal_flash *
-hal_bsp_flash_dev(uint8_t id)
-{
- /*
- * Internal flash mapped to id 0.
- */
- if (id == 0) {
- return &nrf_flash_dev;
- }
-#if MCUBOOT_MYNEWT
- if (id == 1) {
- return &nrf5340_net_vflash_dev.nv_flash;
- }
-#endif
-#if MYNEWT_VAL(IPC_NRF5340_FLASH_CLIENT)
- if (id == 2) {
- return ipc_flash();
- }
-#endif
-
- return NULL;
-}
-
const struct hal_bsp_mem_dump *
hal_bsp_core_dump(int *area_cnt)
{
diff --git a/hw/bsp/fanstel_ev_bt40e/src/hal_bsp.c b/hw/bsp/fanstel_ev_bt40e/src/hal_bsp.c
index 00670827b..f6cf26f04 100644
--- a/hw/bsp/fanstel_ev_bt40e/src/hal_bsp.c
+++ b/hw/bsp/fanstel_ev_bt40e/src/hal_bsp.c
@@ -47,30 +47,6 @@ extern uint8_t __StackLimit;
extern uint8_t __StackTop;
#endif
-const struct hal_flash *
-hal_bsp_flash_dev(uint8_t id)
-{
- /*
- * Internal flash mapped to id 0.
- */
- if (id == 0) {
- return &nrf_flash_dev;
- }
-#if MYNEWT_VAL(QSPI_ENABLE)
- if (id == 1) {
- return &nrf_qspi_dev;
- }
-#endif
-#if MYNEWT_VAL(IPC_NRF5340_FLASH_CLIENT)
- _Static_assert(2 < MYNEWT_VAL(HAL_FLASH_MAX_DEVICE_COUNT) || MYNEWT_VAL(QSPI_ENABLE),
- "HAL_FLASH_MAX_DEVICE_COUNT must be set to 3 when QSPI_ENABLE is 0");
- if (id == 2) {
- return ipc_flash();
- }
-#endif
- return NULL;
-}
-
const struct hal_bsp_mem_dump *
hal_bsp_core_dump(int *area_cnt)
{
diff --git a/hw/bsp/fanstel_ev_bt40e/syscfg.yml b/hw/bsp/fanstel_ev_bt40e/syscfg.yml
index 3661bef76..84113732d 100644
--- a/hw/bsp/fanstel_ev_bt40e/syscfg.yml
+++ b/hw/bsp/fanstel_ev_bt40e/syscfg.yml
@@ -127,8 +127,6 @@ syscfg.vals.BSP_NRF5340_NET_ENABLE:
syscfg.vals.BSP_NRF5340_NET_FLASH_ENABLE:
IPC_NRF5340_CHANNELS: 4
-syscfg.vals.IPC_NRF5340_FLASH_CLIENT:
- HAL_FLASH_MAX_DEVICE_COUNT: 3
syscfg.vals.'FANSTEL_NRF5340_MODULE=="BT40NE" || FANSTEL_NRF5340_MODULE=="BT40N"':
# NRF21540 pins managed by Network core
diff --git a/hw/bsp/frdm-k64f/src/hal_bsp.c b/hw/bsp/frdm-k64f/src/hal_bsp.c
index bed6255cc..57ffd2ef0 100644
--- a/hw/bsp/frdm-k64f/src/hal_bsp.c
+++ b/hw/bsp/frdm-k64f/src/hal_bsp.c
@@ -124,21 +124,9 @@ static struct eflash_crypto_dev enc_flash_dev0 = {
.efd_hwdev = &kinetis_flash_dev,
}
};
-#endif
-const struct hal_flash *
-hal_bsp_flash_dev(uint8_t id)
-{
- if (id == 0) {
- return &kinetis_flash_dev;
- }
-#if MYNEWT_VAL(ENC_FLASH_DEV)
- if (id == 1) {
- return &enc_flash_dev0.ecd_dev.efd_hal;
- }
+HAL_FLASH_DEV(enc_flash, (1), &enc_flash_dev0.ecd_dev.efd_hal);
#endif
- return NULL;
-}
const struct hal_bsp_mem_dump *
hal_bsp_core_dump(int *area_cnt)
diff --git a/hw/bsp/frdm-k82f/src/hal_bsp.c b/hw/bsp/frdm-k82f/src/hal_bsp.c
index 618d66020..e0c5b6dd2 100644
--- a/hw/bsp/frdm-k82f/src/hal_bsp.c
+++ b/hw/bsp/frdm-k82f/src/hal_bsp.c
@@ -158,26 +158,9 @@ static struct eflash_crypto_dev enc_flash_dev0 = {
.efd_hwdev = &kinetis_flash_dev,
}
};
-#endif
-const struct hal_flash *
-hal_bsp_flash_dev(uint8_t id)
-{
- if (id == 0) {
- return &kinetis_flash_dev;
- }
-#if MYNEWT_VAL(QSPI_ENABLE)
- if (id == 1) {
- return &nxp_qspi_dev;
- }
+HAL_FLASH_DEV(enc_flash, (2), &enc_flash_dev0.ecd_dev.efd_hal);
#endif
-#if MYNEWT_VAL(ENC_FLASH_DEV)
- if (id == 2) {
- return &enc_flash_dev0.ecd_dev.efd_hal;
- }
-#endif
- return NULL;
-}
const struct hal_bsp_mem_dump *
hal_bsp_core_dump(int *area_cnt)
diff --git a/hw/bsp/hifive1/src/hal_bsp.c b/hw/bsp/hifive1/src/hal_bsp.c
index e7b7de36a..e8e105f9e 100644
--- a/hw/bsp/hifive1/src/hal_bsp.c
+++ b/hw/bsp/hifive1/src/hal_bsp.c
@@ -54,23 +54,6 @@ struct bus_spi_node_cfg flash_spi_cfg = {
#endif
#endif
-static const struct hal_flash *flash_devs[] = {
- [0] = &fe310_flash_dev,
-#if MYNEWT_VAL(SPIFLASH)
- [1] = &spiflash_dev.hal,
-#endif
-};
-
-const struct hal_flash *
-hal_bsp_flash_dev(uint8_t id)
-{
- if (id >= ARRAY_SIZE(flash_devs)) {
- return NULL;
- }
-
- return flash_devs[id];
-}
-
const struct hal_bsp_mem_dump *
hal_bsp_core_dump(int *area_cnt)
{
diff --git a/hw/bsp/lpcxpresso55s28/src/hal_bsp.c b/hw/bsp/lpcxpresso55s28/src/hal_bsp.c
index 320ccfa6c..df1236f8c 100644
--- a/hw/bsp/lpcxpresso55s28/src/hal_bsp.c
+++ b/hw/bsp/lpcxpresso55s28/src/hal_bsp.c
@@ -76,15 +76,6 @@ static const struct hal_bsp_mem_dump dump_cfg[] = {
}
};
-const struct hal_flash *
-hal_bsp_flash_dev(uint8_t id)
-{
- if (id == 0) {
- return &mcux_flash_dev;
- }
- return NULL;
-}
-
const struct hal_bsp_mem_dump *
hal_bsp_core_dump(int *area_cnt)
{
diff --git a/hw/bsp/native-armv7/syscfg.yml b/hw/bsp/native-armv7/syscfg.yml
index a08aeb170..6ba9aae22 100644
--- a/hw/bsp/native-armv7/syscfg.yml
+++ b/hw/bsp/native-armv7/syscfg.yml
@@ -23,6 +23,7 @@ syscfg.defs:
value: 1
syscfg.vals:
+ HAL_FLASH_DEV_TABLE: 0
# Sim isn't flash constrained, so include filename, line number, and
# message in asserts and sysinit panic messages.
OS_CRASH_FILE_LINE: 1
diff --git a/hw/bsp/native/src/hal_bsp.c b/hw/bsp/native/src/hal_bsp.c
index 4de018617..158db43ea 100644
--- a/hw/bsp/native/src/hal_bsp.c
+++ b/hw/bsp/native/src/hal_bsp.c
@@ -57,18 +57,7 @@ static sec_data_secret struct eflash_mbedtls_dev ef_dev0 = {
}
};
-const struct hal_flash *
-hal_bsp_flash_dev(uint8_t id)
-{
- switch (id) {
- case 0:
- return &native_flash_dev;
- case 1:
- return &ef_dev0.dev.efd_hal;
- default:
- return NULL;
- }
-}
+HAL_FLASH_DEV(enc_flash, (1), &ef_dev0.dev.efd_hal);
int
hal_bsp_power_state(int state)
diff --git a/hw/bsp/nina-b1/src/hal_bsp.c b/hw/bsp/nina-b1/src/hal_bsp.c
index 09672b919..2df0356e1 100644
--- a/hw/bsp/nina-b1/src/hal_bsp.c
+++ b/hw/bsp/nina-b1/src/hal_bsp.c
@@ -43,18 +43,6 @@ static const struct hal_bsp_mem_dump dump_cfg[] = {
}
};
-const struct hal_flash *
-hal_bsp_flash_dev(uint8_t id)
-{
- /*
- * Internal flash mapped to id 0.
- */
- if (id != 0) {
- return NULL;
- }
- return &nrf_flash_dev;
-}
-
const struct hal_bsp_mem_dump *
hal_bsp_core_dump(int *area_cnt)
{
diff --git a/hw/bsp/nordic_pca10028-16k/src/hal_bsp.c b/hw/bsp/nordic_pca10028-16k/src/hal_bsp.c
index e8af4d525..2779cda38 100644
--- a/hw/bsp/nordic_pca10028-16k/src/hal_bsp.c
+++ b/hw/bsp/nordic_pca10028-16k/src/hal_bsp.c
@@ -107,18 +107,6 @@ static const struct hal_bsp_mem_dump dump_cfg[] = {
}
};
-const struct hal_flash *
-hal_bsp_flash_dev(uint8_t id)
-{
- /*
- * Internal flash mapped to id 0.
- */
- if (id != 0) {
- return NULL;
- }
- return &nrf_flash_dev;
-}
-
const struct hal_bsp_mem_dump *
hal_bsp_core_dump(int *area_cnt)
{
diff --git a/hw/bsp/nordic_pca10028/src/hal_bsp.c b/hw/bsp/nordic_pca10028/src/hal_bsp.c
index 3e5d6dfa2..a3a76f2fa 100644
--- a/hw/bsp/nordic_pca10028/src/hal_bsp.c
+++ b/hw/bsp/nordic_pca10028/src/hal_bsp.c
@@ -109,18 +109,6 @@ static const struct hal_bsp_mem_dump dump_cfg[] = {
}
};
-const struct hal_flash *
-hal_bsp_flash_dev(uint8_t id)
-{
- /*
- * Internal flash mapped to id 0.
- */
- if (id != 0) {
- return NULL;
- }
- return &nrf_flash_dev;
-}
-
const struct hal_bsp_mem_dump *
hal_bsp_core_dump(int *area_cnt)
{
diff --git a/hw/bsp/nordic_pca10040/src/hal_bsp.c b/hw/bsp/nordic_pca10040/src/hal_bsp.c
index e54a8c3d5..e14e0c2d1 100644
--- a/hw/bsp/nordic_pca10040/src/hal_bsp.c
+++ b/hw/bsp/nordic_pca10040/src/hal_bsp.c
@@ -55,24 +55,9 @@ static sec_data_secret struct eflash_nrf5x_dev enc_flash_dev0 = {
}
};
-#endif
+HAL_FLASH_DEV(enc_flash, (1), &enc_flash_dev0.end_dev.efd_hal);
-const struct hal_flash *
-hal_bsp_flash_dev(uint8_t id)
-{
- /*
- * Internal flash mapped to id 0.
- */
- if (id == 0) {
- return &nrf_flash_dev;
- }
-#if MYNEWT_VAL(ENC_FLASH_DEV)
- if (id == 1) {
- return &enc_flash_dev0.end_dev.efd_hal;
- }
#endif
- return NULL;
-}
const struct hal_bsp_mem_dump *
hal_bsp_core_dump(int *area_cnt)
diff --git a/hw/bsp/nordic_pca10056/src/hal_bsp.c b/hw/bsp/nordic_pca10056/src/hal_bsp.c
index 2b668260f..d52cedb6a 100644
--- a/hw/bsp/nordic_pca10056/src/hal_bsp.c
+++ b/hw/bsp/nordic_pca10056/src/hal_bsp.c
@@ -41,23 +41,6 @@ static const struct hal_bsp_mem_dump dump_cfg[] = {
}
};
-const struct hal_flash *
-hal_bsp_flash_dev(uint8_t id)
-{
- /*
- * Internal flash mapped to id 0.
- */
- if (id == 0) {
- return &nrf_flash_dev;
- }
-#if MYNEWT_VAL(QSPI_ENABLE)
- if (id == 1) {
- return &nrf_qspi_dev;
- }
-#endif
- return NULL;
-}
-
const struct hal_bsp_mem_dump *
hal_bsp_core_dump(int *area_cnt)
{
diff --git a/hw/bsp/nordic_pca10059/src/hal_bsp.c b/hw/bsp/nordic_pca10059/src/hal_bsp.c
index 2b668260f..d52cedb6a 100644
--- a/hw/bsp/nordic_pca10059/src/hal_bsp.c
+++ b/hw/bsp/nordic_pca10059/src/hal_bsp.c
@@ -41,23 +41,6 @@ static const struct hal_bsp_mem_dump dump_cfg[] = {
}
};
-const struct hal_flash *
-hal_bsp_flash_dev(uint8_t id)
-{
- /*
- * Internal flash mapped to id 0.
- */
- if (id == 0) {
- return &nrf_flash_dev;
- }
-#if MYNEWT_VAL(QSPI_ENABLE)
- if (id == 1) {
- return &nrf_qspi_dev;
- }
-#endif
- return NULL;
-}
-
const struct hal_bsp_mem_dump *
hal_bsp_core_dump(int *area_cnt)
{
diff --git a/hw/bsp/nordic_pca10090/src/hal_bsp.c b/hw/bsp/nordic_pca10090/src/hal_bsp.c
index 37c8bd30f..d30349468 100644
--- a/hw/bsp/nordic_pca10090/src/hal_bsp.c
+++ b/hw/bsp/nordic_pca10090/src/hal_bsp.c
@@ -42,19 +42,6 @@ static const struct hal_bsp_mem_dump dump_cfg[] = {
}
};
-const struct hal_flash *
-hal_bsp_flash_dev(uint8_t id)
-{
- /*
- * Internal flash mapped to id 0.
- */
- if (id == 0) {
- return &nrf_flash_dev;
- }
-
- return NULL;
-}
-
const struct hal_bsp_mem_dump *
hal_bsp_core_dump(int *area_cnt)
{
diff --git a/hw/bsp/nordic_pca10095/src/hal_bsp.c b/hw/bsp/nordic_pca10095/src/hal_bsp.c
index c39b96a1c..f6cf26f04 100644
--- a/hw/bsp/nordic_pca10095/src/hal_bsp.c
+++ b/hw/bsp/nordic_pca10095/src/hal_bsp.c
@@ -47,30 +47,6 @@ extern uint8_t __StackLimit;
extern uint8_t __StackTop;
#endif
-const struct hal_flash *
-hal_bsp_flash_dev(uint8_t id)
-{
- /*
- * Internal flash mapped to id 0.
- */
- if (id == 0) {
- return &nrf_flash_dev;
- }
-#if MYNEWT_VAL(QSPI_ENABLE)
- if (id == 1) {
- return &nrf_qspi_dev;
- }
-#endif
-#if MYNEWT_VAL(IPC_NRF5340_FLASH_CLIENT)
- _Static_assert(2 < MYNEWT_VAL(HAL_FLASH_MAX_DEVICE_COUNT) || MYNEWT_VAL(QSPI_ENABLE),
- "HAL_FLASH_MAX_DEVICE_COUNT must be set to 3 when QSPI_ENABLE is 0");
- if (id == 2) {
- return ipc_flash();
- }
-#endif
- return NULL;
-}
-
const struct hal_bsp_mem_dump *
hal_bsp_core_dump(int *area_cnt)
{
diff --git a/hw/bsp/nordic_pca10095/syscfg.yml b/hw/bsp/nordic_pca10095/syscfg.yml
index 5ccacdbcf..38488f7d1 100644
--- a/hw/bsp/nordic_pca10095/syscfg.yml
+++ b/hw/bsp/nordic_pca10095/syscfg.yml
@@ -111,8 +111,6 @@ syscfg.vals.BSP_NRF5340_NET_ENABLE:
syscfg.vals.BSP_NRF5340_NET_FLASH_ENABLE:
IPC_NRF5340_CHANNELS: 4
-syscfg.vals.IPC_NRF5340_FLASH_CLIENT:
- HAL_FLASH_MAX_DEVICE_COUNT: 3
syscfg.restrictions.BSP_NRF5340_NET_FLASH_ENABLE:
- 'IPC_NRF5340_CHANNELS >= 4'
diff --git a/hw/bsp/nordic_pca10095_net/src/hal_bsp.c b/hw/bsp/nordic_pca10095_net/src/hal_bsp.c
index 2f5a7bc76..65f277660 100644
--- a/hw/bsp/nordic_pca10095_net/src/hal_bsp.c
+++ b/hw/bsp/nordic_pca10095_net/src/hal_bsp.c
@@ -48,29 +48,6 @@ extern uint8_t __StackLimit;
extern uint8_t __StackTop;
#endif
-const struct hal_flash *
-hal_bsp_flash_dev(uint8_t id)
-{
- /*
- * Internal flash mapped to id 0.
- */
- if (id == 0) {
- return &nrf_flash_dev;
- }
-#if MCUBOOT_MYNEWT
- if (id == 1) {
- return &nrf5340_net_vflash_dev.nv_flash;
- }
-#endif
-#if MYNEWT_VAL(IPC_NRF5340_FLASH_CLIENT)
- if (id == 2) {
- return ipc_flash();
- }
-#endif
-
- return NULL;
-}
-
const struct hal_bsp_mem_dump *
hal_bsp_core_dump(int *area_cnt)
{
diff --git a/hw/bsp/nordic_pca10121/net/src/hal_bsp.c b/hw/bsp/nordic_pca10121/net/src/hal_bsp.c
index 2f5a7bc76..65f277660 100644
--- a/hw/bsp/nordic_pca10121/net/src/hal_bsp.c
+++ b/hw/bsp/nordic_pca10121/net/src/hal_bsp.c
@@ -48,29 +48,6 @@ extern uint8_t __StackLimit;
extern uint8_t __StackTop;
#endif
-const struct hal_flash *
-hal_bsp_flash_dev(uint8_t id)
-{
- /*
- * Internal flash mapped to id 0.
- */
- if (id == 0) {
- return &nrf_flash_dev;
- }
-#if MCUBOOT_MYNEWT
- if (id == 1) {
- return &nrf5340_net_vflash_dev.nv_flash;
- }
-#endif
-#if MYNEWT_VAL(IPC_NRF5340_FLASH_CLIENT)
- if (id == 2) {
- return ipc_flash();
- }
-#endif
-
- return NULL;
-}
-
const struct hal_bsp_mem_dump *
hal_bsp_core_dump(int *area_cnt)
{
diff --git a/hw/bsp/nordic_pca10121/src/hal_bsp.c b/hw/bsp/nordic_pca10121/src/hal_bsp.c
index 300c901bc..63ab92606 100644
--- a/hw/bsp/nordic_pca10121/src/hal_bsp.c
+++ b/hw/bsp/nordic_pca10121/src/hal_bsp.c
@@ -48,28 +48,6 @@ extern uint8_t __StackLimit;
extern uint8_t __StackTop;
#endif
-const struct hal_flash *
-hal_bsp_flash_dev(uint8_t id)
-{
- /*
- * Internal flash mapped to id 0.
- */
- if (id == 0) {
- return &nrf_flash_dev;
- }
-#if MYNEWT_VAL(QSPI_ENABLE)
- if (id == 1) {
- return &nrf_qspi_dev;
- }
-#endif
-#if MYNEWT_VAL(IPC_NRF5340_FLASH_CLIENT)
- if (id == 2) {
- return ipc_flash();
- }
-#endif
- return NULL;
-}
-
const struct hal_bsp_mem_dump *
hal_bsp_core_dump(int *area_cnt)
{
diff --git a/hw/bsp/nordic_pca10156/src/hal_bsp.c b/hw/bsp/nordic_pca10156/src/hal_bsp.c
index a61c80990..a1315f1f2 100644
--- a/hw/bsp/nordic_pca10156/src/hal_bsp.c
+++ b/hw/bsp/nordic_pca10156/src/hal_bsp.c
@@ -37,19 +37,6 @@ static const struct hal_bsp_mem_dump dump_cfg[] = {
[0] = { .hbmd_start = &_ram_start, .hbmd_size = RAM_SIZE }
};
-const struct hal_flash *
-hal_bsp_flash_dev(uint8_t id)
-{
- /*
- * Internal flash mapped to id 0.
- */
- if (id == 0) {
- return &nrf54l_flash_dev;
- }
-
- return NULL;
-}
-
const struct hal_bsp_mem_dump *
hal_bsp_core_dump(int *area_cnt)
{
diff --git a/hw/bsp/nordic_pca20020/src/hal_bsp.c b/hw/bsp/nordic_pca20020/src/hal_bsp.c
index c70ca6e73..961a3804a 100644
--- a/hw/bsp/nordic_pca20020/src/hal_bsp.c
+++ b/hw/bsp/nordic_pca20020/src/hal_bsp.c
@@ -55,19 +55,6 @@ static const struct hal_bsp_mem_dump dump_cfg[] = {
}
};
-const struct hal_flash *
-hal_bsp_flash_dev(uint8_t id)
-{
- /*
- * Internal flash mapped to id 0.
- */
- if (id == 0) {
- return &nrf_flash_dev;
- }
-
- return NULL;
-}
-
const struct hal_bsp_mem_dump *
hal_bsp_core_dump(int *area_cnt)
{
diff --git a/hw/bsp/nordic_thingy53/src/hal_bsp.c b/hw/bsp/nordic_thingy53/src/hal_bsp.c
index c39b96a1c..f6cf26f04 100644
--- a/hw/bsp/nordic_thingy53/src/hal_bsp.c
+++ b/hw/bsp/nordic_thingy53/src/hal_bsp.c
@@ -47,30 +47,6 @@ extern uint8_t __StackLimit;
extern uint8_t __StackTop;
#endif
-const struct hal_flash *
-hal_bsp_flash_dev(uint8_t id)
-{
- /*
- * Internal flash mapped to id 0.
- */
- if (id == 0) {
- return &nrf_flash_dev;
- }
-#if MYNEWT_VAL(QSPI_ENABLE)
- if (id == 1) {
- return &nrf_qspi_dev;
- }
-#endif
-#if MYNEWT_VAL(IPC_NRF5340_FLASH_CLIENT)
- _Static_assert(2 < MYNEWT_VAL(HAL_FLASH_MAX_DEVICE_COUNT) || MYNEWT_VAL(QSPI_ENABLE),
- "HAL_FLASH_MAX_DEVICE_COUNT must be set to 3 when QSPI_ENABLE is 0");
- if (id == 2) {
- return ipc_flash();
- }
-#endif
- return NULL;
-}
-
const struct hal_bsp_mem_dump *
hal_bsp_core_dump(int *area_cnt)
{
diff --git a/hw/bsp/nordic_thingy53/syscfg.yml b/hw/bsp/nordic_thingy53/syscfg.yml
index 9fb5326fc..7f7a13ee0 100644
--- a/hw/bsp/nordic_thingy53/syscfg.yml
+++ b/hw/bsp/nordic_thingy53/syscfg.yml
@@ -101,8 +101,6 @@ syscfg.vals.BSP_NRF5340_NET_ENABLE:
syscfg.vals.BSP_NRF5340_NET_FLASH_ENABLE:
IPC_NRF5340_CHANNELS: 4
-syscfg.vals.IPC_NRF5340_FLASH_CLIENT:
- HAL_FLASH_MAX_DEVICE_COUNT: 3
syscfg.restrictions.BSP_NRF5340_NET_FLASH_ENABLE:
- 'IPC_NRF5340_CHANNELS >= 4'
diff --git a/hw/bsp/nrf51-arduino_101/src/hal_bsp.c b/hw/bsp/nrf51-arduino_101/src/hal_bsp.c
index a67309c33..224eb34d0 100644
--- a/hw/bsp/nrf51-arduino_101/src/hal_bsp.c
+++ b/hw/bsp/nrf51-arduino_101/src/hal_bsp.c
@@ -110,18 +110,6 @@ static const struct hal_bsp_mem_dump dump_cfg[] = {
}
};
-const struct hal_flash *
-hal_bsp_flash_dev(uint8_t id)
-{
- /*
- * Internal flash mapped to id 0.
- */
- if (id != 0) {
- return NULL;
- }
- return &nrf_flash_dev;
-}
-
const struct hal_bsp_mem_dump *
hal_bsp_core_dump(int *area_cnt)
{
diff --git a/hw/bsp/nrf51-blenano/src/hal_bsp.c b/hw/bsp/nrf51-blenano/src/hal_bsp.c
index cb633c0ca..db2f4acf1 100644
--- a/hw/bsp/nrf51-blenano/src/hal_bsp.c
+++ b/hw/bsp/nrf51-blenano/src/hal_bsp.c
@@ -109,18 +109,6 @@ static const struct hal_bsp_mem_dump dump_cfg[] = {
}
};
-const struct hal_flash *
-hal_bsp_flash_dev(uint8_t id)
-{
- /*
- * Internal flash mapped to id 0.
- */
- if (id != 0) {
- return NULL;
- }
- return &nrf_flash_dev;
-}
-
const struct hal_bsp_mem_dump *
hal_bsp_core_dump(int *area_cnt)
{
diff --git a/hw/bsp/nucleo-f030r8/src/hal_bsp.c b/hw/bsp/nucleo-f030r8/src/hal_bsp.c
index 2eea79404..72c6a4a94 100644
--- a/hw/bsp/nucleo-f030r8/src/hal_bsp.c
+++ b/hw/bsp/nucleo-f030r8/src/hal_bsp.c
@@ -82,19 +82,6 @@ hal_bsp_mem_dump dump_cfg[] = {
},
};
-extern const struct hal_flash stm32_flash_dev;
-const struct hal_flash *
-hal_bsp_flash_dev(uint8_t id)
-{
- /*
- * Internal flash mapped to id 0.
- */
- if (id != 0) {
- return NULL;
- }
- return &stm32_flash_dev;
-}
-
const struct hal_bsp_mem_dump *
hal_bsp_core_dump(int *area_cnt)
{
diff --git a/hw/bsp/nucleo-f072rb/src/hal_bsp.c b/hw/bsp/nucleo-f072rb/src/hal_bsp.c
index 33eb9d070..9bde5a619 100644
--- a/hw/bsp/nucleo-f072rb/src/hal_bsp.c
+++ b/hw/bsp/nucleo-f072rb/src/hal_bsp.c
@@ -89,19 +89,6 @@ hal_bsp_mem_dump dump_cfg[] = {
},
};
-extern const struct hal_flash stm32_flash_dev;
-const struct hal_flash *
-hal_bsp_flash_dev(uint8_t id)
-{
- /*
- * Internal flash mapped to id 0.
- */
- if (id != 0) {
- return NULL;
- }
- return &stm32_flash_dev;
-}
-
const struct hal_bsp_mem_dump *
hal_bsp_core_dump(int *area_cnt)
{
diff --git a/hw/bsp/nucleo-f103rb/src/hal_bsp.c b/hw/bsp/nucleo-f103rb/src/hal_bsp.c
index 8455bad44..d9cd3e01c 100644
--- a/hw/bsp/nucleo-f103rb/src/hal_bsp.c
+++ b/hw/bsp/nucleo-f103rb/src/hal_bsp.c
@@ -33,10 +33,6 @@
#include <pwm_stm32/pwm_stm32.h>
#endif
-#if MYNEWT_VAL(SPIFLASH)
-#include <spiflash/spiflash.h>
-#endif
-
#if MYNEWT_VAL(UART_0)
const struct stm32_uart_cfg os_bsp_uart0_cfg = {
.suc_uart = USART2,
@@ -99,7 +95,6 @@ static const struct hal_bsp_mem_dump dump_cfg[] = {
},
};
-extern const struct hal_flash stm32_flash_dev;
#if MYNEWT_VAL(SPIFLASH)
#if MYNEWT_VAL(BUS_DRIVER_PRESENT)
struct bus_spi_node_cfg flash_spi_cfg = {
@@ -112,22 +107,6 @@ struct bus_spi_node_cfg flash_spi_cfg = {
#endif
#endif
-static const struct hal_flash *flash_devs[] = {
- [0] = &stm32_flash_dev,
-#if MYNEWT_VAL(SPIFLASH)
- [1] = &spiflash_dev.hal,
-#endif
-};
-
-const struct hal_flash *
-hal_bsp_flash_dev(uint8_t id)
-{
- if (id >= ARRAY_SIZE(flash_devs)) {
- return NULL;
- }
-
- return flash_devs[id];
-}
const struct hal_bsp_mem_dump *
hal_bsp_core_dump(int *area_cnt)
{
diff --git a/hw/bsp/nucleo-f303k8/src/hal_bsp.c b/hw/bsp/nucleo-f303k8/src/hal_bsp.c
index e48ac5d89..0bb13c16e 100644
--- a/hw/bsp/nucleo-f303k8/src/hal_bsp.c
+++ b/hw/bsp/nucleo-f303k8/src/hal_bsp.c
@@ -90,19 +90,6 @@ static const struct hal_bsp_mem_dump dump_cfg[] = {
}
};
-extern const struct hal_flash stm32_flash_dev;
-const struct hal_flash *
-hal_bsp_flash_dev(uint8_t id)
-{
- /*
- * Internal flash mapped to id 0.
- */
- if (id != 0) {
- return NULL;
- }
- return &stm32_flash_dev;
-}
-
const struct hal_bsp_mem_dump *
hal_bsp_core_dump(int *area_cnt)
{
diff --git a/hw/bsp/nucleo-f303re/src/hal_bsp.c b/hw/bsp/nucleo-f303re/src/hal_bsp.c
index 459b4a316..bfa4f9f52 100644
--- a/hw/bsp/nucleo-f303re/src/hal_bsp.c
+++ b/hw/bsp/nucleo-f303re/src/hal_bsp.c
@@ -90,19 +90,6 @@ static const struct hal_bsp_mem_dump dump_cfg[] = {
}
};
-extern const struct hal_flash stm32_flash_dev;
-const struct hal_flash *
-hal_bsp_flash_dev(uint8_t id)
-{
- /*
- * Internal flash mapped to id 0.
- */
- if (id != 0) {
- return NULL;
- }
- return &stm32_flash_dev;
-}
-
const struct hal_bsp_mem_dump *
hal_bsp_core_dump(int *area_cnt)
{
diff --git a/hw/bsp/nucleo-f401re/src/hal_bsp.c b/hw/bsp/nucleo-f401re/src/hal_bsp.c
index bbb9692f2..aa2e4a123 100644
--- a/hw/bsp/nucleo-f401re/src/hal_bsp.c
+++ b/hw/bsp/nucleo-f401re/src/hal_bsp.c
@@ -89,19 +89,6 @@ const struct stm32_hal_i2c_cfg os_bsp_i2c0_cfg = {
};
#endif
-extern const struct hal_flash stm32_flash_dev;
-const struct hal_flash *
-hal_bsp_flash_dev(uint8_t id)
-{
- /*
- * Internal flash mapped to id 0.
- */
- if (id != 0) {
- return NULL;
- }
- return &stm32_flash_dev;
-}
-
const struct hal_bsp_mem_dump *
hal_bsp_core_dump(int *area_cnt)
{
diff --git a/hw/bsp/nucleo-f411re/src/hal_bsp.c b/hw/bsp/nucleo-f411re/src/hal_bsp.c
index ec9b59673..0d103479d 100644
--- a/hw/bsp/nucleo-f411re/src/hal_bsp.c
+++ b/hw/bsp/nucleo-f411re/src/hal_bsp.c
@@ -155,19 +155,6 @@ const struct stm32_hal_i2c_cfg os_bsp_i2c2_cfg = {
};
#endif
-extern const struct hal_flash stm32_flash_dev;
-const struct hal_flash *
-hal_bsp_flash_dev(uint8_t id)
-{
- /*
- * Internal flash mapped to id 0.
- */
- if (id != 0) {
- return NULL;
- }
- return &stm32_flash_dev;
-}
-
const struct hal_bsp_mem_dump *
hal_bsp_core_dump(int *area_cnt)
{
diff --git a/hw/bsp/nucleo-f413zh/src/hal_bsp.c b/hw/bsp/nucleo-f413zh/src/hal_bsp.c
index bc9ead434..6bc3de93c 100644
--- a/hw/bsp/nucleo-f413zh/src/hal_bsp.c
+++ b/hw/bsp/nucleo-f413zh/src/hal_bsp.c
@@ -95,19 +95,6 @@ static const struct hal_bsp_mem_dump dump_cfg[] = {
}
};
-extern const struct hal_flash stm32_flash_dev;
-const struct hal_flash *
-hal_bsp_flash_dev(uint8_t id)
-{
- /*
- * Internal flash mapped to id 0.
- */
- if (id != 0) {
- return NULL;
- }
- return &stm32_flash_dev;
-}
-
const struct hal_bsp_mem_dump *
hal_bsp_core_dump(int *area_cnt)
{
diff --git a/hw/bsp/nucleo-f439zi/src/hal_bsp.c b/hw/bsp/nucleo-f439zi/src/hal_bsp.c
index f88ae0896..a11d726c3 100644
--- a/hw/bsp/nucleo-f439zi/src/hal_bsp.c
+++ b/hw/bsp/nucleo-f439zi/src/hal_bsp.c
@@ -172,19 +172,6 @@ static const struct hal_bsp_mem_dump dump_cfg[] = {
}
};
-extern const struct hal_flash stm32_flash_dev;
-const struct hal_flash *
-hal_bsp_flash_dev(uint8_t id)
-{
- /*
- * Internal flash mapped to id 0.
- */
- if (id != 0) {
- return NULL;
- }
- return &stm32_flash_dev;
-}
-
const struct hal_bsp_mem_dump *
hal_bsp_core_dump(int *area_cnt)
{
diff --git a/hw/bsp/nucleo-f746zg/src/hal_bsp.c b/hw/bsp/nucleo-f746zg/src/hal_bsp.c
index 826a73bc9..e7118eb4d 100644
--- a/hw/bsp/nucleo-f746zg/src/hal_bsp.c
+++ b/hw/bsp/nucleo-f746zg/src/hal_bsp.c
@@ -157,19 +157,6 @@ static const struct hal_bsp_mem_dump dump_cfg[] = {
},
};
-extern const struct hal_flash stm32_flash_dev;
-const struct hal_flash *
-hal_bsp_flash_dev(uint8_t id)
-{
- /*
- * Internal flash mapped to id 0.
- */
- if (id != 0) {
- return NULL;
- }
- return &stm32_flash_dev;
-}
-
const struct hal_bsp_mem_dump *
hal_bsp_core_dump(int *area_cnt)
{
diff --git a/hw/bsp/nucleo-f767zi/src/hal_bsp.c b/hw/bsp/nucleo-f767zi/src/hal_bsp.c
index 7c9d92a12..9f031100d 100644
--- a/hw/bsp/nucleo-f767zi/src/hal_bsp.c
+++ b/hw/bsp/nucleo-f767zi/src/hal_bsp.c
@@ -201,19 +201,6 @@ static const struct hal_bsp_mem_dump dump_cfg[] = {
},
};
-extern const struct hal_flash stm32_flash_dev;
-const struct hal_flash *
-hal_bsp_flash_dev(uint8_t id)
-{
- /*
- * Internal flash mapped to id 0.
- */
- if (id != 0) {
- return NULL;
- }
- return &stm32_flash_dev;
-}
-
const struct hal_bsp_mem_dump *
hal_bsp_core_dump(int *area_cnt)
{
diff --git a/hw/bsp/nucleo-g0b1re/src/hal_bsp.c b/hw/bsp/nucleo-g0b1re/src/hal_bsp.c
index 3c3443e83..07391f1a3 100644
--- a/hw/bsp/nucleo-g0b1re/src/hal_bsp.c
+++ b/hw/bsp/nucleo-g0b1re/src/hal_bsp.c
@@ -21,7 +21,6 @@
#include "bsp/bsp.h"
#include "os/mynewt.h"
#include "mynewt_cm.h"
-#include "spiflash/spiflash.h"
#include <hal/hal_bsp.h>
#include <hal/hal_flash_int.h>
@@ -33,10 +32,6 @@
#include <bus/drivers/spi_common.h>
#endif
-#if MYNEWT_PKG_apache_mynewt_core__hw_drivers_flash_fs_flash
-#include <fs_flash/fs_flash.h>
-#endif
-
#if MYNEWT_VAL(PWM_0) || MYNEWT_VAL(PWM_1) || MYNEWT_VAL(PWM_2)
#include <pwm_stm32/pwm_stm32.h>
#endif
@@ -196,28 +191,6 @@ static const struct hal_bsp_mem_dump dump_cfg[] = {
},
};
-extern const struct hal_flash stm32_flash_dev;
-
-static const struct hal_flash *flash_devs[] = {
- [0] = &stm32_flash_dev,
-#if MYNEWT_VAL(SPIFLASH)
- [1] = &spiflash_dev.hal,
-#endif
-#if MYNEWT_PKG_apache_mynewt_core__hw_drivers_flash_fs_flash
- [2] = &fs_flash_dev.hal,
-#endif
-};
-
-const struct hal_flash *
-hal_bsp_flash_dev(uint8_t id)
-{
- if (id >= ARRAY_SIZE(flash_devs)) {
- return NULL;
- }
-
- return flash_devs[id];
-}
-
const struct hal_bsp_mem_dump *
hal_bsp_core_dump(int *area_cnt)
{
diff --git a/hw/bsp/nucleo-g491re/src/hal_bsp.c b/hw/bsp/nucleo-g491re/src/hal_bsp.c
index 98b20f437..822ffaaa2 100644
--- a/hw/bsp/nucleo-g491re/src/hal_bsp.c
+++ b/hw/bsp/nucleo-g491re/src/hal_bsp.c
@@ -21,7 +21,6 @@
#include "bsp/bsp.h"
#include "os/mynewt.h"
#include "mynewt_cm.h"
-#include "spiflash/spiflash.h"
#include <hal/hal_bsp.h>
#include <hal/hal_flash_int.h>
@@ -33,10 +32,6 @@
#include <bus/drivers/spi_common.h>
#endif
-#if MYNEWT_PKG_apache_mynewt_core__hw_drivers_flash_fs_flash
-#include <fs_flash/fs_flash.h>
-#endif
-
#if MYNEWT_VAL(PWM_0) || MYNEWT_VAL(PWM_1) || MYNEWT_VAL(PWM_2)
#include <pwm_stm32/pwm_stm32.h>
#endif
@@ -153,28 +148,6 @@ static const struct hal_bsp_mem_dump dump_cfg[] = {
},
};
-extern const struct hal_flash stm32_flash_dev;
-
-static const struct hal_flash *flash_devs[] = {
- [0] = &stm32_flash_dev,
-#if MYNEWT_VAL(SPIFLASH)
- [1] = &spiflash_dev.hal,
-#endif
-#if MYNEWT_PKG_apache_mynewt_core__hw_drivers_flash_fs_flash
- [2] = &fs_flash_dev.hal,
-#endif
-};
-
-const struct hal_flash *
-hal_bsp_flash_dev(uint8_t id)
-{
- if (id >= ARRAY_SIZE(flash_devs)) {
- return NULL;
- }
-
- return flash_devs[id];
-}
-
const struct hal_bsp_mem_dump *
hal_bsp_core_dump(int *area_cnt)
{
diff --git a/hw/bsp/nucleo-h563zi/src/hal_bsp.c b/hw/bsp/nucleo-h563zi/src/hal_bsp.c
index a5fbc7435..e3ca6d61a 100644
--- a/hw/bsp/nucleo-h563zi/src/hal_bsp.c
+++ b/hw/bsp/nucleo-h563zi/src/hal_bsp.c
@@ -29,10 +29,6 @@
#include <stm32h5xx.h>
#include <stm32_common/stm32_hal.h>
-#if MYNEWT_VAL(SPIFLASH)
-#include <spiflash/spiflash.h>
-#endif
-
#if MYNEWT_VAL(ETH_0)
#include <stm32_eth/stm32_eth.h>
#include <stm32_eth/stm32_eth_cfg.h>
@@ -203,25 +199,6 @@ static const struct hal_bsp_mem_dump dump_cfg[] = {
},
};
-extern const struct hal_flash stm32_flash_dev;
-
-static const struct hal_flash *flash_devs[] = {
- [0] = &stm32_flash_dev,
-#if MYNEWT_VAL(SPIFLASH)
- [1] = &spiflash_dev.hal,
-#endif
-};
-
-const struct hal_flash *
-hal_bsp_flash_dev(uint8_t id)
-{
- if (id >= ARRAY_SIZE(flash_devs)) {
- return NULL;
- }
-
- return flash_devs[id];
-}
-
const struct hal_bsp_mem_dump *
hal_bsp_core_dump(int *area_cnt)
{
diff --git a/hw/bsp/nucleo-h723zg/src/hal_bsp.c b/hw/bsp/nucleo-h723zg/src/hal_bsp.c
index 78b16d56f..1e177a718 100644
--- a/hw/bsp/nucleo-h723zg/src/hal_bsp.c
+++ b/hw/bsp/nucleo-h723zg/src/hal_bsp.c
@@ -21,7 +21,6 @@
#include "bsp/bsp.h"
#include "os/mynewt.h"
#include "mynewt_cm.h"
-#include "spiflash/spiflash.h"
#include <hal/hal_bsp.h>
#include <hal/hal_flash_int.h>
@@ -183,25 +182,6 @@ static const struct hal_bsp_mem_dump dump_cfg[] = {
},
};
-extern const struct hal_flash stm32_flash_dev;
-
-static const struct hal_flash *flash_devs[] = {
- [0] = &stm32_flash_dev,
-#if MYNEWT_VAL(SPIFLASH)
- [1] = &spiflash_dev.hal,
-#endif
-};
-
-const struct hal_flash *
-hal_bsp_flash_dev(uint8_t id)
-{
- if (id >= ARRAY_SIZE(flash_devs)) {
- return NULL;
- }
-
- return flash_devs[id];
-}
-
const struct hal_bsp_mem_dump *
hal_bsp_core_dump(int *area_cnt)
{
diff --git a/hw/bsp/nucleo-h753zi/src/hal_bsp.c b/hw/bsp/nucleo-h753zi/src/hal_bsp.c
index 1d3275637..11bf71178 100644
--- a/hw/bsp/nucleo-h753zi/src/hal_bsp.c
+++ b/hw/bsp/nucleo-h753zi/src/hal_bsp.c
@@ -21,7 +21,6 @@
#include "bsp/bsp.h"
#include "os/mynewt.h"
#include "mynewt_cm.h"
-#include "spiflash/spiflash.h"
#include <hal/hal_bsp.h>
#include <hal/hal_flash_int.h>
@@ -182,18 +181,6 @@ static const struct hal_bsp_mem_dump dump_cfg[] = {
},
};
-extern const struct hal_flash stm32_flash_dev;
-
-const struct hal_flash *
-hal_bsp_flash_dev(uint8_t id)
-{
- if (id != 0) {
- return NULL;
- }
-
- return &stm32_flash_dev;
-}
-
const struct hal_bsp_mem_dump *
hal_bsp_core_dump(int *area_cnt)
{
diff --git a/hw/bsp/nucleo-l073rz/src/hal_bsp.c b/hw/bsp/nucleo-l073rz/src/hal_bsp.c
index 80c4dbd90..5299fe97f 100644
--- a/hw/bsp/nucleo-l073rz/src/hal_bsp.c
+++ b/hw/bsp/nucleo-l073rz/src/hal_bsp.c
@@ -29,10 +29,6 @@
#include <stm32l073xx.h>
#include <stm32_common/stm32_hal.h>
-#if MYNEWT_VAL(SPIFLASH)
-#include <spiflash/spiflash.h>
-#endif
-
#if MYNEWT_VAL(PWM_0) || MYNEWT_VAL(PWM_1) || MYNEWT_VAL(PWM_2)
#include <pwm_stm32/pwm_stm32.h>
#endif
@@ -111,7 +107,6 @@ static const struct hal_bsp_mem_dump dump_cfg[] = {
},
};
-extern const struct hal_flash stm32_flash_dev;
#if MYNEWT_VAL(SPIFLASH)
#if MYNEWT_VAL(BUS_DRIVER_PRESENT)
struct bus_spi_node_cfg flash_spi_cfg = {
@@ -124,22 +119,6 @@ struct bus_spi_node_cfg flash_spi_cfg = {
#endif
#endif
-static const struct hal_flash *flash_devs[] = {
- [0] = &stm32_flash_dev,
-#if MYNEWT_VAL(SPIFLASH)
- [1] = &spiflash_dev.hal,
-#endif
-};
-
-const struct hal_flash *
-hal_bsp_flash_dev(uint8_t id)
-{
- if (id >= ARRAY_SIZE(flash_devs)) {
- return NULL;
- }
-
- return flash_devs[id];
-}
const struct hal_bsp_mem_dump *
hal_bsp_core_dump(int *area_cnt)
{
diff --git a/hw/bsp/nucleo-l476rg/src/hal_bsp.c b/hw/bsp/nucleo-l476rg/src/hal_bsp.c
index 9020ccb2c..a62b8ea48 100644
--- a/hw/bsp/nucleo-l476rg/src/hal_bsp.c
+++ b/hw/bsp/nucleo-l476rg/src/hal_bsp.c
@@ -119,19 +119,6 @@ static const struct hal_bsp_mem_dump dump_cfg[] = {
},
};
-extern const struct hal_flash stm32_flash_dev;
-const struct hal_flash *
-hal_bsp_flash_dev(uint8_t id)
-{
- /*
- * Internal flash mapped to id 0.
- */
- if (id != 0) {
- return NULL;
- }
- return &stm32_flash_dev;
-}
-
const struct hal_bsp_mem_dump *
hal_bsp_core_dump(int *area_cnt)
{
diff --git a/hw/bsp/nucleo-u575zi-q/src/hal_bsp.c b/hw/bsp/nucleo-u575zi-q/src/hal_bsp.c
index 06153b595..bf9e5f7a7 100644
--- a/hw/bsp/nucleo-u575zi-q/src/hal_bsp.c
+++ b/hw/bsp/nucleo-u575zi-q/src/hal_bsp.c
@@ -21,7 +21,6 @@
#include "bsp/bsp.h"
#include "os/mynewt.h"
#include "mynewt_cm.h"
-#include "spiflash/spiflash.h"
#include <hal/hal_bsp.h>
#include <hal/hal_flash_int.h>
@@ -148,25 +147,6 @@ static const struct hal_bsp_mem_dump dump_cfg[] = {
},
};
-extern const struct hal_flash stm32_flash_dev;
-
-static const struct hal_flash *flash_devs[] = {
- [0] = &stm32_flash_dev,
-#if MYNEWT_VAL(SPIFLASH)
- [1] = &spiflash_dev.hal,
-#endif
-};
-
-const struct hal_flash *
-hal_bsp_flash_dev(uint8_t id)
-{
- if (id >= ARRAY_SIZE(flash_devs)) {
- return NULL;
- }
-
- return flash_devs[id];
-}
-
const struct hal_bsp_mem_dump *
hal_bsp_core_dump(int *area_cnt)
{
diff --git a/hw/bsp/olimex-p103/src/hal_bsp.c b/hw/bsp/olimex-p103/src/hal_bsp.c
index 91336da09..2543c48d3 100644
--- a/hw/bsp/olimex-p103/src/hal_bsp.c
+++ b/hw/bsp/olimex-p103/src/hal_bsp.c
@@ -67,19 +67,6 @@ static const struct hal_bsp_mem_dump dump_cfg[] = {
},
};
-extern const struct hal_flash stm32_flash_dev;
-const struct hal_flash *
-hal_bsp_flash_dev(uint8_t id)
-{
- /*
- * Internal flash mapped to id 0.
- */
- if (id != 0) {
- return NULL;
- }
- return &stm32_flash_dev;
-}
-
const struct hal_bsp_mem_dump *
hal_bsp_core_dump(int *area_cnt)
{
diff --git a/hw/bsp/olimex-pic32-emz64/src/hal_bsp.c b/hw/bsp/olimex-pic32-emz64/src/hal_bsp.c
index 2d2812d0b..fc369f54a 100644
--- a/hw/bsp/olimex-pic32-emz64/src/hal_bsp.c
+++ b/hw/bsp/olimex-pic32-emz64/src/hal_bsp.c
@@ -108,23 +108,6 @@ struct bus_spi_node_cfg flash_spi_cfg = {
#endif
#endif
-static const struct hal_flash *flash_devs[] = {
- [0] = &pic32mz_flash_dev,
-#if MYNEWT_VAL(SPIFLASH)
- [1] = &spiflash_dev.hal,
-#endif
-};
-
-const struct hal_flash *
-hal_bsp_flash_dev(uint8_t id)
-{
- if (id >= ARRAY_SIZE(flash_devs)) {
- return NULL;
- }
-
- return flash_devs[id];
-}
-
void
hal_bsp_init(void)
{
diff --git a/hw/bsp/olimex-pic32-hmz144/src/hal_bsp.c b/hw/bsp/olimex-pic32-hmz144/src/hal_bsp.c
index dcf57182a..d35a25845 100644
--- a/hw/bsp/olimex-pic32-hmz144/src/hal_bsp.c
+++ b/hw/bsp/olimex-pic32-hmz144/src/hal_bsp.c
@@ -107,23 +107,6 @@ struct bus_spi_node_cfg flash_spi_cfg = {
#endif
#endif
-static const struct hal_flash *flash_devs[] = {
- [0] = &pic32mz_flash_dev,
-#if MYNEWT_VAL(SPIFLASH)
- [1] = &spiflash_dev.hal,
-#endif
-};
-
-const struct hal_flash *
-hal_bsp_flash_dev(uint8_t id)
-{
- if (id >= ARRAY_SIZE(flash_devs)) {
- return NULL;
- }
-
- return flash_devs[id];
-}
-
void
hal_bsp_init(void)
{
diff --git a/hw/bsp/olimex_stm32-e407_devboard/src/hal_bsp.c b/hw/bsp/olimex_stm32-e407_devboard/src/hal_bsp.c
index 02cd545d1..b17260ab8 100644
--- a/hw/bsp/olimex_stm32-e407_devboard/src/hal_bsp.c
+++ b/hw/bsp/olimex_stm32-e407_devboard/src/hal_bsp.c
@@ -259,19 +259,6 @@ static const struct hal_bsp_mem_dump dump_cfg[] = {
}
};
-extern const struct hal_flash stm32_flash_dev;
-const struct hal_flash *
-hal_bsp_flash_dev(uint8_t id)
-{
- /*
- * Internal flash mapped to id 0.
- */
- if (id != 0) {
- return NULL;
- }
- return &stm32_flash_dev;
-}
-
const struct hal_bsp_mem_dump *
hal_bsp_core_dump(int *area_cnt)
{
diff --git a/hw/bsp/p-nucleo-wb55-usbdongle/src/hal_bsp.c b/hw/bsp/p-nucleo-wb55-usbdongle/src/hal_bsp.c
index 13db4f60e..5242d5fc6 100644
--- a/hw/bsp/p-nucleo-wb55-usbdongle/src/hal_bsp.c
+++ b/hw/bsp/p-nucleo-wb55-usbdongle/src/hal_bsp.c
@@ -67,19 +67,6 @@ static const struct hal_bsp_mem_dump dump_cfg[] = {
},
};
-extern const struct hal_flash stm32_flash_dev;
-const struct hal_flash *
-hal_bsp_flash_dev(uint8_t id)
-{
- /*
- * Internal flash mapped to id 0.
- */
- if (id != 0) {
- return NULL;
- }
- return &stm32_flash_dev;
-}
-
const struct hal_bsp_mem_dump *
hal_bsp_core_dump(int *area_cnt)
{
diff --git a/hw/bsp/p-nucleo-wb55/src/hal_bsp.c b/hw/bsp/p-nucleo-wb55/src/hal_bsp.c
index 8c2caaf08..0ca7bf780 100644
--- a/hw/bsp/p-nucleo-wb55/src/hal_bsp.c
+++ b/hw/bsp/p-nucleo-wb55/src/hal_bsp.c
@@ -67,19 +67,6 @@ static const struct hal_bsp_mem_dump dump_cfg[] = {
},
};
-extern const struct hal_flash stm32_flash_dev;
-const struct hal_flash *
-hal_bsp_flash_dev(uint8_t id)
-{
- /*
- * Internal flash mapped to id 0.
- */
- if (id != 0) {
- return NULL;
- }
- return &stm32_flash_dev;
-}
-
const struct hal_bsp_mem_dump *
hal_bsp_core_dump(int *area_cnt)
{
diff --git a/hw/bsp/pinetime/src/hal_bsp.c b/hw/bsp/pinetime/src/hal_bsp.c
index b4951dc2a..73026c0eb 100644
--- a/hw/bsp/pinetime/src/hal_bsp.c
+++ b/hw/bsp/pinetime/src/hal_bsp.c
@@ -69,27 +69,10 @@ struct bus_spi_node_cfg flash_spi_cfg = {
#endif
#endif
-static const struct hal_flash *flash_devs[] = {
- /* MCU internal flash. */
- [0] = &nrf_flash_dev,
-#if MYNEWT_VAL(SPIFLASH)
- /* External SPI Flash. */
- [1] = &spiflash_dev.hal,
-#endif
-};
-
/**
* Retrieves the flash device with the specified ID. Returns NULL if no such
* device exists.
*/
-const struct hal_flash *
-hal_bsp_flash_dev(uint8_t id)
-{
- if (id >= ARRAY_SIZE(flash_devs)) {
- return NULL;
- }
- return flash_devs[id];
-}
/**
* Retrieves the configured priority for the given interrupt. If no priority
diff --git a/hw/bsp/puckjs/src/hal_bsp.c b/hw/bsp/puckjs/src/hal_bsp.c
index 0284e47da..3895068d9 100644
--- a/hw/bsp/puckjs/src/hal_bsp.c
+++ b/hw/bsp/puckjs/src/hal_bsp.c
@@ -44,18 +44,6 @@ static const struct hal_bsp_mem_dump dump_cfg[] = {
}
};
-const struct hal_flash *
-hal_bsp_flash_dev(uint8_t id)
-{
- /*
- * Internal flash mapped to id 0.
- */
- if (id != 0) {
- return NULL;
- }
- return &nrf_flash_dev;
-}
-
const struct hal_bsp_mem_dump *
hal_bsp_core_dump(int *area_cnt)
{
diff --git a/hw/bsp/rb-blend2/src/hal_bsp.c b/hw/bsp/rb-blend2/src/hal_bsp.c
index 8977012ab..366b67e41 100644
--- a/hw/bsp/rb-blend2/src/hal_bsp.c
+++ b/hw/bsp/rb-blend2/src/hal_bsp.c
@@ -43,18 +43,6 @@ static const struct hal_bsp_mem_dump dump_cfg[] = {
}
};
-const struct hal_flash *
-hal_bsp_flash_dev(uint8_t id)
-{
- /*
- * Internal flash mapped to id 0.
- */
- if (id != 0) {
- return NULL;
- }
- return &nrf_flash_dev;
-}
-
const struct hal_bsp_mem_dump *
hal_bsp_core_dump(int *area_cnt)
{
diff --git a/hw/bsp/rb-nano2/src/hal_bsp.c b/hw/bsp/rb-nano2/src/hal_bsp.c
index 051f88962..4c5d8e7e3 100644
--- a/hw/bsp/rb-nano2/src/hal_bsp.c
+++ b/hw/bsp/rb-nano2/src/hal_bsp.c
@@ -42,18 +42,6 @@ static const struct hal_bsp_mem_dump dump_cfg[] = {
}
};
-const struct hal_flash *
-hal_bsp_flash_dev(uint8_t id)
-{
- /*
- * Internal flash mapped to id 0.
- */
- if (id != 0) {
- return NULL;
- }
- return &nrf_flash_dev;
-}
-
const struct hal_bsp_mem_dump *
hal_bsp_core_dump(int *area_cnt)
{
diff --git a/hw/bsp/reel_board/src/hal_bsp.c b/hw/bsp/reel_board/src/hal_bsp.c
index 2ca4fdefe..f5cc2f042 100644
--- a/hw/bsp/reel_board/src/hal_bsp.c
+++ b/hw/bsp/reel_board/src/hal_bsp.c
@@ -40,16 +40,6 @@ static const struct hal_bsp_mem_dump hal_bsp_core_dump_cfg[] = {
}
};
-const struct hal_flash *
-hal_bsp_flash_dev(uint8_t id)
-{
- if (id == 0) {
- return &nrf_flash_dev;
- }
-
- return NULL;
-}
-
const struct hal_bsp_mem_dump *
hal_bsp_core_dump(int *area_cnt)
{
diff --git a/hw/bsp/ruuvitag_rev_b/src/hal_bsp.c b/hw/bsp/ruuvitag_rev_b/src/hal_bsp.c
index 9dfb147eb..71c9cfd90 100644
--- a/hw/bsp/ruuvitag_rev_b/src/hal_bsp.c
+++ b/hw/bsp/ruuvitag_rev_b/src/hal_bsp.c
@@ -69,19 +69,6 @@ static const struct hal_bsp_mem_dump dump_cfg[] = {
}
};
-const struct hal_flash *
-hal_bsp_flash_dev(uint8_t id)
-{
- /*
- * Internal flash mapped to id 0.
- */
- if (id == 0) {
- return &nrf_flash_dev;
- }
-
- return NULL;
-}
-
const struct hal_bsp_mem_dump *
hal_bsp_core_dump(int *area_cnt)
{
diff --git a/hw/bsp/stm32f3discovery/src/hal_bsp.c b/hw/bsp/stm32f3discovery/src/hal_bsp.c
index eee167cfd..f353bad67 100644
--- a/hw/bsp/stm32f3discovery/src/hal_bsp.c
+++ b/hw/bsp/stm32f3discovery/src/hal_bsp.c
@@ -80,19 +80,6 @@ static const struct hal_bsp_mem_dump dump_cfg[] = {
}
};
-extern const struct hal_flash stm32_flash_dev;
-const struct hal_flash *
-hal_bsp_flash_dev(uint8_t id)
-{
- /*
- * Internal flash mapped to id 0.
- */
- if (id != 0) {
- return NULL;
- }
- return &stm32_flash_dev;
-}
-
const struct hal_bsp_mem_dump *
hal_bsp_core_dump(int *area_cnt)
{
diff --git a/hw/bsp/stm32f411discovery/src/hal_bsp.c b/hw/bsp/stm32f411discovery/src/hal_bsp.c
index 14fde03b1..5a500ae49 100644
--- a/hw/bsp/stm32f411discovery/src/hal_bsp.c
+++ b/hw/bsp/stm32f411discovery/src/hal_bsp.c
@@ -143,19 +143,6 @@ const struct stm32_hal_i2c_cfg os_bsp_i2c2_cfg = {
};
#endif
-extern const struct hal_flash stm32_flash_dev;
-const struct hal_flash *
-hal_bsp_flash_dev(uint8_t id)
-{
- /*
- * Internal flash mapped to id 0.
- */
- if (id != 0) {
- return NULL;
- }
- return &stm32_flash_dev;
-}
-
const struct hal_bsp_mem_dump *
hal_bsp_core_dump(int *area_cnt)
{
diff --git a/hw/bsp/stm32f429discovery/src/hal_bsp.c b/hw/bsp/stm32f429discovery/src/hal_bsp.c
index 638e5f792..e4865cb2c 100644
--- a/hw/bsp/stm32f429discovery/src/hal_bsp.c
+++ b/hw/bsp/stm32f429discovery/src/hal_bsp.c
@@ -98,19 +98,6 @@ static const struct hal_bsp_mem_dump dump_cfg[] = {
}
};
-extern const struct hal_flash stm32_flash_dev;
-const struct hal_flash *
-hal_bsp_flash_dev(uint8_t id)
-{
- /*
- * Internal flash mapped to id 0.
- */
- if (id != 0) {
- return NULL;
- }
- return &stm32_flash_dev;
-}
-
const struct hal_bsp_mem_dump *
hal_bsp_core_dump(int *area_cnt)
{
diff --git a/hw/bsp/stm32f4discovery/src/hal_bsp.c b/hw/bsp/stm32f4discovery/src/hal_bsp.c
index 3741c7ec2..73ddb4a0f 100644
--- a/hw/bsp/stm32f4discovery/src/hal_bsp.c
+++ b/hw/bsp/stm32f4discovery/src/hal_bsp.c
@@ -116,19 +116,6 @@ static const struct hal_bsp_mem_dump dump_cfg[] = {
}
};
-extern const struct hal_flash stm32_flash_dev;
-const struct hal_flash *
-hal_bsp_flash_dev(uint8_t id)
-{
- /*
- * Internal flash mapped to id 0.
- */
- if (id != 0) {
- return NULL;
- }
- return &stm32_flash_dev;
-}
-
const struct hal_bsp_mem_dump *
hal_bsp_core_dump(int *area_cnt)
{
diff --git a/hw/bsp/stm32f7discovery/src/hal_bsp.c b/hw/bsp/stm32f7discovery/src/hal_bsp.c
index f0954f535..e197f33ed 100644
--- a/hw/bsp/stm32f7discovery/src/hal_bsp.c
+++ b/hw/bsp/stm32f7discovery/src/hal_bsp.c
@@ -184,22 +184,6 @@ static const struct hal_bsp_mem_dump dump_cfg[] = {
},
};
-extern const struct hal_flash stm32_flash_dev;
-const struct hal_flash *
-hal_bsp_flash_dev(uint8_t id)
-{
- /*
- * Internal flash mapped to id 0.
- */
- if (id == 0) {
- return &stm32_flash_dev;
- }
- if (id == 1) {
- return qspi_flash_0;
- }
- return NULL;
-}
-
const struct hal_bsp_mem_dump *
hal_bsp_core_dump(int *area_cnt)
{
diff --git a/hw/bsp/stm32l152discovery/src/hal_bsp.c b/hw/bsp/stm32l152discovery/src/hal_bsp.c
index 505580ae8..c1fd1580c 100644
--- a/hw/bsp/stm32l152discovery/src/hal_bsp.c
+++ b/hw/bsp/stm32l152discovery/src/hal_bsp.c
@@ -67,19 +67,6 @@ static const struct hal_bsp_mem_dump dump_cfg[] = {
},
};
-extern const struct hal_flash stm32_flash_dev;
-const struct hal_flash *
-hal_bsp_flash_dev(uint8_t id)
-{
- /*
- * Internal flash mapped to id 0.
- */
- if (id != 0) {
- return NULL;
- }
- return &stm32_flash_dev;
-}
-
const struct hal_bsp_mem_dump *
hal_bsp_core_dump(int *area_cnt)
{
diff --git a/hw/bsp/telee02/src/hal_bsp.c b/hw/bsp/telee02/src/hal_bsp.c
index ecabcd3bf..bc2d971ed 100644
--- a/hw/bsp/telee02/src/hal_bsp.c
+++ b/hw/bsp/telee02/src/hal_bsp.c
@@ -45,18 +45,6 @@ static const struct hal_bsp_mem_dump dump_cfg[] = {
}
};
-const struct hal_flash *
-hal_bsp_flash_dev(uint8_t id)
-{
- /*
- * Internal flash mapped to id 0.
- */
- if (id != 0) {
- return NULL;
- }
- return &nrf_flash_dev;
-}
-
const struct hal_bsp_mem_dump *
hal_bsp_core_dump(int *area_cnt)
{
diff --git a/hw/bsp/ublox_bmd_345/src/hal_bsp.c b/hw/bsp/ublox_bmd_345/src/hal_bsp.c
index 09f3b8455..57adb6c17 100644
--- a/hw/bsp/ublox_bmd_345/src/hal_bsp.c
+++ b/hw/bsp/ublox_bmd_345/src/hal_bsp.c
@@ -42,23 +42,6 @@ static const struct hal_bsp_mem_dump dump_cfg[] = {
}
};
-const struct hal_flash *
-hal_bsp_flash_dev(uint8_t id)
-{
- /*
- * Internal flash mapped to id 0.
- */
- if (id == 0) {
- return &nrf_flash_dev;
- }
-#if MYNEWT_VAL(QSPI_ENABLE)
- if (id == 1) {
- return &nrf_qspi_dev;
- }
-#endif
- return NULL;
-}
-
const struct hal_bsp_mem_dump *
hal_bsp_core_dump(int *area_cnt)
{
diff --git a/hw/bsp/ublox_mini_nora_b1/net/src/hal_bsp.c b/hw/bsp/ublox_mini_nora_b1/net/src/hal_bsp.c
index 2f5a7bc76..65f277660 100644
--- a/hw/bsp/ublox_mini_nora_b1/net/src/hal_bsp.c
+++ b/hw/bsp/ublox_mini_nora_b1/net/src/hal_bsp.c
@@ -48,29 +48,6 @@ extern uint8_t __StackLimit;
extern uint8_t __StackTop;
#endif
-const struct hal_flash *
-hal_bsp_flash_dev(uint8_t id)
-{
- /*
- * Internal flash mapped to id 0.
- */
- if (id == 0) {
- return &nrf_flash_dev;
- }
-#if MCUBOOT_MYNEWT
- if (id == 1) {
- return &nrf5340_net_vflash_dev.nv_flash;
- }
-#endif
-#if MYNEWT_VAL(IPC_NRF5340_FLASH_CLIENT)
- if (id == 2) {
- return ipc_flash();
- }
-#endif
-
- return NULL;
-}
-
const struct hal_bsp_mem_dump *
hal_bsp_core_dump(int *area_cnt)
{
diff --git a/hw/bsp/ublox_mini_nora_b1/src/hal_bsp.c b/hw/bsp/ublox_mini_nora_b1/src/hal_bsp.c
index 00670827b..f6cf26f04 100644
--- a/hw/bsp/ublox_mini_nora_b1/src/hal_bsp.c
+++ b/hw/bsp/ublox_mini_nora_b1/src/hal_bsp.c
@@ -47,30 +47,6 @@ extern uint8_t __StackLimit;
extern uint8_t __StackTop;
#endif
-const struct hal_flash *
-hal_bsp_flash_dev(uint8_t id)
-{
- /*
- * Internal flash mapped to id 0.
- */
- if (id == 0) {
- return &nrf_flash_dev;
- }
-#if MYNEWT_VAL(QSPI_ENABLE)
- if (id == 1) {
- return &nrf_qspi_dev;
- }
-#endif
-#if MYNEWT_VAL(IPC_NRF5340_FLASH_CLIENT)
- _Static_assert(2 < MYNEWT_VAL(HAL_FLASH_MAX_DEVICE_COUNT) || MYNEWT_VAL(QSPI_ENABLE),
- "HAL_FLASH_MAX_DEVICE_COUNT must be set to 3 when QSPI_ENABLE is 0");
- if (id == 2) {
- return ipc_flash();
- }
-#endif
- return NULL;
-}
-
const struct hal_bsp_mem_dump *
hal_bsp_core_dump(int *area_cnt)
{
diff --git a/hw/bsp/ublox_mini_nora_b1/syscfg.yml b/hw/bsp/ublox_mini_nora_b1/syscfg.yml
index 99abba6dc..c287d086c 100644
--- a/hw/bsp/ublox_mini_nora_b1/syscfg.yml
+++ b/hw/bsp/ublox_mini_nora_b1/syscfg.yml
@@ -124,8 +124,6 @@ syscfg.vals.BSP_NRF5340_NET_ENABLE:
syscfg.vals.BSP_NRF5340_NET_FLASH_ENABLE:
IPC_NRF5340_CHANNELS: 4
-syscfg.vals.IPC_NRF5340_FLASH_CLIENT:
- HAL_FLASH_MAX_DEVICE_COUNT: 3
syscfg.restrictions.BSP_NRF5340_NET_FLASH_ENABLE:
- 'IPC_NRF5340_CHANNELS >= 4'
diff --git a/hw/bsp/usbmkw41z/src/hal_bsp.c b/hw/bsp/usbmkw41z/src/hal_bsp.c
index ac743407c..9b57e7198 100644
--- a/hw/bsp/usbmkw41z/src/hal_bsp.c
+++ b/hw/bsp/usbmkw41z/src/hal_bsp.c
@@ -36,18 +36,6 @@ static const struct hal_bsp_mem_dump dump_cfg[] = {
}
};
-const struct hal_flash *
-hal_bsp_flash_dev(uint8_t id)
-{
- /*
- * Internal flash mapped to id 0.
- */
- if (id != 0) {
- return NULL;
- }
- return NULL;
-}
-
const struct hal_bsp_mem_dump *
hal_bsp_core_dump(int *area_cnt)
{
diff --git a/hw/bsp/vbluno51/src/hal_bsp.c b/hw/bsp/vbluno51/src/hal_bsp.c
index 76b617ade..28f28733d 100644
--- a/hw/bsp/vbluno51/src/hal_bsp.c
+++ b/hw/bsp/vbluno51/src/hal_bsp.c
@@ -107,18 +107,6 @@ static const struct hal_bsp_mem_dump dump_cfg[] = {
}
};
-const struct hal_flash *
-hal_bsp_flash_dev(uint8_t id)
-{
- /*
- * Internal flash mapped to id 0.
- */
- if (id != 0) {
- return NULL;
- }
- return &nrf_flash_dev;
-}
-
const struct hal_bsp_mem_dump *
hal_bsp_core_dump(int *area_cnt)
{
diff --git a/hw/bsp/vbluno52/src/hal_bsp.c b/hw/bsp/vbluno52/src/hal_bsp.c
index 0284e47da..3895068d9 100644
--- a/hw/bsp/vbluno52/src/hal_bsp.c
+++ b/hw/bsp/vbluno52/src/hal_bsp.c
@@ -44,18 +44,6 @@ static const struct hal_bsp_mem_dump dump_cfg[] = {
}
};
-const struct hal_flash *
-hal_bsp_flash_dev(uint8_t id)
-{
- /*
- * Internal flash mapped to id 0.
- */
- if (id != 0) {
- return NULL;
- }
- return &nrf_flash_dev;
-}
-
const struct hal_bsp_mem_dump *
hal_bsp_core_dump(int *area_cnt)
{
diff --git a/hw/bsp/weact_g431cb/src/hal_bsp.c b/hw/bsp/weact_g431cb/src/hal_bsp.c
index e3329514a..39f94d36a 100644
--- a/hw/bsp/weact_g431cb/src/hal_bsp.c
+++ b/hw/bsp/weact_g431cb/src/hal_bsp.c
@@ -135,22 +135,6 @@ static const struct hal_bsp_mem_dump dump_cfg[] = {
},
};
-extern const struct hal_flash stm32_flash_dev;
-
-static const struct hal_flash *flash_devs[] = {
- [0] = &stm32_flash_dev,
-};
-
-const struct hal_flash *
-hal_bsp_flash_dev(uint8_t id)
-{
- if (id >= ARRAY_SIZE(flash_devs)) {
- return NULL;
- }
-
- return flash_devs[id];
-}
-
const struct hal_bsp_mem_dump *
hal_bsp_core_dump(int *area_cnt)
{
diff --git a/hw/bsp/weact_h503cb/src/hal_bsp.c b/hw/bsp/weact_h503cb/src/hal_bsp.c
index 4033ff15d..f65e9e496 100644
--- a/hw/bsp/weact_h503cb/src/hal_bsp.c
+++ b/hw/bsp/weact_h503cb/src/hal_bsp.c
@@ -29,7 +29,6 @@
#include <stm32h5xx.h>
#include <stm32_common/stm32_hal.h>
#include <bus/drivers/spi_common.h>
-#include <spiflash/spiflash.h>
#if MYNEWT_VAL(PWM_0)
#include <pwm_stm32/pwm_stm32.h>
@@ -115,25 +114,6 @@ static const struct hal_bsp_mem_dump dump_cfg[] = {
},
};
-extern const struct hal_flash stm32_flash_dev;
-
-static const struct hal_flash *flash_devs[] = {
- [0] = &stm32_flash_dev,
-#if MYNEWT_VAL(SPIFLASH)
- [1] = &spiflash_dev.hal,
-#endif
-};
-
-const struct hal_flash *
-hal_bsp_flash_dev(uint8_t id)
-{
- if (id >= ARRAY_SIZE(flash_devs)) {
- return NULL;
- }
-
- return flash_devs[id];
-}
-
const struct hal_bsp_mem_dump *
hal_bsp_core_dump(int *area_cnt)
{
diff --git a/hw/hal/syscfg.yml b/hw/hal/syscfg.yml
index 21324164f..c5cc8f8ba 100644
--- a/hw/hal/syscfg.yml
+++ b/hw/hal/syscfg.yml
@@ -53,7 +53,7 @@ syscfg.defs:
flash devices registered with HAL_FLASH_DEV() (hal_flash_devs
link table). Set to 0 when BSP provides its own
hal_bsp_flash_dev().
- value: 0
+ value: 1
HAL_FLASH_MAX_DEVICE_COUNT:
description: >
If set to zero, flash device ids have continues numbers 0,1,2,...