splash_source: add support for filesystem formatted sata
authorNikita Kiryanov <nikita@compulab.co.il>
Thu, 29 Oct 2015 09:54:43 +0000 (11:54 +0200)
committerStefano Babic <sbabic@denx.de>
Mon, 16 Nov 2015 11:01:35 +0000 (12:01 +0100)
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>
common/splash_source.c
include/splash.h

index cf475699f04f64e5f22491568ed371d932344fe9..a09dd4b46eb643ad7ceaf0cbd52f282fc486fc19 100644 (file)
@@ -13,6 +13,7 @@
 #include <spi_flash.h>
 #include <spi.h>
 #include <usb.h>
+#include <sata.h>
 #include <bmp_layout.h>
 #include <fs.h>
 
@@ -116,6 +117,9 @@ static int splash_select_fs_dev(struct splash_location *location)
        case SPLASH_STORAGE_USB:
                res = fs_set_blk_dev("usb", location->devpart, FS_TYPE_ANY);
                break;
+       case SPLASH_STORAGE_SATA:
+               res = fs_set_blk_dev("sata", location->devpart, FS_TYPE_ANY);
+               break;
        default:
                printf("Error: unsupported location storage.\n");
                return -ENODEV;
@@ -146,6 +150,19 @@ static inline int splash_init_usb(void)
 }
 #endif
 
+#ifdef CONFIG_CMD_SATA
+static int splash_init_sata(void)
+{
+       return sata_initialize();
+}
+#else
+static inline int splash_init_sata(void)
+{
+       printf("Cannot load splash image: no SATA support\n");
+       return -ENOSYS;
+}
+#endif
+
 #define SPLASH_SOURCE_DEFAULT_FILE_NAME                "splash.bmp"
 
 static int splash_load_fs(struct splash_location *location, u32 bmp_load_addr)
@@ -161,6 +178,9 @@ static int splash_load_fs(struct splash_location *location, u32 bmp_load_addr)
        if (location->storage == SPLASH_STORAGE_USB)
                res = splash_init_usb();
 
+       if (location->storage == SPLASH_STORAGE_SATA)
+               res = splash_init_sata();
+
        if (res)
                return res;
 
index b728bd62a7dd9b0efd83ceffef410da1a0d1be33..f0755ca695f83f643e9aa06b3619096fd4159544 100644 (file)
@@ -29,6 +29,7 @@ enum splash_storage {
        SPLASH_STORAGE_SF,
        SPLASH_STORAGE_MMC,
        SPLASH_STORAGE_USB,
+       SPLASH_STORAGE_SATA,
 };
 
 enum splash_flags {