summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Clear OWNERS for factory/firmware branchfactory-samus-4788.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/+/3155094 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Owners-Override: Jora Jacobi <jora@google.com> Tested-by: Jack Rosenthal <jrosenth@chromium.org>
* bolt: Make fan min/max be the same as linkDuncan Laurie2013-10-051-2/+2
| | | | | | | | | | | | | | | The fan was not spinning enough to cool the system because it thought the max fan speed was 5000. BUG=none BRANCH=bolt TEST=build and boot on bolt, generate load and see that the fan comes on to a reasonable level to cool the system. Change-Id: Ifa5023534a6be8625abf7df7fa44aed649f4fabc Signed-off-by: Duncan Laurie <dlaurie@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/171969 Reviewed-by: Bill Richardson <wfrichar@chromium.org>
* samus: Add battery_is_connected checkBill Richardson2013-10-042-0/+11
| | | | | | | | | | | | | | | | | | | | | | | Copied from Bolt. This is so the 30-second wait when no battery is installed can be skipped. Note that if we ever decide to monitor the battery temp through the BAT_TEMP line, we'll have to rethink how battery_is_connected() is implemented, since we can't reliably treat that GPIO as both digital and analog simultaneously. BUG=chrome-os-partner:22870 BRANCH=none TEST=manual cd src/platform/ec make BOARD=samus make runtests Change-Id: Ifea952c8f99b2b40c2fab382e949958a2f71d157 Signed-off-by: Bill Richardson <wfrichar@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/171796 Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
* samus: alternate functions, chargerBill Richardson2013-10-043-15/+38
| | | | | | | | | | | | | | | | Adding some more board-specific configurations for Samus. BUG=chrome-os-partner:22870 BRANCH=none TEST=manual make runtests Change-Id: I86c909e899fb5bdb6ba75f476ced58bae2c75c29 Signed-off-by: Bill Richardson <wfrichar@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/171809 Reviewed-by: Duncan Laurie <dlaurie@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org>
* bolt: Add battery_is_connected checkDuncan Laurie2013-10-042-0/+11
| | | | | | | | | | | | | | | | | | | | This is so the 30 second wait when no battery is installed can be skipped. Since Bolt needs a complete AC+Battery disconnect when updating the BIOS this 30 second wait is aggravating. BUG=chrome-os-partner:20448 BRANCH=bolt TEST=disconnect AC+Battery, then connect AC and watch it boot without waiting for 30 seconds. Change-Id: Ibaf42fe1dba9c74aa465aa0a1a5381ba6981f66e Signed-off-by: Duncan Laurie <dlaurie@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/171689 Reviewed-by: Bill Richardson <wfrichar@chromium.org> Reviewed-by: Dave Parker <dparker@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org>
* Cleanup use of config.h macrosBill Richardson2013-10-049-21/+13
| | | | | | | | | | | | | | | | | | | | | | | | include/config.h should have the canonical list of all CONFIG_* macros used everywhere else. This fixes some that weren't included, and some that had been changed in one place but not in others. BUG=chrome-os-partner:18343 BRANCH=none TEST=manual Build everything. It should still work. cd src/plaform/ec make runtests for i in bds bolt daisy discovery falco kirby link mccroskey peppy pit puppy rambi samus slippy snow spring; do make BOARD=$i || touch died.$i; done There shouldn't be any died.* files. Change-Id: I0a1ec2d57668509c514dc5a521e547836a3e9894 Signed-off-by: Bill Richardson <wfrichar@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/171690 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* samus: First pass at GPIOsBill Richardson2013-10-023-135/+79
| | | | | | | | | | | | | | | | | | | This is the first attempt at wiring the GPIOs for Samus. More to come, of course. BUG=chrome-os-partner:22870 BRANCH=none TEST=manual The only thing we can check is that it compiles and doesn't break anything. cd src/platform/ec make BOARD=samus make runtests Change-Id: Ia9dc94c420c21551c5db3e28e749954cea3055a1 Signed-off-by: Bill Richardson <wfrichar@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/171528
* Fix typo: s/GPOI_/GPIO_/gBill Richardson2013-10-023-3/+3
| | | | | | | | | | | | | | | | Slippy, Peppy, and Falco should learn to spell. BUG=chrome-os-partner:18343 BRANCH=none TEST=manual make runtests Nothing uses this, it's just annoying to look at. Change-Id: I61e09fc6a804c1de972b34520db1db8f0b874dbe Signed-off-by: Bill Richardson <wfrichar@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/171567
* Internalize magic numbers for smart USB chargingBill Richardson2013-10-022-4/+4
| | | | | | | | | | | | | | | | | | | | | Link is the only platform that uses smart usb ports. Link's board.h defines USB_CHARGE_PORT_COUNT, yet the usb_port_power_smart.c file is peppered with assumptions that that constant is always 2. This moves the constant into usb_port_power_smart.c where it belongs. BUG=chrome-os-partner:18343 BRANCH=none TEST=manual make runtests Code refactoring only, no visible changes, Change-Id: Id45e11d88585a98348105b1399c7e18c554add50 Signed-off-by: Bill Richardson <wfrichar@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/171565 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* Always enable tpschrome low current chargingRong Chang2013-10-021-20/+4
| | | | | | | | | | | | | | | | | | | | | The PMU charger loop is conservative. And there is no need to set hardware low charging current termination. BRANCH=pit BUG=chrome-os-partner:22946 TEST=manual Discharge the battery to level < 40%. Issue console command 'pmu', check register 0x09 output. The NOITERM bit(5) should be set to 1. That means no low charging current termination. Signed-off-by: Rong Chang <rongchang@chromium.org> Change-Id: I45532dcaab3bab566407b209f26693e2c3451014 Reviewed-on: https://chromium-review.googlesource.com/170906 Reviewed-by: Hung-ying Tyan <tyanh@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org> Reviewed-by: Jaehoon Kim <jh228.kim@samsung.com> Tested-by: Jaehoon Kim <jh228.kim@samsung.com>
* lpc: Clean up processing wake eventsRandall Spangler2013-10-029-122/+18
| | | | | | | | | | | | | | | | | | | | | | Every board other than link does the same thing - filter out the power button event, then set the WAKE_L gpio level based on the remaining events. This code doesn't need to be duplicated 7 times, so make it common. Link didn't filter out the power button wake signal, but works fine with the common implementation. Like the other boards it gets a power button wake event via the dedicated PCH PWRBTN# signal. BUG=chrome-os-partner:18343 BRANCH=none TEST=suspend link, then wake using power button press compile all platforms; pass unit tests Change-Id: Ib3a6d310d0f5e337374b3c331ab2872fe377bdf6 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/171405 Reviewed-by: Alec Berg <alecaberg@chromium.org> Reviewed-by: Bill Richardson <wfrichar@chromium.org> Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
* bolt: Fix panel power passthruDuncan Laurie2013-10-023-2/+4
| | | | | | | | | | | | | | | | | The Bolt board does not use the standard CHIPSET_HASWELL and with a recent commit that meant haswell_interrupt() was defined to NULL and it would not turn on the panel power. BUG=chrome-os-partner:20372 BRANCH=bolt TEST=build and boot on bolt and see magic working panel Change-Id: I6174e2b4a8337acc2f395b8b2b18a00107661af1 Signed-off-by: Duncan Laurie <dlaurie@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/171112 Reviewed-by: Bill Richardson <wfrichar@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org> Commit-Queue: Randall Spangler <rspangler@chromium.org>
* lm4: Fix typo in eeprom codeRandall Spangler2013-10-011-2/+2
| | | | | | | | | | | | | | We don't use the EEPROM block on the LM4 chip, but if we ever do we'll want this off-by-one error fixed. BUG=chrome-os-partner:18343 BRANCH=none TEST=Build bds, since that's the only board which even compiles this code. Pass unit tests. Change-Id: I598f043cf00ebc1eca75fa6e6b7815d85a61e353 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/171141
* Clean up G781 temperature sensor power detectionRandall Spangler2013-10-0112-58/+35
| | | | | | | | | | | | | | | | | | This was previously done in a board-specific function across 4 boards. Except that the board-specific function was identical in all cases (that is, not really board-specific). Put it back in the common implementation to get rid of duplicated code, and use CONFIG_TEMP_SENSOR_POWER_GPIO to indicate which GPIO rail controls the sensor power. BUG=chrome-os-partner:18343 BRANCH=none TEST=build all boards; pass unit tests Change-Id: I29de40001d5d4dc873e5ba8f3abb328c6271f235 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/171140 Reviewed-by: Bill Richardson <wfrichar@chromium.org>
* Test more error cases of host command handlingVic Yang2013-10-011-2/+26
| | | | | | | | | | | | | | This adds tests of invalid command version and invalid command. BUG=chrome-os-partner:19236 TEST=Pass host_command test BRANCH=None Change-Id: I49ce1b4c8b31ef98d9ee8203e88adfa521471d6d Signed-off-by: Vic Yang <victoryang@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/170935 Reviewed-by: Bill Richardson <wfrichar@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org>
* Emulator support of fake GPIO inputVic Yang2013-10-019-119/+79
| | | | | | | | | | | | | | | | | | For all GPIOs, the current values are recorded. A test can then change the value of a GPIO input by gpio_set_level(). The changed value is recorded and also interrupt is fired if the change fits the interrupt flags defined in board/host/board.c. BUG=chrome-os-partner:19235 TEST=Pass all tests BRANCH=None Change-Id: If8e547e5adf4a20dcb118f5fe2187293005d4ca3 Signed-off-by: Vic Yang <victoryang@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/170907 Reviewed-by: Bill Richardson <wfrichar@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org> Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* Rewrite git/gerrit/gerrit-int urls to googlesourceAaron Gable2013-10-011-1/+1
| | | | | | | | | | | | | BUG=chromium:281665,chromium:290413 TEST=None BRANCH=none Change-Id: Iaf8a245c0aa3a2a1838b80dc5b8dd0c7d62b1551 Signed-off-by: Aaron Gable <agable@google.com> Reviewed-on: https://chromium-review.googlesource.com/171256 Reviewed-by: Mike Frysinger <vapier@chromium.org> Tested-by: Mike Frysinger <vapier@chromium.org>
* Create samus board configBill Richardson2013-09-308-2/+917
| | | | | | | | | | | | | | | | | | | This just does a copy/rename from Bolt. Tweaking for Samus' peculiarities will come next. BUG=chrome-os-partner:22870 BRANCH=none TEST=manual The only thing we can check is that it compiles: cd src/platform/ec make BOARD=samus Change-Id: Ied95ebdd1137548b21334b4a65a298c68482c517 Signed-off-by: Bill Richardson <wfrichar@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/171081 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* Wake keyboard task when lid opensRandall Spangler2013-09-301-0/+13
| | | | | | | | | | | | | | | | | | If keyboard scanning is active when the lid closes, it will disable scanning put the scan task to sleep. We need a corresponding task wake when the lid opens, or scanning will be stuck off (until something else happens, like poking the power button). BUG=chrome-os-partner:22190 BRANCH=peppy TEST=Hold down a key. Use a magnet to trigger the lid switch. Scanning should stop while the lid is "closed", and restart when the magnet is moved to "open" the lid again. Change-Id: I0a900f17f65b75cbdb45950cea7f50190d2bf9b1 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/170993 Reviewed-by: Bill Richardson <wfrichar@chromium.org>
* Battery command needs to delay between iterationsRandall Spangler2013-09-301-0/+8
| | | | | | | | | | | | | | | | | | The battery command takes a long time to run if given a high repeat count. Since it doesn't sleep at all between iterations by default, this will unsurprisingly starve all other tasks and cause a watchdog timeout. Reset the watchdog between iterations, to give the rest of the system time to do things. This is similar to what we do in the i2cscan command. BUG=chrome-os-partner:22232 BRANCH=none TEST=apshutdown, then battery 1000 = no watchdog Change-Id: I3ce55e15d90a6dfda34b1e2e332d7f7828922e78 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/170968
* Tool support for STM32L-Discovery boardJeremy Thorpe2013-09-282-2/+3
| | | | | | | | | | | | | | | Add the ChipID for the stm32l152c board to stm32mon. Add discovery to the list of supported boards in flash_ec. BUG=None TEST=With modified servo connector, see that image can be loaded onto stm32l152c discovery board. BRANCH=none Change-Id: Ie16c64d17c907f7de765b09de98f534c486ae04c Signed-off-by: Jeremy Thorpe <jeremyt@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/170981 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* basic support for STM32L-Discovery boardVincent Palatin2013-09-284-0/+129
| | | | | | | | | | | | | | | | | | Support for the basic development board built by STmicro with STM32L152 chip. Signed-off-by: Vincent Palatin <vpalatin@chromium.org> BUG=none TEST=See that LEDs can be driven from the console, button can be read. With additional print statement, see that button hook is called. BRANCH=none Change-Id: I494ab525f17e08b57595ee49489ade63b3305f2a Reviewed-on: https://chromium-review.googlesource.com/170920 Reviewed-by: Randall Spangler <rspangler@chromium.org> Commit-Queue: Jeremy Thorpe <jeremyt@chromium.org> Tested-by: Jeremy Thorpe <jeremyt@chromium.org>
* Support backlight control via lid onlyRandall Spangler2013-09-2715-22/+177
| | | | | | | | | | | | | | | | | | | | | The old backlight_x86 code did (backlight enable) = (lid is open) && (GPIO request from AP) Newer systems will AND those signals in hardware. Support those systems by separating CONFIG_BACKLIGHT_LID and CONFIG_BACKLIGHT_REQ_GPIO, and add tests for the case where the enable signal is dependent only on the lid position. BUG=chrome-os-partner:22960 BRANCH=none TEST=pass unit tests Change-Id: I1909426e49f00a8acd5047fd88c801cba1dacd76 Reviewed-on: https://chromium-review.googlesource.com/170925 Tested-by: Randall Spangler <rspangler@chromium.org> Reviewed-by: Bill Richardson <wfrichar@chromium.org> Commit-Queue: Randall Spangler <rspangler@chromium.org>
* Add a test for x86 backlight passthroughVic Yang2013-09-277-1/+169
| | | | | | | | | | | | | | | | | This checks x86 backlight passthrough by toggling lid switch and PCH backlight output, and also by host command. Also fix a bug that backlight switch host command can never be invoked due to incorrect version mask. BUG=chrome-os-partner:19236 TEST=util/make_all.sh BRANCH=None (unless some platform needs backlight switch host command) Change-Id: Iefc5f4b7387c4d2aa43059d073bd70aed879fe34 Signed-off-by: Vic Yang <victoryang@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/170758 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* Test charging error state when battery is detachedVic Yang2013-09-271-0/+15
| | | | | | | | | | | | | | This checks charge state machine goes into error state when battery is not responding. BUG=chrome-os-partner:19236 TEST=Pass sbs_charging test BRANCH=None Change-Id: I61970c4d88cbb0d6242613cdc87b88da7ae3f2f4 Signed-off-by: Vic Yang <victoryang@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/170753 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* Test interface for detaching fake I2C devicesVic Yang2013-09-272-0/+97
| | | | | | | | | | | | | | This provides an interface to detach and re-attach fake I2C devices, which can be used to test I2C connection failure. BUG=chrome-os-partner:19235 TEST=Pass sbs_charging test along with the next CL BRANCH=None Change-Id: Ibfee79b13d45e62377d894aa28547e77bef2189e Signed-off-by: Vic Yang <victoryang@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/170752 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* Merge smart_battery_stub.h to smart_battery.hVic Yang2013-09-273-25/+12
| | | | | | | | | | | | | | | | | For testing, we are now mocking things at function-level instead of file-level. No need to have separate header file for smart battery functions now. Merge them back to smart_battery.h. Just moving code. No functional change. BUG=chrome-os-partner:18343 TEST=util/make_all.sh BRANCH=None Change-Id: I4de1f73def447e75458118c1148c598794ddc091 Signed-off-by: Vic Yang <victoryang@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/170751 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* Revert "pit: Disable CONFIG_HOST_COMMAND_STATUS"Andrew Bresticker2013-09-271-0/+1
| | | | | | | | | | | | | | | | | The kernel driver now correctly handles EC_RES_IN_PROGRESS. This reverts commit 62e9444161bba05da2dd219214be01084312d2fb. BRANCH=pit BUG=chrome-os-partner:22825 TEST=Run flashrom, bang on the keyboard, and issue i2c commands to TPSCHROME. Observe that I2C_PASSTHRU and MKBP_STATE commands do not interleave with GET_COMMS_STATUS commands Change-Id: I8589552f6c7a1506a32b5510fe340dba29702e13 Signed-off-by: Andrew Bresticker <abrestic@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/170844 Reviewed-by: Simon Glass <sjg@chromium.org>
* Add test for LP5562 LED controlVic Yang2013-09-254-6/+312
| | | | | | | | | | | | | | This adds a test for LP5562 LED control. The test mocks charging and battery status and check LED behavior is as expected. BUG=chrome-os-partner:19236 TEST=Pass the new test BRANCH=None Change-Id: Iac6b538b24c555bf48b6824f880091cd11a585d4 Signed-off-by: Vic Yang <victoryang@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/170597 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* Add test for memory-mapped switch informationVic Yang2013-09-253-0/+21
| | | | | | | | | | | | | | This checks power button and lid switch states are updated correctly to memory-mapped region. BUG=chrome-os-partner:19236 TEST=Pass power_button and lid_sw tests BRANCH=None Change-Id: Ia49b5a3142b5fd47985bc6f53b1bbffd6d4bbeac Signed-off-by: Vic Yang <victoryang@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/170438 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* cleanup: Remove unused fan channelsRandall Spangler2013-09-2514-48/+32
| | | | | | | | | | | | | | | | | | With the PWM interface refactoring, only the CPU fan uses the fan.h interface. All other PWM channels (keyboard backlight, etc.) use the pwm.h interface. Remove the unused constants, and rename FAN_CH_CPU to CONFIG_FAN_CH_CPU so it fits with the other fan config options. No functional changes; just renaming things. BUG=chrome-os-partner:18343 BRANCH=none TEST=build all targets; pass unit tests Change-Id: I391fbeaf54afcc29a11c2799a4520b7ad8784796 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/170534 Reviewed-by: Vic Yang <victoryang@chromium.org>
* rambi: Initial EC firmwareChromeOS Developer2013-09-257-4/+468
| | | | | | | | | | | | | | | | This should have all the correct GPIO mappings. Chipset and charger tasks are currently disabled, until we bring up the voltage rails and I2C communication. BUG=chrome-os-partner:22895 BRANCH=none TEST=compiles; everything else needs to wait until we get hardware Change-Id: Iea49fe7ab8bd17f61c8cc6c71f236a503418ee28 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/170540 Reviewed-by: Vic Yang <victoryang@chromium.org>
* Revert "Set WLAN_OFF_L to open drain"Paul Stewart2013-09-251-1/+1
| | | | | | | | | | | | This reverts commit 03cc4b422d28459fca60d29d830078bd8d6f1db1. A change in plan (and schematics) dictate that the EC should/will be the sole driver of this signal. Change-Id: I1e61ada1ae8579ae9a83c8410c38e3f5fe225bba Reviewed-on: https://chromium-review.googlesource.com/170533 Reviewed-by: Paul Stewart <pstew@chromium.org> Commit-Queue: Paul Stewart <pstew@chromium.org> Tested-by: Paul Stewart <pstew@chromium.org>
* Make support for dedicated recovery GPIO signal optionalRandall Spangler2013-09-257-0/+12
| | | | | | | | | | | | | | | | | | switch.c currently assumes that all boards have GPIO_RECOVERY_L. This is not true for Rambi, and also isn't true for ARM boards (which should also eventually use the common switch implementation). Add a new CONFIG_SWITCH_DEDICATED_RECOVERY option to control whether to compile this support. BUG=chrome-os-partner:22893 BRANCH=none TEST=compile all boards; pass unit tests Change-Id: If6f34d1afd580c9d79a8edcdda18833068e70f66 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/170489 Reviewed-by: Bill Richardson <wfrichar@chromium.org>
* Add deprecated consts to ec_commands.h, just in case.Bill Richardson2013-09-241-0/+11
| | | | | | | | | | | | | | | | | | | We've removed a few constants from the exported header file since the last big sync. Just in case some of them are still in use (coredump, flashrom), let's make it easy to redistribute the header unchanged. We can remove them for real next time. BUG=chromium:251441 BRANCH=none TEST=manual Compile, test, run, etc. This CL just adds back some unused (by the EC) constants that were previously removed, so nothing should change. Change-Id: Ia9889db89a90d56c8154fea1e8c8a483fdcae805 Signed-off-by: Bill Richardson <wfrichar@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/170522 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* stm32: snow: Fix the charging temperature range.jaehoon kim2013-09-241-2/+2
| | | | | | | | | | | | | | | | The value of start_charging_min_c and charging_min_c is 5 degrees C. To meet the samsung specification, we have to change these values as 0 degrees C like pit. BUG=chrome-os-partner:22882 TEST=Already checked the charging LED and the EC log in the oven. Change-Id: Id6b6e1e61d5d8c2a3fcca7ff2ccc46e430ec2d7d Signed-off-by: Jaehoon Kim <jh228.kim@samsung.com> Reviewed-on: https://chromium-review.googlesource.com/170476 Reviewed-by: Wonjoon Lee <woojoo.lee@samsung.com> Reviewed-by: Katie Roberts-Hoffman <katierh@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org>
* Mock flash erase/write function at physical layerVic Yang2013-09-245-59/+59
| | | | | | | | | | | | | | | | | This moves the mock function from common layer down to physical layer to complete the test of common layer. Also disable flash test for hardware tests, as this is only testing common layer. BUG=chrome-os-partner:19236 TEST=util/make_all.sh BRANCH=None Change-Id: Idd1c2c44591952894486f84d428872cfbf2cfdad Signed-off-by: Vic Yang <victoryang@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/170297 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* Set WLAN_OFF_L to open drainstabilize-4731.85.Bstabilize-4731.62.Bstabilize-4731.31.Brelease-R31-4731.BPaul Stewart2013-09-241-1/+1
| | | | | | | | | | | | | | | | | | On bolt this pin is connected both to the PCH and the EC. As designed, it was intended for both parts to treat this as an open-drain circuit. Signed-off-by: Paul Stewart <pstew@chromium.org> BUG=chrome-os-partner:22175 BRANCH=none TEST=No good test yet, since PCH appears to drive all the time Change-Id: Ib6ca16b4f797c8c334fb9f030f20cdbbc756f3fb Reviewed-on: https://chromium-review.googlesource.com/170257 Reviewed-by: Randall Spangler <rspangler@chromium.org> Commit-Queue: Paul Stewart <pstew@chromium.org> Tested-by: Paul Stewart <pstew@chromium.org>
* Support compiling with chipset task disabledRandall Spangler2013-09-235-15/+31
| | | | | | | | | | | | | | For bringup, we need to be able to compile a binary with the chipset task disabled. Chipset functions should be stubbed to do nothing in that case. BUG=chrome-os-partner:22820 BRANCH=none TEST=compile falco, pit, link with chipset task commented out in ec.tasklist Change-Id: I73a4e09effb049f19b1a128e643b267d6469037b Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/170221
* Fix thermal.c compilation if fans are not present.Randall Spangler2013-09-233-1/+9
| | | | | | | | | | | | | Currently, it doesn't compile unless CONFIG_FAN is defined. BUG=chrome-os-partner:22803 BRANCH=none TEST=temporarily undefine CONFIG_FAN in board/link/board.h; code compiles and all unit tests pass Change-Id: I251d670ccd299f7a50b1455364a817e07fad4cb1 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/170106
* stm32: Fix polarity of charger interruptRandall Spangler2013-09-2312-12/+12
| | | | | | | | | | | | | | | | | | | | | | The charger interrupt is active-low. Snow and Spring properly triggered on falling (asserting) edge, but Pit (and Daisy/Puppy) didn't. Fix those boards, and rename the signal to end in _L so we don't make that mistake again. BUG=chrome-os-partner:22827 BRANCH=pit TEST=unplug/replug AC adapter on pit; see debug output as follows: [batt] state charging -> idle0 Charger IRQ received. [batt] state idle0 -> charging Charger IRQ received. Change-Id: I1f5c9370d1118461dc033955ba77aab2cebb7ece Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/170256 Reviewed-by: Jaehoon Kim <jh228.kim@samsung.com> Tested-by: Jaehoon Kim <jh228.kim@samsung.com> Reviewed-by: Doug Anderson <dianders@chromium.org>
* Record average runtime and delay of hooksVic Yang2013-09-231-12/+43
| | | | | | | | | | | | | | | | | | | | | | | In additional to recording the maximum runtime and delay, let's also keep track of the moving average. The average is calculated by: New_Avg = (Old_Avg * 7 + New_Val) / 8 every time the hook fires. The average values are only accurate for hooks that fire enough times, but it won't be useful anyway for a hook that only fires just once or twice. Also, show warning if HOOK_TICK or HOOK_SECOND fires more than 10% late. BUG=chrome-os-partner:21801 TEST=On Kirby, check average values are sane. TEST='waitms 800' and see warning of HOOK_TICK firing late. BRANCH=None Change-Id: I453545830d854c6c5bfc795d01fc558a965cff6e Signed-off-by: Vic Yang <victoryang@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/169704 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* lm4: make CONFIG_UART_HOST optionalRandall Spangler2013-09-202-6/+36
| | | | | | | | | | | | | | | | Currently, CONFIG_UART_HOST must be defined for all LM4-based platforms. Future platforms may not need host UART support, so make it optional. BUG=chrome-os-partner:22802 BRANCH=none TEST=Temporarily comment out CONFIG_UART_HOST in board/link/board.h; code still compiles. Change-Id: I8775d9daaf8f6e45f1f374c9be7f10316611447f Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/170104 Reviewed-by: Bill Richardson <wfrichar@chromium.org>
* cleanup: move test mocks to board/host and remove unused mocksRandall Spangler2013-09-197-212/+1
| | | | | | | | | | | | | | | | Now that we have a better test framework in place, mock implementations go in either chip/host/ or board/host/, depending on whether they're mocking chip or common/board functionality. Move the remaining mocks there. Also, several mocks were neither compiled nor used, and haven't kept pace with other refactoring; delete those. BUG=chrome-os-partner:18343 BRANCH=none TEST=build all board; pass all unit tests Change-Id: Ie2a81c3ccd4506679192d979aa87fe7ed6c1c5a0 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/169873
* Turn off backlight power when lid is closed.Jeremy Thorpe2013-09-191-11/+9
| | | | | | | | | | | | | | | Ensure that the backlight is off whenever the lid is closed, independently of whether the AP asserts SUSPEND_L. BUG=None TEST=On Kirby, toggle lid switch closed and see that backlight turns off immediately. BRANCH=None Change-Id: I1516be3b139a8cbb07a8a81229c8143c88118e91 Signed-off-by: Jeremy Thorpe <jeremyt@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/169875 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* cleanup: move board-specific battery files to board dirsRandall Spangler2013-09-1915-59/+22
| | | | | | | | | | | | | | | | | | | | | | | | The battery files contain board-specific constants and a few small methods like battery-detect and battery-cut. Most of these aren't reused across platforms. The battery files have also been cleaned up so those board-specific constants basically all that's left in them. Where a file is used by a single board only, move it to board/(boardname)/battery.c. Batteries used by more than one board (e.g. battery_link.c used by both link and bolt) are still in common/battery_*.c, since that's cleaner than duplicating the file in each board's directory. No code changes, just moving files. BUG=chrome-os-partner:18343 BRANCH=none TEST=build all boards and pass unit tests Change-Id: I946c8eb874672c77f9b77105e5b900f98fa48d0f Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/169893 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* Fix console channel name listVic Yang2013-09-181-1/+3
| | | | | | | | | | | | | | | This adds back missing "hook" channel name. Also add a build assertion to make sure we don't miss this again. BUG=chrome-os-partner:21801 TEST=Build all boards. Remove "hook" channel and check build fails. BRANCH=None Change-Id: I373016504fd3753e1a791077d49b3af14b2b1aa4 Signed-off-by: Vic Yang <victoryang@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/169703 Reviewed-by: Vincent Palatin <vpalatin@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org>
* Haswell: Add control for touchscreen resetDave Parker2013-09-181-0/+17
| | | | | | | | | | | BUG=chrome-os-partner:22076 BRANCH=peppy TEST=Manual. Verify touchscreen operational in S0. Change-Id: Ife2d4e11142195bddf202933430ec8af243b1309 Signed-off-by: Dave Parker <dparker@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/167150 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* ec: fix duplicate 'const' declarartion.Yunlian Jiang2013-09-171-1/+1
| | | | | | | | | | | | | | | BRANCH=None BUG=chromium:292965 TEST=CC="i686-pc-linux-gnu-clang" CXX="i686-pc-linux-gnu-clang++" emerge-x86-generic chromeos-ec passes. Signed-off-by: yunlian@chromium.org Change-Id: I936f5e9b3e6ab5a5c1c2f6b6c41d054d748545e3 Reviewed-on: https://chromium-review.googlesource.com/169633 Reviewed-by: Luis Lozano <llozano@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org> Commit-Queue: Yunlian Jiang <yunlian@chromium.org> Tested-by: Yunlian Jiang <yunlian@chromium.org>
* Remove 'sb' and 'sbc' console commandsstabilize-4701.BVic Yang2013-09-171-78/+0
| | | | | | | | | | | | | | | The functionality of these commands can be fully covered by 'i2cxfer' command. Remove them to save code size. BUG=None TEST=Build all boards. Pass all tests. BRANCH=None Change-Id: I3f57e797530b17cff17b50feec80436ad7872409 Signed-off-by: Vic Yang <victoryang@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/169510 Reviewed-by: Vincent Palatin <vpalatin@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org>