mirror of
https://github.com/Stichting-MINIX-Research-Foundation/u-boot.git
synced 2025-09-10 12:39:22 -04:00
* Map ISP1362 USB OTG controller for NSCU board
* Patch by Brad Parker, 02 Aug 2003: fix sc520_cdp problems * Implement Boot Cycle Detection (Req. 2.3 of OSDL CGL Reqirements) * Allow erase command to cross flash bank boundaries
This commit is contained in:
parent
96dd9af4c7
commit
bdccc4fedc
@ -2,6 +2,15 @@
|
|||||||
Changes for U-Boot 0.4.5:
|
Changes for U-Boot 0.4.5:
|
||||||
======================================================================
|
======================================================================
|
||||||
|
|
||||||
|
* Map ISP1362 USB OTG controller for NSCU board
|
||||||
|
|
||||||
|
* Patch by Brad Parker, 02 Aug 2003:
|
||||||
|
fix sc520_cdp problems
|
||||||
|
|
||||||
|
* Implement Boot Cycle Detection (Req. 2.3 of OSDL CGL Reqirements)
|
||||||
|
|
||||||
|
* Allow erase command to cross flash bank boundaries
|
||||||
|
|
||||||
* Patch by Scott McNutt, 21 Jul 2003:
|
* Patch by Scott McNutt, 21 Jul 2003:
|
||||||
Add support for LynuxWorks Kernel Downloadable Images (KDIs).
|
Add support for LynuxWorks Kernel Downloadable Images (KDIs).
|
||||||
Both LynxOS and BlueCat linux KDIs are supported.
|
Both LynxOS and BlueCat linux KDIs are supported.
|
||||||
|
16
Makefile
16
Makefile
@ -116,13 +116,12 @@ LIBS += post/libpost.a post/cpu/libcpu.a
|
|||||||
LIBS += common/libcommon.a
|
LIBS += common/libcommon.a
|
||||||
LIBS += lib_generic/libgeneric.a
|
LIBS += lib_generic/libgeneric.a
|
||||||
|
|
||||||
|
#########################################################################
|
||||||
#########################################################################
|
#########################################################################
|
||||||
|
|
||||||
all: u-boot.srec u-boot.bin System.map
|
ALL = u-boot.srec u-boot.bin System.map
|
||||||
|
|
||||||
install: all
|
all: $(ALL)
|
||||||
-cp u-boot.bin /tftpboot/u-boot.bin
|
|
||||||
-cp u-boot.bin /net/denx/tftpboot/u-boot.bin
|
|
||||||
|
|
||||||
u-boot.srec: u-boot
|
u-boot.srec: u-boot
|
||||||
$(OBJCOPY) ${OBJCFLAGS} -O srec $< $@
|
$(OBJCOPY) ${OBJCFLAGS} -O srec $< $@
|
||||||
@ -130,6 +129,13 @@ u-boot.srec: u-boot
|
|||||||
u-boot.bin: u-boot
|
u-boot.bin: u-boot
|
||||||
$(OBJCOPY) ${OBJCFLAGS} -O binary $< $@
|
$(OBJCOPY) ${OBJCFLAGS} -O binary $< $@
|
||||||
|
|
||||||
|
u-boot.img: u-boot.bin
|
||||||
|
./tools/mkimage -A $(ARCH) -T firmware -C none \
|
||||||
|
-a $(TEXT_BASE) -e 0 \
|
||||||
|
-n $(shell sed -n -e 's/.*U_BOOT_VERSION//p' include/version.h | \
|
||||||
|
sed -e 's/"[ ]*$$/ for $(BOARD) board"/') \
|
||||||
|
-d $< $@
|
||||||
|
|
||||||
u-boot.dis: u-boot
|
u-boot.dis: u-boot
|
||||||
$(OBJDUMP) -d $< > $@
|
$(OBJDUMP) -d $< > $@
|
||||||
|
|
||||||
@ -864,7 +870,7 @@ clobber: clean
|
|||||||
| xargs rm -f
|
| xargs rm -f
|
||||||
rm -f $(OBJS) *.bak tags TAGS
|
rm -f $(OBJS) *.bak tags TAGS
|
||||||
rm -fr *.*~
|
rm -fr *.*~
|
||||||
rm -f u-boot u-boot.bin u-boot.srec u-boot.map System.map
|
rm -f u-boot u-boot.map $(ALL)
|
||||||
rm -f tools/crc32.c tools/environment.c tools/env/crc32.c
|
rm -f tools/crc32.c tools/environment.c tools/env/crc32.c
|
||||||
rm -f tools/inca-swap-bytes cpu/mpc824x/bedbug_603e.c
|
rm -f tools/inca-swap-bytes cpu/mpc824x/bedbug_603e.c
|
||||||
rm -f include/asm/proc include/asm/arch include/asm
|
rm -f include/asm/proc include/asm/arch include/asm
|
||||||
|
@ -29,7 +29,7 @@ OBJS := sc520_cdp.o flash.o
|
|||||||
SOBJS := sc520_cdp_asm.o sc520_cdp_asm16.o
|
SOBJS := sc520_cdp_asm.o sc520_cdp_asm16.o
|
||||||
|
|
||||||
$(LIB): $(OBJS) $(SOBJS)
|
$(LIB): $(OBJS) $(SOBJS)
|
||||||
$(AR) crv $@ $(OBJS)
|
$(AR) crv $@ $(OBJS) $(SOBJS)
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f $(SOBJS) $(OBJS)
|
rm -f $(SOBJS) $(OBJS)
|
||||||
|
@ -325,7 +325,7 @@ void flash_print_info(flash_info_t *info)
|
|||||||
}
|
}
|
||||||
printf ("\n");
|
printf ("\n");
|
||||||
|
|
||||||
done:
|
done: ;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*-----------------------------------------------------------------------
|
/*-----------------------------------------------------------------------
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
#include <asm/pci.h>
|
#include <asm/pci.h>
|
||||||
#include <asm/ic/sc520.h>
|
#include <asm/ic/sc520.h>
|
||||||
#include <asm/ic/ali512x.h>
|
#include <asm/ic/ali512x.h>
|
||||||
#include <ssi.h>
|
#include <spi.h>
|
||||||
|
|
||||||
#undef SC520_CDP_DEBUG
|
#undef SC520_CDP_DEBUG
|
||||||
|
|
||||||
@ -557,6 +557,19 @@ void ssi_chip_select(int dev)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void spi_eeprom_probe(int x)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
int spi_eeprom_read(int x, int offset, char *buffer, int len)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int spi_eeprom_write(int x, int offset, char *buffer, int len)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
void spi_init_f(void)
|
void spi_init_f(void)
|
||||||
{
|
{
|
||||||
@ -585,6 +598,9 @@ ssize_t spi_read(uchar *addr, int alen, uchar *buffer, int len)
|
|||||||
#endif
|
#endif
|
||||||
#ifdef CONFIG_SC520_CDP_USE_MW
|
#ifdef CONFIG_SC520_CDP_USE_MW
|
||||||
res = mw_eeprom_read(2, offset, buffer, len);
|
res = mw_eeprom_read(2, offset, buffer, len);
|
||||||
|
#endif
|
||||||
|
#if !defined(CONFIG_SC520_CDP_USE_SPI) && !defined(CONFIG_SC520_CDP_USE_MW)
|
||||||
|
res = 0;
|
||||||
#endif
|
#endif
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
@ -606,6 +622,9 @@ ssize_t spi_write(uchar *addr, int alen, uchar *buffer, int len)
|
|||||||
#endif
|
#endif
|
||||||
#ifdef CONFIG_SC520_CDP_USE_MW
|
#ifdef CONFIG_SC520_CDP_USE_MW
|
||||||
res = mw_eeprom_write(2, offset, buffer, len);
|
res = mw_eeprom_write(2, offset, buffer, len);
|
||||||
|
#endif
|
||||||
|
#if !defined(CONFIG_SC520_CDP_USE_SPI) && !defined(CONFIG_SC520_CDP_USE_MW)
|
||||||
|
res = 0;
|
||||||
#endif
|
#endif
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
@ -31,7 +31,7 @@ SECTIONS
|
|||||||
.text : { *(.text); }
|
.text : { *(.text); }
|
||||||
|
|
||||||
. = ALIGN(4);
|
. = ALIGN(4);
|
||||||
.rodata : { *(.rodata) }
|
.rodata : { *(.rodata) *(.rodata.str1.1) *(.rodata.str1.32) }
|
||||||
|
|
||||||
. = 0x400000; /* Ram data segment to use */
|
. = 0x400000; /* Ram data segment to use */
|
||||||
_i386boot_romdata_dest = ABSOLUTE(.);
|
_i386boot_romdata_dest = ABSOLUTE(.);
|
||||||
|
@ -363,6 +363,12 @@ long int initdram (int board_type)
|
|||||||
memctl->memc_mcr = 0x011C | UPMB;
|
memctl->memc_mcr = 0x011C | UPMB;
|
||||||
#endif /* CONFIG_CAN_DRIVER */
|
#endif /* CONFIG_CAN_DRIVER */
|
||||||
|
|
||||||
|
#ifdef CONFIG_ISP1362_USB
|
||||||
|
/* Initialize OR5 / BR5 */
|
||||||
|
memctl->memc_or5 = CFG_OR5_ISP1362;
|
||||||
|
memctl->memc_br5 = CFG_BR5_ISP1362;
|
||||||
|
#endif /* CONFIG_ISP1362_USB */
|
||||||
|
|
||||||
|
|
||||||
return (size_b0 + size_b1);
|
return (size_b0 + size_b1);
|
||||||
}
|
}
|
||||||
|
@ -1012,9 +1012,9 @@ int do_imls (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
|||||||
printf ("Image at %08lX:\n", (ulong)hdr);
|
printf ("Image at %08lX:\n", (ulong)hdr);
|
||||||
print_image_hdr( hdr );
|
print_image_hdr( hdr );
|
||||||
putc ('\n');
|
putc ('\n');
|
||||||
next_sector:
|
next_sector: ;
|
||||||
}
|
}
|
||||||
next_bank:
|
next_bank: ;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (0);
|
return (0);
|
||||||
|
@ -85,9 +85,9 @@ abbrev_spec(char *str, flash_info_t **pinfo, int *psf, int *psl)
|
|||||||
if (ep == p || *ep != '\0' ||
|
if (ep == p || *ep != '\0' ||
|
||||||
last < first || last >= fp->sector_count)
|
last < first || last >= fp->sector_count)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
last = first;
|
last = first;
|
||||||
|
}
|
||||||
|
|
||||||
*pinfo = fp;
|
*pinfo = fp;
|
||||||
*psf = first;
|
*psf = first;
|
||||||
@ -95,6 +95,81 @@ abbrev_spec(char *str, flash_info_t **pinfo, int *psf, int *psl)
|
|||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
flash_fill_sect_ranges (ulong addr_first, ulong addr_last,
|
||||||
|
int *s_first, int *s_last,
|
||||||
|
int *s_count )
|
||||||
|
{
|
||||||
|
flash_info_t *info;
|
||||||
|
ulong bank;
|
||||||
|
int rcode = 0;
|
||||||
|
|
||||||
|
*s_count = 0;
|
||||||
|
|
||||||
|
for (bank=0; bank < CFG_MAX_FLASH_BANKS; ++bank) {
|
||||||
|
s_first[bank] = -1; /* first sector to erase */
|
||||||
|
s_last [bank] = -1; /* last sector to erase */
|
||||||
|
}
|
||||||
|
|
||||||
|
for (bank=0,info=&flash_info[0];
|
||||||
|
(bank < CFG_MAX_FLASH_BANKS) && (addr_first <= addr_last);
|
||||||
|
++bank, ++info) {
|
||||||
|
ulong b_end;
|
||||||
|
int sect;
|
||||||
|
short s_end;
|
||||||
|
|
||||||
|
if (info->flash_id == FLASH_UNKNOWN) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
b_end = info->start[0] + info->size - 1; /* bank end addr */
|
||||||
|
s_end = info->sector_count - 1; /* last sector */
|
||||||
|
|
||||||
|
|
||||||
|
for (sect=0; sect < info->sector_count; ++sect) {
|
||||||
|
ulong end; /* last address in current sect */
|
||||||
|
|
||||||
|
end = (sect == s_end) ? b_end : info->start[sect + 1] - 1;
|
||||||
|
|
||||||
|
if (addr_first > end)
|
||||||
|
continue;
|
||||||
|
if (addr_last < info->start[sect])
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (addr_first == info->start[sect]) {
|
||||||
|
s_first[bank] = sect;
|
||||||
|
}
|
||||||
|
if (addr_last == end) {
|
||||||
|
s_last[bank] = sect;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (s_first[bank] >= 0) {
|
||||||
|
if (s_last[bank] < 0) {
|
||||||
|
if (addr_last > b_end) {
|
||||||
|
s_last[bank] = s_end;
|
||||||
|
} else {
|
||||||
|
printf ("Error: end address"
|
||||||
|
" not on sector boundary\n");
|
||||||
|
rcode = 1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (s_last[bank] < s_first[bank]) {
|
||||||
|
printf ("Error: end sector"
|
||||||
|
" precedes start sector\n");
|
||||||
|
rcode = 1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
sect = s_last[bank];
|
||||||
|
addr_first = (sect == s_end) ? b_end + 1: info->start[sect + 1];
|
||||||
|
(*s_count) += s_last[bank] - s_first[bank] + 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return rcode;
|
||||||
|
}
|
||||||
|
|
||||||
int do_flinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
int do_flinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
||||||
{
|
{
|
||||||
ulong bank;
|
ulong bank;
|
||||||
@ -180,7 +255,6 @@ int do_flerase (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
printf ("Erase Flash from 0x%08lx to 0x%08lx ", addr_first, addr_last);
|
|
||||||
rcode = flash_sect_erase(addr_first, addr_last);
|
rcode = flash_sect_erase(addr_first, addr_last);
|
||||||
return rcode;
|
return rcode;
|
||||||
}
|
}
|
||||||
@ -189,53 +263,32 @@ int flash_sect_erase (ulong addr_first, ulong addr_last)
|
|||||||
{
|
{
|
||||||
flash_info_t *info;
|
flash_info_t *info;
|
||||||
ulong bank;
|
ulong bank;
|
||||||
int s_first, s_last;
|
int s_first[CFG_MAX_FLASH_BANKS], s_last[CFG_MAX_FLASH_BANKS];
|
||||||
int erased;
|
int erased = 0;
|
||||||
|
int planned;
|
||||||
int rcode = 0;
|
int rcode = 0;
|
||||||
|
|
||||||
erased = 0;
|
rcode = flash_fill_sect_ranges (addr_first, addr_last,
|
||||||
|
s_first, s_last, &planned );
|
||||||
|
|
||||||
for (bank=0,info=&flash_info[0]; bank < CFG_MAX_FLASH_BANKS; ++bank, ++info) {
|
if (planned && (rcode == 0)) {
|
||||||
ulong b_end;
|
for (bank=0,info=&flash_info[0];
|
||||||
int sect;
|
(bank < CFG_MAX_FLASH_BANKS) && (rcode == 0);
|
||||||
|
++bank, ++info) {
|
||||||
if (info->flash_id == FLASH_UNKNOWN) {
|
if (s_first[bank]>=0) {
|
||||||
continue;
|
erased += s_last[bank] - s_first[bank] + 1;
|
||||||
}
|
printf ("Erase Flash from 0x%08lx to 0x%08lx "
|
||||||
|
"in Bank # %ld ",
|
||||||
b_end = info->start[0] + info->size - 1; /* bank end addr */
|
info->start[s_first[bank]],
|
||||||
|
(s_last[bank] == info->sector_count) ?
|
||||||
s_first = -1; /* first sector to erase */
|
info->start[0] + info->size - 1:
|
||||||
s_last = -1; /* last sector to erase */
|
info->start[s_last[bank]+1] - 1,
|
||||||
|
bank+1);
|
||||||
for (sect=0; sect < info->sector_count; ++sect) {
|
rcode = flash_erase (info, s_first[bank], s_last[bank]);
|
||||||
ulong end; /* last address in current sect */
|
|
||||||
short s_end;
|
|
||||||
|
|
||||||
s_end = info->sector_count - 1;
|
|
||||||
|
|
||||||
end = (sect == s_end) ? b_end : info->start[sect + 1] - 1;
|
|
||||||
|
|
||||||
if (addr_first > end)
|
|
||||||
continue;
|
|
||||||
if (addr_last < info->start[sect])
|
|
||||||
continue;
|
|
||||||
|
|
||||||
if (addr_first == info->start[sect]) {
|
|
||||||
s_first = sect;
|
|
||||||
}
|
|
||||||
if (addr_last == end) {
|
|
||||||
s_last = sect;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (s_first>=0 && s_first<=s_last) {
|
|
||||||
erased += s_last - s_first + 1;
|
|
||||||
rcode = flash_erase (info, s_first, s_last);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (erased) {
|
|
||||||
printf ("Erased %d sectors\n", erased);
|
printf ("Erased %d sectors\n", erased);
|
||||||
} else {
|
} else if (rcode == 0) {
|
||||||
printf ("Error: start and/or end address"
|
printf ("Error: start and/or end address"
|
||||||
" not on sector boundary\n");
|
" not on sector boundary\n");
|
||||||
rcode = 1;
|
rcode = 1;
|
||||||
@ -243,7 +296,6 @@ int flash_sect_erase (ulong addr_first, ulong addr_last)
|
|||||||
return rcode;
|
return rcode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int do_protect (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
int do_protect (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
||||||
{
|
{
|
||||||
flash_info_t *info;
|
flash_info_t *info;
|
||||||
@ -256,11 +308,11 @@ int do_protect (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (strcmp(argv[1], "off") == 0)
|
if (strcmp(argv[1], "off") == 0) {
|
||||||
p = 0;
|
p = 0;
|
||||||
else if (strcmp(argv[1], "on") == 0)
|
} else if (strcmp(argv[1], "on") == 0) {
|
||||||
p = 1;
|
p = 1;
|
||||||
else {
|
} else {
|
||||||
printf ("Usage:\n%s\n", cmdtp->usage);
|
printf ("Usage:\n%s\n", cmdtp->usage);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@ -370,48 +422,26 @@ int flash_sect_protect (int p, ulong addr_first, ulong addr_last)
|
|||||||
{
|
{
|
||||||
flash_info_t *info;
|
flash_info_t *info;
|
||||||
ulong bank;
|
ulong bank;
|
||||||
int s_first, s_last;
|
int s_first[CFG_MAX_FLASH_BANKS], s_last[CFG_MAX_FLASH_BANKS];
|
||||||
int protected, i;
|
int protected, i;
|
||||||
int rcode = 0;
|
int planned;
|
||||||
|
int rcode;
|
||||||
|
|
||||||
|
rcode = flash_fill_sect_ranges( addr_first, addr_last, s_first, s_last, &planned );
|
||||||
|
|
||||||
protected = 0;
|
protected = 0;
|
||||||
|
|
||||||
|
if (planned && (rcode == 0)) {
|
||||||
for (bank=0,info=&flash_info[0]; bank < CFG_MAX_FLASH_BANKS; ++bank, ++info) {
|
for (bank=0,info=&flash_info[0]; bank < CFG_MAX_FLASH_BANKS; ++bank, ++info) {
|
||||||
ulong b_end;
|
|
||||||
int sect;
|
|
||||||
|
|
||||||
if (info->flash_id == FLASH_UNKNOWN) {
|
if (info->flash_id == FLASH_UNKNOWN) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
b_end = info->start[0] + info->size - 1; /* bank end addr */
|
if (s_first[bank]>=0 && s_first[bank]<=s_last[bank]) {
|
||||||
|
debug ("Protecting sectors %d..%d in bank %ld\n",
|
||||||
s_first = -1; /* first sector to erase */
|
s_first[bank], s_last[bank], bank+1);
|
||||||
s_last = -1; /* last sector to erase */
|
protected += s_last[bank] - s_first[bank] + 1;
|
||||||
|
for (i=s_first[bank]; i<=s_last[bank]; ++i) {
|
||||||
for (sect=0; sect < info->sector_count; ++sect) {
|
|
||||||
ulong end; /* last address in current sect */
|
|
||||||
short s_end;
|
|
||||||
|
|
||||||
s_end = info->sector_count - 1;
|
|
||||||
|
|
||||||
end = (sect == s_end) ? b_end : info->start[sect + 1] - 1;
|
|
||||||
|
|
||||||
if (addr_first > end)
|
|
||||||
continue;
|
|
||||||
if (addr_last < info->start[sect])
|
|
||||||
continue;
|
|
||||||
|
|
||||||
if (addr_first == info->start[sect]) {
|
|
||||||
s_first = sect;
|
|
||||||
}
|
|
||||||
if (addr_last == end) {
|
|
||||||
s_last = sect;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (s_first>=0 && s_first<=s_last) {
|
|
||||||
protected += s_last - s_first + 1;
|
|
||||||
for (i=s_first; i<=s_last; ++i) {
|
|
||||||
#if defined(CFG_FLASH_PROTECTION)
|
#if defined(CFG_FLASH_PROTECTION)
|
||||||
if (flash_real_protect(info, i, p))
|
if (flash_real_protect(info, i, p))
|
||||||
rcode = 1;
|
rcode = 1;
|
||||||
@ -424,12 +454,11 @@ int flash_sect_protect (int p, ulong addr_first, ulong addr_last)
|
|||||||
#if defined(CFG_FLASH_PROTECTION)
|
#if defined(CFG_FLASH_PROTECTION)
|
||||||
if (!rcode) putc ('\n');
|
if (!rcode) putc ('\n');
|
||||||
#endif /* CFG_FLASH_PROTECTION */
|
#endif /* CFG_FLASH_PROTECTION */
|
||||||
|
|
||||||
}
|
}
|
||||||
if (protected) {
|
|
||||||
printf ("%sProtected %d sectors\n",
|
printf ("%sProtected %d sectors\n",
|
||||||
p ? "" : "Un-", protected);
|
p ? "" : "Un-", protected);
|
||||||
} else {
|
} else if (rcode == 0) {
|
||||||
printf ("Error: start and/or end address"
|
printf ("Error: start and/or end address"
|
||||||
" not on sector boundary\n");
|
" not on sector boundary\n");
|
||||||
rcode = 1;
|
rcode = 1;
|
||||||
|
@ -32,6 +32,8 @@
|
|||||||
#include <hush.h>
|
#include <hush.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include <post.h>
|
||||||
|
|
||||||
#if defined(CONFIG_BOOT_RETRY_TIME) && defined(CONFIG_RESET_TO_RETRY)
|
#if defined(CONFIG_BOOT_RETRY_TIME) && defined(CONFIG_RESET_TO_RETRY)
|
||||||
extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]); /* for do_reset() prototype */
|
extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]); /* for do_reset() prototype */
|
||||||
#endif
|
#endif
|
||||||
@ -258,6 +260,12 @@ void main_loop (void)
|
|||||||
#ifdef CONFIG_PREBOOT
|
#ifdef CONFIG_PREBOOT
|
||||||
char *p;
|
char *p;
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef CONFIG_BOOTCOUNT_LIMIT
|
||||||
|
unsigned long bootcount = 0;
|
||||||
|
unsigned long bootlimit = 0;
|
||||||
|
char *bcs;
|
||||||
|
char bcs_set[16];
|
||||||
|
#endif /* CONFIG_BOOTCOUNT_LIMIT */
|
||||||
|
|
||||||
#if defined(CONFIG_VFD) && defined(VFD_TEST_LOGO)
|
#if defined(CONFIG_VFD) && defined(VFD_TEST_LOGO)
|
||||||
ulong bmp = 0; /* default bitmap */
|
ulong bmp = 0; /* default bitmap */
|
||||||
@ -270,6 +278,16 @@ void main_loop (void)
|
|||||||
trab_vfd (bmp);
|
trab_vfd (bmp);
|
||||||
#endif /* CONFIG_VFD && VFD_TEST_LOGO */
|
#endif /* CONFIG_VFD && VFD_TEST_LOGO */
|
||||||
|
|
||||||
|
#ifdef CONFIG_BOOTCOUNT_LIMIT
|
||||||
|
bootcount = bootcount_load();
|
||||||
|
bootcount++;
|
||||||
|
bootcount_store (bootcount);
|
||||||
|
sprintf (bcs_set, "%lu", bootcount);
|
||||||
|
setenv ("bootcount", bcs_set);
|
||||||
|
bcs = getenv ("bootlimit");
|
||||||
|
bootlimit = bcs ? simple_strtoul (bcs, NULL, 10) : 0;
|
||||||
|
#endif /* CONFIG_BOOTCOUNT_LIMIT */
|
||||||
|
|
||||||
#ifdef CONFIG_MODEM_SUPPORT
|
#ifdef CONFIG_MODEM_SUPPORT
|
||||||
debug ("DEBUG: main_loop: do_mdm_init=%d\n", do_mdm_init);
|
debug ("DEBUG: main_loop: do_mdm_init=%d\n", do_mdm_init);
|
||||||
if (do_mdm_init) {
|
if (do_mdm_init) {
|
||||||
@ -322,6 +340,14 @@ void main_loop (void)
|
|||||||
init_cmd_timeout ();
|
init_cmd_timeout ();
|
||||||
# endif /* CONFIG_BOOT_RETRY_TIME */
|
# endif /* CONFIG_BOOT_RETRY_TIME */
|
||||||
|
|
||||||
|
#ifdef CONFIG_BOOTCOUNT_LIMIT
|
||||||
|
if (bootlimit && (bootcount > bootlimit)) {
|
||||||
|
printf ("Warning: Bootlimit (%u) exceeded. Using altbootcmd.\n",
|
||||||
|
(unsigned)bootlimit);
|
||||||
|
s = getenv ("altbootcmd");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
#endif /* CONFIG_BOOTCOUNT_LIMIT */
|
||||||
s = getenv ("bootcmd");
|
s = getenv ("bootcmd");
|
||||||
|
|
||||||
debug ("### main_loop: bootcmd=\"%s\"\n", s ? s : "<UNDEFINED>");
|
debug ("### main_loop: bootcmd=\"%s\"\n", s ? s : "<UNDEFINED>");
|
||||||
|
@ -208,3 +208,27 @@ ulong post_word_load (void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#endif /* CONFIG_POST || CONFIG_LOGBUFFER*/
|
#endif /* CONFIG_POST || CONFIG_LOGBUFFER*/
|
||||||
|
|
||||||
|
#ifdef CONFIG_BOOTCOUNT_LIMIT
|
||||||
|
|
||||||
|
void bootcount_store (ulong a)
|
||||||
|
{
|
||||||
|
volatile ulong *save_addr =
|
||||||
|
(volatile ulong *)(CFG_IMMR + CPM_BOOTCOUNT_ADDR);
|
||||||
|
|
||||||
|
save_addr[0] = a;
|
||||||
|
save_addr[1] = BOOTCOUNT_MAGIC;
|
||||||
|
}
|
||||||
|
|
||||||
|
ulong bootcount_load (void)
|
||||||
|
{
|
||||||
|
volatile ulong *save_addr =
|
||||||
|
(volatile ulong *)(CFG_IMMR + CPM_BOOTCOUNT_ADDR);
|
||||||
|
|
||||||
|
if (save_addr[1] != BOOTCOUNT_MAGIC)
|
||||||
|
return 0;
|
||||||
|
else
|
||||||
|
return save_addr[0];
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* CONFIG_BOOTCOUNT_LIMIT */
|
||||||
|
@ -110,3 +110,29 @@ ulong post_word_load (void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#endif /* CONFIG_POST || CONFIG_LOGBUFFER*/
|
#endif /* CONFIG_POST || CONFIG_LOGBUFFER*/
|
||||||
|
|
||||||
|
#ifdef CONFIG_BOOTCOUNT_LIMIT
|
||||||
|
|
||||||
|
void bootcount_store (ulong a)
|
||||||
|
{
|
||||||
|
volatile ulong *save_addr =
|
||||||
|
(volatile ulong *)( ((immap_t *) CFG_IMMR)->im_cpm.cp_dpmem +
|
||||||
|
CPM_BOOTCOUNT_ADDR );
|
||||||
|
|
||||||
|
save_addr[0] = a;
|
||||||
|
save_addr[1] = BOOTCOUNT_MAGIC;
|
||||||
|
}
|
||||||
|
|
||||||
|
ulong bootcount_load (void)
|
||||||
|
{
|
||||||
|
volatile ulong *save_addr =
|
||||||
|
(volatile ulong *)( ((immap_t *) CFG_IMMR)->im_cpm.cp_dpmem +
|
||||||
|
CPM_BOOTCOUNT_ADDR );
|
||||||
|
|
||||||
|
if (save_addr[1] != BOOTCOUNT_MAGIC)
|
||||||
|
return 0;
|
||||||
|
else
|
||||||
|
return save_addr[0];
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* CONFIG_BOOTCOUNT_LIMIT */
|
||||||
|
@ -141,6 +141,13 @@ typedef struct cpm_buf_desc {
|
|||||||
#else
|
#else
|
||||||
#define CPM_POST_WORD_ADDR CFG_CPM_POST_WORD_ADDR
|
#define CPM_POST_WORD_ADDR CFG_CPM_POST_WORD_ADDR
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef CFG_CPM_BOOTCOUNT_ADDR
|
||||||
|
#define CPM_BOOTCOUNT_ADDR (CPM_POST_WORD_ADDR - 2*sizeof(ulong))
|
||||||
|
#else
|
||||||
|
#define CPM_BOOTCOUNT_ADDR CFG_CPM_BOOTCOUNT_ADDR
|
||||||
|
#endif
|
||||||
|
|
||||||
#define PROFF_SCC1 ((uint)0x8000)
|
#define PROFF_SCC1 ((uint)0x8000)
|
||||||
#define PROFF_SCC2 ((uint)0x8100)
|
#define PROFF_SCC2 ((uint)0x8100)
|
||||||
#define PROFF_SCC3 ((uint)0x8200)
|
#define PROFF_SCC3 ((uint)0x8200)
|
||||||
|
@ -236,7 +236,7 @@ extern void pic_write (uchar reg, uchar val);
|
|||||||
# define CFG_DEF_EEPROM_ADDR CFG_I2C_EEPROM_ADDR
|
# define CFG_DEF_EEPROM_ADDR CFG_I2C_EEPROM_ADDR
|
||||||
#endif /* CONFIG_SPI || !defined(CFG_I2C_EEPROM_ADDR) */
|
#endif /* CONFIG_SPI || !defined(CFG_I2C_EEPROM_ADDR) */
|
||||||
|
|
||||||
#if defined(CONFIG_PCU_E) || defined(CONFIG_CCM) || defined(CONFIG_ATC)
|
#if defined(CONFIG_SPI)
|
||||||
extern void spi_init_f (void);
|
extern void spi_init_f (void);
|
||||||
extern void spi_init_r (void);
|
extern void spi_init_r (void);
|
||||||
extern ssize_t spi_read (uchar *, int, uchar *, int);
|
extern ssize_t spi_read (uchar *, int, uchar *, int);
|
||||||
@ -400,6 +400,9 @@ uint dpram_alloc(uint size);
|
|||||||
uint dpram_alloc_align(uint size,uint align);
|
uint dpram_alloc_align(uint size,uint align);
|
||||||
void post_word_store (ulong);
|
void post_word_store (ulong);
|
||||||
ulong post_word_load (void);
|
ulong post_word_load (void);
|
||||||
|
void bootcount_store (ulong);
|
||||||
|
ulong bootcount_load (void);
|
||||||
|
#define BOOTCOUNT_MAGIC 0xB001C041
|
||||||
|
|
||||||
/* $(CPU)/.../<eth> */
|
/* $(CPU)/.../<eth> */
|
||||||
void mii_init (void);
|
void mii_init (void);
|
||||||
|
@ -83,6 +83,12 @@
|
|||||||
#define CPM_POST_WORD_ADDR CFG_CPM_POST_WORD_ADDR
|
#define CPM_POST_WORD_ADDR CFG_CPM_POST_WORD_ADDR
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef CFG_CPM_BOOTCOUNT_ADDR
|
||||||
|
#define CPM_BOOTCOUNT_ADDR (CPM_POST_WORD_ADDR - 2*sizeof(ulong))
|
||||||
|
#else
|
||||||
|
#define CPM_BOOTCOUNT_ADDR CFG_CPM_BOOTCOUNT_ADDR
|
||||||
|
#endif
|
||||||
|
|
||||||
#define BD_IIC_START ((uint) 0x0400) /* <- please use CPM_I2C_BASE !! */
|
#define BD_IIC_START ((uint) 0x0400) /* <- please use CPM_I2C_BASE !! */
|
||||||
|
|
||||||
/* Export the base address of the communication processor registers
|
/* Export the base address of the communication processor registers
|
||||||
|
@ -90,6 +90,8 @@
|
|||||||
|
|
||||||
#define CONFIG_RTC_MPC8xx /* use internal RTC of MPC8xx */
|
#define CONFIG_RTC_MPC8xx /* use internal RTC of MPC8xx */
|
||||||
|
|
||||||
|
#define CONFIG_ISP1362_USB /* ISP1362 USB OTG controller */
|
||||||
|
|
||||||
#define CONFIG_COMMANDS ( CONFIG_CMD_DFL | \
|
#define CONFIG_COMMANDS ( CONFIG_CMD_DFL | \
|
||||||
CFG_CMD_ASKENV | \
|
CFG_CMD_ASKENV | \
|
||||||
CFG_CMD_DHCP | \
|
CFG_CMD_DHCP | \
|
||||||
@ -392,6 +394,15 @@
|
|||||||
BR_PS_8 | BR_MS_UPMB | BR_V )
|
BR_PS_8 | BR_MS_UPMB | BR_V )
|
||||||
#endif /* CONFIG_CAN_DRIVER */
|
#endif /* CONFIG_CAN_DRIVER */
|
||||||
|
|
||||||
|
#ifdef CONFIG_ISP1362_USB
|
||||||
|
#define CFG_ISP1362_BASE 0xD0000000 /* ISP1362 mapped at 0xD0000000 */
|
||||||
|
#define CFG_ISP1362_OR_AM 0xFFFF8000 /* 32 kB address mask */
|
||||||
|
#define CFG_OR5_ISP1362 (CFG_ISP1362_OR_AM | OR_CSNT_SAM | \
|
||||||
|
OR_ACS_DIV2 | OR_BI | OR_SCY_5_CLK)
|
||||||
|
#define CFG_BR5_ISP1362 ((CFG_ISP1362_BASE & BR_BA_MSK) | \
|
||||||
|
BR_PS_16 | BR_MS_GPCM | BR_V )
|
||||||
|
#endif /* CONFIG_ISP1362_USB */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Memory Periodic Timer Prescaler
|
* Memory Periodic Timer Prescaler
|
||||||
*
|
*
|
||||||
|
@ -603,8 +603,8 @@ print_header (image_header_t *hdr)
|
|||||||
printf ("Image Type: "); print_type(hdr);
|
printf ("Image Type: "); print_type(hdr);
|
||||||
printf ("Data Size: %d Bytes = %.2f kB = %.2f MB\n",
|
printf ("Data Size: %d Bytes = %.2f kB = %.2f MB\n",
|
||||||
size, (double)size / 1.024e3, (double)size / 1.048576e6 );
|
size, (double)size / 1.024e3, (double)size / 1.048576e6 );
|
||||||
printf ("Load Address: 0x%08x\n", ntohl(hdr->ih_load));
|
printf ("Load Address: 0x%08X\n", ntohl(hdr->ih_load));
|
||||||
printf ("Entry Point: 0x%08x\n", ntohl(hdr->ih_ep));
|
printf ("Entry Point: 0x%08X\n", ntohl(hdr->ih_ep));
|
||||||
|
|
||||||
if (hdr->ih_type == IH_TYPE_MULTI || hdr->ih_type == IH_TYPE_SCRIPT) {
|
if (hdr->ih_type == IH_TYPE_MULTI || hdr->ih_type == IH_TYPE_SCRIPT) {
|
||||||
int i, ptrs;
|
int i, ptrs;
|
||||||
@ -631,7 +631,7 @@ print_header (image_header_t *hdr)
|
|||||||
* if planning to do something with
|
* if planning to do something with
|
||||||
* multiple files
|
* multiple files
|
||||||
*/
|
*/
|
||||||
printf (" Offset = %08x\n", pos);
|
printf (" Offset = %08X\n", pos);
|
||||||
}
|
}
|
||||||
/* copy_file() will pad the first files to even word align */
|
/* copy_file() will pad the first files to even word align */
|
||||||
size += 3;
|
size += 3;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user