[U-Boot] [PATCH 2/5] splash_source: add support for filesystem formatted mmc

Igor Grinberg grinberg at compulab.co.il
Wed Oct 21 14:25:58 CEST 2015


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 <grinberg at compulab.co.il>
> Cc: Tom Rini <trini at konsulko.com>
> Signed-off-by: Nikita Kiryanov <nikita at compulab.co.il>
> ---

[...]

> 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?

> +	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.


More information about the U-Boot mailing list