summaryrefslogtreecommitdiff
path: root/board/lazor/board.h
Commit message (Collapse)AuthorAgeFilesLines
* lazor: Fix compilation warningWai-Hong Tam2021-05-061-2/+0
| | | | | | | | | | | | | | It fixes the compilation warning: warning: implicit declaration of function 'board_is_clamshell'. BRANCH=None BUG=None TEST=Built Chromium EC and Zephyr EC. Checked no warning. Change-Id: I3278cd29853ff8882b36a32ed95fd0c81f0b8491 Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2876172 Reviewed-by: Keith Short <keithshort@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>
* lazor: move sku functions into separate sku.c fileJack Rosenthal2021-03-221-0/+2
| | | | | | | | | | | | | | | | | | | Refactor board.c to move the sku-related configuration detection functionality to it's own file. This will make the process of including this code in Zephyr easier. Had to add an ugly ifdef around some TCPM stuff as we don't have that going in Zephyr yet... sorry :-( BUG=b:183054226,b:183118990 BRANCH=none TEST=power sequence lazor (using CrOS EC OS build) Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: Ibf746de807afe284eb63134f0af47b0d2d5ac471 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2774366 Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Wai-Hong Tam <waihong@google.com>
* lazor: move declaration of battery_cell_type to ln9310.hJack Rosenthal2021-03-221-8/+0
| | | | | | | | | | | | | | | | | | | ln9310 driver depends on these functions (sadly), so it does not make sense to be declaring them in board.h. Specifically, the Zephyr build won't include Lazor's board.h. ln9310.h is the best home I can think of for now. Ideally we could refactor this later so that the ln9310 driver wasn't depending on board-specific functions. BUG=b:183054226 BRANCH=none TEST=buildall Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: I7c82d2ed3d3c16d8131238cd236741e31de5b0c7 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2776221 Reviewed-by: Simon Glass <sjg@chromium.org>
* sc7180: move switchcap declarations to common headerJack Rosenthal2021-03-191-4/+0
| | | | | | | | | | | | | | | | | | | | | 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>
* board/lazor: Move enum definition before its useTom Hughes2021-03-161-0/+7
| | | | | | | | | | | | | | | | board/lazor/board.h:121:6: error: ISO C++ forbids forward references to 'enum' types enum battery_cell_type board_get_battery_cell_type(void); ^ BRANCH=none BUG=b:144959033 TEST=none Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: Id2abde06326a0fe9297b98127aa7ef6768ce1479 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2740564 Reviewed-by: Jack Rosenthal <jrosenth@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>
* lazor: Add motion sensors ICM40608 and KX022Sue Chen2020-12-221-0/+10
| | | | | | | | | | | | | | | | | | | KX022 is for lid accel. ICM40608 is for base accel and gyro. For the i2c addresses of KX022 and BMA255 are different, do a single read to check which chip is on the DUT. For the i2c addresses of ICM40608 and BMI160 are the same, read reg ICM426XX_REG_WHO_AM_I to check if the chip is ICM426XX_CHIP_ICM40608. BUG=b:175663607 BRANCH=none TEST=Motion sensors are detected correctly and ectool motionsense show correct data. Signed-off-by: Sue Chen <sue.chen@quanta.corp-partner.google.com> Change-Id: I2788bdc1e5bad1b1212ffaa7670969318b77221f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2592304 Reviewed-by: Wai-Hong Tam <waihong@google.com>
* Lazor: Remove the bring-up featuresWai-Hong Tam2020-11-161-6/+0
| | | | | | | | | | | | | Remove all the bring-up features. BRANCH=None BUG=b:169736149 TEST=Built the image. Change-Id: Ic1175c11ffede2e1267c88b1932724b5c34a2424 Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2538263 Reviewed-by: Stephen Boyd <swboyd@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>
* Lazor: Remove some of the bring-up featuresWai-Hong Tam2020-10-221-2/+0
| | | | | | | | | | | | | | | | | | Remove the CONFIG_BRINGUP and CONFIG_SYSTEM_UNLOCKED, to align the behaviors to the shipping devices, like disabling PD in RO. The remaining bring-up features have no behavior difference with the shipping devices. They just add some debug commands. We can keep them for a while. BRANCH=None BUG=None TEST=Build Lazor image and it booted correctly. Change-Id: I8e4d7a3f2937e6ce07a46eb9555ad00c50e6b667 Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2415379 Reviewed-by: Stephen Boyd <swboyd@chromium.org>
* Trogdor: Mask proper Search key location on the board levelWai-Hong Tam2020-09-261-0/+1
| | | | | | | | | | | | | | | | | | | | Don't use the default key mask, which enables both the old location (KSO_01/KSI_00) and the new location (KSO_00/KSI_03) for the Search key. It makes EC over-doing ghost detection. Define the key mask on the board level: * Trogdor/Lazor uses the old location * Pompom uses the new location * Coachz has no keyboard BRANCH=None BUG=b:169361784 TEST=Tested on Lazor, enabled "ksstate on" in EC console, pressed Grave + Tab + Left-Ctrl and saw these keys detected. Change-Id: I0cf37921901a4f997edbef3ac6a89e4351e742d7 Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2432449 Reviewed-by: Douglas Anderson <dianders@chromium.org>
* Lazor: Support multiple PS8xxx TCPC and switch to PS8805 on rev3+Wai-Hong Tam2020-09-171-0/+2
| | | | | | | | | | | | | | Lazor rev3+ switches the TCPC to PS8805. This CL makes it support multiple TCPC on a single image. BRANCH=None BUG=b:168682309 TEST=Built Lazor image correctly. Change-Id: I2fc93ae18051e8950c2a7975e43771c238c22aad Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2415631 Reviewed-by: Alexandru M Stan <amstan@chromium.org>
* Coachz: Remove the keyboard backlight supportWai-Hong Tam2020-09-171-0/+3
| | | | | | | | | | | | | | | | Coachz doesn't has an internal keyboard. Move the CONFIG from baseboard to board, as the keyboard backlight is not a common feature. BRANCH=None BUG=b:167884598 TEST=Built the Coachz image. Change-Id: Idd5937da9ad6a3ab1be277e537bbd2e70e2b1d9a Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2410855 Reviewed-by: Stephen Boyd <swboyd@chromium.org>
* Lazor: Support new battery AP18C8K and AP18C4KSue Chen2020-09-161-0/+2
| | | | | | | | | | | | | | Add new battery config: AP18C8K and AP18C4K BUG=b:168139106 BRANCH=none TEST=Check found battery info in console and cutoff work. Signed-off-by: Sue Chen <sue.chen@quanta.corp-partner.google.com> Change-Id: Ic7d08ee932fd61681bf30e4dae98cd2d349a056f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2413189 Reviewed-by: Wai-Hong Tam <waihong@google.com> Commit-Queue: Wai-Hong Tam <waihong@google.com>
* Trogdor: Move GPIO aliases from baseboard to boardWai-Hong Tam2020-09-161-0/+2
| | | | | | | | | | | | | | Move some GPIO aliases from baseboard to board such that they can be customized to use different names. BRANCH=None BUG=b:167884598 TEST=Built the affect Trogdor boards. Change-Id: Id8d68d9b03d43010a81565f7625b8033aab14594 Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2410850 Reviewed-by: Stephen Boyd <swboyd@chromium.org>
* ln9310: Move battery cell type to board customizationWai-Hong Tam2020-09-041-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | Checking the input voltage to make the decision of 2S battery or 3S battery is not reliable. The 3S battery with very low charge might be under 10V that we initialized the switchcap to 2:1 mode. When the battery was then charged up to 12V, VOUT would go to 6 V which would be a problem. This change moves the decision to board customization. It checks the SKU ID. It can be extended to other ways, like checking the battery manufacturer and device names. To prevent any damage when attaching a 3S battery to a 2S-SKU board, add a check before configuring the switchcap to 2:1 mode. BRANCH=None BUG=b:163867792, b:151393598 TEST=Built successfully. Change-Id: I3f69132bc00b13ec39b229e98a34a5f7f75008f1 Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2391210 Reviewed-by: Stephen Boyd <swboyd@chromium.org>
* lazor/limozeen: Support clamshell SKUsWai-Hong Tam2020-09-041-0/+2
| | | | | | | | | | | | | | Configure the sensor count to 0, disable the tablet mode switch, and disable the interrupt line for the clamshell SKUs. BRANCH=None BUG=b:166934151 TEST=Tested Lazor; its sensors working properly. Change-Id: Id70c2f2925a5538e3492810fec9aad000514ea17 Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2391203 Reviewed-by: Stephen Boyd <swboyd@chromium.org>
* pompom: Remove TCPC port1 configurationAlvinCC_Hsu2020-09-041-0/+1
| | | | | | | | | | | | | | | | This patch removes configurations (I2C, GPIO, TASK and Interrupt...) about TCPC port1 for pompom. BUG=b:167476139 BRANCH=none TEST=power on after flashing FW and it works normal. Signed-off-by: AlvinCC_Hsu <alvincc_hsu@compal.corp-partner.google.com> Change-Id: I1275c1ef7e7d3e65d695dace834a9bcbb4e66dcc Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2391022 Reviewed-by: Wai-Hong Tam <waihong@google.com> Commit-Queue: Wai-Hong Tam <waihong@google.com> Tested-by: Wai-Hong Tam <waihong@google.com>
* lazor/limozeen: Support DA9313 and LN9310 switchcapsWai-Hong Tam2020-09-021-0/+5
| | | | | | | | | | | | | | | | Dynamic detect the present of LN9310 by probing the I2C device. If LN9310 not present, fallback to use DA9313. Initialize the switchcap in different ways, like its enable pin, interrupt, power good, etc. BRANCH=None BUG=b:163867792, b:151393598 TEST=Built Lazor image, checked DA9313 detected, booted into kernel. Change-Id: I661282e27a09af1bf30e5b7acba32772a6a8885d Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2386482 Reviewed-by: Stephen Boyd <swboyd@chromium.org>
* sc7180: Decouple the switchcap control from the power sequenceWai-Hong Tam2020-09-021-0/+4
| | | | | | | | | | | | | | | | | Currently, SC7180 power sequence is tightly coupled with a single switchcap part, i.e. DA9313. Should decouple the switchcap control from the power sequence, such that more different switchcap parts can be supported. BRANCH=None BUG=b:163867792 TEST=Built the affect images and booted into kernel. Change-Id: I7f63cd22bbc308672c40a734be4f6dfc80e07158 Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2386480 Reviewed-by: Stephen Boyd <swboyd@chromium.org> Reviewed-by: Philip Chen <philipchen@chromium.org>
* Lazor: Remove CONFIG_USB_PD_REV20Wai-Hong Tam2020-07-221-2/+0
| | | | | | | | | | | | | | | The crrev.com/c/2184547 and crrev.com/c/2212678 made the PD rev 2.0 default and don't need to define the CONFIG. BRANCH=None BUG=None TEST=Built the image. Change-Id: I62a0280d35b631f3317a48a41bbc26ed6b583c6c Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2290059 Reviewed-by: Philip Chen <philipchen@chromium.org> Reviewed-by: Stephen Boyd <swboyd@chromium.org>
* lazor: Add a new battery and enable battery revive disconnectWai-Hong Tam2020-07-221-0/+2
| | | | | | | | | | | | | | | | | | | | | Add a new battery and define its ship_mode an fet registers. Enable the battery revive disconnect, that the PD Try.SRC feature will not be enabled if the battery discharge FET is not active. It helps the first time boot from battery cutoff. The battery needs more time to sample the board present. During that time the discharge FET is inactive. Enabling Try.SRC will cause the power lost and then reboot loop. We should not enable Try.SRC in this case. BRANCH=None BUG=b:159319530 TEST=Cut off the battery; the first time boot is successful. Change-Id: Icbf2a5b958da823af0b79facb9c1e806f37c712a Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2303432 Reviewed-by: Udaya Kiran Ammu <udaykiran@google.com> Reviewed-by: Jett Rink <jettrink@chromium.org>
* power: Use a general name for PMIC_RESIN_L signal on sc7180 and sdm845Wai-Hong Tam2020-07-201-0/+3
| | | | | | | | | | | | | Don't bound to the PMIC part name. BRANCH=None BUG=b:148113568 TEST=Built the affected images. Change-Id: I3c2e8851294b957aa133c6a8528de3960a3e468c Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2303815 Reviewed-by: Stephen Boyd <swboyd@chromium.org>
* Lazor: Modify battery informationSue Chen2020-07-091-0/+11
| | | | | | | | | | | | | | | Define board_battery_info and CONFIG_BATTERY_FUEL_GAUGE to get battery info by reading manufacture name. BUG=none BRANCH=none TEST=recognize the battery correctly, and cut off the battery successfully by console command and ectool Change-Id: I394c7526f17151350ca1e50e4fe638af93493699 Signed-off-by: Sue Chen <sue.chen@quanta.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2253483 Reviewed-by: Wai-Hong Tam <waihong@google.com>
* Trogdor: Enable extended GPIO command for debuggingWai-Hong Tam2020-06-111-0/+1
| | | | | | | | | | | | | | | The extended GPIO command is useful for debugging. It can modify the GPIO flags, like changing an input to an output. Enable it as a bringup feature. BRANCH=None BUG=None TEST=Used "gpioset" command to change a GPIO from an input to an output. Change-Id: I2b7b1947d0853d7e23378647d152a33b650b551d Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2220832 Reviewed-by: Stephen Boyd <swboyd@chromium.org>
* Lazor: Change the lid accel sensor driverWai-Hong Tam2020-05-161-2/+2
| | | | | | | | | | | | | | Change the driver from KX022 to BMA253. BRANCH=None BUG=b:155853349 TEST=Build the lazor image and check the lid accel sensor info. Change-Id: I945173dfa0592adbfc4ff16ebe203a92515c5f29 Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2200067 Reviewed-by: Philip Chen <philipchen@chromium.org> Reviewed-by: Alexandru M Stan <amstan@chromium.org>
* Trogdor: Remove triggering AP cold reset over a hostcommandWai-Hong Tam2020-05-161-1/+0
| | | | | | | | | | | | | | | This route hasn't been used. Remove it. That makes the chipset_reset() do the same thing for all requests. BRANCH=None BUG=b:119261783 TEST=Ran the command "ectool apreset" in userspace; returned error: EC result 1 (INVALID_COMMAND) Change-Id: I8cb8b0df508ab0cbcebafed528c2204f6210cbf7 Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2204581 Reviewed-by: Julius Werner <jwerner@chromium.org>
* Trogdor: Enable debug features for USB PDWai-Hong Tam2020-05-161-0/+1
| | | | | | | | | | | | | | | Enable the I2C trace and TCPCI dump, which are useful for debugging USB Type-C related issues. TCPCI dump has no performance impact. It can still be enabled on production. BRANCH=None BUG=b:146075455 TEST=Tried the console commands i2ctrace and tcpci_dump. Change-Id: I2f39c8fb91db2a853eb4b9d5d159d5e137b3b087 Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2204580 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* Lazor: Support tablet modeWai-Hong Tam2020-04-091-1/+17
| | | | | | | | | | | | | | | | Add functions to support tablet mode: * Lid acceleration definitions * TABLET_MODE_L interrupt * Lid angle detection that disables keyboard BRANCH=None BUG=b:150793669 TEST=Built the Lazor image successfully. Change-Id: I2622bdb1c4899f70b8dd1321b33cac9306fd4abb Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2122838 Reviewed-by: Alexandru M Stan <amstan@chromium.org>
* Lazor: Initial commit for Lazor boardWai-Hong Tam2020-04-021-0/+79
Major changes: * EC chip: NPCX796FC * Flash size: 512KB * TCPC chips: PS8751 * BC1.2 chips: PI3USB9201 * Update GPIOs BRANCH=None BUG=b:150793669 TEST=Built the Lazor image successfully. Change-Id: I28b53b9aa7867153f86c947e3a441f3c5c081549 Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2123050 Reviewed-by: Alexandru M Stan <amstan@chromium.org>