4 * Copyright (c) 2005-2008 Analog Devices Inc.
6 * See file CREDITS for list of people who contributed to this
9 * Licensed under the GPL-2 or later.
16 #include <asm/blackfin.h>
17 #include <asm/mach-common/bits/bootrom.h>
20 * the bootldr command loads an address, checks to see if there
21 * is a Boot stream that the on-chip BOOTROM can understand,
22 * and loads it via the BOOTROM Callback. It is possible
23 * to also add booting from SPI, or TWI, but this function does
24 * not currently support that.
27 int do_bootldr(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
34 addr = (void *)load_addr;
36 addr = (void *)simple_strtoul(argv[1], NULL, 16);
38 /* Check if it is a LDR file */
40 #if defined(__ADSPBF54x__) || defined(__ADSPBF52x__)
41 if ((*data & 0xFF000000) == 0xAD000000 && data[2] == 0x00000000) {
43 if (*data == 0xFF800060 || *data == 0xFF800040 || *data == 0xFF800020) {
45 /* We want to boot from FLASH or SDRAM */
46 printf("## Booting ldr image at 0x%p ...\n", addr);
54 : "q7" (addr), "a" (_BOOTROM_MEMBOOT));
56 printf("## No ldr image at address 0x%p\n", addr);
61 U_BOOT_CMD(bootldr, 2, 0, do_bootldr,
62 "bootldr - boot ldr image from memory\n",
64 " - boot ldr image stored in memory\n");