1 // SPDX-License-Identifier: GPL-2.0+
8 * BMP handling routines
18 static int do_bmp_info(struct cmd_tbl *cmdtp, int flag, int argc,
24 case 1: /* use image_load_addr as default address */
25 addr = image_load_addr;
27 case 2: /* use argument */
28 addr = hextoul(argv[1], NULL);
34 return (bmp_info(addr));
37 static int do_bmp_display(struct cmd_tbl *cmdtp, int flag, int argc,
43 splash_get_pos(&x, &y);
46 case 1: /* use image_load_addr as default address */
47 addr = image_load_addr;
49 case 2: /* use argument */
50 addr = hextoul(argv[1], NULL);
53 addr = hextoul(argv[1], NULL);
54 if (!strcmp(argv[2], "m"))
57 x = dectoul(argv[2], NULL);
58 if (!strcmp(argv[3], "m"))
61 y = dectoul(argv[3], NULL);
67 return (bmp_display(addr, x, y));
70 static struct cmd_tbl cmd_bmp_sub[] = {
71 U_BOOT_CMD_MKENT(info, 3, 0, do_bmp_info, "", ""),
72 U_BOOT_CMD_MKENT(display, 5, 0, do_bmp_display, "", ""),
75 static int do_bmp(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
79 /* Strip off leading 'bmp' command argument */
83 c = find_cmd_tbl(argv[0], &cmd_bmp_sub[0], ARRAY_SIZE(cmd_bmp_sub));
86 return c->cmd(cmdtp, flag, argc, argv);
93 "manipulate BMP image data",
94 "info <imageAddr> - display image info\n"
95 "bmp display <imageAddr> [x y] - display image at x,y"