]> git.sur5r.net Git - u-boot/blobdiff - cmd/mtdparts.c
arm: socfpga: Remove unused passing parameter of socfpga_bridges_reset
[u-boot] / cmd / mtdparts.c
index 53074a1e85cc0501548eb513c093c594a40c10ff..683c48bdad1bc0a9a1c023d8d3802f138d115da2 100644 (file)
@@ -109,17 +109,25 @@ DECLARE_GLOBAL_DATA_PTR;
 #define MTD_WRITEABLE_CMD              1
 
 /* default values for mtdids and mtdparts variables */
-#if defined(MTDIDS_DEFAULT)
-static const char *const mtdids_default = MTDIDS_DEFAULT;
+#if !defined(MTDIDS_DEFAULT)
+#ifdef CONFIG_MTDIDS_DEFAULT
+#define MTDIDS_DEFAULT CONFIG_MTDIDS_DEFAULT
 #else
-static const char *const mtdids_default = NULL;
+#define MTDIDS_DEFAULT NULL
 #endif
-
-#if defined(MTDPARTS_DEFAULT)
-static const char *const mtdparts_default = MTDPARTS_DEFAULT;
+#endif
+#if !defined(MTDPARTS_DEFAULT)
+#ifdef CONFIG_MTDPARTS_DEFAULT
+#define MTDPARTS_DEFAULT CONFIG_MTDPARTS_DEFAULT
 #else
-static const char *const mtdparts_default = NULL;
+#define MTDPARTS_DEFAULT NULL
+#endif
 #endif
+#if defined(CONFIG_SYS_MTDPARTS_RUNTIME)
+extern void board_mtdparts_default(const char **mtdids, const char **mtdparts);
+#endif
+static const char *mtdids_default = MTDIDS_DEFAULT;
+static const char *mtdparts_default = MTDPARTS_DEFAULT;
 
 /* copies of last seen 'mtdids', 'mtdparts' and 'partition' env variables */
 #define MTDIDS_MAXLEN          128
@@ -1493,7 +1501,7 @@ static int spread_partitions(void)
                        part = list_entry(pentry, struct part_info, link);
 
                        debug("spread_partitions: device = %s%d, partition %d ="
-                               " (%s) 0x%08x@0x%08x\n",
+                               " (%s) 0x%08llx@0x%08llx\n",
                                MTD_DEV_TYPE(dev->id->type), dev->id->num,
                                part_num, part->name, part->size,
                                part->offset);
@@ -1548,7 +1556,7 @@ static int parse_mtdparts(const char *const mtdparts)
        int err = 1;
        char tmp_parts[MTDPARTS_MAXLEN];
 
-       debug("\n---parse_mtdparts---\nmtdparts = %s\n\n", p);
+       debug("\n---parse_mtdparts---\nmtdparts = %s\n\n", mtdparts);
 
        /* delete all devices and partitions */
        if (mtd_devices_init() != 0) {
@@ -1725,6 +1733,9 @@ int mtdparts_init(void)
                memset(last_ids, 0, MTDIDS_MAXLEN);
                memset(last_parts, 0, MTDPARTS_MAXLEN);
                memset(last_partition, 0, PARTITION_MAXLEN);
+#if defined(CONFIG_SYS_MTDPARTS_RUNTIME)
+               board_mtdparts_default(&mtdids_default, &mtdparts_default);
+#endif
                use_defaults = 1;
                initialized = 1;
        }
@@ -2022,7 +2033,7 @@ static int do_mtdparts(cmd_tbl_t *cmdtp, int flag, int argc,
 
                if (!strcmp(&argv[1][3], ".spread")) {
                        spread_partition(mtd, p, &next_offset);
-                       debug("increased %s to %d bytes\n", p->name, p->size);
+                       debug("increased %s to %llu bytes\n", p->name, p->size);
                }
 #endif