Mike Frysinger | dd14af7 | 2008-11-27 16:50:32 -0500 | [diff] [blame] | 1 | /* |
| 2 | * U-boot - spibootldr.c |
| 3 | * |
| 4 | * Copyright (c) 2005-2008 Analog Devices Inc. |
| 5 | * |
| 6 | * See file CREDITS for list of people who contributed to this |
| 7 | * project. |
| 8 | * |
| 9 | * Licensed under the GPL-2 or later. |
| 10 | */ |
| 11 | |
| 12 | #include <common.h> |
| 13 | #include <command.h> |
| 14 | |
| 15 | #include <asm/blackfin.h> |
| 16 | #include <asm/mach-common/bits/bootrom.h> |
| 17 | |
Wolfgang Denk | 54841ab | 2010-06-28 22:00:46 +0200 | [diff] [blame] | 18 | int do_spibootldr(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) |
Mike Frysinger | dd14af7 | 2008-11-27 16:50:32 -0500 | [diff] [blame] | 19 | { |
| 20 | s32 addr; |
| 21 | |
| 22 | /* Get the address */ |
| 23 | if (argc < 2) |
| 24 | addr = 0; |
| 25 | else |
| 26 | addr = simple_strtoul(argv[1], NULL, 16); |
| 27 | |
| 28 | printf("## Booting ldr image at SPI offset 0x%x ...\n", addr); |
| 29 | |
| 30 | return bfrom_SpiBoot(addr, BFLAG_PERIPHERAL | 4, 0, NULL); |
| 31 | } |
| 32 | |
Frans Meulenbroeks | 388a29d | 2010-07-31 15:01:53 +0200 | [diff] [blame] | 33 | U_BOOT_CMD( |
| 34 | spibootldr, 2, 0, do_spibootldr, |
Mike Frysinger | dd14af7 | 2008-11-27 16:50:32 -0500 | [diff] [blame] | 35 | "boot ldr image from spi", |
| 36 | "[offset]\n" |
| 37 | " - boot ldr image stored at offset into spi\n"); |