Skip to content

Commit 75a7cb6

Browse files
authored
[update] add fal component. (#5662)
* [update] add fal component. * [update] format code. * [update] change PKG_USING_FAL to RT_USING_FAL * [update] format code. * [update] fal * [update] delete FAL_SW_VERSION
1 parent 3b1445d commit 75a7cb6

File tree

67 files changed

+2775
-93
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+2775
-93
lines changed

bsp/at32/Libraries/rt_drivers/drv_flash.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
#ifdef BSP_USING_ON_CHIP_FLASH
1515
#include "drv_flash.h"
1616

17-
#if defined(PKG_USING_FAL)
17+
#if defined(RT_USING_FAL)
1818
#include "fal.h"
1919
#endif
2020

@@ -171,7 +171,7 @@ int at32_flash_erase(rt_uint32_t addr, size_t size)
171171
return size;
172172
}
173173

174-
#if defined(PKG_USING_FAL)
174+
#if defined(RT_USING_FAL)
175175

176176
static int fal_flash_read(long offset, rt_uint8_t *buf, size_t size);
177177
static int fal_flash_write(long offset, const rt_uint8_t *buf, size_t size);

bsp/bluetrum/libraries/hal_drivers/drv_flash.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@
1313

1414
#ifdef BSP_USING_ON_CHIP_FLASH
1515

16-
#if defined(PKG_USING_FAL)
16+
#if defined(RT_USING_FAL)
1717
#include "fal.h"
1818
#endif
1919

2020
//#define DRV_DEBUG
2121
#define LOG_TAG "drv.flash"
2222
#include <drv_log.h>
2323

24-
#if defined(PKG_USING_FAL)
24+
#if defined(RT_USING_FAL)
2525

2626
#define AB32_FLASH_START_ADDRESS 0x00000000
2727
#define AB32_FLASH_SIZE (1024 * 1024)

bsp/maxim/MAX32660_EVSYS/board/Kconfig

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ menu "On-chip Peripheral Drivers"
6363
endif
6464
endif
6565
config BSP_USING_ON_CHIP_FLASH
66-
select PKG_USING_FAL
66+
select RT_USING_FAL
6767
bool "Enable on-chip FLASH"
6868
default n
6969
config BSP_USING_I2C

bsp/mm32f327x/drivers/Kconfig

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ menu "Hardware Drivers Config"
2525
config OCFLASH_USE_FAL
2626
bool "Enable On Chip Flash FAL Driver"
2727
depends on BSP_USING_OCFLASH
28-
select PKG_USING_FAL
28+
select RT_USING_FAL
2929
default n
3030
config OCFLASH_USE_LFS
3131
bool "Enable On Chip Flash DFS Driver"

bsp/n32g452xx/Libraries/rt_drivers/drv_flash.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#ifdef BSP_USING_ON_CHIP_FLASH
1616
#include "drv_flash.h"
1717

18-
#if defined(PKG_USING_FAL)
18+
#if defined(RT_USING_FAL)
1919
#include "fal.h"
2020
#endif
2121

@@ -172,7 +172,7 @@ int n32_flash_erase(rt_uint32_t addr, size_t size)
172172
return size;
173173
}
174174

175-
#if defined(PKG_USING_FAL)
175+
#if defined(RT_USING_FAL)
176176

177177
static int fal_flash_read(long offset, rt_uint8_t *buf, size_t size);
178178
static int fal_flash_write(long offset, const rt_uint8_t *buf, size_t size);

bsp/nrf5x/libraries/drivers/drv_flash.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
#ifdef BSP_USING_ON_CHIP_FLASH
1616

17-
#if defined(PKG_USING_FAL)
17+
#if defined(RT_USING_FAL)
1818
#include "fal.h"
1919
#endif
2020

@@ -155,7 +155,7 @@ int mcu_flash_erase(rt_uint32_t addr, size_t size)
155155
return size;
156156
}
157157

158-
#if defined(PKG_USING_FAL)
158+
#if defined(RT_USING_FAL)
159159

160160
static int fal_flash_read(long offset, rt_uint8_t *buf, size_t size);
161161
static int fal_flash_write(long offset, const rt_uint8_t *buf, size_t size);

bsp/nrf5x/libraries/drivers/drv_qspi_flash.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#include <stdint.h>
1212
#include "board.h"
1313
#include "nrfx_qspi.h"
14-
#if defined(PKG_USING_FAL)
14+
#if defined(RT_USING_FAL)
1515
#include <fal.h>
1616

1717
//log

