summaryrefslogtreecommitdiff
path: root/board/trogdor
Commit message (Collapse)AuthorAgeFilesLines
* trogdor: usb_mux: Split struct usb_mux in trogdor boardsTomasz Michalec2022-09-131-7/+13
| | | | | | | | | | | | | | | | Update trogdor 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: I8bcd1f97850c9064734ee60a7785b55578a6a9a1 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3779621 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-1211-11/+11
| | | | | | | | | | | | | | | 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-6/+5
| | | | | | | | | | | | | | | | | | 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/trogdor/usbc_config.c: Format with clang-formatJack Rosenthal2022-07-011-23/+15
| | | | | | | | | | | BUG=b:236386294 BRANCH=none TEST=none Change-Id: I6f76c9bfda5534b2f7da998ae20cdf76852d8eee Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3729036 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* board/trogdor/board.c: Format with clang-formatJack Rosenthal2022-06-281-72/+41
| | | | | | | | | | | BUG=b:236386294 BRANCH=none TEST=none Change-Id: Icb9c4b2dd848d68670876212d353bbe74d2b96ad Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3729035 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* board/trogdor/led.c: Format with clang-formatJack Rosenthal2022-06-281-9/+10
| | | | | | | | | | | BUG=b:236386294 BRANCH=none TEST=none Change-Id: I2e5ba1e707ce296a5b934a422df2ce263b813ff4 Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3729047 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* board/trogdor/hibernate.c: Format with clang-formatJack Rosenthal2022-06-281-4/+2
| | | | | | | | | | | BUG=b:236386294 BRANCH=none TEST=none Change-Id: I0b485b3db17a5b78081e9b37799df2680221b96c Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3729026 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* board/trogdor/board.h: Format with clang-formatJack Rosenthal2022-06-281-13/+4
| | | | | | | | | | | BUG=b:236386294 BRANCH=none TEST=none Change-Id: I65396436bf80ab03ca5ac6577ceade75e62b8526 Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3729025 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>
* 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/+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>
* baseboard/trogdor: move usbc_config.c to board levelSue Chen2021-12-111-0/+48
| | | | | | | | | | | | | | | | | | | 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-10/+35
| | | | | | | | | | | | | | 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>
* 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-20/+0
| | | | | | | | | | | | | | | | | | | | | | 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>
* 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>
* trogdor: Enable battery fuel gaugeWai-Hong Tam2021-07-132-34/+68
| | | | | | | | | | | | | | | | | | Do the same thing as CL:2987915, for Trogdor. Enable the battery fuel gauge and add the battery info as an example, such that the follower boards can just add the new battery info. I pick a battery from the Lazor board. As long as it is a 2-cell battery, it does not matter too much. BRANCH=None BUG=b:184071830 TEST=Built the trogdor image successfully and booted to AP. Change-Id: Ic861a46148d238ba1dc015cd7b907321b484deca Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2994752 Reviewed-by: Keith Short <keithshort@chromium.org>
* trogdor: Separate the board_hibernate() to a separate fileWai-Hong Tam2021-06-233-12/+19
| | | | | | | | | | | | | | | Move the board_hiberante() from board.c to a separate file hibernate.c. This makes Zephyr easier to include the code. BRANCH=None BUG=b:191803008 TEST=Built the trogdor image successfully. Change-Id: Ie3749b9db72fc5b0535cfb6f9ef92499b3b46b82 Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2980447 Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* trogdor: Move USB-C related functions and configs to usbc_config.cWai-Hong Tam2021-06-233-294/+323
| | | | | | | | | | | | | | | Move the functions and configs from board.c into the shared file, usbc_config.c. So this code can be used by Zephyr. BRANCH=None BUG=b:191803008 TEST=Built the trogdor image and checked PD negotiation. Change-Id: I500baf13705d18517332992fd83258fe69735a3a Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2980446 Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* trogdor: Move GPIO functions to a header fileWai-Hong Tam2021-06-232-12/+25
| | | | | | | | | | | | | | | | | At present these functions are declared static in board.c which means they cannot be implemented in a different file. With zephyr we need to split the files up a bit. Move the declarations to a header file instead. BRANCH=None BUG=b:191803008 TEST=Built the trogdor image successfully. Change-Id: Ic9ad9ec210b61c2a92e36119bb635524136988ab Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2980445 Reviewed-by: Keith Short <keithshort@chromium.org>
* trogdor: Move the switchcap code outWai-Hong Tam2021-06-233-17/+23
| | | | | | | | | | | | | | Move the switchcap implementation to another file so it can be more readily used by the Zephyr OS build. BRANCH=None BUG=b:191803008 TEST=Built the trogdor image successfully. Change-Id: I7b42f29b79e53d97c0cd86abf61f3a9f7db96de9 Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2980444 Reviewed-by: Keith Short <keithshort@chromium.org>
* Revert "Trogdor: Add interrupt on CCD_MODE_ODL to enable SBU mux"Wai-Hong Tam2021-06-232-24/+1
| | | | | | | | | | | | | | | | | This reverts commit 2966f2f98ac039e80be84aa6b450474652336175. The latest hardware places H1 SBU lines in front of the PPC chip. So the PPC internal mux state doesn't affect H1 anymore. We don't need the workaround, which fixed PPC blocking H1 SBU lines. So revert it. BRANCH=None BUG=b:184071830 TEST=Tested plugging a monitor and then plugging CCD. CCD worked fine. Change-Id: Ifa62e15dc39701ba2c0ddbd7ad0ab6274b254d11 Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2980443 Reviewed-by: Stephen Boyd <swboyd@chromium.org>
* trogdor: Drop the workaround of hibernateWai-Hong Tam2021-06-211-10/+0
| | | | | | | | | | | | | | | We added the hibernate workaround for the boards without the pull-up rework. The latest Trogdor revision has the external pull-up. So it doesn't need the workaround for the bug b/170324206. BRANCH=None BUG=b:184071830, b:170324206 TEST=Built the Trogdor image. Change-Id: I62cb3126b4ed4b2c38f04f0b3c937130c1b6fe9a Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2971866 Reviewed-by: Stephen Boyd <swboyd@chromium.org>
* trogdor: Drop the support of legacy board revisionsWai-Hong Tam2021-06-214-58/+0
| | | | | | | | | | | | | | The older board revisions use a different EC part. No way to support it using the same EC image. Totally drop the support. BRANCH=None BUG=b:184071830 TEST=Built the Trogdor image. Change-Id: Ib495d69eeb1b4894c87b45ad86a29fd43a0befd9 Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2971865 Reviewed-by: Stephen Boyd <swboyd@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>
* Trogdor: Update the GPIO names for rev-2Wai-Hong Tam2021-06-043-20/+39
| | | | | | | | | | | | | | Update the GPIO names according to the rev-2 schematic Define the unused pins. BRANCH=None BUG=b:184071830 TEST=Build the Trogdor image and test it on the rev-2 board. Change-Id: Ida8bdbf0dc63984d1f31b4db8b7b6f39f8b33e41 Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2911506 Reviewed-by: Stephen Boyd <swboyd@chromium.org>
* Trogdor: Enable Trogdor as a convertibleWai-Hong Tam2021-05-173-1/+78
| | | | | | | | | | | | | | | | | | | | | | | | Trogdor rev-0 and rev-1 are clamshell designs. Trogdor rev-2 is a convertible design. We don't support rev-0 and rev-1. Make it straight to a convertible: * Add the lid acceleration sensor * Just assign a random rotation metrix, as no chassis * Add the GPIO TABLET_MODE_L interrupt * Enable lid angle detection that disables keyboard * Enable sensors in S3 for the above angle detection BRANCH=None BUG=b:187343625 TEST=Build the Trogdor image and enable "accelinfo on" which shows the lid accel reading and the lid angle. As the lid accel sensor is not mounted to the lid surface. The lid accel reading and the lid angle are not accurate. Change-Id: I16af2c63181eb6037fbf6742c07427e20064c335 Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2895920 Reviewed-by: Stephen Boyd <swboyd@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/+1
| | | | | | | | | | | | | | | | | | 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
* Trogdor: Change the flash size to 512KBWai-Hong Tam2021-04-011-1/+1
| | | | | | | | | | | | | Rev-2 uses another EC SKU, which has 512KB flash instead. BRANCH=None BUG=b:184071830 TEST=Built the image and checked it bootable on rev-2. Change-Id: I51c6c280e9c58e371ef0288afe4736508a950edd Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2798976 Reviewed-by: Alexandru M Stan <amstan@chromium.org>
* 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>
* Trogdor: Change for rev-2 boardWai-Hong Tam2021-03-052-3/+8
| | | | | | | | | | | | | | | Change the EC chip variant from NPCX7M7WB to NPCX7M6FC. This is an incompatible change. It breaks the earlier rev-0 and rev-1 boards. So block building their images. BRANCH=Trogdor BUG=None TEST=Build the Trogdor image. Change-Id: I844848e6747c1eca331a597302244fbca8349854 Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2738527 Reviewed-by: Douglas Anderson <dianders@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>
* task_set_event: remove the wait argumentDawid Niedzwiecki2020-12-141-2/+2
| | | | | | | | | | | | | | | | | | | | There is an option in the task_set_event function which force the calling task to wait for an event. However, the option is never used thus remove it. This also will help in the Zephyr migration process. BUG=b:172360521 BRANCH=none TEST=make buildall Signed-off-by: Dawid Niedzwiecki <dn@semihalf.com> Change-Id: Ic152fd3d6862d487bcc0024c48d136556c0b81bc Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2521599 Reviewed-by: Jett Rink <jettrink@chromium.org> Reviewed-by: Tom Hughes <tomhughes@chromium.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Commit-Queue: Jack Rosenthal <jrosenth@chromium.org>
* Trogdor: Add the interrupt for USB-A overcurrentWai-Hong Tam2020-11-182-2/+21
| | | | | | | | | | | | | | | | | | | | | The USB-A VBUS is through a load switch. The FAULT_L pin of the load switch requires an external pull-up. Apply the pull-up on EC side. Add the interrupt of the FAULT_L pin. Route to the function board_overcurrent_event(), which currently prints an error message. BRANCH=Trogdor BUG=b:173154219 TEST=Plugged a USB load >1.5A to the USB-A port and checked the error message was printed: [73.738372 p2: overcurrent!] Change-Id: I5f5f82de942eaf26a33051ad17f14b90d8024b89 Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2547190 Reviewed-by: Alexandru M Stan <amstan@chromium.org>
* Trogdor: Move CONFIG_CMD_AP_RESET_LOG out of bringup listWai-Hong Tam2020-11-161-1/+0
| | | | | | | | | | | | | Move this CONFIG from bringup to production. BRANCH=None BUG=b:169736149 TEST=Built the image. Change-Id: I490499f3a85f91c6f07a0e099b8c0738bf0eb787 Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2538262 Reviewed-by: Stephen Boyd <swboyd@chromium.org>
* Trogdor: Apply internal PU to the interrupt of PI3USB9201Wai-Hong Tam2020-11-071-1/+5
| | | | | | | | | | | | | | | | | The BC1.2 chip PI3USB9281 some Trogdor old revisions used has push-pull output on the interrupt pin. But the PI3USB9201 some latest revisions used has open-drain output. These lines don't have external PU. So apply EC internal PU. BRANCH=Trogdor BUG=b:172674040 TEST=Plugged a C-to-A adapter to a CDP port, the BC1.2 interrupted and detected the 1.5A source. Change-Id: I15e27221bff1ce35fc35b03ac38340b5dfb1055d Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2523298 Reviewed-by: Stephen Boyd <swboyd@chromium.org>
* Trogdor: Apply PD to sensors' interrupts before entering hibernateWai-Hong Tam2020-11-021-0/+9
| | | | | | | | | | | | | | | | Sensors are unpowered in hibernate. Apply PD to the interrupt lines such that they don't float. Don't need to remove the PD as they will be restored to the gpio.inc configs before the interrupts are enabled. BRANCH=None BUG=b:169595541 TEST=Triggered EC hibernate, woke up, and verified sensors working. Change-Id: I18819700d454fbbc16b28f65dad9533d97aa7d4c Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2511805 Reviewed-by: Alexandru M Stan <amstan@chromium.org> Reviewed-by: Stephen Boyd <swboyd@chromium.org>
* Trogdor: Configure OE_L and SEL of DP muxes to prevent leakageWai-Hong Tam2020-10-311-2/+2
| | | | | | | | | | | | | | | | | | | | | The OE_L has external pull-up. It is actually an open-drain output. Configuring it to push-pull has leakage through the pull-up to an unpowered rail during EC hibernate. Also configure SEL to output low if OE_L is deasserted. The SEL has no meaning if the muxes are disabled. When EC hibernate, the muxing ICs are unpowered. Outputing low prevents leakage through the muxing ICs. BRANCH=None BUG=b:169595541 TEST=Plugged a HDMI monitor to port-0 and port-1; checked the DP mux settings correctly. Change-Id: Icf0e81172626c09bc556756f1bcdddb83f45ac68 Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2508864 Reviewed-by: Stephen Boyd <swboyd@chromium.org>
* Trogdor: Define the NC strap and output it lowWai-Hong Tam2020-10-311-0/+3
| | | | | | | | | | | | | Define the NC strap and output it low for power saving. BRANCH=None BUG=b:169595541 TEST=Built the images and booted fine. Change-Id: Ic2f1a098218403c3bff534b921b385ba893a83cf Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2508863 Reviewed-by: Stephen Boyd <swboyd@chromium.org>
* Trogdor: Do not activate g-sensors in S5Wai-Hong Tam2020-10-231-2/+2
| | | | | | | | | | | | | | | | | The g-sensors are not necessary to be active in S5; no gesture recognition in Trogdor designs. Do not activate it in S5. Though without this change, EC doesn't read the g-sensors as there is no config (zero odr) for S5. BRANCH=None BUG=b:170288119 TEST=Still read the g-sensors on S0 and S3. Change-Id: I54e8012e2674e13273e5fe9b96e9e9e6086e6490 Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2492529 Reviewed-by: Stephen Boyd <swboyd@chromium.org>
* Trogdor: Deprecate PMIC_FAULT_L signalWai-Hong Tam2020-10-221-1/+1
| | | | | | | | | | | | | | This signal is no longer connected to PMIC on recent hardware revisions. It is unused. Deprecate it. BRANCH=None BUG=b:171245607 TEST=Built the affected Trogdor images. Change-Id: I75562f1aa9e411df38afd321ab63b51e91e7d4f7 Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2488660 Reviewed-by: Alexandru M Stan <amstan@chromium.org>
* Trogdor: Remove GPIO 1.8V flagsWai-Hong Tam2020-10-201-6/+6
| | | | | | | | | | | | | | | | | | | | | | | The supply of the following GPIOs are VSPI/VHIF which is 1.8V. Their voltage levels are not configurable. The 1.8V flag is unnecessary. * PS_HOLD * PMIC_FAULT_L * AP_SUSPEND * ACCEL_GYRO_INT_L The following GPIOs are on 3.3V supply and not configurable. The 1.8V flag doesn't work. As they are used as open-drain, should be fine. * PM845_RESIN_L * PMIC_KPD_PWR_ODL BRANCH=None BUG=b:169595541 TEST=Tested the power-on and power-off sequence. Change-Id: I309c1a925b78e1140967cf3702e4ec3bba2a4583 Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2485910 Reviewed-by: Alexandru M Stan <amstan@chromium.org>
* Trogdor: Enable pull-down on SHI signalsWai-Hong Tam2020-10-201-0/+9
| | | | | | | | | | | | | | | Enable pull-down to avoid these signals floating. It is believed that it can get better power number in S5/G3. BRANCH=None BUG=b:169595541 TEST=Host commands between EC and AP work as expected. Check the GPIOs are low when AP is off. Change-Id: I1bcf882bf8f29b06a129700faebee8552085f0ef Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2469505 Reviewed-by: Alexandru M Stan <amstan@chromium.org>
* Trogdor: Enable PPC power sink path before hibernate on old boardsWai-Hong Tam2020-10-081-0/+13
| | | | | | | | | | | | | | | | | | | | | | The old boards don't have the hardware fix b/169797080. They need the workaround to make ACOK functional to wake EC up from hibernate. EC enables the PPC power sink path before EC enters hibernate, such that the ACOK won't be blocked by PPC. Otherwise, the PPC keeps the sink path disconnected; ACOK won't go High and can't wake EC up. Do it in board_hibernate() instead of board_hibernate_late(), which has I2C disabled. BRANCH=None BUG=b:170324206 TEST=Tested on Lazor, without the hardware rework. Triggered EC into hibernate; plugging AC can wake EC up. Change-Id: I3a97f59a344aff88b12fb19e2ea3ae126d1a8715 Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2461939 Reviewed-by: Stephen Boyd <swboyd@chromium.org>
* Trogdor: Assert a GPIO to turn off rails before enter hibernateWai-Hong Tam2020-10-081-0/+1
| | | | | | | | | | | | | | | | We disabled the PSL mode hibernate. We uses another GPIO to control switches, which were originally controlled by PSL_OUT. Add this GPIO, named HIBERNATE_L, such that the non-PSL mode hibernate can retrofit the original design. BRANCH=None BUG=b:169797080 TEST=Triggered EC hibernate and checked the HIBERNATE_L GPIO asserted. Change-Id: I69c0d0296f701f3027adfd4d27fa51bdae0844a5 Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2446662 Reviewed-by: Alexandru M Stan <amstan@chromium.org>