+static int do_bmp_info(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
+{
+ ulong addr;
+
+ switch (argc) {
+ case 1: /* use load_addr as default address */
+ addr = load_addr;
+ break;
+ case 2: /* use argument */
+ addr = simple_strtoul(argv[1], NULL, 16);
+ break;
+ default:
+ return CMD_RET_USAGE;
+ }
+
+ return (bmp_info(addr));
+}
+
+static int do_bmp_display(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
+{
+ ulong addr;
+ int x = 0, y = 0;
+
+ splash_get_pos(&x, &y);
+
+ switch (argc) {
+ case 1: /* use load_addr as default address */
+ addr = load_addr;
+ break;
+ case 2: /* use argument */
+ addr = simple_strtoul(argv[1], NULL, 16);
+ break;
+ case 4:
+ addr = simple_strtoul(argv[1], NULL, 16);
+ x = simple_strtoul(argv[2], NULL, 10);
+ y = simple_strtoul(argv[3], NULL, 10);
+ break;
+ default:
+ return CMD_RET_USAGE;
+ }
+
+ return (bmp_display(addr, x, y));
+}
+
+static cmd_tbl_t cmd_bmp_sub[] = {
+ U_BOOT_CMD_MKENT(info, 3, 0, do_bmp_info, "", ""),
+ U_BOOT_CMD_MKENT(display, 5, 0, do_bmp_display, "", ""),
+};
+
+#ifdef CONFIG_NEEDS_MANUAL_RELOC
+void bmp_reloc(void) {
+ fixup_cmdtable(cmd_bmp_sub, ARRAY_SIZE(cmd_bmp_sub));
+}
+#endif