]>
git.ipfire.org Git - people/ms/u-boot.git/blob - board/esd/common/cmd_loadpci.c
2 * (C) Copyright 2005-2008
3 * Matthias Fuchs, esd GmbH Germany, matthias.fuchs@esd-electronics.com
5 * SPDX-License-Identifier: GPL-2.0+
10 #if !defined(CONFIG_440)
11 #include <asm/4xx_pci.h>
14 #if defined(CONFIG_CMD_BSP)
15 #define ADDRMASK 0xfffff000
18 * Command loadpci: wait for signal from host and boot image.
20 int do_loadpci(cmd_tbl_t
*cmdtp
, int flag
, int argc
, char * const argv
[])
29 #if defined(CONFIG_440)
30 ptm1la
= in32r(PCIL0_PTM1LA
);
32 ptm1la
= in32r(PTM1LA
);
42 puts("\nWaiting for action from pci host -");
45 * Wait for host to write the start address
47 while (*ptr
== 0xffffffff) {
51 putc(0x08); /* backspace */
52 putc(str
[count2
% 4]);
55 /* Abort if ctrl-c was pressed */
64 printf("\nGot bootcode %08x: ", *ptr
);
65 la
= ptm1la
+ (*ptr
& ADDRMASK
);
66 sprintf(addr
, "%08x", la
);
68 switch (*ptr
& ~ADDRMASK
) {
71 * Boot image via bootm
73 printf("booting image at addr 0x%s ...\n", addr
);
74 setenv("loadaddr", addr
);
75 do_bootm(cmdtp
, 0, 0, NULL
);
80 * Boot image via "source" command
82 printf("executing script at addr 0x%s ...\n", addr
);
90 printf("running command at addr 0x%s ...\n", addr
);
91 run_command((char *)la
, 0);
95 printf("unhandled boot method\n");
102 loadpci
, 1, 1, do_loadpci
,
103 "Wait for pci bootcmd and boot it",