From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nikita Kiryanov Date: Fri, 23 Oct 2015 13:51:09 +0300 Subject: [U-Boot] [PATCH 2/5] splash_source: add support for filesystem formatted mmc In-Reply-To: <56278456.6000400@compulab.co.il> References: <1440924156-11309-1-git-send-email-nikita@compulab.co.il> <1440924156-11309-3-git-send-email-nikita@compulab.co.il> <56278456.6000400@compulab.co.il> Message-ID: <20151023105109.GD11008@skynet> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Wed, Oct 21, 2015 at 03:25:58PM +0300, Igor Grinberg wrote: > Hi Nikita, > > On 08/30/15 11:42, Nikita Kiryanov wrote: > > Add support for loading splash image from an SD card formatted with > > a filesystem. Update boards to maintain original behavior where needed. > > > > Cc: Igor Grinberg > > Cc: Tom Rini > > Signed-off-by: Nikita Kiryanov > > --- > > [...] > > > diff --git a/common/splash_source.c b/common/splash_source.c > > index 4820c12..cb45c63 100644 > > --- a/common/splash_source.c > > +++ b/common/splash_source.c > > [...] > > > +static int splash_load_fs(struct splash_location *location, u32 bmp_load_addr) > > +{ > > + int res; > > + loff_t bmp_size; > > + > > + res = splash_select_fs_dev(location); > > + if (res) > > + return res; > > + > > + res = fs_size("splash.bmp", &bmp_size); > > The splash.bmp can be a default file name (which is selected through > menuconfig), but I think, will it be better to make it a env variable? Well, the menuconfig part I think is best left to another series because it won't be a simple addition: default file name define would have to depend on CONFIG_SPLASH_SOURCE, which shouldn't exist as an option without CONFIG_SPLASH_SCREEN and its related defines, none of which have a fitting place in the current menuconfig hierarchy. Then there's the board config file changes these additions would cause. As for the env variable suggestion though, that can be done. > > > + if (res) { > > + printf("Error (%d): cannot determine file size\n", res); > > + return res; > > + } > > + > > + if (bmp_load_addr + bmp_size >= gd->start_addr_sp) { > > + printf("Error: splashimage address too high. Data overwrites U-Boot and/or placed beyond DRAM boundaries.\n"); > > + return -EFAULT; > > + } > > + > > + splash_select_fs_dev(location); > > + return fs_read("splash.bmp", bmp_load_addr, 0, 0, NULL); > > +} > > + > > [...] > > -- > Regards, > Igor. >