From 606ffc5e70697a12a088c69c27edae4ab7315842 Mon Sep 17 00:00:00 2001 From: bigmagic Date: Tue, 29 Dec 2020 18:16:45 +0800 Subject: [PATCH] add ls2k lwext4 pkgs support --- bsp/ls2kdev/.config | 7 ++----- bsp/ls2kdev/README.md | 23 +++++++++++++++++++++-- bsp/ls2kdev/applications/mnt.c | 10 +++++++++- bsp/ls2kdev/drivers/ata/SConscript | 2 +- bsp/ls2kdev/rtconfig.h | 3 --- 5 files changed, 33 insertions(+), 12 deletions(-) diff --git a/bsp/ls2kdev/.config b/bsp/ls2kdev/.config index 04c3a16458..2d89bcb80b 100644 --- a/bsp/ls2kdev/.config +++ b/bsp/ls2kdev/.config @@ -448,12 +448,9 @@ CONFIG_RT_LWIP_USING_PING=y # CONFIG_PKG_USING_GUIENGINE is not set # CONFIG_PKG_USING_CAIRO is not set # CONFIG_PKG_USING_PIXMAN is not set -CONFIG_PKG_USING_LWEXT4=y -CONFIG_PKG_LWEXT4_PATH="/packages/system/lwext4" -CONFIG_RT_USING_DFS_LWEXT4=y -CONFIG_PKG_USING_LWEXT4_LATEST_VERSION=y +# CONFIG_PKG_USING_LWEXT4 is not set +# CONFIG_PKG_USING_LWEXT4_LATEST_VERSION is not set # CONFIG_PKG_USING_LWEXT4_V100 is not set -CONFIG_PKG_LWEXT4_VER="latest" # CONFIG_PKG_USING_PARTITION is not set # CONFIG_PKG_USING_FAL is not set # CONFIG_PKG_USING_FLASHDB is not set diff --git a/bsp/ls2kdev/README.md b/bsp/ls2kdev/README.md index 89e041ad71..8a0c6a71ba 100644 --- a/bsp/ls2kdev/README.md +++ b/bsp/ls2kdev/README.md @@ -110,7 +110,25 @@ title TFTPBOOT 以上三步完成之后,重启系统,就可以省略每次都需要进入pmon的输入命令的麻烦,板子上电后,可以自动从系统TFTP服务器中获取固件,然后启动,大大提高调试代码效率。 -## 5. 支持情况 +## 5.SATA接口的SSD文件系统支持 + +当前已经支持SATA接口的SSD文件系统驱动,需要通过menuconfig + +``` +RT-Thread online packages ---> + system packages ---> + lwext4: an excellent choice of ext2/3/4 filesystem for microcontrollers +``` + +然后输入下面的命令更新软件包 + +``` +pkgs --update +``` + +输入`scons`编译代码即可使用SATA接口的SSD文件系统。 + +## 6. 支持情况 | 驱动 | 支持情况 | 备注 | | ------ | ---- | :------: | @@ -120,8 +138,9 @@ title TFTPBOOT | GMAC | 支持 | 网卡驱动 | | RTC | 支持 | - | | SPI | 支持 | - | +| SATA SSD | 支持 | 需要打开lwext4软件包 | -## 6. 联系人信息 +## 7. 联系人信息 维护人:[bernard][4] diff --git a/bsp/ls2kdev/applications/mnt.c b/bsp/ls2kdev/applications/mnt.c index f6057806a5..1c9b9b047a 100644 --- a/bsp/ls2kdev/applications/mnt.c +++ b/bsp/ls2kdev/applications/mnt.c @@ -9,6 +9,9 @@ */ #include #include + +#ifdef PKG_USING_LWEXT4 + #include #include #include @@ -18,6 +21,9 @@ #include #include +#define EXT4_DEBUG_ALL (0xFFFFFFFF) +#define EXT4_DEBUG_NO (0) + int mount_ssd(void) { struct blk_device *blkdev = (struct blk_device *)rt_device_find("dwc_ahsata_blk"); @@ -28,7 +34,7 @@ int mount_ssd(void) return; } - //ext4_dmask_set(0xFFFFFFFF); + ext4_dmask_set(EXT4_DEBUG_NO); blk_device_init(blkdev); dfs_mount("dwc_ahsata_blk","/","ext",0,(void *)1); dfs_mount("dwc_ahsata_blk","/boot","ext",0,(void *)0); @@ -37,3 +43,5 @@ int mount_ssd(void) } INIT_ENV_EXPORT(mount_ssd); + +#endif diff --git a/bsp/ls2kdev/drivers/ata/SConscript b/bsp/ls2kdev/drivers/ata/SConscript index 74db1f1012..164023bd1f 100644 --- a/bsp/ls2kdev/drivers/ata/SConscript +++ b/bsp/ls2kdev/drivers/ata/SConscript @@ -9,6 +9,6 @@ if GetDepend('RT_USING_DFS_ELMFAT') == False: SrcRemove(src, 'dwc_ahsata.c') SrcRemove(src, 'libata.c') -group = DefineGroup('Drivers', src, depend = [''], CPPPATH = CPPPATH) +group = DefineGroup('Drivers', src, depend = ['PKG_USING_LWEXT4'], CPPPATH = CPPPATH) Return('group') diff --git a/bsp/ls2kdev/rtconfig.h b/bsp/ls2kdev/rtconfig.h index f96e90aa22..dfaa45a009 100644 --- a/bsp/ls2kdev/rtconfig.h +++ b/bsp/ls2kdev/rtconfig.h @@ -219,9 +219,6 @@ /* system packages */ -#define PKG_USING_LWEXT4 -#define RT_USING_DFS_LWEXT4 -#define PKG_USING_LWEXT4_LATEST_VERSION /* Micrium: Micrium software products porting for RT-Thread */