Skip to content

Commit 74812c0

Browse files
committed
add raspi4 sdio driver
1 parent 8cf8369 commit 74812c0

File tree

6 files changed

+1003
-3
lines changed

6 files changed

+1003
-3
lines changed

bsp/raspberry-pi/raspi4-32/.config

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,23 @@ CONFIG_DFS_FILESYSTEMS_MAX=2
112112
CONFIG_DFS_FILESYSTEM_TYPES_MAX=2
113113
CONFIG_DFS_FD_MAX=16
114114
# CONFIG_RT_USING_DFS_MNTTABLE is not set
115-
# CONFIG_RT_USING_DFS_ELMFAT is not set
115+
CONFIG_RT_USING_DFS_ELMFAT=y
116+
117+
#
118+
# elm-chan's FatFs, Generic FAT Filesystem Module
119+
#
120+
CONFIG_RT_DFS_ELM_CODE_PAGE=437
121+
CONFIG_RT_DFS_ELM_WORD_ACCESS=y
122+
# CONFIG_RT_DFS_ELM_USE_LFN_0 is not set
123+
# CONFIG_RT_DFS_ELM_USE_LFN_1 is not set
124+
# CONFIG_RT_DFS_ELM_USE_LFN_2 is not set
125+
CONFIG_RT_DFS_ELM_USE_LFN_3=y
126+
CONFIG_RT_DFS_ELM_USE_LFN=3
127+
CONFIG_RT_DFS_ELM_MAX_LFN=255
128+
CONFIG_RT_DFS_ELM_DRIVES=2
129+
CONFIG_RT_DFS_ELM_MAX_SECTOR_SIZE=512
130+
# CONFIG_RT_DFS_ELM_USE_ERASE is not set
131+
CONFIG_RT_DFS_ELM_REENTRANT=y
116132
CONFIG_RT_USING_DFS_DEVFS=y
117133
# CONFIG_RT_USING_DFS_ROMFS is not set
118134
# CONFIG_RT_USING_DFS_RAMFS is not set
@@ -140,7 +156,13 @@ CONFIG_RT_USING_PIN=y
140156
# CONFIG_RT_USING_MTD_NAND is not set
141157
# CONFIG_RT_USING_PM is not set
142158
# CONFIG_RT_USING_RTC is not set
143-
# CONFIG_RT_USING_SDIO is not set
159+
CONFIG_RT_USING_SDIO=y
160+
CONFIG_RT_SDIO_STACK_SIZE=512
161+
CONFIG_RT_SDIO_THREAD_PRIORITY=15
162+
CONFIG_RT_MMCSD_STACK_SIZE=1024
163+
CONFIG_RT_MMCSD_THREAD_PREORITY=22
164+
CONFIG_RT_MMCSD_MAX_PARTITION=16
165+
# CONFIG_RT_SDIO_DEBUG is not set
144166
CONFIG_RT_USING_SPI=y
145167
# CONFIG_RT_USING_QSPI is not set
146168
# CONFIG_RT_USING_SPI_MSD is not set
@@ -525,7 +547,8 @@ CONFIG_BSP_USING_CORETIMER=y
525547
# CONFIG_BSP_USING_SYSTIMER is not set
526548
CONFIG_BSP_USING_WDT=y
527549
# CONFIG_BSP_USING_RTC is not set
528-
# CONFIG_BSP_USING_SDIO is not set
550+
CONFIG_BSP_USING_SDIO=y
551+
CONFIG_BSP_USING_SDIO0=y
529552

530553
#
531554
# Board Peripheral Drivers
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/*
2+
* Copyright (c) 2006-2019, RT-Thread Development Team
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*
6+
* Change Logs:
7+
* Date Author Notes
8+
* 2017-5-30 bernard the first version
9+
*/
10+
11+
#include <rtthread.h>
12+
13+
#ifdef BSP_USING_SDIO0
14+
#include <dfs_fs.h>
15+
16+
int mnt_init(void)
17+
{
18+
rt_thread_delay(RT_TICK_PER_SECOND);
19+
if (dfs_mount("sd0", "/", "elm", 0, 0) == 0)
20+
{
21+
rt_kprintf("file system initialization done!\n");
22+
}
23+
24+
return 0;
25+
}
26+
INIT_ENV_EXPORT(mnt_init);
27+
#endif

0 commit comments

Comments
 (0)