summaryrefslogtreecommitdiff
path: root/common/port80.c
Commit message (Collapse)AuthorAgeFilesLines
* Update license boilerplate text in source code filesMike Frysinger2022-09-121-1/+1
| | | | | | | | | | | | | | | Normally we don't do this, but enough changes have accumulated that we're doing a tree-wide one-off update of the name & style. BRANCH=none BUG=chromium:1098010 TEST=`repo upload` works Change-Id: Icd3a1723c20595356af83d190b2c6a9078b3013b Signed-off-by: Mike Frysinger <vapier@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3891203 Reviewed-by: Jeremy Bettis <jbettis@chromium.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* tree-wide: const-ify argv for console commandsCaveh Jalali2022-09-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | This updates the API for console commands from "int cmd(int argc, char **argv)" to "int cmd(int argc, const char **argv)" which is more accurate and in line with common convention. BRANCH=none BUG=b:244387210 TEST="make buildall" passes TEST="zmake build -a" passes TEST="util/compare_build.sh -b all" passes TEST="./twister -v -T zephyr/test" passes Cq-Depend: chrome-internal:4960125 Cq-Depend: chrome-internal:4959932 Change-Id: I57de9f35b85b8f3c7119df36aefb2abf25d2625f Signed-off-by: Caveh Jalali <caveh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3863941 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Tom Hughes <tomhughes@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org>
* port80: Add a config to avoid logging port80 codesAndrew McRae2022-08-251-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | Add a config item to disable logging all of the port80 history buffer as each code is received. Individual codes can still be logged as they are received when enabled via the console command 'port80 intprint' or using the CONFIG_PORT80_PRINT_IN_INT config item. This reduces the overhead at AP startup on the logging. It has been observed on the ITE81302 that logging the port80 codes causes significant overhead that may lead to watchdog timeouts. The port80 code history is still available via the 'port80' EC console command. BUG=b:243607643 TEST=zmake build nereid; flash & run BRANCH=none Signed-off-by: Andrew McRae <amcrae@google.com> Change-Id: I543b0391bcf474c9d040baa98ff75f6e2b9fd5a9 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3853308 Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com> Reviewed-by: Peter Marheine <pmarheine@chromium.org>
* tree: Replace %pT with snprintf_timestampTom Hughes2022-07-151-3/+8
| | | | | | | | | | | | | | | | | Using standard format specifiers makes it easier to switch between the "builtin" EC standard library and the C standard library provided by the toolchain (or Zephyr). BRANCH=none BUG=b:238433667, b:234181908 TEST=On icetower v0.1 with servo_micro and J-Trace attached: > reboot observe console shows timestamps Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: I6660ff22ebc6ba74f1245ff83026f5919b356a02 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3756178 Reviewed-by: Ting Shen <phoenixshen@chromium.org>
* common/port80.c: Format with clang-formatJack Rosenthal2022-06-281-14/+13
| | | | | | | | | | | BUG=b:236386294 BRANCH=none TEST=none Change-Id: I5f7228e81f3e97f61d5ed59d7abdee482e48c3e1 Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3729700 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* tree: Remove .bss.slowTom Hughes2021-10-191-3/+3
| | | | | | | | | | | | | | | | | | The config option to enable .bss.slow was removed in commit b224441aaaa5dd08274811d65bb795b4abc231d8 because the option was only used with kunimitsu, which was removed from the EC codebase a long time ago. Remove the reference in the linker maps to complete the cleanup. BRANCH=none BUG=b:172020503, b:172221339 TEST=make buildall Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: Ibc519f9974cb26e6d15180e2ce0c359867ced1ac Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3219263 Reviewed-by: Ting Shen <phoenixshen@chromium.org>
* tree: Make all host commands staticTom Hughes2021-10-151-1/+1
| | | | | | | | | | | | | | Almost all of the host commands were already static. This change makes all of them static for consistency. BRANCH=none BUG=b:172020503 TEST=make buildall -j Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: I8330e85e6d64a039f08d7620eed1fe897f436567 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3221786 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* Port80: handle 4-byte Port80 codes properlyJun Lin2021-05-171-9/+8
| | | | | | | | | | | | | | | | | | | | | | | In this CL, there are the following changes: 1. call hook_call_deferred to dump Port80 codes in any case. 2. inhibit Port80 code which is greater than 0x100 from being sent to host (i.e. written to last_boot variable) BRANCH=none BUG=b:184872297 TEST=build the image with "#define CONFIG_PORT80_4_BYTE"; connect npcx9_evb to the eSPI host emulator; the host sends a PUT_IOWR_SHORT transaction to IO address 0x80 with 4 bytes of code "0xEEE20400"; the EC console shows: Port 80 writes: eee20400 <--new Signed-off-by: Jun Lin <CHLin56@nuvoton.com> Change-Id: I4bcc75cc74c2ad75a51bb25af5d1a13e8b36dca6 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2894324 Reviewed-by: Furquan Shaikh <furquan@chromium.org> Commit-Queue: CH Lin <chlin56@nuvoton.com> Tested-by: CH Lin <chlin56@nuvoton.com>
* Port80: allow to accept 4-byte Port80 codeJun Lin2021-05-041-5/+10
| | | | | | | | | | | | | | | | | | | | | | | | The original Port80 implementation assumes that the Port80 code is only 2-byte wide and is less than 0x100. In the recent AMD chipset (CEZANNE), AP will send a 4-byte Port80 code via a single PUT_IOWR_SHORT eSPI transaction in PSP. This CL adds a config option to allow the Port80 to print 4-byte code when the config is defined. BRANCH=none BUG=b:184872297 TEST=build the image with "#define CONFIG_PORT80_4_BYTE"; connect npcx9_evb to the eSPI host emulator; the host sends a PUT_IOWR_SHORT transaction to IO address 0x80 with 4 bytes of code "0xEEE20400"; the EC console shows: Port 80 writes: eee20400 <--new Signed-off-by: Jun Lin <CHLin56@nuvoton.com> Change-Id: I3b93d9fc41e1875bb628a15c58231005e9555cfd Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2858296 Tested-by: CH Lin <chlin56@nuvoton.com> Reviewed-by: Raul E Rangel <rrangel@chromium.org> Commit-Queue: CH Lin <chlin56@nuvoton.com>
* printf: Convert %T to %pTEvan Green2019-10-051-1/+2
| | | | | | | | | | | | | | | | | | | | | | In order to be more compliant to standards, and ultimately turn on compile-time printf format validation, switch the non-standard %T into %pT, which takes a pointer to a 64-bit timestamp as an argument. For convenience, define PRINTF_TIMESTAMP_NOW, which will use the current time as the timestamp value, rather than forcing everyone to pass a pointer to get_time().val. For a couple of instances, simply use CPRINTS instead. BUG=chromium:984041 TEST=make -j buildall BRANCH=None Cq-Depend:chrome-internal:1473305 Change-Id: I83e45b55a95ea27256dc147544ae3f7e39acc5dd Signed-off-by: Evan Green <evgreen@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1704216 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* host_command: Change host command return value to enum ec_statusTom Hughes2019-10-021-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the host command handler callback function returns an int, it's easy to accidentally mix up the enum ec_error_list and enum ec_status types. The host commands always expect an enum ec_status type, so we change the return value to be of that explicit type. Compilation will then fail if you accidentally try to return an enum ec_error_list value. Ran the following commands and then manually fixed up a few remaining instances that were not caught: git grep --name-only 'static int .*(struct host_cmd_handler_args \*args)' |\ xargs sed -i 's#static int \(.*\)(struct host_cmd_handler_args \*args)#\ static enum ec_status \1(struct host_cmd_handler_args \*args)##' git grep --name-only 'int .*(struct host_cmd_handler_args \*args)' |\ xargs sed -i 's#int \(.*\)(struct host_cmd_handler_args \*args)#\ enum ec_status \1(struct host_cmd_handler_args \*args)##' BRANCH=none BUG=chromium:1004831 TEST=make buildall -j Cq-Depend: chrome-internal:1872675 Change-Id: Id93df9387ac53d016a1594dba86c6642babbfd1e Signed-off-by: Tom Hughes <tomhughes@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1816865 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* LICENSE: remove unnecessary (c) after CopyrightTom Hughes2019-06-191-1/+1
| | | | | | | | | | | | | | | | Ran the following command: git grep -l 'Copyright (c)' | \ xargs sed -i 's/Copyright (c)/Copyright/g' BRANCH=none BUG=none TEST=make buildall -j Change-Id: I6cc4a0f7e8b30d5b5f97d53c031c299f3e164ca7 Signed-off-by: Tom Hughes <tomhughes@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1663262 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* 7-seg display: Add config to display port80 msg and power statesAyushee2019-05-031-0/+7
| | | | | | | | | | | | | | | | | Adding this CL to display port80 message and power states of EC & SOC on the 7-segment display. BRANCH=None BUG=b:130738086 TEST=Manually tested on intelrvp, able to verify the power states and port80 message displayed on the 7 segment display Change-Id: I4437cfcd60662c8637e406e425f98fad1a4ba7ed Signed-off-by: Ayushee <ayushee.shah@intel.com> Reviewed-on: https://chromium-review.googlesource.com/1575433 Commit-Ready: Daisuke Nojiri <dnojiri@chromium.org> Tested-by: Ayushee Shah <ayushee.shah@intel.com> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* port80: Clean up macrosFurquan Shaikh2017-10-311-4/+1
| | | | | | | | | | | | | | | | | 1. Add a new config option to define history buffer length. This allows boards to override this option if required. 2. Get rid of unused PORT80_POLL_PERIOD macro BUG=None BRANCH=None TEST=Verified that all port80 messages from a boot-up or S3 resume are present in port80 history buffer. Change-Id: Ie64680459f58358713a1b1445a0b99fcfe1c1cdc Signed-off-by: Furquan Shaikh <furquan@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/745902 Reviewed-by: Aaron Durbin <adurbin@chromium.org>
* port80: Provide default routine for logging port80 resumeFurquan Shaikh2017-10-311-0/+7
| | | | | | | | | | | | | | Add a common hook handler on CHIPSET_RESUME to log port80 resume message instead of duplicating the same code in all chip lpc_resume. BUG=b:68669668 BRANCH=None TEST=Verified that port80 resume is logged on S0ix and S3 resume. Change-Id: I313692f5499717d0d8f62be2ba3b8566c46e4dde Signed-off-by: Furquan Shaikh <furquan@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/745362 Reviewed-by: Aaron Durbin <adurbin@chromium.org>
* port80: Disable default print of port80 messages in interrupt contextFurquan Shaikh2017-09-121-30/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. Add a new config option CONFIG_PORT80_PRINT_IN_INT which is disabled by default to disable printing of port80 messages in interrupt context. 2. If CONFIG_BRINGUP is defined, redefine CONFIG_PORT80_PRINT_IN_INT to enable printing of port80 messages in interrupt context for boards that are in bringup phase. 3. If print_in_int is disabled, add a deferred call to dump port80 buffer to EC console 4 seconds after the last port80 message is received. BUG=b:64196191 BRANCH=None TEST=Verified following: 1. make -j buildall 2. Port80 messages are not printed by default on Soraka 3. Port80 buffer is dumped 4 seconds after last port80 message, if BIOS is stuck for 4 seconds, in recovery mode and when reboot from AP console. 4. Boot time on soraka went down from ~1.59seconds to ~1.45 seconds in EC reboot case (savings of ~140ms). Change-Id: I9aee0987765f905b4ac49d04ffc54d71ee3a04f9 Signed-off-by: Furquan Shaikh <furquan@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/661880 Reviewed-by: Aaron Durbin <adurbin@chromium.org>
* cleanup: DECLARE_CONSOLE_COMMAND only needs 4 argsBill Richardson2016-08-241-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Since pretty much always, we've declared console commands to take a "longhelp" argument with detailed explanations of what the command does. But since almost as long, we've never actually used that argument for anything - we just silently throw it away in the macro. There's only one command (usbchargemode) that even thinks it defines that argument. We're never going to use this, let's just get rid of it. BUG=none BRANCH=none CQ-DEPEND=CL:*279060 CQ-DEPEND=CL:*279158 CQ-DEPEND=CL:*279037 TEST=make buildall; tested on Cr50 hardware Everything builds. Since we never used this arg anyway, there had better not be any difference in the result. Change-Id: Id3f71a53d02e3dc625cfcc12aa71ecb50e35eb9f Signed-off-by: Bill Richardson <wfrichar@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/374163 Reviewed-by: Myles Watson <mylesgw@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org>
* common: port80: Add items to .bss.slow.Aseda Aboagye2015-11-111-3/+3
| | | | | | | | | | | | | | | | | | | | | BUG=chrome-os-partner:46056 BUG=chrome-os-partner:46063 BRANCH=None TEST=Enable CONFIG_REPLACE_LOADER_WITH_BSS_SLOW on GLaDOS. Build, flash, and verify AP and EC boot. Suspend/Resume and verify that port80 data is in the history. TEST='sysjump rw' suspend/resume nad verify that new port80 writes are present in the history. TEST=make -j buildall tests. CQ-DEPEND=CL:311209 Change-Id: Idebb3247b55465f1fbf35a33dff2f00968b8f4ce Signed-off-by: Aseda Aboagye <aaboagye@google.com> Reviewed-on: https://chromium-review.googlesource.com/311365 Commit-Ready: Aseda Aboagye <aaboagye@chromium.org> Tested-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org>
* port80: Remove HAS_TASK_PORT80.Aseda Aboagye2015-10-191-58/+0
| | | | | | | | | | | | | | | | | | | | | | The only boards that had a port 80 task were the ones using the MEC1322. Since that EC now has a dedicated timer interrupt configured for port80 writes, we can remove this code that was providing the port 80 task. Additionally, the config option CONFIG_PORT80_TASK_EN is removed. BUG=chrome-os-partner:46062 BRANCH=None TEST=make -j buildall tests CQ-DEPEND=CL:305591 Change-Id: I145d989b8872240e749ef77aabe0ae76fc94d443 Signed-off-by: Aseda Aboagye <aaboagye@google.com> Reviewed-on: https://chromium-review.googlesource.com/305791 Commit-Ready: Aseda Aboagye <aaboagye@chromium.org> Tested-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Kevin K Wong <kevin.k.wong@intel.com> Reviewed-by: Shawn N <shawnn@chromium.org>
* port80: Reduce history buffer to 256 bytes.Aseda Aboagye2015-10-131-1/+1
| | | | | | | | | | | | | | | | | | This saves us 256 bytes in RAM. BUG=chrome-os-partner:46059 BUG=chrome-os-partner:46063 BRANCH=None TEST=make -j buildall tests TEST=Flash on GLaDOS, plug in charger and verify AP and EC boot. Change-Id: Ic8d79aeeb6e134ba1424d0b6b3062f4527b68673 Signed-off-by: Aseda Aboagye <aaboagye@google.com> Reviewed-on: https://chromium-review.googlesource.com/305360 Commit-Ready: Aseda Aboagye <aaboagye@chromium.org> Tested-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Alec Berg <alecaberg@chromium.org> Reviewed-by: Shawn N <shawnn@chromium.org>
* port80: Disable port80 task when leaving S0Shawn Nematbakhsh2015-07-151-11/+26
| | | | | | | | | | | | | | | | | | | | port80 task polling prevents the EC from entering low power states and isn't useful when the AP isn't running. Therefore, when CONFIG_PORT80_TASK_EN is enabled, only enable the port80 task when entering S0, and disable it when leaving S0. BUG=chrome-os-partner:42104 TEST=Manual on Glados. Boot AP, verify that 'port80' log starts with "10 20...". Shutdown AP, verify with 'taskinfo' that PORT80 task stops consuming cycles. Boot AP again, verify that 'port80' log starts with new "10 20...". BRANCH=None Change-Id: Id41dbdaa4597456d042b7a3921c1ec439af759f4 Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/285550 Reviewed-by: Duncan Laurie <dlaurie@chromium.org> Reviewed-by: Alec Berg <alecaberg@chromium.org>
* mec1322: Added task-based Port80 POST code support.Kevin K Wong2015-04-271-0/+47
| | | | | | | | | | | | | | | | | | | | | | With mec1322's EMI set to decode IO 0x800, it does not have any other interfaces to support POST code via IO 0x80. This change is to enable Port80 POST code support via polling method. Limitation: - POST Code 0xFF will be ignored. - POST Code frequency is greater than 1 msec. BUG=chrome-os-partner:39386 TEST=Verified Port80 POST code is captured in EC console. Verified "port80 task" console command will disable/enable Port80 task. Verified "port80 poll" will get the last Port80 POST code. BRANCH=none Change-Id: I27e53e84b5be1fd98464a44407dd58b93d8c798d Signed-off-by: Kevin K Wong <kevin.k.wong@intel.com> Reviewed-on: https://chromium-review.googlesource.com/266783 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* CHROMIUM: ec: Add Port 80 history access from ectoolsWenkai Du2014-05-071-2/+38
| | | | | | | | | | | | | | | | | | | | | | While debugging reboot issue, it was difficult to get POST code from failing boards. Currently POST code is only accessible from EC console. Not all boards are fitted with servo board. This patch adds Port 80 history access from ectool. Reuse command code 0x48, EC_CMD_PORT80_LAST_BOOT with version 1. Signed-off-by: Wenkai Du <wenkai.du@intel.com> BUG=chrome-os-partner:28514 BRANCH=rambi TEST=manually test on rambi to confirm port 80 history match EC console Change-Id: If204d8fb457d8d8d18055f8282a406a35c03305e Reviewed-on: https://chromium-review.googlesource.com/198012 Reviewed-by: Randall Spangler <rspangler@chromium.org> Reviewed-by: Wenkai Du <wenkai.du@intel.com> Commit-Queue: Wenkai Du <wenkai.du@intel.com> Tested-by: Wenkai Du <wenkai.du@intel.com>
* Clean up a few modules in common/Randall Spangler2012-10-261-5/+3
| | | | | | | | | | | | | Just code cleanup; no functional changes BUG=chrome-os-partner:15579 BRANCH=none TEST=build link and snow Change-Id: Ib62f805777994b39cd9f47a721f52529bb9399c5 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/36573 Reviewed-by: Simon Glass <sjg@chromium.org>
* port80: Track and export last post code in previous bootDuncan Laurie2012-08-131-2/+31
| | | | | | | | | | | | | | | | | | | | | | | - Add a special port80 event for LPC reset assertion and use that event to store the previous post code. - Add a new command to retrive the last saved post code so I can easily query it at boot/resume and log unusual codes. BUG=none TEST=manual (with additional coreboot/mosys changes) - interrupt boot process by issuing x86reset on EC console or by using warm reset button on servo - read event log with mosys on next boot 78 | 2012-08-13 09:24:04 | System boot | 262 79 | 2012-08-13 09:24:04 | Last post code in previous boot | 0x9e 80 | 2012-08-13 09:24:04 | System Reset Change-Id: I7b9f10442b9c468d89fde4e75adb94b0c07c2c8d Signed-off-by: Duncan Laurie <dlaurie@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/29995 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* Enhance port 80 loggingRandall Spangler2012-08-071-11/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - 'port80 intprint' toggles printing port 80 codes in interrupt handler (turning that off speeds up port 80 capture a bit, if you're sending port 80 codes very rapidly) - 'port80 flush' flushes the log buffer - log buffer expanded to 256 entries - log buffer tracks S3->S0 power state transitions, so you can tell where each boot starts This uses ~500 bytes more RAM on the EC, but we've got piles of RAM (with this change we're using 17KB out of 32KB). BUG=none TEST=manual - boot system - port80 -> prints data - port80 intprint -> now disabled - reboot; wait for reboot; no port80 debug output during boot - port80 -> prints data from previous boot AND this one - port80 flush - port80 -> nothing in log Change-Id: I64ee72fb13ab0fdd85d04b9640b5390fdac31400 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/29420 Reviewed-by: Bill Richardson <wfrichar@chromium.org> Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
* If port 80 buffer isn't full, only print partial contentsRandall Spangler2012-06-181-12/+27
| | | | | | | | | | | | | | | BUG=chromium-os:31902 TEST=manual 1. reboot ec 2. port80; nothing there 3. powerbtn 4. retype port80 repeatedly during boot and see it fill and then scroll Change-Id: Id227d5debbdd635332ed2f42bc0f163833031b5c Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/25442 Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
* Better help for console commandsRandall Spangler2012-05-251-1/+4
| | | | | | | | | | | | | | | | | | | | 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
* Even more debug command cleanup to save spaceRandall Spangler2012-05-211-7/+5
| | | | | | | | BUG=none TEST=(run the commands) Change-Id: Ibc414ffd594e06dbdce64c51859b6f247bb10d36 Signed-off-by: Randall Spangler <rspangler@chromium.org>
* Use console output instead of uart output for console commandsRandall Spangler2012-04-241-1/+1
| | | | | | | | | | | | 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-6/+7
| | | | | | | | | | | | | | | | | | 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
* Clean up initsRandall Spangler2012-04-191-12/+2
| | | | | | | | | | | | We can clear the reset cause in system pre-init now because of a previous change which preserves it across a sysjump. Signed-off-by: Randall Spangler <rspangler@chromium.org> BUG=none TEST=if it boots, it works Change-Id: I1d8b99df5a0be0de9545d22ad1a6b7fb3140f813
* Add %T format code to print current timestamp.Randall Spangler2012-04-031-1/+1
| | | | | | | | | 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
* Remove code for skipping duplicate port 80 writesRandall Spangler2012-03-191-13/+4
| | | | | | | | | | | | | The kernel no longer uses port 80 as a delay mechanism, so we don't need to detect the no-longer-present spammy writes. Signed-off-by: Randall Spangler <rspangler@chromium.org> BUG=chrome-os-partner:7972 TEST=port80 scroll, then boot the system. see a few repeated bytes, but not piles of 00 and ff's. Change-Id: Id14dc43ab4e1b15c6bab99a17c062f295a59e7e6
* Make port 80 output less scrollyRandall Spangler2012-02-141-7/+16
| | | | | | | | | | | | | | | | | | | | | It was scrolling so much that the EC debug output for power state transitions was getting lost. Now it uses CR instead of LF. Use 'port80 scroll' to turn scrolling back on (it's off by default). Port 80 history is still visible via the 'port80' command, in all cases. Signed-off-by: Randall Spangler <rspangler@chromium.org> BUG=none TEST=powerbtn ; power on; should not scroll screen port80 ; confirm history is still there port80 scroll ; enable scrolling powerbtn ; turn system off powerbtn ; turn system back on; should scroll screen port80 ; confirm history is still there Change-Id: I85d058ff0b2b9d3d5296060747bde5e872b85817
* Print repeated port 80 writes, for coreboot/uboot debuggingRandall Spangler2012-02-091-0/+3
| | | | | | | | | Signed-off-by: Randall Spangler <rspangler@chromium.org> BUG=chrome-os-partner:7972 TEST=boot main processor; look for repeated sequential port 80 writes Change-Id: I07b247130945296ce73177a342e0b2cf5645f4fb
* register console commands at compile-timeVincent Palatin2012-01-241-9/+1
| | | | | | | | | | | | | | | 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/+74
source files mainly done by Randall. Signed-off-by: Randall Spangler <rspangler@chromium.org> Change-Id: Iaff83a842b17f3350fb6f2a3f1597ad4c29bd12a