* [U-Boot] [PATCH] spl: fat/fs: Add option to include/exclude FAT write build in SPL
@ 2019-01-17 7:10 tien.fong.chee at intel.com
2019-01-17 7:54 ` Simon Goldschmidt
0 siblings, 1 reply; 4+ messages in thread
From: tien.fong.chee at intel.com @ 2019-01-17 7:10 UTC (permalink / raw)
To: u-boot
From: Tien Fong Chee <tien.fong.chee@intel.com>
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.
Signed-off-by: Tien Fong Chee <tien.fong.chee@intel.com>
---
common/spl/Kconfig | 7 +++++++
fs/fat/Makefile | 7 ++++++-
fs/fat/fat.c | 4 +++-
fs/fs.c | 3 ++-
4 files changed, 18 insertions(+), 3 deletions(-)
diff --git a/common/spl/Kconfig b/common/spl/Kconfig
index 0ddbffc..dad4c11 100644
--- a/common/spl/Kconfig
+++ b/common/spl/Kconfig
@@ -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
diff --git a/fs/fat/Makefile b/fs/fat/Makefile
index e64b61a..654b8c3 100644
--- a/fs/fat/Makefile
+++ b/fs/fat/Makefile
@@ -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
diff --git a/fs/fat/fat.c b/fs/fat/fat.c
index ac8913e..8803fb4 100644
--- a/fs/fat/fat.c
+++ b/fs/fat/fat.c
@@ -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)
{
diff --git a/fs/fs.c b/fs/fs.c
index cb26517..0b8088b 100644
--- a/fs/fs.c
+++ b/fs/fs.c
@@ -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
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [U-Boot] [PATCH] spl: fat/fs: Add option to include/exclude FAT write build in SPL
2019-01-17 7:10 [U-Boot] [PATCH] spl: fat/fs: Add option to include/exclude FAT write build in SPL tien.fong.chee at intel.com
@ 2019-01-17 7:54 ` Simon Goldschmidt
2019-01-17 12:25 ` Tom Rini
0 siblings, 1 reply; 4+ messages in thread
From: Simon Goldschmidt @ 2019-01-17 7:54 UTC (permalink / raw)
To: u-boot
On Thu, Jan 17, 2019 at 8:10 AM <tien.fong.chee@intel.com> wrote:
>
> From: Tien Fong Chee <tien.fong.chee@intel.com>
>
> 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.
>
> Signed-off-by: Tien Fong Chee <tien.fong.chee@intel.com>
> ---
> common/spl/Kconfig | 7 +++++++
> fs/fat/Makefile | 7 ++++++-
> fs/fat/fat.c | 4 +++-
> fs/fs.c | 3 ++-
> 4 files changed, 18 insertions(+), 3 deletions(-)
>
> diff --git a/common/spl/Kconfig b/common/spl/Kconfig
> index 0ddbffc..dad4c11 100644
> --- a/common/spl/Kconfig
> +++ b/common/spl/Kconfig
> @@ -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
> diff --git a/fs/fat/Makefile b/fs/fat/Makefile
> index e64b61a..654b8c3 100644
> --- a/fs/fat/Makefile
> +++ b/fs/fat/Makefile
> @@ -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
> diff --git a/fs/fat/fat.c b/fs/fat/fat.c
> index ac8913e..8803fb4 100644
> --- a/fs/fat/fat.c
> +++ b/fs/fat/fat.c
> @@ -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
> /* Stub for read only operation */
> int flush_dirty_fat_buffer(fsdata *mydata)
> {
> diff --git a/fs/fs.c b/fs/fs.c
> index cb26517..0b8088b 100644
> --- a/fs/fs.c
> +++ b/fs/fs.c
> @@ -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
^ permalink raw reply [flat|nested] 4+ messages in thread
* [U-Boot] [PATCH] spl: fat/fs: Add option to include/exclude FAT write build in SPL
2019-01-17 7:54 ` Simon Goldschmidt
@ 2019-01-17 12:25 ` Tom Rini
2019-01-18 4:21 ` Chee, Tien Fong
0 siblings, 1 reply; 4+ messages in thread
From: Tom Rini @ 2019-01-17 12:25 UTC (permalink / raw)
To: u-boot
On Thu, Jan 17, 2019 at 08:54:48AM +0100, Simon Goldschmidt wrote:
> On Thu, Jan 17, 2019 at 8:10 AM <tien.fong.chee@intel.com> wrote:
> >
> > From: Tien Fong Chee <tien.fong.chee@intel.com>
> >
> > 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.
> >
> > Signed-off-by: Tien Fong Chee <tien.fong.chee@intel.com>
> > ---
> > common/spl/Kconfig | 7 +++++++
> > fs/fat/Makefile | 7 ++++++-
> > fs/fat/fat.c | 4 +++-
> > fs/fs.c | 3 ++-
> > 4 files changed, 18 insertions(+), 3 deletions(-)
> >
> > diff --git a/common/spl/Kconfig b/common/spl/Kconfig
> > index 0ddbffc..dad4c11 100644
> > --- a/common/spl/Kconfig
> > +++ b/common/spl/Kconfig
> > @@ -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
> > diff --git a/fs/fat/Makefile b/fs/fat/Makefile
> > index e64b61a..654b8c3 100644
> > --- a/fs/fat/Makefile
> > +++ b/fs/fat/Makefile
> > @@ -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
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
> > +endif
> > diff --git a/fs/fat/fat.c b/fs/fat/fat.c
> > index ac8913e..8803fb4 100644
> > --- a/fs/fat/fat.c
> > +++ b/fs/fat/fat.c
> > @@ -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)' ?
Yes, CONFIG_IS_ENABLED(FAT_WRITE) please.
--
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>
^ permalink raw reply [flat|nested] 4+ messages in thread
* [U-Boot] [PATCH] spl: fat/fs: Add option to include/exclude FAT write build in SPL
2019-01-17 12:25 ` Tom Rini
@ 2019-01-18 4:21 ` Chee, Tien Fong
0 siblings, 0 replies; 4+ messages in thread
From: Chee, Tien Fong @ 2019-01-18 4:21 UTC (permalink / raw)
To: u-boot
On Thu, 2019-01-17 at 07:25 -0500, Tom Rini wrote:
> On Thu, Jan 17, 2019 at 08:54:48AM +0100, Simon Goldschmidt wrote:
> >
> > On Thu, Jan 17, 2019 at 8:10 AM <tien.fong.chee@intel.com> wrote:
> > >
> > >
> > > From: Tien Fong Chee <tien.fong.chee@intel.com>
> > >
> > > 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.
> > >
> > > Signed-off-by: Tien Fong Chee <tien.fong.chee@intel.com>
> > > ---
> > > common/spl/Kconfig | 7 +++++++
> > > fs/fat/Makefile | 7 ++++++-
> > > fs/fat/fat.c | 4 +++-
> > > fs/fs.c | 3 ++-
> > > 4 files changed, 18 insertions(+), 3 deletions(-)
> > >
> > > diff --git a/common/spl/Kconfig b/common/spl/Kconfig
> > > index 0ddbffc..dad4c11 100644
> > > --- a/common/spl/Kconfig
> > > +++ b/common/spl/Kconfig
> > > @@ -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
> > > diff --git a/fs/fat/Makefile b/fs/fat/Makefile
> > > index e64b61a..654b8c3 100644
> > > --- a/fs/fat/Makefile
> > > +++ b/fs/fat/Makefile
> > > @@ -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
> 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
Okay.
>
> >
> > >
> > > +endif
> > > diff --git a/fs/fat/fat.c b/fs/fat/fat.c
> > > index ac8913e..8803fb4 100644
> > > --- a/fs/fat/fat.c
> > > +++ b/fs/fat/fat.c
> > > @@ -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)' ?
> Yes, CONFIG_IS_ENABLED(FAT_WRITE) please.
Okay.
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2019-01-18 4:21 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-17 7:10 [U-Boot] [PATCH] spl: fat/fs: Add option to include/exclude FAT write build in SPL tien.fong.chee at intel.com
2019-01-17 7:54 ` Simon Goldschmidt
2019-01-17 12:25 ` Tom Rini
2019-01-18 4:21 ` Chee, Tien Fong
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.