test: dm: Add test case for devfdt_get_addr_ptr
[platform/kernel/u-boot.git] / cmd / flash.c
index 230d840..240871e 100644 (file)
@@ -9,6 +9,8 @@
  */
 #include <common.h>
 #include <command.h>
+#include <log.h>
+#include <uuid.h>
 
 #if defined(CONFIG_CMD_MTDPARTS)
 #include <jffs2/jffs2.h>
@@ -268,7 +270,8 @@ flash_fill_sect_ranges (ulong addr_first, ulong addr_last,
 }
 #endif /* CONFIG_MTD_NOR_FLASH */
 
-static int do_flinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_flinfo(struct cmd_tbl *cmdtp, int flag, int argc,
+                    char *const argv[])
 {
 #ifdef CONFIG_MTD_NOR_FLASH
        ulong bank;
@@ -296,7 +299,8 @@ static int do_flinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
        return 0;
 }
 
-static int do_flerase(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_flerase(struct cmd_tbl *cmdtp, int flag, int argc,
+                     char *const argv[])
 {
 #ifdef CONFIG_MTD_NOR_FLASH
        flash_info_t *info = NULL;
@@ -408,13 +412,12 @@ int flash_sect_erase(ulong addr_first, ulong addr_last)
                     ++bank, ++info) {
                        if (s_first[bank]>=0) {
                                erased += s_last[bank] - s_first[bank] + 1;
-                               debug ("Erase Flash from 0x%08lx to 0x%08lx "
-                                       "in Bank # %ld ",
-                                       info->start[s_first[bank]],
-                                       (s_last[bank] == info->sector_count) ?
-                                               info->start[0] + info->size - 1:
-                                               info->start[s_last[bank]+1] - 1,
-                                       bank+1);
+                               debug("Erase Flash from 0x%08lx to 0x%08lx in Bank # %ld ",
+                                     info->start[s_first[bank]],
+                                     (s_last[bank] == info->sector_count) ?
+                                     info->start[0] + info->size - 1 :
+                                     info->start[s_last[bank] + 1] - 1,
+                                     bank + 1);
                                rcode = flash_erase(info, s_first[bank],
                                                    s_last[bank]);
                        }
@@ -430,7 +433,8 @@ int flash_sect_erase(ulong addr_first, ulong addr_last)
 }
 #endif /* CONFIG_MTD_NOR_FLASH */
 
-static int do_protect(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_protect(struct cmd_tbl *cmdtp, int flag, int argc,
+                     char *const argv[])
 {
        int rcode = 0;
 #ifdef CONFIG_MTD_NOR_FLASH
@@ -608,9 +612,9 @@ int flash_sect_protect(int p, ulong addr_first, ulong addr_last)
                        }
 
                        if (s_first[bank]>=0 && s_first[bank]<=s_last[bank]) {
-                               debug ("%sProtecting sectors %d..%d in bank %ld\n",
-                                       p ? "" : "Un-",
-                                       s_first[bank], s_last[bank], bank+1);
+                               debug("%sProtecting sectors %d..%d in bank %ld\n",
+                                     p ? "" : "Un-", s_first[bank],
+                                     s_last[bank], bank + 1);
                                protected += s_last[bank] - s_first[bank] + 1;
                                for (i=s_first[bank]; i<=s_last[bank]; ++i) {
 #if defined(CONFIG_SYS_FLASH_PROTECTION)