bsp/nrf5x/nrf52832/applications/mnt.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
#ifdef BSP_USING_ON_CHIP_FS
1616

17-
#ifndef PKG_USING_FAL
17+
#ifndef RT_USING_FAL
1818
#error "if you want to use on chip filesystem, you need to enable FAL package()"
1919
#endif
2020

bsp/nrf5x/nrf52832/board/Kconfig

+1-1
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ menu "On-chip Peripheral Drivers"
338338

339339
endif
340340
config BSP_USING_ON_CHIP_FLASH
341-
select PKG_USING_FAL
341+
select RT_USING_FAL
342342
bool "Enable on-chip FLASH"
343343
default n
344344

bsp/nrf5x/nrf52840/board/Kconfig

+2-2
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ menu "Onboard Peripheral Drivers"
3737

3838

3939
menuconfig BSP_USING_QSPI_FLASH
40-
select PKG_USING_FAL
40+
select RT_USING_FAL
4141
bool "Enable QSPI FLASH(MX25R64 8MB)"
4242
default n
4343
depends on BSP_BOARD_PCA_10056
@@ -378,7 +378,7 @@ menu "On-chip Peripheral Drivers"
378378

379379

380380
config BSP_USING_ON_CHIP_FLASH
381-
select PKG_USING_FAL
381+
select RT_USING_FAL
382382
bool "Enable on-chip FLASH"
383383
default n
384384

bsp/nuvoton/libraries/m031/rtt_port/Kconfig

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ config SOC_SERIES_M032
2828

2929
config BSP_USING_FMC
3030
bool "Enable Flash Memory Controller(FMC)"
31-
select PKG_USING_FAL
31+
select RT_USING_FAL
3232
default n
3333

3434
config BSP_USING_GPIO

bsp/nuvoton/libraries/m031/rtt_port/drv_fmc.c

+9-9
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
#include <rtdevice.h>
1717
#include "NuMicro.h"
1818

19-
#if defined(PKG_USING_FAL)
19+
#if defined(RT_USING_FAL)
2020
#include <fal.h>
2121
#endif
2222

@@ -31,15 +31,15 @@
3131

3232
/* Private functions ------------------------------------------------------------*/
3333
static int nu_fmc_init(void);
34-
#if defined(PKG_USING_FAL)
34+
#if defined(RT_USING_FAL)
3535
static int aprom_read(long offset, uint8_t *buf, size_t size);
3636
static int aprom_write(long offset, const uint8_t *buf, size_t size);
3737
static int aprom_erase(long offset, size_t size);
3838

3939
static int ldrom_read(long offset, uint8_t *buf, size_t size);
4040
static int ldrom_write(long offset, const uint8_t *buf, size_t size);
4141
static int ldrom_erase(long offset, size_t size);
42-
#endif /* PKG_USING_FAL */
42+
#endif /* RT_USING_FAL */
4343

4444
/* Public functions -------------------------------------------------------------*/
4545
int nu_fmc_read(long offset, uint8_t *buf, size_t size);
@@ -50,10 +50,10 @@ int nu_fmc_erase(long offset, size_t size);
5050
static rt_mutex_t g_mutex_fmc = RT_NULL;
5151

5252
/* Public variables -------------------------------------------------------------*/
53-
#if defined(PKG_USING_FAL)
53+
#if defined(RT_USING_FAL)
5454
const struct fal_flash_dev Onchip_aprom_flash = { "OnChip_APROM", FMC_APROM_BASE, FMC_APROM_END, FMC_FLASH_PAGE_SIZE, {NULL, aprom_read, aprom_write, aprom_erase} };
5555
const struct fal_flash_dev Onchip_ldrom_flash = { "OnChip_LDROM", FMC_LDROM_BASE, FMC_LDROM_END, FMC_FLASH_PAGE_SIZE, {NULL, ldrom_read, ldrom_write, ldrom_erase} };
56-
#endif /* PKG_USING_FAL */
56+
#endif /* RT_USING_FAL */
5757

5858
int nu_fmc_read(long addr, uint8_t *buf, size_t size)
5959
{
@@ -277,7 +277,7 @@ int nu_fmc_erase(long addr, size_t size)
277277
return erased_size;
278278
}
279279

280-
#if defined(PKG_USING_FAL)
280+
#if defined(RT_USING_FAL)
281281

282282
static int aprom_read(long offset, uint8_t *buf, size_t size)
283283
{
@@ -309,7 +309,7 @@ static int ldrom_erase(long offset, size_t size)
309309
return nu_fmc_erase(Onchip_ldrom_flash.addr + offset, size);
310310
}
311311

