projects
/
oweals
/
u-boot.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Blackfin: replace "bfin_reset_or_hang()" with "panic()"
[oweals/u-boot.git]
/
common
/
cmd_ide.c
diff --git
a/common/cmd_ide.c
b/common/cmd_ide.c
index d486697bb4aa70ec335d40d22df31db4c53bd519..a1f7e57155b74a25936e73d92578214f661cff2e 100644
(file)
--- a/
common/cmd_ide.c
+++ b/
common/cmd_ide.c
@@
-25,6
+25,7
@@
/*
* IDE support
*/
/*
* IDE support
*/
+
#include <common.h>
#include <config.h>
#include <watchdog.h>
#include <common.h>
#include <config.h>
#include <watchdog.h>
@@
-45,6
+46,12
@@
#include <mpc5xxx.h>
#endif
#include <mpc5xxx.h>
#endif
+#ifdef CONFIG_ORION5X
+#include <asm/arch/orion5x.h>
+#elif defined CONFIG_KIRKWOOD
+#include <asm/arch/kirkwood.h>
+#endif
+
#include <ide.h>
#include <ata.h>
#include <ide.h>
#include <ata.h>
@@
-179,8
+186,7
@@
int do_ide (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
switch (argc) {
case 0:
case 1:
switch (argc) {
case 0:
case 1:
- cmd_usage(cmdtp);
- return 1;
+ return cmd_usage(cmdtp);
case 2:
if (strncmp(argv[1],"res",3) == 0) {
puts ("\nReset IDE"
case 2:
if (strncmp(argv[1],"res",3) == 0) {
puts ("\nReset IDE"
@@
-229,8
+235,7
@@
int do_ide (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
}
return rcode;
}
}
return rcode;
}
- cmd_usage(cmdtp);
- return 1;
+ return cmd_usage(cmdtp);
case 3:
if (strncmp(argv[1],"dev",3) == 0) {
int dev = (int)simple_strtoul(argv[2], NULL, 10);
case 3:
if (strncmp(argv[1],"dev",3) == 0) {
int dev = (int)simple_strtoul(argv[2], NULL, 10);
@@
-278,8
+283,7
@@
int do_ide (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
#endif
}
#endif
}
- cmd_usage(cmdtp);
- return 1;
+ return cmd_usage(cmdtp);
default:
/* at least 4 args */
default:
/* at least 4 args */
@@
-332,14
+336,12
@@
int do_ide (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
printf ("%ld blocks written: %s\n",
n, (n==cnt) ? "OK" : "ERROR");
printf ("%ld blocks written: %s\n",
n, (n==cnt) ? "OK" : "ERROR");
- if (n==cnt)
{
+ if (n==cnt)
return 0;
return 0;
- } else {
+ else
return 1;
return 1;
- }
} else {
} else {
- cmd_usage(cmdtp);
- rcode = 1;
+ return cmd_usage(cmdtp);
}
return rcode;
}
return rcode;
@@
-374,9
+376,8
@@
int do_diskboot (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
boot_device = argv[2];
break;
default:
boot_device = argv[2];
break;
default:
- cmd_usage(cmdtp);
show_boot_progress (-42);
show_boot_progress (-42);
- return
1
;
+ return
cmd_usage(cmdtp)
;
}
show_boot_progress (42);
}
show_boot_progress (42);
@@
-497,7
+498,6
@@
int do_diskboot (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
/* Check if we should attempt an auto-start */
if (((ep = getenv("autostart")) != NULL) && (strcmp(ep,"yes") == 0)) {
char *local_args[2];
/* Check if we should attempt an auto-start */
if (((ep = getenv("autostart")) != NULL) && (strcmp(ep,"yes") == 0)) {
char *local_args[2];
- extern int do_bootm (cmd_tbl_t *, int, int, char *[]);
local_args[0] = argv[0];
local_args[1] = NULL;
local_args[0] = argv[0];
local_args[1] = NULL;
@@
-811,13
+811,14
@@
set_pcmcia_timing (int pmode)
/* We only need to swap data if we are running on a big endian cpu. */
/* But Au1x00 cpu:s already swaps data in big endian mode! */
/* We only need to swap data if we are running on a big endian cpu. */
/* But Au1x00 cpu:s already swaps data in big endian mode! */
-#if defined(__LITTLE_ENDIAN) || ( defined(CONFIG_AU1X00) && !defined(CONFIG_GTH2) )
+#if defined(__LITTLE_ENDIAN) || \
+ (defined(CONFIG_SOC_AU1X00) && !defined(CONFIG_GTH2))
#define input_swap_data(x,y,z) input_data(x,y,z)
#else
static void
input_swap_data(int dev, ulong *sect_buf, int words)
{
#define input_swap_data(x,y,z) input_data(x,y,z)
#else
static void
input_swap_data(int dev, ulong *sect_buf, int words)
{
-#if defined(CONFIG_
HMI10) || defined(CONFIG_
CPC45)
+#if defined(CONFIG_CPC45)
uchar i;
volatile uchar *pbuf_even = (uchar *)(ATA_CURR_BASE(dev)+ATA_DATA_EVEN);
volatile uchar *pbuf_odd = (uchar *)(ATA_CURR_BASE(dev)+ATA_DATA_ODD);
uchar i;
volatile uchar *pbuf_even = (uchar *)(ATA_CURR_BASE(dev)+ATA_DATA_EVEN);
volatile uchar *pbuf_odd = (uchar *)(ATA_CURR_BASE(dev)+ATA_DATA_ODD);
@@
-853,11
+854,11
@@
input_swap_data(int dev, ulong *sect_buf, int words)
#endif /* __LITTLE_ENDIAN || CONFIG_AU1X00 */
#endif /* __LITTLE_ENDIAN || CONFIG_AU1X00 */
-#if defined(
__PPC__) || defined(CONFIG_PXA_PCMCIA) || defined(CONFIG_SH
)
+#if defined(
CONFIG_IDE_SWAP_IO
)
static void
output_data(int dev, ulong *sect_buf, int words)
{
static void
output_data(int dev, ulong *sect_buf, int words)
{
-#if defined(CONFIG_
HMI10) || defined(CONFIG_
CPC45)
+#if defined(CONFIG_CPC45)
uchar *dbuf;
volatile uchar *pbuf_even;
volatile uchar *pbuf_odd;
uchar *dbuf;
volatile uchar *pbuf_even;
volatile uchar *pbuf_odd;
@@
-897,19
+898,19
@@
output_data(int dev, ulong *sect_buf, int words)
}
#endif
}
}
#endif
}
-#else /* !
__PPC__
*/
+#else /* !
CONFIG_IDE_SWAP_IO
*/
static void
output_data(int dev, ulong *sect_buf, int words)
{
outsw(ATA_CURR_BASE(dev)+ATA_DATA_REG, sect_buf, words<<1);
}
static void
output_data(int dev, ulong *sect_buf, int words)
{
outsw(ATA_CURR_BASE(dev)+ATA_DATA_REG, sect_buf, words<<1);
}
-#endif /*
__PPC__
*/
+#endif /*
CONFIG_IDE_SWAP_IO
*/
-#if defined(
__PPC__) || defined(CONFIG_PXA_PCMCIA) || defined(CONFIG_SH
)
+#if defined(
CONFIG_IDE_SWAP_IO
)
static void
input_data(int dev, ulong *sect_buf, int words)
{
static void
input_data(int dev, ulong *sect_buf, int words)
{
-#if defined(CONFIG_
HMI10) || defined(CONFIG_
CPC45)
+#if defined(CONFIG_CPC45)
uchar *dbuf;
volatile uchar *pbuf_even;
volatile uchar *pbuf_odd;
uchar *dbuf;
volatile uchar *pbuf_even;
volatile uchar *pbuf_odd;
@@
-955,14
+956,14
@@
input_data(int dev, ulong *sect_buf, int words)
}
#endif
}
}
#endif
}
-#else /* !
__PPC__
*/
+#else /* !
CONFIG_IDE_SWAP_IO
*/
static void
input_data(int dev, ulong *sect_buf, int words)
{
insw(ATA_CURR_BASE(dev)+ATA_DATA_REG, sect_buf, words << 1);
}
static void
input_data(int dev, ulong *sect_buf, int words)
{
insw(ATA_CURR_BASE(dev)+ATA_DATA_REG, sect_buf, words << 1);
}
-#endif /*
__PPC__
*/
+#endif /*
CONFIG_IDE_SWAP_IO
*/
/* -------------------------------------------------------------------------
*/
/* -------------------------------------------------------------------------
*/
@@
-1543,7
+1544,6
@@
static void ide_reset (void)
#if defined(CONFIG_IDE_LED) && \
!defined(CONFIG_CPC45) && \
#if defined(CONFIG_IDE_LED) && \
!defined(CONFIG_CPC45) && \
- !defined(CONFIG_HMI10) && \
!defined(CONFIG_KUP4K) && \
!defined(CONFIG_KUP4X)
!defined(CONFIG_KUP4K) && \
!defined(CONFIG_KUP4X)
@@
-1579,13
+1579,13
@@
int ide_device_present(int dev)
* ATAPI Support
*/
* ATAPI Support
*/
-#if defined(
__PPC__) || defined(CONFIG_PXA_PCMCIA
)
+#if defined(
CONFIG_IDE_SWAP_IO
)
/* since ATAPI may use commands with not 4 bytes alligned length
* we have our own transfer functions, 2 bytes alligned */
static void
output_data_shorts(int dev, ushort *sect_buf, int shorts)
{
/* since ATAPI may use commands with not 4 bytes alligned length
* we have our own transfer functions, 2 bytes alligned */
static void
output_data_shorts(int dev, ushort *sect_buf, int shorts)
{
-#if defined(CONFIG_
HMI10) || defined(CONFIG_
CPC45)
+#if defined(CONFIG_CPC45)
uchar *dbuf;
volatile uchar *pbuf_even;
volatile uchar *pbuf_odd;
uchar *dbuf;
volatile uchar *pbuf_even;
volatile uchar *pbuf_odd;
@@
-1617,7
+1617,7
@@
output_data_shorts(int dev, ushort *sect_buf, int shorts)
static void
input_data_shorts(int dev, ushort *sect_buf, int shorts)
{
static void
input_data_shorts(int dev, ushort *sect_buf, int shorts)
{
-#if defined(CONFIG_
HMI10) || defined(CONFIG_
CPC45)
+#if defined(CONFIG_CPC45)
uchar *dbuf;
volatile uchar *pbuf_even;
volatile uchar *pbuf_odd;
uchar *dbuf;
volatile uchar *pbuf_even;
volatile uchar *pbuf_odd;
@@
-1646,7
+1646,7
@@
input_data_shorts(int dev, ushort *sect_buf, int shorts)
#endif
}
#endif
}
-#else /* !
__PPC__
*/
+#else /* !
CONFIG_IDE_SWAP_IO
*/
static void
output_data_shorts(int dev, ushort *sect_buf, int shorts)
{
static void
output_data_shorts(int dev, ushort *sect_buf, int shorts)
{
@@
-1659,7
+1659,7
@@
input_data_shorts(int dev, ushort *sect_buf, int shorts)
insw(ATA_CURR_BASE(dev)+ATA_DATA_REG, sect_buf, shorts);
}
insw(ATA_CURR_BASE(dev)+ATA_DATA_REG, sect_buf, shorts);
}
-#endif /*
__PPC__
*/
+#endif /*
CONFIG_IDE_SWAP_IO
*/
/*
* Wait until (Status & mask) == res, or timeout (in ms)
/*
* Wait until (Status & mask) == res, or timeout (in ms)