summaryrefslogtreecommitdiff
path: root/baseboard/zork
Commit message (Collapse)AuthorAgeFilesLines
* charger: Move charger_state_v2.h into charge_state.hSimon Glass2023-05-111-1/+0
| | | | | | | | | | | | | | | | | | | | 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>
* Rename CONFIG_CHARGER_INPUT_CURRENT to _CHARGER_DEFAULT_CURRENT_LIMITPeter Marheine2022-11-291-1/+1
| | | | | | | | | | | | | | | | | | | "Default input current" is not a very clear name, so rename this option to better express its use as a default value that is set in the charger. This is made possible by splitting other uses into CHARGER_MIN_INPUT_CURRENT_LIMIT, making the only use for CHARGER_INPUT_CURRENT be as a default. BUG=b:163093572 TEST=make buildall; zmake build -a BRANCH=none LOW_COVERAGE_REASON=isl9241 and sm5803 currently lack emulators Signed-off-by: Peter Marheine <pmarheine@chromium.org> Change-Id: Ia9c1df9061825b15477466e85343afeb2a371288 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4025404 Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com> Reviewed-by: Keith Short <keithshort@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>
* baseboard: Remove unused externsJeremy Bettis2022-11-231-18/+0
| | | | | | | | | | | | | | | | | | | | | The symbols zork_base_standard_ref and grunt_base_standard_ref are never actually defined or used anywhere. BRANCH=None BUG=b:247100970 TEST=zmake build -a TEST=./twister --clobber -v -i TEST=make -j$(nproc) buildall_only runtests TEST=zmake compare-builds Change-Id: I1425ceb38f1de45e50c98f86f4df4221602120e0 Signed-off-by: Jeremy Bettis <jbettis@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4049881 Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com> Auto-Submit: Jeremy Bettis <jbettis@chromium.org> Commit-Queue: Simon Glass <sjg@chromium.org> Tested-by: Jeremy Bettis <jbettis@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org>
* Add CONFIG_CHARGER_MIN_INPUT_CURRENT_LIMITPeter Marheine2022-11-232-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* baseboard: Sort header filesJeremy Bettis2022-11-232-2/+2
| | | | | | | | | | | | | | | | | | | | | Sort all includes in baseboard 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 Signed-off-by: Jeremy Bettis <jbettis@google.com> Change-Id: I259d3bae478d1f649623bc56339e2f8423ede0dc Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4049441 Tested-by: Jeremy Bettis <jbettis@chromium.org> Commit-Queue: Simon Glass <sjg@chromium.org> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com> Reviewed-by: Simon Glass <sjg@chromium.org> Auto-Submit: Jeremy Bettis <jbettis@chromium.org>
* driver/retimer/ps8818.h: Add I2C ADDR FLAGS 0x30, 0x58, 0x70Tommy Chung2022-11-221-1/+1
| | | | | | | | | | | | BUG=b:259354679 BRANCH=none TEST=make buildall -j Signed-off-by: Tommy Chung <tommy.chung@quanta.corp-partner.google.com> Change-Id: Ia93b7fb6c927e2d527186e0d59d3e37da01ed820 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4001240 Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com> Reviewed-by: Zhuohao Lee <zhuohao@chromium.org>
* Zephyr: Add shim support for PS8818Diana Z2022-09-201-1/+1
| | | | | | | | | | | | | | | | | Add support for the PS8818 in the shim so it can be configured using the devicetree. Note that all of the PS8818's include file is "public" in that boards regularly manipulate the registers directly rather than through well-formed APIs. BRANCH=None BUG=b:244457125 TEST=zmake build skyrim Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: Ia182ca5617d312db2acb8fb7680a7847a3a7ecb8 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3905887 Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com> Reviewed-by: Keith Short <keithshort@chromium.org>
* zork: usb_mux: Split struct usb_mux in zork boardsTomasz Michalec2022-09-131-1/+1
| | | | | | | | | | | | | | | | Update zork 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: I0ce3899148a8b5e9bc95abbc929adb63f27f42fc Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3779619 Commit-Queue: Tomasz Michalec <tmichalec@google.com> Tested-by: Tomasz Michalec <tmichalec@google.com> Reviewed-by: Keith Short <keithshort@chromium.org>
* 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>
* Zephyr: Add AOZ1380 to PPC devicetreeDiana Z2022-09-081-1/+1
| | | | | | | | | | | | | | | | Add the AOZ1380 as an option into the zephyr shim for boards to set up in their devicetree. BRANCH=None BUG=b:244457125 TEST=zmake build skyrim; make -j buildall Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: I1876cdca462fe9d7db0dcc0f4d2043cb43639c6d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3880670 Reviewed-by: Keith Short <keithshort@chromium.org> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com> Commit-Queue: Keith Short <keithshort@chromium.org>
* tree-wide: const-ify argv for console commandsCaveh Jalali2022-09-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | This updates the API for console commands from "int cmd(int argc, char **argv)" to "int cmd(int argc, const char **argv)" which is more accurate and in line with common convention. BRANCH=none BUG=b:244387210 TEST="make buildall" passes TEST="zmake build -a" passes TEST="util/compare_build.sh -b all" passes TEST="./twister -v -T zephyr/test" passes Cq-Depend: chrome-internal:4960125 Cq-Depend: chrome-internal:4959932 Change-Id: I57de9f35b85b8f3c7119df36aefb2abf25d2625f Signed-off-by: Caveh Jalali <caveh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3863941 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Tom Hughes <tomhughes@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org>
* tree: Replace %pT with snprintf_timestampTom Hughes2022-07-151-1/+4
| | | | | | | | | | | | | | | | | Using standard format specifiers makes it easier to switch between the "builtin" EC standard library and the C standard library provided by the toolchain (or Zephyr). BRANCH=none BUG=b:238433667, b:234181908 TEST=On icetower v0.1 with servo_micro and J-Trace attached: > reboot observe console shows timestamps Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: I6660ff22ebc6ba74f1245ff83026f5919b356a02 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3756178 Reviewed-by: Ting Shen <phoenixshen@chromium.org>
* baseboard/zork/usb_pd_policy.c: Format with clang-formatJack Rosenthal2022-07-011-2/+2
| | | | | | | | | | | BUG=b:236386294 BRANCH=none TEST=none Change-Id: I6a756034de04fc3f98c039c85a271d1af2e930a4 Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3727959 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* baseboard/zork/baseboard.c: Format with clang-formatJack Rosenthal2022-06-301-22/+20
| | | | | | | | | | | BUG=b:236386294 BRANCH=none TEST=none Change-Id: I770f47b197ef077ccfb7c1804fa92baebf980b2a Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3727954 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* baseboard/zork/cbi_ec_fw_config.h: Format with clang-formatJack Rosenthal2022-06-291-42/+32
| | | | | | | | | | | BUG=b:236386294 BRANCH=none TEST=none Change-Id: I815ab251475743534049d86953b1a295c882a5f4 Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3727957 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* baseboard/zork/cbi_ssfc.c: Format with clang-formatJack Rosenthal2022-06-291-3/+2
| | | | | | | | | | | BUG=b:236386294 BRANCH=none TEST=none Change-Id: I5191cdeccbd1ce783022e3941bddc8495357fa99 Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3727958 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* baseboard/zork/variant_dalboz.c: Format with clang-formatJack Rosenthal2022-06-291-1/+1
| | | | | | | | | | | BUG=b:236386294 BRANCH=none TEST=none Change-Id: I23a460ae17e89dc17c853fad4830990fc6de741f Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3727960 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* baseboard/zork/cbi_ec_fw_config.c: Format with clang-formatJack Rosenthal2022-06-281-20/+17
| | | | | | | | | | | BUG=b:236386294 BRANCH=none TEST=none Change-Id: I4f746472bd6c2097687212d29f28a2fbf5bb5561 Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3727956 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* baseboard/zork/variant_trembyle.c: Format with clang-formatJack Rosenthal2022-06-281-55/+39
| | | | | | | | | | | BUG=b:236386294 BRANCH=none TEST=none Change-Id: I1b0c3ec817bfe73a039711306a59cbf593169926 Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3727961 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* baseboard/zork/baseboard.h: Format with clang-formatJack Rosenthal2022-06-281-62/+56
| | | | | | | | | | | BUG=b:236386294 BRANCH=none TEST=none Change-Id: If25144e6d0875838d98178d24faa6de76f77a140 Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3727955 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>
* Ezkinil: Add 3rd source InvenSense ICM-42607-PSue Chen2022-03-091-0/+1
| | | | | | | | | | | | | | | Add icm42607 driver in ezkinil project to support 3rd accelgyro source. BUG=b:217971875 BRANCH=zork TEST=make BOARD=ezkinil Signed-off-by: Sue Chen <sue.chen@quanta.corp-partner.google.com> Change-Id: Icc31e73caa5a4de60584a46a24edcd24a5dc355a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3442908 Reviewed-by: Isaac Lee <isaaclee@google.com> Commit-Queue: Isaac Lee <isaaclee@google.com>
* config: rename CONFIG_HOSTCMD_ESPI to CONFIG_HOST_INTERFACE_ESPIKeith Short2021-11-191-1/+1
| | | | | | | | | | | | | | | Rename CONFIG_HOSTCMD_ESPI to CONFIG_HOST_INTERFACE_ESPI. This makes the host interface selection configs distinct from configs used to enable/disable specific host commands. BUG=b:195416058 BRANCH=main TEST=compare_build.sh Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: I7f52614ca9a0dd54cc7e96e51bba40453564198e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3095842 Tested-by: Michał Barnaś <mb@semihalf.com>
* baseboard/zork: Unify enum typesTom Hughes2021-10-252-8/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | enum ec_ssfc_base_gyro_sensor and enum ec_cfg_base_gyro_sensor_type have the same values. clang warns that we're trying to convert between these two types: board/morphius/board.c:257:10: error: implicit conversion from enumeration type 'enum ec_ssfc_base_gyro_sensor' to different enumeration type 'enum ec_cfg_base_gyro_sensor_type' [-Werror,-Wenum-conversion] return get_cbi_ssfc_base_sensor(); Rather than duplicate the type (and it accidentally getting out of sync), just use the canonical base type. BRANCH=none BUG=b:172020503 TEST=./util/compare_builds.sh -b all -j 120 => All match, except ezkinil due to the change of the base_gyro_config variable from "int" to "enum" Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: I8168518a87469004c33adebed89879225c470ace Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3238249 Reviewed-by: Keith Short <keithshort@chromium.org>
* adc: Remove adc_chip.h where adc.h is usedCaveh Jalali2021-08-272-2/+0
| | | | | | | | | | | | | | This removes the use of adc_chip.h where adc.h is also used. In this case, adc_chip.h is redundant. BRANCH=none BUG=b:181271666 TEST=buildall passes Change-Id: Id7baf9aef949447a4d47934242f9bae97c971262 Signed-off-by: Caveh Jalali <caveh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3120317 Reviewed-by: Keith Short <keithshort@chromium.org>
* nct38xx: Split after-reset timestabilize-14151.B-mainDevin Lu2021-08-131-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | Split after-reset time for NCT3807 and NCT3808, since the after-reset time is not the same. From the datasheet (section 4.4.2 Reset Timing) as following: * | Min | Max | * ----------------------+-------+-------+ * NCT3807 (single port) | x | 1.5ms | * ----------------------+-------+-------+ * NCT3808 (dual port) | x | 3ms | * ----------------------+-------+-------+ Currently the after-reset time for NCT3807 is zero. Change to 2ms to fit specification as well. BUG=none BRANCH=none TEST=On Redrix. Initial success with NCT3807. TEST=On Dirinboz. Initial success with NCT3807. TEST=make buildall. Signed-off-by: Devin Lu <Devin.Lu@quantatw.com> Change-Id: I1f47f57c0d8955946b1c2522e1a1736739217f41 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3068492 Reviewed-by: caveh jalali <caveh@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>
* Ezkinil: Add PS8818 for TYPEC C1 secondary MUXSue Chen2021-07-302-0/+21
| | | | | | | | | | | | | | | Use SSFC bits 6-7 to choose which secondary MUX is used. BUG=b:192523667 BRANCH=zork TEST=After setting SSFC to 0x80 on the DUT with PS8818, the typec on DB works fine. Signed-off-by: Sue Chen <sue.chen@quanta.corp-partner.google.com> Change-Id: I8a66098d1e9b947acfb26b78f0cec7f835bf4c40 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3000894 Reviewed-by: Edward Hill <ecgh@chromium.org> Commit-Queue: Edward Hill <ecgh@chromium.org>
* dalboz: not read thermisotr in S5Zick Wei2021-07-281-0/+5
| | | | | | | | | | | | | | | The thermistor: TEMP_SENSOR_SOC powerd by S5 power rail, EC will get abnormal high temperature when DUT get from G3 to S5, we ignore thermistor temperature in S5. BUG=none BRANCH=zork TEST=verify there's no shutdown/prochot message during EC power on. Signed-off-by: Zick Wei <zick.wei@quanta.corp-partner.google.com> Change-Id: Ie755dfab741ce1340c75bbeb5eb53288381b1c0a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3045427 Reviewed-by: Peter Marheine <pmarheine@chromium.org>
* keyboard: Use __override for keyboard_scan_configDaisuke Nojiri2021-07-232-2/+2
| | | | | | | | | | | | | | | | | Currently keyboard_scan_config is defined by each board using CONFIG_KEYBOARD_BOARD_CONFIG. This patch makes it defined as __override hence removes CONFIG_KEYBOARD_BOARD_CONFIG. BUG=None BRANCH=None TEST=buildall Change-Id: I53a356741ba4d00e829ca59b74ee6dc704188728 Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3044403 Tested-by: Gwendal Grignou <gwendal@chromium.org> Commit-Queue: Gwendal Grignou <gwendal@chromium.org> Reviewed-by: Gwendal Grignou <gwendal@chromium.org>
* chgstv2: Unify power-on and shutdown battery thresholdsDaisuke Nojiri2021-06-231-1/+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>
* Zork: Update TCPC reset functions to notify NCT38xx driverDiana Z2021-06-171-11/+18
| | | | | | | | | | | | | | | The NCT38xx driver is now storing boot information which should be cleared whenever the TCPC is forcibly reset through the reset line. Add these reset calls to all zork boards. BRANCH=None BUG=None TEST=make -j buildall Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: I89089a32d4d17dc260df7928028c2dc5fef45aa2 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2965846 Reviewed-by: Denis Brockus <dbrockus@chromium.org>
* config: Rename CONFIG_CROS_BOARD_INFOPhilip Chen2021-06-161-1/+1
| | | | | | | | | | | | | | | | | | Rename CONFIG_CROS_BOARD_INFO to CONFIG_CBI_EEPROM to make it clear that the information comes from on-board EEPROM. It sets up the groundwork for adding more options of CBI sources later. BRANCH=None BUG=b:186264627 TEST=make buildall -j Signed-off-by: Philip Chen <philipchen@google.com> Change-Id: I9a6feee0a8b35bbf29e445544243485507767ad8 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2945792 Reviewed-by: Philip Chen <philipchen@chromium.org> Commit-Queue: Philip Chen <philipchen@chromium.org> Tested-by: Philip Chen <philipchen@chromium.org>
* thermisor: move header to include dirDawid Niedzwiecki2021-04-222-2/+2
| | | | | | | | | | | | | | | | Move the "thermistor.h" header to the include/driver/temp_sensor directory. It is used by the Zephyr shim, so the change is useful to include the header. BUG=b:180403276 BRANCH=none TEST=make buildall Signed-off-by: Dawid Niedzwiecki <dn@semihalf.com> Change-Id: I0e83df97e50a3b324440b65ddb900ddf135f2439 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2843323 Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* zork: Turn off CC_LPC console outputEdward Hill2021-04-121-1/+1
| | | | | | | | | | | | | | Disable CC_LPC console channel by default, to avoid noisy "ACPI kblight" filling up logs. BUG=none BRANCH=zork TEST=check console output Signed-off-by: Edward Hill <ecgh@chromium.org> Change-Id: I53d3181d25cce4451e9602eb590504ac9e739d2e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2821361 Reviewed-by: Denis Brockus <dbrockus@chromium.org>
* Zork: Remove pause in S5 configDiana Z2021-04-121-1/+0
| | | | | | | | | | | | | This config is a no-op in AMD power sequencing. BRANCH=None BUG=None TEST=make -j buildall Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: I16424c94e48916946e9928707681c30de856eb16 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2818530 Reviewed-by: Edward Hill <ecgh@chromium.org>
* zork: add SSFC field for eDP PHY alternate tuningIsaac Lee2021-03-222-0/+24
| | | | | | | | | | | | | | The signal of some eDP will impact WWAN, will need to adjust PHY settings to avoid the noise. BUG=b:171269338 TEST=builds BRANCH=zork Change-Id: Iaab51a577a9d0c899683ef14ab46efe62f7f9c92 Signed-off-by: Isaac Lee <isaaclee@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2772403 Reviewed-by: Peter Marheine <pmarheine@chromium.org>
* dirinboz: add FW_CONFIG support for different keyboard layoutIsaac Lee2021-03-152-0/+25
| | | | | | | | | | BUG=b:182232569 BRANCH=firmware-zork-13434.B-main TEST=build all Change-Id: I567739a9499249d5bdb067e23ee80a957ba7c2e4 Signed-off-by: Isaac Lee <isaaclee@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2755360
* COIL: Rename ioexpander i2c address variableDiana Z2021-02-241-2/+2
| | | | | | | | | | | | | | Rename ioexpander i2c address to match current conventions and update any calling locations. BRANCH=None BUG=None TEST=make -j buildall Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: Iddad457f73d0dd0167496b794c00e274f8985615 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2697855 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* usb_pd: Improve safe state when entering DP modeRob Barnes2021-02-041-85/+0
| | | | | | | | | | | | | | | | | | | | | Place the USB Type-C pins that are to be re-configured to DisplayPort Configuration into the Safe state before sending the configure command. Then switch the pins to DisplayPort after receiving the ack to the command. This is handled correctly in Zork. Move this handling into the common code so it applies to all platforms. BUG=b:123310411, b:178733280 TEST=Functional test of DP over Type-C BRANCH=None Change-Id: I29762a0fa8e780cbdf391cde298422d6c01f6f0a Signed-off-by: Rob Barnes <robbarnes@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2659288 Reviewed-by: Edward Hill <ecgh@chromium.org> Reviewed-by: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
* zork: add SSFC field for auto-mode speaker ampPeter Marheine2021-02-012-12/+23
| | | | | | | | | | | | | | | | This also converts the union with bitfields to explicit bit positions: it's difficult to tell which bits are actually which when using bitfields, because bitfield layout is implementation-defined (and in practice depends on target endianness when building with GCC). BUG=b:177971830 TEST=builds BRANCH=zork Signed-off-by: Peter Marheine <pmarheine@chromium.org> Change-Id: I703571e2bbad51cceac809624f14cf1e6118a899 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2657901 Reviewed-by: Edward Hill <ecgh@chromium.org>
* zork: add a LTE present bit in fw_configVincent Palatin2021-01-282-0/+25
| | | | | | | | | | | | | | | | | | | | | | The up-to-date program/zork/program.star has a new LTE_PRESENT bit in the fw_config. Define it, so we can use it to steer the USB 3 mux for the LTE modem. Signed-off-by: Vincent Palatin <vpalatin@chromium.org> BUG=b:178457388 BUG=b:177389383 BRANCH=zork TEST=On a vilboz360 LTE, program the CBI as for the next production batch (e.g. 'sudo ectool cbi set 6 0x20099200 4') then run with the next CL and see the LTE modem enumerated as USB 3. Change-Id: I7834aa5bc8a7ba45debbc1f5c20d82f04de8d84b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2648108 Tested-by: Vincent Palatin <vpalatin@chromium.org> Reviewed-by: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Peter Marheine <pmarheine@chromium.org> Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
* zork: add support SSFCZick Wei2021-01-263-0/+72
| | | | | | | | | | | | | | | | | This patch add support SSFC for zork, add support base sensor as below: SSFC_BASE_GYRO_BMI160 = 1, SSFC_BASE_GYRO_LSM6DSM = 2, SSFC_BASE_GYRO_ICM426XX = 3, BUG=b:173753906 BRANCH=zork TEST=make buildall Signed-off-by: Zick Wei <zick.wei@quanta.corp-partner.google.com> Change-Id: I10749d819b852861ac5a32d69f2b872527633082 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2641706 Reviewed-by: Edward Hill <ecgh@chromium.org>
* config: Provide default VCONN Swap delayAbe Levkoy2021-01-221-1/+0
| | | | | | | | | | | | | | | | | Almost every relevant board copy-pastes 5000 us. Make that the default and get rid of the redundant definitions. This is the approximate result of this command: find . -type f -name *.h | xargs sed -i -E \ '/#define CONFIG_USBC_VCONN_SWAP_DELAY_US[[:space:]]+5000[[:space:]]/d' BUG=b:144165680 TEST=make buildall BRANCH=none Change-Id: Ife86f9752971abcd7ab5ad5a5e607eb2ccbde2ba Signed-off-by: Abe Levkoy <alevkoy@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2628132 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* config: Make VCONN Swap delay a documented optionAbe Levkoy2021-01-221-1/+1
| | | | | | | | | | | | | | | | | | | | | Replace PD_VCONN_SWAP_DELAY with CONFIG_USBC_VCONN_SWAP_DELAY_US. This is the approximate result of the following command, run from platform/ec: find . -type f -\( -name '*.c' -o -name '*.h' -\) | \ xargs sed -iE 's/PD_VCONN_SWAP_DELAY/CONFIG_USBC_VCONN_SWAP_DELAY/g' Fix some latent formatting errors in usb_pd_protocol.c, because they were preventing pre-upload hooks from passing. BUG=b:144165680 TEST=make buildall BRANCH=none Signed-off-by: Abe Levkoy <alevkoy@chromium.org> Change-Id: Icaf3b309c08fdcd162e960cf5dc88185016b5d2d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2628131 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
* Refactor CONFIG_FLASH_SIZE to CONFIG_FLASH_SIZE_BYTESYuval Peress2021-01-151-1/+1
| | | | | | | | | | | | | | | | | | | | | In Zephyr CONFIG_FLASH_SIZE is a Kconfig value that is used throughout. The issue is that the units don't match. In Zephyr the value is in KiB instead of bytes. This refactor simply renames CONFIG_FLASH_SIZE in platform/ec to include the unit (via _BYTES). BRANCH=none BUG=b:174873770 TEST=make buildall be generated by the build instead of per board Signed-off-by: Yuval Peress <peress@chromium.org> Change-Id: I44bf3c7a20fcf62aaa9ae15715be78db4210f384 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2627638 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Hughes <tomhughes@chromium.org> Commit-Queue: Jack Rosenthal <jrosenth@chromium.org>
* zork: remove retimer HPD controlZick Wei2021-01-071-6/+0
| | | | | | | | | | | | | | | | | | | | | zork dali sku will control HPD to mst hub when detect USB-C device has DP function, but when EC get attention command from device, HPD will not set high or low as attention required, so mst hub will not update display information when attach/de-attach display device from hub/dock/dongle. BUG=b:176977406 BRANCH=zork TEST=verify on morphius, OS will update display information when remove display on hub/dock/dongle side. Signed-off-by: Zick Wei <zick.wei@quanta.corp-partner.google.com> Change-Id: I8a7c7277edaa300ec829114eed5d15378ea21aa5 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2612310 Reviewed-by: Edward Hill <ecgh@chromium.org> Reviewed-by: Denis Brockus <dbrockus@chromium.org> Tested-by: Edward Hill <ecgh@chromium.org> Commit-Queue: Denis Brockus <dbrockus@chromium.org>
* Move tcpic.h header into include/driverSimon Glass2021-01-071-1/+1
| | | | | | | | | | | | | | | | | | This header cannot currently be accessed by Zephyr since it is in a driver directory, not an include directory. This header has quite a bit of public stuff in it, so it seems reasonable to consider everything public. Move the header file and update all users. BUG=b:175434113 BRANCH=none TEST=make buildall -j30 build volteer on zephyr Signed-off-by: Simon Glass <sjg@chromium.org> Change-Id: Ibba37f47a06783fafb5095f853f2a68d92b6df87 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2607745
* zork: use MKBP GPIO & host event for wake on DPPeter Marheine2021-01-051-1/+6
| | | | | | | | | | | | | | | | | | | | | | | GPIO-only MKBP only works when the AP is awake; we need to use GPIO_AND_HOST_EVENT in order to support waking the AP in response to MKBP events; in particular DP_ALT_MODE_ENTERED. We also configure the MKBP wakeup mask so powerd can apply configuration at runtime per chromeos-config: if no mask is configured then the hostcmd to set the wakeup mask is not included in the firmware. Wake on MKBP (and thus wake on DP) also requires AP firmware support. https://review.coreboot.org/c/coreboot/+/48844 implements it for Zork. BUG=b:174121852 TEST=Generating DP event via EC console on morphius with patched AP firmware successfully wakes system from S3. BRANCH=zork Signed-off-by: Peter Marheine <pmarheine@chromium.org> Change-Id: Ifb193399259674da17694aac5213bfd1f189ee59 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2607026 Reviewed-by: Edward Hill <ecgh@chromium.org>