From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alex Kiernan Date: Sat, 9 Jun 2018 14:26:45 +0100 Subject: [U-Boot] [PATCH] block: Add SPL_BLOCK_CACHE and default n In-Reply-To: <20180608204816.15226-1-aford173@gmail.com> References: <20180608204816.15226-1-aford173@gmail.com> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Fri, Jun 8, 2018 at 9:48 PM Adam Ford wrote: > > When enabling BLOCK_CACHE on devices with limited RAM during SPL, > some devices may not boot. This creates an option to enable > block caching in SPL by defaults off. It is dependant on BLOCK_CACHE > and SPL_BLK > > Fixes: 46960ad6d09b ("block: Have BLOCK_CACHE default to y in some cases") > > Signed-off-by: Adam Ford > > diff --git a/drivers/block/Kconfig b/drivers/block/Kconfig > index 0792373cfc..8ef363b3d4 100644 > --- a/drivers/block/Kconfig > +++ b/drivers/block/Kconfig > @@ -37,6 +37,13 @@ config BLOCK_CACHE > it will prevent repeated reads from directory structures and other > filesystem data structures. > > +config SPL_BLOCK_CACHE > + bool "Use block device cache in SPL" > + depends on BLOCK_CACHE && SPL_BLK > + default n > + help > + This option enables the disk-block cache in SPL > + > config IDE > bool "Support IDE controllers" > select HAVE_BLOCK_DEVICE > diff --git a/drivers/block/Makefile b/drivers/block/Makefile > index 5fcafb193e..a9af28a552 100644 > --- a/drivers/block/Makefile > +++ b/drivers/block/Makefile > @@ -11,4 +11,9 @@ endif > > obj-$(CONFIG_IDE) += ide.o > obj-$(CONFIG_SANDBOX) += sandbox.o > +ifdef CONFIG_SPL_BUILD > +obj-$(SPL_BLOCK_CACHE) += blkcache.o CONFIG_SPL_BLOCK_CACHE? > +endif > +ifndef CONFIG_SPL_BUILD > obj-$(CONFIG_BLOCK_CACHE) += blkcache.o > +endif Could this all get replaced by: obj-$(CONFIG_$(SPL_)BLOCK_CACHE) += blkcache.o > diff --git a/include/blk.h b/include/blk.h > index fc0c239e46..c17c5eb047 100644 > --- a/include/blk.h > +++ b/include/blk.h > @@ -111,7 +111,8 @@ struct blk_desc { > #define PAD_TO_BLOCKSIZE(size, blk_desc) \ > (PAD_SIZE(size, blk_desc->blksz)) > > -#ifdef CONFIG_BLOCK_CACHE > +#if (defined(CONFIG_BLOCK_CACHE) && !defined(CONFIG_SPL_BUILD)) || \ > + (defined(CONFIG_SPL_BLOCK_CACHE) && defined(CONFIG_SPL_BUILD)) > /** Replace with CONFIG_IS_ENABLED? > * blkcache_read() - attempt to read a set of blocks from cache > * > -- > 2.17.1 > > _______________________________________________ > U-Boot mailing list > U-Boot at lists.denx.de > https://lists.denx.de/listinfo/u-boot -- Alex Kiernan