]> git.sur5r.net Git - u-boot/blobdiff - board/renesas/sh7785lcr/selfcheck.c
SPDX: Convert all of our single license tags to Linux Kernel style
[u-boot] / board / renesas / sh7785lcr / selfcheck.c
index ce0620f6878d8a91e52672fe933fa80b2c1a9d2c..c5f469342d47fb53edb0b337a37cc877c4a8a417 100644 (file)
@@ -1,23 +1,10 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * Copyright (C) 2008 Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com>
- *
- * 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
  */
 
 #include <common.h>
+#include <console.h>
 #include <asm/io.h>
 #include <asm/processor.h>
 #include <asm/pci.h>
 
 #define SM107_DEVICEID         (0x13e00060 + NOCACHE_OFFSET)
 
-static void wait_ms(unsigned long time)
-{
-       while (time--)
-               udelay(1000);
-}
-
 static void test_pld(void)
 {
        printf("PLD version = %04x\n", readb(PLD_VERSR));
@@ -53,10 +34,10 @@ static void test_led(void)
 {
        printf("turn on LEDs 3, 5, 7, 9\n");
        writeb(0x55, PLD_LEDCR);
-       wait_ms(2000);
+       mdelay(2000);
        printf("turn on LEDs 4, 6, 8, 10\n");
        writeb(0xaa, PLD_LEDCR);
-       wait_ms(2000);
+       mdelay(2000);
        writeb(0x00, PLD_LEDCR);
 }
 
@@ -108,14 +89,12 @@ static void test_pci(void)
        printf("PCI CN2 ID = %08x\n", readl(0xfe040220));
 }
 
-int do_hw_test(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_hw_test(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
        char *cmd;
 
-       if (argc != 2) {
-               printf("Usage:\n%s\n", cmdtp->usage);
-               return 1;
-       }
+       if (argc != 2)
+               return cmd_usage(cmdtp);
 
        cmd = argv[1];
        switch (cmd[0]) {
@@ -150,8 +129,7 @@ int do_hw_test(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
                test_net();
                break;
        default:
-               printf("Usage:\n%s\n", cmdtp->usage);
-               return 1;
+               return cmd_usage(cmdtp);
        }
 
        return 0;
@@ -159,7 +137,7 @@ int do_hw_test(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 
 U_BOOT_CMD(
        hwtest, 2,      1,      do_hw_test,
-       "hwtest - hardware test for R0P7785LC0011RL board\n",
+       "hardware test for R0P7785LC0011RL board",
        "\n"
        "hwtest all   - test all hardware\n"
        "hwtest pld   - output PLD version\n"
@@ -168,5 +146,5 @@ U_BOOT_CMD(
        "hwtest sm107 - output SM107 version\n"
        "hwtest net   - check RTL8110 ID\n"
        "hwtest sata  - check SiI3512 ID\n"
-       "hwtest pci   - output PCI slot device ID\n"
+       "hwtest pci   - output PCI slot device ID"
 );