2013-03-06 10:48:14 +01:00
|
|
|
/**
|
|
|
|
* Native Board board_init implementation
|
|
|
|
*
|
2015-09-27 18:58:30 +02:00
|
|
|
* Copyright (C) 2014 Ludwig Knüpfer <ludwig.knuepfer@fu-berlin.de>
|
2013-03-06 10:48:14 +01:00
|
|
|
*
|
2014-07-31 19:45:27 +02:00
|
|
|
* This file is subject to the terms and conditions of the GNU Lesser
|
|
|
|
* General Public License v2.1. See the file LICENSE in the top level
|
|
|
|
* directory for more details.
|
2013-03-06 10:48:14 +01:00
|
|
|
*
|
2018-06-01 12:09:16 +02:00
|
|
|
* @ingroup boards_native
|
2013-03-06 10:48:14 +01:00
|
|
|
* @{
|
|
|
|
* @file
|
2015-09-27 18:58:30 +02:00
|
|
|
* @author Ludwig Knüpfer <ludwig.knuepfer@fu-berlin.de>
|
2013-03-06 10:48:14 +01:00
|
|
|
* @}
|
|
|
|
*/
|
2013-06-02 12:42:10 +02:00
|
|
|
#include <stdio.h>
|
2013-03-06 12:27:25 +01:00
|
|
|
#include "board.h"
|
|
|
|
|
2013-07-15 20:57:12 +02:00
|
|
|
#include "board_internal.h"
|
|
|
|
|
2016-07-11 09:53:13 +02:00
|
|
|
#ifdef MODULE_MTD
|
|
|
|
#include "mtd_native.h"
|
2021-12-04 15:40:59 +01:00
|
|
|
|
|
|
|
mtd_native_dev_t mtd0_dev = {
|
2021-12-06 13:03:45 +01:00
|
|
|
.base = {
|
2021-12-04 15:40:59 +01:00
|
|
|
.driver = &native_flash_driver,
|
|
|
|
.sector_count = MTD_SECTOR_NUM,
|
|
|
|
.pages_per_sector = MTD_SECTOR_SIZE / MTD_PAGE_SIZE,
|
|
|
|
.page_size = MTD_PAGE_SIZE,
|
2022-02-21 12:04:48 +01:00
|
|
|
.write_size = MTD_WRITE_SIZE,
|
2021-12-04 15:40:59 +01:00
|
|
|
},
|
|
|
|
.fname = MTD_NATIVE_FILENAME,
|
|
|
|
};
|
|
|
|
|
2023-04-11 18:40:47 +02:00
|
|
|
MTD_XFA_ADD(mtd0_dev.base, 0);
|
2021-12-04 15:40:59 +01:00
|
|
|
#endif
|
|
|
|
|
2022-09-24 14:59:32 +02:00
|
|
|
#ifdef MODULE_VFS_DEFAULT
|
2022-03-28 18:03:43 +02:00
|
|
|
#include "vfs_default.h"
|
2021-12-04 15:40:59 +01:00
|
|
|
|
|
|
|
/*
|
|
|
|
* On `native` we define auto-mounts for every file system.
|
|
|
|
*
|
|
|
|
* A 'real' board would typically always use the same file system to avoid
|
|
|
|
* data loss when re-formatting, but since `native` is for testing only we
|
|
|
|
* provide all file system definitions here.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* littlefs support */
|
|
|
|
#if defined(MODULE_LITTLEFS)
|
2022-03-28 18:03:43 +02:00
|
|
|
VFS_AUTO_MOUNT(littlefs, VFS_MTD(mtd0_dev), VFS_DEFAULT_NVM(0), 0);
|
2021-12-04 15:40:59 +01:00
|
|
|
|
|
|
|
/* littlefs2 support */
|
|
|
|
#elif defined(MODULE_LITTLEFS2)
|
2022-03-28 18:03:43 +02:00
|
|
|
VFS_AUTO_MOUNT(littlefs2, VFS_MTD(mtd0_dev), VFS_DEFAULT_NVM(0), 0);
|
2021-12-04 15:40:59 +01:00
|
|
|
|
|
|
|
/* spiffs support */
|
|
|
|
#elif defined(MODULE_SPIFFS)
|
2022-03-28 18:03:43 +02:00
|
|
|
VFS_AUTO_MOUNT(spiffs, VFS_MTD(mtd0_dev), VFS_DEFAULT_NVM(0), 0);
|
2021-12-04 15:40:59 +01:00
|
|
|
|
|
|
|
/* FAT support */
|
|
|
|
#elif defined(MODULE_FATFS_VFS)
|
2022-03-28 18:03:43 +02:00
|
|
|
VFS_AUTO_MOUNT(fatfs, VFS_MTD(mtd0_dev), VFS_DEFAULT_NVM(0), 0);
|
2021-12-04 15:40:59 +01:00
|
|
|
|
2022-09-24 14:59:32 +02:00
|
|
|
/* ext2/3/4 support */
|
|
|
|
#elif defined(MODULE_LWEXT4)
|
|
|
|
VFS_AUTO_MOUNT(lwext4, VFS_MTD(mtd0_dev), VFS_DEFAULT_NVM(0), 0);
|
|
|
|
|
2023-02-24 22:02:09 +01:00
|
|
|
/* host fs pass-through */
|
|
|
|
#elif defined(MODULE_FS_NATIVE)
|
|
|
|
VFS_AUTO_MOUNT(native, { .hostpath = FS_NATIVE_DIR }, VFS_DEFAULT_NVM(0), 0);
|
|
|
|
|
2016-07-11 09:53:13 +02:00
|
|
|
#endif
|
2022-09-24 14:59:32 +02:00
|
|
|
#endif /* MODULE_VFS_DEFAULT */
|
2016-07-11 09:53:13 +02:00
|
|
|
|
2013-03-13 21:45:28 +01:00
|
|
|
/**
|
|
|
|
* Nothing to initialize at the moment.
|
|
|
|
* Turns the red LED on and the green LED off.
|
|
|
|
*/
|
2014-05-07 12:36:32 +02:00
|
|
|
void board_init(void)
|
2013-03-06 01:10:50 +01:00
|
|
|
{
|
|
|
|
puts("RIOT native board initialized.");
|
|
|
|
}
|