splash_source: rename *_read() to *_read_raw()
Rename raw read functions to *_read_raw() in preparation for supporting read_fs() feature. Cc: Igor Grinberg <grinberg@compulab.co.il> Cc: Tom Rini <trini@konsulko.com> Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il> Acked-by: Igor Grinberg <grinberg@compulab.co.il>
This commit is contained in:
parent
3d99e86269
commit
bcbb6448b9
|
@ -18,7 +18,7 @@ DECLARE_GLOBAL_DATA_PTR;
|
||||||
|
|
||||||
#ifdef CONFIG_SPI_FLASH
|
#ifdef CONFIG_SPI_FLASH
|
||||||
static struct spi_flash *sf;
|
static struct spi_flash *sf;
|
||||||
static int splash_sf_read(u32 bmp_load_addr, int offset, size_t read_size)
|
static int splash_sf_read_raw(u32 bmp_load_addr, int offset, size_t read_size)
|
||||||
{
|
{
|
||||||
if (!sf) {
|
if (!sf) {
|
||||||
sf = spi_flash_probe(CONFIG_SF_DEFAULT_BUS,
|
sf = spi_flash_probe(CONFIG_SF_DEFAULT_BUS,
|
||||||
|
@ -32,7 +32,7 @@ static int splash_sf_read(u32 bmp_load_addr, int offset, size_t read_size)
|
||||||
return spi_flash_read(sf, offset, read_size, (void *)bmp_load_addr);
|
return spi_flash_read(sf, offset, read_size, (void *)bmp_load_addr);
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
static int splash_sf_read(u32 bmp_load_addr, int offset, size_t read_size)
|
static int splash_sf_read_raw(u32 bmp_load_addr, int offset, size_t read_size)
|
||||||
{
|
{
|
||||||
debug("%s: sf support not available\n", __func__);
|
debug("%s: sf support not available\n", __func__);
|
||||||
return -ENOSYS;
|
return -ENOSYS;
|
||||||
|
@ -40,7 +40,7 @@ static int splash_sf_read(u32 bmp_load_addr, int offset, size_t read_size)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_CMD_NAND
|
#ifdef CONFIG_CMD_NAND
|
||||||
static int splash_nand_read(u32 bmp_load_addr, int offset, size_t read_size)
|
static int splash_nand_read_raw(u32 bmp_load_addr, int offset, size_t read_size)
|
||||||
{
|
{
|
||||||
return nand_read_skip_bad(&nand_info[nand_curr_device], offset,
|
return nand_read_skip_bad(&nand_info[nand_curr_device], offset,
|
||||||
&read_size, NULL,
|
&read_size, NULL,
|
||||||
|
@ -48,14 +48,14 @@ static int splash_nand_read(u32 bmp_load_addr, int offset, size_t read_size)
|
||||||
(u_char *)bmp_load_addr);
|
(u_char *)bmp_load_addr);
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
static int splash_nand_read(u32 bmp_load_addr, int offset, size_t read_size)
|
static int splash_nand_read_raw(u32 bmp_load_addr, int offset, size_t read_size)
|
||||||
{
|
{
|
||||||
debug("%s: nand support not available\n", __func__);
|
debug("%s: nand support not available\n", __func__);
|
||||||
return -ENOSYS;
|
return -ENOSYS;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static int splash_storage_read(struct splash_location *location,
|
static int splash_storage_read_raw(struct splash_location *location,
|
||||||
u32 bmp_load_addr, size_t read_size)
|
u32 bmp_load_addr, size_t read_size)
|
||||||
{
|
{
|
||||||
u32 offset;
|
u32 offset;
|
||||||
|
@ -66,9 +66,9 @@ static int splash_storage_read(struct splash_location *location,
|
||||||
offset = location->offset;
|
offset = location->offset;
|
||||||
switch (location->storage) {
|
switch (location->storage) {
|
||||||
case SPLASH_STORAGE_NAND:
|
case SPLASH_STORAGE_NAND:
|
||||||
return splash_nand_read(bmp_load_addr, offset, read_size);
|
return splash_nand_read_raw(bmp_load_addr, offset, read_size);
|
||||||
case SPLASH_STORAGE_SF:
|
case SPLASH_STORAGE_SF:
|
||||||
return splash_sf_read(bmp_load_addr, offset, read_size);
|
return splash_sf_read_raw(bmp_load_addr, offset, read_size);
|
||||||
default:
|
default:
|
||||||
printf("Unknown splash location\n");
|
printf("Unknown splash location\n");
|
||||||
}
|
}
|
||||||
|
@ -85,7 +85,7 @@ static int splash_load_raw(struct splash_location *location, u32 bmp_load_addr)
|
||||||
if (bmp_load_addr + bmp_header_size >= gd->start_addr_sp)
|
if (bmp_load_addr + bmp_header_size >= gd->start_addr_sp)
|
||||||
goto splash_address_too_high;
|
goto splash_address_too_high;
|
||||||
|
|
||||||
res = splash_storage_read(location, bmp_load_addr, bmp_header_size);
|
res = splash_storage_read_raw(location, bmp_load_addr, bmp_header_size);
|
||||||
if (res < 0)
|
if (res < 0)
|
||||||
return res;
|
return res;
|
||||||
|
|
||||||
|
@ -95,7 +95,7 @@ static int splash_load_raw(struct splash_location *location, u32 bmp_load_addr)
|
||||||
if (bmp_load_addr + bmp_size >= gd->start_addr_sp)
|
if (bmp_load_addr + bmp_size >= gd->start_addr_sp)
|
||||||
goto splash_address_too_high;
|
goto splash_address_too_high;
|
||||||
|
|
||||||
return splash_storage_read(location, bmp_load_addr, bmp_size);
|
return splash_storage_read_raw(location, bmp_load_addr, bmp_size);
|
||||||
|
|
||||||
splash_address_too_high:
|
splash_address_too_high:
|
||||||
printf("Error: splashimage address too high. Data overwrites U-Boot and/or placed beyond DRAM boundaries.\n");
|
printf("Error: splashimage address too high. Data overwrites U-Boot and/or placed beyond DRAM boundaries.\n");
|
||||||
|
|
Loading…
Reference in New Issue