<feed xmlns='http://www.w3.org/2005/Atom'>
<title>u-boot.git/common/console.c, branch v2017.09-rc2</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.
</subtitle>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/'/>
<entry>
<title>dm: console: Check for serial devices properly</title>
<updated>2017-07-31T16:21:40+00:00</updated>
<author>
<name>Simon Glass</name>
<email>sjg@chromium.org</email>
</author>
<published>2017-07-27T15:31:04+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=7b3c4c3a5305c68a7de2444f555ac7241d6fdb8e'/>
<id>7b3c4c3a5305c68a7de2444f555ac7241d6fdb8e</id>
<content type='text'>
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 &lt;sjg@chromium.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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 &lt;sjg@chromium.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>console: Unify the check for a serial console</title>
<updated>2017-07-31T16:21:40+00:00</updated>
<author>
<name>Simon Glass</name>
<email>sjg@chromium.org</email>
</author>
<published>2017-07-27T15:31:03+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=42f9f915c2b7aeac222c93a7f7085d9838722efc'/>
<id>42f9f915c2b7aeac222c93a7f7085d9838722efc</id>
<content type='text'>
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 &lt;sjg@chromium.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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 &lt;sjg@chromium.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>console: simplify puts()</title>
<updated>2017-07-28T18:02:47+00:00</updated>
<author>
<name>Masahiro Yamada</name>
<email>yamada.masahiro@socionext.com</email>
</author>
<published>2017-07-17T04:08:32+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=c61d0009feb966e0e93254a8c435a1889085e6b8'/>
<id>c61d0009feb966e0e93254a8c435a1889085e6b8</id>
<content type='text'>
Current puts() and putc() have similar #ifdef / if() conditionals.
Make puts() iterate over putc() to avoid code duplication.

Signed-off-by: Masahiro Yamada &lt;yamada.masahiro@socionext.com&gt;
Reviewed-by: Simon Glass &lt;sjg@chromium.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Current puts() and putc() have similar #ifdef / if() conditionals.
Make puts() iterate over putc() to avoid code duplication.

