summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
* | Merge "stm32: use level interrupt instead of edge"Vincent Palatin2012-05-305-11/+11
|\ \
| * | stm32: use level interrupt instead of edgeVincent Palatin2012-05-305-11/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Using low level trigger interrupt rather than falling edge is more robust since we avoid detecting glitches or missing interrupts. This is backward compatible with the AP software expecting falling edge. Signed-off-by: Vincent Palatin <vpalatin@chromium.org> BUG=chrome-os-partner:8869 TEST=On Daisy, check we can still enter text in U-Boot console and Chrome browser (and check interrupt count increase as expected). Change-Id: Ide2b27f9129173530d137b5d70d998ebd8f8e669
* | | Merge "Add basic SPI support to link"Gerrit2012-05-308-0/+221
|\ \ \ | |/ / |/| |
| * | Add basic SPI support to linkRandall Spangler2012-05-308-0/+221
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds SPI transaction support, and a debug command to read a few values from the SPI EEPROM. Note that the SPI controller is normally *disabled* with all its I/Os high-Z, so this will not interfere with main processor or Servo on the SPI bus. The bus is only enabled during the SPIROM command itself. BUG=chrome-os-partner:7844 TEST=manual 1) Reboot system 2) on EC console, 'spirom'. Should print Man/Dev ID : 0xef 0x16 JEDEC ID : 0xef 0x40 0x17 Unique ID : 0xd1 0x61 0x44 0xb0 0x63 0x5d 0x40 0x32 Status reg 1: 0x00 Status reg 2: 0x00 Note that unique ID is, well, unique, so it won't match my value. But it should still be something not all 0xff's. 3) Power on the system. x86 should still boot normally, indicating that the EC isn't interfering with the SPI bus. Change-Id: I53bf5fdbbe7a37949375d0463e30e408cc6fb6a8
* | | Merge "stm32f: update flash write size"Gerrit2012-05-301-2/+2
|\ \ \ | |/ / |/| |
| * | stm32f: update flash write sizeDavid Hendricks2012-05-291-2/+2
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This CL updates the constant FLASH_WRITE_BYTES to 64 and modifies the decrement value in the flash_physical_write() loop. The constant value was changed so that it would agree with EC_FLASH_SIZE_MAX which is the size of the data payload. FLASH_WRITE_BYTES is provided as part of EC_CMD_FLASH_INFO, so programs which query size this way will can take advantage of 64-byte writes. The decrement value in the loop did not actually change in value, but instead uses the size of the half-word. Signed-off-by: David Hendricks <dhendrix@chromium.org> BUG=none TEST=Tested on Lucas Change-Id: If335bd8e11db0acc6464dcdef819d91f61ae0890
* | ec: Remove *.dis from default target.Hung-Te Lin2012-05-301-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | *.dis files can always be generated by *.elf files, so we can remove it from default build targets, and only generate that on demand (make dis). This also speeds up building time from 6.637s to 4.9s. BUG=chromium-os:31379 TEST=emerge-link chromeos-ec make # no *.dis make dis # get *.dis Change-Id: Ibc5305501ae72a0733f401863ea1d4c1f17aa34f Signed-off-by: Hung-Te Lin <hungte@chromium.org>
* | Improve the timeout when running on non-Google EC boards.Louis Yung-Chieh Lo2012-05-301-2/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The udelay() has big overhead so that repeating calling leads big errors (expect 1 sec of timeout, but actually 12 secs of timeout). So, the improvement is to double the udelay count when BUSY bit is set. Even better, if we can check the I/O port content before really running the EC command, it can save more time. BUG=chrome-os-partner:10003 TEST=tested on link, alex, zgb, lumpy, stumpy and mario. Only mario takes 1 second to timeout. Others stop when checking ports (takes around 0.01 second). Change-Id: I96c6d8cbe6226d05428a2ab126815e934942f5a9 Signed-off-by: Louis Yung-Chieh Lo <yjlou@chromium.org>
* | Merge "Add host command to simulate key press"Gerrit2012-05-293-0/+66
|\ \
| * | Add host command to simulate key pressVic Yang2012-05-293-0/+66
| |/ | | | | | | | | | | | | | | | | | | | | In order to enable automatic keyboard testing, let's add key press simulating command to ectool. BUG=chrome-os-partner:9188 TEST='ectool kbpress 4 6 1' and see 'j' pressed. 'ectool kbpress 4 6 0' and see 'j' released. Change-Id: I5a445e13aad2bd09aa6e9a1d62995cf34b782aeb
* | Merge "Jump to RAM before entering hibernate"Gerrit2012-05-291-7/+18
|\ \
| * | Jump to RAM before entering hibernateRandall Spangler2012-05-291-7/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Works around LM4 errata where EEPROM access is unstable while powering down. Signed-off-by: Randall Spangler <rspangler@chromium.org> BUG=chrome-os-partner:9996 TEST=hibernate 1 Change-Id: I99d21ec8ab5a06fb0972edebec3cc58ca9f60fa9
* | | Merge "Use correct EEPROM timeout"Gerrit2012-05-291-7/+18
|\ \ \ | |/ / |/| |
| * | Use correct EEPROM timeoutRandall Spangler2012-05-291-7/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Randall Spangler <rspangler@chromium.org> BUG=chrome-os-partner:10200 TEST=manual eeread 2 0 --> note original value eewrite 2 0 0x1234 eeread 2 0 --> should be 0x1234 eewrite 2 0 (original value) eeread 2 0 --> should be original value again Change-Id: Ibb72426663122b22b2bfe87c821c374eab334450
* | | Merge "usleep() chains to udelay() if called before task_start()"v1.1.0Gerrit2012-05-293-6/+26
|\ \ \ | |/ /
| * | usleep() chains to udelay() if called before task_start()Randall Spangler2012-05-293-6/+26
| |/ | | | | | | | | | | | | | | | | | | | | ...so I can use usleep() for eeprom delays in the CL coming next... Signed-off-by: Randall Spangler <rspangler@chromium.org> BUG=chrome-os-partner:10200 TEST=if it boots, it worked Change-Id: I564578f24452a4ac39abe79ff28cfff4b665ad2f
* | Merge "Add a way to set indiviual sensitivity factor for each TMP006 sensor"Gerrit2012-05-293-5/+9
|\ \ | |/ |/|
| * Add a way to set indiviual sensitivity factor for each TMP006 sensorVic Yang2012-05-283-5/+9
| | | | | | | | | | | | | | | | | | | | | | | | Each TMP006 temperature sensor has different sensitivity factor. Let's add a field to set different sensitivity factor for each sensor. Also update the factors to get more reasonable temperature readings, but still need more precise calibration. BUG=chrome-os-partner:9599 TEST=Build and read tempearture succeeded. Change-Id: Ib4feea3b78b71f6d37c9a02668ffa7bd9e63d390
* | Fix temperature comparison issue in discharging stateRong Chang2012-05-281-6/+8
|/ | | | | | | | | | | | | | When discharging, EC checks if battery temperature is in working range. The battery pack module should provide the working range in deci-Kelvin, not Celcius. Signed-off-by: Rong Chang <rongchang@chromium.org> BUG=chrome-os-partner:9485 TEST=manual Unplug AC adapter, and check /sys/class/power_supply/BAT0/charge_now Change-Id: Ib6a312941cb1f3622c6f18d2c58bc50a06feafaf
* Make ectool correctly report when keyboard backlight is offVic Yang2012-05-265-1/+15
| | | | | | | | | | | When keyboard backlight is disabled, make 'ectool pwmgetkblight' reports 'disabled'. BUG=chrome-os-partner:9966 TEST='ectool pwmgetkblight' shows 'Keyboard backlight disabled' when lid closed. Change-Id: Ica690159e30431ccb530275fcc2311fb8f54a9aa
* Add system_is_locked() to prevent sysjump on consumer systemsRandall Spangler2012-05-257-57/+123
| | | | | | | | | | | | | | | | | | | | | | | | | | | This returns true when both HW and SW write protect are enabled. Once WP is enabled, sysjump will be locked out. system_is_locked() can be used to gate other dangerous-ish commands too. Signed-off-by: Randall Spangler <rspangler@chromium.org> BUG=chrome-os-partner:7468 TEST=manual sysinfo -> unlocked, copy A sysjump B -> works flashwp lock reboot (make sure flashinfo shows WP asserted and flash locked; note there is a HW bug on proto1 which makes this flaky) sysinfo -> locked, copy A sysjump B -> fails (remove WP screw) reboot hard flashwp unlock Change-Id: I849b573675c2c1cb4c44b9a05d6973e38247ca23
* Better help for console commandsRandall Spangler2012-05-2533-266/+495
| | | | | | | | | | | | | | | | | | | | 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
* Merge "Add mmapinfo command to power_button.c"Gerrit2012-05-251-0/+22
|\
| * Add mmapinfo command to power_button.cBill Richardson2012-05-251-0/+22
| | | | | | | | | | | | | | | | BUG=none TEST=none Change-Id: Id6ced0b87b354136e0b80026a537958586bb1325 Signed-off-by: Bill Richardson <wfrichar@chromium.org>
* | Merge "stm32: fix keyboard FIFO"Gerrit2012-05-252-13/+12
|\ \
| * | stm32: fix keyboard FIFOVincent Palatin2012-05-252-13/+12
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | When the FIFO is empty, returns the last read entry not the next one. also rewrite the FIFO index increment to generate slightly better code. Signed-off-by: Vincent Palatin <vpalatin@chromium.org> BUG=chrome-os-partner:8869 TEST=On Snow, in U-Boot using "stdin=mkbp-keyb" type on internal keyboard and see the correct text. Change-Id: I189d230053de40dd563ce672db82dd6217e545e3
* | Merge "Cleanup - includes go in include dir"Gerrit2012-05-253-2/+1
|\ \
| * | Cleanup - includes go in include dirRandall Spangler2012-05-253-2/+1
| |/ | | | | | | | | | | | | | | | | Signed-off-by: Randall Spangler <rspangler@chromium.org> BUG=none TEST=if it builds, it works Change-Id: I2064f3eed4790051312a5a53ef742dcf79c4ee9d
* | Init task contexts/stacks at runtimeVincent Palatin2012-05-252-29/+42
|/ | | | | | | | | | | | | Instead of storing task contexts in .data and wasting several kB of flash with mostly 0s, move them to .bss and fill the initial context at EC startup. The runtime overhead is small enough. Signed-off-by: Vincent Palatin <vpalatin@chromium.org> BUG=chrome-os-partner:9839 TEST=run on Link and check verified boot and chromeOS startup are OK. Change-Id: Iaef23d46a4e3e80e49886dfbf7ab1f537c587362
* Merge "Fix disabling columns when power button is pressed"Gerrit2012-05-251-31/+23
|\
| * Fix disabling columns when power button is pressedRandall Spangler2012-05-241-31/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This works around a problem where columns are not tri-stated when calling select_column(COLUMN_ASSERT_ALL) with enable_scanning=0. Also removes polling for power button released; we can use the same task wait for that as we do for a keypress. Signed-off-by: Randall Spangler <rspangler@chromium.org> BUG=chrome-os-partner:7486 TEST=manual 1) press g then press power button repeatedly. EC is not rebooted. 2) press power button the g repeatedly. EC is not rebooted. 3) press power+refresh (or ESC on proto1). EC is rebooted. Change-Id: I43a0beae1a6c0ef8fa9379a8fff47b6006e63c8c
* | Merge "Add I2C host communication"Gerrit2012-05-242-0/+214
|\ \
| * | Add I2C host communicationVincent Palatin2012-05-242-0/+214
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Allow to use EC tool on ARM based platforms. Signed-off-by: Vincent Palatin <vpalatin@chromium.org> BUG=None TEST=On Daisy, ectool version Change-Id: If7f52de827d0bcffb39af0553245cce4e02b9b48
* | | Merge "Split communication functions from host tools"Gerrit2012-05-246-170/+155
|\ \ \ | |/ /
| * | Split communication functions from host toolsVincent Palatin2012-05-246-170/+155
| |/ | | | | | | | | | | | | | | | | | | | | | | Preparatory work to re-use the tools on ARM boards using I2C communications. Signed-off-by: Vincent Palatin <vpalatin@chromium.org> BUG=None TEST=make BOARD=link && make BOARD=bds && make BOard=DAISY Change-Id: I31d41f30c3231a4a9349b939bf6bba871ed4c383
* | Enable brown-out resetRandall Spangler2012-05-242-0/+4
|/ | | | | | | | | | | This resets the EC when power falls below the brown-out threshold Signed-off-by: Randall Spangler <rspangler@chromium.org> BUG=chrome-os-partner:9952 TEST=hopefully srikanth can; requires hardware mods to test. Change-Id: I161e49003409cb68eb43303c3c8de0eb4cc27104
* Fix I2C port frequency calculationRandall Spangler2012-05-241-6/+38
| | | | | | | | | | | | | | | | | | Also fix 'i2cscan' output, and detect/ignore busy ports Signed-off-by: Randall Spangler <rspangler@chromium.org> BUG=chrome-os-partner:9928 TEST=manual 1) check i2cscan i2cscan -> thermal port should report busy gpioset enable_vs 1 i2cscan -> thermal port should show 4 devices 2) probe EC_SMB_CK[012] signals to verify clock frequency Change-Id: I52e165de77eb9ed2619d648d84f251152772fe1c
* Merge "Add a way to pass in define flag when 'make'"Gerrit2012-05-241-1/+1
|\
| * Add a way to pass in define flag when 'make'Vic Yang2012-05-241-1/+1
| | | | | | | | | | | | | | | | | | | | In order to pass in different config from ebuild and enable easier debugging/testing, let's add a way to pass in define flags to make. BUG=chrome-os-partner:9936 TEST='V=1 EXTRA_CFLAGS=-DFACTORY_MODE make' and see '-DFACTORY_MODE'. Change-Id: I18dc5a3dc61bda1e63e96081def3f077ba431938
* | Update backlight in lid open/close funcsRandall Spangler2012-05-241-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ...so lidopen/lidclose debug command also update the backlight Signed-off-by: Randall Spangler <rspangler@chromium.org> BUG=chrome-os-partner:9188 TEST=manual: powerbtn -> boot system, display backlight on kblight 100 -> keyboard backlight on lidclose -> backlights off lidopen -> backlights on Change-Id: I0d092d3061ba8a00c8790b3d1b8380eecd2d1628
* | Merge "Keyboard scan must stop driving columns when power button is pressed."Gerrit2012-05-237-16/+58
|\ \
| * | Keyboard scan must stop driving columns when power button is pressed.Louis Yung-Chieh Lo2012-05-247-16/+58
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Tristage all columns as soon as possible right after the power button is pressed. This can avoid the silego chip to reset the EC. Resume the interrupt mode after power button is released so that the deasserted columns doesn't trigger EC reset. Also change some function names for export. BUG=chrome-os-partner:7486 TEST= press g first, then power button. repeat many times. system is not rebooted. press power button first, then g. repeat many times. system is not rebooted. ESC+power is still reseting system. The long press power button still shutdowns system. Change-Id: Ie5dec20ec3d3c4ffbd4acf5a4dd7f63eec38af56
* | Merge "Handle multiple pending lightbar events."Gerrit2012-05-231-29/+44
|\ \ | |/ |/|
| * Handle multiple pending lightbar events.Bill Richardson2012-05-221-29/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | Since the events are requests for new patterns, we only want to do the latest one. This does that. BUG=chrome-os-partner:9349 TEST=none No test: multiple events are rare. I had to fake them to see the problem. Change-Id: I7e7de94655576e16c442a97097a7303e422a551a Signed-off-by: Bill Richardson <wfrichar@chromium.org>
* | Merge "stm32: try to be more robust against malformed commands"Gerrit2012-05-221-6/+21
|\ \
| * | stm32: try to be more robust against malformed commandsVincent Palatin2012-05-231-6/+21
| |/ | | | | | | | | | | | | | | | | | | | | Timeout properly when the AP doesn't want our bytes. Signed-off-by: Vincent Palatin <vpalatin@chromium.org> BUG=chrome-os-partner:8865 TEST=On Snow, boot with an old kernel. Change-Id: Iac4fa5c3606f2e8731927326fad291dae26a615c
* | Merge "Add EC command to report board version"Gerrit2012-05-222-0/+19
|\ \ | |/ |/|
| * Add EC command to report board versionVadim Bendebury2012-05-222-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The main CPU might need to know the particular hardware version the system is running on. This information is available to the EC, this change adds a mechanism for the main CPU to request this information. The board version is defined as a flat 16 bit number. BUG=chrome-os-partner:8722 TEST=manual . this change was tested in concert with the appropriate coreboot modification, the proto1 board returns board version of 0. The code was modified manually to return a one off version - and the coreboot indeed observed board version of 1 Change-Id: If434d33f43783b18cb202ea15819bd5804694b8e Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
* | Merge "stm32: ensure I2C properly behave after sysjump"Gerrit2012-05-221-0/+6
|\ \
| * | stm32: ensure I2C properly behave after sysjumpVincent Palatin2012-05-221-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Sometimes when requesting a sysjump from the AP, the I2C bus gets wedged. Ensure we restore it in a proper state during the driver initialization. Signed-off-by: Vincent Palatin <vpalatin@chromium.org> BUG=chrome-os-partner:8865 TEST=On Snow, use flashrom to program the EC. Change-Id: I6279afba2bdeed4473ace42220a0342c4addaf1d