]> git.ipfire.org Git - people/ms/u-boot.git/blobdiff - board/esd/cpci405/cpci405.c
Add GPL-2.0+ SPDX-License-Identifier to source files
[people/ms/u-boot.git] / board / esd / cpci405 / cpci405.c
index c29c876d6170b07a0e544616ff3ef16f8901b597..63cd862d2d2ff6b31dc94042eee924b430cc0c49 100644 (file)
@@ -2,23 +2,7 @@
  * (C) Copyright 2001-2003
  * Stefan Roese, esd gmbh germany, stefan.roese@esd-electronics.com
  *
- * 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>
 #include <libfdt.h>
@@ -32,7 +16,6 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
 extern void __ft_board_setup(void *blob, bd_t *bd);
 
 #undef FPGA_DEBUG
@@ -89,7 +72,6 @@ int N_AU_IMAGES = (sizeof(au_image) / sizeof(au_image[0]));
 
 /* Prototypes */
 int cpci405_version(void);
-int gunzip(void *, int, unsigned char *, unsigned long *);
 void lxt971_no_sleep(void);
 
 int board_early_init_f(void)
@@ -417,7 +399,7 @@ int checkboard(void)
        int len;
 #endif
        char str[64];
-       int i = getenv_r("serial#", str, sizeof(str));
+       int i = getenv_f("serial#", str, sizeof(str));
        unsigned short ver;
 
        puts("Board: ");
@@ -651,14 +633,13 @@ int OWReadByte(void)
        return result;
 }
 
-int do_onewire(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_onewire(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
        unsigned short val;
        int result;
        int i;
        unsigned char ow_id[6];
        char str[32];
-       unsigned char ow_crc;
 
        /*
         * Clear 1-wire bit (open drain with pull-up)
@@ -677,11 +658,10 @@ int do_onewire(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
        OWReadByte(); /* skip family code ( == 0x01) */
        for (i = 0; i < 6; i++)
                ow_id[i] = OWReadByte();
-       ow_crc = OWReadByte(); /* read crc */
+       OWReadByte(); /* read crc */
 
-       sprintf(str, "%08X%04X",
-               *(unsigned int *)&ow_id[0],
-               *(unsigned short *)&ow_id[4]);
+       sprintf(str, "%02X%02X%02X%02X%02X%02X",
+               ow_id[0], ow_id[1], ow_id[2], ow_id[3], ow_id[4], ow_id[5]);
        printf("Setting environment variable 'ow_id' to %s\n", str);
        setenv("ow_id", str);
 
@@ -699,9 +679,8 @@ U_BOOT_CMD(
 /*
  * Write backplane ip-address...
  */
-int do_get_bpip(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_get_bpip(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
-       bd_t *bd = gd->bd;
        char *buf;
        ulong crc;
        char str[32];
@@ -734,12 +713,7 @@ int do_get_bpip(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
                /*
                 * Update whole ip-addr
                 */
-               bd->bi_ip_addr = ipaddr;
-               sprintf(str, "%ld.%ld.%ld.%ld",
-                       (bd->bi_ip_addr & 0xff000000) >> 24,
-                       (bd->bi_ip_addr & 0x00ff0000) >> 16,
-                       (bd->bi_ip_addr & 0x0000ff00) >> 8,
-                       (bd->bi_ip_addr & 0x000000ff));
+               sprintf(str, "%pI4", &ipaddr);
                setenv("ipaddr", str);
                printf("Updated ip_addr from bp_eeprom to %s!\n", str);
        }
@@ -757,7 +731,7 @@ U_BOOT_CMD(
 /*
  * Set and print backplane ip...
  */
-int do_set_bpip(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_set_bpip(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
        char *buf;
        char str[32];