Commit Graph

29 Commits

Author SHA1 Message Date
Marti Bolivar 427159bf95 zephyr: fix ffconf.h override use of STRINGIZE
This is a "standard" macro name that we shouldn't be overriding.
Namespace this with an FFCONF_ prefix to avoid clashes with other
modules, such as the one currently observed in this twister error:

In file included from /__w/zephyr/modules/fs/fatfs/include/ff.h:29,
                 from /__w/zephyr/zephyr/subsys/fs/fat_fs.c:16:
/__w/zephyr/modules/fs/fatfs/include/ffconf.h:295: error: "STRINGIZE" redefined [-Werror]
  295 | #define STRINGIZE(x) STRINGIZE_AGAIN(x)
      |
In file included from /__w/zephyr/modules/hal/silabs/gecko/emlib/inc/em_common.h:34,
                 from /__w/zephyr/modules/hal/silabs/gecko/emlib/inc/em_core.h:34,
                 from /__w/zephyr/modules/hal/silabs/gecko/emlib/inc/em_bus.h:34,
                 from ../../../../../../../soc/arm/silabs_exx32/efm32gg11b/soc.h:25,
                 from ../../../../../../../include/zephyr/arch/arm/aarch32/cortex_m/cmsis.h:19,
                 from ../../../../../../../include/zephyr/arch/arm/aarch32/mpu/arm_mpu_v7m.h:11,
                 from ../../../../../../../include/zephyr/arch/arm/aarch32/mpu/arm_mpu.h:14,
                 from ../../../../../../../include/zephyr/arch/arm/aarch32/arch.h:266,
                 from ../../../../../../../include/zephyr/arch/cpu.h:19,
                 from ../../../../../../../include/zephyr/kernel_includes.h:33,
                 from ../../../../../../../include/zephyr/kernel.h:17,
                 from /__w/zephyr/zephyr/subsys/fs/fat_fs.c:9:
/__w/zephyr/modules/hal/silabs/gecko/common/inc/sl_common.h:82: note: this is the location of the previous definition
   82 | #define STRINGIZE(X) #X
      |
cc1: all warnings being treated as errors

Signed-off-by: Marti Bolivar <marti.bolivar@nordicsemi.no>
2023-01-16 13:07:44 +01:00
Dominik Ermel 89f53db020 fs: Update driver to version 0.15 w/patch1
The commit updates driver, with changes that have appeared
since last update to version 0.14b, and applies Zephyr compatibility
patches to where required.

