]> git.sur5r.net Git - u-boot/blobdiff - common/bootstage.c
Merge branch 'master' of git://git.denx.de/u-boot-sunxi
[u-boot] / common / bootstage.c
index 9ef931fd8313f844afa848c684143f10b451c69d..9793b85d4e42d481e677639e8aa8210391379efd 100644 (file)
@@ -1,7 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * Copyright (c) 2011, Google Inc. All rights reserved.
- *
- * SPDX-License-Identifier:    GPL-2.0+
  */
 
 
  */
 
 #include <common.h>
-#include <libfdt.h>
+#include <linux/libfdt.h>
 #include <malloc.h>
 #include <linux/compiler.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
 enum {
-       RECORD_COUNT = CONFIG_BOOTSTAGE_RECORD_COUNT,
+       RECORD_COUNT = CONFIG_VAL(BOOTSTAGE_RECORD_COUNT),
 };
 
 struct bootstage_record {
@@ -205,7 +204,7 @@ uint32_t bootstage_accum(enum bootstage_id id)
  * @return pointer to name, either from the record or pointing to buf.
  */
 static const char *get_record_name(char *buf, int len,
-                                  struct bootstage_record *rec)
+                                  const struct bootstage_record *rec)
 {
        if (rec->name)
                return rec->name;
@@ -327,7 +326,7 @@ void bootstage_report(void)
        }
        if (data->rec_count > RECORD_COUNT)
                printf("Overflowed internal boot id table by %d entries\n"
-                      "- please increase CONFIG_BOOTSTAGE_RECORD_COUNT\n",
+                      "Please increase CONFIG_(SPL_)BOOTSTAGE_RECORD_COUNT\n",
                       data->rec_count - RECORD_COUNT);
 
        puts("\nAccumulated time:\n");
@@ -361,9 +360,9 @@ static void append_data(char **ptrp, char *end, const void *data, int size)
 
 int bootstage_stash(void *base, int size)
 {
-       struct bootstage_data *data = gd->bootstage;
+       const struct bootstage_data *data = gd->bootstage;
        struct bootstage_hdr *hdr = (struct bootstage_hdr *)base;
-       struct bootstage_record *rec;
+       const struct bootstage_record *rec;
        char buf[20];
        char *ptr = base, *end = ptr + size;
        uint32_t count;
@@ -414,12 +413,12 @@ int bootstage_stash(void *base, int size)
        return 0;
 }
 
-int bootstage_unstash(void *base, int size)
+int bootstage_unstash(const void *base, int size)
 {
+       const struct bootstage_hdr *hdr = (struct bootstage_hdr *)base;
        struct bootstage_data *data = gd->bootstage;
-       struct bootstage_hdr *hdr = (struct bootstage_hdr *)base;
+       const char *ptr = base, *end = ptr + size;
        struct bootstage_record *rec;
-       char *ptr = base, *end = ptr + size;
        uint rec_size;
        int i;
 
@@ -456,7 +455,7 @@ int bootstage_unstash(void *base, int size)
 
        if (data->rec_count + hdr->count > RECORD_COUNT) {
                debug("%s: Bootstage has %d records, we have space for %d\n"
-                       "- please increase CONFIG_BOOTSTAGE_USER_COUNT\n",
+                       "Please increase CONFIG_(SPL_)BOOTSTAGE_RECORD_COUNT\n",
                      __func__, hdr->count, RECORD_COUNT - data->rec_count);
                return -ENOSPC;
        }