summaryrefslogtreecommitdiff
path: root/common/console.c
Commit message (Collapse)AuthorAgeFilesLines
* Split console output into its own moduleRandall Spangler2012-06-131-107/+0
| | | | | | | | | | | | | | No code changes, just rearranging source in preparation for an experiment to see how much the binary shrinks if we disable the interactive console. BUG=none TEST=none Change-Id: Ie21f1b3dcd04272e80fd40b2ed54d1eaf7fb1cdf Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/25232 Reviewed-by: Bill Richardson <wfrichar@chromium.org>
* Add basic SPI support to linkRandall Spangler2012-05-301-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds SPI transaction support, and a debug command to read a few values from the SPI EEPROM. Note that the SPI controller is normally *disabled* with all its I/Os high-Z, so this will not interfere with main processor or Servo on the SPI bus. The bus is only enabled during the SPIROM command itself. BUG=chrome-os-partner:7844 TEST=manual 1) Reboot system 2) on EC console, 'spirom'. Should print Man/Dev ID : 0xef 0x16 JEDEC ID : 0xef 0x40 0x17 Unique ID : 0xd1 0x61 0x44 0xb0 0x63 0x5d 0x40 0x32 Status reg 1: 0x00 Status reg 2: 0x00 Note that unique ID is, well, unique, so it won't match my value. But it should still be something not all 0xff's. 3) Power on the system. x86 should still boot normally, indicating that the EC isn't interfering with the SPI bus. Change-Id: I53bf5fdbbe7a37949375d0463e30e408cc6fb6a8
* Better help for console commandsRandall Spangler2012-05-251-24/+74
| | | | | | | | | | | | | | | | | | | | Additional help messages and usage are gated by CONFIG_CONSOLE_CMDHELP, so we can turn it on if there's space (adds about 3KB to image size) and turn it off when there isn't. Signed-off-by: Randall Spangler <rspangler@chromium.org> BUG=none TEST=manual 1) help 2) help list 3) help gpioset 4) gpioset -> wrong number of params 5) gpioset fred 0 -> param1 bad 6) gpioset cpu_prochot fred -> param2 bad Change-Id: Ibe99f37212020f763ebe65a068e6aa83a809a370
* More debug command cleanup to save spaceRandall Spangler2012-05-211-1/+3
| | | | | | | | | | (saves another 1.5KB) BUG=none TEST=(run the commands) Change-Id: Id3ca58528fa68a4cec606edf2b98b9af38ac228f Signed-off-by: Randall Spangler <rspangler@chromium.org>
* Clean up debug commands to use less spaceRandall Spangler2012-05-211-23/+15
| | | | | | | | BUG=none TEST=(run the commands) Change-Id: I6ed4aee169311825190bcc386b86cdc32ba0866a Signed-off-by: Randall Spangler <rspangler@chromium.org>
* Sort console commands at build timeVincent Palatin2012-05-151-21/+4
| | | | | | | | | | | | Use the linker to sort console commands by name, this saves execution time and memory. BUG=none TEST=generate several images with 5N, 5N+1, 5N-1 commands and check the output of the "help" command. Change-Id: Ib5d8f3bca726621c68ab152f4fa662cee355abb1 Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
* Arrange help output to sort 'column first'Vadim Bendebury2012-05-141-25/+31
| | | | | | | | | | | | | | | Sort the command name index, and then print them in file columns (as before), but ordering columns first. This makes it much easier to examine the 'help' command output. BUG=none TEST=manual . program the new image . execute the 'help' command . observe output printed sorted 'columns first' Change-Id: I7b15cef09a61fe20eb4ba5ee274ba1d72063f1c0 Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
* Allow console commands abbreviationVadim Bendebury2012-05-141-7/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The EC console input handling code is being enhanced to accept abbreviated command names. If the abbreviation is unique, the appropriate command is used, if the abbreviation is ambiguous, the command is handled as nonexistent. The error message is being modified to mention that the command either does not exist or is ambiguous. This change also makes it impossible to have command names matching the beginning of other command names. Two such cases are being fixed (`ch' renamed to `chan' and `thermal' renamed to 'thermalconf'). BUG=none TEST=manual . program the new EC image. Try entering at the console: > h Command 'h' either not found or ambiguous. Command returned error 1 > he Known commands: adc autofan battery ch charger ... > help Known commands: adc autofan battery ch charger ... Change-Id: Iaa3e91e1504e42daefb02d561e00c39003548197 Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
* Allow boards to set the default console maskSimon Glass2012-05-101-6/+9
| | | | | | | | | | | | | | Some boards don't like to have every keyboard scan printed, but some devs find this info comforting. Add a way for boards to select the require console mask. BUG=none TEST=manual: build and boot on daisy, see that key scan messages are suppressed. build on all platforms Change-Id: I8e6e640eaabc0a08e5427cd97f7089dda1238025 Signed-off-by: Simon Glass <sjg@chromium.org>
* Fix truncated output from 'ch' commandRandall Spangler2012-05-101-0/+1
| | | | | | | | | Signed-off-by: Randall Spangler <rspangler@chromium.org> BUG=none TEST='ch' - prints all the channels now Change-Id: I38ebc3eed2476c44c26fc00d6ea79800ae427722
* Issue warning on fan stall.Vic Yang2012-04-261-0/+1
| | | | | | | | | | | | When PWM module detects fan stall, issue SMI warning and print warning message to console. Signed-off-by: Vic Yang <victoryang@google.com> BUG=chrome-os-partner:7497 TEST=Disconnect fan and power up. See warning message. Change-Id: I4d96595f7f3cdfab5df333afc35206304bacab9d
* Use console output instead of uart output for console commandsRandall Spangler2012-04-241-6/+10
| | | | | | | | | | | | This completes console output cleanup. The remaining calls to uart_puts() and uart_printf() actually need to be that way. Signed-off-by: Randall Spangler <rspangler@chromium.org> BUG=chrome-os-partner:7464 TEST=manual Change-Id: Ib1d6d370d30429017b3d11994894fece75fab6ea
* Refactor async console outputRandall Spangler2012-04-241-21/+124
| | | | | | | | | | | | | | | | | | 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
* Move externs from .lds file into a header fileRandall Spangler2012-04-191-3/+1
| | | | | | | | | | | Fewer magic externs = good. Signed-off-by: Randall Spangler <rspangler@chromium.org> BUG=none TEST=if it boots, it works Change-Id: Ifadeb1701400c5492c40d2eaf8f68f2d70189648
* Change task messages to eventsRandall Spangler2012-04-061-2/+2
| | | | | | | | | | | | | Signed-off-by: Randall Spangler <rspangler@chromium.org> BUG=chrome-os-partner:7461 TEST=manual make BOARD={bds,link,daisy} make tests flash link system and make sure it boots Change-Id: I1241a1895c083e387e38ddab01ac346ca4474eb9
* Handle up/down arrow keys for UART console.Vic Yang2012-02-071-9/+1
| | | | | | | | | | | | | | | | | | | | | | 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
* Remove useless header includesVincent Palatin2012-01-261-1/+0
| | | | | | | | | | | | | | Preparatory work to introduce a second SoC : 2nd series 2/4 Avoid introducing platform specific dependencies in common files where they are not necessary. Signed-off-by: Vincent Palatin <vpalatin@chromium.org> BUG=None TEST=build for BDS and Link Change-Id: If2ccd022e4956425222b55a5a48ca7522857e7f0
* Help command prints a sorted multi-column list of commandsRandall Spangler2012-01-241-8/+25
| | | | | | | | | Signed-off-by: Randall Spangler <rspangler@chromium.org> BUG=none TEST=type 'help' from console Change-Id: If88610f35337243ca2550de2851bd1924083344d
* register console commands at compile-timeVincent Palatin2012-01-241-38/+12
| | | | | | | | | | | | | | | Instead of using a runtime callback to register the console commands, put them in a special linker section. So we can do a macro to "register" them during the build. It saves 684 bytes and a few microseconds at startup. Signed-off-by: Vincent Palatin <vpalatin@chromium.org> BUG=None TEST=run a few commands from the BDS command line. Change-Id: Id33ea210b9035bf76ed720373c74c5dd24ccd1b1
* Initial sources import 1/3Randall Spangler2011-12-071-0/+207
source files mainly done by Randall. Signed-off-by: Randall Spangler <rspangler@chromium.org> Change-Id: Iaff83a842b17f3350fb6f2a3f1597ad4c29bd12a