| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Now that we don't have an old charge_state, this is the only one.
Rename it accordingly.
This makes no functional change.
BUG=b:218332694
TEST=make buildall
Change-Id: I95923eedd2715b8c7793df8f6e3171c82f9347ca
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4516193
Reviewed-by: Tristan Honscheid <honscheid@google.com>
Tested-by: Simon Glass <sjg@chromium.org>
Commit-Queue: Eric Peers <epeers@google.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Making this change causes common trng functions to move memory
locations. This change only affects fingerprint (FPMCU) boards
BUG=b:280889889
TEST=make BOARD=bloonchipper, CONFIG_CMD_RAND enabled in board.h
ALLOW_CONFIG=1 ./util/compare_build.sh -b all
=> All boards match, except the following Fingerprint boards:
bloonchipper
dartmonkey
hatch_fp
nami_fp
nocturne_fp
nucleo-dartmonkey
Change-Id: I4dbb5e255be0f61eb7b446af4565bea487c08e52
Signed-off-by: David Cross <davidmcross@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4507892
Reviewed-by: Bobby Casey <bobbycasey@google.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The battery_near_full is used to set PWR_STATE_DISCHARGE_FULL and
PWR_STATE_CHARGE_NEAR_FULL and these two states are used to set LED
behaviors. We should change battery_near_full to depend on display
SOC because LED bahaviors are already depends on display SOC.
There is an exception, isl9241.c also checks
charge_get_state() == PWR_STATE_CHARGE_NEAR_FULL in function
isl9241_restart_charge_voltage_when_full. With this change,
this feature will depend on the battery display SOC rather than RSOC.
The display SOC is bigger than RSOC ~3% when the battery is
BATTERY_LEVEL_NEAR_FULL(default 97%) so this feature may be 3% ahead
of schedule. The 3% difference should have no harm for this feature.
BUG=b:278512388
TEST=1.verify LED behavior on voltorb
2.no "E: Node with matching prop not found" on voltorb
Change-Id: I87f555571e22cbcdd0e8e0a201f76e3de8204ebe
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4478776
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-by: Siyu Qin <qinsiyu@huaqin.corp-partner.google.com>
Commit-Queue: wen zhang <zhangwen6@huaqin.corp-partner.google.com>
Tested-by: wen zhang <zhangwen6@huaqin.corp-partner.google.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Atlas, coral, corori, eve, morphius, primus, and rammus are setting
CONFIG_BATTERY_LEVEL_NEAR_FULL to custom values. This causes their LEDs
show 'full' while the display battery percentages are still < 100%.
We'll make these boards define CONFIG_BATT_HOST_FULL_FACTOR, instead.
And fix LED dts for some zephyr projects.
BUG=b:280818345
TEST=build pass
Change-Id: I98f97798ea99cc812671d5b31d64e92d55a1e05a
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4523043
Commit-Queue: wen zhang <zhangwen6@huaqin.corp-partner.google.com>
Tested-by: wen zhang <zhangwen6@huaqin.corp-partner.google.com>
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The console command to induce a stack overflow crash uses ccprintf,
which acquires a mutex lock internally. The exception handler aborts
the thread (shell_uart) when the stack overflow is detected, but the
mutex is not released. This causes system safe mode to deadlock.
Switch to panic_printf to avoid this deadlock. A more robust long
term fix may be to change Zephyr internals to release mutexes on aborted
threads.
LOW_COVERAGE_REASON=Swapping single function call
BUG=b:278792557
TEST=Able to start system safe mode after a stack overflow on skyrim
Change-Id: Ib7b50487d27e77fdd5b6cec5176060074868dca3
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4504115
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-by: Boris Mittelberg <bmbm@google.com>
Auto-Submit: Rob Barnes <robbarnes@google.com>
Commit-Queue: Rob Barnes <robbarnes@google.com>
Tested-by: Rob Barnes <robbarnes@google.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We don't have a v1 anymore, so the name makes no sense. Move it into
the existing file.
Include charge_state.h instead of v2, doing this in the same change to
avoid build errors.
This makes no functional change.
BUG=b:218332694
TEST=make buildall
Change-Id: Ic3e3adc45e4d002c2cd5ba8aa65e24686e01d628
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4516191
Reviewed-by: Tim Van Patten <timvp@google.com>
Commit-Queue: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Yuval Peress <peress@google.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We have enum charge_state_v2 and used to have enum charge_state. Try
to avoid using charger_state in the source except as an enum.
This makes no functional change.
BUG=b:218332694
TEST=make buildall
Change-Id: I68e4eb3112a32be00819f74c51ea744d148a88d5
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4516189
Reviewed-by: Al Semjonovs <asemjonovs@google.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We have a new 'charge state' in struct charge_state_data as part of the
charge_state_v2.h file. This is confusing.
Rename this function to match the enum it is referencing.
This makes no functional change.
BUG=b:218332694
TEST=make buildall
Change-Id: I7f08dd4fb11e2939e0ef779018c1e3206ebc8d20
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4516188
Commit-Queue: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Aaron Massey <aaronmassey@google.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This name is confusing, since its members start with PWR_ and the
comment for enum charge_state_v2 says that these values are only used
to control the LEDs, with one not-quite-correct exception, whatever
that might be.
We could rename it to power_state, but that is already fairly widely
used as a variable in the code base. Also it seems better to match the
enum PWR_ prefix. Future work may rename the members too.
Rename the charge_state enum.
This makes no functional change.
BUG=b:218332694
TEST=make buildall
Change-Id: If8a7cc73dcfb4c1e89984e57fc55e432416e8aec
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4516187
Commit-Queue: Simon Glass <sjg@chromium.org>
Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org>
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add tests for the `8042` set of console commands in `keyboard_8042.c`,
covers about 100 new lines.
BUG=b:281691908
TEST=./twister -s drivers/drivers.keyboard_8042
Change-Id: I1e28e0258305d0e1d17571346fcdca8f19102cb9
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4520583
Commit-Queue: Peter Marheine <pmarheine@chromium.org>
Tested-by: Tristan Honscheid <honscheid@google.com>
Commit-Queue: Tristan Honscheid <honscheid@google.com>
Auto-Submit: Tristan Honscheid <honscheid@google.com>
Reviewed-by: Peter Marheine <pmarheine@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Zephyr and CrOS EC can use the same method for scheduling the safe mode
timeout, so there's no need to have an overridden task.
BUG=None
TEST=Safe mode starts and timesout on skyrim
Change-Id: I57b296223ec86cf47110a00f3f021e8a8a30ead3
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4519103
Tested-by: Rob Barnes <robbarnes@google.com>
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
Commit-Queue: Rob Barnes <robbarnes@google.com>
Auto-Submit: Rob Barnes <robbarnes@google.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Many old boards are out of flash space, which makes porting safe mode to
older boards difficult. To make this process smoother shorten strings so
less flash space is needed.
BUG=None
TEST=Safe mode runs
Change-Id: I0934f1a477b01e7c8f71241844ac0eefa093c5ea
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4519102
Commit-Queue: Rob Barnes <robbarnes@google.com>
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
Tested-by: Rob Barnes <robbarnes@google.com>
Auto-Submit: Rob Barnes <robbarnes@google.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Try to work around the code-coverage loss by moving the condition into
the function.
BUG=b:281109948
TEST=check if coverage goes back up
Change-Id: I3374692c7010f3712e87a2e144212488fb58bb91
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4519108
Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
Tested-by: Jeremy Bettis <jbettis@chromium.org>
Commit-Queue: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add a way to set the base input-voltage in the charger_base.c file. Use
this for the two accesses required in charger_base.c, thus removing the
final two base-related #ifdefs in that file.
With this we can drop the inclusion of the ec_ec_comm_client/server
headers.
This makes no functional change.
BUG=b:218332694
TEST=zmake build dev-posix
Check size on lux:
*** 69552 bytes in flash and 1152 bytes in RAM lux RO ****
*** 69460 bytes in flash and 1120 bytes in RAM lux RW ****
Check size on brya:
*** 33464 bytes in flash and 23136 bytes in RAM brya RO ****
*** 33428 bytes in flash and 23136 bytes in RAM brya RW ****
Change-Id: I8b747b8d7dbe890ce071027aaeed23b879ae8070
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4510250
Commit-Queue: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This field is only accessible when CONFIG_EC_EC_COMM_BATTERY_CLIENT is
enabled, but we want to dump it in the main charger file. Add a
function to access the value.
This makes no functional change.
BUG=b:218332694
TEST=zmake build dev-posix
Check size on lux:
*** 69552 bytes in flash and 1152 bytes in RAM lux RO ****
*** 69460 bytes in flash and 1120 bytes in RAM lux RW ****
Change-Id: Iebf22c19cd3e2c649715eb3e6010709fda075929
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4510249
Tested-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
Commit-Queue: Simon Glass <sjg@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Change the #ifdef in charge_set_input_current_limit() to use if() and
move a line of setup code into charger_base_setup().
This makes no functional change.
BUG=b:218332694
TEST=zmake build dev-posix
Check size on lux:
*** 69552 bytes in flash and 1152 bytes in RAM lux RO ****
*** 69460 bytes in flash and 1120 bytes in RAM lux RW ****
Change-Id: Ie657a69165b4e2cda56c9966e5831152d6b745d4
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4510248
Tested-by: Simon Glass <sjg@chromium.org>
Commit-Queue: Simon Glass <sjg@chromium.org>
Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Move use of this variable wholly within charger_base.c by adding a
function to show the current charge level and another to check if the
base is nearly full.
This makes no functional change.
BUG=b:218332694
TEST=zmake build dev-posix
Check size on lux:
*** 69552 bytes in flash and 1152 bytes in RAM lux RO ****
*** 69460 bytes in flash and 1120 bytes in RAM lux RW ****
Change-Id: I558c3c122f52a8d4e034bd375b20e7ca154fd3a7
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4510247
Commit-Queue: Simon Glass <sjg@chromium.org>
Reviewed-by: Tomasz Michalec <tmichalec@google.com>
Tested-by: Simon Glass <sjg@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Move use of this variable wholly within charger_base.c by adding two
functions to deal with what charger_state_v2.c needs:
- seeing if charge_base has changed since last time
- committing that change
I did toy with the idea of making these two functions static inlines,
but that does tend to obfuscate the fact that they only exist when the
base is present. So for now at least I have left two IS_ENABLED()
calls in the code.
This makes no functional change.
BUG=b:218332694
TEST=zmake build dev-posix
Check size on lux:
*** 69552 bytes in flash and 1152 bytes in RAM lux RO ****
*** 69448 bytes in flash and 1120 bytes in RAM lux RW ****
Change-Id: Ib9bdbce62cefb99b12aeb235450eac5d29861d3b
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4510246
Reviewed-by: Tristan Honscheid <honscheid@google.com>
Commit-Queue: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This variable is not used in the main charger file. Move it over to the
base file by creating a setup function for the base, calling it from
the charger_setup() function.
This makes no functional change.
BUG=b:218332694
TEST=zmake build dev-posix
Check size on lux:
*** 69552 bytes in flash and 1152 bytes in RAM lux RO ****
*** 69448 bytes in flash and 1120 bytes in RAM lux RW ****
Change-Id: Idbdb7639cb51e65de2c77303545221cca25c8865
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4510245
Reviewed-by: Al Semjonovs <asemjonovs@google.com>
Tested-by: Simon Glass <sjg@chromium.org>
Commit-Queue: Simon Glass <sjg@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
With the essential refactoring complete, move the base code into a new
charger_base.c file, with a corresponding charger_base.h header file.
The base name 'charger' was chosen since it matches the charger.h
header file, even though charge_state_v2.c uses the 'charge' base name.
Three variables must be exported for use by the charge_state_v2.c code:
charge_base, prev_charge_base and base_responsive. For now these are
made global. Future work will tidy that up.
The base_connected() function is defined in the new C file, with a stub
in the header for when CONFIG_EC_EC_COMM_BATTERY_CLIENT is not enabled.
The hook for board_base_reset() is placed at the bottom of the new
charger_base.c file.
With this change we have 8 #ifdefs for CONFIG_EC_EC_COMM_BATTERY_CLIENT
in charge_state_v2.c - future work will tidy those up.
This makes no functional change.
BUG=b:218332694
TEST=zmake build dev-posix
Check size on lux:
*** 69552 bytes in flash and 1152 bytes in RAM lux RO ****
*** 69448 bytes in flash and 1120 bytes in RAM lux RW ****
Change-Id: I2d8d03e8b07ed1b281b8729cffdb8140239b5b2b
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4510244
Commit-Queue: Simon Glass <sjg@chromium.org>
Reviewed-by: Tristan Honscheid <honscheid@google.com>
Tested-by: Simon Glass <sjg@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We want to move this function into its own file where it will not have
access to the 'curr' state. Pass in the ac value and use the return
value to indicate whether it should be zeroed.
Pass in prev_ac as well, for the same reason.
This changes the ordering of curr.ac being set to 0, so it happens
after board_base_reset() has been called. From what I can tell, this
does not matter, although there is a lot of code what could be
affected by the base_detect_deferred hook or the call to
base_detect_change().
So this makes no functional change.
BUG=b:218332694
TEST=zmake build dev-posix
Check size on lux:
*** 69552 bytes in flash and 1152 bytes in RAM lux RO ****
*** 69448 bytes in flash and 1120 bytes in RAM lux RW ****
Change-Id: Ie2171016b692d233fda4f7bd527e74cbb965702e
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4510243
Commit-Queue: Simon Glass <sjg@chromium.org>
Reviewed-by: Tomasz Michalec <tmichalec@google.com>
Tested-by: Simon Glass <sjg@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Pass this variable in as an argument, so we can eventually move the
base code out into its own file.
BUG=b:218332694
TEST=zmake build dev-posix
Check size on lux:
*** 69552 bytes in flash and 1152 bytes in RAM lux RO ****
*** 69452 bytes in flash and 1120 bytes in RAM lux RW ****
Change-Id: I14fb41b07a1baa8bc38efe493de9c4242dda3456
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4510242
Tested-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
Commit-Queue: Simon Glass <sjg@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In preparation for moving this function into its own file, pass in the
charge state that we want it to work with.
Use a local variable for the battery information to simplify the code.
This makes no functional change.
BUG=b:218332694
TEST=zmake build dev-posix
Check code on lux:
*** 69552 bytes in flash and 1152 bytes in RAM lux RO ****
*** 69440 bytes in flash and 1120 bytes in RAM lux RW ****
Change-Id: If6271fcac99eb3af554bda52f86ed63267daea76
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4509873
Tested-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Al Semjonovs <asemjonovs@google.com>
Commit-Queue: Simon Glass <sjg@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This function is called in two modes, one where it deals with the
currently requested voltage/current and one where it does not. The
function has access to the necessary state so there is no need to
pass it in. It is better to tell the function which approach to take
explicitly, using a boolean, rather than using zero values for the
first two arguments to indicate this.
Replace the first two arguments with a boolean.
This makes no functional change.
BUG=b:218332694
TEST=zmake build dev-posix
Check code on lux:
*** 69552 bytes in flash and 1152 bytes in RAM lux RO ****
*** 69416 bytes in flash and 1152 bytes in RAM lux RW ****
Change-Id: I8389e35b0f61b2c4f03a7e7aac746eeab20ef0de
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4509872
Reviewed-by: Aaron Massey <aaronmassey@google.com>
Commit-Queue: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The double declaration of this variable is ugly. The only user seems to
be lux, where board_is_base_connected() is implemented simply by
reading from another variable. So there is really advantage to caching
the value in the charger code.
Change base_connected() to a function, where it returns false if there
is no base, otherwise calls the base code to find out.
This makes no functional change.
BUG=b:218332694
TEST=zmake build dev-posix
Check code on lux:
*** 69552 bytes in flash and 1152 bytes in RAM lux RO ****
*** 69424 bytes in flash and 1152 bytes in RAM lux RW ****
Change-Id: I14a05a7705fa52c92fa15b0ee233f79ef01d1b53
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4508350
Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
Commit-Queue: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is a property of the charger task and various functions access it.
Within each iteration of the charger loop, it is only changed at most
once.
It seems better to use a local variable for that.
Unfortunately the exported function charge_get_percent() needs access
to this variable. But it seems better to group exported information
together, updating it as needed. Then this information it could
potentially be accessed as a cohesive whole, rather than a collection
of unrelated pieces.
Make a start on this by creating a new local struct to hold what will
be the 'published' information. Update it once around the charger loop.
Update charge_get_percent() to use that version of the information.
Code size on lux, which seems to be the only user of the base code,
increases a bit. This hits it fairly hard since it adds a 5th function
argument to set_base_lid_current(). We could improve that by using
flags instead of three booleans. But it seems best to do that once we
have all the reported state in one place. Note that we get much of the
code space back with the next CL.
This makes no functional change.
BUG=b:218332694
TEST=zmake build dev-posix
Lux adds 136 bytes to RO, less to RW; RAM improves a little
Free space before:
*** 69624 bytes in flash and 1152 bytes in RAM lux RO ****
*** 69444 bytes in flash and 1120 bytes in RAM lux RW ****
after:
*** 69488 bytes in flash and 1152 bytes in RAM lux RO ****
*** 69476 bytes in flash and 1152 bytes in RAM lux RW ****
Change-Id: Ide34a613e0bab7868d268b6fa1a9db258d3c5945
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4508349
Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>
Commit-Queue: Simon Glass <sjg@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This does not need to be global to the whole file. Move it into the
charging loop.
This makes no functional change.
BUG=b:218332694
TEST=zmake build dev-posix
Change-Id: Ia9e5b4e202535e6b3f9277a66cbdbc87c984d95e
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4508348
Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
Commit-Queue: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add a way to disable some debugging related to the chgstate command. It
is a small, but enough to reclaim 70 bytes for damu.
Use functions to avoid needing #ifdefs in the main body of the code.
Convert the value to a bool while we are here.
BUG=b:218332694
TEST=build on brya and see that the feature is still enabled
$ grep CONFIG_CHARGE_DEBUG build/brya/.config
CONFIG_CHARGE_DEBUG=y
Check damu is the same as before:
*** 12 bytes in flash and 10908 bytes in RAM still available on damu RO ****
Change-Id: I07d2453aa74ab53a29275bba76cd2e8003c5dc14
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4518028
Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
Commit-Queue: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Move this related code into a separate function, to reduce the side of
the charger_task() function.
This makes no functional change.
BUG=b:218332694
TEST=zmake build dev-posix
Change-Id: I20632ed822df5cc2799959b251c29cb160eabcf7
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4508347
Commit-Queue: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Put this code in a separate function, since it is logically related.
This makes no functional change.
BUG=b:218332694
TEST=zmake build dev-posix
Change-Id: I1ebab33e72d5927bbc3fcd1e0562b66102c5c689
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4508346
Reviewed-by: Tristan Honscheid <honscheid@google.com>
Commit-Queue: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Since we are switching from cryptoc to BoringSSL on some boards, we
should support OPENSSL_cleanse() function provided by BoringSSL to avoid
compiling and linking both libcryptoc and BoringSSL.
BUG=b:277029648
TEST=make BOARD=prism
TEST=make BOARD=hammer
TEST=make BOARD=bloonchipper
TEST=make BOARD=dartmonkey
Change-Id: Ief5dc28adecaf33120094ba42e418144cdafe9e5
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4383046
Reviewed-by: Tom Hughes <tomhughes@chromium.org>
Tested-by: Patryk Duda <patrykd@google.com>
Commit-Queue: Patryk Duda <patrykd@google.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Work around coreboot GCC preprocessor bug.
BRANCH=None
BUG=b:272518464
TEST=gcc -E
Change-Id: I90d096f6f3bd30b0d961d3d1d6e802eded076ecd
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4510537
Commit-Queue: Tristan Honscheid <honscheid@google.com>
Reviewed-by: Tristan Honscheid <honscheid@google.com>
Auto-Submit: Jeremy Bettis <jbettis@chromium.org>
Tested-by: Jeremy Bettis <jbettis@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This code relates to deciding on the charge state, so move it into the
same function.
This makes no functional change.
BUG=b:218332694
TEST=zmake build dev-posix
Change-Id: I2d8fb744047f9d986b47b7460bbfa471233f9689
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4508345
Reviewed-by: Al Semjonovs <asemjonovs@google.com>
Tested-by: Simon Glass <sjg@chromium.org>
Commit-Queue: Simon Glass <sjg@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When the AP is controlling the VDMs, it still needs the EC to snoop the
VDM:Attention messages to transmit the HPD GPIO and also to wake it when
a monitor is attached.
BUG=b:266714542
TEST=./twister -T ./zephyr/test, observe monitor working with skyrim and
DNS patch to enable feature
Change-Id: Iebbd434addfd8c3007f330240387130469857403
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4218926
Tested-by: Diana Z <dzigterman@chromium.org>
Commit-Queue: Diana Z <dzigterman@chromium.org>
Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Move this related code into a separate function.
BUG=b:218332694
TEST=zmake build dev-posix
make BOARD=brya -j50 |grep "brya " |sed 's/still.*on //'
*** 33552 bytes in flash and 23168 bytes in RAM brya RO ****
*** 33392 bytes in flash and 23104 bytes in RAM brya RW ****
(RO flash improves a lot, RW down 32 bytes)
Change-Id: Iea944de1706b0bababcebd0474303733c199f64d
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4500692
Commit-Queue: Simon Glass <sjg@chromium.org>
Reviewed-by: Tomasz Michalec <tmichalec@google.com>
Tested-by: Simon Glass <sjg@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Move this related code into a separate function.
Also move the call site up above the sleep-determination code, since
they seem to be unrelated and it seems better to do sleep determination
at the end of the loop.
BUG=b:218332694
TEST=zmake build dev-posix
Change-Id: I2e9b569c3b1fb10991ae2c368f78b1c7c62542e8
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4500691
Commit-Queue: Simon Glass <sjg@chromium.org>
Reviewed-by: Aaron Massey <aaronmassey@google.com>
Tested-by: Simon Glass <sjg@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Move this related code into a separate function.
BUG=b:218332694
TEST=zmake build dev-posix
make BOARD=brya -j50 |grep "brya " |sed 's/still.*on //'
*** 33464 bytes in flash and 23136 bytes in RAM brya RO ****
*** 33424 bytes in flash and 23136 bytes in RAM brya RW ****
(RO flash space decreased from 33488 = 24 bytes)
Change-Id: I24655906c1865e0fc7d3c83a1a74aa708854fbbc
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4500690
Tested-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Yuval Peress <peress@google.com>
Commit-Queue: Simon Glass <sjg@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Move the other goto into the function and turn it into a return.
This makes no functional change.
BUG=b:218332694
TEST=zmake build dev-posix
make BOARD=brya -j50 |grep "brya " |sed 's/still.*on //'
*** 33488 bytes in flash and 23168 bytes in RAM brya RO ****
*** 33424 bytes in flash and 23136 bytes in RAM brya RW ****
(no change since start of series)
Change-Id: I9d0ce317a8bf529aa01c6a0316ec5fb4dfbaa13f
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4500689
Reviewed-by: Aaron Massey <aaronmassey@google.com>
Commit-Queue: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This goes through various steps to decide what charge state to use,
using a goto to get to the final state.
Move the code into a function instead, so we can use a return.
This makes no functional change.
BUG=b:218332694
TEST=zmake build dev-posix
Change-Id: Ibb46b172c5560e64cac8861f4330ddbc5b35649f
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4500688
Tested-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tomasz Michalec <tmichalec@google.com>
Commit-Queue: Simon Glass <sjg@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Split this code out into its own function, called if a change is
detected.
This changes the ordering of the assignment of need_static but should
should not matter.
This makes no functional change.
BUG=b:218332694
TEST=zmake build dev-posix
Change-Id: Ia992c9c03ae2d156b490d071b1b1111d3b077939
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4500687
Tested-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Yuval Peress <peress@google.com>
Commit-Queue: Simon Glass <sjg@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Split this code out into its own function, called if a change is
detected.
Tweak a comment while we are here.
This makes no functional change.
BUG=b:218332694
TEST=zmake build dev-posix
Change-Id: Iabcc117a28004a24a0069b2205e87c92c7807f4b
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4500686
Reviewed-by: Tristan Honscheid <honscheid@google.com>
Commit-Queue: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Convert these to if() to avoid the extra build paths.
This makes no functional change.
BUG=b:218332694
TEST=zmake build dev-posix
Change-Id: I1933097a0a1085cbbeb21e55fa3a26ad01fa042c
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4500685
Commit-Queue: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add a base_ prefix to this so that it is clear it relates to the base
handling. Also drop the #ifdef by moving the function outside it.
This makes no functional change.
BUG=b:218332694
TEST=zmake build dev-posix
Change-Id: I40ba3fec0141e3b382f9801fc26cfee5bff92cd6
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4501290
Reviewed-by: Al Semjonovs <asemjonovs@google.com>
Tested-by: Simon Glass <sjg@chromium.org>
Commit-Queue: Simon Glass <sjg@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Move this into its own function so simplify the main loop.
Fix a comment in the hook at the same time.
This makes no functional change.
BUG=b:218332694
TEST=zmake build dev-posix
Change-Id: Ibdee116e10ab10265ad1718a76ed3401475ad235
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4501289
Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>
Commit-Queue: Simon Glass <sjg@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Take this function outside the #ifdef so we can call it behind an if()
statement. Rename it with a base_ prefix so it is clear which functions
relate to the base, and could perhaps be moved to another file.
This makes no functional change.
Unfortunately we still need the #ifdef in the function due to some
variables which are declared behind that #ifdef.
BUG=b:218332694
TEST=zmake build dev-posix
Change-Id: I102a5b6f98b731b9a2cb42c070b9bd1f20e25f99
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4501288
Commit-Queue: Simon Glass <sjg@chromium.org>
Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Move this into a function to shorten the main loop and avoid an #ifdef
in it.
Use a condition check to call the function so that it is clear that it
relates to the base.
Unfortunately we still need the #ifdef in the function due to the
base_responsive variable.
This makes no functional change.
BUG=b:218332694
TEST=zmake build dev-posix
Change-Id: Ia2c689d5800daff43870dc017defa174f93ea38f
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4501287
Reviewed-by: Aaron Massey <aaronmassey@google.com>
Commit-Queue: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The charger_task() function is extremely long. Start to split it up by
creating a charger_setup() function for the initial setup code.
This makes no functional change.
BUG=b:218332694
TEST=zmake build dev-posix
Change-Id: I12b3ff29c59418ce0819fa28973a8be7a4574dd9
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4501286
Reviewed-by: Aaron Massey <aaronmassey@google.com>
Tested-by: Simon Glass <sjg@chromium.org>
Commit-Queue: Simon Glass <sjg@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
For the Charge Limit feature, we need to discharge down to the upper
limit for the battery sustainer. The Charge Limit feature requires that
the system never charge above 80%, so if the feature is enabled when the
system is over that, it needs to discharge down to 80%.
BUG=b:222619859
TEST=run-sbs_charging_v2
Change-Id: I3f65743144de64411484dd3f2aa6c5fd681a47c9
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4507756
Commit-Queue: Derek Basehore <dbasehore@chromium.org>
Tested-by: Derek Basehore <dbasehore@chromium.org>
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add coverage to much of ocpc_config_secondary_charger() and
ocpc_calc_resistances()
BUG=b:276805061
TEST=./twister -T zephyr/test/ocpc
Change-Id: I78ca222fc44c087807d1419ae1dd15e1875b1b2a
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4504794
Commit-Queue: Tristan Honscheid <honscheid@google.com>
Tested-by: Tristan Honscheid <honscheid@google.com>
Reviewed-by: Peter Marheine <pmarheine@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There are several calls to motion_sense_fifo_stage_data() with the
|sensor| parameter set to NULL. However, motion_sense_fifo_stage_data()
requires a non-NULL value, and will crash otherwise.
Remove those calls, since they are (apparently) dead code. Otherwise,
the EC would be crashing whenever they are executed.
This allows enabling CONFIG_PLATFORM_EC_GESTURE_HOST_DETECTION in
test/drivers/prj.conf, to enable additional testing (which exposed this
bug).
BUG=b:259754018
TEST=emerge-skyrim chromeos-ec chromeos-zephyr -j
Change-Id: I8f641520e04e3f37a1f62e92eeaf1a03cfef07cf
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4499747
Tested-by: Tim Van Patten <timvp@google.com>
Commit-Queue: Tim Van Patten <timvp@google.com>
Reviewed-by: Aaron Massey <aaronmassey@google.com>
|