Commit Graph

15 Commits

Author SHA1 Message Date
Randall Spangler
d5ade1b2ed Clean up UART module
And change some direct uart_printf()/uart_puts() output to console
output methods instead.  Disable unused comxtest debug command.  No
other functional changes.

BUG=chrome-os-partner:15579
BRANCH=none
TEST=boot system; should still see debug output with reset flags

Change-Id: I57fe6bb781a1ba7884afa6d090b74a92f45a53cc
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/36835
2012-10-30 12:42:43 -07:00
Randall Spangler
fc6b412589 Consolidate emergency debug output
This removes the duplicate uart_emergency_printf() vs. panic_printf()
/ uart_emergency_puts() vs. panic_puts() implementation and saves
~0.5kb of code size.

The other significant change is that uart_flush_output() is now smart
enough to determine if it's in an interrupt; if so, it will spin-flush
the output buffer instead of waiting on the uart interrupt.  This
removes the need for a separate panic_flush().

BUG=chrome-os-partner:15579
BRANCH=none
TEST=crash unaligned; should print well-formatted crash dump

Change-Id: Ifae756203dd1881806be563308077c1d68302e1f
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/36695
2012-10-29 10:36:05 -07:00
Randall Spangler
cf7f33d158 Clean up uart buffering code
No functional changes.

BUG=chrome-os-partner:15579
BRANCH=none
TEST=help version -> prints help on version command

Change-Id: I79c4b668513b6037aa6cf3fa1a2a8c0fc9856f41
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/36612
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
2012-10-26 09:49:38 -07:00
Randall Spangler
c7f2e0246e Move printf() formatting to its own file to enable re-use
Also add snprintf(), and %X format code.

BUG=chrome-os-partner:10206
TEST=timerinfo; should print correctly.  'ectool battery' on host side should print same serial as 'battery' on EC console.

Change-Id: I5c9f69d1a20ee5d0a59440c122655adbf62c9aea
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/24635
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Rong Chang <rongchang@chromium.org>
2012-06-07 00:54:02 -07:00
Randall Spangler
9b44097d23 Add support for printing fixed-point numbers
This makes timestamps much easier to read.

Signed-off-by: Randall Spangler <rspangler@chromium.org>

BUG=chrome-os-partner:9866
TEST=timerinfo, taskinfo, battery commands have fixed-point numbers,
and timestamps printed in the log look right.

Change-Id: If91c83f725984c8e04bfb7cdcff316d9c3bfe24c
2012-05-22 10:37:56 -07:00
Randall Spangler
135f14bf49 Refactor async console output
This adds a 'ch' command which prints/sets which channels are active

This handles all the async output; the remaining debug commands will
be refactored to use ccprintf() / ccputs() in a followup CL.

Signed-off-by: Randall Spangler <rspangler@chromium.org>

BUG=chrome-os-partner:7464
TEST=manual

ch --> all channels active
ch 0x100 -> just port80 active
powerbtn -> system boots; only port 80 codes shown on console

Change-Id: I9efc43acec919b62b78c2c82c61946d32380adfe
2012-04-24 17:46:54 -07:00
Randall Spangler
9f552ff5aa Implement 64-bit integer printing in uart_printf()
Signed-off-by: Randall Spangler <rspangler@chromium.org>

BUG=chrome-os-partner:7490
TEST=timerinfo; numbers should look reasonable

Change-Id: I698be99c87bf311013427ac0ed9e93e5687f40c0
2012-04-20 14:01:11 -07:00
Randall Spangler
95462ad4fe Add %T format code to print current timestamp.
Signed-off-by: Randall Spangler <rspangler@chromium.org>

BUG=chrome-os-partner:8724
TEST=if timestamps show up in the debug output, it works

Change-Id: I5264a3a40a07a824cc15b39a7bd81f2db02a3c13
2012-04-03 11:35:47 -07:00
Randall Spangler
b2ac77b37b Support warm reboot from one EC image to another.
This is necessary at init-time for verified boot to jump from RO to
one of the RW images.

It's also used by factory EC update to update one image and then jump
to the updated image to finish the update.  In this case, the x86 does
NOT reboot.

Signed-off-by: Randall Spangler <rspangler@chromium.org>

BUG=chrome-os-partner:8449
TEST=manual

1) power on x86 and log in
2) sysjump a  --> system is in a; x86 has not rebooted
3) sysjump ro --> system is back in RO; x86 has not rebooted
4) reboot -> system is in RO; x86 HAS rebooted

Change-Id: I9dbadcf9775e146a0718abfd4ee0758b65350a87
2012-03-19 15:41:14 -07:00
Bill Richardson
737fbbd032 Delay enabling UART1 until after LPC bus is enabled.
BUG=none
TEST=manual

Try it on a bds with no LPC bus. It gets a BusFault without this patch.

Change-Id: If3f38df5f7bebaf4c7045a9f48fbe3ac66e8bdbf
2012-02-17 15:55:32 -08:00
Vic Yang
730f099c83 Handle up/down arrow keys for UART console.
Record commands used previously and use up/down arrow key to navigate in
the command history.
Also removed the command '.' of repeating last command as we can use up
arrow key now.

Also changed the behaviour of uart_write_char() to be blocking on
transmit FIFO full, so that we do not lose echoed character and do not
need to flush.

BUG=chrome-os-partner:7815
TEST=Type 'help' and enter. Then type 'aaaa' and up arrow key, should
show 'help', and pressing enter prints help.
Type 'hellp' and enter. Then type 'aaaaaa' and up arrow key, should show
'hellp'. Should be able to use left/right arrow key and backspace to
correct it to 'help', and pressing enter prints help.
Type 'help' and enter. Then type 'aaa', up arrow key, and down arrow
key. Should show 'aaa'.

Change-Id: I65c615d61bf63acb31bea329aa91a3202d4db0ad
2012-02-07 10:23:59 +08:00
Randall Spangler
300e7edb87 Add UART1 receive support (UART to x86 console)
Signed-off-by: Randall Spangler <rspangler@chromium.org>

BUG=chrome-os-partner:7488
TEST=type things into the x86 console UART; should appear on the u-boot prompt

Change-Id: I75fd225842c03d11d79280fb7453ad37695279e3
2012-02-06 14:53:49 -08:00
Vincent Palatin
53eaf213d5 Split UART code
Preparatory work to introduce a second SoC : 3rd series 1/2

Most of the code is handling the buffering and the printf, thus put it
in an hardware independant location and only implement the UART
dependant portions in the chip driver.

Signed-off-by: Vincent Palatin <vpalatin@chromium.org>

BUG=None
TEST=run on BDS and stress the console.

Change-Id: I9376f2fa1dad341eac808e1756dbeff32900bd51
2012-01-26 22:07:00 +00:00
Randall Spangler
70c3e30b63 Clean up UART code
LPC module no longer directly talks to UART registers, and vice-versa.

Signed-off-by: Randall Spangler <rspangler@chromium.org>

BUG=none
TEST='ectool sertest' on target system

Change-Id: Id070c0d849bdfe91c752e0af651d357b695d2648
(cherry picked from commit ab8c3c2b8e3b08a4bf5573cda3a12dd3a384e67d)
2011-12-12 14:12:09 -08:00
Randall Spangler
bdf7da5b08 Initial sources import 1/3
source files mainly done by Randall.

Signed-off-by: Randall Spangler <rspangler@chromium.org>

Change-Id: Iaff83a842b17f3350fb6f2a3f1597ad4c29bd12a
2011-12-07 19:10:02 +00:00