1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

boards/native: add support for lwEXT4

This commit is contained in:
Benjamin Valentin 2022-09-24 14:59:32 +02:00
parent e798d21b3b
commit c1a8a5cc9e
3 changed files with 13 additions and 5 deletions

View File

@ -14,7 +14,7 @@ endif
# default to using littlefs2 on the virtual flash if no other fs was selected
ifneq (,$(filter vfs_default,$(USEMODULE)))
ifeq (,$(filter spiffs littlefs fatfs_vfs,$(USEMODULE)))
ifeq (,$(filter lwext%_vfs spiffs littlefs fatfs_vfs,$(USEMODULE)))
USEMODULE += littlefs2
endif
USEMODULE += mtd

View File

@ -35,7 +35,7 @@ mtd_native_dev_t mtd0_dev = {
mtd_dev_t *mtd0 = &mtd0_dev.base;
#endif
#ifdef MODULE_VFS
#ifdef MODULE_VFS_DEFAULT
#include "vfs_default.h"
/*
@ -62,8 +62,12 @@ VFS_AUTO_MOUNT(spiffs, VFS_MTD(mtd0_dev), VFS_DEFAULT_NVM(0), 0);
#elif defined(MODULE_FATFS_VFS)
VFS_AUTO_MOUNT(fatfs, VFS_MTD(mtd0_dev), VFS_DEFAULT_NVM(0), 0);
/* ext2/3/4 support */
#elif defined(MODULE_LWEXT4)
VFS_AUTO_MOUNT(lwext4, VFS_MTD(mtd0_dev), VFS_DEFAULT_NVM(0), 0);
#endif
#endif /* MODULE_VFS */
#endif /* MODULE_VFS_DEFAULT */
/**
* Nothing to initialize at the moment.

View File

@ -60,22 +60,26 @@ void _native_LED_RED_TOGGLE(void);
* @{
*/
#ifndef MTD_PAGE_SIZE
#ifdef MODULE_FATFS
#if defined(MODULE_FATFS) || defined(MODULE_LWEXT4)
#define MTD_PAGE_SIZE (512)
#else
#define MTD_PAGE_SIZE (256)
#endif
#endif
#ifndef MTD_SECTOR_SIZE
#ifdef MODULE_FATFS
#if defined(MODULE_FATFS) || defined(MODULE_LWEXT4)
#define MTD_SECTOR_SIZE (512)
#else
#define MTD_SECTOR_SIZE (4096)
#endif
#endif
#ifndef MTD_SECTOR_NUM
#if defined(MODULE_FATFS) || defined(MODULE_LWEXT4)
#define MTD_SECTOR_NUM (32768)
#else
#define MTD_SECTOR_NUM (2048)
#endif
#endif
/** Advertised write size. While the file system backend supports single byte
* granularity, this can be increased to mimic other media. */
#ifndef MTD_WRITE_SIZE