summaryrefslogtreecommitdiff
path: root/common/pstore_commands.c
Commit message (Collapse)AuthorAgeFilesLines
* host_command: Change host command return value to enum ec_statusTom Hughes2019-10-021-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* pstore: Fix issue with block calculation for pstore blocksMoritz Fischer2017-01-031-2/+2
| | | | | | | | | | | | | | | | Fix issue where the block is calculated wrong since the offset that gets added is wrongly EEPROM_BLOCK_COUNT_PSTORE which is the number of total blocks rather than the starting block given by EEPROM_BLOCK_START_PSTORE. TEST=Build test, ran on board with stubbed out functions. BUG=none BRANCH=none Change-Id: Ide4839845353c2b9f95a37eb689c8d800169bb22 Signed-off-by: Moritz Fischer <moritz.fischer@ettus.com> Reviewed-on: https://chromium-review.googlesource.com/424182 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* Change host command params/response pointers to void *Randall Spangler2012-07-261-6/+3
| | | | | | | | | | | | | This removes a bunch of unnecessary typecasts, since you can assign to/from void * without them. This also uncovered a few cases where const was being cast away for the input params; now fixed. BUG=none TEST=mkbp hash from u-boot console, and/or system boots ok Change-Id: Ic314b9d2ca06226ea8a09703ef5c1a912eb7146d Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/28500
* Pass maximum size of response buffer in via host command handler argsRandall Spangler2012-07-121-1/+1
| | | | | | | | | BUG=chrome-os-partner:11275 TEST=from u-boot prompt, 'mkbp hash' Change-Id: I4cf37acfdd8e4edfe2cb6259b0fc6d0860ef0f79 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/27225
* Refactor API for host commands, and handle variable length data betterRandall Spangler2012-07-111-22/+23
| | | | | | | | | | | | | | | | | | | | | | | Added version mask field to DECLARE_HOST_COMMAND() because it's convenient to do so when I'm touching all host command implementations, but all commands simply declare version 0 and nothing checks it yet. Will add version support in a followup CL. This change is internal to the EC; it does not change the data sent over the host interface. BUG=chrome-os-partner:11275 TEST=manual ectool version && ectool echash; should get sane data from both ectool flashread 0x80 0x40 /tmp/foo && od -tx1 /tmp/foo should match data from offset 0x80 of ec.bin (od -j128 -n64 -tx1 ec.bin) Change-Id: I5699f72b8d5e1ac23929353c9a34158d76c44206 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/27172 Reviewed-by: Bill Richardson <wfrichar@chromium.org>
* de-LPCify the EC host interfaceVincent Palatin2012-05-151-22/+22
| | | | | | | | | | | | | Preparatory work to use common host command code between ARM and x86. Just rename constants, do not change the binary API. Signed-off-by: Vincent Palatin <vpalatin@chromium.org> BUG=chrome-os-partner:9614 TEST=make BOARD=link Change-Id: I534d427c9b50103273835a6f32a0ddb622c762b3
* Slightly update the host commands APIVincent Palatin2012-05-141-3/+5
| | | | | | | | | | | | | | | | | | | | Preparatory work to use common host command code between ARM and x86. Every command sends back explicitly the size of the response payload. The size of the response defaults to 0 ond can be updated. Add a protocol version number returned as command 0x00 to help with backward compatibility. move a couple of function from lpc specific header to host commands to be able to implement them for the I2C link. Signed-off-by: Vincent Palatin <vpalatin@chromium.org> BUG=chrome-os-partner:9614 TEST=make BOARD=link Change-Id: I6a28edf02996ddf6b7f32a3831d07d5f0271848f
* Use console output instead of uart output for console commandsRandall Spangler2012-04-241-4/+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
* Add fake developer switchRandall Spangler2012-04-101-13/+6
| | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Randall Spangler <rspangler@chromium.org> BUG=chrome-os-partner:8884 TEST=manual optget fake_dev_switch --> 0 optset fake_dev_switch 1 optget fake_dev_switch --> 1 optset fake_dev_switch 0 optget fake_dev_switch --> 0 Reboot by holding ESC+D and tapping power optget fake_dev_switch --> 1 Reboot by holding ESC+F and tapping power optget fake_dev_switch --> 0 Change-Id: Iccb3bc8b3d571e551e204892769efc4161858055
* Refactor LPC status / result codesRandall Spangler2012-03-011-9/+9
| | | | | | | | | | | | | | | This is necessary to support SCI/SMI events. Note that this breaks compatibility with previous ectool builds - and probably also breaks flashrom support. Signed-off-by: Randall Spangler <rspangler@chromium.org> BUG=chrome-os-partner:8253 TEST='ectool hello' and 'ectool flashinfo' still work and 'ectool usbchargemode 3 1' fails with error 2 Change-Id: If39e5b6e7cdcec1b5ec765594e8492925b430b10
* Register host commands the same clever way we do console commandsRandall Spangler2012-02-281-2/+4
| | | | | | | BUG=none TEST=run assorted ectool commands Change-Id: I830d3cbf2d1557b3ab455ec8736d3de5e5d3e697
* Add persistent host storage in EC EEPROMRandall Spangler2012-02-281-0/+109
Signed-off-by: Randall Spangler <rspangler@chromium.org> BUG=chrome-os-partner:8247 TEST=manual from root shell on host: ectool pstoreinfo --> should print PstoreSize 1024 AccessSize 4 echo testing 1 2 3 4 > /tmp/infile ectool pstorewrite 8 /tmp/infile ectool pstoreread 8 /tmp/outfile diff /tmp/infile /tmp/outfile Change-Id: I565e580307584f7def36c5e53d360c1a897d67d2