projects
/
oweals
/
u-boot.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
bootm: Require boot function only if it is about to be used
[oweals/u-boot.git]
/
common
/
cmd_bootldr.c
diff --git
a/common/cmd_bootldr.c
b/common/cmd_bootldr.c
index 48d113f1f12e988e4ab7d64085698fe253b53808..bc5c1f95eaff9cdf783347e8ded104d16035bb29 100644
(file)
--- a/
common/cmd_bootldr.c
+++ b/
common/cmd_bootldr.c
@@
-24,7
+24,7
@@
static bool ldr_valid_signature(uint8_t *data)
#if defined(__ADSPBF561__)
/* BF56x has a 4 byte global header */
#if defined(__ADSPBF561__)
/* BF56x has a 4 byte global header */
- if (data[3] ==
0xA0
)
+ if (data[3] ==
(GFLAG_56X_SIGN_MAGIC << (GFLAG_56X_SIGN_SHIFT - 24))
)
return true;
#elif defined(__ADSPBF531__) || defined(__ADSPBF532__) || defined(__ADSPBF533__) || \
return true;
#elif defined(__ADSPBF531__) || defined(__ADSPBF532__) || defined(__ADSPBF533__) || \
@@
-53,11
+53,6
@@
static bool ldr_valid_signature(uint8_t *data)
* LDRs from random memory addresses. So whenever possible, use that. In
* the older cases (BF53x/BF561), parse the LDR format ourselves.
*/
* LDRs from random memory addresses. So whenever possible, use that. In
* the older cases (BF53x/BF561), parse the LDR format ourselves.
*/
-#define ZEROFILL 0x0001
-#define RESVECT 0x0002
-#define INIT 0x0008
-#define IGNORE 0x0010
-#define FINAL 0x8000
static void ldr_load(uint8_t *base_addr)
{
#if defined(__ADSPBF531__) || defined(__ADSPBF532__) || defined(__ADSPBF533__) || \
static void ldr_load(uint8_t *base_addr)
{
#if defined(__ADSPBF531__) || defined(__ADSPBF532__) || defined(__ADSPBF533__) || \
@@
-76,7
+71,7
@@
static void ldr_load(uint8_t *base_addr)
# endif
memmove(&flags, base_addr + 8, sizeof(flags));
# endif
memmove(&flags, base_addr + 8, sizeof(flags));
- bfin_write_EVT1(flags & RESVECT ? 0xFFA00000 : 0xFFA08000);
+ bfin_write_EVT1(flags &
BFLAG_53X_
RESVECT ? 0xFFA00000 : 0xFFA08000);
do {
/* block header may not be aligned */
do {
/* block header may not be aligned */
@@
-85,24
+80,24
@@
static void ldr_load(uint8_t *base_addr)
memmove(&flags, base_addr+8, sizeof(flags));
base_addr += sizeof(addr) + sizeof(count) + sizeof(flags);
memmove(&flags, base_addr+8, sizeof(flags));
base_addr += sizeof(addr) + sizeof(count) + sizeof(flags);
- printf("loading to 0x%08x (
0x%
x bytes) flags: 0x%04x\n",
+ printf("loading to 0x%08x (
%#
x bytes) flags: 0x%04x\n",
addr, count, flags);
addr, count, flags);
- if (!(flags & IGNORE)) {
- if (flags & ZEROFILL)
+ if (!(flags &
BFLAG_53X_
IGNORE)) {
+ if (flags &
BFLAG_53X_
ZEROFILL)
memset((void *)addr, 0x00, count);
else
memcpy((void *)addr, base_addr, count);
memset((void *)addr, 0x00, count);
else
memcpy((void *)addr, base_addr, count);
- if (flags & INIT) {
+ if (flags &
BFLAG_53X_
INIT) {
void (*init)(void) = (void *)addr;
init();
}
}
void (*init)(void) = (void *)addr;
init();
}
}
- if (!(flags & ZEROFILL))
+ if (!(flags &
BFLAG_53X_
ZEROFILL))
base_addr += count;
base_addr += count;
- } while (!(flags & FINAL));
+ } while (!(flags &
BFLAG_53X_
FINAL));
#endif
}
#endif
}
@@
-142,7
+137,7
@@
static void ldr_exec(void *addr)
* to also add booting from SPI, or TWI, but this function does
* not currently support that.
*/
* to also add booting from SPI, or TWI, but this function does
* not currently support that.
*/
-int do_bootldr(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_bootldr(cmd_tbl_t *cmdtp, int flag, int argc, char *
const
argv[])
{
void *addr;
{
void *addr;
@@
-167,7
+162,9
@@
int do_bootldr(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
return 0;
}
return 0;
}
-U_BOOT_CMD(bootldr, 2, 0, do_bootldr,
+U_BOOT_CMD(
+ bootldr, 2, 0, do_bootldr,
"boot ldr image from memory",
"[addr]\n"
"boot ldr image from memory",
"[addr]\n"
- " - boot ldr image stored in memory\n");
+ ""
+);