splash: Introduce default_splash_locations
authorAlexey Brodkin <Alexey.Brodkin@synopsys.com>
Fri, 1 Jul 2016 19:48:16 +0000 (22:48 +0300)
committerAnatolij Gustschin <agust@denx.de>
Tue, 26 Jul 2016 06:47:37 +0000 (08:47 +0200)
This change introduces default_splash_locations which
simplifies splash recovery from the first partition of
USB/MMC/SATA drive.

Given usual mapping of the first partition of external media for
basic boot stuff like uImage/zImage, .dtb etc it looks quite
obvious option to put there splash.bmp as well.

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
Cc: Nikita Kiryanov <nikita@compulab.co.il>
Cc: Simon Glass <sjg@chromium.org>
Cc: Jeroen Hofstee <jeroen@myspectrum.nl>
Signed-off-by: Anatolij Gustschin <agust@denx.de>
common/splash.c
include/splash.h

index 561d35b4e41f9072d84e430d028e92ec8aecd8c3..89af437f2cafec3c648b13dc273e1fe4c1e4d287 100644 (file)
 #include <splash.h>
 #include <lcd.h>
 
+static struct splash_location default_splash_locations[] = {
+       {
+               .name = "sf",
+               .storage = SPLASH_STORAGE_SF,
+               .flags = SPLASH_STORAGE_RAW,
+               .offset = 0x0,
+       },
+       {
+               .name = "mmc_fs",
+               .storage = SPLASH_STORAGE_MMC,
+               .flags = SPLASH_STORAGE_FS,
+               .devpart = "0:1",
+       },
+       {
+               .name = "usb_fs",
+               .storage = SPLASH_STORAGE_USB,
+               .flags = SPLASH_STORAGE_FS,
+               .devpart = "0:1",
+       },
+       {
+               .name = "sata_fs",
+               .storage = SPLASH_STORAGE_SATA,
+               .flags = SPLASH_STORAGE_FS,
+               .devpart = "0:1",
+       },
+};
+
 __weak int splash_screen_prepare(void)
 {
-       return 0;
+       return splash_source_load(default_splash_locations,
+                                 ARRAY_SIZE(default_splash_locations));
 }
 
 #ifdef CONFIG_SPLASH_SCREEN_ALIGN
index 25df1cf5ad80395a1074c0c192dcf4b72f9db877..136eac7402465e34488687ccaa9d6d1bbb1b75b6 100644 (file)
@@ -47,7 +47,16 @@ struct splash_location {
        char *ubivol;   /* UBI volume-name for ubifsmount */
 };
 
+#ifdef CONFIG_SPLASH_SOURCE
 int splash_source_load(struct splash_location *locations, uint size);
+#else
+static inline int splash_source_load(struct splash_location *locations,
+                                    uint size)
+{
+       return 0;
+}
+#endif
+
 int splash_screen_prepare(void);
 
 #ifdef CONFIG_SPLASH_SCREEN_ALIGN