summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorMichael Brandt <Michael.Brandt@stericsson.com>2009-10-22 09:53:44 +0200
committerMichael Brandt <Michael.Brandt@stericsson.com>2009-10-22 09:53:44 +0200
commit8eae61fe5292db29b5bd61cadc1613851dea0765 (patch)
tree813a8bdb4a1a82025975d7a26496983e64d25daa /common
parenteb3f0f68ba384f179bb57ad8d5b0cd095eb4d7a4 (diff)
parentf67066b6b0740b826ed862615c5ab022aaf4779a (diff)
Merge branch 'master' of http://git.denx.de/u-boot
Diffstat (limited to 'common')
-rwxr-xr-xcommon/Makefile3
-rw-r--r--common/cmd_mem.c58
-rwxr-xr-xcommon/cmd_nvedit.c62
-rw-r--r--common/env_embedded.c7
-rw-r--r--common/lcd.c21
-rw-r--r--common/miiphyutil.c2
6 files changed, 76 insertions, 77 deletions
diff --git a/common/Makefile b/common/Makefile
index 7ba449505..f85b6d319 100755
--- a/common/Makefile
+++ b/common/Makefile
@@ -52,9 +52,6 @@ COBJS-y += env_common.o
COBJS-$(CONFIG_ENV_IS_IN_DATAFLASH) += env_dataflash.o
COBJS-$(CONFIG_ENV_IS_IN_EEPROM) += env_eeprom.o
COBJS-$(CONFIG_ENV_IS_EMBEDDED) += env_embedded.o
-COBJS-$(CONFIG_ENV_IS_IN_EEPROM) += env_embedded.o
-COBJS-$(CONFIG_ENV_IS_IN_FLASH) += env_embedded.o
-COBJS-$(CONFIG_ENV_IS_IN_NVRAM) += env_embedded.o
COBJS-$(CONFIG_ENV_IS_IN_FLASH) += env_flash.o
COBJS-$(CONFIG_ENV_IS_IN_MG_DISK) += env_mgdisk.o
COBJS-$(CONFIG_ENV_IS_IN_NAND) += env_nand.o
diff --git a/common/cmd_mem.c b/common/cmd_mem.c
index 98508003b..a34b342f0 100644
--- a/common/cmd_mem.c
+++ b/common/cmd_mem.c
@@ -631,7 +631,7 @@ int do_mem_mtest (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
vu_long *addr, *start, *end;
ulong val;
ulong readback;
- int rcode = 0;
+ ulong errs = 0;
int iterations = 1;
int iteration_limit;
@@ -698,9 +698,9 @@ int do_mem_mtest (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
if (iteration_limit && iterations > iteration_limit) {
- printf("Tested %d iteration(s) without errors.\n",
- iterations-1);
- return 0;
+ printf("Tested %d iteration(s) with %lu errors.\n",
+ iterations-1, errs);
+ return errs != 0;
}
printf("Iteration: %6d\r", iterations);
@@ -732,9 +732,14 @@ int do_mem_mtest (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
*dummy = ~val; /* clear the test data off of the bus */
readback = *addr;
if(readback != val) {
- printf ("FAILURE (data line): "
+ printf ("FAILURE (data line): "
"expected %08lx, actual %08lx\n",
val, readback);
+ errs++;
+ if (ctrlc()) {
+ putc ('\n');
+ return 1;
+ }
}
*addr = ~val;
*dummy = val;
@@ -743,6 +748,11 @@ int do_mem_mtest (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
printf ("FAILURE (data line): "
"Is %08lx, should be %08lx\n",
readback, ~val);
+ errs++;
+ if (ctrlc()) {
+ putc ('\n');
+ return 1;
+ }
}
}
}
@@ -808,7 +818,11 @@ int do_mem_mtest (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
printf ("\nFAILURE: Address bit stuck high @ 0x%.8lx:"
" expected 0x%.8lx, actual 0x%.8lx\n",
(ulong)&start[offset], pattern, temp);
- return 1;
+ errs++;
+ if (ctrlc()) {
+ putc ('\n');
+ return 1;
+ }
}
}
start[test_offset] = pattern;
@@ -826,7 +840,11 @@ int do_mem_mtest (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
printf ("\nFAILURE: Address bit stuck low or shorted @"
" 0x%.8lx: expected 0x%.8lx, actual 0x%.8lx\n",
(ulong)&start[offset], pattern, temp);
- return 1;
+ errs++;
+ if (ctrlc()) {
+ putc ('\n');
+ return 1;
+ }
}
}
start[test_offset] = pattern;
@@ -864,7 +882,11 @@ int do_mem_mtest (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
printf ("\nFAILURE (read/write) @ 0x%.8lx:"
" expected 0x%.8lx, actual 0x%.8lx)\n",
(ulong)&start[offset], pattern, temp);
- return 1;
+ errs++;
+ if (ctrlc()) {
+ putc ('\n');
+ return 1;
+ }
}
anti_pattern = ~pattern;
@@ -882,7 +904,11 @@ int do_mem_mtest (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
printf ("\nFAILURE (read/write): @ 0x%.8lx:"
" expected 0x%.8lx, actual 0x%.8lx)\n",
(ulong)&start[offset], anti_pattern, temp);
- return 1;
+ errs++;
+ if (ctrlc()) {
+ putc ('\n');
+ return 1;
+ }
}
start[offset] = 0;
}
@@ -897,9 +923,9 @@ int do_mem_mtest (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
}
if (iteration_limit && iterations > iteration_limit) {
- printf("Tested %d iteration(s) without errors.\n",
- iterations-1);
- return 0;
+ printf("Tested %d iteration(s) with %lu errors.\n",
+ iterations-1, errs);
+ return errs != 0;
}
++iterations;
@@ -923,7 +949,11 @@ int do_mem_mtest (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
printf ("\nMem error @ 0x%08X: "
"found %08lX, expected %08lX\n",
(uint)addr, readback, val);
- rcode = 1;
+ errs++;
+ if (ctrlc()) {
+ putc ('\n');
+ return 1;
+ }
}
val += incr;
}
@@ -943,7 +973,7 @@ int do_mem_mtest (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
incr = -incr;
}
#endif
- return rcode;
+ return 0; /* not reached */
}
diff --git a/common/cmd_nvedit.c b/common/cmd_nvedit.c
index 3fe1fc239..91dec157e 100755
--- a/common/cmd_nvedit.c
+++ b/common/cmd_nvedit.c
@@ -203,6 +203,37 @@ int _do_setenv (int flag, int argc, char *argv[])
break;
}
+ /* Check for console redirection */
+ if (strcmp(name,"stdin") == 0) {
+ console = stdin;
+ } else if (strcmp(name,"stdout") == 0) {
+ console = stdout;
+ } else if (strcmp(name,"stderr") == 0) {
+ console = stderr;
+ }
+
+ if (console != -1) {
+ if (argc < 3) { /* Cannot delete it! */
+ printf("Can't delete \"%s\"\n", name);
+ return 1;
+ }
+
+#ifdef CONFIG_CONSOLE_MUX
+ i = iomux_doenv(console, argv[2]);
+ if (i)
+ return i;
+#else
+ /* Try assigning specified device */
+ if (console_assign (console, argv[2]) < 0)
+ return 1;
+
+#ifdef CONFIG_SERIAL_MULTI
+ if (serial_assign (argv[2]) < 0)
+ return 1;
+#endif
+#endif /* CONFIG_CONSOLE_MUX */
+ }
+
/*
* Delete any existing definition
*/
@@ -230,37 +261,6 @@ int _do_setenv (int flag, int argc, char *argv[])
}
#endif
- /* Check for console redirection */
- if (strcmp(name,"stdin") == 0) {
- console = stdin;
- } else if (strcmp(name,"stdout") == 0) {
- console = stdout;
- } else if (strcmp(name,"stderr") == 0) {
- console = stderr;
- }
-
- if (console != -1) {
- if (argc < 3) { /* Cannot delete it! */
- printf("Can't delete \"%s\"\n", name);
- return 1;
- }
-
-#ifdef CONFIG_CONSOLE_MUX
- i = iomux_doenv(console, argv[2]);
- if (i)
- return i;
-#else
- /* Try assigning specified device */
- if (console_assign (console, argv[2]) < 0)
- return 1;
-
-#ifdef CONFIG_SERIAL_MULTI
- if (serial_assign (argv[2]) < 0)
- return 1;
-#endif
-#endif /* CONFIG_CONSOLE_MUX */
- }
-
/*
* Switch to new baudrate if new baudrate is supported
*/
diff --git a/common/env_embedded.c b/common/env_embedded.c
index ae6cac439..e27e1cd27 100644
--- a/common/env_embedded.c
+++ b/common/env_embedded.c
@@ -41,11 +41,6 @@
#endif
/*
- * Generate embedded environment table
- * inside U-Boot image, if needed.
- */
-#if defined(ENV_IS_EMBEDDED)
-/*
* Only put the environment in it's own section when we are building
* U-Boot proper. The host based program "tools/envcrc" does not need
* a seperate section. Note that ENV_CRC is only defined when building
@@ -210,5 +205,3 @@ unsigned long env_size __PPCTEXT__ = sizeof(env_t);
* Add in absolutes.
*/
GEN_ABS(env_offset, CONFIG_ENV_OFFSET);
-
-#endif /* ENV_IS_EMBEDDED */
diff --git a/common/lcd.c b/common/lcd.c
index dc8fea669..4e316183d 100644
--- a/common/lcd.c
+++ b/common/lcd.c
@@ -99,32 +99,11 @@ static int lcd_getfgcolor (void);
static void console_scrollup (void)
{
-#if 1
/* Copy up rows ignoring the first one */
memcpy (CONSOLE_ROW_FIRST, CONSOLE_ROW_SECOND, CONSOLE_SCROLL_SIZE);
/* Clear the last one */
memset (CONSOLE_ROW_LAST, COLOR_MASK(lcd_color_bg), CONSOLE_ROW_SIZE);
-#else
- /*
- * Poor attempt to optimize speed by moving "long"s.
- * But the code is ugly, and not a bit faster :-(
- */
- ulong *t = (ulong *)CONSOLE_ROW_FIRST;
- ulong *s = (ulong *)CONSOLE_ROW_SECOND;
- ulong l = CONSOLE_SCROLL_SIZE / sizeof(ulong);
- uchar c = lcd_color_bg & 0xFF;
- ulong val= (c<<24) | (c<<16) | (c<<8) | c;
-
- while (l--)
- *t++ = *s++;
-
- t = (ulong *)CONSOLE_ROW_LAST;
- l = CONSOLE_ROW_SIZE / sizeof(ulong);
-
- while (l-- > 0)
- *t++ = val;
-#endif
}
/*----------------------------------------------------------------------*/
diff --git a/common/miiphyutil.c b/common/miiphyutil.c
index 66fd9cad8..196ef4a7b 100644
--- a/common/miiphyutil.c
+++ b/common/miiphyutil.c
@@ -299,7 +299,7 @@ int miiphy_reset (char *devname, unsigned char addr)
debug ("PHY status read failed\n");
return (-1);
}
- if (miiphy_write (devname, addr, PHY_BMCR, reg | 0x8000) != 0) {
+ if (miiphy_write (devname, addr, PHY_BMCR, reg | PHY_BMCR_RESET) != 0) {
debug ("PHY reset failed\n");
return (-1);
}