13 Feb, 2020
1 commit
-
Avoid errors of like
common/console.c: In function ‘console_record_reset’:
common/console.c:615:16: error: passing argument 1 of ‘membuff_purge’
discards ‘volatile’ qualifier from pointer target type
[-Werror=discarded-qualifiers]
615 | membuff_purge(&gd->console_out);
| ^~~~~~~~~~~~~~~~by casting to non-volatile.
The volatile property stems from declarations like
arch/arm/include/asm/global_data.h:114:
But there is no need to treat gd->console_out and gd->console_in as
volatile in the context of common/console.c.Fixes: b612312816ff ("console: Add a function to read a line of the output / eof")
Signed-off-by: Heinrich Schuchardt
Reviewed-by: Simon Glass
06 Feb, 2020
1 commit
-
When recording the console output for testing it is useful to be able to
read the output a line at a time to check that the output is correct. Also
we need to check that we get to the end of the output.Add a console function to return the next line and another to see how must
data is left.Signed-off-by: Simon Glass
07 Nov, 2019
1 commit
-
Newer versions of LLVM-7 will provide an unused function warning over
console_doenv() in the case of SYS_CONSOLE_IS_IN_ENV not being enabled
as can be the case in SPL. Add guards around this function.Signed-off-by: Tom Rini
12 Aug, 2019
2 commits
-
This file contains lots of internal details about the environment. Most
code can include env.h instead, calling the functions there as needed.Rename this file and add a comment at the top to indicate its internal
nature.Signed-off-by: Simon Glass
Acked-by: Joe Hershberger
Reviewed-by: Simon Goldschmidt
[trini: Fixup apalis-tk1.c]
Signed-off-by: Tom Rini -
Move env_set() over to the new header file.
Acked-by: Joe Hershberger
Signed-off-by: Simon Glass
08 Aug, 2019
2 commits
-
Avoid to flush buffer when silent console is activated as the
console can be reactivate later, after relocation, when the env will
be updated with the saved one.Solve issue (missing beginning of U-Boot trace) when:
- CONFIG_SILENT_CONSOLE is activated
- silent=1 is defined in default environment (CONFIG_EXTRA_ENV_SETTINGS)
- silent is removed in saved environment with:
> env delete silent; env saveOnly functional when PRE_CONSOLE_BUFFER is activated.
Signed-off-by: Patrick Delaunay
Signed-off-by: Patrice Chotard -
Update the "silent" property with the variable "silent" get from
saved environment, it solves the issue when:
- CONFIG_SILENT_CONSOLE and CONFIG_SYS_CONSOLE_IS_IN_ENV are activated
- silent is not defined in default environment
- silent is requested in saved environment with:
> env set silent 1; env saveOn next reboot the console is not disabled as expected after relocation
and the environment load from flash (the callback is not called when
the INSERT is requested in the created hash table)Signed-off-by: Patrick Delaunay
Signed-off-by: Patrice Chotard
26 Nov, 2018
1 commit
-
We support putc() in this case but not puts(), but this is more useful
since it is what printf() uses.This particularly affects debugging early in SPL, where currently printf()
statements result in no output. Fix this by adding a special case into
puts() for sandbox, just like putc().Signed-off-by: Simon Glass
Reviewed-by: Joe Hershberger
11 Sep, 2018
1 commit
-
Unify the fgetc function when MUX is activated or not:
- always call tstc() : it is the normal behavior expected
by serial uclass (call tstc then getc) and that avoids
issue when SERIAL_RX_BUFFER is activated
- reload WATCHDOG in the char waiting loopThis patch allow to have the same behavior when CONSOLE_MUX is activated
or not and avoid regression when this feature is deactivated.Signed-off-by: Patrick Delaunay
Reviewed-by: Simon Glass
27 Jul, 2018
2 commits
-
In raw mode, handle ctrl-c as normal. This allows normal ctrl-c behavior
such as aborting a command that is timing out without completely
terminating the sandbox executable.In [1], Simon disabled this. His reason for it was that it interferes
with piping test scripts. Piping should be done in cooked mode, so this
change should still not interfere.[1] commit 8969ea3e9f2db04a6b3675 ("sandbox: Disable Ctrl-C")
Signed-off-by: Joe Hershberger
Reviewed-by: Simon Glass -
We don't necessarily want to re-enable ctrl-c if it was already disabled
when calling tstc().Signed-off-by: Joe Hershberger
Reviewed-by: Simon Glass
19 Jun, 2018
1 commit
-
Both putc() and puts() can be called before global_data is set up. Some of
the code paths don't handle this correctly. Add an explicit test before
any member is accessed.Reported-by: Coverity (CID: 169030)
Signed-off-by: Simon Glass
Reviewed-by: Heinrich Schuchardt
07 May, 2018
2 commits
-
When U-Boot started using SPDX tags we were among the early adopters and
there weren't a lot of other examples to borrow from. So we picked the
area of the file that usually had a full license text and replaced it
with an appropriate SPDX-License-Identifier: entry. Since then, the
Linux Kernel has adopted SPDX tags and they place it as the very first
line in a file (except where shebangs are used, then it's second line)
and with slightly different comment styles than us.In part due to community overlap, in part due to better tag visibility
and in part for other minor reasons, switch over to that style.This commit changes all instances where we have a single declared
license in the tag as both the before and after are identical in tag
contents. There's also a few places where I found we did not have a tag
and have introduced one.Signed-off-by: Tom Rini
-
With tighter build flags the fact that doesn't have a
reference back to MAX_NAMES causes an error. Include here and
then in common/console.c use MAX_NAMES rather than 3 when working with
stdio_names.Reported-by: Peter Robinson
Signed-off-by: Tom Rini
Tested-by: Peter Robinson
08 Dec, 2017
1 commit
-
While sandbox works OK without the special-case code, it does result in
console output being stored in the pre-console buffer while sandbox starts
up. If there is a crash or a problem then there is no indication of what
is going on.For ease of debugging it seems better to revert this change also.
This reverts commit d8c6fb8cedbc35eee27730a7fa544e499b3c81cc.
Signed-off-by: Simon Glass
13 Nov, 2017
1 commit
-
This reverts commit c61d0009feb966e0e93254a8c435a1889085e6b8.
A tbs2910 board user reported a very slow console frambuffer as
regression in current u-boot. I could bisect this down to the
above mentioned commit.This revert brings back the fast framebuffer console (one
cache flush per string in puts(), not after each char).Reported-by: Uwe Scheffler
Signed-off-by: Soeren Moch
Tested-by: Uwe Scheffler
Reviewed-by: Simon Glass
28 Aug, 2017
1 commit
-
The silent environment callback function does not update the silent
flag during silent env set or unset. That is because of duplicated
CONFIG keyword at preprocessor condition in silent environment
callback function and cause silent env callback unable to work.This patch is to remove the duplicated CONFIG keywork in silent
environment callback function.Signed-off-by: Wilson Lee
Cc: Keng Soon Cheah
Cc: Chen Yee Chew
Cc: Joe Hershberger
16 Aug, 2017
2 commits
-
We are now using an env_ prefix for environment functions. Rename these
two functions for consistency. Also add function comments in common.h.Quite a few places use getenv() in a condition context, provoking a
warning from checkpatch. These are fixed up in this patch also.Suggested-by: Wolfgang Denk
Signed-off-by: Simon Glass -
We are now using an env_ prefix for environment functions. Rename setenv()
for consistency. Also add function comments in common.h.Suggested-by: Wolfgang Denk
Signed-off-by: Simon Glass
01 Aug, 2017
2 commits
-
With driver model the serial device is often not called "serial". Mark
driver-model stdio devices so that they can be detected and we can look up
the uclass. This is a more reliable way of finding out whether the console
is connected to a serial device or not.Signed-off-by: Simon Glass
-
Put the check for whether a console is a serial device in a function so
that we can share the code in the two places that use it.Signed-off-by: Simon Glass
29 Jul, 2017
1 commit
-
Current puts() and putc() have similar #ifdef / if() conditionals.
Make puts() iterate over putc() to avoid code duplication.Signed-off-by: Masahiro Yamada
Reviewed-by: Simon Glass
12 Jul, 2017
3 commits
-
At present sandbox has a special case where it directly calls os_putc()
when it does not have a console yet.Now that we have the pre-console buffer enabled we can drop this. Any
early characters will be buffered and output later.Signed-off-by: Simon Glass
Reviewed-by: Bin Meng
Tested-by: Stephen Warren -
At present this feature casts the address to a pointer. Use the
map_sysmem() function so that it will work correctly on sandbox.Signed-off-by: Simon Glass
Reviewed-by: Bin Meng
Tested-by: Bin Meng
Tested-by: Stephen Warren -
At present the U-Boot banner is only displayed on the serial console. If
this is not visible to the user, the banner does not show. Some devices
have a video display which can usefully display this information.Add a banner which is printed after relocation only on non-serial devices
if CONFIG_DISPLAY_BOARDINFO_LATE is defined.Signed-off-by: Simon Glass
Reviewed-by: Bin Meng
Tested-by: Bin Meng
Tested-by: Stephen Warren
06 Feb, 2017
1 commit
-
CONFIG_CONSOLE_MUX and CONFIG_SYS_CONSOLE_IS_IN_ENV are not applicable
for SPL. Update the console code to use CONFIG_IS_ENABLED(), so that these
options will be inactive in SPL.Signed-off-by: Simon Glass
Reviewed-by: Bin Meng
24 Oct, 2016
2 commits
-
Move these option to Kconfig and tidy up existing uses.
Signed-off-by: Simon Glass
Reviewed-by: Jagan Teki -
Move these option to Kconfig and tidy up existing uses.
The Power PC boards don't have a suitable common element: the common header
files don't appear to line up with the Kconfig files as far as I can tell.
This results in a lot of defconfig changes.Signed-off-by: Simon Glass
Reviewed-by: Jagan Teki
[trini: Re-migrate, update common/console.c logic]
Signed-off-by: Tom Rini
18 Oct, 2016
1 commit
-
Hardware: CM-FX6 Module from Compulab
This patch fixes unwanted watchdog resets while the user enters
a command at the U-Boot prompt.As found on the CM-FX6 board from Compulab, when having enabled the
watchdog, a missing WATCHDOG_RESET call in common/console.c causes
this and alike boards to reset when the watchdog's timeout has
elapsed while waiting at the U-Boot prompt.Despite the user could press several keys within the watchdog
timeout limit, the while loop in cli_readline.c, line 261, does only
call WATCHDOG_RESET if first == 1, which gets set to 0 in the 1st
loop iteration. This leads to a watchdog timeout no matter if the
user presses keys or not.Although, this affects other boards as well as it touches
common/console.c, the macro WATCHDOG_RESET expands to {} if watchdog
support isn't configured. Hence, there's no harm caused and no need to
surround it by #ifdef in this case.* Symptom:
U-Boot resets after watchdog times out when in commandline prompt
and watchdog is enabled.* Reasoning:
When U-Boot shows the commandline prompt, the following function
call stack is executed while waiting for a keypress:common/main.c:
main_loop => common/cli.c: cli_loop() =>
common/cli_hush.c:
parse_file_outer => parse_stream_outer =>
parse_stream => b_getch(i) =>
i->get(i) => file_get =>
get_user_input => cmdedit_read_input =>
uboot_cli_readline =>
common/cli_readline.c:
cli_readline => cli_readline_into_buffer =>
cread_line => getcmd_getch (== getc) =>
common/console.c:
fgetc => console_tstccommon/console.c:
(with CONFIG_CONSOLE_MUX is set)- in console_tstc line 181:
If dev->tstc(dev) returns 0, the global tstcdev variable doesn't get
set. This is the case if no character is in the serial buffer.- in fgetc(int file), line 297:
Program flow keeps looping because tstcdev does not get set.
Therefore WATCHDOG_RESET is not called, as mx_serial_tstc from
drivers/serial/serial_mxc.c does not call it.* Solution:
Add WATCHDOG_RESET into the loop of console_tstc.Note: Macro expands to {} if not configured, so no #ifdef is needed.
* Comment:
Signed-off-by: Christian Storm
Signed-off-by: Jan Kiszka
Signed-off-by: Andreas J. Reichel
Acked-by: Simon Glass
07 Oct, 2016
1 commit
-
When CONFIG_SILENT_CONSOLE is defined and the default environment has
silent=1 it is not possible for a user to make the console un-silent if
the environment is not available when console_init_f() is called (for
example because the environment is in SPI).Add a new helper function console_update_silent() and call it from both
console_init_f() and console_init_r().Signed-off-by: Chris Packham
Reviewed-by: Simon Glass
27 Mar, 2016
1 commit
-
Since commit b391d74 "debug_uart: output CR along with LF", the
handling in puts() is duplicated, not to mention that it should
output carriage return before line feed.Signed-off-by: Bin Meng
Reviewed-by: Tom Rini
12 Feb, 2016
1 commit
-
Boards with a saved environment may use 'lcd' in their stdout environment
variable, expecting that this will enable output to the LCD. When the board
moves to use driver model for video, this will no-longer work. Add a
work-around to fix this. A warning messages is printed, and we will remove
the work-around at the end of 2016.Signed-off-by: Simon Glass
Acked-by: Anatolij Gustschin
Tested-by: Stephen Warren
25 Jan, 2016
1 commit
-
clang-3.8 reports that these functions are unused, remove them. As this
is the last part of CONFIG_MODEM_SUPPORT_DEBUG, drop that from README.Reviewed-by: Bin Meng
Signed-off-by: Tom Rini
23 Nov, 2015
3 commits
-
This patch adds a small printf() version that supports all basic formats.
Its intented to be used in U-Boot SPL versions on platforms with very
limited internal RAM sizes.To enable it, just define CONFIG_USE_TINY_PRINTF in your defconfig. This
will result in the SPL using this tiny function and the main U-Boot
still using the full-blown printf() function.This code was copied from:
http://www.sparetimelabs.com/printfrevisited
With mostly only coding style related changes so that its checkpatch
clean.The size reduction is about 2.5KiB. Here a comparison for the db-mv784mp-gp
(Marvell AXP) SPL:Without this patch:
58963 18536 1928 79427 13643 ./spl/u-boot-splWith this patch:
56542 18536 1956 77034 12cea ./spl/u-boot-splNote:
To make it possible to compile tiny-printf.c instead of vsprintf.c when
CONFIG_USE_TINY_PRINTF is defined, the functions printf() and vprintf() are
moved from common/console.c into vsprintf.c in this patch.Signed-off-by: Stefan Roese
Cc: Simon Glass
Cc: Hans de Goede
Cc: Tom Rini
Cc: Albert Aribaud -
Change some comments to match the U-Boot coding style rules.
Signed-off-by: Stefan Roese
Cc: Simon Glass
Acked-by: Simon Glass -
As done in commit da229e4e [sandbox: Drop special-case sandbox console code],
this patch drops the sandbox special-case code in vprintf() that was
missed by Simon at that time.Signed-off-by: Stefan Roese
Cc: Simon Glass
Acked-by: Simon Glass
20 Nov, 2015
2 commits
-
It is useful to be able to record console output and provide console input
via a buffer. This provides sandbox with the ability to run a command and
check its output. If the console is set to silent then no visible output
is generated.This also provides a means to fix the problem where tests produce unwanted
output, such as errors or warnings. This can be confusing. We can instead
set the console to silent and record this output. It can be checked later
in the test if required.It is possible that this may prove useful for non-test situations. For
example the console output may be suppressed for normal operations, but
recorded and stored for access by the OS. That feature is not implemented
at present.Signed-off-by: Simon Glass
-
The console includes a global variable and several functions that are only
used by a small subset of U-Boot files. Before adding more functions, move
the definitions into their own header file.Signed-off-by: Simon Glass
22 Jul, 2015
2 commits
-
At present printf() skips output if it can see there is no console. This
is really just an optimisation, and is not necessary. Also it is currently
incorrect in some cases. Rather than update the logic, just remove it so
that we don't need to keep it in sync.Signed-off-by: Simon Glass
-
When there is no console ready, allow the debug UART to be used for output.
This makes debugging of early code considerably easier.Signed-off-by: Simon Glass