提交 1a344f29 编写于 作者: W wdenk

* Removed '--no-warn-mismatch' option from Makefile. This option

  makes 'ld' to overlook binary objects compatibility.

* Moved $(PLATFORM_LIBS) from the library group (--start-group ...
  --end-group) outside of the group. This will make 'ld' to do
  _multiple_ search in the library group when resolving symbol
  references and do only a _single_ seach in libgcc.a after the group
  search.

* Fix stability problems on CPC45 board again.

* Make image detection for diskboot / usbboot / scsiboot more robust
  (also check header checksum)
上级 436be29c
......@@ -2,6 +2,20 @@
Changes for U-Boot 1.1.3:
======================================================================
* Removed '--no-warn-mismatch' option from Makefile. This option
makes 'ld' to overlook binary objects compatibility.
* Moved $(PLATFORM_LIBS) from the library group (--start-group ...
--end-group) outside of the group. This will make 'ld' to do
_multiple_ search in the library group when resolving symbol
references and do only a _single_ seach in libgcc.a after the group
search.
* Fix stability problems on CPC45 board again.
* Make image detection for diskboot / usbboot / scsiboot more robust
(also check header checksum)
* Update CPC45 board configuration.
* Add USB and PCI support for INKA4x0 board
......
......@@ -121,7 +121,7 @@ LIBS += common/libcommon.a
.PHONY : $(LIBS)
# Add GCC lib
PLATFORM_LIBS += --no-warn-mismatch -L $(shell dirname `$(CC) $(CFLAGS) -print-libgcc-file-name`) -lgcc
PLATFORM_LIBS += -L $(shell dirname `$(CC) $(CFLAGS) -print-libgcc-file-name`) -lgcc
# The "tools" are needed early, so put this first
......@@ -161,7 +161,7 @@ u-boot.dis: u-boot
u-boot: depend $(SUBDIRS) $(OBJS) $(LIBS) $(LDSCRIPT)
UNDEF_SYM=`$(OBJDUMP) -x $(LIBS) |sed -n -e 's/.*\(__u_boot_cmd_.*\)/-u\1/p'|sort|uniq`;\
$(LD) $(LDFLAGS) $$UNDEF_SYM $(OBJS) \
--start-group $(LIBS) $(PLATFORM_LIBS) --end-group \
--start-group $(LIBS) --end-group $(PLATFORM_LIBS) \
-Map u-boot.map -o u-boot
$(LIBS):
......
此差异已折叠。
......@@ -27,7 +27,6 @@
/*
* SCSI support.
*/
#include <common.h>
#include <command.h>
#include <asm/processor.h>
......@@ -35,15 +34,6 @@
#include <image.h>
#include <pci.h>
#undef SCSI_DEBUG
#ifdef SCSI_DEBUG
#define PRINTF(fmt,args...) printf (fmt ,##args)
#else
#define PRINTF(fmt,args...)
#endif
#if (CONFIG_COMMANDS & CFG_CMD_SCSI)
#ifdef CONFIG_SCSI_SYM53C8XX
......@@ -120,7 +110,7 @@ void scsi_scan(int mode)
scsi_setup_inquiry(pccb);
if(scsi_exec(pccb)!=TRUE) {
if(pccb->contr_stat==SCSI_SEL_TIME_OUT) {
PRINTF("Selection timeout ID %d\n",pccb->target);
debug ("Selection timeout ID %d\n",pccb->target);
continue; /* selection timeout => assuming no device present */
}
scsi_print_error(pccb);
......@@ -211,8 +201,7 @@ int do_scsiboot (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
char *boot_device = NULL;
char *ep;
int dev, part = 0;
ulong cnt;
ulong addr;
ulong addr, cnt, checksum;
disk_partition_t info;
image_header_t *hdr;
int rcode = 0;
......@@ -270,7 +259,7 @@ int do_scsiboot (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
"Name: %.32s Type: %.32s\n",
dev, part, info.name, info.type);
PRINTF ("First Block: %ld, # of blocks: %ld, Block Size: %ld\n",
debug ("First Block: %ld, # of blocks: %ld, Block Size: %ld\n",
info.start, info.size, info.blksz);
if (scsi_read (dev, info.start, 1, (ulong *)addr) != 1) {
......@@ -281,17 +270,24 @@ int do_scsiboot (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
hdr = (image_header_t *)addr;
if (hdr->ih_magic == IH_MAGIC) {
print_image_hdr (hdr);
cnt = (hdr->ih_size + sizeof(image_header_t));
cnt += info.blksz - 1;
cnt /= info.blksz;
cnt -= 1;
} else {
printf("\n** Bad Magic Number **\n");
return 1;
}
checksum = ntohl(hdr->ih_hcrc);
hdr->ih_hcrc = 0;
if (crc32 (0, (char *)hdr, sizeof(image_header_t)) != checksum) {
puts ("\n** Bad Header Checksum **\n");
return 1;
}
print_image_hdr (hdr);
cnt = (hdr->ih_size + sizeof(image_header_t));
cnt += info.blksz - 1;
cnt /= info.blksz;
cnt -= 1;
if (scsi_read (dev, info.start+1, cnt,
(ulong *)(addr+info.blksz)) != cnt) {
printf ("** Read error on %d:%d\n", dev, part);
......@@ -359,7 +355,7 @@ int do_scsi (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
ok++;
if (dev)
printf("\n");
PRINTF("print_part of %x\n",dev);
debug ("print_part of %x\n",dev);
print_part(&scsi_dev_desc[dev]);
}
}
......@@ -435,7 +431,7 @@ ulong scsi_read(int device, ulong blknr, ulong blkcnt, ulong *buffer)
buf_addr=(unsigned long)buffer;
start=blknr;
blks=blkcnt;
PRINTF("\nscsi_read: dev %d startblk %lx, blccnt %lx buffer %lx\n",device,start,blks,(unsigned long)buffer);
debug ("\nscsi_read: dev %d startblk %lx, blccnt %lx buffer %lx\n",device,start,blks,(unsigned long)buffer);
do {
pccb->pdata=(unsigned char *)buf_addr;
if(blks>SCSI_MAX_READ_BLK) {
......@@ -452,7 +448,7 @@ ulong scsi_read(int device, ulong blknr, ulong blkcnt, ulong *buffer)
start+=blks;
blks=0;
}
PRINTF("scsi_read_ext: startblk %lx, blccnt %x buffer %lx\n",start,smallblks,buf_addr);
debug ("scsi_read_ext: startblk %lx, blccnt %x buffer %lx\n",start,smallblks,buf_addr);
if(scsi_exec(pccb)!=TRUE) {
scsi_print_error(pccb);
blkcnt-=blks;
......@@ -460,7 +456,7 @@ ulong scsi_read(int device, ulong blknr, ulong blkcnt, ulong *buffer)
}
buf_addr+=pccb->datalen;
} while(blks!=0);
PRINTF("scsi_read_ext: end startblk %lx, blccnt %x buffer %lx\n",start,smallblks,buf_addr);
debug ("scsi_read_ext: end startblk %lx, blccnt %x buffer %lx\n",start,smallblks,buf_addr);
return(blkcnt);
}
......@@ -551,7 +547,7 @@ void scsi_setup_read_ext(ccb * pccb, unsigned long start, unsigned short blocks)
pccb->cmd[6]=0;
pccb->cmdlen=10;
pccb->msgout[0]=SCSI_IDENTIFY; /* NOT USED */
PRINTF("scsi_setup_read_ext: cmd: %02X %02X startblk %02X%02X%02X%02X blccnt %02X%02X\n",
debug ("scsi_setup_read_ext: cmd: %02X %02X startblk %02X%02X%02X%02X blccnt %02X%02X\n",
pccb->cmd[0],pccb->cmd[1],
pccb->cmd[2],pccb->cmd[3],pccb->cmd[4],pccb->cmd[5],
pccb->cmd[7],pccb->cmd[8]);
......@@ -567,7 +563,7 @@ void scsi_setup_read6(ccb * pccb, unsigned long start, unsigned short blocks)
pccb->cmd[5]=0;
pccb->cmdlen=6;
pccb->msgout[0]=SCSI_IDENTIFY; /* NOT USED */
PRINTF("scsi_setup_read6: cmd: %02X %02X startblk %02X%02X blccnt %02X\n",
debug ("scsi_setup_read6: cmd: %02X %02X startblk %02X%02X blccnt %02X\n",
pccb->cmd[0],pccb->cmd[1],
pccb->cmd[2],pccb->cmd[3],pccb->cmd[4]);
}
......
......@@ -32,13 +32,6 @@
#include <usb.h>
#undef CMD_USB_DEBUG
#ifdef CMD_USB_DEBUG
#define CMD_USB_PRINTF(fmt,args...) printf (fmt ,##args)
#else
#define CMD_USB_PRINTF(fmt,args...)
#endif
static int usb_stor_curr_dev=-1; /* current device */
/* some display routines (info command) */
......@@ -317,8 +310,7 @@ int do_usbboot (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
char *boot_device = NULL;
char *ep;
int dev, part=0, rcode;
ulong cnt;
ulong addr;
ulong addr, cnt, checksum;
disk_partition_t info;
image_header_t *hdr;
block_dev_desc_t *stor_dev;
......@@ -385,7 +377,7 @@ int do_usbboot (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
"Name: %.32s Type: %.32s\n",
dev, part, info.name, info.type);
printf ("First Block: %ld, # of blocks: %ld, Block Size: %ld\n",
debug ("First Block: %ld, # of blocks: %ld, Block Size: %ld\n",
info.start, info.size, info.blksz);
if (stor_dev->block_read(dev, info.start, 1, (ulong *)addr) != 1) {
......@@ -395,17 +387,26 @@ int do_usbboot (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
hdr = (image_header_t *)addr;
if (hdr->ih_magic == IH_MAGIC) {
print_image_hdr (hdr);
cnt = (hdr->ih_size + sizeof(image_header_t));
cnt += info.blksz - 1;
cnt /= info.blksz;
cnt -= 1;
} else {
if (hdr->ih_magic != IH_MAGIC) {
printf("\n** Bad Magic Number **\n");
return 1;
}
checksum = ntohl(hdr->ih_hcrc);
hdr->ih_hcrc = 0;
if (crc32 (0, (char *)hdr, sizeof(image_header_t)) != checksum) {
puts ("\n** Bad Header Checksum **\n");
return 1;
}
print_image_hdr (hdr);
cnt = (hdr->ih_size + sizeof(image_header_t));
cnt += info.blksz - 1;
cnt /= info.blksz;
cnt -= 1;
if (stor_dev->block_read (dev, info.start+1, cnt,
(ulong *)(addr+info.blksz)) != cnt) {
printf ("\n** Read error on %d:%d\n", dev, part);
......
......@@ -496,14 +496,13 @@
#define CFG_IDE_MAXDEVICE 1 /* max. 1 drive per IDE bus */
#define CFG_ATA_IDE0_OFFSET 0x0000
#define CONFIG_HMI10
#define CFG_ATA_BASE_ADDR CFG_PCMCIA_MEM_ADDR
#define CFG_ATA_DATA_OFFSET CFG_PCMCIA_MEM_SIZE
/* Offset for normal register accesses */
#define CFG_ATA_REG_OFFSET CFG_PCMCIA_MEM_SIZE
#define CFG_ATA_REG_OFFSET (CFG_PCMCIA_MEM_SIZE + 0x320)
/* Offset for alternate registers */
#define CFG_ATA_ALT_OFFSET (CFG_PCMCIA_MEM_SIZE + 0x400)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册