* (C) Copyright 2005
* Martin Krause, TQ-Systems GmbH, martin.krause@tqs.de.
*
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
+ * SPDX-License-Identifier: GPL-2.0+
*/
#include <common.h>
/*
* BC3450 specific commands
*/
-#if (CONFIG_COMMANDS & CFG_CMD_BSP)
-
-#undef DEBUG
-#ifdef DEBUG
-# define dprintf(fmt,args...) printf(fmt, ##args)
-#else
-# define dprintf(fmt,args...)
-#endif
+#if defined(CONFIG_CMD_BSP)
/*
* Definitions for DS1620 chip
#define THERM_WRITE_TL 0x02
#define THERM_WRITE_TH 0x01
-#define CFG_CPU 2
-#define CFG_1SHOT 1
-#define CFG_STANDALONE 0
+#define CONFIG_SYS_1SHOT 1
+#define CONFIG_SYS_STANDALONE 0
struct therm {
int hi;
#define SM501_POWER_MODE0_GATE 0x00000040UL
#define SM501_POWER_MODE1_GATE 0x00000048UL
#define POWER_MODE_GATE_GPIO_PWM_I2C 0x00000040UL
-#define SM501_GPIO_DATA_LOW 0x00010000UL
+#define SM501_GPIO_DATA_LOW 0x00010000UL
#define SM501_GPIO_DATA_HIGH 0x00010004UL
#define SM501_GPIO_DATA_DIR_LOW 0x00010008UL
#define SM501_GPIO_DATA_DIR_HIGH 0x0001000CUL
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;
}
(PWR_OFF | BUZZER | FP_DATA_TRI);
init_done = 1;
-/* dprintf("sm501_gpio_init: done.\n"); */
+ debug("sm501_gpio_init: done.\n");
+
return 0;
}
* 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;
if (rc > 0x0F)
return -1;
- printf ("0x%x\n", rc);
+ printf ("0x%lx\n", rc);
return 0;
}
U_BOOT_CMD (dip, 1, 1, cmd_dip,
- "dip - read dip switch and config inputs\n",
+ "read dip switch and config inputs",
"\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");
}
U_BOOT_CMD (buz, 2, 1, cmd_buz,
- "buz - turns buzzer on/off\n",
- "\n" "buz <on/off>\n" " - turns the buzzer on or off\n");
+ "turns buzzer on/off",
+ "\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 ();
}
U_BOOT_CMD (fp, 3, 1, cmd_fp,
- "fp - front panes access functions\n",
+ "front panes access functions",
"\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
*/
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;
therm.hi <<= 1;
therm.lo <<= 1;
ds1620_write_state (&therm);
- ds1620_out (THERM_WRITE_CONFIG, 8, CFG_STANDALONE);
+ ds1620_out (THERM_WRITE_CONFIG, 8, CONFIG_SYS_STANDALONE);
return 0;
}
}
}
U_BOOT_CMD (temp, 3, 1, cmd_temp,
- "temp - print current temperature\n",
- "\n" "temp\n" " - print current temperature\n");
+ "print current temperature",
+ "\n" "temp\n" " - print current temperature");
#ifdef CONFIG_BC3450_CAN
/*
static int init_done = 0;
int i;
struct mpc5xxx_mscan *can1 =
- (struct mpc5xxx_mscan *) (CFG_MBAR + 0x0900);
+ (struct mpc5xxx_mscan *) (CONFIG_SYS_MBAR + 0x0900);
struct mpc5xxx_mscan *can2 =
- (struct mpc5xxx_mscan *) (CFG_MBAR + 0x0980);
+ (struct mpc5xxx_mscan *) (CONFIG_SYS_MBAR + 0x0980);
/* GPIO configuration of the CAN pins is done in BC3450.h */
* 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 =
- (struct mpc5xxx_mscan *) (CFG_MBAR + 0x0900);
+ (struct mpc5xxx_mscan *) (CONFIG_SYS_MBAR + 0x0900);
struct mpc5xxx_mscan *can2 =
- (struct mpc5xxx_mscan *) (CFG_MBAR + 0x0980);
+ (struct mpc5xxx_mscan *) (CONFIG_SYS_MBAR + 0x0980);
/* send a message on CAN1 */
can1->cantbsel = 0x01;
/*
* 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;
return 1;
}
-U_BOOT_CMD (test, 2, 1, cmd_test, "test - unit test routines\n", "\n"
+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");
-#endif /* CFG_CMD_BSP */
+ "test unit-off\n"
+ " - turns off the BC3450 unit\n"
+ " WARNING: Unsaved environment variables will be lost!"
+);
+#endif