summaryrefslogtreecommitdiff
path: root/common
Commit message (Collapse)AuthorAgeFilesLines
* Merge "More debug command cleanup to save space"Gerrit2012-05-215-122/+79
|\
| * More debug command cleanup to save spaceRandall Spangler2012-05-215-122/+79
| | | | | | | | | | | | | | | | | | | | (saves another 1.5KB) BUG=none TEST=(run the commands) Change-Id: Id3ca58528fa68a4cec606edf2b98b9af38ac228f Signed-off-by: Randall Spangler <rspangler@chromium.org>
* | Add host command to read temperature sensor infoVic Yang2012-05-222-1/+38
|/ | | | | | | | | | | In order to perform testing across all future boards and enable easier debugging, we need a host command to read temperature sensor name and sensor type. BUG=chrome-os-patner:9836 TEST='ectool tempsinfo 0' shows sensor name and its type. Change-Id: I06d9c6b045902394179c35e2ee8bc8dc551e8e98
* Clean up debug commands to use less spaceRandall Spangler2012-05-212-67/+34
| | | | | | | | BUG=none TEST=(run the commands) Change-Id: I6ed4aee169311825190bcc386b86cdc32ba0866a Signed-off-by: Randall Spangler <rspangler@chromium.org>
* Add LM4 support for hard resetRandall Spangler2012-05-211-5/+13
| | | | | | | | | | | | (And add STM32 support for disabling interrupts before reset, which got missed before.) Signed-off-by: Randall Spangler <rspangler@chromium.org> BUG=chrome-os-partner:7470 TEST=from console, "reboot", then "reboot hard" Change-Id: Ib98792abc0c91a01e2230b419fc876052380655a
* Merge "Fix a bug that 'ectool thermalget' silently fails"Gerrit2012-05-212-5/+10
|\
| * Fix a bug that 'ectool thermalget' silently failsVic Yang2012-05-212-5/+10
| | | | | | | | | | | | | | | | | | | | 'ectool thermalget' should return error if sensor ID or threshold ID is out of range. This CL fixes a bug that error codes mismatch. BUG=chrome-os-partner:9840 TEST='ectool thermalget 0 10' gives error. Change-Id: I74d0c66044cd31743c4fac0a8dc0431db6259e71
* | Merge "Use common host command processing for Daisy I2C"Gerrit2012-05-213-94/+3
|\ \ | |/ |/|
| * Use common host command processing for Daisy I2CVincent Palatin2012-05-183-94/+3
| | | | | | | | | | | | | | | | | | | | | | | | This also updates the communication protocol between the EC and the AP in a non backward compatible way. Signed-off-by: Vincent Palatin <vpalatin@chromium.org> BUG=chrome-os-partner:9614 TEST=on Daisy with updated kernel driver, use the keyboard in ChromeOS Change-Id: I5a50e9a74b9891153a37ea79318c8a66a1b0c5ca
* | Fix flash base in full image ELFVincent Palatin2012-05-191-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the flash base address is non null (e.g. stm32), it's nice to have the full ELF image (including the 3 copies) at the right address. This doesn't change anything to the final .bin image but allow to load directly the .obj with tools which handle ELF format. Signed-off-by: Vincent Palatin <vpalatin@chromium.org> BUG=None TEST=Flash ec.obj on a Snow board using the ST-Link JTAG over GDB. Change-Id: I51a6d9c00b359c6204bd51b30ee7a4fec362d88e
* | stm32: keep power across sysjumpVincent Palatin2012-05-181-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Ensure we can jump between EC images without powering down the GAIA AP : - preserve GPIO state - go back to "power-on" state if needed in GAIA state machine. Signed-off-by: Vincent Palatin <vpalatin@chromium.org> BUG=chrome-os-partner:8865 TEST=On Daisy, boot Linux, then type "sysjump B" and observed we can still interact with Linux without any AP reboot. Change-Id: Ia2bd0f65ea348813b120bcc3a3f3bdfa96a9877a
* | Fix partition address when flash base is not zeroVincent Palatin2012-05-181-3/+3
|/ | | | | | | | | | | | | On chips where CONFIG_FLASH_BASE is not 0 (e.g. stm32), the reset vector address check in system_run_image_copy would fail because we are comparing an absolute address against a flash offset. Signed-off-by: Vincent Palatin <vpalatin@chromium.org> BUG=chrome-os-partner:8865 TEST=on Daisy, type "sysjump B" in EC console. Change-Id: Ib79677fb926a37fcf32f4aac013dc36b086f4464
* Merge "Preserve USB port state when jumping"Gerrit2012-05-171-3/+38
|\
| * Preserve USB port state when jumpingVic Yang2012-05-171-3/+38
| | | | | | | | | | | | | | | | | | | | USB ports are disabled after jumping between firmware copies. We need to record USB port state and restore them after jumping. BUG=chrome-os-partner:9692 TEST=Manual Change-Id: Ic5cb83bdd8e49017457f732d317a1b59ced59ead
* | Disable unused BDS functionalityRandall Spangler2012-05-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | This was used on the hybrid Badger-Lumpy systems for one-off testing. It wouldn't necessarily work on a bare Badger board, and maintaining it resulted in frequent build breaks. Signed-off-by: Randall Spangler <rspangler@chromium.org> BUG=none TEST=build link, bds, daisy; boot link and bds Change-Id: Ib64ccad9f38d76832ab57f7254dbf32f3d5e4a5e
* | Add AC state change hookRandall Spangler2012-05-173-8/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | And start wiring to x86_power so it can detect AC state changes (needed to enable/disable turbo). *YES*, this compiles for BDS/Daisy now... Signed-off-by: Randall Spangler <rspangler@chromium.org> BUG=chrome-os-partner:9069 TEST=plug/unplug AC power and look for "x86 AC on" / "x86 AC off" in debug log Change-Id: I8399fab9637d6635a1c615f07448fd45b86bc25f
* | Fix some behaviors of keyboard command handlers.Louis Yung-Chieh Lo2012-05-172-23/+100
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The phenomenon is that there is a char on-hold in port 0x60 and the kernel never picks it up. Hence the keyboard cannnot be recognized after resume. It comes from multiple reasons: 1. The command I8042_CMD_RESET_BAT(0xff) and I8042_CMD_ENABLE(0xf4) didn't clean the buffer. 2. clean_underlying_buffer() has clean the queue, but forgot to clean the TOH (TO Host). Add keyboard_clean_buffer() to clean the TOH (To Host). 3. When KB interrupt is just enabled, the IRQ didn't sent if there is a char queued in buffer already. keyboard_resume_interrupt() solves this. 4. Not all keyboard reset should reset the buffer. Only the enable/disble of controller RAM should NOT reset buffer. Other enable/disable should clean the buffer. 5. i8042 commands (those commands to port 0x64) should NOT return ACK even the parameter byte(s) goes to port 0x60. 6. Keyboard was disabled by kernel, but key stroke still sent to host (this needs the BIOS to fix). Also fix the minor issues: 1. I8042_CMD_RESEND should not return I8042_RET_ACK. 2. I8042_DIS_KB/I8042_ENA_KB should effect the controller RAM content. 3. only send out the scan code when keyboard is enabled. 4. add kblog command for future debug (disabled by default because it neeeds 1KB of memory). Signed-off-by: Louis Yung-Chieh Lo <yjlou@chromium.org> BUG=chrome-os-partner:9525 TEST=tested on link. Start from S0. 1. Run powerd_suspend. 2. Expect system is in S3. 3. Press any key to wake up system. 4. Expect system is up and keyboard is working. 5. repeat for 20+ times. Change-Id: I1c48822687d7c1f7ef0e8d8bca54bf9b05fd785f
* | de-LPCify the EC host interfaceVincent Palatin2012-05-1513-247/+246
| | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | Enable vboot for BDS too.Bill Richardson2012-05-151-10/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The recovery switch is the DOWN button. BUG=none TEST=manual Install on BDS, open console. Press the reset button, it should boot to firmware A. Hold the DOWN button, press the reset button. It should stay in RO. Change-Id: I82f72a56df463c7cc67bde7e09f3be1545c76129 Signed-off-by: Bill Richardson <wfrichar@chromium.org>
* | Sort console commands at build timeVincent Palatin2012-05-151-21/+4
| | | | | | | | | | | | | | | | | | | | | | | | Use the linker to sort console commands by name, this saves execution time and memory. BUG=none TEST=generate several images with 5N, 5N+1, 5N-1 commands and check the output of the "help" command. Change-Id: Ib5d8f3bca726621c68ab152f4fa662cee355abb1 Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
* | Merge "Arrange help output to sort 'column first'"Gerrit2012-05-141-25/+31
|\ \
| * | Arrange help output to sort 'column first'Vadim Bendebury2012-05-141-25/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Sort the command name index, and then print them in file columns (as before), but ordering columns first. This makes it much easier to examine the 'help' command output. BUG=none TEST=manual . program the new image . execute the 'help' command . observe output printed sorted 'columns first' Change-Id: I7b15cef09a61fe20eb4ba5ee274ba1d72063f1c0 Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
* | | Merge "Slightly update the host commands API"Gerrit2012-05-149-45/+83
|\ \ \
| * | | Slightly update the host commands APIVincent Palatin2012-05-149-45/+83
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | Merge "Change polarity of PROCHOT signal to match EVT"Gerrit2012-05-142-2/+22
|\ \ \
| * | | Change polarity of PROCHOT signal to match EVTRandall Spangler2012-05-142-2/+22
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This would throttle proto1 systems, if it weren't for a HW bug which means we don't have prochot control over proto1 systems at all. Signed-off-by: Randall Spangler <rspangler@chromium.org> BUG=chrome-os-partner:8982 TEST=system still boots Change-Id: Ie42c034141f24795ec2bfee592e194001d3cd174
* | | Fix charging task running too frequentlyRandall Spangler2012-05-141-7/+12
|/ / | | | | | | | | | | | | | | | | Signed-off-by: Randall Spangler <rspangler@chromium.org> BUG=none TEST=taskinfo; note that number of IRQ8 (I2C0) exceptions goes up more slowly Change-Id: Ib93aaab80fdd19b7a35aec43903393baf506f2e8
* | Merge "Allow console commands abbreviation"Gerrit2012-05-143-9/+29
|\ \
| * | Allow console commands abbreviationVadim Bendebury2012-05-143-9/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The EC console input handling code is being enhanced to accept abbreviated command names. If the abbreviation is unique, the appropriate command is used, if the abbreviation is ambiguous, the command is handled as nonexistent. The error message is being modified to mention that the command either does not exist or is ambiguous. This change also makes it impossible to have command names matching the beginning of other command names. Two such cases are being fixed (`ch' renamed to `chan' and `thermal' renamed to 'thermalconf'). BUG=none TEST=manual . program the new EC image. Try entering at the console: > h Command 'h' either not found or ambiguous. Command returned error 1 > he Known commands: adc autofan battery ch charger ... > help Known commands: adc autofan battery ch charger ... Change-Id: Iaa3e91e1504e42daefb02d561e00c39003548197 Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
* | | daisy: Refactor the power taskSimon Glass2012-05-141-87/+236
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a set of functions to deal with power on/power off, and checking the power button. Then use these functions in a new top-level power control loop. This implements the following features: - Cold reset powers off the AP When powered off: - Press pwron turns on the AP - Hold pwron turns on the AP, and then 16s later turns it off and leaves it off until pwron is released and pressed again When powered on: - The PMIC PWRON signal is released one second after the power button is released (we expect that U-Boot as asserted XPSHOLD by then) - Holding pwron for 8s powers off the AP - Pressing and releasing pwron within that 8s is ignored - If XPSHOLD is dropped by the AP, then we power the AP off BUG=chrome-os-partner:9424 TEST=very ad-hoc: 1. build and boot on daisy, flash U-Boot with USB using 'cros_bundle_firmware -w usb', inserting daisy USB cable when it says 'Reseting board via servo...' 2. Press cold reset, then power on, see that it powers on 3. Then hold power-on for 8 seconds and see that it power off 4. XPSHOLD function not tested yet (this should work in Daisy 2) Change-Id: Ie471af0b4e690de7d6340e47e148c8ce3cda94f3 Signed-off-by: Simon Glass <sjg@chromium.org>
* | daisy: Deal with no-timeout explicity in wait_in_signal()Simon Glass2012-05-141-10/+17
|/ | | | | | | | | | | | | | | | | | This function accepts a timeout value of -1, so add a comment to that effect. Also make it deal with this explicitly since the current function seems to return prematurely in that case. BUG=chrome-os-partner:9424 TEST=very ad-hoc: 1. build and boot on daisy, flash U-Boot with USB using 'cros_bundle_firmware -w usb', inserting daisy USB cable when it says 'Reseting board via servo...' 2. Press cold reset, then power on, see that it powers on 3. Then hold power-on for 8 seconds and see that it power off 4. XPSHOLD function not tested yet Change-Id: I01bd81997836333ca33e61d48823e8ff41034d5f Signed-off-by: Simon Glass <sjg@chromium.org>
* Maintain timer value across sysjumps and clean up init debug outputRandall Spangler2012-05-113-20/+28
| | | | | | | | | | | This helps us keep track of how long vboot is taking on the EC. Signed-off-by: Randall Spangler <rspangler@chromium.org> BUG=chrome-os-partner:9651 TEST=reboot system and look at debug log. time shouldn't start over after it jumps to image A. Change-Id: Iad86e90d42dabf1c67b2c2be80dda1151cf9a288
* Call timer_init() before other interrupts are initializedRandall Spangler2012-05-111-5/+7
| | | | | | | | | | Signed-off-by: Randall Spangler <rspangler@chromium.org> BUG=chrome-os-partner:9647 TEST=hack code to put a uart_puts() immediately following uart_init() It shouldn't crash. Change-Id: Ia1867a631934dbd457a23183010fdf9f5c284873
* Enable verified boot for EC firmwareBill Richardson2012-05-105-20/+332
| | | | | | | | | | | | | | | | | | | | BUG=chrome-os-partner:7459 TEST=manual In the chroot: cd src/platform/ec make BOARD=link The firmware image (build/link/ec.bin) is signed with dev-keys. Reflash the EC and try it, and it should verify and reboot into RW A. Additional tests (setting USE_RO_NORMAL, poking random values into VBLOCK_A or FW_MAIN_A to force RW B to run, etc.) are left as an exercise for the reader. I've done them and they work, though. Change-Id: I29a23ea69aef02a11aebd4af3b043f6864723523 Signed-off-by: Bill Richardson <wfrichar@chromium.org>
* Use open drain reset signals, and clean up signals to 5VALW-powered devicesRandall Spangler2012-05-103-32/+35
| | | | | | | | | | | | | | | | | | | | | | Open drain cleanup minimizes leakage and signal glitching on shared reset/signal lines, and is tidier than explicitly switching the signals between inputs/outputs. Touchscreen and lightbar are powered by +5VALW so their signals need to be dropped when +5VALW is off to avoid leakage, and so they see a clean reset signal when they're powered up. Moved +5VALW power-on to S5-S3 transition, to minimize power draw in S5. This also ensures that 5VALW-powered devices get reset when the device bounces through S5. (No effect on proto1, where 5VALW is not under EC control.) Signed-off-by: Randall Spangler <rspangler@chromium.org> BUG=chrome-os-partner:9172 TEST=boot and shutdown system; still works. Change-Id: Ia4bf0703292a189c324ce283d1e79a33776ee40f
* Allow boards to set the default console maskSimon Glass2012-05-101-6/+9
| | | | | | | | | | | | | | Some boards don't like to have every keyboard scan printed, but some devs find this info comforting. Add a way for boards to select the require console mask. BUG=none TEST=manual: build and boot on daisy, see that key scan messages are suppressed. build on all platforms Change-Id: I8e6e640eaabc0a08e5427cd97f7089dda1238025 Signed-off-by: Simon Glass <sjg@chromium.org>
* Fix truncated output from 'ch' commandRandall Spangler2012-05-101-0/+1
| | | | | | | | | Signed-off-by: Randall Spangler <rspangler@chromium.org> BUG=none TEST='ch' - prints all the channels now Change-Id: I38ebc3eed2476c44c26fc00d6ea79800ae427722
* Adjust fan speed control thresholdsVic Yang2012-05-101-3/+3
| | | | | | | | | | | | | This CL set higher temperature thresholds for CPU temperature to reduce fan noise. Also set temperature thresholds for case temperature so that we can adjust fan speed according to them. Signed-off-by: Vic Yang <victoryang@chromium.org> BUG=chrome-os-partner:8982 TEST=Manual Change-Id: I16a74e10af4583a59065c09e8d9538232b0fb157
* Drop DPWROK when system is off for more than 10 secrelease-R20-2268.BRandall Spangler2012-05-093-68/+137
| | | | | | | | | | | | | | | | | | | | | | | | | | This saves ~70mw of power. To make this work, I also had to stretch the power button signal to give the system a chance to come back up when the user taps the power button. Signed-off-by: Randall Spangler <rspangler@chromium.org> BUG=chrome-os-partner:9574 TEST=manual For each of the following tests, wait ~15 sec after the system is powered off to give it a chance to drop DPWROK. 1) tap power button -> system turns on 2) hold power button 1 sec -> system turns on 3) open lid -> system turns on 4) silego reset (power+refresh, or power+esc on proto1) -> system stays off 5) silego recovery (power+esc+refresh) -> system turns on 6) hold down power button and type 'reboot' on EC console -> system turns on 7) type 'powerbtn' on EC console -> system turns on Change-Id: I781cf3e665104192521b7fb9ff75a3c3e7f43464
* Add hooks for chipset power transitionsRandall Spangler2012-05-094-40/+59
| | | | | | | | | | | | This is cleaner than having x86_power explicitly know about everything else in the system that cares about power transitions. Signed-off-by: Randall Spangler <rspangler@chromium.org> BUG=none TEST=boot and shutdown system; still works. Mouse powered to system is off in S5. Change-Id: Ib673ca2d9edd5473334e7604e98b99b02b768419
* Fix polarity of radio-disable GPIOsRandall Spangler2012-05-091-0/+4
| | | | | | | | | | | | Signed-off-by: Randall Spangler <rspangler@chromium.org> BUG=chrome-os-partner:8932 TEST=manual 1) gpioget with system off -> ENABLE_WLAN = 0, RADIO_ENABLE_* = 0 2) gpioget with system on -> ENABLE_WLAN = 1, RADIO_ENABLE_* = 1 Change-Id: I397a195b4539083c622b85d63703c334cae931fb
* Merge "stm32: add flash programming support"Gerrit2012-05-091-0/+5
|\
| * stm32: add flash programming supportVincent Palatin2012-05-091-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implements the on-chip flash erasing and writing functions. The actual writing is done from a routine in internal RAM (using the special .iram.text section) with interrupt disabled as we cannot read flash during the writing process. The write-protect feature is only lightly tested. Signed-off-by: Vincent Palatin <vpalatin@chromium.org> BUG=chrome-os-partner:8865 TEST=run on Daisy, from the EC console, use flasherase and flashwrite commands and observe the results using rw command. Change-Id: I4c64cf28b23df52b18500b42a32a7d3668d45ba6
* | Make CPU_PROCHOTn high-Z (input) unless we're driving it low.Randall Spangler2012-05-081-1/+2
| | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Randall Spangler <rspangler@chromium.org> BUG=chrome-os-partner:9563 TEST=manual Measure +3VALW power before and after change with system in S5. Should drop by ~50mW. Change-Id: I264694a80b2e558e46708de6ab1bfb146f79eb68
* | Add gpio_set_flags() and system_get_board_version()Randall Spangler2012-05-081-3/+40
| | | | | | | | | | | | | | | | | | Signed-off-by: Randall Spangler <rspangler@chromium.org> BUG=chrome-os-partner:9117 TEST=version; board version should be 0 on proto1 and 1 on EVT Change-Id: Ic64ad0d009151fbda09f5c1605ef50ae708cb6ae
* | Merge "Automatically switch USB charging mode"Gerrit2012-05-082-4/+31
|\ \ | |/ |/|
| * Automatically switch USB charging modeVic Yang2012-05-092-4/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | Disable USB ports when system is down and set USB ports to standard downstream mode when system is up or sleeping. Signed-off-by: Vic Yang <victoryang@google.com> BUG=chrome-os-partner:9249 TEST=Plug in a phone and see it charge when system is on. Turn off the system and see it stop charging. Change-Id: I02850dee7051ed6589e0f176a933069203f0efdf
* | Merge "Move gpio list into gpio.h header file"Gerrit2012-05-081-4/+0
|\ \
| * | Move gpio list into gpio.h header fileSimon Glass2012-05-081-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is referenced by various files, so should be in the gpio.h header. BUG=none TEST=manual: build and boot on daisy, see that USB download still works build on all platforms Change-Id: If579c975ef6c82988b9e411eeaa97c950d9efce4 Signed-off-by: Simon Glass <sjg@chromium.org>
* | | Add LPC lightbar command to get the current sequence.Bill Richardson2012-05-081-27/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of making the STOP command synchronous, we can just have the host-side app tell the EC to stop, then poll until it has. BUG=chrome-os-partner:9349 TEST=manual "make BOARD=link", then copy build/link/util/lbplay to the host and run it. Change-Id: I846924ae7994a498e0089197785cf239898fe2a3 Signed-off-by: Bill Richardson <wfrichar@chromium.org>