summaryrefslogtreecommitdiff
path: root/common/console_output.c
Commit message (Collapse)AuthorAgeFilesLines
* tpm: add a console channel for TPM subsystemVadim Bendebury2015-07-251-0/+1
| | | | | | | | | | | | | With conditional compilation in place more channels can be created. BRANCH=none BUG=chrome-os-partner:43025 TEST=none yet Change-Id: Ia5aa5dba054b53adeabf7bd49d1111f65e87e924 Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/287129 Reviewed-by: Bill Richardson <wfrichar@chromium.org>
* console: compile some channels in conditionallyVadim Bendebury2015-07-251-0/+6
| | | | | | | | | | | | | | | | As new features come along the console channel space limited at 32 becomes very tight. But not all features are present all the time. Let's make some of the channels compile time configurable. This makes for uglier code but allows to support more channels. BRANCH=none BUG=none TEST=make buildall -j Change-Id: Id21560d4aa05c0e5245872c50ae19340cda8fd3e Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/286610 Reviewed-by: Bill Richardson <wfrichar@chromium.org>
* cr50: Use distinct configuration option for SPI Slave supportVadim Bendebury2015-07-251-0/+1
| | | | | | | | | | | | | | | | | | | | SPI slave and master interfaces require very different code to support, they should have separate configuration options. Host command code printouts should use their own console channel. Using SPS to designate SPI Slave interface is not universally acceptable, a bug has been opened to discuss the alternatives and clean up the code. BRANCH=none BUG=chromium:512613 TEST=make buildall -j Change-Id: I6683286a221c4689ecc247fdfe8ebca529f3f458 Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/286469 Reviewed-by: Bill Richardson <wfrichar@chromium.org>
* console: remove CC_USBMSGwendal Grignou2015-04-071-1/+0
| | | | | | | | | | | | | | | Mass storage has been removed by https://chromium-review.googlesource.com/238763 We can remove the USBMS entry from console.h BUG=chromium:474394 BRANCH=none TEST=make -j buildall Change-Id: Ic18f205eb49be411988ad47151b6de678d08355e Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/264420 Reviewed-by: Anton Staaf <robotboy@chromium.org>
* ensure all console channels are displaying properlyVincent Palatin2015-04-061-0/+2
| | | | | | | | | | | | | | | | | | If the number of console channels is greater than 32 (the bit size of the channel mask), the overflowing ones are silently masked. Signed-off-by: Vincent Palatin <vpalatin@chromium.org> BRANCH=none BUG=none TEST=add one channel and see the build failing on the assert. Change-Id: I1793b22990be85882d80aae44503bba62358fbd2 Reviewed-on: https://chromium-review.googlesource.com/264062 Reviewed-by: Gwendal Grignou <gwendal@chromium.org> Trybot-Ready: Vincent Palatin <vpalatin@chromium.org> Tested-by: Vincent Palatin <vpalatin@chromium.org> Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
* Samus: Split motion sense and lid angleGwendal Grignou2014-10-291-0/+1
| | | | | | | | | | | | | | | Split motion_sense.c. Translate the accel data in the Android coordinate right away. BUG=chrome-os-partner:32002 BRANCH=ToT TEST=On samus, check lid angle are still correct. Change-Id: If743e25245dc1ce4cdacb8a4d5af22616c4a79e4 Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/225486 Reviewed-by: Sheng-liang Song <ssl@chromium.org> Reviewed-by: Alec Berg <alecaberg@chromium.org>
* Samus: move gesture to commonGwendal Grignou2014-10-291-0/+1
| | | | | | | | | | | | | | | | Move gesture to common directory, 1st step to be reused by other board. Cleanup motion_sense shutdown path. BUG=chrome-os-partner:33102 TEST=Double tap still works on Samus BRANCH=ToT Change-Id: I0a3b38c4a7dbe95c27dcdebff04c1176aaf932d1 Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/225235 Reviewed-by: Sheng-liang Song <ssl@chromium.org> Reviewed-by: Alec Berg <alecaberg@chromium.org>
* usb: add support for mass storage (bulk-only)Dominic Chen2014-08-151-0/+1
| | | | | | | | | | | | | | implement USB mass storage class using the bulk-only transport protocol with the transparent SCSI command set. BRANCH=none BUG=none TEST=verify that usb mass storage functions on windows xp, 7, 8, mac os x, goobuntu precise Change-Id: Ideecad55bd275df7b30aa4a3ed263304a3a109cd Signed-off-by: Dominic Chen <ddchen@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/206303 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* usb: add USB console driverVincent Palatin2014-07-171-6/+25
| | | | | | | | | | | | | | | | | Provide access to the EC console through 2 USB bulk endpoints. (which can be used through the usbserial driver) Signed-off-by: Vincent Palatin <vpalatin@chromium.org> BRANCH=none BUG=none TEST=run on Fruitpie and use the console over USB Change-Id: Ia897764f3a030972ee2ed323f293c5fca899765a Reviewed-on: https://chromium-review.googlesource.com/204167 Reviewed-by: Anton Staaf <robotboy@chromium.org> Commit-Queue: Vic Yang <victoryang@chromium.org> Tested-by: Vic Yang <victoryang@chromium.org>
* samus: add retry mechanism for EC to PD host commandsAlec Berg2014-06-281-0/+1
| | | | | | | | | | | | | | | Add a retry mechanism for EC to PD host commands to make the communication channel more robust. BUG=none BRANCH=none TEST=run on system to verify that we don't drop host commands to PD MCU. Change-Id: Ida6f02a149e4dd9e85a5aac21790928b16864104 Signed-off-by: Alec Berg <alecaberg@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/205148 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* stm32: add USB driverVincent Palatin2014-06-181-0/+1
| | | | | | | | | | | | | | | | | | Enough USB support to be able to enumerate the device and use bulk or interrupt endpoints. Signed-off-by: Vincent Palatin <vpalatin@chromium.org> BRANCH=none BUG=chrome-os-partner:28295 TEST=with the following USB console CL, connect a Fruitpie through USB and use its console over USB. Change-Id: I37b7f3b6a754cb82ab5f940ea20122d2e16b3b5b Reviewed-on: https://chromium-review.googlesource.com/193983 Tested-by: Vincent Palatin <vpalatin@chromium.org> Reviewed-by: Todd Broch <tbroch@chromium.org> Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
* Add cprints() and ccprints()Vic Yang2014-05-211-0/+19
| | | | | | | | | | | | | | | | | | | | | Our code base contains a lot of debug messages in this pattern: CPRINTF("[%T xxx]\n") or ccprintf("[%T xxx]\n") The strings are taking up spaces in the EC binaries, so let's refactor this by adding cprints() and ccprints(). cprints() is just like cprintf(), except that it adds the brackets and the timestamp. ccprints() is equivalent to cprints(CC_CONSOLE, ...) This saves us hundreds of bytes in EC binaries. BUG=chromium:374575 TEST=Build and check flash size BRANCH=None Change-Id: Ifafe8dc1b80e698b28ed42b70518c7917b49ee51 Signed-off-by: Vic Yang <victoryang@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/200490 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* USB Power Delivery core codeVincent Palatin2014-04-121-0/+1
| | | | | | | | | | | | | | | | The protocol layer implementation for USB Power Delivery messaging. Signed-off-by: Vincent Palatin <vpalatin@chromium.org> BRANCH=none BUG=none TEST=none Change-Id: I7db75b004cf9dbf13fa1df95336f206e93236fc9 Reviewed-on: https://chromium-review.googlesource.com/189866 Tested-by: Vincent Palatin <vpalatin@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org> Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
* rambi: glimmer: Disable key scanning in suspend when lid is openAlec Berg2014-03-271-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Added ability to disable the keyboard to wake from suspend when the lid is outside a certain angle range. This has been added to glimmer by defining CONFIG_LID_ANGLE_KEY_SCAN in its board.h. Also modified the lid angle calculation to include a reliability flag which can be used to tell when the hinge aligns too closely with gravity and the lid angle value is unreliable. BUG=none BRANCH=rambi TEST=Tested on a glimmer: In S3, verified that when the lid is open past ~180 deg, the keyboard does not wake the machine. Also verified that if you align hinge with gravity, the keyboard enabled/disabled status remains the same (since we can't actually trust the lid angle value). Change-Id: I45b2c7c3c4bbcae61d3a0f8b5baa461ab8dabfb0 Original-Change-Id: If1a1592d259902d38941936961854b81b3a75b95 Signed-off-by: Alec Berg <alecaberg@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/190061 Reviewed-on: https://chromium-review.googlesource.com/191612 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* accel: clapper: glimmer: Add support for accelerometer interrupt.stabilize-5696.BAlec Berg2014-03-261-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | Adding in support for accelerometer interrupt for use currently in clapper and glimmer. This is disabled by default and can be enabled with CONFIG_ACCEL_INTERRUPTS. BUG=none BRANCH=rambi TEST=Manual test on a glimmer using accelint console command. On console enter: accelint 0 32 When you tap the lid, it should fire the interrupt and print msg to console. accelint 1 32 Tap the base and it will fire another interrupt. Change-Id: Iaab324945e34d527140399ec4f06efd812a62840 Original-Change-Id: I0329112fdcae3c8adc0ca07e74fef7a591d4b9a1 Signed-off-by: Alec Berg <alecaberg@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/190099 Reviewed-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/191549
* rambi: Add motion sense task to track motionAlec Berg2014-02-221-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added motion sense task to Clapper and Glimmer. This task samples the accelerometers and calculate a lid angle. Note that as the machine is rotated towards the hinge angle aligning with gravity, the lid calculation becomes less trustworthy. Added a math_util file to hold various mathematical functions useful for calculating lid angle that may be helpful in other places. For each board with accelerometers we need to define some orientation specific data in board.c. There is a calibration procedure through the EC console that can be enabled by defining CONFIG_ACCEL_CALIBRATE. The calibration procedure can help determine the orientation data required. For debugging purposes there is a console command to regularly print to the EC console the accelerometer data and derived lid angle. The console command can be enabled by defining CONFIG_CMD_LID_ANGLE. BUG=none Original-BUG=chrome-os-partner:24703 BRANCH=rambi TEST=Ran the calibration procedure on a Glimmer unit, and then rotated the machine in space. Verified that the lid angle calculated roughly matched actual lid angle. Original-Change-Id: I63a5e384b7f6b628b4ea01de49843355fb8d6ebe Signed-off-by: Alec Berg <alecaberg@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/184783 Reviewed-by: Randall Spangler <rspangler@chromium.org> Signed-off-by: Alec Berg <alecaberg@chromium.org> (cherry picked from commit efb07945a5159fa0e7a746c666b2519ebdca9c22) Conflicts: board/clapper/board.c board/clapper/ec.tasklist board/glimmer/board.c board/glimmer/ec.tasklist Change-Id: Ibc492ef5c11e7084e87f01338c4d7775f9a08c18 Signed-off-by: Alec Berg <alecaberg@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/187433 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* cleanup: Comments in console_output.cRandall Spangler2013-10-251-4/+14
| | | | | | | | | | | | | | No code changes, just tidying some comments and moving a TODO to a bug. BUG=chrome-os-partner:23557 BRANCH=none TEST=compile any project; hey, this is just a change in comments. Change-Id: Ib1e3190ac9abdc90fb04c785e1f20b9cc66b1bc3 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/174447 Reviewed-by: Alec Berg <alecaberg@chromium.org> Reviewed-by: Bill Richardson <wfrichar@chromium.org>
* lm4: Add a low power idle task.stabilize-4825.BAlec Berg2013-10-151-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | First implementation of a low power idle task for the LM4 chip. The low power mode is selected by defining CONFIG_LOW_POWER_IDLE in a board.h file. This commit turns it on for Peppy, Slippy, and Falco only because those are the only boards tested. When using the low power idle task, the chip goes in to deep sleep when it can. Deep sleep disables clocks to most peripherals and puts the onboard flash and RAM into a low power mode. The chip is woken out of deep sleep using the RTC in the hibernate module. Increased the idle task stack size to handle more involved idle task. In board.c, the array of GPIO info can be used to select which GPIO points can wake up the EC from deep sleep. Currenlty selected are the power button, lid open, AC present, PCH_SLP_S3, and PCH_SLP_S5. Additionally the port with the KB scan row GPIO point is also enabled to wake up the EC from deep sleep. Signed-off-by: Alec Berg <alecaberg@chromium.org> BUG=None BRANCH=none TEST=Passes all unit tests. Runs on slippy, peppy, and falco with no noticeable side affects. Verified that the power consumed by the EC is lower when in S3, S5 and G3 by scoping the sense resistor powering the chip. Change-Id: I83fa9a159a4b79201b99f2c32678dc4fc8921726 Reviewed-on: https://chromium-review.googlesource.com/172183 Reviewed-by: Vincent Palatin <vpalatin@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org> Commit-Queue: Alec Berg <alecaberg@chromium.org> Tested-by: Alec Berg <alecaberg@chromium.org>
* Fix console channel name listVic Yang2013-09-181-1/+3
| | | | | | | | | | | | | | | This adds back missing "hook" channel name. Also add a build assertion to make sure we don't miss this again. BUG=chrome-os-partner:21801 TEST=Build all boards. Remove "hook" channel and check build fails. BRANCH=None Change-Id: I373016504fd3753e1a791077d49b3af14b2b1aa4 Signed-off-by: Vic Yang <victoryang@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/169703 Reviewed-by: Vincent Palatin <vpalatin@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org>
* console_output: Add commands for saving / restoring print mask.Shawn Nematbakhsh2013-08-081-13/+24
| | | | | | | | | | | | | | | | | | | | | | | Saving + restoring the channel print mask previously involved running the 'chan' command with no parameters, then parsing the output. This parsing is unreliable if other tasks are also writing to the console. Add commands to save / backup the current channel mask, and later restoring it. Typical method to limit channel mask will now be: chan save chan <mask> ... chan restore BUG=chromium:269758. TEST=Run 'chan save' / 'chan 0' / 'chan restore' on EC console, verify print mask is restored. BRANCH=Peppy/Falco. Change-Id: I725c7fb5e3ac7e55ed5f435446f8fc5c54af165f Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/65208 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* Move files in preparation for merging keyboard_scan modulesRandall Spangler2013-03-271-1/+0
| | | | | | | | | | | | | | | | | | This is part one of a series to merge the keyboard scan interface to be common across all platforms. This change just moves and renames files and APIs and removes some read code, and sets up protocol-specific CONFIG options. It makes the next CL which actually merges keyboard scanning easier to parse. BUG=chrome-os-partner:18360 BRANCH=none TEST=compile all boards; test keyboard on spring and link Change-Id: I815a40aae4e5d5f333b8501aff9656080533d913 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/46549 Reviewed-by: Bill Richardson <wfrichar@chromium.org>
* Rename power_button module to switchRandall Spangler2012-10-301-1/+1
| | | | | | | | | | | | | | | Since it handles not just power button, but also lid switch, AC detect, and other switches. No functional changes; just renaming. BUG=chrome-os-partner:15579 BRANCH=none TEST=boot system, power on/off with power button Change-Id: I51628a52293f7207715f5f6bf368a08fe6c3dbce Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/36821
* Clean up console moduleRandall Spangler2012-10-241-3/+1
| | | | | | | | | | | | Code cleanup and reformatting. No functional changes. BUG=chrome-os-partner:15579 BRANCH=none TEST=compile code; type a debug command like 'help list'. Change-Id: I641215ba3333628f658eec86d9d99718c43b111f Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/36387
* Add console channel for thermal outputRandall Spangler2012-10-101-0/+1
| | | | | | | | | | | | | Needed for debugging upcoming TMP006 calibration changes BUG=none TEST=boot; EC console output should appear as before BRANCH=link Change-Id: I93a18949888533ecefd226fdc64e1fab7d52a8f1 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/35187 Reviewed-by: Bill Richardson <wfrichar@chromium.org>
* Simplify host event processingRandall Spangler2012-07-121-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | Now both copies of the event state live in host_event_commands.c, and lpc / memmap just shadows the main copy. BUG=chrome-os-partner:11172 TEST=manual Boot system. should see events 0x2000, 0x80, 0x08 get set and then cleared. At U-boot prompt, type on keyboard. Should set event 0x1000 get set, but only on the first keypress (because U-boot doesn't consume that event). Then from EC console, hostevent clear 0x1000 -> see event 0x1000 clear hostevent clear 0x1000 -> no debug output (it's already clear) hostevent clearb 0x1000 -> see event copy B 0x1000 clear hostevent clearb 0x1000 -> no debug output (copy B is already clear) Change-Id: I855c035865649ba1490cd9027157d5bcdcc9895f Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/27321
* Split console output into its own moduleRandall Spangler2012-06-131-0/+114
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>