summaryrefslogtreecommitdiff
path: root/board/storo
Commit message (Collapse)AuthorAgeFilesLines
* charger: Move charger_state_v2.h into charge_state.hSimon Glass2023-05-111-1/+1
| | | | | | | | | | | | | | | | | | | | 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>
* 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-011-5/+5
| | | | | | | | | | | | | | | | | | | | 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-2/+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-6/+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-16/+25
| | | | | | | | | | | | | | | | 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/storo/board.h: Format with clang-formatJack Rosenthal2022-07-071-2/+3
| | | | | | | | | | | | BUG=b:236386294 BRANCH=none TEST=none Tricium: disable Change-Id: Icc5cfee8f3fb5674c5b57e070f39d1fd55b28e5a Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3749424 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* board/storo/board.c: Format with clang-formatJack Rosenthal2022-07-011-161/+130
| | | | | | | | | | | BUG=b:236386294 BRANCH=none TEST=none Change-Id: I4fe321f0ba2f73b5fadabe10642f8e786e6f917c Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3728957 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* board/storo/board.h: Format with clang-formatJack Rosenthal2022-07-011-24/+16
| | | | | | | | | | | BUG=b:236386294 BRANCH=none TEST=none Change-Id: I3f0bf35554a7ba2f567b0760651790723daa1cdf Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3728958 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* board/storo/cbi_ssfc.h: Format with clang-formatJack Rosenthal2022-07-011-1/+0
| | | | | | | | | | | BUG=b:236386294 BRANCH=none TEST=none Change-Id: I5aa83b6223b05923075e8ceab573eec8a411fbd3 Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3728959 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* board/storo/usb_pd_policy.c: Format with clang-formatJack Rosenthal2022-06-281-2/+2
| | | | | | | | | | | BUG=b:236386294 BRANCH=none TEST=none Change-Id: I1a6bbc20c18ddb0ce5e8a0df130c38503dc46722 Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3728972 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* board/storo/cbi_ssfc.c: Format with clang-formatJack Rosenthal2022-06-281-2/+2
| | | | | | | | | | | BUG=b:236386294 BRANCH=none TEST=none Change-Id: I3656389a45ffda0d31d04e37a4ea5aa1e7c5a16e Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3728971 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* board/storo/led.c: Format with clang-formatJack Rosenthal2022-06-281-17/+26
| | | | | | | | | | | BUG=b:236386294 BRANCH=none TEST=none Change-Id: Ief58ab37a9d5cd479c6aaf45bd2db76578ff3eaf Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3728960 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* usbc: wrap task_set_event to have an explicit port argumentFabio Baltieri2022-05-271-2/+2
| | | | | | | | | | | | | | | | | 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>
* storo: Add comments for redrivermike2022-05-131-0/+9
| | | | | | | | | | | | | | | | | | NCS8510 and TUSB544 use the same driver and EQ settings, so add a comment to explain the situation. BUG=b:230403435 BRANCH=dedede TEST=none Signed-off-by: mike <mike5@huaqin.corp-partner.google.com> Change-Id: I24d1dd9f5d46c81bcbca12c7d9b4ae14d963643b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3632041 Commit-Queue: Marco Chen <marcochen@chromium.org> Reviewed-by: wen zhang <zhangwen6@huaqin.corp-partner.google.com> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Marco Chen <marcochen@chromium.org> Tested-by: Marco Chen <marcochen@chromium.org>
* Storo: Increase pd_task stack sizemike2022-04-291-2/+2
| | | | | | | | | | | | | | | | Stack of pd_task may be overflow during some FAFT test, enlarge the stack size to avoid system boot. BUG=b:230833524 BRANCH=dedede TEST=test firmware_FwScreenCloseLid,firmware_FwScreenPressPower and platform_ServoPowerStateController.USBPluggedin pass Signed-off-by: mike <mike5@huaqin.corp-partner.google.com> Change-Id: Ia087d5b6238d4343d1dec9a5c9cdf6c4bb581636 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3615695 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
* Storo: Add battery smbus pec functionMike Lee2022-04-261-0/+1
| | | | | | | | | | | | | | | | | Renesas battery would have error data transmission, so we need the error checking feature to ensure our received data is correct. BUG=b:229600877 BRANCH=dedede TEST=test battery smbus transmission stress pass Signed-off-by: Mike Lee <mike5@huaqin.corp-partner.google.com> Change-Id: I3668a3b771914c389036df80851eb1800021f8b8 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3601925 Reviewed-by: Ganxiang Wang <wangganxiang@huaqin.corp-partner.google.com> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
* Storo: Modify board active charge port settingMike Lee2022-01-061-1/+1
| | | | | | | | | | | | | | | | If the charge port does not change, we don’t need to stop the charge IC. BUG=b:211080520,b:197199689 BRANCH=dedede TEST=make BOARD=storo pass, the DUT can boot up normally when only the 45W adapter is inserted Signed-off-by: Mike Lee <mike5@huaqin.corp-partner.google.com> Change-Id: I5ca07d9cd91c2cecff4f90dc5ab1a62f502c86f0 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3347354 Reviewed-by: wen zhang <zhangwen6@huaqin.corp-partner.google.com> Reviewed-by: Diana Z <dzigterman@chromium.org>
* Revert "Storo: Modify active charge port setting"Mike Lee2022-01-061-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit abc448dfbb68b8b94fbfaf1e8193d44b44cf1107. Reason for revert: sinking must always be re-enabled during the hard reset process, and due to timing differences, we may not always go through the charge port of None in this sequence Original change's description: > Storo: Modify active charge port setting > > If the port is not changing, should not be doing anything. > In order to solve the problem of sometimes unable to boot > under AC only state, we can make a return early. > > BUG=b:197199689 > BRANCH=dedede > TEST=make BOARD=storo pass, the DUT can boot up normally > when only the 45W adapter is inserted > > Signed-off-by: Mike Lee <mike5@huaqin.corp-partner.google.com> > Change-Id: Icec7a5e9a0ed6efdd41489b4fd3e74325f4b81fa > Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3167617 > Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> > Reviewed-by: wen zhang <zhangwen6@huaqin.corp-partner.google.com> > Commit-Queue: Aseda Aboagye <aaboagye@chromium.org> Bug: b:197199689,b:211080520 Change-Id: I21c34e7616e3797dba5c3c77f7591a37f19f3981 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3347352 Reviewed-by: wen zhang <zhangwen6@huaqin.corp-partner.google.com> Tested-by: Mike Lee <mike5@huaqin.corp-partner.google.com> Reviewed-by: Diana Z <dzigterman@chromium.org> Commit-Queue: Mike Lee <mike5@huaqin.corp-partner.google.com>
* Storo: Add battery second source informationMike Lee2021-12-102-4/+36
| | | | | | | | | | | | | | | | Add new battery config BUG=b:206895271 BRANCH=dedede TEST=Check battery info in console and cutoff function work. Signed-off-by: Mike Lee <mike5@huaqin.corp-partner.google.com> Change-Id: I245bbe4a1333e3350b79d22958e888ce01ccadd8 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3289579 Reviewed-by: wen zhang <zhangwen6@huaqin.corp-partner.google.com> Reviewed-by: Henry Sun <henrysun@google.com> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
* tree: Files should end with single newlineTom Hughes2021-10-181-1/+0
| | | | | | | | | | | | | | | | | | | | | | | One of the checks that runs as part of "repo upload" looks for a single newline at the end of each file. I'm getting warnings about this when I touch files that do not follow this, even though I didn't add the extra newlines. This commit fixes all files by running the following: for f in $(find . -name '*.[ch]'); do printf '%s\n' "$(cat ${f})" > ${f}; done BRANCH=none BUG=b:172020503 TEST=./util/compare_build.sh -b all -j 120 => MATCH Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: Ia3ece5b64b549d21ca11708791368002bb6e9b0e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3229797 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* storo: Add motion sense config for BMI220Mike Lee2021-10-123-1/+71
| | | | | | | | | | | | | | | | | | | Add BMI220 base sensor config for second source BUG=b:188373185 BRANCH=dedede TEST=Using ectool 'motionsense' verified lid angle goes from 0 to 360 and swtiches to tablet mode after crossing 200 threshold on re-work bmi220/bmi253 DUT Signed-off-by: Mike Lee <mike5@huaqin.corp-partner.google.com> Change-Id: I9e72bb898b2dbfe68e44248f0238982921c4a198 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3077596 Reviewed-by: Henry Sun <henrysun@google.com> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: jesen <wangganxiang@huaqin.corp-partner.google.com> Reviewed-by: Weimin Wu <wuweimin@huaqin.corp-partner.google.com> Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
* Storo: Modify active charge port settingMike Lee2021-09-171-0/+4
| | | | | | | | | | | | | | | | | | If the port is not changing, should not be doing anything. In order to solve the problem of sometimes unable to boot under AC only state, we can make a return early. BUG=b:197199689 BRANCH=dedede TEST=make BOARD=storo pass, the DUT can boot up normally when only the 45W adapter is inserted Signed-off-by: Mike Lee <mike5@huaqin.corp-partner.google.com> Change-Id: Icec7a5e9a0ed6efdd41489b4fd3e74325f4b81fa Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3167617 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: wen zhang <zhangwen6@huaqin.corp-partner.google.com> Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
* Revert "storo: update EC thermal table"Mike Lee2021-08-192-37/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 9193fc043f70b7fa657e30605ec18b1f548b2ac8. Reason for revert: Because this CL affects the boot problem of ac only Original change's description: > storo: update EC thermal table > > Update EC thermal table for throttle and shutdown point. > > BUG=b:194967456 > BRANCH=dedede > TEST=make BOARD=storo and verify function pass by thermal team. > > Signed-off-by: mike <mike5@huaqin.corp-partner.google.com> > Change-Id: Ia5f78111c40aee613bfba5e96ce0af93cb7c81e5 > Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3062706 > Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> > Commit-Queue: Aseda Aboagye <aaboagye@chromium.org> Bug: b:197199689 Change-Id: I59374bf9a95abf606d11575456fefafdbd84507c Signed-off-by: Mike Lee <mike5@huaqin.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3106908 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
* lid_angle: Create a common callback for lid angle changesWai-Hong Tam2021-08-051-3/+1
| | | | | | | | | | | | | | | | | | | | | | Each board defines its own callback lid_angle_peripheral_enable(). The implementation is very similar. Create a common implementation and reduce the duplicated code. This CL removes the board callbacks which are identifical to the common callback. If it is slightly different, keep it and add the __override tag. The check of TEST_BUILD is unnecessary as the board callback is not linked in the test build. BRANCH=None BUG=b:194922043 TEST=Build all the images. Change-Id: I73d381730f35b80eff69399cdfc5fb54f839aee0 Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3069175 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* storo: update EC thermal tablemike2021-08-022-0/+37
| | | | | | | | | | | | | | Update EC thermal table for throttle and shutdown point. BUG=b:194967456 BRANCH=dedede TEST=make BOARD=storo and verify function pass by thermal team. Signed-off-by: mike <mike5@huaqin.corp-partner.google.com> Change-Id: Ia5f78111c40aee613bfba5e96ce0af93cb7c81e5 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3062706 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
* storo: add 2nd accel source KX022mike2021-07-212-0/+43
| | | | | | | | | | | | | | | | | Add 2nd lid accel source KX022 BUG=b:188373186 BRANCH=dedede TEST=make BOARD=storo 1. Set CBI SSFC 0x11 and use command "ectool motionsense" for sensor kx022 2. test factory test pass Signed-off-by: mike <mike5@huaqin.corp-partner.google.com> Change-Id: Ibba58d53cf6fbfa35ba0c8e7fe73d4ebfdb9e7c8 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3037288 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
* storo: remove base sensor of clamshell boardMike Lee2021-07-212-12/+48
| | | | | | | | | | | | | | | according to OEM request, we will remove base sensor for clamshell baord in DVT2 state. BUG=b:193314277 BRANCH=dedede TEST=make BOARD=storo pass, and test rework board OK. Signed-off-by: Mike Lee <mike5@huaqin.corp-partner.google.com> Change-Id: Iefc965f468529e48c521c600f3edd98fabb1cdff Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3016494 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
* dedede: Make scope of SSFC definition per boardParth Malkan2021-07-193-1/+97
| | | | | | | | | | | | | | | | | | | | | | SSFC bit definition started diverging between coreboot and EC. To avoid conflicts move the definitions of SSFC bits within EC to per board instead of at a baseboard level. Base sensor and Lid sensor components are common across all boards Base Sensor - bits 0-2 Lid Sensor - bits 3-5 In addition, Sasuke uses bits 6-8 for usb superspeed mux Cret board uses bits 9-11 in coreboot for audio codec BRANCH=firmware-dedede-13606.B BUG=b:187694527 TEST=make buildall Signed-off-by: Parth Malkan <parthmalkan@google.com> Change-Id: Ib0f732e5d41668135ff180c545ff4bb6a1cb1427 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3021932 Reviewed-by: YH Lin <yueherngl@chromium.org> Reviewed-by: Marco Chen <marcochen@chromium.org>
* dedede: Enable CONFIG_ASSERT_CCD_MODE_ON_DTS_CONNECTRob Barnes2021-07-021-1/+1
| | | | | | | | | | | | | | | | | | Enable CONFIG_ASSERT_CCD_MODE_ON_DTS_CONNECT on all dedede boards. This will assert GPIO_CCD_MODE_ODL when a debug device is connected to a CCD port. GPIO_CCD_MODE_ODL must be configured as an open drain so EC and Cr50 don't drive fight. BUG=b:190189242 TEST=Build dedede BRANCH=None Change-Id: I2d71312967f2d4a693ac9753279f49478e8c092c Signed-off-by: Rob Barnes <robbarnes@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2976759 Reviewed-by: Diana Z <dzigterman@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Tested-by: Diana Z <dzigterman@chromium.org>
* storo: change icm-42607 sensor configMike Lee2021-06-291-14/+17
| | | | | | | | | | | | | | | change icm-42607 sensor location from lid to base BUG=b:192334282 BRANCH=dedede TEST=make BOARD=storo pass, and use 'ectool motionsense info 1' can show correct location. Signed-off-by: Mike Lee <mike5@huaqin.corp-partner.google.com> Change-Id: Ie733f6b08fb28599bd31a81cd071437862350324 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2994744 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
* keeby/dedede: Gate temp sensor access by GPIOAseda Aboagye2021-06-291-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | On dedede and keeby boards, the thermistors are powered by the EC's GPIO_EN_PP3300_A pin. If the thermistors are read before they are powered then the EC may force a thermal shutdown due to the bad reading. This commit simply defines CONFIG_TEMP_SENSOR_POWER_GPIO along with a CONFIG_TEMP_SENSOR_FIRST_READ_DELAY_MS to ensure we don't get any false positive thermal shutdowns. BUG=b:192053176 BRANCH=dedede TEST=Build and flash lalala. Unplug AC charger from DUT, press refresh+power button to reset DUT, verify that DUT boots up automatically. TEST=Repeat above test with madoo. Signed-off-by: Aseda Aboagye <aaboagye@google.com> Change-Id: I2a49e2f896c4120a8f01f440ea22c9b3763c6589 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2988364 Tested-by: Aseda Aboagye <aaboagye@chromium.org> Auto-Submit: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Diana Z <dzigterman@chromium.org> Commit-Queue: Diana Z <dzigterman@chromium.org>
* chgstv2: Unify power-on and shutdown battery thresholdsDaisuke Nojiri2021-06-231-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, power-on battery SoC and shutdown battery SoC are independently configured by each board. This patch will unify the setting as follows: CONFIG_CHARGER_MIN_BAT_PCT_FOR_POWER_ON = 2 (don't boot if soc < 2%) CONFIG_BATT_HOST_SHUTDOWN_PERCENTAGE = 2 (shutdown if soc <= 2%) BATTERY_LEVEL_SHUTDOWN = 3 (shutdown if soc < 3%) CONFIG_BATTERY_EXPORT_DISPLAY_SOC = Y (removed) CONFIG_CHARGER_MIN_BAT_PCT_FOR_POWER_ON_WITH_AC = 1 This allows us to show the low battery alert whenever we can because EC doesn't inhibit power-on even if it knows the host would immediately shut down. With CONFIG_BATTERY_EXPORT_DISPLAY_SOC, boards will start using the CONFIG_BATT_HOST_SHUTDOWN_PERCENTAGE = 2% as the low battery threshold (and the SoC will be agreed between the EC and Powerd). Boards with CONFIG_CHARGER_MIN_BAT_PCT_FOR_POWER_ON = 1 will keep the same threshold. This is for avoiding degrading the UX by increasing the power-on threshold (even though a question that 1% may not be enough for soft sync to finish consistently remains to be answered). Boards with CONFIG_CHARGER_MIN_BAT_PCT_FOR_POWER_ON > 2 will have a lower threshold but we think 2% is enough to finish the software sync. A lower threshold also improves the UX by showing the low battery alert in the situation where otherwise the system would leave the user uninformed by not responding to a power button press. BUG=b:191837893 BRANCH=None TEST=buildall Change-Id: If6ff733bc181f929561a3fffb8a84e760668ce37 Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2981468 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* storo: tune tusb544 EQ settingMike Lee2021-06-081-0/+99
| | | | | | | | | | | | | | | | Modify strength value setting of tusb544, set vod dcgain setting_5,set usb eq 15,and set dp eq 6. BUG=b:183583917,b:183586638 BRANCH=dedede TEST=make BOARD=storo and verified pass by EE Signed-off-by: Mike Lee <mike5@huaqin.corp-partner.google.com> Change-Id: Ic8b16fed18e06e4fa763faf47c2041dc1d3c29f1 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2784332 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
* storo: Add motion sensor config for lis2dwl/icm-42607Mike Lee2021-06-033-33/+155
| | | | | | | | | | | | | | | | | Add icm-42607 config for new second source base accel/gyro, and lis2dwl lid accel config for new second source. BUG=b:188373185,b:188373186 BRANCH=dedede TEST=Using ectool 'motionsense' verified lid angle goes from 0 to 360 and swtiches to tablet mode after crossing 200 threshold on re-work lis2dwl/icm-42607 DUT. Signed-off-by: Mike Lee <mike5@huaqin.corp-partner.google.com> Change-Id: I2080816aeb0f5f542d773b8dbe219dbe6efd4226 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2912409 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
* storo:The stylus has no function when the first time using the stylus.stabilize-13970.B-mainqinwentao2021-05-141-0/+3
| | | | | | | | | | | | | | | | | fix the power-on detection of the stylus BUG=b:187970959 BRANCH=dedede TEST=make -j BOARD=storo Signed-off-by: jesen <wangganxiang@huaqin.corp-partner.google.com> Change-Id: Iabde2114464865b7b1cae865bd0737cdb54c9b4a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2891678 Reviewed-by: Henry Sun <henrysun@google.com> Reviewed-by: Mike Lee <mike5@huaqin.corp-partner.google.com> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
* storo: remove CONFIG_SYSTEM_UNLOCKED for faft_ecMike Lee2021-05-131-3/+0
| | | | | | | | | | | | | | | Remove CONFIG_SYSTEM_UNLOCKED for firmware qual test BUG=b:187867613 BRANCH=dedede TEST=make BOARD=storo pass TEST=test firmware_ECSystemLocked pass Signed-off-by: Mike Lee <mike5@huaqin.corp-partner.google.com> Change-Id: I7233db423321ba1e3753afa7c012142df5c0259b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2891682 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
* Storo: Use display SoC to control charge LEDDaisuke Nojiri2021-05-101-0/+3
| | | | | | | | | | | | | | | | | | | | Currently, Storo uses the state of charge provided from the battery. This isn't the same as the SoC shown on the screen because Powerd compensates it based on the full factor and the low battery shutdown threshold. This change makes Storo use the display SoC for the charge LED module so that the charge LED and the display SoC synchronously work. BUG=b:181506409 BRANCH=dedede TEST=Storo's LED turns from amber to white when the display soc reaches 95% (internally 94.6%). Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Change-Id: I42c505c9fbd39f82de2318f0d7ff8589eeca4d8c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2876165 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* LED On/Off: Make battery LED optionalDiana Z2021-04-221-4/+5
| | | | | | | | | | | | | | | Currently, all boards using the LED On/Off module have battery LEDs. However, if we'd like to expand support to Chromeboxes then the battery LED must become optional. BRANCH=None BUG=b:185508707 TEST=make -j buildall Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: Ieae098829ebe6c8b103f23d5abdbf70e7bcbdf2d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2832692 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* dedede/raa489000: Enable ASGATE when sourcingAseda Aboagye2021-04-011-0/+5
| | | | | | | | | | | | | | | | | | | | With the previous change to disable the ASGATE from the charger side, this actually ended up breaking sourcing VBUS. This commit enables the ASGATE when we are attempting to source VBUS. BUG=b:183220414 BRANCH=dedede TEST=Build and flash madoo, plug in a Type-C sink, verify that VBUS is sourced. TEST=Verify that DUT can PR_Swap with peripheral. Signed-off-by: Aseda Aboagye <aaboagye@google.com> Change-Id: I1938f2b827e57a04ef72e2ad35ad6ff29ce18712 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2795073 Reviewed-by: Diana Z <dzigterman@chromium.org> Commit-Queue: Aseda Aboagye <aaboagye@chromium.org> Tested-by: Aseda Aboagye <aaboagye@chromium.org>
* Reland "dedede/raa489000: Disable ASGATE from READY state"Aseda Aboagye2021-04-011-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a reland of f7fbc629f0655229cc7ffdadfb18c9e13118e3d2 Original change's description: > dedede/raa489000: Disable ASGATE from READY state > > On the boards which use the RAA489000, we keep the ADC enabled while > giving VBUS control to the charger side. This can cause a situation > where VBUS is not quite zero volts when a charger is removed. This > commit uses the charger side registers to control the ASGATE when > selecting our active charge port. This is done in addition to the > existing implementation which uses the TCPCI registers to control > ASGATE. When we place the parts into low power mode, we move the VBUS > control from the TCPC side of the IC to the charger side. It should > be safe to issue both commands as if the TCPC side has control, the IC > ignores the setting from the charger side registers. > > BUG=b:183220414 > BRANCH=dedede > TEST=Build and flash madoo, plug in charger to port, unplug, verify > that VBUS falls to < 200mV and decays from there. > > Signed-off-by: Aseda Aboagye <aaboagye@google.com> > Change-Id: I8e8c8cc32575d18c9d3d1210ed3c5cf69ad5ca4b > Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2793058 > Tested-by: Aseda Aboagye <aaboagye@chromium.org> > Reviewed-by: Diana Z <dzigterman@chromium.org> > Commit-Queue: Aseda Aboagye <aaboagye@chromium.org> Bug: b:183220414 Change-Id: I36db53f3e13ba848308cd7e0c94a1b5a3551c600 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2797549 Reviewed-by: Diana Z <dzigterman@chromium.org> Commit-Queue: Aseda Aboagye <aaboagye@chromium.org> Tested-by: Aseda Aboagye <aaboagye@chromium.org>
* dedede/raa48900 boards: Apply 4% ICL reductionMike Lee2021-03-311-2/+3
| | | | | | | | | | | | | | | | | | The RAA48900 charger IC seems to over draw its contract by roughly 4%. This commit simply modifies our input current limit to account for that. BUG=b:147463641 BRANCH=dedede TEST=Build and flash storo and sasukette,verify that input current limit is reduced and is under the contract. Signed-off-by: Mike Lee <mike5@huaqin.corp-partner.google.com> Change-Id: I37bc4fba776114f3386d79ff118edd7add104a67 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2780856 Reviewed-by: Henry Sun <henrysun@google.com> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Commit-Queue: Henry Sun <henrysun@google.com>
* Add a common header for board_is_sourcing_vbus()Simon Glass2021-03-311-2/+0
| | | | | | | | | | | | | | | | This function prototype is defined in lots of files, none of which is visible to Zephyr. Add a prototype in one place and remove the others. BUG=b:183296099 BRANCH=none TEST=make buildall Signed-off-by: Simon Glass <sjg@chromium.org> Change-Id: Ia324327a69b117483ab9ee5c85eba93c0fb5ad9c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2789799 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* Revert "dedede/raa489000: Disable ASGATE from READY state"Aseda Aboagye2021-03-311-7/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit f7fbc629f0655229cc7ffdadfb18c9e13118e3d2. Reason for revert: Breaks sourcing of VBUS. Original change's description: > dedede/raa489000: Disable ASGATE from READY state > > On the boards which use the RAA489000, we keep the ADC enabled while > giving VBUS control to the charger side. This can cause a situation > where VBUS is not quite zero volts when a charger is removed. This > commit uses the charger side registers to control the ASGATE when > selecting our active charge port. This is done in addition to the > existing implementation which uses the TCPCI registers to control > ASGATE. When we place the parts into low power mode, we move the VBUS > control from the TCPC side of the IC to the charger side. It should > be safe to issue both commands as if the TCPC side has control, the IC > ignores the setting from the charger side registers. > > BUG=b:183220414 > BRANCH=dedede > TEST=Build and flash madoo, plug in charger to port, unplug, verify > that VBUS falls to < 200mV and decays from there. > > Signed-off-by: Aseda Aboagye <aaboagye@google.com> > Change-Id: I8e8c8cc32575d18c9d3d1210ed3c5cf69ad5ca4b > Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2793058 > Tested-by: Aseda Aboagye <aaboagye@chromium.org> > Reviewed-by: Diana Z <dzigterman@chromium.org> > Commit-Queue: Aseda Aboagye <aaboagye@chromium.org> Bug: b:183220414 Change-Id: Ibf6c161adca9981a065e969b6c3b73dd408ef1ba Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2796411 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Commit-Queue: Aseda Aboagye <aaboagye@chromium.org> Tested-by: Aseda Aboagye <aaboagye@chromium.org> Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
* dedede/raa489000: Disable ASGATE from READY stateAseda Aboagye2021-03-301-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | | On the boards which use the RAA489000, we keep the ADC enabled while giving VBUS control to the charger side. This can cause a situation where VBUS is not quite zero volts when a charger is removed. This commit uses the charger side registers to control the ASGATE when selecting our active charge port. This is done in addition to the existing implementation which uses the TCPCI registers to control ASGATE. When we place the parts into low power mode, we move the VBUS control from the TCPC side of the IC to the charger side. It should be safe to issue both commands as if the TCPC side has control, the IC ignores the setting from the charger side registers. BUG=b:183220414 BRANCH=dedede TEST=Build and flash madoo, plug in charger to port, unplug, verify that VBUS falls to < 200mV and decays from there. Signed-off-by: Aseda Aboagye <aaboagye@google.com> Change-Id: I8e8c8cc32575d18c9d3d1210ed3c5cf69ad5ca4b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2793058 Tested-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Diana Z <dzigterman@chromium.org> Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
* genvif: Use VIF overrides by defaultAbe Levkoy2021-03-301-0/+3
| | | | | | | | | | | | | | Use board-specific override files when generating VIFs for boards. BUG=b:172276715 TEST=make buildall BRANCH=none Signed-off-by: Abe Levkoy <alevkoy@chromium.org> Change-Id: I197365018ceb8197c22d631cebf4cbce1c0119f7 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2785506 Reviewed-by: Denis Brockus <dbrockus@chromium.org> Commit-Queue: Denis Brockus <dbrockus@chromium.org>