rt-thread-official/bsp/ls2kdev/applications/mnt.c

48 lines
951 B
C
Raw Normal View History

2020-12-29 17:56:12 +08:00
/*
* Copyright (c) 2006-2020, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
* Change Logs:
* Date Author Notes
* 2020-12-29 bigmagic first version
*/
#include <rthw.h>
#include <rtthread.h>
2020-12-29 18:16:45 +08:00
#ifdef PKG_USING_LWEXT4
2020-12-29 17:56:12 +08:00
#include <dfs.h>
#include <dfs_fs.h>
#include <dfs_file.h>
#include <ext4.h>
#include <ext4_debug.h>
#include <blk_device.h>
#include <stdint.h>
#include <pci.h>
2020-12-29 18:16:45 +08:00
#define EXT4_DEBUG_ALL (0xFFFFFFFF)
#define EXT4_DEBUG_NO (0)
2020-12-29 17:56:12 +08:00
int mount_ssd(void)
{
struct blk_device *blkdev = (struct blk_device *)rt_device_find("dwc_ahsata_blk");
if(blkdev == RT_NULL)
{
rt_kprintf("dwc_ahsata_blk not found!\n");
return;
}
2020-12-29 18:16:45 +08:00
ext4_dmask_set(EXT4_DEBUG_NO);
2020-12-29 17:56:12 +08:00
blk_device_init(blkdev);
dfs_mount("dwc_ahsata_blk","/","ext",0,(void *)1);
dfs_mount("dwc_ahsata_blk","/boot","ext",0,(void *)0);
return 0;
}
INIT_ENV_EXPORT(mount_ssd);
2020-12-29 18:16:45 +08:00
#endif