mnt.c 951 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /*
  2. * Copyright (c) 2006-2020, RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2020-12-29 bigmagic first version
  9. */
  10. #include <rthw.h>
  11. #include <rtthread.h>
  12. #ifdef PKG_USING_LWEXT4
  13. #include <dfs.h>
  14. #include <dfs_fs.h>
  15. #include <dfs_file.h>
  16. #include <ext4.h>
  17. #include <ext4_debug.h>
  18. #include <blk_device.h>
  19. #include <stdint.h>
  20. #include <pci.h>
  21. #define EXT4_DEBUG_ALL (0xFFFFFFFF)
  22. #define EXT4_DEBUG_NO (0)
  23. int mount_ssd(void)
  24. {
  25. struct blk_device *blkdev = (struct blk_device *)rt_device_find("dwc_ahsata_blk");
  26. if(blkdev == RT_NULL)
  27. {
  28. rt_kprintf("dwc_ahsata_blk not found!\n");
  29. return;
  30. }
  31. ext4_dmask_set(EXT4_DEBUG_NO);
  32. blk_device_init(blkdev);
  33. dfs_mount("dwc_ahsata_blk","/","ext",0,(void *)1);
  34. dfs_mount("dwc_ahsata_blk","/boot","ext",0,(void *)0);
  35. return 0;
  36. }
  37. INIT_ENV_EXPORT(mount_ssd);
  38. #endif