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>
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>
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
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>
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>
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>
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>
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>
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>
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>
The kernel driver now correctly handles EC_RES_IN_PROGRESS.
This reverts commit 62e9444161.
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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
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
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>
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>
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>
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
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>
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>
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>
Instead of mocking it at sb_read()/sb_write() level, let's mock them at
I2C transaction level so as to increase test coverage of smart battery
driver.
BUG=chrome-os-partner:19236
TEST=Pass sbs_charging test.
BRANCH=None
Change-Id: I9bcd69517b084ea598c7b074a40143338e6150fe
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/169512
Reviewed-by: Randall Spangler <rspangler@chromium.org>
To test drivers, we need a way to fake I2C periphrals. With this CL, a
fake peripheral can be done by declaring its own I2C read/write
functions. The fake I2C peripherals may return EC_ERROR_INVAL to
indicate it's not responding. The emulator I2C read/write call scans
through all registered I2C peripherals and uses the first response.
BUG=chrome-os-partner:19235
TEST=Pass sbs_charging test with the next CL.
BRANCH=None
Change-Id: I9380dc40e147781b42e09eb6979c864bbd9f2ac4
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/169511
Reviewed-by: Randall Spangler <rspangler@chromium.org>
STM32 has a single-byte mailbox for UART I/O. When the core clock
runs at 16Mhz we can service interrupts fast enough to handle 115200
baud input, but when we drop to 1MHz we drop characters. Using DMA to
receive input solves this problem.
The STM32 DMA engine can only generate interrupts when the transfer is
half-done / all-done, so we need to poll the DMA receive-head-pointer
to see if individual characters have been received. Do this in the
tick task (every 250ms). When a character is received, poll more
quickly for a bit (5 times before the next tick) so the input console
is more responsive to typing.
BUG=chrome-os-partner:20485
BRANCH=none
TEST=Console is responsive to debug commands. For example, help -> prints help
apshutdown -> shuts down AP
arrow keys -> move cursor and scroll through command history
Ctrl+Q, help, wait a second, Ctrl+S -> help output printed after Ctrl+S
Then in chip/stm32/config_chip.h, comment out #define CONFIG_UART_RX_DMA
and rebuild/reflash the EC. When the AP is up, the console works normally
but after 'apshutdown', the EC drops to 1MHz core clock, and the arrow
keys don't work. (This step confirms that adding DMA support did not
change the behavior of systems where CONFIG_UART_RX_DMA is not defined.)
Change-Id: I199448354824bd747c7b290ea7fd5ccf354c11bb
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/169406
Reviewed-by: Simon Glass <sjg@chromium.org>
If CONFIG_HOOK_DEBUG is defined, the maximum run time of each hook is
recorded. Also, record the delayed amount of time of HOOK_TICK and
HOOK_SECOND firing. The statistics are available through console command
'hookstats'.
Also fix a bug that CC_HOOK is used but not defined when
CONFIG_HOOK_DEBUG is defined.
BUG=chrome-os-partner:21801
TEST=Build with HOOK_DEBUG and check 'hookstats'
BRANCH=None
Change-Id: I3acba3abdd487cf20d9a532429f766cdddea2e93
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/169274
All calls to it did
if (uart_tx_stopped())
uart_tx_start();
And that was the only use of uart_tx_stopped(). Merge the functions.
BUG=chrome-os-partner:20485
BRANCH=none
TEST=EC debug console still prints output and accepts commands.
Ctrl+Q pauses output and Ctrl+S resumes it.
Change-Id: I113c64f5fdfc6b02b63034a74b1a3c6c6a76c351
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/169329
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
The console task should be higher priority than the host command task,
since that allows debugging problems with host commands.
The keyboard scanning task should be higher priority than both of
them, since it's extremely latency-sensitive. As currently written,
long-running host commands such as I2C passthru can interfere with
keyboard scanning.
BUG=chrome-os-partner:22681
BRANCH=none (potentially affects pit, but apparently not noticeably)
TEST=type bursts of 6-8 characters quickly while doing a flash update
of the EC; should not drop characters.
Change-Id: I48db014053750a5f1fae5d06df34768975bb8297
Reviewed-on: https://chromium-review.googlesource.com/169334
Tested-by: Randall Spangler <rspangler@chromium.org>
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Commit-Queue: Randall Spangler <rspangler@chromium.org>
Nothing ever called uart_flush_input() or uart_gets(), so remove them.
They're dead code, and make implementing UART DMA input more complex.
BUG=chrome-os-partner:20485
BRANCH=none
TEST=build all platforms; pass unit tests
Change-Id: I94c2c372ac3f326b98e819b2c89b8995311b2868
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/169345
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Change the charger's Input Current Register setting for the 45W adapter to
match the latest spec.
BUG=chrome-os-partner:20739
BRANCH=Falco,ToT
TEST=manual
Connect a 45W adapter, run the "battery" and "charger" commands on the EC
console.
When the battery charge is below 10% (turbo off), the "I_in" value displayed
by the "charger" command should be 1536. Before it was 2560.
Change-Id: I0483b5408aa2da352cd3aeda58e1656c095d86b2
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/169323
Reviewed-by: Randall Spangler <rspangler@chromium.org>
(cherry picked from commit 3a2ef8cb38d9b0fcc638bbc9a5f7a465a8b14565)
Reviewed-on: https://chromium-review.googlesource.com/169392
I was just updating the input current limit when turbo mode was enabled and
disabled. However, it turns out that the charger can decide to change the
setting all by itself if the inrush current is too high. This happens pretty
much every time that the AC is applied.
We didn't notice this while the AP was on, but when the AP was off we were
exiting the watch_adapter_closely() function too soon and so we missed the
transition. This CL fixes that.
But just to be safe, instead of only updating when we think we need to,
we're going to just update the value every time we check on the adapter.
That way if we happen to miss a change due to a race condition or transient,
we'll catch it the next time through the loop.
BUG=chrome-os-partner:20739
BRANCH=Falco,ToT
TEST=manual
Before this CL, you can run "sbc 0x3f" on the EC console while plugging and
unplugging the AC adapter. When the AP is off and AC is reapplied, you'd see
the reported value mysteriously change.
After this CL, it doesn't.
Change-Id: I5661c548cccd4eb24ba4d8a0b8cd070acc2e49ef
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/169322
Reviewed-by: Randall Spangler <rspangler@chromium.org>
(cherry picked from commit 1bcdd0eb6ff353a7215efe0b24630148ea7a9f28)
Reviewed-on: https://chromium-review.googlesource.com/169391
This enables 'ectool led' command.
BUG=chrome-os-partner:22056
TEST='ectool led battery query' and check brightness ranges are correct.
TEST='ectool led battery green' and LED turns green.
TEST='ectool led battery yellow' and LED turns yellow.
TEST='ectool led battery auto' and LED goes back to auto control.
TEST='ectool led power query' returns error.
BRANCH=None
Change-Id: Ide4d80851270fc17d474aee58ec46436a709745c
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/168870
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
This causes the EC to give a warning when the battery is less than 3.5% and
shutdown when the batteyr is less than 1.5%
BUG=chrome-os-partner:21926
TEST=check that warning happens at < 3.5% and shutdown happens at < 1.5% on the
EC console.
Change-Id: I1bd06f632e969b55bbb041c65ab106ef764e454b
Signed-off-by: Derek Basehore <dbasehore@chromium.org>
(cherry picked from commit 2f93978e5e5dcf841ef24fa6b9ba2fa9459d3d98)
(cherry picked from commit 447d69abcb3c61440d89b4aac8c4472a35b3b77d)
Reviewed-on: https://chromium-review.googlesource.com/169055
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
This fixes the problem that after an EC reboot, OTG dongle stops
working.
BUG=chrome-os-partner:21964
TEST=Reboot EC and boot from OTG dongle.
BRANCH=None
Change-Id: Ieec43f612d01114d13afb40293acfd0b3e324e8c
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/168737
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Having a per-device enum list for use by the EC_CMD_GET_SET_VALUE command
won't work when the one-and-only ectool tries to talk to different devices.
Any particular enum may be missing or have a completely different meaning.
Instead, we can do the same thing that EC_CMD_HOST_EVENT_* does - use the
same structs for a bunch of different commands.
If/when we run out of command numbers (it's currently only 8 bits), we'll
just switch to using EC protocol v3 (see crosbug.com/p/20820), which
provides 16 bits for the command.
This CL renames EC_CMD_GET_SET_VALUE to EC_CMD_GSV_PAUSE_IN_S5 (since that's
the one-and-only use of it at present), and renames the params/response
structs as well. Since only the names are changing, the implementation
remains backwards-compatible (assuming the flags value usage is preserved by
ectool for the EC_CMD_GSV_PAUSE_IN_S5 command, which it is).
If I can cherry-pick this change into the one place where it's being used, I
will.
BUG=chromium:287969
BRANCH=ToT
TEST=manual
Although this is primarily an internal name change, it also means that the
commands to invoke the previous usage of this feature have changed. To test:
On Haswell systems only.
To enable the pause in S5 at shutdown, do either of these:
EC console: pause_in_s5 on
root shell: ectool pause_in_s5 on
Shut the AP down politely, and it should pause in S5 for 10 seconds before
continuing to G3. You can see this by watching the EC console.
To disable the pause in S5 at shutdown, do any of these:
EC console: pause_in_s5 off
root shell: ectool pause_in_s5 off
or
press Refresh + POWER
Boot the system, then politely shut down. This time it should go directly to
G3 without pausing in S5.
Change-Id: Ic614fed37ad89db794c2bbcca2b83d1603030ab2
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/168816
This reduces the number of UART interrupts by a factor of 12, and
reduces the overall interrupt rate on STM32 by a factor of 2.
BUG=chrome-os-partner:20485
BRANCH=none (not required for pit branch)
TEST=Boot pit. Ctrl+Q pauses debug output; Ctrl+S resumes it.
'crash divzero' still prints a full crash dump.
And util/makeall.sh passes builds all platforms and passes tests.
Change-Id: I86993e14b436150298dcb2c6d29086cc3c9db418
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/168814
This is a precursor to DMA-based UART transfers, which require
different processing for DMA vs PIO output types.
BUG=chrome-os-partner:20485
BRANCH=pit
TEST=Boot pit; verify EC console still works.
Change-Id: I6d6f55561eeebe9bd2928b2bfb25278c86f689d1
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/168811
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
The definition of GPIO interface allows passing in multi-bit mask, and
this is what's done by gpio_config_module(). Fix STM32L's function so
that it doesn't accidentally set incorrect GPIO register values.
BUG=chrome-os-partner:22605
TEST=On Kirby, do 'led r 0' and check the value of 0x40020800 is
0x01540000.
BRANCH=None
Change-Id: I9a1c8074aab7345485a590ecf138bf99d0742997
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/168739
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Tested-by: Randall Spangler <rspangler@chromium.org>