]> git.sur5r.net Git - u-boot/blobdiff - common/cmd_mem.c
mac: Fix the condition check for setting the MAC from the EEPROM
[u-boot] / common / cmd_mem.c
index 4d64cfffde8040bb397f373d52b63fb927f27cee..d44aa1d7339a711ba04db2031ba74866b50c273c 100644 (file)
@@ -33,6 +33,9 @@
 #include <dataflash.h>
 #endif
 #include <watchdog.h>
+#include <linux/compiler.h>
+
+DECLARE_GLOBAL_DATA_PTR;
 
 static int mod_mem(cmd_tbl_t *, int, int, int, char * const []);
 
@@ -459,7 +462,8 @@ static int do_mem_loop(cmd_tbl_t *cmdtp, int flag, int argc,
        if (argc < 3)
                return CMD_RET_USAGE;
 
-       /* Check for a size spefication.
+       /*
+        * Check for a size specification.
         * Defaults to long if no or incorrect specification.
         */
        if ((size = cmd_get_data_size(argv[0], 4)) < 0)
@@ -528,7 +532,8 @@ int do_mem_loopw (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
        if (argc < 4)
                return CMD_RET_USAGE;
 
-       /* Check for a size spefication.
+       /*
+        * Check for a size specification.
         * Defaults to long if no or incorrect specification.
         */
        if ((size = cmd_get_data_size(argv[0], 4)) < 0)
@@ -680,7 +685,7 @@ static int do_mem_mtest(cmd_tbl_t *cmdtp, int flag, int argc,
                 * Data line test: write a pattern to the first
                 * location, write the 1's complement to a 'parking'
                 * address (changes the state of the data bus so a
-                * floating bus doen't give a false OK), and then
+                * floating bus doesn't give a false OK), and then
                 * read the value back. Note that we read it back
                 * into a variable because the next time we read it,
                 * it might be right (been there, tough to explain to
@@ -744,7 +749,7 @@ static int do_mem_mtest(cmd_tbl_t *cmdtp, int flag, int argc,
                 *              1's test on the relevant bits of the
                 *              address and checking for aliasing.
                 *              This test will find single-bit
-                *              address failures such as stuck -high,
+                *              address failures such as stuck-high,
                 *              stuck-low, and shorted pins. The base
                 *              address and size of the region are
                 *              selected by the caller.
@@ -1203,6 +1208,22 @@ U_BOOT_CMD(
 
 #endif
 
+#ifdef CONFIG_CMD_MEMINFO
+__weak void board_show_dram(ulong size)
+{
+       puts("DRAM:  ");
+       print_size(size, "\n");
+}
+
+static int do_mem_info(cmd_tbl_t *cmdtp, int flag, int argc,
+                      char * const argv[])
+{
+       board_show_dram(gd->ram_size);
+
+       return 0;
+}
+#endif
+
 U_BOOT_CMD(
        base,   2,      1,      do_mem_base,
        "print or set address offset",
@@ -1243,3 +1264,11 @@ U_BOOT_CMD(
        "[.b, .w, .l] address value delay(ms)"
 );
 #endif /* CONFIG_MX_CYCLIC */
+
+#ifdef CONFIG_CMD_MEMINFO
+U_BOOT_CMD(
+       meminfo,        3,      1,      do_mem_info,
+       "display memory information",
+       ""
+);
+#endif