X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=board%2Famcc%2Fmakalu%2Fcmd_pll.c;h=f12655bea2f1af5a89ae8046296a1cd631b80f3e;hb=1a4596601fd395f3afb8f82f3f840c5e00bdd57a;hp=b2666dd83b015d481da191ab31273de008700158;hpb=211ea91ac6c225bec7e668a03d0ba7d7310679fa;p=u-boot diff --git a/board/amcc/makalu/cmd_pll.c b/board/amcc/makalu/cmd_pll.c index b2666dd83b..f12655bea2 100644 --- a/board/amcc/makalu/cmd_pll.c +++ b/board/amcc/makalu/cmd_pll.c @@ -2,24 +2,7 @@ * (C) Copyright 2000, 2001 * Wolfgang Denk, DENX Software Engineering, wd@denx.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+ */ /* @@ -48,7 +31,7 @@ do { \ int __i; \ for (__i = 0; __i < 2; __i++) \ - eeprom_write (CFG_I2C_EEPROM_ADDR, \ + eeprom_write (CONFIG_SYS_I2C_EEPROM_ADDR, \ EEPROM_CONF_OFFSET + __i*BUF_STEP, \ pll_select[freq], \ BUF_STEP + __i*BUF_STEP); \ @@ -151,7 +134,7 @@ pll_debug(int off) uchar buffer[EEPROM_SDSTP_PARAM]; memset(buffer, 0, sizeof(buffer)); - eeprom_read(CFG_I2C_EEPROM_ADDR, off, + eeprom_read(CONFIG_SYS_I2C_EEPROM_ADDR, off, buffer, EEPROM_SDSTP_PARAM); printf("Debug: SDSTP[0-3] at offset \"0x%02x\" lists as follows: \n", off); @@ -168,9 +151,9 @@ test_write(void) /* * Write twice, 8 bytes per write */ - eeprom_write (CFG_I2C_EEPROM_ADDR, EEPROM_TEST_OFFSET, + eeprom_write (CONFIG_SYS_I2C_EEPROM_ADDR, EEPROM_TEST_OFFSET, testbuf, 8); - eeprom_write (CFG_I2C_EEPROM_ADDR, EEPROM_TEST_OFFSET+8, + eeprom_write (CONFIG_SYS_I2C_EEPROM_ADDR, EEPROM_TEST_OFFSET+8, testbuf, 16); printf("done\n"); @@ -178,18 +161,18 @@ test_write(void) } int -do_pll_alter (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +do_pll_alter (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { char c = '\0'; pll_freq_t pll_freq; - if (argc < 2) { - printf("Usage: \n%s\n", cmdtp->usage); - goto ret; - } - for (pll_freq = PLL_ebc20; pll_freq < PLL_TOTAL; pll_freq++) + if (argc < 2) + return cmd_usage(cmdtp); + + for (pll_freq = PLL_ebc20; pll_freq < PLL_TOTAL; pll_freq++) { if (!strcmp(pll_name[pll_freq], argv[1])) break; + } switch (pll_freq) { case PLL_ebc20: @@ -222,9 +205,8 @@ do_pll_alter (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) goto ret; default: - printf("Invalid options" - "\n\nUsage: \n%s\n", cmdtp->usage); - goto ret; + printf("Invalid options\n\n"); + return cmd_usage(cmdtp); } printf("PLL set to %s, " @@ -236,8 +218,8 @@ ret: } U_BOOT_CMD( - pllalter, CFG_MAXARGS, 1, do_pll_alter, - "pllalter- change pll frequence \n", + pllalter, CONFIG_SYS_MAXARGS, 1, do_pll_alter, + "change pll frequence", "pllalter - change pll frequence \n\n\ ** New freq take effect after reset. ** \n\ ----------------------------------------------\n\ @@ -291,7 +273,7 @@ U_BOOT_CMD( RCONF: Read current eeprom configuration. \n\ -----------------------------------------------\n\ WTEST: Test EEPROM write with predefined values\n\ - -----------------------------------------------\n" - ); + -----------------------------------------------" +); -#endif /* (CONFIG_COMMANDS & CFG_CMD_EEPROM) */ +#endif /* CONFIG_CMD_EEPROM */