summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Clear OWNERS for factory/firmware branchfirmware-kitty-5771.61.BBrian Norris2021-09-102-10/+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/+/3155194 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Owners-Override: Jora Jacobi <jora@google.com> Tested-by: Jack Rosenthal <jrosenth@chromium.org>
* flash_ec: Disconnect EC-3PO interps when flashing.Aseda Aboagye2016-02-181-1/+13
| | | | | | | | | | | | | | | | | | | | | | | Due to the recent changes for EC-3PO in servod, flash_ec needs to be modified in the same way that was done for ToT. Since the stm32 MCUs are programmed over the UART, we need to make some changes to allow the interpreter to stop listening to the UART PTY when flash_ec needs those PTYs. Otherwise, the EC-3PO interpreter will interfere with the programming and cause the flash to fail every time. BUG=chromium:571170 BUG=chromium:587600 BRANCH=kitty TEST=Tested same patch on other branches to flash stm32 ECs. Change-Id: I6f8de0ca5fdc877d2ef7dc613d1f813edaba8187 Signed-off-by: Aseda Aboagye <aaboagye@google.com> Reviewed-on: https://chromium-review.googlesource.com/328291 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Commit-Queue: Aseda Aboagye <aaboagye@chromium.org> Tested-by: Aseda Aboagye <aaboagye@chromium.org>
* clock-stm32l: properly setting HSI/MSI clock based on the RMYen Lin2014-12-152-7/+47
| | | | | | | | | | | | | | | | | | | | | | | | | According the STM32L RM, when writing to RCC_CFGR to change HSI or MSI clock source, SWS bits of RCC_CFGR register have to be checked if the new clock source is taken into account. Also, when writing ACC64 bit and LATENCY bit to FLASH_ACR register, those bits have to be checked too. Also changed in this CL is to disable MSI if HSI is enabled, and disable HSI if MSI is enabled. BUG=chrome-os-partner:32936 BRANCH=nyan TEST=passed suspend_stress_test on big, blaze and nyan Change-Id: I3ec660d149ecdec3ca3097239612bf2c542d0548 Signed-off-by: Yen Lin <yelin@nvidia.com> Reviewed-on: https://chromium-review.googlesource.com/234490 Reviewed-by: Kary Jin <karyj@nvidia.com> Tested-by: Kary Jin <karyj@nvidia.com> Reviewed-by: Andrew Bresticker <abrestic@chromium.org> (cherry picked from commit 400d9dca8c41f74cf0c2587e881707b80bb17d3d) Reviewed-on: https://chromium-review.googlesource.com/234717 Commit-Queue: Ken Chang <kenc@nvidia.com> Tested-by: Ken Chang <kenc@nvidia.com>
* Kitty: Implement fake lid switch.Jimmy2014-10-142-0/+7
| | | | | | | | | | | | | | | | | | | | 1.Powerled should remain enabled in S3 state. Implement fake lid switch that always returns lid is open. BUG=chrome-os-partner:32106. BRANCH=kitty. TEST=Buildall and check board can boot up. Signed-off-by: Jimmy Lin <jimmy.Lin@quantatw.com> Change-Id: Ife0313d99b9d7c875dd9d55941a05441912c69dd Reviewed-on: https://chromium-review.googlesource.com/218797 Tested-by: 挺倫 林 <jimmy.lin@quantatw.com> (cherry picked from commit 22527408257ae1abc8f618a78302a699796b4f81) Reviewed-on: https://chromium-review.googlesource.com/222827 Reviewed-by: Mohammed Habibulla <moch@chromium.org> Commit-Queue: Ken Chang <kenc@nvidia.com> Tested-by: Ken Chang <kenc@nvidia.com>
* Kitty: Implement Power LED feature.Jimmy2014-10-141-1/+0
| | | | | | | | | | | | | | | | | | | | 1.Defined Power LED behavior in led.c. Removed POWERLED task as it doesn't match kitty power led spec. BUG=chrome-os-partner:32106. BRANCH=kitty. TEST=Buildall and check board can boot up. Check Power LED work normally in S0/S3/S5 state. Signed-off-by: Jimmy Lin <jimmy.Lin@quantatw.com> Change-Id: I774243efb51e710e049e4176694e55d3f32e548f Reviewed-on: https://chromium-review.googlesource.com/221698 Reviewed-by: Mohammed Habibulla <moch@chromium.org> (cherry picked from commit 487829513afa6b52f33174f742700bdd3877fd3e) Reviewed-on: https://chromium-review.googlesource.com/222826 Commit-Queue: Ken Chang <kenc@nvidia.com> Tested-by: Ken Chang <kenc@nvidia.com>
* Revert "charger v2: set charger mode when requesting current/voltage"Andrew Bresticker2014-09-161-15/+2
| | | | | | | | | | | | | | | | | | This reverts commit bd4469ae4ffbbd6f2cd5549bdb8809838e55d6f7. Setting of the charge inhibit appears to sometimes wedge the battery such that charging cannot be un-inhibited and thus the battery cannot charge. Since any savings introduced by inhibiting charging are minimal, let's just leave the bit alone. BUG=chrome-os-partner:30759 TEST=suspend_stress_test on Blaze BRANCH=nyan Change-Id: Ic2b9b2f84ab149b1950cc77acd56dff7fc2d383c Signed-off-by: Andrew Bresticker <abrestic@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/216221 Reviewed-by: Dylan Reid <dgreid@chromium.org>
* kitty:Initial EC for bring up kittyJimmy Lin2014-08-208-2/+295
| | | | | | | | | | | | | | | | | | | Based on nyan project and modify as below items, 1.Disable keyboard and Battery function. 2.Add LED.c file. 3.To config all GPIO by latest schematic. 4.Remove Battery.c file. BUG=chrome-os-partner:31320 BRANCH=kitty TEST=Buildall and check board can boot up. Change-Id: I1854e8fdfa2cd8f95ffdcbf1357e6a91b5abc5f4 Signed-off-by: Jimmy Lin <jimmy.Lin@quantatw.com> Reviewed-on: https://chromium-review.googlesource.com/212407 Tested-by: 挺倫 林 <jimmy.lin@quantatw.com> Reviewed-by: Vic Yang <victoryang@chromium.org> Commit-Queue: 挺倫 林 <jimmy.lin@quantatw.com>
* blaze: update support batteries listDevin Lu2014-08-131-3/+10
| | | | | | | | | | | | | | | | | update support batteries list with new manufacturer name naming rule. BRANCH=nyan BUG=chrome-os-partner:31290 TEST=manual pluggin battery which changing new manufacturer name into sysytem, then check ec can recongize the battery. check battery can discharge normally on battery mode. check battery can be charged normally on ac mode. Change-Id: I30516fc7196a897ce713fbb9614723849cdb6f7d Signed-off-by: Devin Lu <Devin.Lu@quantatw.com> Reviewed-by: Yung-chieh Lo <yjlou@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/212271
* stm32 spi: postpone the RX DMA setup if handler is still using buffer.Louis Yung-Chieh Lo2014-07-071-1/+55
| | | | | | | | | | | | | | | If the AP de-asserts the SPI NSS pin while host command handler is still processing the command, we would delay the Rx DMA setup later. If this case happens, the pending result of handler will be dropped. BUG=chrome-os-partner:28979 BRANCH=tot,nyan TEST=build and play around on big. Change-Id: Id7d4c3c512d3db3301dcd4a8167e45d5565cc6ff Signed-off-by: Louis Yung-Chieh Lo <yjlou@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/204427 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* watchdog: Give more leeway to the independent watchdogDoug Anderson2014-06-231-5/+6
| | | | | | | | | | | | | | | | | | | | | It would be really nice to be guaranteed to see watchdog warnings before we actually hit a watchdog reset even if something strange is going on with the CPU. Let's increase the margin between the timer and the independent so that the hardware watchdog is really hit as a last resort. It seems like a 1.6 second hardware watchdog wouldn't be the end of the world so let's bump that way rather than increasing the number of warnings. BRANCH=ToT BUG=chrome-os-partner:29162 TEST="waitms 1000" on EC console no longer ever reboots. Change-Id: Ic5e5ddec22fb8484cc7c552b19d3f2043c105d0c Signed-off-by: Doug Anderson <dianders@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/204716 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* watchdog: Help ensure that the stm32 watchdog help printsDoug Anderson2014-06-203-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | On stm32 we were programming the WATCHDOG_HELP timer with the same value as the independent watchdog (which automatically resets the CPU). That means we weren't guaranteed to see the WATCHDOG_HELP. It happened to work most of the time due to the the LSI oscillator fudge (we assumed the watchdog was on a 56 kHz oscillator when it was probably on a 38 kHz one), but let's give ourselves a guaranteed gap. It's unlikely that this extra gap will actually help on most machines (if we're running at 53 kHz or lower we already had this much margin), but it's nice to be safe. BRANCH=ToT BUG=chrome-os-partner:29162 TEST=Increase margin to 400 (instead of 50) and type "waitms 300". Sometimes hit watchdog warning. Change-Id: I7f876757c15d7775116720c408a4127b4b94adfa Signed-off-by: Doug Anderson <dianders@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/204715 Reviewed-by: Vic Yang <victoryang@chromium.org> Reviewed-by: Vincent Palatin <vpalatin@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org>
* Increase stack size of charger and chipset tasks.Louis Yung-Chieh Lo2014-06-173-6/+6
| | | | | | | | | | | | | | | | The comment #20 of issue 29162 looks like a stack overflow to me. The issue 29067 also shows the stack is overflowed in some case. Let's increase that. BUG=chrome-os-partner:29067,chrome-os-partner:29162 BRANCH=nyan,tot TEST=build only. Should run RunIn.DozingStress.SuspendResume/RunIn.Reboot2. Change-Id: If3b97af578362eb6d2794b331716f499be7ad066 Signed-off-by: Louis Yung-Chieh Lo <yjlou@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/204277 Reviewed-by: David Hendricks <dhendrix@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org>
* stm32: spi: read spi->dr into a dummy variableYen Lin2014-06-171-1/+2
| | | | | | | | | | | | | | | | | In setup_for_transaction(), read spi->dr into a dummy variable instead of into in_msg[0]. Since in_msg[0] is an alias for a command's port number, this will prevent a command's port number from being over-written if spi transaction is terminated early while a command is still in progress. BUG=chrome-os-partner:28979 BRANCH=nyan TEST=passed factory_test.reboot2 test for >1000 cycles Change-Id: I4385572b2903fa906207977259b456d72fc7f52e Signed-off-by: Yen Lin <yelin@nvidia.com> Reviewed-on: https://chromium-review.googlesource.com/204355 Reviewed-by: Yung-chieh Lo <yjlou@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org>
* Add cprints() and ccprints()Vic Yang2014-06-1676-394/+703
| | | | | | | | | | | | | | | | | | | | | | | | | | | | (cherry-pick to firmware-nyan-5771.B, but without x86 and usb pd) Our code base contains a lot of debug messages in this pattern: CPRINTF("[%T xxx]\n") or ccprintf("[%T xxx]\n") The strings are taking up spaces in the EC binaries, so let's refactor this by adding cprints() and ccprints(). cprints() is just like cprintf(), except that it adds the brackets and the timestamp. ccprints() is equivalent to cprints(CC_CONSOLE, ...) This saves us hundreds of bytes in EC binaries. BUG=chromium:374575 TEST=Build and check flash size BRANCH=None Change-Id: Iad9a71d887ac46f5a521df0f43ebc8f4e7f2e36a Original-Change-Id: Ifafe8dc1b80e698b28ed42b70518c7917b49ee51 Signed-off-by: Vic Yang <victoryang@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/200490 Reviewed-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/203972 Reviewed-by: David Hendricks <dhendrix@chromium.org> Commit-Queue: Yung-chieh Lo <yjlou@chromium.org> Tested-by: Yung-chieh Lo <yjlou@chromium.org>
* Add 'at-shutdown' option to batterycutoff host commandDave Parker2014-06-145-26/+138
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If at-shutdown is specified, the battery is cut off 1 seconds after the host has shutdown. BUG=chrome-os-partner:29292,chrome-os-partner:28887 BRANCH=tot,nyan TEST=Run batterycutoff ectool command and cutoff console command with and without 'at-shutdown' option. Verify the battery is cut off immediately without the option specified and 1 seconds after shutdown with. View the console log to see the deferred cutoff occur. The following tests are verified on big. console: cutoff, AC on: system is off after removing AC. cutoff, AC off: system is off immediately. at-shutdown, AC on: system is off after "power off" and removing AC. at-shutdown, AC off: system is off after "power off". ectool: batterycutoff, AC on: system is off after removing AC. batterycutoff, AC off: system is off immediately. at-shutdown, AC on: battery is cut off after 1s of shutdown. system is off right after removing AC power. at-shutdown, AC off: system is off after 1s of shutdown. [84.058416 power state 3 = S0, in 0x0000] [84.058803 power lost input; wanted 0x0001, got 0x0000] [84.059120 power off 3] [84.072148 Cutting off battery in 1 second(s)] [84.123896 power shutdown complete] [84.128790 power state 7 = S0->S3, in 0x0002] [84.139694 power state 2 = S3, in 0x0002] [84.150857 power state 8 = S3->S5, in 0x0002] [84.166975 power state 1 = S5, in 0x0002] [84.177972 power state 1 = S5, in 0x0002] [85.080012 Battery cut off succeeded.] Change-Id: I56236187fb41c3b9f8cb0c4d0e48080922f075a2 Original-Change-Id: Id4bacf79ad3add885260655f80cb8127bafe1ad6 Signed-off-by: Dave Parker <dparker@google.com> Signed-off-by: Louis Yung-Chieh Lo <yjlou@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/203849 Reviewed-by: David Hendricks <dhendrix@chromium.org>
* nyan: don't compile in shorthelp of console commandsLouis Yung-Chieh Lo2014-06-141-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since stm32l has smaller flash size, undef CONFIG_CONSOLE_CMDHELP to remove short descripton to save 2560 byes. If you need to read the description, grep that in the code. BUG=chromium:374575 BRANCH=tot,nyan TEST=buildall and % grep hey build/big/ec.RO.map 0x000000000000ef48 After shrink --> 0x000000000000e548 Signed-off-by: Louis Yung-Chieh Lo <yjlou@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/200472 Reviewed-by: Bill Richardson <wfrichar@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org> (cherry picked from commit 9e2fac8390051c9bc4166963a4da46e81ed3864b) Change-Id: Ied58699228225164b22d3e8423e36d148a34e7b6 Original-Change-Id: I12113d8ab43e5223dadb4c43ec30e56eca932e75 Reviewed-on: https://chromium-review.googlesource.com/203848 Reviewed-by: Yung-chieh Lo <yjlou@chromium.org> Commit-Queue: Yung-chieh Lo <yjlou@chromium.org> Tested-by: Yung-chieh Lo <yjlou@chromium.org> Reviewed-by: David Hendricks <dhendrix@chromium.org>
* charger v2: set charger mode when requesting current/voltageAndrew Bresticker2014-06-111-2/+15
| | | | | | | | | | | | | | | | | | | | | | Clear the CHARGE_INHIBIT bit when requesting non-zero current/voltage and set it when charging should be disabled. On Blaze with the BQ24725 charger, setting this bit saves 10-15mW when we're not on AC. This also fixes an issue where battery charging would not get enabled when the charger is connected while the machine is in S3/S5. This is because the kernel driver would inhibit charging when the charger was removed and then the EC would not enable it when the charger was re-connected while the host was off, such as in S3/S5. BRANCH=nyan BUG=chrome-os-partner:29386 TEST=Boot Blaze, disconnect charger, suspend, connect charger and observe that the battery now starts charging. Change-Id: I3a8f30a307391248b6b8b005ed31c6c1bc847532 Signed-off-by: Andrew Bresticker <abrestic@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/203163 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* stm32: Enable USART TCIE after clearing TCDavid Hendricks2014-05-201-0/+3
| | | | | | | | | | | | | | | | | | | After clearing the TC flag, we should re-enable TCIE so that when the DMA transfer is done we re-interrupt and allow uart_process_output() to continue printing whatever is in the circular buffer (in the case of wrap-around) or finish gracefully if there is nothing left in the buffer. BUG=chrome-os-partner:28837 BRANCH=nyan TEST=Commands now reliably print full output whereas before they might appear truncated until another interrupt was triggered to finish printing the buffer. Change-Id: I0a4236139f57812f384e2b99af45195537201a04 Signed-off-by: Randall Spangler <rspangler@chromium.org> Signed-off-by: David Hendricks <dhendrix@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/200512
* tegra: waits for battery stable before booting AP.Louis Yung-Chieh Lo2014-05-091-0/+7
| | | | | | | | | | | | | | | | | | | | | This is a follow-up for CL 197990 and 197991. See issue tracker for more details. BUG=chrome-os-partner:28289 BRANCH=tot,nyan TEST=Copy from https://chromium-review.googlesource.com/#/c/197990 Going battery shipmode and plug-in AC, See booting and expect EC log: "[... battery initialized]" Disconnect battery, and plug-in and see booting and expect EC log: "[... battery not responding]" Change-Id: If751a096f36116344443d2a1c5ea2276c010dedb Original-Change-Id: Ic218414c21057a971b478ec60e406f1eb69dd379 Signed-off-by: Louis Yung-Chieh Lo <yjlou@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/199005 Reviewed-by: Gabe Black <gabeblack@chromium.org> Commit-Queue: Gabe Black <gabeblack@chromium.org> Tested-by: Gabe Black <gabeblack@chromium.org>
* Adding waiting function when battery boot-upWonjoon Lee2014-05-092-0/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | Some battery uses clock stretching feature, and this could disturb PMU communication before battery going stable. AP does not know and will attempt PMU setting, and could get fail For various battery indicates usually 1s for stable (even if it is much less in real world 200ms~700ms) Let's checking 'battery is ready' when first pump-up power. BRANCH=ToT BUG=chrome-os-partner:28289 TEST=Going battery shipmode and plug-in AC, See booting and EC log Disconnect battery, and plug-in and see booting and EC log Change-Id: I731959803559881f51162ec4dd947436c3ee212c Original-Change-Id: Idd8ae2ab4ec164b11fe67413bbf647cad18bc481 Signed-off-by: Wonjoon Lee <woojoo.lee@samsung.com> Reviewed-on: https://chromium-review.googlesource.com/197990 Reviewed-by: Randall Spangler <rspangler@chromium.org> Commit-Queue: Doug Anderson <dianders@chromium.org> Tested-by: Doug Anderson <dianders@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/199004 Reviewed-by: Gabe Black <gabeblack@chromium.org> Commit-Queue: Gabe Black <gabeblack@chromium.org> Tested-by: Gabe Black <gabeblack@chromium.org>
* i2c: stm32l: Increase timeout from 10ms to 30msDoug Anderson2014-05-092-2/+10
| | | | | | | | | | | | | | | | | | | | | | We found some cases where the battery can flip out and get confused and hold the i2c lines. Since the battery is actually smbus it will give up after 25ms. Increase our timeout to 30ms so that the next trasaction will work OK. BRANCH=ToT BUG=chrome-os-partner:28425 TEST=Revert (1cd618e Wait for battery boot-up) and use a problematic battery; see boot works OK. Change-Id: I5f3d45afad4f2a490dcbeba6205fa8c8684d0c44 Original-Change-Id: Ife051220cbbbd49d7bc9c8607ba177cd9582fe58 Signed-off-by: Doug Anderson <dianders@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/198212 Reviewed-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/199003 Reviewed-by: Gabe Black <gabeblack@chromium.org> Commit-Queue: Gabe Black <gabeblack@chromium.org> Tested-by: Gabe Black <gabeblack@chromium.org>
* tegra: don't set auto_power_on if SYSJUMPLouis Yung-Chieh Lo2014-05-091-2/+4
| | | | | | | | | | | | | | | | | | | | | | | The auto_power_on is set 1 unexpectedly while EC jumps. This has a side effect that would turn on the AP unexpectedly after "power off". See comment 43 of issue 28249 BUG=chrome-os-partner:28249 BRANCH=tot,nyan TEST=on nyan: > reboot > sysinfo // If EC is in RO, "sysjump RW" > power off // The AP keeps off. Change-Id: Ic184c7083c126217b0f95a1dc4fbbf1bc3277708 Original-Change-Id: I3c06e99383c06af7cd6c17dd65040e20f06d8e73 Signed-off-by: Louis Yung-Chieh Lo <yjlou@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/199002 Reviewed-by: Gabe Black <gabeblack@chromium.org> Commit-Queue: Gabe Black <gabeblack@chromium.org> Tested-by: Gabe Black <gabeblack@chromium.org>
* stm32: Re-enable spi transfers after a sysjumpRandall Spangler2014-05-091-20/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | If we sysjump to EC-RW, that sets enabled=0. enabled is only set back to 1 when the chipset resumes. But on an AP-requested sysjump, the chipset is already on, and so the resume hook never gets called. So, in spi init, check if the AP is already on. If it is, enable spi transfers right away. This probably also affects Pit/Pi. That may need an additional fix in power/gaia.c, if it returns an incorrect chipset state after a sysjump (I didn't test that.) BUG=chrome-os-partner:28249 BRANCH=nyan,pit TEST=Power+Refresh boot system with RONormal disabled, so that the AP tells the EC to jump to EC-RW. Confirm EC communication still works after that. Change-Id: I965114e05b0cb8647b76c3a7dc009d23c0f91ff0 Original-Change-Id: I588ef6d841040cf05d5527f645f122d5708b16ad Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/199001 Reviewed-by: Gabe Black <gabeblack@chromium.org> Commit-Queue: Gabe Black <gabeblack@chromium.org> Tested-by: Gabe Black <gabeblack@chromium.org>
* tegra: fixed a corner case that AP_OFF flag is not cleared.Louis Yung-Chieh Lo2014-05-091-3/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If we follow the TEST steps below, the power state machine in AP and EC were out of sync -- due to the un-clear bit and wrong initial power state. BUG=chrome-os-partner:24835 BRANCH=tot,nyan TEST=on big. > reboot > power off // De-assert XPSHOLD > reboot ap-off > sysinfo // This reset flags does NOT contain "ap-off". > power on % ectool reboot_ec RW // The following message is NOT observed. // "system is on, but RESET_FLAG_AP_OFF is on". > power // This should show the AP is "on". // ensure everything still works. > reboot ap-off // AP keeps off. > reboot // AP is on. Change-Id: Ic7aba45922bf1dac65aab2225cad03ee09df530f Original-Change-Id: I51afed7201d16ebcd889ad12a7af90026591cc2d Signed-off-by: Louis Yung-Chieh Lo <yjlou@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/199000 Reviewed-by: Gabe Black <gabeblack@chromium.org> Commit-Queue: Gabe Black <gabeblack@chromium.org> Tested-by: Gabe Black <gabeblack@chromium.org>
* tegra: reorder the "AP running" and "XPSHOLD seen".Louis Yung-Chieh Lo2014-05-091-1/+2
| | | | | | | | | | | | | | | | FAFT expects the "AP running" shows first, then "XPSHOLD seen". BUG=chrome-os-partner:28316 BRANCH=tot,nyan TEST=build only Change-Id: I301812cd36e5f187ea0821c7637afd67fa909d4e Original-Change-Id: Ic3e9d68b7727d62d3ccc2c037e7547f0276c2eae Signed-off-by: Louis Yung-Chieh Lo <yjlou@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/198969 Reviewed-by: Gabe Black <gabeblack@chromium.org> Commit-Queue: Gabe Black <gabeblack@chromium.org> Tested-by: Gabe Black <gabeblack@chromium.org>
* tegra: fix bug that apshutdown cannot shut down the AP.Louis Yung-Chieh Lo2014-05-091-3/+16
| | | | | | | | | | | | | | | | | | | | | | | | | The power_request variable is not clear in apshutdown case. Thus, the AP comes up again by the "power up" request. Clear this variable only when apshutdown command to avoid affecting the regular power states. BUG=chrome-os-partner:28621 BRANCH=tot,nyan TEST=see below > reboot // or other methods to turn on the AP. > power on > apshutdown // The AP should remain off. Change-Id: Ie302b50c4b08288cab3445bd6fac51cdf0df3ce5 Original-Change-Id: Icfc8a50db95aba656168f5b10dabd9443d75338d Signed-off-by: Louis Yung-Chieh Lo <yjlou@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/198770 Reviewed-by: David Hendricks <dhendrix@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/198968 Reviewed-by: Gabe Black <gabeblack@chromium.org> Commit-Queue: Gabe Black <gabeblack@chromium.org> Tested-by: Gabe Black <gabeblack@chromium.org>
* Big: Modify battery Allowable Temp Range due to battery spec changecloud_lin2014-05-071-3/+3
| | | | | | | | | | | | | BRANCH=big BUG=chrome-os-partner:28542 TEST=Modify battery thermistor and check the system shutdowns when battery temp is -21 degree C Change-Id: I5a8c147755f74b0f07daf5f940924b9af7d33cec Reviewed-on: https://chromium-review.googlesource.com/198163 Reviewed-by: Yung-chieh Lo <yjlou@chromium.org> Commit-Queue: Lin Cloud <cloud_lin@compal.com> Tested-by: Lin Cloud <cloud_lin@compal.com>
* nyan: fix the power in_signals out of sync bug.Louis Yung-Chieh Lo2014-05-061-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | See issue tracker for details. BUG=chrome-os-partner:28518 BRANCH=tot,nyan TEST=on big % reboot ap-off % powerbtn [6.100943 power on 4] Was power on 1 before fix. % reboot [0.098134 power on 2] Was power on 1 before fix. Signed-off-by: Louis Yung-Chieh Lo <yjlou@chromium.org> (cherry picked from commit cdf4fe4a941314ed2b1c17176f9dfe88a90529e0) Change-Id: I19c6888dfc549c1d7bafa897ccbbc5990a7f9c00 Original-Change-Id: Ic34a71ca06a64de5259e2a4c48efa28e38f47e5e Reviewed-on: https://chromium-review.googlesource.com/198289 Commit-Queue: Yung-chieh Lo <yjlou@chromium.org> Tested-by: Yung-chieh Lo <yjlou@chromium.org> Reviewed-by: David Hendricks <dhendrix@chromium.org> Reviewed-by: Yung-chieh Lo <yjlou@chromium.org>
* tegra: keeps AP in off state for "reboot ap-off"Louis Yung-Chieh Lo2014-05-021-3/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | XPSHOLD is not always removed after chipset_force_shutdown(). This is different to the GAIA design. So, check the RESET_FLAG_AP_OFF flag again while check_for_power_on_event(). BUG=chrome-os-partner:28371 BRANCH=tot,nyan TEST=verify on big. re-flash ec: power on 2, AP is up. AP is on, reboot@EC: power on 1, AP is up. AP is off, reboot@EC: power on 2, AP is up. AP is on, reboot ap-off@EC: AP keeps off (see FLAG_AP_OFF flag) AP is off, reboot ap-off@EC: AP keeps off (see FLAG_AP_OFF flag) reboot ap-off@EC, then 'powerbtn': AP is off at boot, then power on 4 reboot@EC: power on 2, AP is up. re-plug AC (remove battery): power on 2 re-plug battery (without AC): power on 2 (but my battery is dead) power off (S5), power on: power off 4, power on 5 power off (G3), power on: power off 4, power on 5 lid close / power off (S5)/ lid open: power on 3 lid close / power off (G3)/ lid open: power on 3 press power button and release: nothing happens after 15s. AP keeps in S5. button off (S5)/ on: power off 3, power on 4 button off (G3)/ on: power off 3, power on 4 power off (S5)/ button on: power off 4, power on 4 power off (G3)/ button on: power off 4, power on 4 button off (S5)/ power on: power off 3, power on 5 button off (G3)/ power on: power off 3, power on 4 button off (S5)/ lid open: power off 3, power on 3 button off (G3)/ lid open: power off 3, power on 3 is off, long press button (60s): power on 4, too long, shutdown, stay off is on, long press button (60s): power off 3, stay off AP is on, apreset cold: entered to S5, power off 3, power on 5 AP is on, apreset warm: power state is not changed, but reboots to BIOS Signed-off-by: Louis Yung-Chieh Lo <yjlou@chromium.org> (cherry picked from commit 413acdbf0dc5f3dfecc6dfbe448ce154dd493a61) Change-Id: I371ff5f7d92b05819089d23d8adb83dd31d236de Original-Change-Id: I3520969406a4cb8487b487c0612bca47de015eba Reviewed-on: https://chromium-review.googlesource.com/198053 Commit-Queue: Yung-chieh Lo <yjlou@chromium.org> Tested-by: Yung-chieh Lo <yjlou@chromium.org> Reviewed-by: Katie Roberts-Hoffman <katierh@chromium.org>
* Big: Correct the charger IC drivercloud_lin2014-04-254-1/+242
| | | | | | | | | | | | | | | | | | | | Add bq24735 driver and move to here for further developing BRANCH=big BUG=None TEST=test basic charing/discharging function Reviewed-on: https://chromium-review.googlesource.com/196541 Reviewed-by: Yung-chieh Lo <yjlou@chromium.org> Tested-by: Lin Cloud <cloud_lin@compal.com> Commit-Queue: Lin Cloud <cloud_lin@compal.com> (cherry picked from commit 295e409ea9ab10adb34b13330a2b9948e43da58c) Change-Id: I55ca2f3dd0318e2332c1e1a1d3f7af61e2d2502a Original-Change-Id: I9145489abbc12a2a9ba52b83449d7407adb80352 Signed-off-by: Louis Yung-Chieh Lo <yjlou@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/197017
* battery: don't talk to battery after cut-offLouis Yung-Chieh Lo2014-04-245-7/+86
| | | | | | | | | | | | | | | | | | | | | | | | Add a shortcut in smart battery driver and i2c passthru. Once the battery cut-off order is submitted (in the factory line), the EC will no longer talk to battery. BUG=chrome-os-partner:28248 BRANCH=tot,nyan TEST=See below > remove AC, cutoff: expect system is off. > cutoff, then remove AC: expect system is off. > cutoff, wait for 1 min, then remove AC: expect system is off. Signed-off-by: Louis Yung-Chieh Lo <yjlou@chromium.org> (cherry picked from commit 401901a83bd8b876a1033742b838311ca584d2a9) Change-Id: Id8b1ed4e7d2745ccc2bf240f488de55855324f43 Original-Change-Id: I5ee56484d3c60f5e1c28dedf5785234bef176404 Reviewed-on: https://chromium-review.googlesource.com/196946 Reviewed-by: Yung-chieh Lo <yjlou@chromium.org> Commit-Queue: Yung-chieh Lo <yjlou@chromium.org> Tested-by: Yung-chieh Lo <yjlou@chromium.org>
* charger v2: only configure charger when AC is on.Louis Yung-Chieh Lo2014-04-241-10/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The CL fcf26a4 enabled periodically charge_request(). However, that could fail and generates lots of error message in the EC console if the AC is not on and charger refuses the request (even it is 0v/0mA). BUG=none BRANCH=tot,nyan TEST=make runtests. Tested on big. Expect NO below annoying error message [1.353104 charge_request(0mV, 0mA)] [1.453170 charge_request(0mV, 0mA)] [1.553281 charge_request(0mV, 0mA)] [1.653317 charge_request(0mV, 0mA)] in the follwing cases: AC on, battery attached, power on, then remove/plug in AC. AC on, battery attached, power on, then remove/plug in battery. AC on, battery removed, power on, then plug in and remove battery. AC off, battery attached, power on, then plug in and remove AC. 'chgstate' also shows good state. At final, charge for 10 mins. Signed-off-by: Louis Yung-Chieh Lo <yjlou@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/196678 Reviewed-by: Lin Cloud <cloud_lin@compal.com> Tested-by: Lin Cloud <cloud_lin@compal.com> Reviewed-by: Devin Lu <Devin.Lu@quantatw.com> Reviewed-by: Bill Richardson <wfrichar@chromium.org> (cherry picked from commit b0409436adcf68cda3bf70a2964b9fdee599189a) Change-Id: Icab972bac073f7ecde55583e2b11451e095dc156 Original-Change-Id: I3ab4294efbd009ecc0f53f2b78228213d2404964 Reviewed-on: https://chromium-review.googlesource.com/196945 Reviewed-by: Yung-chieh Lo <yjlou@chromium.org> Commit-Queue: Yung-chieh Lo <yjlou@chromium.org> Tested-by: Yung-chieh Lo <yjlou@chromium.org>
* battery: move cut-off commands to common/battery.cLouis Yung-Chieh Lo2014-04-239-26/+58
| | | | | | | | | | | | | | | | | | | | | | | So that host and EC commands will be defined in common/battery.c. The board-specific battery.c can focus on the proprietary method. BUG=chrome-os-partner:28248 BRANCH=tot,nyan TEST=make buildall runtest Tested "cutoff" in EC console on big. Signed-off-by: Louis Yung-Chieh Lo <yjlou@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/196621 Reviewed-by: Bill Richardson <wfrichar@chromium.org> (cherry picked from commit 2e7ea4efdb56af411f13e0224a945a67dd6f0dcb) Change-Id: I4b370b4895c6c4655457043392e6f0154111316a Original-Change-Id: I2818eca3f4f65e951da894dc3dbdd4d6f8813840 Reviewed-on: https://chromium-review.googlesource.com/196683 Reviewed-by: Yung-chieh Lo <yjlou@chromium.org> Commit-Queue: Yung-chieh Lo <yjlou@chromium.org> Tested-by: Yung-chieh Lo <yjlou@chromium.org>
* charger v2: supports charger watchdogLouis Yung-Chieh Lo2014-04-232-23/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some chargers support a timeout mechanism that it would stop charging if no voltage/current setting comes from battery or EC. This is designed for safety. In charger v1, it always updates charger periodically. But in v2, old code only updates charger when needed. New code updates the charger periodically. Also keep the ability for debugging. A manual mode is introduced so that any requested volt/curr from host and force idle mode request would trigger this mode. To leave this mode, just disable the force idle mode. BUG=chrome-os-partner:28201,chrome-os-partner:28208 BRANCH=nyan TEST=See below. Plug AC and battery. Wait for 10 mins and the battery is charged normally. 'chgstate idle on': the charger doesn't charge the battery. 'chgstate idle off': charge again. Plug in AC and remove battery: No annoying repeated message and works fine. Plug in battery and remove AC: No annoying repeated message and works fine. Power up machine with battery only: No annoying repeated message and works fine. Power up machine with AC only: No annoying repeated message and works fine. Signed-off-by: Louis Yung-Chieh Lo <yjlou@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/196385 (cherry picked from commit fcf26a43ab1737acc873afcc1b61b4fb20389966) Change-Id: I50fe4b25e9dd8ef18b0444949d05f13b745accd7 Original-Change-Id: I8941b968d9bafdd23545e343c76c81a26076ca9b Reviewed-on: https://chromium-review.googlesource.com/196682 Reviewed-by: Yung-chieh Lo <yjlou@chromium.org> Commit-Queue: Yung-chieh Lo <yjlou@chromium.org> Tested-by: Yung-chieh Lo <yjlou@chromium.org>
* nyan: add info_precharge for drained batteryLouis Yung-Chieh Lo2014-04-224-15/+107
| | | | | | | | | | | | | | | | | | | | | | Charger v2 assumes the battery_get_info() always returns non-NULL even if the battery is not detected, for example, in the over-drained situation. Thus, add a new struct so that we know what the conservative setting is to pre-charge the unknown battery. BUG=chrome-os-partner:28112 BRANCH=nyan,big,blaze TEST=See issue tracker for the test procedure. Signed-off-by: Louis Yung-Chieh Lo <yjlou@chromium.org> (cherry picked from commit c423615cfd11400e1e4f35c97337abd16bd17150) Change-Id: I50bfc901798912d669bc1c01ba72f9da05d0f7f6 Original-Change-Id: Ic7e455254b6e311129eedad4cc9b75292830f3e2 Reviewed-on: https://chromium-review.googlesource.com/196260 Reviewed-by: Yung-chieh Lo <yjlou@chromium.org> Commit-Queue: Yung-chieh Lo <yjlou@chromium.org> Tested-by: Yung-chieh Lo <yjlou@chromium.org>
* Fixed the stack overflow bug in 'battery' console command.Louis Yung-Chieh Lo2014-04-225-15/+61
| | | | | | | | | | | | | | | | | | | | | | | | | On the Nyan EC, we almost run out of the stack of console task. Instead of making that struct static or global, we print the cached data. Read the issue tracker for more detailed discussion. BUG=chrome-os-partner:28027 BRANCH=tot TEST=verified on nyan with/without battery. The "battery" console command doesn't crash the system. Signed-off-by: Louis Yung-Chieh Lo <yjlou@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/194875 Reviewed-by: Dave Parker <dparker@chromium.org> Reviewed-by: Bill Richardson <wfrichar@chromium.org> (cherry picked from commit 58878e79e07f33050d6ff8d280e5db63b5902e10) Change-Id: Idca806a35b46d9a56217ad5edfb08ad646e94172 Original-Change-Id: Ifc73fe969f65ab4f44ec4c39a267e5cdf90521ff Reviewed-on: https://chromium-review.googlesource.com/196229 Reviewed-by: Yung-chieh Lo <yjlou@chromium.org> Commit-Queue: Yung-chieh Lo <yjlou@chromium.org> Tested-by: Yung-chieh Lo <yjlou@chromium.org>
* blaze: add ectool discharge commandDevin Lu2014-04-222-0/+13
| | | | | | | | | | | | | | | | | | | | | | just picks up this commmand for factory. BRANCH=ToT BUG=None TEST=Run ectool chargecontrol command with each option (normal, idle, discharge) on blaze. Verifiy battery can discharge. Signed-off-by: Devin Lu <Devin.Lu@quantatw.com> Reviewed-by: Yung-chieh Lo <yjlou@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/195535 (cherry picked from commit 35b214c1b3559d97663a3c3eecdab7689b29255a) Change-Id: I6b68f457d7ef8d5e300058cd995568b145353bfa Original-Change-Id: I96172a343e4c42dc2aa0f1371e6c0814a2f34e35 Reviewed-on: https://chromium-review.googlesource.com/196228 Reviewed-by: Yung-chieh Lo <yjlou@chromium.org> Commit-Queue: Yung-chieh Lo <yjlou@chromium.org> Tested-by: Yung-chieh Lo <yjlou@chromium.org>
* tegra: move to charger v2.Louis Yung-Chieh Lo2014-04-224-15/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | This would move all tegra boards to charger v2. Also removed the unnecessary charge_keep_power_off(), which was designed for USB power port and doesn't apply to Tegra platform. BUG=none BRANCH=nyan,big,blaze TEST=build and run on nyan. Signed-off-by: Louis Yung-Chieh Lo <yjlou@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/194384 Commit-Queue: Bill Richardson <wfrichar@chromium.org> Reviewed-by: Devin Lu <Devin.Lu@quantatw.com> Tested-by: Devin Lu <Devin.Lu@quantatw.com> Reviewed-by: Bill Richardson <wfrichar@chromium.org> (cherry picked from commit 2e41eb9eb9e9b816a12e58a42fb9b2a2ceeb8a36) Change-Id: Ie109964e20f388c96d30aeee76800e608b62adb2 Original-Change-Id: I13875d0d8561f4cef77cdc40203e5810553fe60b Reviewed-on: https://chromium-review.googlesource.com/196227 Reviewed-by: Yung-chieh Lo <yjlou@chromium.org> Commit-Queue: Yung-chieh Lo <yjlou@chromium.org> Tested-by: Yung-chieh Lo <yjlou@chromium.org>
* lpc: ACPI query-next-event drops masked eventsRandall Spangler2014-04-172-6/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, you could use EC_CMD_ACPI_QUERY_EVENT to read events that were masked off (that is, events which would not generate SCI/SMI/wake signals). The handlers for those signals on the host would still act on the masked-off events - for example, causing unwanted power button keypresses/releases. Now, EC_CMD_ACPI_QUERY_EVENT will only return events which are unmasked. This does not affect storing of events at event generation time. Events are still queued; they won't be dropped until the host attempts to read the next event. This gives the host a chance to set a mask later in boot (but before querying any events) to capture events which happened early in the boot process. BUG=chrome-os-partner:26574 BRANCH=rambi TEST=At EC console, type 'hostevent set 0x80' but don't press enter. Hold down the power button; UI starts fading to white. Press enter at the EC console to issue the hostevent command. System should continue shutting down, not fade back as if the power button were released. Change-Id: Id2cb14b0979f49cdd42424b9a61b310a2bb506f5 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/194935 Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
* blaze: implement the power and battery LED behaviorDevin Lu2014-04-175-6/+199
| | | | | | | | | | | | | | | | | | | Add LED behavior for blaze that will the same as falco and kip. BUG=None BRANCH=ToT TEST=manual Check battery LED show Amber when battery in charging. Check battery LED show white when battery fully. Check battery LED show blinking every 500ms when charging error. Check PWR LED light when system power on. Check PWR LED off when system power down. Check PWR LED will blinking every 1sec when system into suspend. Change-Id: I830952361d3282ff78d29a9a33bd09b64b093ee1 Signed-off-by: Devin Lu <Devin.Lu@quantatw.com> Reviewed-on: https://chromium-review.googlesource.com/193744 Reviewed-by: Yung-chieh Lo <yjlou@chromium.org>
* blaze: add battery configurationDevin Lu2014-04-171-45/+30
| | | | | | | | | | | | | | | | | Set battery cut off command and config battery configuration for blaze. BUG=chrome-os-partner:27120 BRANCH=ToT TEST=manual build ec and flash to blaze board, verify battery works. Verify battery cut off function is workable. Change-Id: I2e1f7de9c6370a2a02fb56fc4520f4bc062b4d6b Signed-off-by: Devin Lu <Devin.Lu@quantatw.com> Reviewed-by: Dave Parker <dparker@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/193000 Reviewed-by: Yung-chieh Lo <yjlou@chromium.org>
* big: Modify LGC battery setting based on battery speccloud_lin2014-04-122-5/+8
| | | | | | | | | | | | | | | | 1. Modify voltage_max 2. Set CP point BUG=chrome-os-partner:27859 BRANCH=Big TEST=Plug in AC and battery, use UART command "charger" to check v_batt and I_in and the values are correct. Change-Id: If83a444338e8d520e6c2f4d04ca6016c14cea8bd Reviewed-on: https://chromium-review.googlesource.com/193584 Reviewed-by: Yung-chieh Lo <yjlou@chromium.org> Commit-Queue: Lin Cloud <cloud_lin@compal.com> Tested-by: Lin Cloud <cloud_lin@compal.com>
* Smart Battery: Buffer battery parameters while they are updatedDave Parker2014-04-121-33/+34
| | | | | | | | | | | | | | | | | | | | | | BUG=chrome-os-partner:27736 BRANCH=ToT TEST=Verify battery charges and 'battery' console command returns sane values. Original-Change-Id: I57d9d432bce4ed28678dddc43fa5166905525557 Signed-off-by: Dave Parker <dparker@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/193338 Reviewed-by: Bill Richardson <wfrichar@chromium.org> Conflicts: driver/battery/smart.c Change-Id: Idae79859961da888e652b3af306ba49c467b412e Reviewed-on: https://chromium-review.googlesource.com/193655 Tested-by: Dave Parker <dparker@chromium.org> Reviewed-by: Bill Richardson <wfrichar@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org> Commit-Queue: Dave Parker <dparker@chromium.org>
* Zinger board configurationVincent Palatin2014-04-128-187/+502
| | | | | | | | | | | | | | | | | | Add the USB Power delivery PHY configuration, and all the pins and details to use the real Zinger board. Signed-off-by: Vincent Palatin <vpalatin@chromium.org> BRANCH=none BUG=none TEST=none Change-Id: Ic2d3616c9fd2bf3ebeccba74a5519697e7c3e899 Reviewed-on: https://chromium-review.googlesource.com/194220 Tested-by: Vincent Palatin <vpalatin@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org> Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
* FruitPie board configurationVincent Palatin2014-04-128-16/+455
| | | | | | | | | | | | | | | | | Add all the pins configuration to use the real FruitPie board and the USB Power Delivery configuration. Signed-off-by: Vincent Palatin <vpalatin@chromium.org> BRANCH=none BUG=none TEST=make BOARD=fruitpie Change-Id: I8c20118400cb6a2e26b541a9ee2da5b706299fcf Reviewed-on: https://chromium-review.googlesource.com/189862 Tested-by: Vincent Palatin <vpalatin@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org> Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
* stm32: USB Power Delivery physical layerVincent Palatin2014-04-123-0/+497
| | | | | | | | | | | | | | | | | Implementation of the physical layer for USB Power Delivery communication using the STM32 chip. Signed-off-by: Vincent Palatin <vpalatin@chromium.org> BRANCH=none BUG=none TEST=none Change-Id: I2a4adeef572b97a284bf52ab9d14d23246c56d18 Reviewed-on: https://chromium-review.googlesource.com/189867 Tested-by: Vincent Palatin <vpalatin@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org> Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
* USB Power Delivery core codeVincent Palatin2014-04-125-0/+1086
| | | | | | | | | | | | | | | | The protocol layer implementation for USB Power Delivery messaging. Signed-off-by: Vincent Palatin <vpalatin@chromium.org> BRANCH=none BUG=none TEST=none Change-Id: I7db75b004cf9dbf13fa1df95336f206e93236fc9 Reviewed-on: https://chromium-review.googlesource.com/189866 Tested-by: Vincent Palatin <vpalatin@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org> Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
* Refactored keyboard scan enable flag to allow for multiple disable reasonsAlec Berg2014-04-117-62/+77
| | | | | | | | | | | | | | | | | | | | | | Refactored keyboard scan enable/disable flag such that it is a mask of potential disable sources. When all disable sources are off, scanning is enabled, otherwise scanning is disabled. This fixes a recently introduced bug in which enabling/disabling keyboard scanning due to lid angle in S3 was interfering with enabling/disabling keyboard scanning due to power button. This also allows for easy expansion for future causes for disabling keyboard scanning. BUG=chrome-os-partner:27851 BRANCH=rambi TEST=Manual tests with a glimmer. Used the ksstate console command to check state of keyboard scanning under all permutations of power button pressed/unpressed, lid switch open/closed, and lid angle in tablet position vs. laptop positon. Change-Id: Ied4c5ebb94510b1078cd81d71373c0f1bd0d6678 Signed-off-by: Alec Berg <alecaberg@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/194287 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* cortex-m0: add more thumb1 helpersVincent Palatin2014-04-111-11/+53
| | | | | | | | | | | | | | | | Add other helpers for compact switch on ARMv6-M. Signed-off-by: Vincent Palatin <vpalatin@chromium.org> BRANCH=none BUG=none TEST=none Change-Id: I711ee8361ff1545acd978974d9f9fc306ca43b78 Reviewed-on: https://chromium-review.googlesource.com/190711 Tested-by: Vincent Palatin <vpalatin@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org> Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
* Stop charge_state_v2 from spewing problems with no battery.Bill Richardson2014-04-111-9/+29
| | | | | | | | | | | | | | | | | | | | | When the battery pack is missing, don't constantly spew console messages about it. Just note it once, and move on. But if we're precharging to try to awaken a dead battery, say so and also say so when we either give up or the battery awakens. BUG=chrome-os-partner:20881 BRANCH=ToT TEST=manual I unplugged and replugged the battery while watching the EC console. It stops the whining. Also tested without CONFIG_BATTERY_PRESENT_CUSTOM defined. It precharges, gives up, continues, etc. Change-Id: I5d4224cd1a6bf90ed6a1cf404260cdf6c61fc125 Signed-off-by: Bill Richardson <wfrichar@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/194113