Commit 50c2d2e120f10042d2241353b4e0d564fc5c3260

Authored by Nikita Kiryanov
Committed by Stefano Babic
1 parent 9bb4e94742

splash_source: add support for filesystem formatted sata

Add support for loading splashimage from filesystem formatted sata
storage.

Cc: Igor Grinberg <grinberg@compulab.co.il>
Cc: Tom Rini <trini@konsulko.com>
Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il>

Showing 2 changed files with 21 additions and 0 deletions Side-by-side Diff

common/splash_source.c
... ... @@ -13,6 +13,7 @@
13 13 #include <spi_flash.h>
14 14 #include <spi.h>
15 15 #include <usb.h>
  16 +#include <sata.h>
16 17 #include <bmp_layout.h>
17 18 #include <fs.h>
18 19  
... ... @@ -116,6 +117,9 @@
116 117 case SPLASH_STORAGE_USB:
117 118 res = fs_set_blk_dev("usb", location->devpart, FS_TYPE_ANY);
118 119 break;
  120 + case SPLASH_STORAGE_SATA:
  121 + res = fs_set_blk_dev("sata", location->devpart, FS_TYPE_ANY);
  122 + break;
119 123 default:
120 124 printf("Error: unsupported location storage.\n");
121 125 return -ENODEV;
... ... @@ -146,6 +150,19 @@
146 150 }
147 151 #endif
148 152  
  153 +#ifdef CONFIG_CMD_SATA
  154 +static int splash_init_sata(void)
  155 +{
  156 + return sata_initialize();
  157 +}
  158 +#else
  159 +static inline int splash_init_sata(void)
  160 +{
  161 + printf("Cannot load splash image: no SATA support\n");
  162 + return -ENOSYS;
  163 +}
  164 +#endif
  165 +
149 166 #define SPLASH_SOURCE_DEFAULT_FILE_NAME "splash.bmp"
150 167  
151 168 static int splash_load_fs(struct splash_location *location, u32 bmp_load_addr)
... ... @@ -160,6 +177,9 @@
160 177  
161 178 if (location->storage == SPLASH_STORAGE_USB)
162 179 res = splash_init_usb();
  180 +
  181 + if (location->storage == SPLASH_STORAGE_SATA)
  182 + res = splash_init_sata();
163 183  
164 184 if (res)
165 185 return res;
... ... @@ -29,6 +29,7 @@
29 29 SPLASH_STORAGE_SF,
30 30 SPLASH_STORAGE_MMC,
31 31 SPLASH_STORAGE_USB,
  32 + SPLASH_STORAGE_SATA,
32 33 };
33 34  
34 35 enum splash_flags {