2 * (C) Copyright 2005-2008
3 * Matthias Fuchs, esd GmbH Germany, matthias.fuchs@esd-electronics.com
5 * SPDX-License-Identifier: GPL-2.0+
11 #if !defined(CONFIG_440)
12 #include <asm/4xx_pci.h>
15 #if defined(CONFIG_CMD_BSP)
16 #define ADDRMASK 0xfffff000
19 * Command loadpci: wait for signal from host and boot image.
21 int do_loadpci(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
30 #if defined(CONFIG_440)
31 ptm1la = in32r(PCIL0_PTM1LA);
33 ptm1la = in32r(PTM1LA);
43 puts("\nWaiting for action from pci host -");
46 * Wait for host to write the start address
48 while (*ptr == 0xffffffff) {
52 putc(0x08); /* backspace */
53 putc(str[count2 % 4]);
56 /* Abort if ctrl-c was pressed */
65 printf("\nGot bootcode %08x: ", *ptr);
66 la = ptm1la + (*ptr & ADDRMASK);
67 sprintf(addr, "%08x", la);
69 switch (*ptr & ~ADDRMASK) {
72 * Boot image via bootm
74 printf("booting image at addr 0x%s ...\n", addr);
75 setenv("loadaddr", addr);
76 do_bootm(cmdtp, 0, 0, NULL);
81 * Boot image via "source" command
83 printf("executing script at addr 0x%s ...\n", addr);
91 printf("running command at addr 0x%s ...\n", addr);
92 run_command((char *)la, 0);
96 printf("unhandled boot method\n");
103 loadpci, 1, 1, do_loadpci,
104 "Wait for pci bootcmd and boot it",