summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
Diffstat (limited to 'common')
-rw-r--r--common/cmd_ide.c69
-rw-r--r--common/cmd_mii.c2
-rw-r--r--common/cmd_usb.c16
-rw-r--r--common/main.c8
4 files changed, 42 insertions, 53 deletions
diff --git a/common/cmd_ide.c b/common/cmd_ide.c
index 50ada33e869..0c9927be744 100644
--- a/common/cmd_ide.c
+++ b/common/cmd_ide.c
@@ -60,6 +60,11 @@ static unsigned long mips_io_port_base = 0;
# define SHOW_BOOT_PROGRESS(arg)
#endif
+#ifdef __PPC__
+# define EIEIO __asm__ volatile ("eieio")
+#else
+# define EIEIO /* nothing */
+#endif
#undef IDE_DEBUG
@@ -790,9 +795,7 @@ ide_outb(int dev, int port, unsigned char val)
dev, port, val, (ATA_CURR_BASE(dev)+port));
/* Ensure I/O operations complete */
-#ifdef __PPC__
- __asm__ volatile("eieio");
-#endif
+ EIEIO;
*((uchar *)(ATA_CURR_BASE(dev)+port)) = val;
}
#else /* ! __PPC__ */
@@ -810,9 +813,7 @@ ide_inb(int dev, int port)
{
uchar val;
/* Ensure I/O operations complete */
-#ifdef __PPC__
- __asm__ volatile("eieio");
-#endif
+ EIEIO;
val = *((uchar *)(ATA_CURR_BASE(dev)+port));
PRINTF ("ide_inb (dev= %d, port= 0x%x) : @ 0x%08lx -> 0x%02x\n",
dev, port, (ATA_CURR_BASE(dev)+port), val);
@@ -837,9 +838,9 @@ output_data_short(int dev, ulong *sect_buf, int words)
pbuf = (ushort *)(ATA_CURR_BASE(dev)+ATA_DATA_REG);
dbuf = (ushort *)sect_buf;
while (words--) {
- __asm__ volatile ("eieio");
+ EIEIO;
*pbuf = *dbuf++;
- __asm__ volatile ("eieio");
+ EIEIO;
}
if (words&1)
@@ -895,13 +896,9 @@ output_data(int dev, ulong *sect_buf, int words)
pbuf = (ushort *)(ATA_CURR_BASE(dev)+ATA_DATA_REG);
dbuf = (ushort *)sect_buf;
while (words--) {
-#ifdef __PPC__
- __asm__ volatile ("eieio");
-#endif
+ EIEIO;
*pbuf = *dbuf++;
-#ifdef __PPC__
- __asm__ volatile ("eieio");
-#endif
+ EIEIO;
*pbuf = *dbuf++;
}
#else /* CONFIG_HMI10 */
@@ -913,13 +910,13 @@ output_data(int dev, ulong *sect_buf, int words)
pbuf_odd = (uchar *)(ATA_CURR_BASE(dev)+ATA_DATA_ODD);
dbuf = (uchar *)sect_buf;
while (words--) {
- __asm__ volatile ("eieio");
+ EIEIO;
*pbuf_even = *dbuf++;
- __asm__ volatile ("eieio");
+ EIEIO;
*pbuf_odd = *dbuf++;
- __asm__ volatile ("eieio");
+ EIEIO;
*pbuf_even = *dbuf++;
- __asm__ volatile ("eieio");
+ EIEIO;
*pbuf_odd = *dbuf++;
}
#endif /* CONFIG_HMI10 */
@@ -946,13 +943,9 @@ input_data(int dev, ulong *sect_buf, int words)
PRINTF("in input data base for read is %lx\n", (unsigned long) pbuf);
while (words--) {
-#ifdef __PPC__
- __asm__ volatile ("eieio");
-#endif
+ EIEIO;
*dbuf++ = *pbuf;
-#ifdef __PPC__
- __asm__ volatile ("eieio");
-#endif
+ EIEIO;
*dbuf++ = *pbuf;
}
#else /* CONFIG_HMI10 */
@@ -964,13 +957,13 @@ input_data(int dev, ulong *sect_buf, int words)
pbuf_odd = (uchar *)(ATA_CURR_BASE(dev)+ATA_DATA_ODD);
dbuf = (uchar *)sect_buf;
while (words--) {
- __asm__ volatile ("eieio");
+ EIEIO;
*dbuf++ = *pbuf_even;
- __asm__ volatile ("eieio");
+ EIEIO;
*dbuf++ = *pbuf_odd;
- __asm__ volatile ("eieio");
+ EIEIO;
*dbuf++ = *pbuf_even;
- __asm__ volatile ("eieio");
+ EIEIO;
*dbuf++ = *pbuf_odd;
}
#endif /* CONFIG_HMI10 */
@@ -994,9 +987,9 @@ input_data_short(int dev, ulong *sect_buf, int words)
pbuf = (ushort *)(ATA_CURR_BASE(dev)+ATA_DATA_REG);
dbuf = (ushort *)sect_buf;
while (words--) {
- __asm__ volatile ("eieio");
+ EIEIO;
*dbuf++ = *pbuf;
- __asm__ volatile ("eieio");
+ EIEIO;
}
if (words&1) {
@@ -1608,9 +1601,7 @@ output_data_shorts(int dev, ushort *sect_buf, int shorts)
PRINTF("in output data shorts base for read is %lx\n", (unsigned long) pbuf);
while (shorts--) {
-#ifdef __PPC__
- __asm__ volatile ("eieio");
-#endif
+ EIEIO;
*pbuf = *dbuf++;
}
#else /* CONFIG_HMI10 */
@@ -1621,9 +1612,9 @@ output_data_shorts(int dev, ushort *sect_buf, int shorts)
pbuf_even = (uchar *)(ATA_CURR_BASE(dev)+ATA_DATA_EVEN);
pbuf_odd = (uchar *)(ATA_CURR_BASE(dev)+ATA_DATA_ODD);
while (shorts--) {
- __asm__ volatile ("eieio");
+ EIEIO;
*pbuf_even = *dbuf++;
- __asm__ volatile ("eieio");
+ EIEIO;
*pbuf_odd = *dbuf++;
}
#endif /* CONFIG_HMI10 */
@@ -1642,9 +1633,7 @@ input_data_shorts(int dev, ushort *sect_buf, int shorts)
PRINTF("in input data shorts base for read is %lx\n", (unsigned long) pbuf);
while (shorts--) {
-#ifdef __PPC__
- __asm__ volatile ("eieio");
-#endif
+ EIEIO;
*dbuf++ = *pbuf;
}
#else /* CONFIG_HMI10 */
@@ -1655,9 +1644,9 @@ input_data_shorts(int dev, ushort *sect_buf, int shorts)
pbuf_even = (uchar *)(ATA_CURR_BASE(dev)+ATA_DATA_EVEN);
pbuf_odd = (uchar *)(ATA_CURR_BASE(dev)+ATA_DATA_ODD);
while (shorts--) {
- __asm__ volatile ("eieio");
+ EIEIO;
*dbuf++ = *pbuf_even;
- __asm__ volatile ("eieio");
+ EIEIO;
*dbuf++ = *pbuf_odd;
}
#endif /* CONFIG_HMI10 */
diff --git a/common/cmd_mii.c b/common/cmd_mii.c
index 4539dc54cad..8ec05c80fa5 100644
--- a/common/cmd_mii.c
+++ b/common/cmd_mii.c
@@ -413,7 +413,7 @@ static void extract_range(
}
}
-// ----------------------------------------------------------------
+/* ---------------------------------------------------------------- */
int do_mii (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
{
char op;
diff --git a/common/cmd_usb.c b/common/cmd_usb.c
index 150b106b602..83004b53ac9 100644
--- a/common/cmd_usb.c
+++ b/common/cmd_usb.c
@@ -598,14 +598,14 @@ U_BOOT_CMD(
usb, 5, 1, do_usb,
"usb - USB sub-system\n",
"reset - reset (rescan) USB controller\n"
- "usb stop [f] - stop USB [f]=force stop\n"
- "usb tree - show USB device tree\n"
- "usb info [dev] - show available USB devices\n"
- "usb scan - (re-)scan USB bus for storage devices\n"
- "usb device [dev] - show or set current USB storage device\n"
- "usb part [dev] - print partition table of one or all USB storage devices\n"
- "usb read addr blk# cnt - read `cnt' blocks starting at block `blk#'\n"
- " to memory address `addr'\n"
+ "usb stop [f] - stop USB [f]=force stop\n"
+ "usb tree - show USB device tree\n"
+ "usb info [dev] - show available USB devices\n"
+ "usb scan - (re-)scan USB bus for storage devices\n"
+ "usb device [dev] - show or set current USB storage device\n"
+ "usb part [dev] - print partition table of one or all USB storage devices\n"
+ "usb read addr blk# cnt - read `cnt' blocks starting at block `blk#'\n"
+ " to memory address `addr'\n"
);
diff --git a/common/main.c b/common/main.c
index 7ce9b75f907..0869426f17d 100644
--- a/common/main.c
+++ b/common/main.c
@@ -726,8 +726,8 @@ static void process_macros (const char *input, char *output)
int inputcnt = strlen (input);
int outputcnt = CFG_CBSIZE;
int state = 0; /* 0 = waiting for '$' */
- /* 1 = waiting for '(' */
- /* 2 = waiting for ')' */
+ /* 1 = waiting for '(' or '{' */
+ /* 2 = waiting for ')' or '}' */
/* 3 = waiting for ''' */
#ifdef DEBUG_PARSER
char *output_start = output;
@@ -765,7 +765,7 @@ static void process_macros (const char *input, char *output)
}
break;
case 1: /* Waiting for ( */
- if (c == '(') {
+ if (c == '(' || c == '{') {
state++;
varname_start = input;
} else {
@@ -780,7 +780,7 @@ static void process_macros (const char *input, char *output)
}
break;
case 2: /* Waiting for ) */
- if (c == ')') {
+ if (c == ')' || c == '}') {
int i;
char envname[CFG_CBSIZE], *envval;
int envcnt = input-varname_start-1; /* Varname # of chars */