summaryrefslogtreecommitdiff
path: root/components/dfs/Kconfig
blob: 4d1418b808568ab27eaaec36e748d42d9c4c58df (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
menu "DFS: device virtual file system"

config RT_USING_DFS
    bool "DFS: device virtual file system"
    select RT_USING_MUTEX
    default y
    help
        The device file system is a light weight virtual file system.

if RT_USING_DFS
    config DFS_USING_POSIX
        bool "Using posix-like functions, open/read/write/close"
        default y

    config DFS_USING_WORKDIR
        bool "Using working directory"
        default y

if RT_USING_DFS_V1
    config RT_USING_DFS_MNTTABLE
        bool "Using mount table for file system"
        default n
        help
            User can use mount table for automatically mount, for example:
                const struct dfs_mount_tbl mount_table[] =
                {
                    {"flash0", "/", "elm", 0, 0},
                    {0}
                };
            The mount_table must be terminated with NULL.
endif

    config DFS_FD_MAX
        int "The maximal number of opened files"
        default 16

    choice RT_USING_DFS_VERSION
        prompt "The version of DFS"
        default RT_USING_DFS_V1
        default RT_USING_DFS_V2 if RT_USING_SMART

        config RT_USING_DFS_V1
            bool "DFS v1.0"
            depends on !RT_USING_SMART

        config RT_USING_DFS_V2
            bool "DFS v2.0"
            select RT_USING_DEVICE_OPS
    endchoice

if RT_USING_DFS_V1
    config DFS_FILESYSTEMS_MAX
        int "The maximal number of mounted file system"
        default 4

    config DFS_FILESYSTEM_TYPES_MAX
        int "The maximal number of file system type"
        default 4
endif

    config RT_USING_DFS_ELMFAT
        bool "Enable elm-chan fatfs"
        default n
        help
            FatFs is a generic FAT/exFAT file system module for small embedded systems.

    if RT_USING_DFS_ELMFAT
        menu "elm-chan's FatFs, Generic FAT Filesystem Module"
        config RT_DFS_ELM_CODE_PAGE
            int "OEM code page"
            default 437

        config RT_DFS_ELM_WORD_ACCESS
            bool "Using RT_DFS_ELM_WORD_ACCESS"
            default y

        choice RT_DFS_ELM_USE_LFN_NAME
            prompt "Support long file name"
            default RT_DFS_ELM_USE_LFN_3

            config RT_DFS_ELM_USE_LFN_0
                bool "0: LFN disable"

            config RT_DFS_ELM_USE_LFN_1
                bool "1: LFN with static LFN working buffer"

            config RT_DFS_ELM_USE_LFN_2
                bool "2: LFN with dynamic LFN working buffer on the stack"

            config RT_DFS_ELM_USE_LFN_3
                bool "3: LFN with dynamic LFN working buffer on the heap"
        endchoice

        config RT_DFS_ELM_USE_LFN
            int
            default 0 if RT_DFS_ELM_USE_LFN_0
            default 1 if RT_DFS_ELM_USE_LFN_1
            default 2 if RT_DFS_ELM_USE_LFN_2
            default 3 if RT_DFS_ELM_USE_LFN_3

        choice RT_DFS_ELM_LFN_UNICODE_NAME
            prompt "Support unicode for long file name"
            default RT_DFS_ELM_LFN_UNICODE_0

            config RT_DFS_ELM_LFN_UNICODE_0
                bool "0: ANSI/OEM in current CP (TCHAR = char)"

            config RT_DFS_ELM_LFN_UNICODE_1
                bool "1: Unicode in UTF-16 (TCHAR = WCHAR)"

            config RT_DFS_ELM_LFN_UNICODE_2
                bool "2: Unicode in UTF-8 (TCHAR = char)"

            config RT_DFS_ELM_LFN_UNICODE_3
                bool "3: Unicode in UTF-32 (TCHAR = DWORD)"
        endchoice

        config RT_DFS_ELM_LFN_UNICODE
            int
            default 0 if RT_DFS_ELM_LFN_UNICODE_0
            default 1 if RT_DFS_ELM_LFN_UNICODE_1
            default 2 if RT_DFS_ELM_LFN_UNICODE_2
            default 3 if RT_DFS_ELM_LFN_UNICODE_3

        config RT_DFS_ELM_MAX_LFN
            int "Maximal size of file name length"
            range 12 255
            default 255

        config RT_DFS_ELM_DRIVES
            int "Number of volumes (logical drives) to be used."
            default 2

        config RT_DFS_ELM_MAX_SECTOR_SIZE
            int "Maximum sector size to be handled."
            default 512
            help
                If you use some spi nor flash for fatfs, please set this the erase sector size, for example 4096.

        config RT_DFS_ELM_USE_ERASE
            bool "Enable sector erase feature"
            default n

        config RT_DFS_ELM_REENTRANT
            bool "Enable the reentrancy (thread safe) of the FatFs module"
            default y

        config RT_DFS_ELM_MUTEX_TIMEOUT
            int "Timeout of thread-safe protection mutex"
            range 0 1000000
            default 3000
            depends on RT_DFS_ELM_REENTRANT

        config RT_DFS_ELM_USE_EXFAT
            bool "Enable exFAT filesystem support"
            default n
            depends on RT_DFS_ELM_USE_LFN >= 1
            help
              exFAT (Extended File Allocation Table) is a file system
              designed for large-capacity storage devices.

              Key features and recommendations:
              - Target scenarios: Primarily used for storage media requiring
                support for very large files (>4GB) or large partitions
                (>32GB), such as high-capacity SD cards or USB drives.

              - Resource cost: Enabling exFAT support will significantly
                increase the code size (ROM footprint) of the file system.

              - Recommendation:
                For small-capacity storage devices (e.g., SPI Flash or
                eMMC under 32GB), the standard FAT16 or FAT32 file
                systems are perfectly adequate. It is strongly recommended
                to keep this option disabled unless you absolutely need to
                handle large-capacity storage, in order to conserve
                valuable code space.

        endmenu
    endif

    config RT_USING_DFS_DEVFS
        bool "Using devfs for device objects"
        default y

if RT_USING_DFS_V1
    config RT_USING_DFS_9PFS
        bool "Using Plan 9 remote filesystem"
        select RT_USING_ADT_BITMAP
        depends on RT_USING_MEMHEAP
        default n

    config RT_USING_DFS_ISO9660
        bool "Using ISO9660 filesystem"
        depends on RT_USING_MEMHEAP
        default n
endif

    menuconfig RT_USING_DFS_ROMFS
        bool "Enable ReadOnly file system on flash"
        default n

    if RT_USING_DFS_ROMFS
        config RT_USING_DFS_ROMFS_USER_ROOT
            bool "Use user's romfs root"
            depends on RT_USING_DFS_V1
            default n
    endif

if RT_USING_SMART
    config RT_USING_DFS_PTYFS
        bool "Using Pseudo-Teletype Filesystem (UNIX98 PTY)"
        depends on RT_USING_DFS_DEVFS
        default y
    config RT_USING_DFS_PROCFS
        bool "Enable proc file system"
        default y
endif

    config RT_USING_DFS_CROMFS
        bool "Enable ReadOnly compressed file system on flash"
        default n
        # select PKG_USING_ZLIB

if RT_USING_DFS_V1
    config RT_USING_DFS_RAMFS
        bool "Enable RAM file system"
        select RT_USING_MEMHEAP
        default n
endif

    config RT_USING_DFS_TMPFS
        bool "Enable TMP file system"
        default y if RT_USING_SMART
        default n

    config RT_USING_DFS_MQUEUE
        bool "Enable MQUEUE file system"
        select RT_USING_DEV_BUS
        default y if RT_USING_SMART
        default n

if RT_USING_DFS_V1
    config RT_USING_DFS_NFS
        bool "Using NFS v3 client file system"
        depends on RT_USING_LWIP
        default n

    if RT_USING_DFS_NFS
        config RT_NFS_HOST_EXPORT
            string "NFSv3 host export"
            default "192.168.1.5:/"
    endif
endif

if RT_USING_DFS_V2
    config RT_USING_PAGECACHE
        bool "Enable page cache"
        default y if RT_USING_SMART
        depends on RT_USING_SMART

    if RT_USING_PAGECACHE
        menu "page cache config"
        config RT_PAGECACHE_COUNT
            int "page cache max total pages."
            default 4096

        config RT_PAGECACHE_ASPACE_COUNT
            int "aspace max active pages."
            default 1024

        config RT_PAGECACHE_PRELOAD
            int "max pre load pages."
            default 4

        config RT_PAGECACHE_HASH_NR
            int "page cache hash size."
            default 1024

        config RT_PAGECACHE_GC_WORK_LEVEL
            int "page cache gc work trigger min percentage, default 90%."
            default 90

        config RT_PAGECACHE_GC_STOP_LEVEL
            int "page cache gc to min percentage, default 70%."
            default 70
        endmenu
    endif
endif

endif

endmenu