312-
#endif /* PKG_USING_FAL */
312+
#endif /* RT_USING_FAL */
313313

314314
static int nu_fmc_init(void)
315315
{
@@ -319,8 +319,8 @@ static int nu_fmc_init(void)
319319

320320
g_mutex_fmc = rt_mutex_create("nu_fmc_lock", RT_IPC_FLAG_PRIO);
321321

322-
/* PKG_USING_FAL */
323-
#if defined(PKG_USING_FAL)
322+
/* RT_USING_FAL */
323+
#if defined(RT_USING_FAL)
324324
fal_init();
325325
#endif
326326

bsp/nuvoton/libraries/m2354/rtt_port/Kconfig

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ config SOC_SERIES_M2354
2828

2929
config BSP_USING_FMC
3030
bool "Enable Flash Memory Controller(FMC)"
31-
select PKG_USING_FAL
31+
select RT_USING_FAL
3232
default n
3333

3434
config BSP_USING_GPIO

bsp/nuvoton/libraries/m2354/rtt_port/drv_fmc.c

+9-9
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
#include <rtdevice.h>
1717
#include "NuMicro.h"
1818

19-
#if defined(PKG_USING_FAL)
19+
#if defined(RT_USING_FAL)
2020
#include <fal.h>
2121
#endif
2222

@@ -28,15 +28,15 @@
2828

2929
/* Private functions ------------------------------------------------------------*/
3030
static int nu_fmc_init(void);
31-
#if defined(PKG_USING_FAL)
31+
#if defined(RT_USING_FAL)
3232
static int aprom_read(long offset, uint8_t *buf, size_t size);
3333
static int aprom_write(long offset, const uint8_t *buf, size_t size);
3434
static int aprom_erase(long offset, size_t size);
3535

3636
static int ldrom_read(long offset, uint8_t *buf, size_t size);
3737
static int ldrom_write(long offset, const uint8_t *buf, size_t size);
3838
static int ldrom_erase(long offset, size_t size);
39-
#endif /* PKG_USING_FAL */
39+
#endif /* RT_USING_FAL */
4040

4141
/* Public functions -------------------------------------------------------------*/
4242
int nu_fmc_read(long offset, uint8_t *buf, size_t size);
@@ -47,10 +47,10 @@ int nu_fmc_erase(long offset, size_t size);
4747
static rt_mutex_t g_mutex_fmc = RT_NULL;
4848

4949
/* Public variables -------------------------------------------------------------*/
50-
#if defined(PKG_USING_FAL)
50+
#if defined(RT_USING_FAL)
5151
const struct fal_flash_dev Onchip_aprom_flash = { "OnChip_APROM", FMC_APROM_BASE, FMC_APROM_END, FMC_FLASH_PAGE_SIZE, {NULL, aprom_read, aprom_write, aprom_erase} };
5252
const struct fal_flash_dev Onchip_ldrom_flash = { "OnChip_LDROM", FMC_LDROM_BASE, FMC_LDROM_END, FMC_FLASH_PAGE_SIZE, {NULL, ldrom_read, ldrom_write, ldrom_erase} };
53-
#endif /* PKG_USING_FAL */
53+
#endif /* RT_USING_FAL */
5454

5555
int nu_fmc_read(long addr, uint8_t *buf, size_t size)
5656
{
@@ -274,7 +274,7 @@ int nu_fmc_erase(long addr, size_t size)
274274
return erased_size;
275275
}
276276

277-
#if defined(PKG_USING_FAL)
277+
#if defined(RT_USING_FAL)
278278

279279
static int aprom_read(long offset, uint8_t *buf, size_t size)
280280
{
@@ -306,7 +306,7 @@ static int ldrom_erase(long offset, size_t size)
306306
return nu_fmc_erase(Onchip_ldrom_flash.addr + offset, size);
307307
}
308308

309-
#endif /* PKG_USING_FAL */
309+
#endif /* RT_USING_FAL */
310310

311311
static int nu_fmc_init(void)
312312
{
@@ -316,8 +316,8 @@ static int nu_fmc_init(void)
316316

317317
g_mutex_fmc = rt_mutex_create("nu_fmc_lock", RT_IPC_FLAG_PRIO);
318318

319-
/* PKG_USING_FAL */
320-
#if defined(PKG_USING_FAL)
319+
/* RT_USING_FAL */
320+
#if defined(RT_USING_FAL)
321321
fal_init();
322322
#endif
323323

bsp/nuvoton/libraries/m480/rtt_port/Kconfig

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ config SOC_SERIES_M480
2828

2929
config BSP_USING_FMC
3030
bool "Enable Flash Memory Controller(FMC)"
31-
select PKG_USING_FAL
31+
select RT_USING_FAL
3232
default n
3333

3434
config BSP_USING_GPIO

bsp/nuvoton/libraries/m480/rtt_port/drv_fmc.c

+9-9
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
#include <rtdevice.h>
1717
#include "NuMicro.h"
1818

19-
#if defined(PKG_USING_FAL)
19+
#if defined(RT_USING_FAL)
2020
#include <fal.h>
2121
#endif
2222

@@ -28,15 +28,15 @@
2828

2929
/* Private functions ------------------------------------------------------------*/
3030
static int nu_fmc_init(void);
31-
#if defined(PKG_USING_FAL)
31+
#if defined(RT_USING_FAL)
3232
static int aprom_read(long offset, uint8_t *buf, size_t size);
3333
static int aprom_write(long offset, const uint8_t *buf, size_t size);
3434
static int aprom_erase(long offset, size_t size);
3535

3636
static int ldrom_read(long offset, uint8_t *buf, size_t size);
3737
static int ldrom_write(long offset, const uint8_t *buf, size_t size);
3838
static int ldrom_erase(long offset, size_t size);
39-
#endif /* PKG_USING_FAL */
39+
#endif /* RT_USING_FAL */
4040

4141
/* Public functions -------------------------------------------------------------*/
4242
int nu_fmc_read(long offset, uint8_t *buf, size_t size);
@@ -47,10 +47,10 @@ int nu_fmc_erase(long offset, size_t size);
4747
static rt_mutex_t g_mutex_fmc = RT_NULL;
4848

4949
/* Public variables -------------------------------------------------------------*/
50-
#if defined(PKG_USING_FAL)
50+
#if defined(RT_USING_FAL)
5151
const struct fal_flash_dev Onchip_aprom_flash = { "OnChip_APROM", FMC_APROM_BASE, FMC_APROM_END, FMC_FLASH_PAGE_SIZE, {NULL, aprom_read, aprom_write, aprom_erase} };
5252
const struct fal_flash_dev Onchip_ldrom_flash = { "OnChip_LDROM", FMC_LDROM_BASE, FMC_LDROM_END, FMC_FLASH_PAGE_SIZE, {NULL, ldrom_read, ldrom_write, ldrom_erase} };
53-
#endif /* PKG_USING_FAL */
53+
#endif /* RT_USING_FAL */
5454

5555
int nu_fmc_read(long addr, uint8_t *buf, size_t size)
5656
{
@@ -291,7 +291,7 @@ int nu_fmc_erase(long addr, size_t size)
291291
return erased_size;
292292
}
293293

294-
#if defined(PKG_USING_FAL)
294+
#if defined(RT_USING_FAL)
295295

296296
static int aprom_read(long offset, uint8_t *buf, size_t size)
297297
{
@@ -323,7 +323,7 @@ static int ldrom_erase(long offset, size_t size)
323323
return nu_fmc_erase(Onchip_ldrom_flash.addr + offset, size);
324324
}
325325

326-
#endif /* PKG_USING_FAL */
326+
#endif /* RT_USING_FAL */
327327

328328
static int nu_fmc_init(void)
329329
{
@@ -334,8 +334,8 @@ static int nu_fmc_init(void)
334334
g_mutex_fmc = rt_mutex_create("nu_fmc_lock", RT_IPC_FLAG_PRIO);
335335
RT_ASSERT(g_mutex_fmc != RT_NULL);
336336

337-
/* PKG_USING_FAL */
338-
#if defined(PKG_USING_FAL)
337+
/* RT_USING_FAL */
338+
#if defined(RT_USING_FAL)
339339
fal_init();
340340
#endif
341341

bsp/nuvoton/nk-980iot/applications/mnt.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
#include <sys/stat.h>
2929
#include <sys/statfs.h>
3030

31-
#if defined(PKG_USING_FAL)
31+
#if defined(RT_USING_FAL)
3232
#include <fal.h>
3333
#endif
3434

@@ -214,7 +214,7 @@ INIT_ENV_EXPORT(filesystem_init);
214214
#if defined(BOARD_USING_STORAGE_SPIFLASH)
215215
int mnt_init_spiflash0(void)
216216
{
217-
#if defined(PKG_USING_FAL)
217+
#if defined(RT_USING_FAL)
218218
extern int fal_init_check(void);
219219
if (!fal_init_check())
220220
fal_init();

0 commit comments

Comments
 (0)