summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Clear OWNERS for factory/firmware branchfirmware-parrot-2685.BBrian Norris2021-09-101-0/+1
| | | | | | | | | | | | BUG=none TEST=none Change-Id: I0f03f432ada1064ffba9595be78ca7ab4d25ecd1 Signed-off-by: Brian Norris <briannorris@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3155222 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Owners-Override: Jora Jacobi <jora@google.com> Tested-by: Jack Rosenthal <jrosenth@chromium.org>
* Set TPSCHROME temp range configurationRong Chang2012-07-293-22/+178
| | | | | | | | | | | | | | | | | | | Signed-off-by: Rong Chang <rongchang@chromium.org> BUG=chrome-os-partner:11627 TEST=manual Check pmu registers under uart console: "pmu" TPSCHROME version < 3: reg(7) == 0xbd reg(8) == 0xfd TPSCHROME version >= 3: reg(7) == 0xbf reg(8) == 0xff Change-Id: Ifeda54aa142b362aa224575c55220913b0ee7436 Reviewed-on: https://gerrit.chromium.org/gerrit/28587 Reviewed-by: Vic Yang <victoryang@chromium.org> Commit-Ready: Rong Chang <rongchang@chromium.org> Tested-by: Rong Chang <rongchang@chromium.org>
* The jtag_buf_en was not set.Louis Yung-Chieh Lo2012-07-261-1/+2
| | | | | | | | | | | | | | | | | The dut_control function only accepts the first parameter. Thus, the jtag_buf_en:on is actually dropped in flash_link. This caused flash_ec script failed sometimes. BUG=None TEST=tested on link. util/flash_ec --board=link --image=... Change-Id: Ib7f8cdcd651a573ad4bdc6e446f3c715dce29b71 Signed-off-by: Louis Yung-Chieh Lo <yjlou@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/28569 Commit-Ready: Yung-Chieh Lo <yjlou%chromium.org@gtempaccount.com> Tested-by: Yung-Chieh Lo <yjlou%chromium.org@gtempaccount.com> Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* stm32: Add kbpress commandVic Yang2012-07-261-0/+37
| | | | | | | | | | | | | This command is needed by keyboard test. BUG=chrome-os-partner:11747 TEST=Keyboard test passed. Change-Id: I752f8a8f672f4ef2214ff60c8946a1a74745c586 Reviewed-on: https://gerrit.chromium.org/gerrit/28387 Commit-Ready: Vic Yang <victoryang@chromium.org> Reviewed-by: Vic Yang <victoryang@chromium.org> Tested-by: Vic Yang <victoryang@chromium.org>
* Modify Gaia power message to match x86 power moduleVic Yang2012-07-261-4/+5
| | | | | | | | | | | | | Message from power modules should be similar for easier testing. BUG=chrome-os-partner:11815 TEST=none Change-Id: I07e061a34e7d8f8c1f1547d6e15f22f29ee22b84 Reviewed-on: https://gerrit.chromium.org/gerrit/28394 Commit-Ready: Vic Yang <victoryang@chromium.org> Reviewed-by: Vic Yang <victoryang@chromium.org> Tested-by: Vic Yang <victoryang@chromium.org>
* stm32f: Flash write protectVic Yang2012-07-264-33/+311
| | | | | | | | | | | | | | | | | | | | | | | | | | | Implement STM32F write protect to match refactored flash module. Also move fake write-protect pin to use backup register to preserve value across reboot. BUG=chrome-os-partner:11699 TEST=1. 'flashinfo' -> no flags 2. 'fakewp 1' -> 'wp_gpio_asserted' 3. 'flashwp enable' -> 'wp_gpio_asserted ro_at_boot' 4. 'reboot' -> 'wp_gpio_asserted ro_at_boot ro_now' 5. 'fakewp 0' -> 'ro_at_boot ro_now' 6. 'reboot' -> 'ro_at_boot' 7. 'fakewp 1' -> 'wp_gpio_asserted ro_at_boot' 8. 'flashwp rw' -> 'wp_gpio_asserted ro_at_boot rw_at_boot' 9. 'reboot' -> 'wp_gpio_asserted ro_at_boot ro_now rw_at_boot rw_now' 10.'flashwp disable'-> error 7 11.'flashwp norw' -> 'wp_gpio_asserted ro_at_boot ro_now rw_now' 12.'reboot' -> 'wp_gpio_asserted ro_at_boot ro_now' Change-Id: I40405c266e30b10793ccae2f1d26fb9710ce304b Reviewed-on: https://gerrit.chromium.org/gerrit/28372 Reviewed-by: Randall Spangler <rspangler@chromium.org> Commit-Ready: Vic Yang <victoryang@chromium.org> Tested-by: Vic Yang <victoryang@chromium.org>
* Stop keyboard scans from triggering ARM EC resetCharlie Mooney2012-07-262-1/+28
| | | | | | | | | | | | | | | | | | | | | | | | The ARM EC was being rebooted when both the power and one of several other keys were pressed. (LCtrl, Tab, Reload, t, [, ], y, Dim Screen and Mute) It should only do this when the key combo PWR + Reload is pressed. To fix it, keyboard scanning is disabled whenever the power button is pressed. It locks a mutex indicating that scanning should be disabled, and the main keyboard scanning task blocks on the step where it sets up the keyboard and waits for the mutex to unlock. BUG=chrome-os-partner:10889 TEST=Pick one of the troublesome keys. First press it, then quickly press the power button. Then press the power button followed by the troublesome key. Repeat this process several times for each key, it should not reset the system. Press power + reload, this should still reset the system. Pressing and holding power should initiate a shutdown. Change-Id: Ib60d2ebbb57eb8a3c135662514ec622c37a7eb07 Signed-off-by: Charlie Mooney <charliemooney@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/28402 Reviewed-by: David Hendricks <dhendrix@chromium.org>
* Change host command params/response pointers to void *Randall Spangler2012-07-2621-126/+69
| | | | | | | | | | | | | 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
* Change some FMAP area_offset to be related to the start of flash.Louis Yung-Chieh Lo2012-07-251-3/+10
| | | | | | | | | | | | | | | | | | | | | | The area_offset of following area are wrong which is related to the CPU view in the STM32 chip: FMAP RO_FRID RW_FWID Add a macro RELATIVE() to calculate the real offset in flash. BUG=chrome-os-partner:11269 TEST=build in chroot for link and snow. Those fmap afddress are related to the start of flash. Change-Id: I691814e2f53b1de0ecf9fd385bed8d5c598373a7 Signed-off-by: Louis Yung-Chieh Lo <yjlou@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/28388 Commit-Ready: Yung-Chieh Lo <yjlou%chromium.org@gtempaccount.com> Reviewed-by: Yung-Chieh Lo <yjlou%chromium.org@gtempaccount.com> Tested-by: Yung-Chieh Lo <yjlou%chromium.org@gtempaccount.com>
* Don't protect firmware now if protect-ro-at-boot is not setRandall Spangler2012-07-251-2/+6
| | | | | | | | | | | | | | | Otherwise, EC software sync protects the entire firmware except in recovery mode, regardless of the WP pin. BUG=chrome-os-partner:11847 TEST=boot with WP enabled but RO-at-boot disabled; flashinfo should show entire flash still writable CQ-DEPEND=28444 Change-Id: I58d60adfaa952b127e8695213f95f6da0e34821d Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/28445 Reviewed-by: Bill Richardson <wfrichar@chromium.org>
* don't crash when receiving ACPI query on legacy channelVincent Palatin2012-07-251-0/+24
| | | | | | | | | | | | | | | | | | | | | | When updating the EC and BIOS, we have to run for some times the new EC with the old BIOS (after we have upgraded the first half of the EC and before rebooting the machine), let's handle the ACPI request so the kernel is not sending them into a loop triggering a reboot of the machine. Signed-off-by: Vincent Palatin <vpalatin@chromium.org> BUG=chrome-os-partner:11821 TEST=update a Link EVT using "chromeos-firmware --mode=factory" from current BCS binaries (EC v1.1.104-b8d7d8f / Firmware 2476) to next candidates ( EC v1.1.301 / Firmware 2657). Change-Id: I115a42e6c33c143cbdc38341dcf7e0f61a8bd771 Reviewed-on: https://gerrit.chromium.org/gerrit/28409 Reviewed-by: Duncan Laurie <dlaurie@chromium.org> Tested-by: Vincent Palatin <vpalatin@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org> Commit-Ready: Vincent Palatin <vpalatin@chromium.org>
* Add upstart script to collect temperature statistics.Luigi Semenzato2012-07-251-0/+33
| | | | | | | | | | | | | | | | This is used only in selected platforms, and installed by the temp-metrics package in the private overlay for those platforms. BUG=chrome-os-partner:11631 TEST=manually using about:histograms Signed-off-by: Luigi Semenzato <semenzato@chromium.org> Change-Id: I89dffed6aa34d683ff78a360988fdfb84c2dc641 Reviewed-on: https://gerrit.chromium.org/gerrit/28311 Tested-by: Luigi Semenzato <semenzato@chromium.org> Reviewed-by: Richard Barnette <jrbarnette@chromium.org> Commit-Ready: Luigi Semenzato <semenzato@chromium.org>
* Change the path check of --image in util/flash_ec.Louis Yung-Chieh Lo2012-07-241-1/+1
| | | | | | | | | | | | | | BUG=None TEST=test on link. % util/flash_ec --board=link --image=a/random/file/path flash successfully. Change-Id: I82980783585ac7d2979cf195b7eb820dbf072156 Signed-off-by: Louis Yung-Chieh Lo <yjlou@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/28252 Commit-Ready: Yung-Chieh Lo <yjlou%chromium.org@gtempaccount.com> Tested-by: Yung-Chieh Lo <yjlou%chromium.org@gtempaccount.com> Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* Fix order of init hooks so chipset is called before power buttonRandall Spangler2012-07-244-3/+13
| | | | | | | | | | | | | | BUG=chrome-os-partner:11779 TEST=manual 1. power on system 2. sysjump RW 3. system should stay powered on Change-Id: Idf238c0567daa6137324e91e58279329865a2d42 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/28346 Reviewed-by: Yung-Chieh Lo <yjlou%chromium.org@gtempaccount.com>
* Add RW offset query interface (EC_CMD_FLASH_RW_OFFSET).Louis Yung-Chieh Lo2012-07-242-0/+57
| | | | | | | | | | BUG=chrome-os-partner:11149 TEST=build only. Originally-Signed-off-by: Louis Yung-Chieh Lo <yjlou@chromium.org> Change-Id: I35ad1e0a49c95a2d6cffbe49b2013a1b8050aabc Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/28166
* Set correct name for new TMP006 sensorsVic Yang2012-07-241-24/+24
| | | | | | | | | | | BUG=chrome-os-partner:11491 TEST=none Change-Id: I00a59554fb5819c0942d917f8d558c1a00570a73 Reviewed-on: https://gerrit.chromium.org/gerrit/28251 Reviewed-by: Randall Spangler <rspangler@chromium.org> Commit-Ready: Vic Yang <victoryang@chromium.org> Tested-by: Vic Yang <victoryang@chromium.org>
* Add "all" command for sensor temperatures and sensor info.Luigi Semenzato2012-07-241-12/+57
| | | | | | | | | | | | | | | | This change makes it easier and less costly for the metrics daemon to collect sensor temperatures. BUG=chrome-os-partner:11631 TEST=manually verified that it works as expected Signed-off-by: Luigi Semenzato <semenzato@google.com> Change-Id: Iee7ca971f53d65f07589173322b55b0d87ab5363 Reviewed-on: https://gerrit.chromium.org/gerrit/28026 Reviewed-by: Randall Spangler <rspangler@chromium.org> Commit-Ready: Luigi Semenzato <semenzato@chromium.org> Tested-by: Luigi Semenzato <semenzato@chromium.org>
* Calculate the hash only of the actual RW codeRandall Spangler2012-07-243-7/+44
| | | | | | | | | | | | | | | | | No need to hash a bunch of 0xff's at the end. We explicitly set a 0xea byte after the end of the code in firmware_image.lds.S. BUG=chrome-os-partner:11087 TEST=look for the hash start line in the EC debug output: [0.011543 hash start 0x00014000 0x00011590] The second number is the code size. It should be the same size as ec.RW.bin, instead of 0x14000. Change-Id: Ibc94851dc1a09eb46cad46bb97dc5762f9c521f0 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/28300
* hash command without args prints current hashRandall Spangler2012-07-241-0/+15
| | | | | | | | | BUG=none TEST=hash -> prints offset, size, (digest or in-progress) Change-Id: Ic21319c522811b3b73ace3538adb5dda0e6324c2 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/28301
* Revert "Revert "i2c: Support command version numbers""Simon Glass2012-07-243-15/+57
| | | | | | | | | | This reverts commit 3bb4c6acf4ff327f956ee5e1b6deefcd84dc8fbb Change-Id: I690baa9bcc0229502c103fc31314170bbc825f65 Reviewed-on: https://gerrit.chromium.org/gerrit/28189 Commit-Ready: Simon Glass <sjg@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org> Tested-by: Simon Glass <sjg@chromium.org>
* Revert "Revert "i2c: Move host command processing into a function""Simon Glass2012-07-231-13/+18
| | | | | | | | | | This reverts commit 353bc6826033c0681394f0c49701dd5678422a0c Change-Id: I9c7d7264db158f242b9b869f903e57b111d6f2c5 Reviewed-on: https://gerrit.chromium.org/gerrit/28188 Reviewed-by: Simon Glass <sjg@chromium.org> Tested-by: Simon Glass <sjg@chromium.org> Commit-Ready: Simon Glass <sjg@chromium.org>
* Refactor flash moduleRandall Spangler2012-07-238-341/+376
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a significant rewrite of the flash module, since it turns out that much less of the flash logic is actually common between stm32 and lm4. BUG=chrome-os-partner:11699 TEST=on link, (enable hardware wp) flashinfo -> wp_gpio_asserted flashwp enable flashinfo -> wp_gpio_asserted ro_at_boot reboot flashinfo -> wp_gpio_asserted ro_at_boot ro_now flashwp disable -> error 7 flashwp now flashinfo -> wp_gpio_asserted ro_at_boot ro_now rw_now reboot flashinfo -> wp_gpio_asserted ro_at_boot ro_now (disable hardware wp) reboot flashinfo -> ro_at_boot flashwp disable flashinfo -> (no flags) Change-Id: If22b02373946ce1c080d49ccded4f8fa3e380115 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/28200 Reviewed-by: Vic Yang <victoryang@chromium.org>
* Add console command to inject host commandVic Yang2012-07-231-0/+87
| | | | | | | | | | | | | | | | | For easier testing. BUG=chrome-os-partner:11350 TEST=Try host command 0x01=CMD_HELLO. > hostcmd 0x01 0 00000000 04030201 > hostcmd 0x01 0 01020304 05050505 Change-Id: I18becbd7d26241fa673fd46d9ce23a984ac47026 Signed-off-by: Vic Yang <victoryang@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/28059 Reviewed-by: Bill Richardson <wfrichar@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org>
* Implement something close to final lightbar code.Bill Richardson2012-07-234-43/+323
| | | | | | | | | | | | BUG=chrome-os-partner:8039 TEST=manual Boot the system, look at the lightbar. It should pulse colors slowly on battery, faster on AC. Change-Id: I0184973d11eda51db87d652aa2c92995f5a25588 Signed-off-by: Bill Richardson <wfrichar@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/27810
* host_command: Add send_result() to the arg structureSimon Glass2012-07-237-55/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It's a bit odd that the drivers package up a command to be processed by host_command, but then host_command calls a global function to pass the response back. This adds ambiguity in the host_send_response() implementations as to whether the command being responded to really is using the same buffers that the driver set up. Add a function pointer to the command, and have host_command call that. Add status to the args structure also, which removes some of the special case logic for error handling. BUG=chrome-os-partner:11317 TEST=manual and a bit ad-hoc: (note, this testing is not completed yet) Check that snow and link still process commands correctly over I2C from U-Boot. At this stage only the old interface is supported. SMDK5250 # mkbp test Old interface: New interface: Version 0: ec_command() returned error Test failed with error -1 SMDK5250 # Change-Id: I816738150bce3f8d78e7cd32abf361621aa12312 Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/28154 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* bitrot: disable VBOOT_SIG for BDS. It's broken.Bill Richardson2012-07-231-1/+1
| | | | | | | | | | | | | | | | | | BDS has been slowly rotting as we make changes for Link. I haven't been able to test the BDS image for some time (I think due to openocd updates that no longer like the BDS configs), and now it doesn't even compile. This is gating the Link schedule, so I'm just turning it off. If we ever need the BDS again, well, what fun. BUG=none TEST=none It already doesn't work, so it should continue to not work. Change-Id: I2b365623903590a56948dfceb986a2300699f541 Signed-off-by: Bill Richardson <wfrichar@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/28181 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* Add console functionalityRandall Spangler2012-07-233-83/+228
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Keys I keep hitting should work like I expect them to. Home or Ctrl+A = move to beginning of line End or Ctrl+E = move to end of line Del = delete-right Ctrl+K = delete to end of line Ctrl+L = clear screen and reprint current line Ctrl+N = next command Ctrl+P = previous command Also, improve filtering of escape sequences and non-printable characters, so hitting unsupported keys or control codes doesn't mess up the current line of input. BUG=chrome-os-partner:11666 TEST=manual type 'fhelpbar' home -> cursor moves to beginning of line Ctrl+E -> cursor moves to end of line Ctrl+A -> cursor moves to beginning of line (of course, if you're using Minicom, you'll need to type Ctrl+A A, since Minicom uses Ctrl+A as its control key) del -> 'helpbar' end -> cursor moves to end of line left-arrow 3 times -> cursor moves under 'b' Ctrl+L -> screen clears, cursor still under 'b' Ctrl+K -> 'help' Ctrl+Y Page-Up Page-Down -> nothing printed enter -> prints known commands (output of 'help' command) Ctrl+P -> 'help' Ctrl+N -> empty command line Change-Id: Id893c93b26db8f3deed6ea8be5aab88a3daaead4 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/28143
* Refactor reboot command to add ap-off and cancel optionsRandall Spangler2012-07-236-26/+62
| | | | | | | | | | | | | | | | | | | | | | Also add 'preserve' flag, for tracking when flags have been preserved from a previous boot. BUG=chrome-os-partner:11663 TEST=manual reboot -> flags = soft reboot preserve -> flags = soft preserve From ectool, 'ectool reboot_ec cold at-shutdown' sysinfo -> shows reboot at shutdown: 4 reboot cancel sysinfo -> no longer shows pending reboot reboot ap-off -> flags = soft ap-off, AP is not powered on Change-Id: I117f33fe21048edb2261be4dcdc6c828a5794d54 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/28139
* Fix unit tests not compiling for linkRandall Spangler2012-07-232-3/+8
| | | | | | | | | BUG=none TEST=make link tests Change-Id: I678b927d068bd7f1f43115a4495c16902588faa7 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/28140
* ec: Remove "_A" suffix in FMAP RW firmware areas.Hung-Te Lin2012-07-231-12/+5
| | | | | | | | | | | | | | | Since we only have one RW firmware, let's remove _A to prevent confusion. Also change "BOOT_STUB" to FR_MAIN to reflect the fact that it's not just bootstub - it's a full firmware area just like FW_MAIN. BUG=chrome-os-partner:11360 TEST=emerge-link chromeos-ec; dump_fmap -x /build/link/firmware/ec.bin Change-Id: Ia84062ada5959164b2b4e0f9cc5fcc032ca6f71e Signed-off-by: Hung-Te Lin <hungte@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/27971 Reviewed-by: Randall Spangler <rspangler@chromium.org> Tested-by: Randall Spangler <rspangler@chromium.org>
* Revert "host_command: Add send_result() to the arg structure"Randall Spangler2012-07-227-72/+57
| | | | | | | | | | | | This reverts commit 18db93b25b05c871826fd1853a33a560e64ed247 Breaks link checksums. Change-Id: Ieeb278b7d4da0600bdc9ced1476b67f23abce1a1 Reviewed-on: https://gerrit.chromium.org/gerrit/28136 Commit-Ready: Randall Spangler <rspangler@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org> Tested-by: Randall Spangler <rspangler@chromium.org>
* Revert "i2c: Move host command processing into a function"Randall Spangler2012-07-221-18/+13
| | | | | | | | | | | | This reverts commit b2772df970e422e7e31731d38813ee57635c8058 Dependent on reverted change. Change-Id: I353bc6826033c0681394f0c49701dd5678422a0c Reviewed-on: https://gerrit.chromium.org/gerrit/28137 Commit-Ready: Randall Spangler <rspangler@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org> Tested-by: Randall Spangler <rspangler@chromium.org>
* Revert "i2c: Support command version numbers"Randall Spangler2012-07-223-57/+15
| | | | | | | | | | | | This reverts commit b983290238458f88a897ce3cfb06faae9ec79a40 Dependent on reverted change. Change-Id: I3bb4c6acf4ff327f956ee5e1b6deefcd84dc8fbb Reviewed-on: https://gerrit.chromium.org/gerrit/28138 Commit-Ready: Randall Spangler <rspangler@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org> Tested-by: Randall Spangler <rspangler@chromium.org>
* Clean up ectoolRandall Spangler2012-07-222-37/+28
| | | | | | | | | | | | | Assorted minor cleanup; make protocol a bit more efficient, and add a missing line of output to flash protect status. BUG=none TEST=ectool flashprotect; should print valid bits = 0x3f on link Change-Id: I9bea78506b3ed367df731d358982d3e2febb13af Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/28097 Reviewed-by: Vic Yang <victoryang@chromium.org>
* Support up to 24 thermal sensorsRandall Spangler2012-07-226-61/+110
| | | | | | | | | | | | | | | | | And tidy reporting fan/thermal via memmap. BUG=chrome-os-partner:11628 TEST=manual ectool pwmgetfanrpm -> should report fan speed ectool temps N -> should work for N=0-9 reports error for N=15-23 reports invalid sensor ID for N<0 or N>23 Change-Id: I484f81399f5e9dae9c759401091cc6f5acc733ff Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/28032 Reviewed-by: Bill Richardson <wfrichar@chromium.org>
* i2c: Support command version numbersSimon Glass2012-07-223-15/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, I2C commands look like this: Input: cmd8 [params bytes] checksum Output: response8 [response_ptr bytes] checksum Use a prefix byte of (0xDC + cmd_version) to indicate the command version. This is compatible with the existing protocol, since there are no host commands in the range 0xDC-0xFB. If the first byte of the from-host data is 0x00-0xDB, it's a version 0 command. There is no change to the output format, since the EC needs to hand back a response which matches the version requested by the host. New input: (0xDC+ver8) cmd8 paramlen8 [params bytes] checksum New output: response8 responselen8 [response_ptr bytes] checksum If the host gets a response of EC_RES_INVALID_COMMAND, it knows it's talking to an old EC, and at most version 0 of the command is supported. BUG=chrome-os-partner:11317 TEST=manual and a bit ad-hoc: (note, this testing is not completed yet, so far only snow is tested) Check that snow and link still process commands correctly over I2C from U-Boot. SMDK5250 # mkbp test Old interface: New interface: Test passed Change-Id: I1c21f2b036091e9122b4f980ca5f5af34f7fc070 Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/27470
* i2c: Move host command processing into a functionSimon Glass2012-07-221-13/+18
| | | | | | | | | | | | | | | | | | | | | | We are about to add more logic here, so move it this code out of the event handler and into its own function. BUG=chrome-os-partner:11317 TEST=manual and a bit ad-hoc: (note, this testing is not completed yet) Check that snow and link still process commands correctly over I2C from U-Boot. At this stage only the old interface is supported. SMDK5250 # mkbp test Old interface: New interface: Version 0: ec_command() returned error Test failed with error -1 SMDK5250 # Change-Id: I5387eb5533ab6faa27769f4cf21075387357371d Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/27469
* host_command: Add send_result() to the arg structureSimon Glass2012-07-227-57/+72
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It's a bit odd that the drivers package up a command to be processed by host_command, but then host_command calls a global function to pass the response back. This adds ambiguity in the host_send_response() implementations as to whether the command being responded to really is using the same buffers that the driver set up. Add a function pointer to the command, and have host_command call that. Add status to the args structure also, which removes some of the special case logic for error handling. BUG=chrome-os-partner:11317 TEST=manual and a bit ad-hoc: (note, this testing is not completed yet) Check that snow and link still process commands correctly over I2C from U-Boot. At this stage only the old interface is supported. SMDK5250 # mkbp test Old interface: New interface: Version 0: ec_command() returned error Test failed with error -1 SMDK5250 # Change-Id: Ic4afdcd7689666cc0f6af228abc6cffe41b0fcbf Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/27468
* stm32f: Fix some error in flash write protectVic Yang2012-07-213-9/+63
| | | | | | | | | | | | | | | | | | And also add a fake write protect pin command for futher development and testing. BUG=chrome-os-partner:11595 TEST=Enable pstate read/write for stm32f. 1. 'flashinfo' -> WP pin deasserted. No blocks protected. 2. 'flashwp enable' -> Nothing changes. 3. 'fakewp 1'; 'flashinfo' -> WP pin asserted. No blocks protected. 4. 'flashwp enable'; 'flashinfo' -> RO protected. Change-Id: Id5b1997442d9104d9cb254a295e0bd2f8c83bc78 Signed-off-by: Vic Yang <victoryang@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/28062 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* Prevent parallel make from failingVic Yang2012-07-201-7/+5
| | | | | | | | | | | | | | | | When we do parallel 'make', it fails intermittently. We might be hitting a make bug: http://savannah.gnu.org/bugs/?30653 Let's remove the intermediate file for now and see if this happens again. BUG=chrome-os-partner:11614 TEST=Repeatedly remove some file and parallel make. This originally gave an error once every two time. It doesn't now. Change-Id: Iaaf48e7d19b11dad30bc70cd50e73c195caf17b4 Signed-off-by: Vic Yang <victoryang@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/28105 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* daisy/snow: enable SUSPEND_L interruptDavid Hendricks2012-07-191-0/+1
| | | | | | | | | | | | | | This enables interrupts on SUSPEND_L. Signed-off-by: David Hendricks <dhendrix@chromium.org> BUG=none TEST=Power LED on Snow throbs when powerd_suspend is used Change-Id: I5f06e717ddc07d5c2f129ff59a108131da8dbf87 Reviewed-on: https://gerrit.chromium.org/gerrit/27968 Reviewed-by: Vincent Palatin <vpalatin@chromium.org> Commit-Ready: David Hendricks <dhendrix@chromium.org> Tested-by: David Hendricks <dhendrix@chromium.org>
* link: update fan policyVincent Palatin2012-07-191-5/+7
| | | | | | | | | | | | | | | | | | | | | As per James advice : - increase fan speed at low temperature up to maximum "silent RPM", this will give us more margin for later operations. - lower the maximum fan RPM threshold to 86 C to try to lower CPU temperature impact on skin temp. - do not take into account "object" temp sensors, they are too random at the moment. Signed-off-by: Vincent Palatin <vpalatin@chromium.org> BUG=None TEST=adhoc Change-Id: I3b60570e33f82e4015c6588d9e2ae538a33ad14f Reviewed-on: https://gerrit.chromium.org/gerrit/27921 Reviewed-by: Sameer Nanda <snanda@chromium.org> Tested-by: Vincent Palatin <vpalatin@chromium.org> Commit-Ready: Vincent Palatin <vpalatin@chromium.org>
* stm32f: Support hard resetVic Yang2012-07-191-6/+33
| | | | | | | | | | | | | | | | Now that we have hibernate ability, we can use this to perform a hard reset. BUG=chrome-os-partner:11579 TEST=Build success and working on 'snow': 'reboot' and see reset cause is 'reset-pin soft'. 'reboot hard' and see reset cause is 'hard'. Build success on 'daisy'. Change-Id: I18132eee2f0d574d7d1674f7be25249dbe19749d Signed-off-by: Vic Yang <victoryang@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/27930 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* stm32f: Add hibernate supportVic Yang2012-07-191-0/+74
| | | | | | | | | | | | | | | | | This adds hibernate support to stm32f. Watchdog can wake us but cannot be stopped unless system resets, so the longest time we can hibernate for now is about 26s. And wake from wake pin is not working. Nevertheless, we can use this for hard reset for now, and fix these problems later. BUG=chrome-os-partner:11579 TEST='hibernate 1' and see system wakes after 1 second. See reset cause is 'hibernate'. Change-Id: Iafa42012b59c12b70e18a7908c5d864c6e8bd2b4 Signed-off-by: Vic Yang <victoryang@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/27909 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* Add interface to charge_state for lightbarRandall Spangler2012-07-192-35/+58
| | | | | | | | | | | | Use these functions to get charging state and battery percent. Use power_ac_present() from power_button.h to find out if AC adapter is present. BUG=chrome-os-partner:8039 TEST=none Change-Id: Ied670c297be316b0b8fa56a450a1566470099b5b Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/27830
* stm32: Support backup registers and preseving reset flagsVic Yang2012-07-192-10/+59
| | | | | | | | | | | | | | | | | | | | This CL configures backup registers and add support of preseving reset flags in backup registers before rebooting. BUG=chrome-os-partner:11368 TEST=On snow there's always a reset-pin flag now, so test this with watchdog and soft reset. 1. reset with keyboard. flags -> reset-pin 2. trigger watchdog reset. flags -> reset-pin watchdog 3. 'reboot soft preserve' flags -> reset-pin watchdog soft 4. trigger watchdog reset. flags -> reset-pin watchdog 5. 'reboot soft' flags -> reset-pin soft Change-Id: I8b8a8abfbd69d8abb3386b188af73b9f662f4b38 Signed-off-by: Vic Yang <victoryang@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/27848 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* Disable keyboard backlight on suspend entryDuncan Laurie2012-07-191-0/+1
| | | | | | | | | | | | | | | | | | | | In theory this should be done by a kernel driver, but there is already a suspend hook so it is easy to have the EC turn off the backlight if it is not done by the host. BUG=none TEST=manual 1) boot Link device 2) log in and run 'powerd_suspend' 3) observe that keyboard backlight is turned off Change-Id: I10b83505d681f5b6d9cb32c1bef62dc21dd038e1 Signed-off-by: Duncan Laurie <dlaurie@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/27721 Reviewed-by: Randall Spangler <rspangler@chromium.org> Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* Add host command to exit force idle charge stateVic Yang2012-07-183-3/+41
| | | | | | | | | | | | | | | | | | | | | Currently the only way to exit force idle state is to unplug AC power. Let's add a host command to do so. Signed-off-by: Vic Yang <victoryang@chromium.org> BUG=chrome-os-partner:9716 TEST=# ectool chargeforceidle 0 - Check nothing happened # ectool chargeforceidle 1 - Power LED blinking green. Check current = 0. # ectool chargeforceidle 0 - Power LED back to yellow. Check charging. Change-Id: Ia8f504b6cf9f42b7d57af3ce2d240f3b00a095f1 Reviewed-on: https://gerrit.chromium.org/gerrit/27768 Reviewed-by: Randall Spangler <rspangler@chromium.org> Tested-by: Vic Yang <victoryang@chromium.org> Commit-Ready: Vic Yang <victoryang@chromium.org>
* Add new TMP006 sensorsVic Yang2012-07-182-3/+47
| | | | | | | | | | | | | | Signed-off-by: Vic Yang <victoryang@chromium.org> BUG=chrome-os-partner:11491 TEST=Build success. System still works fine except with error when reading currently non-existing sensors. Change-Id: I2fa1298ab11296f8b492534b5a8893588df34c82 Reviewed-on: https://gerrit.chromium.org/gerrit/27766 Reviewed-by: Randall Spangler <rspangler@chromium.org> Tested-by: Vic Yang <victoryang@chromium.org> Commit-Ready: Vic Yang <victoryang@chromium.org>
* Send hook notification on GAIA power eventVic Yang2012-07-181-0/+10
| | | | | | | | | | | | | | GAIA power module should send hook notification when power state changes. BUG=chrome-os-partner:11536 TEST=Hook a console message to HOOK_CHIPSET_SHUTDOWN and check this message is printed to console when system shuts down. Change-Id: I5bc3e69eeefeeda453526625887f852b9095ac08 Signed-off-by: Vic Yang <victoryang@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/27814 Reviewed-by: Randall Spangler <rspangler@chromium.org>