spl: fat/fs: Add option to include/exclude FAT write build in SPL
Subsystems (2)
PATCH 1/1 spl: fat/fs: Add option to include/exclude FAT write build in SPL
From: Tien Fong Chee <[email protected]>
Most of the time SPL only needs very simple FAT reading, so having CONFIG_SPL_FAT_WRITE to exclude or undefined would help to save 64KiB default max clustersize from memory.
--- common/spl/Kconfig | 7 +++++++ fs/fat/Makefile | 7 ++++++- fs/fat/fat.c | 4 +++- fs/fs.c | 3 ++- 4 files changed, 18 insertions(+), 3 deletions(-)
common/spl/Kconfig +7 -0
@@ -403,6 +403,13 @@ config SPL_FAT_SUPPORT filesystem from within SPL. Support for the underlying block device (e.g. MMC or USB) must be enabled separately. +config SPL_FAT_WRITE + bool "Support write for FAT filesystems" + help + Enable write support for FAT and VFAT filesystems with SPL. + Support for the underlying block device (e.g. MMC or USB) must be + enabled separately. + config SPL_FPGA_SUPPORT bool "Support FPGAs" help
fs/fat/Makefile +6 -1
@@ -1,5 +1,10 @@ # SPDX-License-Identifier: GPL-2.0+ # +ifdef CONFIG_SPL_BUILD obj-$(CONFIG_FS_FAT) := fat.o -obj-$(CONFIG_FAT_WRITE):= fat_write.o +obj-$(CONFIG_SPL_FAT_WRITE) = fat_write.o +else +obj-$(CONFIG_FS_FAT) := fat.o +obj-$(CONFIG_FAT_WRITE) = fat_write.o +endif
fs/fat/fat.c +3 -1
@@ -145,7 +145,9 @@ static void get_name(dir_entry *dirent, char *s_name) }static int flush_dirty_fat_buffer (fsdata *mydata); -#if !defined(CONFIG_FAT_WRITE ) + +#if (!defined(CONFIG_SPL_BUILD ) && !defined(CONFIG_FAT_WRITE )) || \ + (defined(CONFIG_SPL_BUILD ) && !defined(CONFIG_SPL_FAT_WRITE ))/* Stub for read only operation */ int flush_dirty_fat_buffer (fsdata *mydata) {
fs/fs.c +2 -1
@@ -168,7 +168,8 @@ static struct fstype_info fstypes[] = { .exists = fat_exists, .size = fat_size, .read = fat_read_file, -#ifdef CONFIG_FAT_WRITE +#if (!defined(CONFIG_SPL_BUILD ) && defined(CONFIG_FAT_WRITE )) || \ + (defined(CONFIG_SPL_BUILD ) && defined(CONFIG_SPL_FAT_WRITE )) .write = file_fat_write, .unlink = fat_unlink, .mkdir = fat_mkdir,
Signature · 1 line
1.7.7.4
PATCH 1/1 spl: fat/fs: Add option to include/exclude FAT write build in SPL
Quoted 54 lines · On Thu, Jan 17, 2019 at 8:10 AM <[email protected]> wrote:
From: Tien Fong Chee <[email protected]>
Most of the time SPL only needs very simple FAT reading, so having
CONFIG_SPL_FAT_WRITEto exclude or undefined would help to save 64KiB default max clustersize from memory.Signed-off-by Tien Fong Chee <[email protected]>--- common/spl/Kconfig | 7 +++++++ fs/fat/Makefile | 7 ++++++- fs/fat/fat.c | 4 +++- fs/fs.c | 3 ++- 4 files changed, 18 insertions(+), 3 deletions(-)common/spl/Kconfig +7
-0@@ -403,6 +403,13 @@ config SPL_FAT_SUPPORT filesystem from within SPL. Support for the underlying block device (e.g. MMC or USB) must be enabled separately. +config SPL_FAT_WRITE + bool "Support write for FAT filesystems" + help + Enable write support for FAT and VFAT filesystems with SPL. + Support for the underlying block device (e.g. MMC or USB) must be + enabled separately. + config SPL_FPGA_SUPPORT bool "Support FPGAs" helpfs/fat/Makefile +6
-1@@ -1,5 +1,10 @@ # SPDX-License-Identifier: GPL-2.0+ # +ifdef CONFIG_SPL_BUILD obj-$(CONFIG_FS_FAT) := fat.o -obj-$(CONFIG_FAT_WRITE):= fat_write.o +obj-$(CONFIG_SPL_FAT_WRITE) = fat_write.o +else +obj-$(CONFIG_FS_FAT) := fat.o +obj-$(CONFIG_FAT_WRITE) = fat_write.o +endiffs/fat/fat.c +0
-0
fs/fat/fat.c static void get_name(dir_entry *dirent, char *s_name) · line 150
Quoted 7 lines
fs/fat/fat.c +3
-1@@ -145,7 +145,9 @@ static void get_name(dir_entry *dirent, char *s_name) }static int flush_dirty_fat_buffer (fsdata *mydata); -#if !defined(CONFIG_FAT_WRITE ) + +#if (!defined(CONFIG_SPL_BUILD ) && !defined(CONFIG_FAT_WRITE )) || \ + (defined(CONFIG_SPL_BUILD ) && !defined(CONFIG_SPL_FAT_WRITE ))
What about 'CONFIG_IS_ENABLED(FAT_WRITE)' ?
Regards,
Simon
Quoted 24 lines
fs/fat/fat.c +0
-0/* Stub for read only operation */ int flush_dirty_fat_buffer (fsdata *mydata) {fs/fs.c +2
-2@@ -168,7 +168,8 @@ static struct fstype_info fstypes[] = { .exists = fat_exists, .size = fat_size, .read = fat_read_file, -#ifdef CONFIG_FAT_WRITE +#if (!defined(CONFIG_SPL_BUILD ) && defined(CONFIG_FAT_WRITE )) || \ + (defined(CONFIG_SPL_BUILD ) && defined(CONFIG_SPL_FAT_WRITE )) .write = file_fat_write, .unlink = fat_unlink, .mkdir = fat_mkdir, --1.7.7.4
_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
https://lists.denx.de/listinfo/u-boot
PATCH 1/1 spl: fat/fs: Add option to include/exclude FAT write build in SPL
Quoted 42 lines · Simon Goldschmidt
Quoted 41 lines · On Thu, Jan 17, 2019 at 8:10 AM <[email protected]> wrote:
From: Tien Fong Chee <[email protected]>
Most of the time SPL only needs very simple FAT reading, so having
CONFIG_SPL_FAT_WRITEto exclude or undefined would help to save 64KiB default max clustersize from memory.Signed-off-by Tien Fong Chee <[email protected]>--- common/spl/Kconfig | 7 +++++++ fs/fat/Makefile | 7 ++++++- fs/fat/fat.c | 4 +++- fs/fs.c | 3 ++- 4 files changed, 18 insertions(+), 3 deletions(-)common/spl/Kconfig +7
-0@@ -403,6 +403,13 @@ config SPL_FAT_SUPPORT filesystem from within SPL. Support for the underlying block device (e.g. MMC or USB) must be enabled separately. +config SPL_FAT_WRITE + bool "Support write for FAT filesystems" + help + Enable write support for FAT and VFAT filesystems with SPL. + Support for the underlying block device (e.g. MMC or USB) must be + enabled separately. + config SPL_FPGA_SUPPORT bool "Support FPGAs" helpfs/fat/Makefile +0
-0@@ -1,5 +1,10 @@ # SPDX-License-Identifier: GPL-2.0+ #
Quoted 7 lines
fs/fat/Makefile line 9
Quoted 7 lines
fs/fat/Makefile +5
-1+ifdef CONFIG_SPL_BUILD obj-$(CONFIG_FS_FAT) := fat.o -obj-$(CONFIG_FAT_WRITE):= fat_write.o +obj-$(CONFIG_SPL_FAT_WRITE) = fat_write.o +else +obj-$(CONFIG_FS_FAT) := fat.o +obj-$(CONFIG_FAT_WRITE) = fat_write.o
Like the ext4 one, we need a patch to rename SPL_FAT_SUPPORT to SPL_FS_FAT and then:
obj-$(CONFIG_$(SPL_)FS_FAT) += fat.o
obj-$(CONFIG_$(SPL_)FAT_WRITE) += fat_write.o
Quoted 8 lines
Quoted 8 lines
fs/fat/Makefile +1
-0+endiffs/fat/fat.c +0
-0@@ -145,7 +145,9 @@ static void get_name(dir_entry *dirent, char *s_name) }
Quoted 7 lines
fs/fat/fat.c static void get_name(dir_entry *dirent, char *s_name) · line 150
Quoted 5 lines
fs/fat/fat.c +3
-1static int flush_dirty_fat_buffer (fsdata *mydata); -#if !defined(CONFIG_FAT_WRITE ) + +#if (!defined(CONFIG_SPL_BUILD ) && !defined(CONFIG_FAT_WRITE )) || \ + (defined(CONFIG_SPL_BUILD ) && !defined(CONFIG_SPL_FAT_WRITE ))What about '
CONFIG_IS_ENABLED(FAT_WRITE)' ?
Yes, CONFIG_IS_ENABLED(FAT_WRITE) please.
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: not available URL: <http://lists.denx.de/pipermail/u-boot/attachments/20190117/b09a2588/attachment.sig>
Chee
PATCH 1/1 spl: fat/fs: Add option to include/exclude FAT write build in SPL
Quoted 60 lines · Tom Rini
Quoted 49 lines · Simon Goldschmidt
Quoted 47 lines · On Thu, Jan 17, 2019 at 8:10 AM <[email protected]> wrote:
From: Tien Fong Chee <[email protected]>
Most of the time SPL only needs very simple FAT reading, so having
CONFIG_SPL_FAT_WRITEto exclude or undefined would help to save 64KiB
default max clustersize from memory.Signed-off-by Tien Fong Chee <[email protected]>---
common/spl/Kconfig | 7 +++++++
fs/fat/Makefile | 7 ++++++-
fs/fat/fat.c | 4 +++-
fs/fs.c | 3 ++-4 files changed, 18 insertions(+), 3 deletions(-)common/spl/Kconfig +0
-0@@ -403,6 +403,13 @@ config SPL_FAT_SUPPORTfilesystem from within SPL. Support for the underlying block
device (e.g. MMC or USB) must be enabled separately.+config
SPL_FAT_WRITE
+ bool "Support write for FAT filesystems"
+ help
+ Enable write support for FAT and VFAT filesystems with SPL.
+ Support for the underlying block device (e.g. MMC or USB) must be
+ enabled separately.
+
configSPL_FPGA_SUPPORT
bool "Support FPGAs"
helpfs/fat/Makefile +0
-0@@ -1,5 +1,10 @@ # SPDX-License-Identifier: GPL-2.0+ #Quoted 7 lines
fs/fat/Makefile line 9
Quoted 7 lines
fs/fat/Makefile +1
-0+ifdef CONFIG_SPL_BUILDobj-$(CONFIG_FS_FAT) := fat.o
fs/fat/Makefile +4
-1-obj-$(CONFIG_FAT_WRITE):= fat_write.o +obj-$(CONFIG_SPL_FAT_WRITE) = fat_write.o +else +obj-$(CONFIG_FS_FAT) := fat.o +obj-$(CONFIG_FAT_WRITE) = fat_write.oLike the ext4 one, we need a patch to rename
SPL_FAT_SUPPORTtoSPL_FS_FATand then:
Quoted 2 lines
obj-$(CONFIG_$(SPL_)FS_FAT) += fat.o
obj-$(CONFIG_$(SPL_)FAT_WRITE) += fat_write.o
Okay.
Quoted 20 lines
Quoted 12 lines
Quoted 12 lines
fs/fat/Makefile +1
-0+endiffs/fat/fat.c +0
-0@@ -145,7 +145,9 @@ static void get_name(dir_entry *dirent, char *s_name) }Quoted 8 lines
fs/fat/fat.c static void get_name(dir_entry *dirent, char · line 153
Quoted 7 lines
fs/fat/fat.c +3
-1static int flush_dirty_fat_buffer(fsdata *mydata); -#if !defined(CONFIG_FAT_WRITE ) + +#if (!defined(CONFIG_SPL_BUILD) && !defined(CONFIG_FAT_WRITE)) || \ + (defined(CONFIG_SPL_BUILD) && !defined(CONFIG_SPL_FAT_WRITE))What about '
CONFIG_IS_ENABLED(FAT_WRITE)' ?
Quoted 1 line
Yes,
CONFIG_IS_ENABLED(FAT_WRITE)please.
Okay.