summaryrefslogtreecommitdiff
path: root/board/beetley
Commit message (Collapse)AuthorAgeFilesLines
* Default charger current derating to 5%Peter Marheine2023-01-121-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Not derating seems like a common pitfall that can cause problems with some chargers, so set a reasonably conservative default. 5% is chosen as the most common derating factor used among boards today (counting occurrences in source code, so this may undercount 5% occurrences because several projects set 5% at the project rather than board-level): 1. 38 x 5% 2. 23 x 4% 3. 6 x 10% 3. 2 x 3% 4. 1 x 2% Boards that currently configure this setting are modified only to continue building without warnings regardless of whether they use the new default value in order to signal that they were explicitly configured. BUG=b:260774380 TEST=make buildall / zmake build -a BRANCH=none Change-Id: I017849d38572fbc48090ae1fa2c539b808e426f9 Signed-off-by: Peter Marheine <pmarheine@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4109651 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com>
* board: Sort header filesJeremy Bettis2022-12-012-4/+4
| | | | | | | | | | | | | | | | | | | | Sort all includes in board with the clang-format rules used by the zephyr project. BRANCH=None BUG=b:247100970 TEST=zmake build -a TEST=./twister --clobber -v -i TEST=make -j72 buildall_only runtests TEST=zmake compare-builds -a Signed-off-by: Jeremy Bettis <jbettis@google.com> Change-Id: I6ad72b167cbb768a64c338fa633eb4bf5a401897 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4060360 Reviewed-by: Tom Hughes <tomhughes@chromium.org> Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org> Tested-by: Jeremy Bettis <jbettis@chromium.org> Commit-Queue: Jeremy Bettis <jbettis@chromium.org>
* Add default implementation of board_set_charge_limitPeter Marheine2022-11-241-6/+0
| | | | | | | | | | | | | | | | | | | The majority of boards simply call charge_set_input_current_limit() from board_set_charge_limit() now that the minimum current limit and derating are available as config options. Make this the default behavior of the charge manager, overridable by boards as needed. Boards that have existing custom behavior retain it, with their versions of board_set_charge_limit() marked as __override as necessary. BUG=b:163093572 TEST=make buildall; zmake build -a BRANCH=none Signed-off-by: Peter Marheine <pmarheine@chromium.org> Change-Id: I72475ca0e8381596cafbcda4b042c7f884ae0432 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4022857 Reviewed-by: Keith Short <keithshort@chromium.org>
* Add CONFIG_CHARGER_MIN_INPUT_CURRENT_LIMITPeter Marheine2022-11-231-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This splits the dual use of CONFIG_CHARGER_INPUT_CURRENT into two different symbols, changing the uses of that which are used to set a minimum current limit to be CONFIG_CHARGER_MAX_INPUT_CURRENT_LIMIT. Most boards implement this in the same way within either the board or baseboard, so handling of the new option is moved into charge_set_input_current_limit (which is called by every user of the option) and every board which repeated this pattern has the new symbol set to the same value as the old one, with the duplicated code deleted. One functional change to the charge manager is made: when charging stops, the input current limit is set to the default value (CONFIG_CHARGER_INPUT_CURRENT) rather than 0. This captures the intent that the default current is appropriate at any time, which was previously configured by individual boards' implementation of board_set_charge_limit() while still allowing the limit to be set lower as needed. To verify that all changes are appropriate, the following has been manually checked: * All boards with a change to a .c file also have a .h change * All boards without a changed .h file have a changed baseboard.h * For Zephyr projects, those with a changed .c file have config added for the minimum limit and others (only corsola) are unchanged to leave it off. This is intended to verify that each board that duplicated the MAX() logic has its configuration updated to use the shared copy, and that boards with that code in the baseboard also update their configuration. BUG=b:163093572 TEST=make buildall; zmake build -a BRANCH=none LOW_COVERAGE_REASON=added lines will soon be deleted Change-Id: Ia460a16293c1fb82aac3784fd9be57ba0985f2fe Signed-off-by: Peter Marheine <pmarheine@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4019703 Reviewed-by: Keith Short <keithshort@chromium.org> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com>
* Add CONFIG_CHARGER_INPUT_CURRENT_DERATE_PCTPeter Marheine2022-11-172-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Many boards derate their charge current limits by some fixed ratio, which results in duplicate code appearing in many different boards. Since nearly all of these are in implementations of board_set_charge_limit() and themselves call charge_set_input_current_limit(), make that derating a config option and move it into charge_set_input_current_limit(). This makes most boards' implementations uniform and ripe for further simplification in later changes. For those boards that do more complex adjustments, those can be retained by keeping the existing logic in board_set_charge_limit(). Several boards also uselessly defined multiple versions of board_set_charge_limit(): the redundant ones are removed. BUG=b:163093572 TEST=make buildall; zmake build -a BRANCH=none LOW_COVERAGE_REASON=follow-up CLs delete uncovered code Change-Id: I0a7162e72538a91ad06ba85b91a10b93eb6af96b Signed-off-by: Peter Marheine <pmarheine@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4015966 Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com> Commit-Queue: Keith Short <keithshort@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org>
* dedede: usb_mux: Split struct usb_mux in dedede boardsTomasz Michalec2022-09-131-5/+8
| | | | | | | | | | | | | | | | Update dedede boards to use new struct usb_mux_chain. BUG=b:236274003 TEST=make buildall BRANCH=None Cq-Depend: chromium:3748785 Signed-off-by: Tomasz Michalec <tm@semihalf.com> Change-Id: Ie73f5bc250c436a2d72fdfb4c8f8707f05fba9f6 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3779623 Commit-Queue: Tomasz Michalec <tmichalec@google.com> Reviewed-by: Keith Short <keithshort@chromium.org> Tested-by: Tomasz Michalec <tmichalec@google.com>
* Update license boilerplate text in source code filesMike Frysinger2022-09-1210-10/+10
| | | | | | | | | | | | | | | Normally we don't do this, but enough changes have accumulated that we're doing a tree-wide one-off update of the name & style. BRANCH=none BUG=chromium:1098010 TEST=`repo upload` works Change-Id: Icd3a1723c20595356af83d190b2c6a9078b3013b Signed-off-by: Mike Frysinger <vapier@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3891203 Reviewed-by: Jeremy Bettis <jbettis@chromium.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* dedede: limit PD voltage to 15V for boards with SM5803Peter Marheine2022-07-211-0/+1
| | | | | | | | | | | | | | | | | | | | | | Silicon Mitus have stated that the SM5803 may be damaged by voltage spikes on VBUS in excess of 20V, and recommended that VBUS above 15V not be used to prevent damage. Although dedede configures the max PD power to 45W which will usually result in 15V@3A maximum, 20V@2.25A is also a valid choice that would be dangerous. Boards that do not use the SM5803 are unchanged, but the setting must now be specified for each board because it is not uniform across all dedede boards. BUG=b:230712704 TEST=make buildall BRANCH=none Signed-off-by: Peter Marheine <pmarheine@chromium.org> Change-Id: I5b2359fc2720ef0b5a7f2480ff67e0e821c378ad Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3778900 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Diana Z <dzigterman@chromium.org>
* board/beetley/cbi_ssfc.h: Format with clang-formatJack Rosenthal2022-07-011-1/+0
| | | | | | | | | | | BUG=b:236386294 BRANCH=none TEST=none Change-Id: I484b2362fc471d265e3ddc2c6ec0851bb10177ba Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3728030 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* board/beetley/usb_pd_policy.c: Format with clang-formatJack Rosenthal2022-07-011-2/+2
| | | | | | | | | | | BUG=b:236386294 BRANCH=none TEST=none Change-Id: I882264deced3820efd3755b23710de21371e5c73 Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3728050 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* board/beetley/board.c: Format with clang-formatJack Rosenthal2022-06-301-58/+41
| | | | | | | | | | | BUG=b:236386294 BRANCH=none TEST=none Change-Id: I3f2faaab68be035036d8d4532c53b823ef93f578 Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3728047 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* board/beetley/led.c: Format with clang-formatJack Rosenthal2022-06-291-27/+31
| | | | | | | | | | | BUG=b:236386294 BRANCH=none TEST=none Change-Id: I797411dd4ccaec6c5c398dc9a1ef7004fdf48ef3 Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3728031 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* board/beetley/board.h: Format with clang-formatJack Rosenthal2022-06-281-9/+4
| | | | | | | | | | | BUG=b:236386294 BRANCH=none TEST=none Change-Id: Id6efb540c72ba27076994dd060067e6723248be2 Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3728048 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* board/beetley/cbi_ssfc.c: Format with clang-formatJack Rosenthal2022-06-281-2/+2
| | | | | | | | | | | BUG=b:236386294 BRANCH=none TEST=none Change-Id: I78b5760757095b965fe5d039e942f123392d7630 Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3728049 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* usbc: wrap task_set_event to have an explicit port argumentFabio Baltieri2022-05-271-1/+1
| | | | | | | | | | | | | | | | | Define an explicit function to set events for the usb charger tasks, so that the caller is not coupled to the internal task implementation, and we can use a single task on a later patch. BRANCH=none BUG=b:226411332 TEST=make buildall TEST=zmake testall TEST=cq dry run Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com> Change-Id: I7a1223642b800568bf4f9864f75b2b647c84d29f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3663746 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* board/baseboard: Remove ACCEL_INTERRUPTSGwendal Grignou2022-05-231-1/+0
| | | | | | | | | | | | | | Use a finer grain set of define, to allow some sensors to use interrupt when wired properly and some use force mode when not using interrupt. BUG=b:230401133 BRANCH=asurada,dedede,brya TEST=Build all. Check Zephyr with herobrine. Check on bugzzy. Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Change-Id: I9c7d50b88a0eaec017f4e5e2ccfdb80761d71fb3 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3609121 Reviewed-by: Yuval Peress <peress@google.com>
* motion_sensor: Remove |int_signal| fieldGwendal Grignou2021-12-141-4/+0
| | | | | | | | | | | | | | | | | | | | | |int_signal| was used to check interrupt signal to protect from interrupt coming while processing FIFO. Instead, use loop until all FIFO samples are processed, as used in linux kernel sensor fifo routine. [See for example see st_lsm6dsx_handler_thread() in driver/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c]. BUG=b:207055975,b:129159505 BRANCH="asurada atlas chameleon dedede drallion endeavour fpmcu grunt hatch icarus kalista keeby kukui mistral nami nocturne octopus poppy puff quiche rammus sarien trogdor volteer zork" TEST=testall, both cros_ec and zephyr. Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Change-Id: I3cfd63c73a7361522ddf42a686dcffdac38d8741 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3328808 Reviewed-by: Diana Z <dzigterman@chromium.org>
* beetley: Initial ECwuzhongtian2021-09-087-709/+549
| | | | | | | | | | | | | | | Create beetley BUG=b:198713668 BRANCH=dedede TEST=make BOARD=beetley pass Signed-off-by: wuzhongtian <wuzhongtian@huaqin.corp-partner.google.com> Change-Id: I2f8c64708eb628ce55cef56e4c36e12845dd8f55 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3146776 Reviewed-by: Mike Lee <mike5@huaqin.corp-partner.google.com> Reviewed-by: Shou-Chieh Hsu <shouchieh@chromium.org> Commit-Queue: Shou-Chieh Hsu <shouchieh@chromium.org>
* beetley: Initial EC imageZhi Li2021-09-0811-0/+1504
Create the initial EC image for the beetley variant by copying the waddledee reference board EC files into a new directory named for the variant. (Auto-Generated by create_initial_ec_image.sh version 1.5.0). BUG=b:198713668 BRANCH=None TEST=make BOARD=beetley Signed-off-by: Zhi Li <lizhi7@huaqin.corp-partner.google.com> Change-Id: I5663d92180d87ca217f698cc0ed31c3494c777a9 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3139530 Reviewed-by: Weimin Wu <wuweimin@huaqin.corp-partner.google.com> Reviewed-by: Shou-Chieh Hsu <shouchieh@chromium.org> Commit-Queue: Shou-Chieh Hsu <shouchieh@chromium.org>