mnt.c 951 字节
Newer Older
B
bigmagic 已提交
1 2 3 4 5 6 7 8 9 10 11
/*
 * 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>
B
bigmagic 已提交
12 13 14

#ifdef PKG_USING_LWEXT4

B
bigmagic 已提交
15 16 17 18 19 20 21 22 23
#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>

B
bigmagic 已提交
24 25 26
#define EXT4_DEBUG_ALL  (0xFFFFFFFF)
#define EXT4_DEBUG_NO   (0)

B
bigmagic 已提交
27 28 29 30 31 32 33 34 35 36
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;
    }
    
B
bigmagic 已提交
37
    ext4_dmask_set(EXT4_DEBUG_NO);
B
bigmagic 已提交
38 39 40 41 42 43 44 45
    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);
B
bigmagic 已提交
46 47

#endif