summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2019-03-07 14:23:37 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2019-03-07 14:23:37 +0100
commit63557eb99211a4d1e5f722255a2f9fd0a1e7c6ae (patch)
tree1c23d2aca9a2fa5374c82b8cd6119c498c6983f8 /common
parenteae7bc9688f80eb105d159d544391dbd16be27fe (diff)
parent4902e6c5e3be35f5653b304f4b578026473c91a3 (diff)
downloadbarebox-63557eb99211a4d1e5f722255a2f9fd0a1e7c6ae.tar.gz
Merge branch 'for-next/misc'
Diffstat (limited to 'common')
-rw-r--r--common/Kconfig28
-rw-r--r--common/console_common.c41
2 files changed, 38 insertions, 31 deletions
diff --git a/common/Kconfig b/common/Kconfig
index 21b33f0..53052c9 100644
--- a/common/Kconfig
+++ b/common/Kconfig
@@ -245,16 +245,6 @@ config BAREBOX_MAX_BARE_INIT_SIZE
this will allow your bare_init to fit in SRAM as example
ARCH can overwrite it via ARCH_BAREBOX_MAX_BARE_INIT_SIZE
-config BAREBOX_MAX_PBLX_SIZE
- depends on PBL_MULTI_IMAGES
- depends on IMAGE_COMPRESSION
- prompt "Maximum PBLX size"
- hex
- default 0xffffffff
- help
- Define the maximum size of the PBLX image.
- The pblx is a self extracting barebox binary.
-
config HAVE_CONFIGURABLE_MEMORY_LAYOUT
bool
@@ -1016,11 +1006,21 @@ config DEBUG_INFO
config DEBUG_LL
bool
depends on HAS_DEBUG_LL
- prompt "low level debug messages"
+ prompt "Low level debug messages (read help)"
help
- Enable this to get low level debug messages during barebox initialization.
- This requires SoC specific support. Most SoCs require the debug UART to be
- initialized by a debugger or first stage bootloader.
+ Enable this to get low level debug messages during barebox
+ initialization. This is helpful if you are debugging code that
+ executes before the console is initialized.
+
+ This requires SoC specific support. Most SoCs require the
+ debug UART to be initialized by a debugger or first stage
+ bootloader.
+
+ Note that selecting this option will limit barebox to a single
+ UART definition, as specified below under "low-level debugging
+ port". Attempting to boot the resulting image on a different
+ platform *will not work*, so this option should not be enabled
+ for builds that are intended to be portable.
choice
prompt "Kernel low-level debugging port"
diff --git a/common/console_common.c b/common/console_common.c
index 0131a11..a4d2636 100644
--- a/common/console_common.c
+++ b/common/console_common.c
@@ -79,6 +79,18 @@ void log_clean(unsigned int limit)
}
}
+static void print_colored_log_level(const int level)
+{
+ if (!console_allow_color())
+ return;
+ if (level >= ARRAY_SIZE(colored_log_level))
+ return;
+ if (!colored_log_level[level])
+ return;
+
+ puts(colored_log_level[level]);
+}
+
static void pr_puts(int level, const char *str)
{
struct log_entry *log;
@@ -108,21 +120,10 @@ nolog:
if (level > barebox_loglevel)
return;
+ print_colored_log_level(level);
puts(str);
}
-static void print_colored_log_level(const int level)
-{
- if (!console_allow_color())
- return;
- if (level >= ARRAY_SIZE(colored_log_level))
- return;
- if (!colored_log_level[level])
- return;
-
- pr_puts(level, colored_log_level[level]);
-}
-
int pr_print(int level, const char *fmt, ...)
{
va_list args;
@@ -132,8 +133,6 @@ int pr_print(int level, const char *fmt, ...)
if (!IS_ENABLED(CONFIG_LOGBUF) && level > barebox_loglevel)
return 0;
- print_colored_log_level(level);
-
va_start(args, fmt);
i = vsprintf(printbuffer, fmt, args);
va_end(args);
@@ -152,8 +151,6 @@ int dev_printf(int level, const struct device_d *dev, const char *format, ...)
if (!IS_ENABLED(CONFIG_LOGBUF) && level > barebox_loglevel)
return 0;
- print_colored_log_level(level);
-
if (dev->driver && dev->driver->name)
ret += sprintf(printbuffer, "%s ", dev->driver->name);
@@ -193,7 +190,7 @@ static int console_common_init(void)
}
device_initcall(console_common_init);
-void log_print(unsigned flags)
+void log_print(unsigned flags, unsigned levels)
{
struct log_entry *log;
unsigned long last = 0;
@@ -202,6 +199,16 @@ void log_print(unsigned flags)
uint64_t diff = log->timestamp - time_beginning;
unsigned long difful;
+ if (levels && !(levels & (1 << log->level)))
+ continue;
+
+ if (!(flags & (BAREBOX_LOG_PRINT_RAW | BAREBOX_LOG_PRINT_TIME
+ | BAREBOX_LOG_DIFF_TIME)))
+ print_colored_log_level(log->level);
+
+ if (flags & BAREBOX_LOG_PRINT_RAW)
+ printf("<%i>", log->level);
+
do_div(diff, 1000);
difful = diff;