From: Otavio Salvador Date: Tue, 4 Jun 2013 18:25:42 +0000 (-0300) Subject: bmp: Respect "splashpos" if it is defined X-Git-Url: https://code.ossystems.io/gitweb?a=commitdiff_plain;h=bb7f0b1acfbfd9f009713b54bd2f633024b7e9af;p=bsp%2Fu-boot.git bmp: Respect "splashpos" if it is defined Signed-off-by: Otavio Salvador --- diff --git a/common/cmd_bmp.c b/common/cmd_bmp.c index 5a52edde31..48e045e08a 100644 --- a/common/cmd_bmp.c +++ b/common/cmd_bmp.c @@ -33,6 +33,10 @@ #include #include +#ifdef CONFIG_SPLASH_SCREEN_ALIGN +#define BMP_ALIGN_CENTER 0x7FFF +#endif + static int bmp_info (ulong addr); /* @@ -112,6 +116,25 @@ static int do_bmp_display(cmd_tbl_t * cmdtp, int flag, int argc, char * const ar { ulong addr; int x = 0, y = 0; + __maybe_unused char *s; + +#ifdef CONFIG_SPLASH_SCREEN_ALIGN + s = getenv("splashpos"); + if (s != NULL) { + if (s[0] == 'm') + x = BMP_ALIGN_CENTER; + else + x = simple_strtol(s, NULL, 0); + + s = strchr(s + 1, ','); + if (s != NULL) { + if (s[1] == 'm') + y = BMP_ALIGN_CENTER; + else + y = simple_strtol(s + 1, NULL, 0); + } + } +#endif /* CONFIG_SPLASH_SCREEN_ALIGN */ switch (argc) { case 1: /* use load_addr as default address */