Commit 50c2d2e120f10042d2241353b4e0d564fc5c3260
Committed by
Stefano Babic
1 parent
9bb4e94742
Exists in
v2017.01-smarct4x
and in
30 other branches
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; |