Origin: ELM Chan (http://elm-chan.org)
Project URL: http://elm-chan.org/fsw/ff/00index_e.html
Sources: http://elm-chan.org/fsw/ff/arc/ff15.zip
Sources package SHA256:
  9b8704000eb8823dc27314f63899d42c995c3f5e4e0be06382c98c90331e01a2

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2022-12-06 17:45:19 +01:00
Dominik Ermel 38f303ad09 zephyr: Add ffconf.h override with ZEPHYR_CONFIG_OVERRIDE
ffconf.h gets extended with Zephyr specific code that allows
to include ZEPHYR_CONFIG_OVERRIDE pointed header file with
definitions that override ffconf.h.

This way changes to ffconf.h can be stored with Zephyr directory
tree and it should be easier to update ffconf.h from newer
versions of ELM FAT source.

This allows greater flexibility in doing configuration logic
on Zephyr side.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2022-11-18 10:07:39 +01:00
Dominik Ermel 00f7bf679b zephyr: Revert ffconf.h file to umodified R0.14b version
Reverting.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2022-11-18 10:07:39 +01:00
Dominik Ermel 8ee8bd94d6 zephyr: Remove zephyr specific source files
The commit removes zfs_diskio.c.  File is now provided from
modules/fatfs/ within Zephry project source tree.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2022-11-18 10:07:39 +01:00
Dominik Ermel e40377289e zephyr: Remove CMakeLists.txt
The commit removes CmakeLists.txt and modifies zephyr/module.yml
to allow storing Zephyr specific sources in module/fatfs
directory of Zephyr project.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2022-11-18 10:07:39 +01:00
Gerard Marull-Paretas a30531af3a zephyr: update include paths to use <zephyr/...>
Zephyr has prefixed all of its includes with <zephyr/...>. While the old
mode can still be used (CONFIG_LEGACY_INCLUDE_PATH) and is still enabled
by default, it's better to be prepared for its removal in the future.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2022-05-11 20:30:35 +09:00
Boon Khai Ng 9237454a30 fat_fs: Add support for the "win" variable alignment in FATFS struct
This is to support Sypnosys Designware SDMMC controller read and write
operation where the buffer address is needed to be 16bytes and 512bytes
aligned. Adding macro FS_FATFS_WINDOW_ALIGNMENT to align the "win"
variable address in FATFS struct.

Signed-off-by: Boon Khai Ng <boon.khai.ng@intel.com>
2022-01-21 09:52:20 +01:00
Anas Nashif 09a9d913c6 diskio: use new location of disk_access.h
disk_access.h was moved, use new location.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-01-18 16:54:27 -05:00
Dominik Ermel 94fcd6bfb3 fs: Update driver to version 0.14b
The commit updates driver, with changes that have appeared
since last update to version 0.12b, and applies Zephyr compatibility
patches to where required.

Origin: ELM Chan (http://elm-chan.org)
Project URL: http://elm-chan.org/fsw/ff/00index_e.html
Sources: http://elm-chan.org/fsw/ff/arc/ff14b.zip
Sources package SHA256:
  134d2ce89a96d601c564287387025a852efde9730ad5ecb35d59461658ba8b5f

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2021-08-16 19:50:40 +02:00
Markus Fuchs 237778d3f1 fat_fs: Add support for variable sector size
Add support for variable sector sizes by exposing _MAX_SS as
CONFIG_FS_FATFS_MAX_SS to Kconfig and adding the GET_SECTOR_SIZE IOCTL.

Signed-off-by: Markus Fuchs <markus.fuchs@de.sauter-bc.com>
2020-11-05 22:09:34 -06:00
Markus Fuchs 1d1fcc725a fat_fs: Expose _VOLUMES to Kconfig
Expose _VOLUMES as CONFIG_FS_FATFS_VOLUMES to Kconfig to be able to
adjust the number of used logical drives.

Signed-off-by: Markus Fuchs <markus.fuchs@de.sauter-bc.com>
2020-11-03 03:17:06 -06:00
Dominik Ermel 320e2c06ef fs: Expose _FS_READONLY and _USE_MKFS to Kconfig
FAT FS config mapping:
  _FS_READONLY  as CONFIG_FS_FATFS_READ_ONLY
  _FS_MKFS      as CONFIG_FS_MKFS

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2020-10-19 18:39:46 +02:00
Jui-Chou Chung 13697783bf fs: Add kconfig option for enabling exFAT support
Add Kconfig options for exposing the support of exFAT

Signed-off-by: Jui-Chou Chung <jui-chou.chung@nordicsemi.no>
2020-08-13 12:07:31 +02:00
Audun Korneliussen 9ee6b9b951 fs: Expose _USE_LFN, _MAX_LFN, and _CODE_PAGE as kconfig options.
When _USE_LFN is 0 (default), filenames are restricted to 8.3 format.
It's useful to have long filenames as an easily configurable option.
_MAX_LFN and _CODE_PAGE are closely related parameters that determines
character set and max filename length.

Note that value of _USE_LFN determines if LFN working buffer is placed in
BSS, stack, or heap.

Signed-off-by: Audun Korneliussen <audun.korneliussen@nordicsemi.no>
2020-01-23 15:11:28 +01:00
Kumar Gala 0c1288bb81 include: Fix use of <disk_access.h> -> <disk/disk_access.h>
Fix #include <disk_access.h> as it has been deprecated and
should be #include <disk/disk_access.h>.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-12-09 15:07:20 -05:00
Anas Nashif df96914dd9 zephyr: add fatfs as a module
Added module.yml file to make this a zephyr module.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-05-22 22:07:53 -04:00
Ramakrishna Pallala 75d48a71ce subsys: disk: Add support for multiple disk interfaces
Add support for enabling multiple disk interfaces (Flash, RAM)
simultaneously in Zephyr by introducing a simple disk interface
framework where we can register multiple disks which would
interface with different storage devices. This would enable us
to have multiple instances of FATFS in Zephyr.

Add support for mass storage drive disk name which will be
used as an argument when calling the disk interface API's.

Enable multiple volumes support configuration in
ELM FAT library.

Signed-off-by: Ramakrishna Pallala <ramakrishna.pallala@intel.com>
2018-05-08 08:53:01 -04:00
Michael Hope b409c6ce21 disk: delete the GET_DISK_SIZE IOCTL.
The argument is a u32_t which limits the maximum disk size to 4 GiB.
Rather than fix this, delete the ioctl and switch the only use to
GET_SECTOR_COUNT instead.

Signed-off-by: Michael Hope <mlhx@google.com>
2018-01-31 09:14:40 -05:00
Sebastian Bøe 9b180329b3 kbuild: Removed KBuild
Signed-off-by: Sebastian Boe <sebastian.boe@nordicsemi.no>
2017-11-08 20:00:22 -05:00
Sebastian Bøe 1787fb1486 Introduce cmake-based rewrite of KBuild
Introducing CMake is an important step in a larger effort to make
Zephyr easy to use for application developers working on different
platforms with different development environment needs.

Simplified, this change retains Kconfig as-is, and replaces all
Makefiles with CMakeLists.txt. The DSL-like Make language that KBuild
offers is replaced by a set of CMake extentions. These extentions have
either provided simple one-to-one translations of KBuild features or
introduced new concepts that replace KBuild concepts.

This is a breaking change for existing test infrastructure and build
scripts that are maintained out-of-tree. But for FW itself, no porting
should be necessary.

For users that just want to continue their work with minimal
disruption the following should suffice:

Install CMake 3.8.2+

Port any out-of-tree Makefiles to CMake.

Learn the absolute minimum about the new command line interface:

$ cd samples/hello_world
$ mkdir build && cd build
$ cmake -DBOARD=nrf52_pca10040 ..

$ cd build
$ make

PR: zephyrproject-rtos#4692
docs: http://docs.zephyrproject.org/getting_started/getting_started.html

Signed-off-by: Sebastian Boe <sebastian.boe@nordicsemi.no>
2017-11-08 20:00:22 -05:00
Anas Nashif 70194fb1c6 subsys: fs: consolidate elm FAT kconfig options
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-10-03 08:43:50 -04:00
Ramesh Thomas 165aec8e3c fs: Update external FAT FS source with new rev 0.12b
Update elm-chan FAT FS with latest sources. Updated README with changes
made to default configurations.

Change-Id: I3c868479506042d174ac7df360ce62931d8ac5af
Jira: ZEP-1338
Signed-off-by: Ramesh Thomas <ramesh.thomas@intel.com>
2017-01-25 05:31:14 +00:00
Jithu Joseph 1543d650c5 fs: expose generic ramdisk/flash disk access functions
This patch removes "FAT" from  files names, config names and
symbol names so as to avoid confusion, when other modules use
them in a more generic way.

Also flash_disk_access.c and ram_disk_access.c now exports generic
disk_access symbols as defined in include/disk_access.h rather
than FAT specific ones in fs/fat_diskio.h. Thus modules like
USB which need to use disk_access interface is not dependent
on symbols from ELMChan FAT module. Also fat_diskio.h
is removed.

Further the shim between ELM chan and Zephyr is modified as
per these changes.

Change-Id: Ifd80f14a629e467ee9c7a9aaff8a4896eed11982
Signed-off-by: Jithu Joseph <jithu.joseph@intel.com>
2016-11-09 02:45:45 +00:00
Andrew Boie bd3b952669 fat_fs: zfs_diskio: use same typedefs in header
The implementation was using different typedefs than the prototypes
in the header.

Issue: ZEP-695
Change-Id: Ia369daafe1bce39830535d184bd4388b13c986b4
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-08-16 14:43:06 -07:00
Ramesh Thomas a57bb85b9e fs: Adds diskio interface
Adds the diskio interface for the FAT file system.  This
revision uses RAM to emulate disk storage.

Origin: Original
Jira: ZEP-285
Change-Id: I7a30c8761d5ed9b564f1d1e08482c5ef199d7372
Signed-off-by: Ramesh Thomas <ramesh.thomas@intel.com>
2016-08-01 16:46:38 -07:00
Ramesh Thomas 4cc2eb6f39 fs: Update FatFs Kconfig names
Modified the Kconfig flag names to identify external FS
with source. This is required to differentiate between
additional external Fat FS code tht may be added in future.

Jira: ZEP-285
Change-Id: Ief4d11f57494fa1f7ba234182b8b922bc82575cc
Signed-off-by: Ramesh Thomas <ramesh.thomas@intel.com>
2016-07-29 19:12:43 +00:00
Ramesh Thomas e056fb95b3 fs: PUll in rev 0.12a of open source FAT FS code
Update latest revision of the FAT FS code.

Origin: ELM Chan
URL: http://elm-chan.org/fsw/ff/00index_e.html
Change-Id: I602c239055c171595a46986eaa774298117055b6
Signed-off-by: Ramesh Thomas <ramesh.thomas@intel.com>
2016-07-20 15:06:36 +00:00
Ramesh Thomas 7fe32b2eca fs: [WIP] Pull in open source FAT FS implementation
This implements the top layer of the FAT FS. It exports an user API
that would be abstacted by Zephyr FS API. It has another set of API
to interface with a bottom layer that would provide platform specific
file systems. A flash file system will be implemented for the bottom
layer.

Jira: ZEP-285
Origin: ELM Chan
URL: http://elm-chan.org/fsw/ff/00index_e.html
Change-Id: Id7c99dbdac9612b1a597bd8099b8a528824afae9
Signed-off-by: Ramesh Thomas <ramesh.thomas@intel.com>
2016-06-29 05:17:57 +00:00