summaryrefslogtreecommitdiff
path: root/board/coachz
Commit message (Collapse)AuthorAgeFilesLines
* Trogdor: Enable C1 PPC interruptWai-Hong Tam2022-11-101-0/+1
| | | | | | | | | | | | | | | | The C1 PPC interrupt is defined but not enabled on init. Should enable it. BUG=b:258532320 BRANCH=Trogdor TEST=Build all the affected boards Change-Id: I793a511783c7266897f3dc5f0988eb6ca16decc9 Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4019344 Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com> Commit-Queue: Stephen Boyd <swboyd@chromium.org> Reviewed-by: Stephen Boyd <swboyd@chromium.org>
* PCHG: Report errors to hostDaisuke Nojiri2022-10-251-0/+4
| | | | | | | | | | | | | | | | | | | | | This patch makes PCHG sub-system handle errors. It adds event and error masks to select which events and errors to be reported in each chipset power state. A host can clear error flags by sending a mask via EC_CMD_PCHG command when it acknowledges errors. This patch itself will not introduce any behavioral change. Actual changes will happen when the host takes actions on reported errors. BUG=b:245764044 BRANCH=None TEST=Redrix Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Change-Id: I19b432d6515ad6821b4e3bc9a228a1fdaa353b0f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3938410 Reviewed-by: caveh jalali <caveh@chromium.org>
* board/coachz: Free up more flash spaceTom Hughes2022-10-141-0/+1
| | | | | | | | | | | BRANCH=none BUG=b:172020503 TEST=make buildall Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: Iea7d3c0400cc7af8bbad109d6adbbf18e73714a2 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3952907 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* strongbad: usb_mux: Split struct usb_mux in strongbad boardsTomasz Michalec2022-09-131-7/+13
| | | | | | | | | | | | | | | | Update strongbad 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: I6527f41f081bca7a179f52afb87a6f534d2f09f2 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3779622 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-129-9/+9
| | | | | | | | | | | | | | | 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>
* charge_state: Add PWR_STATE_FORCED_IDLE stateParth Malkan2022-08-181-10/+9
| | | | | | | | | | | | | | | | | | Add PWR_STATE_FORCED_IDLE state which indicates PWR_STATE_IDLE state is forced when charge control is not normal. Also update led.c files for boards to replace chflag use with new PWR_STATE_FORCED_IDLE. BUG=b:241167493 TEST=make buildall, zmake build --all, make runhosttests -j BRANCH=None Signed-off-by: Parth Malkan <parthmalkan@google.com> Cq-Depend: chromium:3807136 Change-Id: Ib00ed3df977482a4430b0c3d16a2a0e305bbd47f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3807134 Reviewed-by: Wai-Hong Tam <waihong@google.com>
* board/coachz/led.c: Format with clang-formatJack Rosenthal2022-07-011-11/+10
| | | | | | | | | | | BUG=b:236386294 BRANCH=none TEST=none Change-Id: I17b3fb522507863b87fd96ce9eaf34216fbd03a1 Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3728168 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* board/coachz/base_detect.c: Format with clang-formatJack Rosenthal2022-07-011-8/+8
| | | | | | | | | | | BUG=b:236386294 BRANCH=none TEST=none Change-Id: I1929d7fddc93f67296c2cc120c10814d8ac358a1 Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3728150 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* board/coachz/board.h: Format with clang-formatJack Rosenthal2022-06-301-7/+4
| | | | | | | | | | | BUG=b:236386294 BRANCH=none TEST=none Change-Id: Iff1a4de95219581c794868cd2f63d35252001d6a Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3728167 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* board/coachz/usbc_config.c: Format with clang-formatJack Rosenthal2022-06-281-2/+2
| | | | | | | | | | | BUG=b:236386294 BRANCH=none TEST=none Change-Id: Idf75f5dfbdd58f84b758d2b65756c2adccb52c8c Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3728169 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* board/coachz/board.c: Format with clang-formatJack Rosenthal2022-06-281-106/+62
| | | | | | | | | | | BUG=b:236386294 BRANCH=none TEST=none Change-Id: I16e14a6cf9037ced9618837d23785c1aaffdcc47 Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3728126 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>
* gpio: cleanup header usage for i2cKeith Short2022-02-251-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | i2c.h only requires the enum gpio_signal, so use gpio_signal.h instead of gpio.h. The builld doesn't compare due to an ASSERT() calls in i2c-stm32f4.c because the line numbers changed. Before this change: 80068b2: f240 2332 movw r3, #562 80068b6: 48a4 ldr r0, [pc, #656] 80068b8: f7fc fb1a bl 8002ef0 <panic_assert_fail> After this change: 80068b2: f44f 730d mov.w r3, #564 80068b6: 48a4 ldr r0, [pc, #656] 80068b8: f7fc fb1a bl 8002ef0 <panic_assert_fail> BUG=b:218856245 BRANCH=none TEST=compare_build.sh Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: I0f9f428d5c575c444b9df69f71a0ed6c4b3e378c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3489094 Reviewed-by: Fabio Baltieri <fabiobaltieri@google.com>
* TCPM: Change the PS8xxx I2C flags name to match the driverSam Hurst2022-02-101-2/+2
| | | | | | | | | | | | | | | | 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/+1
| | | | | | | | | | | | | | 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>
* baseboard/trogdor: move usbc_config.c to board levelSue Chen2021-12-112-1/+61
| | | | | | | | | | | | | | | | | | | move baseboard/trogdor/usbc_config.c to board file to let board modify charger_profile_override. BUG=none BRANCH=trogdor TEST="make BOARD" build pass for trogdor family (pompom, pazquel, coachz, lazor, marzipan, homestar, wormdingler, trogdor, mrbland, quackingstick, kingoftown) "zmake -D testall" without ERROR message. Signed-off-by: Sue Chen <sue.chen@quanta.corp-partner.google.com> Change-Id: I6dc71f64a1275fa1a71692f43611d3888f780cb6 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3255090 Reviewed-by: Wai-Hong Tam <waihong@google.com> Commit-Queue: Bob Moragues <moragues@chromium.org>
* i2c: Use declared initializers for i2c_ports: trogdor boardsKeith Short2021-11-301-12/+42
| | | | | | | | | | | | | | Convert all instances of i2c_ports[] to use declared initializers. This allows the fields to be reordered without breaking code. BUG=none BRANCH=none TEST=compare_build.sh Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: Ibecd375996b92119eca35721d084c35b6e4e6f1f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3300186 Reviewed-by: Denis Brockus <dbrockus@chromium.org>
* battery: Move battery get/set vendor param to common/battery.cTommy Chung2021-10-282-22/+4
| | | | | | | | | | | | | | | Since the functions are copied by many boards, move them to common. The specific param regs are defined in each specific boards. BUG=b:203031618 BRANCH=none TEST=make BOARD=burnet/coachz/eve/homestar/kappa/mrbland/quackingstick/ wormdingler. Signed-off-by: Tommy Chung <tommy.chung@quanta.corp-partner.google.com> Change-Id: I77c070663ad3e800ec484bd21865c5d911a2c48b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3220718 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* Coachz: Enable CONFIG_LTODiana Z2021-09-291-0/+1
| | | | | | | | | | | | | | | Coachz is down to 100's of bytes of free flash on ToT. Enable LTO to free up about 9k in flash space. BRANCH=None BUG=None TEST=make -j BOARD=coachz shows 9k+ free flash Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: Ib49e4f41780c7df5ebdeabf91dface0fea2f0234 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3192234 Reviewed-by: Wai-Hong Tam <waihong@google.com> Commit-Queue: Wai-Hong Tam <waihong@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>
* Coachz: MotionSensor: Combine BMI160 & BMI260pengjunhao52021-09-083-2/+88
| | | | | | | | | | | | | | | | | | | | This commit is for second source BMI260, We use chip id to detect which MotionSensor is on the board(BMI160 or BMI260) and combine two different setting for different MotionSensor. BUG=b:195908820 TEST=make -j BOARD=coachz Verify build on SIT board BRANCH=Trogdor Signed-off-by: pengjunhao <pengjunhao5@huaqin.corp-partner.google.com> Reviewed-by: tongjian <tongjian@huaqin.corp-partner.google.com> Reviewed-by: yudengwu <yudengwu@huaqin.corp-partner.google.com> Change-Id: Ib12226744800a9ca2e6f620295e8c2ff762999e3 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3118645 Reviewed-by: Wai-Hong Tam <waihong@google.com> Reviewed-by: Jian Tong <tongjian@huaqin.corp-partner.google.com> Commit-Queue: Keith Short <keithshort@chromium.org>
* Coachz: MotionSensor: Save some flash spacepengjunhao52021-09-031-0/+9
| | | | | | | | | | | | | | | | | | | | | This commit is for second source motionsensor combine(BMI160 & BMI260), We use chip id to detect which MotionSensor is on the board but flash is not enough so we reduce some console cmd. BUG=b:195908820 TEST=make -j BOARD=coachz Verify build on SIT board BRANCH=Trogdor Signed-off-by: pengjunhao <pengjunhao5@huaqin.corp-partner.google.com> Reviewed-by: tongjian <tongjian@huaqin.corp-partner.google.com> Reviewed-by: yudengwu <yudengwu@huaqin.corp-partner.google.com> Change-Id: I396052cb5996858507864c5201c2d93f1a885618 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3139717 Reviewed-by: Wai-Hong Tam <waihong@google.com> Reviewed-by: Keith Short <keithshort@chromium.org> Reviewed-by: Jian Tong <tongjian@huaqin.corp-partner.google.com> Commit-Queue: Keith Short <keithshort@chromium.org>
* adc: Remove adc_chip.h where adc.h is usedCaveh Jalali2021-08-271-1/+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>
* CoachZ: Disable IRQ from CTN730 in RODaisuke Nojiri2021-08-174-8/+11
| | | | | | | | | | | | | | | | | | | When PCHG isn't enabled in RO, a keyboard is disabled until another USB device is plugged. This patch restores PCHG in RO but disables it by assigning an invalid value to the IRQ signal (GPIO_IH_COUNT). A PCHG task will be started but will not run because there will be no event. BUG=b:193223400, b:173235954 BRANCH=trogdor TEST=On CoachZ, stylus charges in normal mode and doesn't charge in recovery mode. Change-Id: Icb5702474ac5ef74119455ab4879447cb7a963e4 Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3100491 Reviewed-by: Jack Rosenthal <jrosenth@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>
* trogdor: Workaround for boards without HIBERNATE_L pull-upWai-Hong Tam2021-06-111-0/+9
| | | | | | | | | | | | | | | | | | | Some hardware doesn't have the external pull-up fix for the bugs, like b/164256614, b/177611071. It requires rework to stuff the resistor. For people who has difficulty to do the rework, this CL is a software workaround, which makes the GPIO push-pull, instead of open-drain. BRANCH=Trogdor BUG=b:190818143 TEST=Booted the Coachz rev-1 board, the I2C bus didn't get wedged. Change-Id: I82116b855db49ec7c93d90727c7837a58cda8d3e Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2956832 Tested-by: Douglas Anderson <dianders@chromium.org> Reviewed-by: Stephen Boyd <swboyd@chromium.org> Reviewed-by: Douglas Anderson <dianders@chromium.org>
* Coachz: Remove PCHG from RODaisuke Nojiri2021-06-114-1/+7
| | | | | | | | | | | | | | Peripheral devices don't need to be charged until EC jumps to RW. This patch removes PCHG from the RO copy. BUG=b:173235954 BRANCH=trogdor TEST=Charge stylus on Coachz. Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Change-Id: I8156d1408bf69f4c1fccecaf3a77eaec29fa2c99 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2795065 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* trogdor: Change GPIO HIBERNATE_L to open drainWai-Hong Tam2021-06-091-1/+1
| | | | | | | | | | | | | | | | We stuffed an external pull-up resistor on the GPIO HIBERNATE_L for fixing the CCD bugs, like b/173828265, b/177611071. The GPIO can be used as open drain. BRANCH=Trogdor BUG=b:189184814 TEST=Tested on Lazor; CCD connection still worked under EC hibernate. Change-Id: I50d832f1619f976a4cb682fa1b666add96563222 Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2950925 Reviewed-by: Stephen Boyd <swboyd@chromium.org>
* base_state: implement basestate host commandTing Shen2021-05-271-3/+3
| | | | | | | | | | | | | | | | | | | | | This CL introduces an unified method to force base attach/detach, to deprecate the hard-coded gpio pin name table in hammerd/hammertests/common.py. Also modifies base_force_state to use the same parameter type as host command. BUG=b:188625010 TEST=manually, run `ectool basestate attach|detach|reset` on coachz BRANCH=trogdor,kukui Signed-off-by: Ting Shen <phoenixshen@google.com> Change-Id: I5235661727cbbd15015c49d588ec70605e4a33e8 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2910472 Reviewed-by: Wai-Hong Tam <waihong@google.com> Tested-by: Ting Shen <phoenixshen@chromium.org> Commit-Queue: Ting Shen <phoenixshen@chromium.org>
* qcom: Generalize the filenames for Qualcomm chipsetsWai-Hong Tam2021-05-171-1/+1
| | | | | | | | | | | | | | | The existing SC7180 power sequence can be reused on its next generation. Generalize the filenames, sc7180.c/sc7180.h to qcom.c/qcom.h. BRANCH=None BUG=b:187980397 TEST=Built all the Chromium EC images and Zephyr EC images. Change-Id: Ie04218ef0a12a4e8aa2db353040c5c39c533ae6f Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2893484 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Alexandru M Stan <amstan@chromium.org>
* mkbp: Move key simulation to input devicesBoris Mittelberg2021-05-101-0/+2
| | | | | | | | | | | | | | | | | | Today some platforms include MKBP_KEYBOARD because they use side buttons, switches or other events that share the same driver with MKBP keyboard. Those platforms don't enable KEYSCAN task. The CL is moving key emulation functionality to MKBP input devices, to make a clear separation between the real keyboard usage and emulation/buttons/switches/etc. All boards that were selecting `CONFIG_KEYBOARD_PROTOCOL_MKBP` without KEYSCAN task are now updated to select `CONFIG_MKBP_INPUT_DEVICES` BUG=b:170966461 BRANCH=main,firmware-dedede-13606.B,firmware-volteer-13672.B-main TEST=None Signed-off-by: Boris Mittelberg <bmbm@google.com> Change-Id: I515140ebf6e175f4b29991329f92266ffca232a8 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2824044
* mkbp: EC buttons and switches via MKBPBoris Mittelberg2021-05-101-2/+1
| | | | | | | | | | | | | | Allowing EC buttons and switches to be signaled via MKBP protocol, using CONFIG_MKBP_INPUT_DEVICES. Default behaviour is unchanged. BUG=b:170966461 BRANCH=main,firmware-dedede-13606.B,firmware-volteer-13672.B-main TEST=None Signed-off-by: Boris Mittelberg <bmbm@google.com> Cq-Depend: chromium:2824044 Change-Id: Ib96f98ecb3717a8ee8963be69fb7d7eb72e6d132 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2796382
* Coachz: When the base state changes, update the virtual switchWai-Hong Tam2021-05-102-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When the base state changes, update the virtual switch. It sends a mode change event to notify AP and then AP will query the latest virtual switch of the base state. BRANCH=None BUG=b:174295396 TEST=Checked detaching and attaching the base. Detach the base: > [269.820490 BASE_DET = 2813 (pulse 0)] [269.821044 tablet mode enabled] [269.821486 event set 0x0000000010000000] [269.821974 base state: detached] Attach the base: > [273.714608 BASE_DET = 156 (pulse 0)] [273.715151 tablet mode disabled] [273.715598 event set 0x0000000010000000] [273.716907 base state: attached] [273.717754 event set 0x0000000010000000] Change-Id: I2f0cac61ee359083df300f4fe3f3d16a14dfb926 Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2884609 Reviewed-by: Matthias Kaehlcke <mka@chromium.org>
* Coachz: Enable the basestate console commandWai-Hong Tam2021-05-101-0/+2
| | | | | | | | | | | | | | The basestate console command is used by tests to emulate the base detach or attach state. Enable it to pass the tests. BRANCH=Trogdor BUG=b:174295396 TEST=Run the basestate to emulate the attach and detach states. Change-Id: I49f7b135873dd821d533088b320bfcadafc85659 Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2884608 Reviewed-by: Matthias Kaehlcke <mka@chromium.org>
* Coachz: generate locked imagehanwenchao2021-05-041-9/+1
| | | | | | | | | | | | | | | | | Remove bringup configs to generate locked image for production. BRANCH=trogdor BUG=b:183687793 TEST=build Signed-off-by: hanwenchao <hanwenchao@huaqin.corp-partner.google.com> Change-Id: I369d4d8e6d55e34e43dd4218aaed9a25ef845e49 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2859349 Tested-by: Philip Chen <philipchen@chromium.org> Reviewed-by: Bob Moragues <moragues@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Wai-Hong Tam <waihong@google.com> Commit-Queue: Philip Chen <philipchen@chromium.org>
* PCHG: Support firmware updateDaisuke Nojiri2021-04-051-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds EC_CMD_PCHG_UPDATE, which allows the host to update firmware of ctn730 via I2C. An updater (e.g. ectool) is expected to issue EC_PCHG_UPDATE_CMD_OPEN, multiple EC_PCHG_UPDATE_CMD_WRITEs, then EC_PCHG_UPDATE_CLOSE. Each sub-command completion is notified to the host via EC_MKBP_EVENT_PCHG. An updater is supposed to wait for the previous sub-command to complete before proceeding to the next. Example: localhost ~ # ectool pchg 0 State: DOWNLOAD (6) FW Version: 0x104 localhost ~ # ectool pchg 0 update 0x207000 0x105 /path/to/image.bin Update file /path/to/image.bin (85632 bytes) is opened. Writing firmware (port=0 ver=0x105 addr=0x207000 bsize=128): ********************************************************************** FW update session closed (CRC32=0x7bd5c66f). localhost ~ # ectool pchg 0 reset Reset port 0 complete localhost ~ # ectool pchg 0 State: ENABLED (2) FW Version: 0x105 BUG=b:182600604, b:173235954 BRANCH=trogdor TEST=ectool pchg 0 update 0x201200 0x105 /tmp/user_ee_X0.1_V1.5.bin TEST=ectool pchg 0 reset Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Change-Id: I9c62f1714dd69428ab5870c443cb4eb77881a6c6 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2757099
* Add a common header for board_vbus_sink_enable()Simon Glass2021-03-311-2/+0
| | | | | | | | | | | | | | | | This function prototype is defined in quite a few 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: I2f3f1e08614408e7b8f6bb0633a478765c73beaa Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2789800 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* 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>
* 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>
* sc7180: move switchcap declarations to common headerJack Rosenthal2021-03-192-4/+1
| | | | | | | | | | | | | | | | | | | | | sc7180 depends on board specific functions: - board_set_switchcap_power - board_is_switchcap_enabled - board_is_switchcap_power_good The declaration for these functions were copied between many board.h files. Move the declaration to the new sc7180.h file so it can be commonly sourced. BUG=b:183054226 BRANCH=none TEST=make buildall Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: Icecb6220bfecdbee665dacb0834ab5752b06815b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2774363 Reviewed-by: Wai-Hong Tam <waihong@google.com>
* Coachz: Fix issue of resetting AP not initialize the states correctlyWai-Hong Tam2021-02-191-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | base_detect_change() and tablet_set_mode() skip doing anything if the state has no change. Originally, the S3->S5 hook sets the state to DISCONNECTED. The next startup S5->S3 may not initialize the state correctly if no change, e.g. the case: attach keyboard -> power-off -> detach keyboard -> power-on. It won't set the tablet mode and won't notify AP. We should set the state to UNKNOWN in the S3->S5 hook. The next startup will set the states correctly and notify AP. BRANCH=Trogdor BUG=b:179930342 TEST=Plug keyboard, power-off AP, unplug keyboard, power-on AP, plug keyboard, and checked the EC log that proper states are set and events are sent to AP. Change-Id: Ie6111f2ebbbde7ec6a9de2045a463d769ee6fb2b Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2685409 Reviewed-by: Ting Shen <phoenixshen@chromium.org>
* pchg: Notify host of full chargeDaisuke Nojiri2021-02-121-0/+1
| | | | | | | | | | | | | | | | | | | Currently, full charge status is implied by capacity = 100 and PCHG_STATE_DETECTED (i.e. state='not charging'). If the charger stops charging before 100% (for battery health control), this condition doesn't work. This patch makes PCHG send PCHG_STATE_FULL explicitly when it sees the soc goes above the threshold in PCHG_STATE_DETECTED. BUG=b:179390065,b:173235954 BRANCH=trogdor TEST=CoachZ. Charge till 96% and verify PCHG0/state becomes 'Full'. Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Change-Id: I634f96992cdc7ef44b5e43544603cc5cc9b3a62d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2691366 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* CoachZ: Pull down WLC IRQDaisuke Nojiri2021-01-281-5/+4
| | | | | | | | | | | | | | | | | ctn730 push-pulls the IRQ line. When it's off, the line should stay low to prevent the EC from getting false IRQ. This patch also configures the ctn730 reset line as GPIO_ODR_HIGH so that the line is kept high and a reset can be issued if needed. BUG=b:173235954, b:178096436 BRANCH=trogdor TEST=CoachZ. Verified reset line goes up and down by gpioset. Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Change-Id: I0023d9a980826a6ea4741459a0b65c2cc11e6106 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2656766 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* Coachz: Add BASE_EN debounce time to 350mshegang52021-01-201-5/+11
| | | | | | | | | | | | | | Add BASE_EN debounce time to meet TP reset sequence BRANCH=master BUG=b:176398060 TEST=make BOARD=coachz -j flash ec and check BASE_EN delay time Signed-off-by: hegang5 <hegang5@huaqin.corp-partner.google.com> Change-Id: I04fb80d9f44a56bbf52dc089406ab0bd4fc2cd16 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2637166 Reviewed-by: Nicolas Boichat <drinkcat@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>
* Coachz: board rev 2+ changed the TCPC part from PS8805 to PS8755gaochao2021-01-132-0/+11
| | | | | | | | | | | | | | | | | EC firmware picks the correct driver based on the board ID BRANCH=Trogdor BUG=b:172952070 TEST=make BOARD=coachz -j flash ec and check TYPE-C base function Signed-off-by: gaochao <gaochao@huaqin.corp-partner.google.com> Change-Id: Iefedb6cfcff99f406bd1bb1e136433a1e4cd28d8 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2540068 Reviewed-by: Gang He <hegang5@huaqin.corp-partner.google.com> Reviewed-by: Wai-Hong Tam <waihong@google.com> Tested-by: Gang He <hegang5@huaqin.corp-partner.google.com> Commit-Queue: Wai-Hong Tam <waihong@google.com>
* coachz: add battery informationhegang52021-01-112-0/+30
| | | | | | | | | | | | | add battery information for coachz BUG=b:176260625 BRANCH=Trogdor TEST=make BOARD=coachz Signed-off-by: hegang5 <hegang5@huaqin.corp-partner.google.com> Change-Id: Ia87062417db1a5a8a53088d4da96948d10b0d129 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2612239 Reviewed-by: Wai-Hong Tam <waihong@google.com>
* Coachz: remove base_DET ALT settingSimon Zhou2021-01-081-1/+0
| | | | | | | | | | | | | | | | | | | The base_DET pin interrupt requires setting to gpio Remove ALT setting to enable interrupt BRANCH=trogdor BUG=b:175747582 TEST=make BOARD=coach check the softkeyboard hot-plug function is ok Change-Id: I09cf857fc32cf855ef75ce2ad4448a4b65508156 Signed-off-by: Simon Zhou <zhouguohui@huaqin.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2529271 Reviewed-by: Gang He <hegang5@huaqin.corp-partner.google.com> Reviewed-by: Wai-Hong Tam <waihong@google.com> Reviewed-by: Bob Moragues <moragues@chromium.org> Tested-by: Gang He <hegang5@huaqin.corp-partner.google.com> Commit-Queue: Wai-Hong Tam <waihong@google.com>
* coachz:update current limithegang52020-12-191-0/+1
| | | | | | | | | | | | | coachz update current limit to 95 percent BRANCH=none BUG=none TEST=make BOARD=coachz -j Signed-off-by: hegang5 <hegang5@huaqin.corp-partner.google.com> Change-Id: I9e2fcd2b9fb84114ce7ceb64ec0e91154306da5b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2597132 Reviewed-by: Wai-Hong Tam <waihong@google.com>