summaryrefslogtreecommitdiff
path: root/common/splash_source.c
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2022-10-30 17:16:35 -0400
committerTom Rini <trini@konsulko.com>2022-10-30 17:16:35 -0400
commit218e2c45af83f2cb7b1374b9023b4ced6eb0bb77 (patch)
treee78dcbb902ebca32f6048b74e67414419dc4edab /common/splash_source.c
parent6f02819cceb19c334f1dbd6eccefb4ccfae319f9 (diff)
parentb86986c7b314f1378ca5be8df49310a6ce7302f8 (diff)
Merge tag 'video-20221030' of https://source.denx.de/u-boot/custodians/u-boot-video
- fix [hv]sync active vs back porch in dw_mipi_dsi - simplefb rotation support - support splash as raw image from MMC - enhancements to Truetype console (multiple fonts and sizes) - drop old LCD support
Diffstat (limited to 'common/splash_source.c')
-rw-r--r--common/splash_source.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/common/splash_source.c b/common/splash_source.c
index 87e55a54f8c..a2601376198 100644
--- a/common/splash_source.c
+++ b/common/splash_source.c
@@ -65,6 +65,30 @@ static int splash_nand_read_raw(u32 bmp_load_addr, int offset, size_t read_size)
}
#endif
+static int splash_mmc_read_raw(u32 bmp_load_addr, struct splash_location *location,
+ size_t read_size)
+{
+ struct disk_partition partition;
+ struct blk_desc *desc;
+ lbaint_t blkcnt;
+ int ret, n;
+
+ if (!IS_ENABLED(CONFIG_CMD_MMC)) {
+ debug("%s: mmc support not available\n", __func__);
+ return -ENOSYS;
+ }
+
+ ret = part_get_info_by_dev_and_name_or_num("mmc", location->devpart, &desc,
+ &partition, 1);
+ if (ret < 0)
+ return ret;
+
+ blkcnt = DIV_ROUND_UP(read_size, partition.blksz);
+ n = blk_dread(desc, partition.start, blkcnt, (void *)(uintptr_t)bmp_load_addr);
+
+ return (n == blkcnt) ? 0 : -EIO;
+}
+
static int splash_storage_read_raw(struct splash_location *location,
u32 bmp_load_addr, size_t read_size)
{
@@ -75,6 +99,8 @@ static int splash_storage_read_raw(struct splash_location *location,
offset = location->offset;
switch (location->storage) {
+ case SPLASH_STORAGE_MMC:
+ return splash_mmc_read_raw(bmp_load_addr, location, read_size);
case SPLASH_STORAGE_NAND:
return splash_nand_read_raw(bmp_load_addr, offset, read_size);
case SPLASH_STORAGE_SF:
@@ -422,6 +448,7 @@ int splash_source_load(struct splash_location *locations, uint size)
{
struct splash_location *splash_location;
char *env_splashimage_value;
+ char *devpart;
u32 bmp_load_addr;
env_splashimage_value = env_get("splashimage");
@@ -438,6 +465,10 @@ int splash_source_load(struct splash_location *locations, uint size)
if (!splash_location)
return -EINVAL;
+ devpart = env_get("splashdevpart");
+ if (devpart)
+ splash_location->devpart = devpart;
+
if (splash_location->flags == SPLASH_STORAGE_RAW)
return splash_load_raw(splash_location, bmp_load_addr);
else if (splash_location->flags == SPLASH_STORAGE_FS)