arm: mvebu: fix ahci mbus config in SPL
[oweals/u-boot.git] / cmd / bmp.c
index 02bdf48b4d422ced97dea7587f07d74c0aee6d6e..00f0256a30e257b7a50028642c9051e85b79de19 100644 (file)
--- a/cmd/bmp.c
+++ b/cmd/bmp.c
@@ -57,7 +57,7 @@ struct bmp_image *gunzip_bmp(unsigned long addr, unsigned long *lenp,
        bmp = dst;
 
        /* align to 32-bit-aligned-address + 2 */
-       bmp = (struct bmp_image *)((((unsigned int)dst + 1) & ~3) + 2);
+       bmp = (struct bmp_image *)((((uintptr_t)dst + 1) & ~3) + 2);
 
        if (gunzip(bmp, CONFIG_SYS_VIDEO_LOGO_MAX_SIZE, map_sysmem(addr, 0),
                   &len) != 0) {
@@ -124,8 +124,14 @@ static int do_bmp_display(cmd_tbl_t * cmdtp, int flag, int argc, char * const ar
                break;
        case 4:
                addr = simple_strtoul(argv[1], NULL, 16);
-               x = simple_strtoul(argv[2], NULL, 10);
-               y = simple_strtoul(argv[3], NULL, 10);
+               if (!strcmp(argv[2], "m"))
+                       x = BMP_ALIGN_CENTER;
+               else
+                       x = simple_strtoul(argv[2], NULL, 10);
+               if (!strcmp(argv[3], "m"))
+                       y = BMP_ALIGN_CENTER;
+               else
+                       y = simple_strtoul(argv[3], NULL, 10);
                break;
        default:
                return CMD_RET_USAGE;
@@ -249,9 +255,11 @@ int bmp_display(ulong addr, int x, int y)
        if (!ret) {
                bool align = false;
 
-# ifdef CONFIG_SPLASH_SCREEN_ALIGN
-               align = true;
-# endif /* CONFIG_SPLASH_SCREEN_ALIGN */
+               if (CONFIG_IS_ENABLED(SPLASH_SCREEN_ALIGN) ||
+                   x == BMP_ALIGN_CENTER ||
+                   y == BMP_ALIGN_CENTER)
+                       align = true;
+
                ret = video_bmp_display(dev, addr, x, y, align);
        }
 #elif defined(CONFIG_LCD)