Signed-off-by: Masahiro Yamada &lt;yamada.masahiro@socionext.com&gt;
Reviewed-by: Simon Glass &lt;sjg@chromium.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>sandbox: Drop special case console code for sandbox</title>
<updated>2017-07-11T16:08:20+00:00</updated>
<author>
<name>Simon Glass</name>
<email>sjg@chromium.org</email>
</author>
<published>2017-06-16T03:37:54+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=d8c6fb8cedbc35eee27730a7fa544e499b3c81cc'/>
<id>d8c6fb8cedbc35eee27730a7fa544e499b3c81cc</id>
<content type='text'>
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 &lt;sjg@chromium.org&gt;
Reviewed-by: Bin Meng &lt;bmeng.cn@gmail.com&gt;
Tested-by: Stephen Warren &lt;swarren@nvidia.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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 &lt;sjg@chromium.org&gt;
Reviewed-by: Bin Meng &lt;bmeng.cn@gmail.com&gt;
Tested-by: Stephen Warren &lt;swarren@nvidia.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>console: Use map_sysmem() for the pre-relocation console</title>
<updated>2017-07-11T16:08:19+00:00</updated>
<author>
<name>Simon Glass</name>
<email>sjg@chromium.org</email>
</author>
<published>2017-06-16T03:37:52+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=4e6bafa56807b7ea4ebfb2eebbcf2eae674866e0'/>
<id>4e6bafa56807b7ea4ebfb2eebbcf2eae674866e0</id>
<content type='text'>
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 &lt;sjg@chromium.org&gt;
Reviewed-by: Bin Meng &lt;bmeng.cn@gmail.com&gt;
Tested-by: Bin Meng &lt;bmeng.cn@gmail.com&gt;
Tested-by: Stephen Warren &lt;swarren@nvidia.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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 &lt;sjg@chromium.org&gt;
Reviewed-by: Bin Meng &lt;bmeng.cn@gmail.com&gt;
Tested-by: Bin Meng &lt;bmeng.cn@gmail.com&gt;
Tested-by: Stephen Warren &lt;swarren@nvidia.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Allow displaying the U-Boot banner on a video display</title>
<updated>2017-07-11T16:08:19+00:00</updated>
<author>
<name>Simon Glass</name>
<email>sjg@chromium.org</email>
</author>
<published>2017-06-16T03:37:50+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=b0895384bebb6a4a2ea5bbdb0941b771b5875012'/>
<id>b0895384bebb6a4a2ea5bbdb0941b771b5875012</id>
<content type='text'>
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 &lt;sjg@chromium.org&gt;
Reviewed-by: Bin Meng &lt;bmeng.cn@gmail.com&gt;
Tested-by: Bin Meng &lt;bmeng.cn@gmail.com&gt;
Tested-by: Stephen Warren &lt;swarren@nvidia.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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 &lt;sjg@chromium.org&gt;
Reviewed-by: Bin Meng &lt;bmeng.cn@gmail.com&gt;
Tested-by: Bin Meng &lt;bmeng.cn@gmail.com&gt;
Tested-by: Stephen Warren &lt;swarren@nvidia.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>console: Don't enable CONFIG-CONSOLE_MUX, etc. in SPL</title>
<updated>2017-02-06T03:38:46+00:00</updated>
<author>
<name>Simon Glass</name>
<email>sjg@chromium.org</email>
</author>
<published>2017-01-16T14:03:26+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=b0265429469dde300e3dc2a2c1dce789014c7208'/>
<id>b0265429469dde300e3dc2a2c1dce789014c7208</id>
<content type='text'>
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 &lt;sjg@chromium.org&gt;
Reviewed-by: Bin Meng &lt;bmeng.cn@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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 &lt;sjg@chromium.org&gt;
Reviewed-by: Bin Meng &lt;bmeng.cn@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Convert CONSOLE_PRE_CONSOLE_BUFFER options to Kconfig</title>
<updated>2016-10-23T22:33:19+00:00</updated>
<author>
<name>Simon Glass</name>
<email>sjg@chromium.org</email>
</author>
<published>2016-10-18T02:12:36+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=8f925584145efecd9a6323801689cffd69cf0b09'/>
<id>8f925584145efecd9a6323801689cffd69cf0b09</id>
<content type='text'>
Move these option to Kconfig and tidy up existing uses.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
Reviewed-by: Jagan Teki &lt;jteki@openedev.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Move these option to Kconfig and tidy up existing uses.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
Reviewed-by: Jagan Teki &lt;jteki@openedev.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Convert SILENT_CONSOLE options to Kconfig</title>
<updated>2016-10-23T22:33:18+00:00</updated>
<author>
<name>Simon Glass</name>
<email>sjg@chromium.org</email>
</author>
<published>2016-10-18T02:12:35+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=98af87997670af840ef178f76b4d6888534a6700'/>
<id>98af87997670af840ef178f76b4d6888534a6700</id>
<content type='text'>
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 &lt;sjg@chromium.org&gt;
Reviewed-by: Jagan Teki &lt;jteki@openedev.com&gt;
[trini: Re-migrate, update common/console.c logic]
Signed-off-by: Tom Rini &lt;trini@konsulko.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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 &lt;sjg@chromium.org&gt;
Reviewed-by: Jagan Teki &lt;jteki@openedev.com&gt;
[trini: Re-migrate, update common/console.c logic]
Signed-off-by: Tom Rini &lt;trini@konsulko.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>watchdog: Fix Watchdog Reset while in U-Boot Prompt</title>
<updated>2016-10-18T01:31:01+00:00</updated>
<author>
<name>Andreas J. Reichel</name>
<email>Andreas.Reichel@tngtech.com</email>
</author>
<published>2016-07-13T10:56:51+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=644074671e702e8dc0ef642b353845a40f8053da'/>
<id>644074671e702e8dc0ef642b353845a40f8053da</id>
<content type='text'>
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          =&gt; common/cli.c: cli_loop() =&gt;
   common/cli_hush.c:
                    parse_file_outer   =&gt; parse_stream_outer       =&gt;
                    parse_stream       =&gt; b_getch(i)               =&gt;
                    i-&gt;get(i)          =&gt; file_get                 =&gt;
                    get_user_input     =&gt; cmdedit_read_input       =&gt;
                    uboot_cli_readline =&gt;
   common/cli_readline.c:
                    cli_readline       =&gt; cli_readline_into_buffer =&gt;
                    cread_line         =&gt; getcmd_getch (== getc)   =&gt;
   common/console.c:
                    fgetc              =&gt; console_tstc

   common/console.c:
   (with CONFIG_CONSOLE_MUX is set)

   - in console_tstc line 181:
   If dev-&gt;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 &lt;christian.storm@tngtech.com&gt;
Signed-off-by: Jan Kiszka &lt;jan.kiszka@siemens.com&gt;
Signed-off-by: Andreas J. Reichel &lt;Andreas.Reichel@tngtech.com&gt;
Acked-by: Simon Glass &lt;sjg@chromium.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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          =&gt; common/cli.c: cli_loop() =&gt;
   common/cli_hush.c:
                    parse_file_outer   =&gt; parse_stream_outer       =&gt;
                    parse_stream       =&gt; b_getch(i)               =&gt;
                    i-&gt;get(i)          =&gt; file_get                 =&gt;
                    get_user_input     =&gt; cmdedit_read_input       =&gt;
                    uboot_cli_readline =&gt;
   common/cli_readline.c:
                    cli_readline       =&gt; cli_readline_into_buffer =&gt;
                    cread_line         =&gt; getcmd_getch (== getc)   =&gt;
   common/console.c:
                    fgetc              =&gt; console_tstc

   common/console.c:
   (with CONFIG_CONSOLE_MUX is set)

   - in console_tstc line 181:
   If dev-&gt;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 &lt;christian.storm@tngtech.com&gt;
Signed-off-by: Jan Kiszka &lt;jan.kiszka@siemens.com&gt;
Signed-off-by: Andreas J. Reichel &lt;Andreas.Reichel@tngtech.com&gt;
Acked-by: Simon Glass &lt;sjg@chromium.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
