]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - common/cmd_vfd.c
fdt_support: Fix buffer overflow in fdt_fixup_memory_banks
[karo-tx-uboot.git] / common / cmd_vfd.c
index 3ef1395b2a349a87d3440bf86d06aacd6ace4f7b..18c14d1f3bc9456eac24618b5492ef910310e022 100644 (file)
@@ -35,7 +35,7 @@
 #include <common.h>
 #include <command.h>
 
-#if (CONFIG_COMMANDS & CFG_CMD_VFD)
+#if defined(CONFIG_CMD_VFD)
 
 #include <vfd_logo.h>
 #define VFD_TEST_LOGO_BMPNR 0
@@ -45,16 +45,14 @@ extern int transfer_pic(unsigned char, unsigned char *, int, int);
 
 int trab_vfd (ulong bitmap);
 
-int do_vfd (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_vfd (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
        ulong bitmap;
 
-       if (argc != 2) {
-               printf ("Usage:\n%s\n", cmdtp->usage);
-               return 1;
-       }
+       if (argc != 2)
+               return cmd_usage(cmdtp);
 
-       if (argv[1][0] == '#') {        /* select bitmap by number */
+       if (argv[1][0] == '/') {        /* select bitmap by number */
                bitmap = simple_strtoul(argv[1]+1, NULL, 10);
                return (trab_vfd(bitmap));
        }
@@ -64,9 +62,17 @@ int do_vfd (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
        transfer_pic(3, (uchar *)bitmap, VFD_LOGO_HEIGHT, VFD_LOGO_WIDTH);
        return 0;
 }
-#endif /* CFG_CMD_VFD */
 
-#ifdef CONFIG_VFD
+U_BOOT_CMD(
+       vfd,    2,      0,      do_vfd,
+       "load a bitmap to the VFDs on TRAB",
+       "/N\n"
+       "    - load bitmap N to the VFDs (N is _decimal_ !!!)\n"
+       "vfd ADDR\n"
+       "    - load bitmap at address ADDR"
+);
+#endif
+
 int trab_vfd (ulong bitmap)
 {
        uchar *addr;
@@ -81,8 +87,6 @@ int trab_vfd (ulong bitmap)
                }
                break;
        case VFD_REMOTE_LOGO_BMPNR:
-               transfer_pic(3, &vfd_remote_logo_bitmap[0],
-                       VFD_LOGO_HEIGHT, VFD_LOGO_WIDTH);
                if ((s = getenv ("bitmap1")) != NULL) {
                        addr = (uchar *)simple_strtoul (s, NULL, 16);
                } else {
@@ -96,4 +100,3 @@ int trab_vfd (ulong bitmap)
        transfer_pic(3, addr, VFD_LOGO_HEIGHT, VFD_LOGO_WIDTH);
        return 0;
 }
-#endif /* CONFIG_VFD */