summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2023-04-03 23:45:41 +0300
committerTom Rini <trini@konsulko.com>2023-04-03 23:45:41 +0300
commit288fe30a2367b8d0e3f416493150a38ebaa88459 (patch)
tree1f841eb95d9ceeda4aa3255fb1132a0342f9b19a /common
parentfd4ed6b7e83ec3aea9a2ce21baea8ca9676f40dd (diff)
parent9876c8c147144db2c120fcc9ffa6de27f6894441 (diff)
downloadu-boot-288fe30a2367b8d0e3f416493150a38ebaa88459.tar.xz
Merge branch 'next'
Signed-off-by: Tom Rini <trini@konsulko.com>
Diffstat (limited to 'common')
-rw-r--r--common/Kconfig62
-rw-r--r--common/board_r.c7
-rw-r--r--common/cli.c25
-rw-r--r--common/console.c2
-rw-r--r--common/dlmalloc.c8
-rw-r--r--common/main.c1
-rw-r--r--common/spl/Kconfig9
-rw-r--r--common/spl/spl_mmc.c12
-rw-r--r--common/splash.c8
9 files changed, 104 insertions, 30 deletions
diff --git a/common/Kconfig b/common/Kconfig
index 0afc01b759..7ff62552cb 100644
--- a/common/Kconfig
+++ b/common/Kconfig
@@ -551,12 +551,11 @@ endmenu
menu "Init options"
config BOARD_TYPES
- bool "Call get_board_type() to get and display the board type"
+ bool "Enable board_type entry in global data struct"
help
- If this option is enabled, checkboard() will call get_board_type()
- to get a string containing the board type and this will be
- displayed immediately after the model is shown on the console
- early in boot.
+ If this option is enabled, a field will be added to the global
+ data struct to store an unsigned long value for the type of
+ platform that we have determined we are on, at run-time.
config DISPLAY_CPUINFO
bool "Display information about the CPU during start up"
@@ -631,10 +630,30 @@ config EVENT_DEBUG
events, such as event-type names. This adds to the code size of
U-Boot so can be turned off for production builds.
+config SPL_EVENT
+ bool # General-purpose event-handling mechanism in SPL
+ depends on SPL
+ help
+ This adds a framework for general purpose sending and processing of
+ events, to allow interested parties to be alerted when something
+ happens. This is an attempt to stem the flow of weak functions,
+ hooks, functions in board_f.c and board_r.c and the Kconfig options
+ below.
+
+ See doc/develop/event.rst for more information.
+
+config SPL_EVENT_DYNAMIC
+ bool
+ depends on SPL_EVENT && EVENT_DYNAMIC
+ help
+ Enable this to support adding an event spy at runtime, without adding
+ it to the EVENT_SPY() linker list. This increases code size slightly
+ but provides more flexibility for boards and subsystems that need it.
+
endif # EVENT
config ARCH_EARLY_INIT_R
- bool "Call arch-specific init soon after relocation"
+ bool
help
With this option U-Boot will call arch_early_init_r() soon after
relocation. Driver model is running by this point, and the cache
@@ -1043,7 +1062,7 @@ choice
prompt "Bloblist location in TPL"
help
Select the location of the bloblist, via various means. Typically
- you should use the same value for SPL as for U-Boot, since they need
+ you should use the same value for TPL as for U-Boot, since they need
to look in the same place. But if BLOBLIST_ALLOC is used, then a
fresh bloblist will be created each time, since there is no shared
address (between phases) for the bloblist.
@@ -1066,6 +1085,35 @@ endchoice
endif # TPL_BLOBLIST
+if VPL_BLOBLIST
+
+choice
+ prompt "Bloblist location in VPL"
+ help
+ Select the location of the bloblist, via various means. Typically
+ you should use the same value for VPL as for U-Boot, since they need
+ to look in the same place. But if BLOBLIST_ALLOC is used, then a
+ fresh bloblist will be created each time, since there is no shared
+ address (between phases) for the bloblist.
+
+config VPL_BLOBLIST_FIXED
+ bool "Place bloblist at a fixed address in memory"
+ help
+ Select this to used a fixed memory address for the bloblist. If the
+ bloblist exists at this address from a previous phase, it used as is.
+ If not it is created at this address in VPL.
+
+config VPL_BLOBLIST_ALLOC
+ bool "Allocate bloblist"
+ help
+ Allocate the bloblist using malloc(). This avoids the need to
+ specify a fixed address on systems where this is unknown or can
+ change at runtime.
+
+endchoice
+
+endif # VPL_BLOBLIST
+
endmenu
source "common/spl/Kconfig"
diff --git a/common/board_r.c b/common/board_r.c
index e45003353f..6b4180b3ec 100644
--- a/common/board_r.c
+++ b/common/board_r.c
@@ -569,6 +569,13 @@ static int dm_announce(void)
printf("Warning: Unexpected devicetree source (not from a prior stage)");
printf("Warning: U-Boot may not function properly\n");
}
+ if (IS_ENABLED(CONFIG_OF_TAG_MIGRATE) &&
+ (gd->flags & GD_FLG_OF_TAG_MIGRATE))
+ /*
+ * U-Boot will silently fail to work after 2023.07 if
+ * there are old tags present
+ */
+ printf("Warning: Device tree includes old 'u-boot,dm-' tags: please fix by 2023.07!\n");
}
return 0;
diff --git a/common/cli.c b/common/cli.c
index 9451e6a142..3916a7b10a 100644
--- a/common/cli.c
+++ b/common/cli.c
@@ -8,6 +8,8 @@
* JinHua Luo, GuangDong Linux Center, <luo.jinhua@gd-linux.com>
*/
+#define pr_fmt(fmt) "cli: %s: " fmt, __func__
+
#include <common.h>
#include <bootstage.h>
#include <cli.h>
@@ -20,6 +22,7 @@
#include <malloc.h>
#include <asm/global_data.h>
#include <dm/ofnode.h>
+#include <linux/errno.h>
#ifdef CONFIG_CMDLINE
/*
@@ -129,16 +132,26 @@ int run_command_list(const char *cmd, int len, int flag)
int run_commandf(const char *fmt, ...)
{
va_list args;
- char cmd[128];
- int i, ret;
+ int nbytes;
va_start(args, fmt);
- i = vsnprintf(cmd, sizeof(cmd), fmt, args);
+ /*
+ * Limit the console_buffer space being used to CONFIG_SYS_CBSIZE,
+ * because its last byte is used to fit the replacement of \0 by \n\0
+ * in underlying hush parser
+ */
+ nbytes = vsnprintf(console_buffer, CONFIG_SYS_CBSIZE, fmt, args);
va_end(args);
- ret = run_command(cmd, 0);
-
- return ret;
+ if (nbytes < 0) {
+ pr_debug("I/O internal error occurred.\n");
+ return -EIO;
+ } else if (nbytes >= CONFIG_SYS_CBSIZE) {
+ pr_debug("'fmt' size:%d exceeds the limit(%d)\n",
+ nbytes, CONFIG_SYS_CBSIZE);
+ return -ENOSPC;
+ }
+ return run_command(console_buffer, 0);
}
/****************************************************************************/
diff --git a/common/console.c b/common/console.c
index e4301a4932..71ad8efd6f 100644
--- a/common/console.c
+++ b/common/console.c
@@ -842,7 +842,7 @@ int console_record_readline(char *str, int maxlen)
return -ENOSPC;
return membuff_readline((struct membuff *)&gd->console_out, str,
- maxlen, ' ');
+ maxlen, '\0');
}
int console_record_avail(void)
diff --git a/common/dlmalloc.c b/common/dlmalloc.c
index 41c7230424..0f9b7262d5 100644
--- a/common/dlmalloc.c
+++ b/common/dlmalloc.c
@@ -80,7 +80,7 @@ GmListElement* makeGmListElement (void* bas)
return this;
}
-void gcleanup ()
+void gcleanup (void)
{
BOOL rval;
assert ( (head == NULL) || (head->base == (void*)gAddressBase));
@@ -2340,7 +2340,7 @@ size_t malloc_usable_size(mem) Void_t* mem;
/* Utility to update current_mallinfo for malloc_stats and mallinfo() */
#ifdef DEBUG
-static void malloc_update_mallinfo()
+static void malloc_update_mallinfo(void)
{
int i;
mbinptr b;
@@ -2397,7 +2397,7 @@ static void malloc_update_mallinfo()
*/
#ifdef DEBUG
-void malloc_stats()
+void malloc_stats(void)
{
malloc_update_mallinfo();
printf("max system bytes = %10u\n",
@@ -2418,7 +2418,7 @@ void malloc_stats()
*/
#ifdef DEBUG
-struct mallinfo mALLINFo()
+struct mallinfo mALLINFo(void)
{
malloc_update_mallinfo();
return current_mallinfo;
diff --git a/common/main.c b/common/main.c
index 682f3359ea..7c70de2e59 100644
--- a/common/main.c
+++ b/common/main.c
@@ -13,6 +13,7 @@
#include <command.h>
#include <console.h>
#include <env.h>
+#include <fdtdec.h>
#include <init.h>
#include <net.h>
#include <version_string.h>
diff --git a/common/spl/Kconfig b/common/spl/Kconfig
index 3c2af453ab..2c042ad306 100644
--- a/common/spl/Kconfig
+++ b/common/spl/Kconfig
@@ -816,8 +816,17 @@ config SPL_MMC
this option to build the drivers in drivers/mmc as part of an SPL
build.
+config SYS_MMCSD_FS_BOOT
+ bool "MMC FS Boot mode"
+ depends on SPL_MMC
+ default y if !ARCH_MVEBU
+ help
+ Enable MMC FS Boot mode. Partition is selected by option
+ SYS_MMCSD_FS_BOOT_PARTITION.
+
config SYS_MMCSD_FS_BOOT_PARTITION
int "MMC Boot Partition"
+ depends on SYS_MMCSD_FS_BOOT
default 1
help
Partition on the MMC to load U-Boot from when the MMC is being
diff --git a/common/spl/spl_mmc.c b/common/spl/spl_mmc.c
index e4135b2048..bd5e6adf1e 100644
--- a/common/spl/spl_mmc.c
+++ b/common/spl/spl_mmc.c
@@ -272,7 +272,7 @@ int spl_start_uboot(void)
}
#endif
-#ifdef CONFIG_SYS_MMCSD_FS_BOOT_PARTITION
+#ifdef CONFIG_SYS_MMCSD_FS_BOOT
static int spl_mmc_do_fs_boot(struct spl_image_info *spl_image,
struct spl_boot_device *bootdev,
struct mmc *mmc,
@@ -341,14 +341,6 @@ static int spl_mmc_do_fs_boot(struct spl_image_info *spl_image,
return err;
}
-#else
-static int spl_mmc_do_fs_boot(struct spl_image_info *spl_image,
- struct spl_boot_device *bootdev,
- struct mmc *mmc,
- const char *filename)
-{
- return -ENOSYS;
-}
#endif
u32 __weak spl_mmc_boot_mode(struct mmc *mmc, const u32 boot_device)
@@ -481,6 +473,7 @@ int spl_mmc_load(struct spl_image_info *spl_image,
return err;
#endif
/* If RAW mode fails, try FS mode. */
+#ifdef CONFIG_SYS_MMCSD_FS_BOOT
case MMCSD_MODE_FS:
debug("spl: mmc boot mode: fs\n");
@@ -489,6 +482,7 @@ int spl_mmc_load(struct spl_image_info *spl_image,
return err;
break;
+#endif
#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
default:
puts("spl: mmc: wrong boot mode\n");
diff --git a/common/splash.c b/common/splash.c
index 245ff680eb..4bc54b1bf9 100644
--- a/common/splash.c
+++ b/common/splash.c
@@ -127,9 +127,11 @@ void splash_get_pos(int *x, int *y)
#include <dm.h>
#include <video_console.h>
#include <video_font.h>
+#include <video_font_data.h>
void splash_display_banner(void)
{
+ struct video_fontdata __maybe_unused *fontdata = fonts;
struct udevice *dev;
char buf[DISPLAY_OPTIONS_BANNER_LENGTH];
int col, row, ret;
@@ -138,9 +140,9 @@ void splash_display_banner(void)
if (ret)
return;
-#ifdef CONFIG_VIDEO_LOGO
- col = BMP_LOGO_WIDTH / VIDEO_FONT_WIDTH + 1;
- row = BMP_LOGO_HEIGHT / VIDEO_FONT_HEIGHT + 1;
+#if IS_ENABLED(CONFIG_VIDEO_LOGO)
+ col = BMP_LOGO_WIDTH / fontdata->width + 1;
+ row = BMP_LOGO_HEIGHT / fontdata->height + 1;
#else
col = 0;
row = 0;