/*
- * (C) Copyright 2002
+ * (C) Copyright 2002-2004
* 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 <net.h>
#include <asm/io.h>
#include <pci.h>
-#include <405gp_pci.h>
+#include <asm/4xx_pci.h>
+#include <asm/processor.h>
#include "pci405.h"
-
-#if (CONFIG_COMMANDS & CFG_CMD_BSP)
-
-extern int do_bootm (cmd_tbl_t *, int, int, char *[]);
-
+#if defined(CONFIG_CMD_BSP)
/*
* Command loadpci: wait for signal from host and boot image.
*/
-int do_loadpci(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_loadpci(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
- unsigned int *ptr = 0;
+ unsigned int *ptr;
int count = 0;
int count2 = 0;
- int status;
int i;
char addr[16];
char str[] = "\\|/-";
* Mark sync address
*/
ptr = 0;
+ /* cppcheck-suppress nullPointer */
*ptr = 0xffffffff;
puts("\nWaiting for image from pci host -");
/*
* Wait for host to write the start address
*/
+ /* cppcheck-suppress nullPointer */
while (*ptr == 0xffffffff) {
count++;
if (!(count % 100)) {
pci_read_config_dword(PCIDEVID_405GP, i, ptr++);
}
ptr = (unsigned int *)PCI_REGS_ADDR;
- *ptr = crc32(0, (char *)PCI_REGS_ADDR+4, PCI_REGS_LEN-4);
+ *ptr = crc32(0, (uchar *)PCI_REGS_ADDR+4, PCI_REGS_LEN-4);
printf("\nStoring PCI Configuration Regs...\n");
} else {
sprintf(addr, "%08x", *ptr);
/*
- * Boot image
+ * Boot image via bootm
*/
- printf("\nBooting image at addr 0x%s ...\n", addr);
+ printf("\nBooting Image at addr 0x%s ...\n", addr);
setenv("loadaddr", addr);
local_args[0] = argv[0];
local_args[1] = NULL;
- status = do_bootm (cmdtp, 0, 1, local_args);
+ do_bootm (cmdtp, 0, 1, local_args);
}
return 0;
}
U_BOOT_CMD(
loadpci, 1, 1, do_loadpci,
- "loadpci - Wait for pci-image and boot it\n",
- NULL
+ "Wait for pci-image and boot it",
+ ""
);
-
#endif