aboutsummaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorwdenk <wdenk>2003-12-07 23:55:12 +0000
committerwdenk <wdenk>2003-12-07 23:55:12 +0000
commit9fd5e31fe0245c44a11d35a8603bb6b25c97b5c8 (patch)
treebbb665de89d40b6584076a60f138616fcf373c70 /common
parent3bbc899fc0bba51db83e4b3960f32c3ad6ba813c (diff)
downloadu-boot-midas-9fd5e31fe0245c44a11d35a8603bb6b25c97b5c8.tar.gz
u-boot-midas-9fd5e31fe0245c44a11d35a8603bb6b25c97b5c8.tar.bz2
u-boot-midas-9fd5e31fe0245c44a11d35a8603bb6b25c97b5c8.zip
* Patch by Pierre Aubert, 24 Nov 2003:
- add a return value for the fpga command - add ide_preinit() function called in ide_init if CONFIG_IDE_PREINIT is defined. If ide_preinit fails, ide_init is aborted. - fix an endianess problem in fat.h
Diffstat (limited to 'common')
-rw-r--r--common/cmd_fpga.c9
-rw-r--r--common/cmd_ide.c24
2 files changed, 23 insertions, 10 deletions
diff --git a/common/cmd_fpga.c b/common/cmd_fpga.c
index 8e180da657..41ed459949 100644
--- a/common/cmd_fpga.c
+++ b/common/cmd_fpga.c
@@ -70,6 +70,7 @@ do_fpga (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
void *fpga_data = NULL;
char *devstr = getenv("fpga");
char *datastr = getenv("fpgadata");
+ int rc = FPGA_FAIL;
if ( devstr ) dev = (int)simple_strtoul( devstr, NULL, 16 );
if ( datastr ) fpga_data = (void *)simple_strtoul( datastr, NULL, 16 );
@@ -106,15 +107,15 @@ do_fpga (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
break;
case FPGA_INFO:
- fpga_info( dev );
+ rc = fpga_info( dev );
break;
case FPGA_LOAD:
- fpga_load( dev, fpga_data, data_size );
+ rc = fpga_load( dev, fpga_data, data_size );
break;
case FPGA_DUMP:
- fpga_dump( dev, fpga_data, data_size );
+ rc = fpga_dump( dev, fpga_data, data_size );
break;
default:
@@ -122,7 +123,7 @@ do_fpga (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
fpga_usage( cmdtp );
break;
}
- return 0;
+ return (rc);
}
static void fpga_usage ( cmd_tbl_t *cmdtp )
diff --git a/common/cmd_ide.c b/common/cmd_ide.c
index 45f6368a76..3f18b00d10 100644
--- a/common/cmd_ide.c
+++ b/common/cmd_ide.c
@@ -486,6 +486,19 @@ void ide_init (void)
unsigned int ata_reset_time;
char *s;
#endif
+#ifdef CONFIG_IDE_8xx_PCCARD
+ extern int pcmcia_on (void);
+ extern int ide_devices_found; /* Initialized in check_ide_device() */
+#endif /* CONFIG_IDE_8xx_PCCARD */
+
+#ifdef CONFIG_IDE_PREINIT
+ WATCHDOG_RESET();
+
+ if (ide_preinit ()) {
+ puts ("ide_preinit failed\n");
+ return;
+ }
+#endif /* CONFIG_IDE_PREINIT */
#ifdef CONFIG_IDE_8xx_PCCARD
extern int pcmcia_on (void);
@@ -756,12 +769,12 @@ set_pcmcia_timing (int pmode)
static void __inline__
ide_outb(int dev, int port, unsigned char val)
{
+ PRINTF ("ide_outb (dev= %d, port= %d, val= 0x%02x) : @ 0x%08lx\n",
+ dev, port, val, (ATA_CURR_BASE(dev)+port));
+
/* Ensure I/O operations complete */
__asm__ volatile("eieio");
*((uchar *)(ATA_CURR_BASE(dev)+port)) = val;
-#if 0
- printf ("ide_outb: 0x%08lx <== 0x%02x\n", ATA_CURR_BASE(dev)+port, val);
-#endif
}
#else /* ! __PPC__ */
static void __inline__
@@ -780,9 +793,8 @@ ide_inb(int dev, int port)
/* Ensure I/O operations complete */
__asm__ volatile("eieio");
val = *((uchar *)(ATA_CURR_BASE(dev)+port));
-#if 0
- printf ("ide_inb: 0x%08lx ==> 0x%02x\n", ATA_CURR_BASE(dev)+port, val);
-#endif
+ PRINTF ("ide_inb (dev= %d, port= %d) : @ 0x%08lx -> 0x%02x\n",
+ dev, port, (ATA_CURR_BASE(dev)+port), val);
return (val);
}
#else /* ! __PPC__ */