X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=board%2Famcc%2Fyucca%2Fcmd_yucca.c;h=c1724bf03480819f256f3c7003a6d864c1be887a;hb=4b19b7448e63bab8af17abbb30acff00d8f0dc99;hp=e698b201fc3fad670389a4bc3871e4e3a9a2a689;hpb=681fc61c4cd3b2ef1fdd67224be8c4387fe533fd;p=u-boot diff --git a/board/amcc/yucca/cmd_yucca.c b/board/amcc/yucca/cmd_yucca.c index e698b201fc..c1724bf034 100644 --- a/board/amcc/yucca/cmd_yucca.c +++ b/board/amcc/yucca/cmd_yucca.c @@ -2,28 +2,13 @@ * (C) Copyright 2001 * Denis Peter, MPL AG Switzerland, d.peter@mpl.ch * - * 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+ * * hacked for evb440spe */ #include +#include #include #include "yucca.h" #include @@ -31,12 +16,10 @@ extern void print_evb440spe_info(void); static int setBootStrapClock(cmd_tbl_t *cmdtp, int incrflag, - int flag, int argc, char *argv[]); - -extern int cmd_get_data_size(char* arg, int default_size); + int flag, int argc, char * const argv[]); /* ------------------------------------------------------------------------- */ -int do_evb440spe(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +int do_evb440spe(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { return setBootStrapClock (cmdtp, 1, flag, argc, argv); } @@ -48,22 +31,19 @@ int do_evb440spe(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) * evb440spe wrclk prom0,prom1 */ static int setBootStrapClock(cmd_tbl_t *cmdtp, int incrflag, int flag, - int argc, char *argv[]) + int argc, char * const argv[]) { uchar chip; ulong data; int nbytes; - extern char console_buffer[]; char sysClock[4]; char cpuClock[4]; char plbClock[4]; char pcixClock[4]; - if (argc < 3) { - printf ("Usage:\n%s\n", cmdtp->usage); - return 1; - } + if (argc < 3) + return cmd_usage(cmdtp); if (strcmp(argv[2], "prom0") == 0) chip = IIC0_BOOTPROM_ADDR; @@ -71,8 +51,8 @@ static int setBootStrapClock(cmd_tbl_t *cmdtp, int incrflag, int flag, chip = IIC0_ALT_BOOTPROM_ADDR; do { - printf("enter sys clock frequency 33 or 66 Mhz or quit to abort\n"); - nbytes = readline (" ? "); + printf("enter sys clock frequency 33 or 66 MHz or quit to abort\n"); + nbytes = cli_readline(" ? "); if (strcmp(console_buffer, "quit") == 0) return 0; @@ -87,15 +67,15 @@ static int setBootStrapClock(cmd_tbl_t *cmdtp, int incrflag, int flag, do { if (strcmp(sysClock, "66") == 0) { - printf("enter cpu clock frequency 400, 533 Mhz or quit to abort\n"); + printf("enter cpu clock frequency 400, 533 MHz or quit to abort\n"); } else { #ifdef CONFIG_STRESS - printf("enter cpu clock frequency 400, 500, 533, 667 Mhz or quit to abort\n"); + printf("enter cpu clock frequency 400, 500, 533, 667 MHz or quit to abort\n"); #else - printf("enter cpu clock frequency 400, 500, 533 Mhz or quit to abort\n"); + printf("enter cpu clock frequency 400, 500, 533 MHz or quit to abort\n"); #endif } - nbytes = readline (" ? "); + nbytes = cli_readline(" ? "); if (strcmp(console_buffer, "quit") == 0) return 0; @@ -132,14 +112,14 @@ static int setBootStrapClock(cmd_tbl_t *cmdtp, int incrflag, int flag, } else { do { if (strcmp(cpuClock, "400") == 0) - printf("enter plb clock frequency 100, 133 Mhz or quit to abort\n"); + printf("enter plb clock frequency 100, 133 MHz or quit to abort\n"); #ifdef CONFIG_STRESS if (strcmp(cpuClock, "667") == 0) - printf("enter plb clock frequency 133, 166 Mhz or quit to abort\n"); + printf("enter plb clock frequency 133, 166 MHz or quit to abort\n"); #endif - nbytes = readline (" ? "); + nbytes = cli_readline(" ? "); if (strcmp(console_buffer, "quit") == 0) return 0; @@ -162,8 +142,8 @@ static int setBootStrapClock(cmd_tbl_t *cmdtp, int incrflag, int flag, } do { - printf("enter Pci-X clock frequency 33, 66, 100 or 133 Mhz or quit to abort\n"); - nbytes = readline (" ? "); + printf("enter Pci-X clock frequency 33, 66, 100 or 133 MHz or quit to abort\n"); + nbytes = cli_readline(" ? "); if (strcmp(console_buffer, "quit") == 0) return 0; @@ -178,19 +158,19 @@ static int setBootStrapClock(cmd_tbl_t *cmdtp, int incrflag, int flag, } while (nbytes == 0); - printf("\nsys clk = %sMhz\n", sysClock); - printf("cpu clk = %sMhz\n", cpuClock); - printf("plb clk = %sMhz\n", plbClock); - printf("Pci-X clk = %sMhz\n", pcixClock); + printf("\nsys clk = %s MHz\n", sysClock); + printf("cpu clk = %s MHz\n", cpuClock); + printf("plb clk = %s MHz\n", plbClock); + printf("Pci-X clk = %s MHz\n", pcixClock); do { - printf("\npress [y] to write I2C bootstrap \n"); - printf("or [n] to abort. \n"); - printf("Don't forget to set board switches \n"); - printf("according to your choice before re-starting \n"); - printf("(refer to 440spe_uboot_kit_um_1_01.pdf) \n"); + printf("\npress [y] to write I2C bootstrap\n"); + printf("or [n] to abort.\n"); + printf("Don't forget to set board switches\n"); + printf("according to your choice before re-starting\n"); + printf("(refer to 440spe_uboot_kit_um_1_01.pdf)\n"); - nbytes = readline (" ? "); + nbytes = cli_readline(" ? "); if (strcmp(console_buffer, "n") == 0) return 0; @@ -283,6 +263,6 @@ static int setBootStrapClock(cmd_tbl_t *cmdtp, int incrflag, int flag, U_BOOT_CMD( evb440spe, 3, 1, do_evb440spe, - "evb440spe - program the serial device strap\n", - "wrclk [prom0|prom1] - program the serial device strap\n" + "program the serial device strap", + "wrclk [prom0|prom1] - program the serial device strap" );