summaryrefslogtreecommitdiff
path: root/board/lindar
Commit message (Collapse)AuthorAgeFilesLines
* board: Sort header filesJeremy Bettis2022-12-011-3/+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>
* tree: Enable warning for fallthrough in switch statementsTom Hughes2022-10-191-0/+1
| | | | | | | | | | | | | | | | | | | | | | | The EC code has generally been good about adding comments about intentional fallthrough in switch statements, but there were a few cases without comments (e.g., https://crrev.com/c/3949622). Enabling -Wimplicit-fallthrough generates a compiler warning if the fallthrough is not annotated with __attribute__((fallthrough)). For convenience, we add a "__fallthrough" macro for this attribute. See https://clang.llvm.org/docs/AttributeReference.html#fallthrough and https://gcc.gnu.org/onlinedocs/gcc/Statement-Attributes.html. BRANCH=none BUG=b:253644823 TEST=make buildall LOW_COVERAGE_REASON=legacy code Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: I9f4d6049f4507a25ce706675d159b70e28b4b825 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3957420 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com>
* volteer: usb_mux: Split struct usb_mux in volteer boardsTomasz Michalec2022-09-131-14/+21
| | | | | | | | | | | | | | | | Update volteer 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: Iaab1d2e718d19198e949df5ee84631cdca3568a2 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3779620 Reviewed-by: Keith Short <keithshort@chromium.org> Tested-by: Tomasz Michalec <tmichalec@google.com> Commit-Queue: Tomasz Michalec <tmichalec@google.com>
* Update license boilerplate text in source code filesMike Frysinger2022-09-128-8/+8
| | | | | | | | | | | | | | | 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>
* config: rename HOSTCMD_ESPI_* to HOST_INTERFACE_ESPI_*Michał Barnaś2022-09-091-1/+1
| | | | | | | | | | | | | | | Rename ESPI additional configs to match the name of base config that selects ESPI as HOST_INTERFACE. BUG=b:195416058 BRANCH=main TEST=zmake testall && make buildall Change-Id: I137449a1a58b1ea0d9794ebc0900e1b68413819d Signed-off-by: Michał Barnaś <mb@semihalf.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3291744 Reviewed-by: Sam Hurst <shurst@google.com> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com>
* 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>
* board/lindar/ktd20xx.h: Format with clang-formatJack Rosenthal2022-07-011-15/+15
| | | | | | | | | | | BUG=b:236386294 BRANCH=none TEST=none Change-Id: I06721b855e9274228dd090236a65509afdb47b3d Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3728636 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* board/lindar/led.c: Format with clang-formatJack Rosenthal2022-07-011-187/+155
| | | | | | | | | | | BUG=b:236386294 BRANCH=none TEST=none Change-Id: If488de700ae02886321ce026d3fbadc6b256a7e4 Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3728637 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* board/lindar/board.c: Format with clang-formatJack Rosenthal2022-06-291-27/+22
| | | | | | | | | | | BUG=b:236386294 BRANCH=none TEST=none Change-Id: Ia5b7da1172eeb61d58ebf54f320b48517ef0b3d6 Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3728634 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* board/lindar/board.h: Format with clang-formatJack Rosenthal2022-06-281-53/+46
| | | | | | | | | | | BUG=b:236386294 BRANCH=none TEST=none Change-Id: I8d9829d0dc33448d42943de6d8c94d515ff045f9 Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3728635 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* board/lindar/battery.c: Format with clang-formatJack Rosenthal2022-06-281-2/+4
| | | | | | | | | | | BUG=b:236386294 BRANCH=none TEST=none Change-Id: Iaf5e541da2a1c64a4a4675cc792518c91089eb4a Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3728625 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* TCPM: Change the PS8xxx I2C flags name to match the driverSam Hurst2022-02-101-4/+4
| | | | | | | | | | | | | | | | Change the PS8xxx I2C flags name from PS8751_I2C_ADDR to PS8XXX_I2C_ADDR. BRANCH=main BUG=b:194432779 TEST=make -j buildall Signed-off-by: Sam Hurst <shurst@google.org> Change-Id: Ie8ac1c922c46bb425b7e7b1a39173872d48f6353 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3449669 Tested-by: Sam Hurst <shurst@google.com> Reviewed-by: Wai-Hong Tam <waihong@google.com> Commit-Queue: Sam Hurst <shurst@google.com>
* ec: Rename GMR_TABLET_MODE_GPIO_L to GPIO_TABLET_MODE_LAndrew McRae2022-01-201-1/+0
| | | | | | | | | | | | | | Normalise the name of the tablet mode detection GPIO so that everyboard does not need to redefine it. BUG=none TEST=zmake testall; make buildall BRANCH=none Signed-off-by: Andrew McRae <amcrae@google.com> Change-Id: Ifb458e755d1e00c0cff66a02c78dfccaba2d070c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3397141 Reviewed-by: Denis Brockus <dbrockus@chromium.org>
* 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>
* Volteer: Enable USB mux taskDiana Z2021-11-291-0/+1
| | | | | | | | | | | | | | Enable the USB mux task for volteer, since the virtual mux sets may take significant time to complete. BRANCH=None BUG=b:186777984 TEST=on voxel, pass tast typec.Mode*.manual Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: I634a6ef8029b8810ed0e08e11d2ab923af320175 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3078418 Reviewed-by: Keith Short <keithshort@chromium.org>
* tree: Work around clang bugTom Hughes2021-11-051-27/+37
| | | | | | | | | | | | | | | | | | | | clang warns: error: initializer element is not a compile-time constant There is an upstream LLVM review with proposed fix: https://reviews.llvm.org/D76096. In the meantime, we will work around it. BRANCH=none BUG=b:172020503, b:202062363 TEST=./util/compare_builds.sh -b all -j 120 => MATCH Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: I066e082870bcd726555a5f2461f09988d4e6ce55 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3237042 Reviewed-by: 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>
* board: Rename RSMRST_L_PGOOD as PG_EC_RSMRST_ODLfirmware-chameleon-14280.B-mainDivya Sasidharan2021-10-121-1/+0
| | | | | | | | | | | | | | | | | GPIO_RSMRST_L_PGOOD is also used as GPIO_PG_EC_RSMRST_ODL creating redundancy. Removing it will help need for redefinitions for zephyr. Remove reference to GPIO_RSMRST_L_PGOOD in zephyr BUG=b:200975143 BRANCH=main TEST=make buildall -j, boot up on brya Change-Id: Iff46595174c54db347b69cff3ad9e266ba9fd535 Signed-off-by: Divya Sasidharan <divya.s.sasidharan@intel.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3180808 Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* tree: Fix TEMP_SENSOR3 GPIO declarationTom Hughes2021-10-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When building with clang, it reports: board/chronicler/gpio.inc:178:1: error: initializer overrides prior initialization of this subobject [-Werror,-Winitializer-overrides] ALTERNATE(PIN(F, 1), 0, MODULE_ADC, 0) /* TEMP_SENSOR3 */ This expands to: static const struct gpio_alt_func gpio_alt_funcs[] = { ... {GPIO_PORT_F, (1U << (1)), .func = (0), .module_id = (MODULE_ADC), .flags = (0)} }; The problem is that struct gpio_alt_func has the order "module_id, func, port, mask, flags", so in this case we are setting func to (1U << (1)) and then to (0). It looks like the intent was to use the PIN_MASK macro instead of PIN, which expands to: static const struct gpio_alt_func gpio_alt_funcs[] = { ... {.port = GPIO_PORT_F, .mask = ((1U << (1))), .func = (0), .module_id = (MODULE_ADC), .flags = (0)}, }; The code appears to be repeated in several boards, which were found with: git grep --name-only TEMP_SENSOR3 | grep gpio.inc | sort | uniq BRANCH=none BUG=b:172020503 TEST=make CC=arm-none-eabi-clang BOARD=chronicler Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: I66a097b761c0b15466a30e53a710d532cd48256c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3206478 Reviewed-by: Eric Yilun Lin <yllin@google.com>
* USB MUX: Update mux HPD update interface to use mux_state_tDiana Z2021-09-161-1/+2
| | | | | | | | | | | | | | | | | Since the drivers are now taking a mux_state_t set of flags to update, go ahead and unify the usb_mux API this way as well. It makes the parameters more apparent than the 1/0 inputs, and aligns the stack to use the same parameters. BRANCH=None BUG=b:172222942 TEST=make -j buildall Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: Ie943dbdf03818d8497c0e328adf2b9794585d96e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3095438 Commit-Queue: Abe Levkoy <alevkoy@chromium.org> Reviewed-by: Abe Levkoy <alevkoy@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>
* tablet_mode: Fix the race condition of setting the tablet modeWai-Hong Tam2021-07-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | There are 2 tablet mode triggers: * Lid: when the lid angle close to 360 degree, either detected by a GMR sensor or by the angle computed by 2 motion sensors. * Base: when the detachable base is detached. These 2 triggers set the tablet mode status, which as a boolean, resulting a race condition. This CL fixes the race condition. Each trigger updates its own bit. The final tablet mode status is the OR of all bits. BRANCH=Trogdor BUG=b:193873098 TEST=Attached the base, checked tablet_mode enabled; detached the base, checked tablet_mode disabled; flip base to 360 degree, checked tablet_mode disabled; move the base out of the lid, checked tablet_mode disabled. Change-Id: Ia9d9d2d66c194796c1039cc8b746c8d1f28a4496 Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3044414 Reviewed-by: Ting Shen <phoenixshen@chromium.org>
* keyboard: Use __override for keyboard_scan_configDaisuke Nojiri2021-07-231-1/+1
| | | | | | | | | | | | | | | | | 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>
* lindar : Correct EC chipset setting to match HW designamber.chen2021-06-032-1/+2
| | | | | | | | | | | | | | | | Correct EC chipset setting to match HW design (npcx797f) BRANCH=main BUG=b:189250648 TEST=make -j BOARD=lindar Signed-off-by: amber.chen <amber.chen@lcfc.corp-partner.google.com> Change-Id: Iecf331427364dc2e439597f33a6add01bff5e787 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2929069 Reviewed-by: Zhuohao Lee <zhuohao@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Zhuohao Lee <zhuohao@chromium.org> Tested-by: Zhuohao Lee <zhuohao@chromium.org>
* lindar: modify PD_MAX_POWER_MW to 45W.arthur.lin2021-05-241-1/+1
| | | | | | | | | | | | | | | Modify PD_MAX_POWER_MW to 45000 from 60000. BRANCH=firmware-volteer-13672.B BUG=b:188855362 TEST=make buildall -j Signed-off-by: arthur.lin <arthur.lin@lcfc.corp-partner.google.com> Change-Id: Iaa62c3f0f343d3e88f83b21bb15832e82856e3cd Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2911100 Reviewed-by: Keith Short <keithshort@chromium.org> Reviewed-by: Zhuohao Lee <zhuohao@chromium.org> Commit-Queue: Zhuohao Lee <zhuohao@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>
* LED On/Off: Remove power LED configDiana Z2021-04-222-3/+2
| | | | | | | | | | | | | | | | | | | | | | Move the LED on/off module towards using a more flexible LED support approach. Define a weak power LED table and setter for boards to override when needed. Note that during run-time these functions will not get called since led_auto_control_is_enabled() will return false for nonexistent LEDs. This consumes an average of 165 additional bytes of flash space on boards which do not use a power LED. BRANCH=None BUG=b:185508707 TEST=make -j buildall, load on guybrush (battery LED only) and confirm no errors are seen. Load on Boten (both LEDs) and confirm behavior appears normal Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: Iaa1e22a7f5d8be39eb8792ee13d358087d7f7482 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2832691 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* Lindar: Update lightbar 10-led cfgreno.wang2021-04-221-2/+2
| | | | | | | | | | | | | | | | | | | | Based on b:183826778's comment#17 and comment18 information to update lightbar 10-led cfg setting. The final placement adopt lightbar circuit's LED9 and LED10 which connect to KTD2061's LEDC1 and and LEDC2, not adopt LED11 and LED12 which connect to LEDC3 and LEDC4. BUG=b:183826778 BRANCH=volteer TEST=make -j BOARD=lindar Signed-off-by: reno.wang <reno.wang@lcfc.corp-partner.google.com> Change-Id: I7f7e1cac1f7361c5c21497a0cc4c1ff2763873bf Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2833031 Reviewed-by: Zhuohao Lee <zhuohao@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* Lindar: Create lightbar command for factory testreno.wang2021-04-141-1/+206
| | | | | | | | | | | | | | | | Add console/host, ectool, command for testing BUG=b:184821618 BRANCH=volteer TEST=make buildall, test command, ex. "ectool lighbar off". Lindar: Lightbar test code Signed-off-by: reno.wang <reno.wang@lcfc.corp-partner.google.com> Change-Id: I2b250d1b9bbc34ef533da34588ee969104f3b7f3 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2814721 Reviewed-by: Zhuohao Lee <zhuohao@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* Lindar: Move to SSFC for lightbar instead of SKUIDreno.wang2021-04-141-5/+68
| | | | | | | | | | | | | | | | | 1. Move to SSFC to check if system support lightbar instead of sku id 2. Add lightbar 12 led support and EC can base on SSFC_LIGHTBAR type to adopt different lightbar led cfg. BUG=b:183826778 BRANCH=volteer TEST=makee buildall, test SSFC_LIGHTBAR Signed-off-by: reno.wang <reno.wang@lcfc.corp-partner.google.com> Change-Id: Ic8fac16e846638c403e37261ecf15a72e805a8e0 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2822270 Reviewed-by: Zhuohao Lee <zhuohao@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* Lindar: Lightbar V9 SPECreno.wang2021-04-141-93/+182
| | | | | | | | | | | | | | | | | | | 1. Update code to match lightbar V9 behavior spec 2. Update lightbar led cfg to match lightbar HW design 3. Update amber (orange) color's current to increase brightness for mechanism team's request. BUG=b:183826778 BRANCH=volteer TEST=makee buildall, test lightbar behavior follow V9 SPEC, check lightbar green and amber color brightness. Signed-off-by: reno.wang <reno.wang@lcfc.corp-partner.google.com> Change-Id: I2626601aebc002fdf03fb5bb10f387a033378fa4 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2814720 Reviewed-by: Keith Short <keithshort@chromium.org> Reviewed-by: Zhuohao Lee <zhuohao@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* Lindar: Lindar's lightbar support in S0ix/S3reno.wang2021-04-034-2/+480
| | | | | | | | | | | | | | | | | | | | | | | | | 1. Lid is closed, lightbar keep off 2. Lid is opened, its behavior follow below. AC+Battery < 20%, lightbar solid 2 amber led on. AC+Battery < 40%, lightbar solid 4 amber led on. AC+Battery < 60%, lightbar solid 6 amber led on. AC+Battery < 80%, lightbar solid 8 amber led on. AC+Battery < 97%, lightbar solid 10 amber led on. AC+Battery >= 97%, lightbar solid 10 green led on. Battery only >= 15%, lightbar keep off. Battery low < 15%, lightbar blink amber color, 1s on, 5s off. 3. Some SKU un-support lightbar, and shouldn't run lightbar task. 4. Lightbar is powered by PP3300_A, and shouldn't run it in S4/S5/G3. 5. Add debounce time for lightbar state change. BUG=b:174133147 BRANCH=volteer TEST=make buildall, test lightbar behavior in S0ix/S3. Signed-off-by: reno.wang <reno.wang@lcfc.corp-partner.google.com> Change-Id: Ibbdc17627f7b2d1b2abbbad23b6c06024455e66b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2739008 Reviewed-by: Keith Short <keithshort@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>
* lindar: remove config for firmware qualjerry2.huang2021-03-261-3/+0
| | | | | | | | | | | | | | 1.Remove CONFIG_SYSTEM_UNLOCKED 2.Remove CONFIG_BYPASS_CBI_EEPROM_WP_CHECK BUG=b:183477746 BRANCH=firmware-volteer-13672.B-main TEST=make buildall Signed-off-by: jerry2.huang <jerry2.huang@lcfc.corp-partner.google.com> Change-Id: I02d87972f465e8343d41f2fe0be84acfb17a1ae1 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2783549 Reviewed-by: Keith Short <keithshort@chromium.org>
* lindar: update thermal table.arthur.lin2021-03-241-12/+12
| | | | | | | | | | | | | | | Update thermal table setting for thermal team request. BRANCH=firmware-volteer-13672.B BUG=b:183306212 TEST=make buildall -j Signed-off-by: arthur.lin <arthur.lin@lcfc.corp-partner.google.com> Change-Id: I88118210b33781adcfaafa831e86a54d2c2b731a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2772402 Reviewed-by: Keith Short <keithshort@chromium.org> Reviewed-by: Zhuohao Lee <zhuohao@chromium.org> Commit-Queue: Zhuohao Lee <zhuohao@chromium.org>
* lindar: modify gpio M2_SSD_PLN setting to GPIO_ODR_HIGHjerry2.huang2021-03-221-3/+3
| | | | | | | | | | | | | | modify M2_SSD_PLN gpio setting from GPIO_OUT_HIGH to GPIO_ODR_HIGH BRANCH=firmware-volteer-13672.B BUG=b:183169516 TEST=make buildall -j verify DUT enter s5,M2_SSD_PLN will be low. Signed-off-by: jerry2.huang <jerry2.huang@lcfc.corp-partner.google.com> Change-Id: I63e99f91513c799b28f95049170d25adc203c5b7 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2772412 Reviewed-by: Keith Short <keithshort@chromium.org>
* lindar: add define CONFIG_CMD_TCPC_DUMParthur.lin2021-03-191-0/+3
| | | | | | | | | | | | | | add EC console command for TCPC dump. BRANCH=firmware-volteer-13672.B BUG=none TEST=make buildall -j Change-Id: I098250e6db2bcd1daa7cb746181e7fd578eac173 Signed-off-by: arthur.lin <arthur.lin@lcfc.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2759765 Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Zhuohao Lee <zhuohao@chromium.org>
* lindar: define GPIO CCD_MODE_ODLarthur.lin2021-03-171-0/+1
| | | | | | | | | | | | | | Define PIN(E,5) CCD_MODE_ODL to input. BRANCH=firmware-volteer-13672.B BUG=none TEST=make buildall -j Signed-off-by: arthur.lin <arthur.lin@lcfc.corp-partner.google.com> Change-Id: I5220012d9397dcd235e96a43d1dbeeba4806516a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2764202 Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* copano,drobit,elemi,lindar,voema: add CONFIG_BYPASS_CBI_EEPROM_WP_CHECKZhuohao Lee2021-03-041-0/+1
| | | | | | | | | | | | | | | In order to bypass the cbi eeprom write protection, we add the config CONFIG_BYPASS_CBI_EEPROM_WP_CHECK to bypass the write protection gpio check. BUG=b:169034911 BRANCH=volteer TEST=`ectool cbi set` is working Change-Id: Ibd1e8af4eb8f7ead506999c4ce3803fa0e341c10 Signed-off-by: Zhuohao Lee <zhuohao@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2719725 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* lindar: add back the TUSB422 related setting.arthur.lin2021-03-032-3/+10
| | | | | | | | | | | | | | | | | For backward compatible with the EVT device, add back the TUSB422 related setting. BRANCH=firmware-volteer-13672.B BUG=b:177980430 TEST=make buildall -j 1. Set cbi board id to 1 and 2 respectively to check the type-c function. 2. Test Type-C PD function for AC, dock, usb device, etc. Signed-off-by: arthur.lin <arthur.lin@lcfc.corp-partner.google.com> Change-Id: I5b9237b40aaf9c464f12a19d8bc61251d649acf4 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2722012 Reviewed-by: Keith Short <keithshort@chromium.org>
* lindar: fix the battery green led cannot be turned on by commandjerry2.huang2021-03-021-2/+2
| | | | | | | | | | | | | | | fix issue of the command "ectool led battery green" didn't work BUG=b:174443628 BRANCH=firmware-volteer-13672.B TEST=make buildall ,Verify "ectool led battery [color]" command work normally Signed-off-by: jerry2.huang <jerry2.huang@lcfc.corp-partner.google.com> Change-Id: I5b7eb789106698dc21345a98609947167fde7d47 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2721323 Reviewed-by: Zhuohao Lee <zhuohao@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org>
* lindar: change TCPC to RT1715reno.wang2021-02-172-3/+5
| | | | | | | | | | | | | | | Replace the TUSB422 driver/I2C address with the RT1715. BRANCH=firmware-volteer-13672.B BUG=b:177980430 TEST=make buildall -j 1. Test Type-C PD function for AC, dock, usb device, etc. Signed-off-by: reno.wang <reno.wang@lcfc.corp-partner.google.com> Change-Id: Ied94898a50e0be643168031de8b2525b9dd04f15 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2666557 Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* lindar: modify led behaviorjerry2.huang2021-02-012-8/+8
| | | | | | | | | | | | | | | | | | | 1.LED color: LED_1_L color change to green LED_2_L color change to red 2.Modify led behavior BUG=b:174443628 BRANCH=firmware-volteer-13672.B TEST=make buildall ,Verify "green LED at full charge, amber during charging,red during charging/low battery, LED off at discharge,red led blink at battery error" the led behavior is normally. Signed-off-by: jerry2.huang <jerry2.huang@lcfc.corp-partner.google.com> Change-Id: I74b6a83d2a252001baa76584ab7f5e58b1129358 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2657904 Reviewed-by: Keith Short <keithshort@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>
* lillipup: fix Dut can't wake battery up from shutdown modeamber.chen2020-12-211-0/+13
| | | | | | | | | | | | | | | | | | | 1. Override "board_battery_is_initialized" to report correct battery initial state. That's same as eldrid board. 2. Once return BP_NOT_SURE for uninitialized battery, EC may require pre-charge current to wake battery up. 3. It shouldn't keep return BP_NO that it may cause EC not to set pre-charge current and cause battery keep in shutdown mode. BUG=b:175767091 BRANCH=firmware-volteer-13521.B TEST=make buildall, Verify battery which is under shutdown mode and wake it up. Signed-off-by: amber.chen <amber.chen@lcfc.corp-partner.google.com> Change-Id: I8b4736553224cf59ac098d41f615742590ef4a20 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2597134 Reviewed-by: Zhuohao Lee <zhuohao@chromium.org>
* lindar: modify LED function to match LED SPECamber.chen2020-12-181-3/+3
| | | | | | | | | | | | | modify LED function to match LED SPEC BUG=b:174443628 BRANCH=firmware-volteer-13521.B TEST=make -j BOARD=lindar Signed-off-by: amber.chen <amber.chen@lcfc.corp-partner.google.com> Change-Id: Ie5e598d119bc096280e717eddae6ed2ce12e61c7 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2597126 Reviewed-by: Zhuohao Lee <zhuohao@chromium.org>
* lindar: modify LED function to match LED SPECamber.chen2020-12-072-10/+11
| | | | | | | | | | | | | | | modify LED function to match LED SPEC BUG=b:174443628 BRANCH=firmware-vloteer-13521.B TEST=make -j BOARD=lindar Signed-off-by: amber.chen <amber.chen@lcfc.corp-partner.google.com> Change-Id: Ie51eaa92aed3c22c5452a132048f95287ea94367 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2566857 Reviewed-by: Keith Short <keithshort@chromium.org> Reviewed-by: Zhuohao Lee <zhuohao@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* lillipup: fix usb type-a bc1.2 chargingjerry2.huang2020-12-023-0/+10
| | | | | | | | | | | | | fix usb type-a bc1.2 charging BUG=b:173093980 BRANCH=firmware-volteer-13521.B TEST=make buildall, test usb type-a charging and usb function work normally Signed-off-by: jerry2.huang <jerry2.huang@lcfc.corp-partner.google.com> Change-Id: I60aadcac58ccbfe86d7005db506788a13d6fe4c9 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2557759 Reviewed-by: Keith Short <keithshort@chromium.org>
* lillipup: fix c1 charging and usb functionamber.chen2020-12-022-54/+49
| | | | | | | | | | | | | | | 1.fix c1 charging and usb function 2.remove USB4 and cleaning up the TCPC,PPC,and USB mux configuration BUG=b:173093980 BRANCH=firmware-volteer-13521.B TEST=make buildall, test c1 charging and usb function work normally Signed-off-by: amber.chen <amber.chen@lcfc.corp-partner.google.com> Change-Id: Ic49d6dfee0e977885e5098dd9d71b89cf19410f8 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2549000 Tested-by: jerry2.huang <jerry2.huang@lcfc.corp-partner.google.com> Reviewed-by: Keith Short <keithshort@chromium.org>