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

84 lines
2.1 KiB
C
Raw Normal View History

2013-03-06 10:48:14 +01:00
/**
* Native Board board_init implementation
*
* Copyright (C) 2014 Ludwig Knüpfer <ludwig.knuepfer@fu-berlin.de>
2013-03-06 10:48:14 +01: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
* @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"
#include "board_internal.h"
#ifdef MODULE_MTD
#include "mtd_native.h"
2021-12-04 15:40:59 +01:00
mtd_native_dev_t mtd0_dev = {
.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,
.write_size = MTD_WRITE_SIZE,
2021-12-04 15:40:59 +01:00
},
.fname = MTD_NATIVE_FILENAME,
};
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);
/* host fs pass-through */
#elif defined(MODULE_FS_NATIVE)
VFS_AUTO_MOUNT(native, { .hostpath = FS_NATIVE_DIR }, VFS_DEFAULT_NVM(0), 0);
#endif
2022-09-24 14:59:32 +02:00
#endif /* MODULE_VFS_DEFAULT */
2013-03-13 21:45:28 +01:00
/**
* Nothing to initialize at the moment.
* Turns the red LED on and the green LED off.
*/
void board_init(void)
2013-03-06 01:10:50 +01:00
{
puts("RIOT native board initialized.");
}