]> git.sur5r.net Git - u-boot/blobdiff - board/bc3450/cmd_bc3450.c
blackfin: add bf6xx spi driver
[u-boot] / board / bc3450 / cmd_bc3450.c
index aa46e5812f2baba4adb80aabf65c9e37cac0ba7e..fefffc39c26f7ff92a6c496be8df7b0c3b611306 100644 (file)
  */
 #if defined(CONFIG_CMD_BSP)
 
-#undef DEBUG
-#ifdef DEBUG
-# define dprintf(fmt,args...)  printf(fmt, ##args)
-#else
-# define dprintf(fmt,args...)
-#endif
-
 /*
  * Definitions for DS1620 chip
  */
@@ -52,7 +45,6 @@
 #define THERM_WRITE_TL         0x02
 #define THERM_WRITE_TH         0x01
 
-#define CONFIG_SYS_CPU                 2
 #define CONFIG_SYS_1SHOT               1
 #define CONFIG_SYS_STANDALONE          0
 
@@ -129,7 +121,7 @@ int sm501_gpio_init (void)
        static int init_done = 0;
 
        if (init_done) {
-/*     dprintf("sm501_gpio_init: nothing to be done.\n"); */
+               debug("sm501_gpio_init: nothing to be done.\n");
                return 1;
        }
 
@@ -162,7 +154,8 @@ int sm501_gpio_init (void)
                (PWR_OFF | BUZZER | FP_DATA_TRI);
 
        init_done = 1;
-/*  dprintf("sm501_gpio_init: done.\n"); */
+       debug("sm501_gpio_init: done.\n");
+
        return 0;
 }
 
@@ -173,7 +166,7 @@ int sm501_gpio_init (void)
  * read and prints the dip switch
  * and/or external config inputs (4bits) 0...0x0F
  */
-int cmd_dip (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
+int cmd_dip (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
 {
        vu_long rc = 0;
 
@@ -198,14 +191,14 @@ U_BOOT_CMD (dip, 1, 1, cmd_dip,
            "\n"
            "     - prints the state of the dip switch and/or\n"
            "       external configuration inputs as hex value.\n"
-           "     - \"Config 1\" is the LSB\n");
+           "     - \"Config 1\" is the LSB");
 
 
 /*
  * buz - turns Buzzer on/off
  */
 #ifdef CONFIG_BC3450_BUZZER
-static int cmd_buz (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
+static int cmd_buz (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
 {
        if (argc != 2) {
                printf ("Usage:\nspecify one argument: \"on\" or \"off\"\n");
@@ -229,14 +222,14 @@ static int cmd_buz (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
 
 U_BOOT_CMD (buz, 2, 1, cmd_buz,
            "turns buzzer on/off",
-           "\n" "buz <on/off>\n" "     - turns the buzzer on or off\n");
+           "\n" "buz <on/off>\n" "     - turns the buzzer on or off");
 #endif /* CONFIG_BC3450_BUZZER */
 
 
 /*
  * fp - front panel commands
  */
-static int cmd_fp (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
+static int cmd_fp (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
 {
        sm501_gpio_init ();
 
@@ -326,14 +319,14 @@ U_BOOT_CMD (fp, 3, 1, cmd_fp,
            "\n"
            "fp bl <on/off>\n"
            "     - turns the CCFL backlight of the display on/off\n"
-           "fp <on/off>\n" "     - turns the whole display on/off\n"
+           "fp <on/off>\n" "     - turns the whole display on/off"
 #ifdef CONFIG_BC3450_CRT
+           "\n"
            "fp crt <on/off>\n"
-           "     - enables/disables the crt output (debug only)\n"
+           "     - enables/disables the crt output (debug only)"
 #endif /* CONFIG_BC3450_CRT */
        );
 
-
 /*
  * temp - DS1620 thermometer
  */
@@ -491,7 +484,7 @@ static void ds1620_write_state (struct therm *therm)
        ds1620_out (THERM_START_CONVERT, 0, 0);
 }
 
-static int cmd_temp (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
+static int cmd_temp (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
 {
        int i;
        struct therm therm;
@@ -524,7 +517,7 @@ static int cmd_temp (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
 
 U_BOOT_CMD (temp, 3, 1, cmd_temp,
            "print current temperature",
-           "\n" "temp\n" "     - print current temperature\n");
+           "\n" "temp\n" "     - print current temperature");
 
 #ifdef CONFIG_BC3450_CAN
 /*
@@ -682,7 +675,7 @@ int can_init (void)
  * return 1 on CAN failure
  * return 0 if no failure
  */
-int do_can (char *argv[])
+int do_can (char * const argv[])
 {
        int i;
        struct mpc5xxx_mscan *can1 =
@@ -777,7 +770,7 @@ int do_can (char *argv[])
 /*
  * test - BC3450 HW test routines
  */
-int cmd_test (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
+int cmd_test (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
 {
 #ifdef CONFIG_BC3450_CAN
        int rcode;
@@ -818,10 +811,11 @@ int cmd_test (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
 
 U_BOOT_CMD (test, 2, 1, cmd_test, "unit test routines", "\n"
 #ifdef CONFIG_BC3450_CAN
-           "test can\n"
-           "     - connect CAN1 (X8) with CAN2 (X9) for this test\n"
+       "test can\n"
+       "     - connect CAN1 (X8) with CAN2 (X9) for this test\n"
 #endif /* CONFIG_BC3450_CAN */
-           "test unit-off\n"
-           "     - turns off the BC3450 unit\n"
-           "       WARNING: Unsaved environment variables will be lost!\n");
+       "test unit-off\n"
+       "     - turns off the BC3450 unit\n"
+       "       WARNING: Unsaved environment variables will be lost!"
+);
 #endif