summaryrefslogtreecommitdiff
path: root/util/ec_sb_firmware_update.c
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* ec: typo correctionsJack Rosenthal2019-03-011-2/+2
| | | | | | | | | | | | | | | | | | | This corrects a typo reported by a user. (counnect -> connect) As well, another typo in a comment. (detays -> delays). Thanks dnojiri@ BUG=chromium:731005 BRANCH=none TEST=Manually verified the change did not break build Change-Id: Ie9be8cdee1b847c9a2fd5aa9a924e7b4e35f8230 Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1487011 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Raul E Rangel <rrangel@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org>
* ectool: Don't acquire lock when dev interface is usedDaisuke Nojiri2019-01-051-7/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The /dev/cros_ec interface has a built-in mutex, thus we do not need to use /run/lock to arbitrate access since we can assume other tools (mosys, flashrom) also use the dev interface. $ generate_logs ... feedback/cbi_info ... $ cat feedback/cbi_info [0] As integer: 1 (0x1) As binary: 01 02 [1] As integer: 3 (0x3) As binary: 03 [2] As integer: 103 (0x67) As binary: 67 3a Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> BUG=chromium:849399 BRANCH=none TEST=Verify 'ectool version' runs on Nami. Verify lock is acquired when '--interface=lpc' is specified. Verify debugd can run cbi_info. Change-Id: Id94317472917a974218bb137bda11fe5618a4b88 Reviewed-on: https://chromium-review.googlesource.com/1393729 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Tested-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* pyro: battery FW update tool modify for learning modeBruce2017-03-161-1/+21
| | | | | | | | | | | | | | | Let unit can't update battery FW when battery state in learning mode. BUG=b:36372859 BRANCH=reef TEST=check unit can't update battery FW in learning mode. Change-Id: I9d69811d84fc386cda6adb51be51f1cfb4fcdf55 Signed-off-by: Bruce.Wan <Bruce.Wan@quantatw.com> Reviewed-on: https://chromium-review.googlesource.com/454656 Commit-Ready: Keith Tzeng <keith.tzeng@quantatw.com> Tested-by: Keith Tzeng <keith.tzeng@quantatw.com> Reviewed-by: Aaron Durbin <adurbin@chromium.org>
* sb_firmware_update: Set ac flag at fw update modeBruce2016-05-021-2/+19
| | | | | | | | | | | | | | | | | | Some reason cause the power off during battery fw update process. Then execute the process again, tool can't detect AC because EC can't read data from battery. So set AC_PRESS flag after check battery is in battery fw update mode. BUG=None BRANCH=None TEST=check the battery can execute fw update in this case. Change-Id: Iafe501eb1719a12425d5cac42d27c897e078acc1 Signed-off-by: Bruce.Wan <Bruce.Wan@quantatw.com> Reviewed-on: https://chromium-review.googlesource.com/341044 Commit-Ready: Keith Tzeng <keith.tzeng@quantatw.com> Tested-by: Keith Tzeng <keith.tzeng@quantatw.com> Reviewed-by: Shawn N <shawnn@chromium.org>
* sb_firmware_update: Remove battery HWID checkBruce2016-03-071-9/+0
| | | | | | | | | | | | | | | | | We're supporting a wide range of batteries, and since file name matching is based on HWID, we don't need to maintain a separate table of supported HWIDs in our utility. BUG=chrome-os-partner:49589,chrome-os-partner:50469 BRANCH=None TEST=buildall Change-Id: I3e7c62379c07a598e23f3c543959503d3d25aee3 Signed-off-by: Bruce.Wan <Bruce.Wan@quantatw.com> Reviewed-on: https://chromium-review.googlesource.com/330231 Commit-Ready: Keith Tzeng <keith.tzeng@quantatw.com> Tested-by: Bruce Wan <Bruce.Wan@quantatw.com> Reviewed-by: Shawn N <shawnn@chromium.org>
* sb_firmware_update: Use any available host protocolShawn Nematbakhsh2016-01-111-1/+1
| | | | | | | | | | | | | | | | Don't restrict host protocol to LPC since newer boards only support COMM_DEV. BUG=chrome-os-partner:44052 TEST=Verify SB FW update is successful on Ultima. BRANCH=None Change-Id: I64f0c3ff278fe464cc71661454734c4cac5e88a9 Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/321330 Commit-Ready: Shawn N <shawnn@chromium.org> Tested-by: Shawn N <shawnn@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org>
* sb_firmware: fixed the last write delaysSheng-Liang Song2015-05-301-15/+32
| | | | | | | | | | | | | | | | | | | | | BUG=chrome-os-partner:40569 BRANCH=none TEST=Begin 1. Install noraml linux images 2. Connected Battery which is having old firmware(100) 3. power on DUT and goto crosh (In normal mode) 4. run "battery_firmware update " 5. Remove AC to interrupt the update 6. Power OFF and power on the DUT again 7. Now seen critical firmware update screen. 8. Reboot around 4 min. 9. See login window. End Change-Id: I2090cfa9200a7402a5fba2e111073dd1d7e7b422 Signed-off-by: Sheng-liang Song <ssl@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/273660 Reviewed-by: Shawn N <shawnn@chromium.org>
* ec: fix -Wuninitialized warning.Yunlian Jiang2015-05-151-2/+2
| | | | | | | | | | | | | | | | | BUG=chromium:488540 Signed-off-by: yunlian@chromium.org BRANCH=none TEST=FEATURES="test" CC=x86_64-cros-linux-gnu-clang CXX=x86_64-cros-linux-gnu-clang++ emerge-falco chromeos-ec Change-Id: If70f7de921a2e973c093a92f03fa0f1603ee0b08 Reviewed-on: https://chromium-review.googlesource.com/271476 Reviewed-by: David James <davidjames@chromium.org> Reviewed-by: Vincent Palatin <vpalatin@chromium.org> Reviewed-by: Yunlian Jiang <yunlian@chromium.org> Reviewed-by: Sheng-liang Song <ssl@chromium.org> Commit-Queue: Sheng-liang Song <ssl@chromium.org> Tested-by: Sheng-liang Song <ssl@chromium.org>
* sb_firmware: Fixed firmware version checkSheng-Liang Song2015-05-141-4/+6
| | | | | | | | | | | | | | | | | | Added firmware version check to handle the following cases: - when the data table version is the same and fw version is newer or - when the fw version is the same and data table version is newer. BUG=chrome-os-partner:36310 BRANCH=none TEST=Verified on Glimmer. crosh> battery_firmware check crosh> battery_firmware update Change-Id: If3d28f6ae7a89fc7c41fd60214ab3616f1abfe5a Signed-off-by: Sheng-Liang Song <ssl@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/270387 Reviewed-by: Shawn N <shawnn@chromium.org>
* sb_firmware: enable retry for status.fw_update_supportedSheng-Liang Song2015-05-141-2/+2
| | | | | | | | | | | | | | | Added retry logic when see fw_update_supported=0. BUG=chrome-os-partner:36310 BRANCH=none TEST=Verified on Glimmer. crosh> battery_firmware check crosh> battery_firmware update Change-Id: I441c9763df9b1e91b3de08d2f30ecfa49c59f677 Signed-off-by: Sheng-Liang Song <ssl@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/270179 Reviewed-by: Shawn N <shawnn@chromium.org>
* sb_firmware: Enable Updates for Simplo Battery Only.Sheng-Liang Song2015-05-141-1/+11
| | | | | | | | | | | | | | | | If can get battery info, enable updates if it is Simplo Battery. If can not get battery info, assume a Simplo Battery is a bad state. BUG=chrome-os-partner:36310 BRANCH=none TEST=Verified on Glimmer. crosh> battery_firmware check crosh> battery_firmware update Change-Id: I0db6b50b5a382b72fd9682621990d0a6dd9e6a2b Signed-off-by: Sheng-Liang Song <ssl@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/266044 Reviewed-by: Shawn N <shawnn@chromium.org>
* sb_firmware: Use new delay values suggested by Simplo & TI.Sheng-Liang Song2015-05-141-87/+67
| | | | | | | | | | | | | | | Used fixed delay values suggested by Simplo & TI. BUG=chrome-os-partner:36310 BRANCH=none TEST=Verified on Glimmer. crosh> battery_firmware check crosh> battery_firmware update Change-Id: Ibc2d135cfd5e4c01fce0f8fcc56f5f850fab3c16 Signed-off-by: Sheng-Liang Song <ssl@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/265754 Reviewed-by: Shawn N <shawnn@chromium.org>
* sb_firmware: check if last full charge is zeroSheng-Liang Song2015-05-141-9/+13
| | | | | | | | | | | | | | | Detect if the last full charge is zero or not. BUG=chrome-os-partner:36310 BRANCH=none TEST=Verified on Glimmer. crosh> battery_firmware check crosh> battery_firmware update Change-Id: I078b860acc96f60830c82af8f85cfb98e27095cb Signed-off-by: Sheng-Liang Song <ssl@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/263156 Reviewed-by: Shawn N <shawnn@chromium.org>
* sb_firmware: update arguments and configsstabilize-6919.BSheng-Liang Song2015-03-271-45/+106
| | | | | | | | | | | | | | | | | | | | - Updated arguments to support two sub commands: - check: check if AC adapter is connect. - update: trigger battery firmware update. - All Delay values are from .cfg file. BUG=chrome-os-partner:36310 BRANCH=none CQ-DEPEND=CL:260868 TEST=Verified on Glimmer. crosh> battery_firmware check crosh> battery_firmware update Change-Id: I7324e1f329383cf5ee62660f4ac4cb0b1c30c056 Signed-off-by: Sheng-Liang Song <ssl@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/260210 Reviewed-by: Shawn N <shawnn@chromium.org>
* sb_firmware: shorter console messagesstabilize-6842.BSheng-Liang Song2015-03-021-3/+1
| | | | | | | | | | | | | | | Reduced console log messages BUG=chrome-os-partner:36310 BRANCH=none TEST=Compile Only Change-Id: I0e30a3094d77673a5fd238efed3851a726fdcdb6 Signed-off-by: Sheng-Liang Song <ssl@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/254931 Reviewed-by: Bernie Thompson <bhthompson@chromium.org> Reviewed-by: Shawn N <shawnn@chromium.org> Commit-Queue: Bernie Thompson <bhthompson@chromium.org>
* sb_firmware: clean up sb firmware update programSheng-Liang Song2015-02-281-53/+55
| | | | | | | | | | | | | | | | | | | | | | | | - battery firmware filename need match with gs:// filename - changed from "%04X" to "%04x" - A fix for LGC battery firmware update. - Add control flags: F_AC_PRESENT - 1 iff AC is connected. F_VERSION_CHECK - 1 if do version check - option to disk version check for stress test. - Add detail log messages - Remove old debug flag. BUG=chrome-os-partner:36310 BRANCH=none TEST=run ec_sb_firmware_update on glimmer Change-Id: Iebc15222a7a55a786291ce2d8931e70acc5b3c4d Signed-off-by: Sheng-Liang Song <ssl@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/253970 Reviewed-by: Shawn N <shawnn@chromium.org>
* EC: Support firmware updater to auto select a battery fw imageSheng-Liang Song2015-02-201-117/+207
| | | | | | | | | | | | | | | | Auto select a battery firmware image based on the current "battery info." sprintf(auto_image_name,"/lib/firmware/battery/maker.%04X.hwid.%04X.bin" maker_id, hardware_id); BUG=chrome-os-partner:24741 BRANCH=glimmer TEST=Verified Simplo Battery Update on glimmer Change-Id: Ie6b2f797a4629fdde3a45e9a6a83c4568655db7a Signed-off-by: Sheng-Liang Song <ssl@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/250130 Reviewed-by: Shawn N <shawnn@chromium.org>
* ectool: add new parameter to identify proper EC.Gwendal Grignou2014-09-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Add parameter name to identify which EC to talk to. Superseed --dev parameter, removed soon. --name cros_ec (the default): send commands to /dev/cros_ec. --name cros_pd: send commands to /dev/cros_pd. ... BUG=chrome-os-partner:31513 TEST=Tested on samus: check ectool --name cros_pd version returns proper data: ectool --name=cros_pd version RO version: samus_pd_v1.1.2079-8e4f9fc-dirt .... CQ-DEPEND=CL:217297 BRANCH=ToT Change-Id: Ie8b5c6c184d73a89b4445e88d6f104169176b9f3 Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/217311 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* EC: Add util for battery firmware updateSheng-Liang Song2014-09-051-0/+652
Ref: Common Smart Battery System Inferface Specification v8.0. Implemented smart battery firmware update util based the above spec. BUG=chrome-os-partner:24741 CQ-DEPEND=CL:210032 CQ-DEPEND=CL:210033 CQ-DEPEND=CL:215720 BRANCH=ToT TEST=Verified LGC & Simplo Battery Update on glimmer Change-Id: Ia61a49f4643ea349d42a4b87d6010c1ac011729b Signed-off-by: Sheng-Liang Song <ssl@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/205324 Reviewed-by: Randall Spangler <rspangler@chromium.org>