From e46d8a1d5109352901364ca5c5c7f9eb448e90e4 Mon Sep 17 00:00:00 2001 From: Boon Khai Ng Date: Mon, 13 Dec 2021 09:39:31 +0800 Subject: [PATCH] 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 --- subsys/fs/Kconfig.fatfs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/subsys/fs/Kconfig.fatfs b/subsys/fs/Kconfig.fatfs index 7b897de947..57cda8717d 100644 --- a/subsys/fs/Kconfig.fatfs +++ b/subsys/fs/Kconfig.fatfs @@ -129,6 +129,19 @@ config FS_FATFS_MAX_SS range 512 4096 default 512 +config FS_FATFS_WINDOW_ALIGNMENT + int "Memory alignment for the member \"win\" in FATFS" + default 1 + help + Specifies alignment, in bytes of FAT FS window buffer that is + used for device's read/write operations. MMC controllers may + require read/write buffer to start at memory address with + specific alignment, for example 16 or 512 bytes, the value + provided here is used as such alignment. Note that the window + buffer is internal element of FATFS structure, which means + that, in worst scenario, value provided here may cause FATFS + structure to have size of twice the value + endmenu endif # FAT_FILESYSTEM_ELM