summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Guybrush: Enable Power Group interruptsstabilize-13851.B-mainelmo_lan2021-03-131-0/+4
| | | | | | | | | | | | | | Enable interrupt of PG_GROUPC_S0_OD and PG_LPDDR4X_S3_OD. BUG=b:182581653 BRANCH=None TEST=EN_PWR_PCORE_S0_R works normal. Signed-off-by: elmo_lan <elmo_lan@compal.corp-partner.google.com> Change-Id: I06ece39630b3f4eab290a80a64b9f70a8f61cac0 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2757809 Reviewed-by: Rob Barnes <robbarnes@google.com> Commit-Queue: Rob Barnes <robbarnes@google.com>
* mchp: Update chip configuration and flash layout for MEC172xScott Worley2021-03-132-24/+42
| | | | | | | | | | | | | | | | | | | Adding MEC172x specific changes to chip configuration and flash layout header files. MEC172x Boot-ROM loader SPI flash layout is different from previous chips. BRANCH=none BUG=none TEST=Build MCHP MEC170x and MEC152x boards Signed-off-by: Scott Worley <scott.worley@microchip.corp-partner.google.com> Change-Id: Id02cdeac8131844e948799c0c9de4f45c47d4d73 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2747654 Reviewed-by: Martin Yan <martin.yan@microchip.corp-partner.google.com> Reviewed-by: Vijay P Hiremath <vijay.p.hiremath@intel.com> Reviewed-by: Ravin Kumar <ravin.kumar@microchip.com> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Tested-by: Martin Yan <martin.yan@microchip.corp-partner.google.com>
* mchp: Add Microchip MEC172x registersScott Worley2021-03-134-66/+1536
| | | | | | | | | | | | | | | | | | | | Microchip MEC172xN is an EC with 416KB total SRAM with eSPI and SPI Host interfaces. The CPU is an ARM Cortex-M4 with FPU, 8 region MPU, and maximum frequency of 96 MHz. This change also adds common CPU clock divider defines for all MEC chips and moves the DMA API struct to the common register header. BRANCH=none BUG=none TEST=Build MCHP MEC170x and MEC152x boards Signed-off-by: Scott Worley <scott.worley@microchip.corp-partner.google.com> Change-Id: Ie159a4addf0bbcd30404339944d5b1695482ab6c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2746438 Reviewed-by: Ravin Kumar <ravin.kumar@microchip.com> Reviewed-by: Vijay P Hiremath <vijay.p.hiremath@intel.com> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Tested-by: Martin Yan <martin.yan@microchip.corp-partner.google.com>
* zephyr: fix Kconfig name for console commandsKeith Short2021-03-126-20/+20
| | | | | | | | | | | | | | | Cleanup Kconfig options to match the convention of starting with CONFIG_PLATFORM_EC_CONSOLE_CMD_*. BUG=b:181794644 BRANCH=none TEST=zmake testall Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: Ibed3d0371483b26c17f8f8c05c088694b6f3728d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2756981 Reviewed-by: Simon Glass <sjg@chromium.org> Commit-Queue: Simon Glass <sjg@chromium.org>
* ocpc: Use desired current from charger taskAseda Aboagye2021-03-121-5/+5
| | | | | | | | | | | | | | | | | | | | | OCPC was directly querying the desired battery current instead of honoring the request from the charger task by mistake. This commit fixes that and makes sure that we don't set our current target from the desired battery current directly. BUG=b:180710082 BRANCH=dedede TEST=Build and flash sasuke, charge from C1, verify that desired charge profile is adhered to. Signed-off-by: Aseda Aboagye <aaboagye@google.com> Change-Id: I6d59babcad891fd09ab9a4fc5641e6d152223b74 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2740572 Tested-by: YongBeum.Ha <ybha@samsung.corp-partner.google.com> Reviewed-by: YongBeum.Ha <ybha@samsung.corp-partner.google.com> Reviewed-by: Diana Z <dzigterman@chromium.org> Auto-Submit: Aseda Aboagye <aaboagye@chromium.org> Commit-Queue: Diana Z <dzigterman@chromium.org>
* zephyr: volteer: Enable battery cut-offKeith Short2021-03-121-3/+1
| | | | | | | | | | | | | | | | | Battery cut-off was disabled because it caused problems when the battery capacity reached 99%. Battery cut-off is no longer causing any charging issues. BUG=b:179393708 BRANCH=none TEST=Discharge battery to 90%, charge to 100% successfully TEST=Run `ectool batterycutoff`, verify battery cutsoff Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: Ied8fa9478ff0360f4077225317d8ae4ad69598d1 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2756968 Reviewed-by: Simon Glass <sjg@chromium.org> Commit-Queue: Simon Glass <sjg@chromium.org>
* VPD: Properly set VPD RA and RD on CC1 and CC2Sam Hurst2021-03-121-2/+2
| | | | | | | | | | | | | | | | Set the RA and RD on CC1 and CC2 of a Vconn Powered Device during the Disc. ID phase. BUG=b:165934405 BRANCH=none TEST=make runtests Verified that CC1 and CC2 were detected as RA and RD using a Total Phase Analyzer. Signed-off-by: Sam Hurst <shurst@google.com> Change-Id: I23e6cdaaa89b77adeb503b28d5847df68ab3cd5d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2748428 Reviewed-by: Diana Z <dzigterman@chromium.org>
* TCPMV2: Add explicit setting of VPD VDO CT CurrentSam Hurst2021-03-125-17/+41
| | | | | | | | | | | | | | | | | | Add the capablility to explicity set a CTVPDs VDO current. BUG=b:165934405 BRANCH=none TEST=make runtests Verified that returned VDO from chocodile_vpdmcu was correct. Signed-off-by: Sam Hurst <shurst@google.com> Change-Id: I2292024986fa89b228b56678d61d1aef2866c817 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2748427 Tested-by: Sam Hurst <shurst@google.com> Reviewed-by: Diana Z <dzigterman@chromium.org> Commit-Queue: Sam Hurst <shurst@google.com>
* TCPMV2: Fix the VPD_VDO returned by VPDsSam Hurst2021-03-121-1/+1
| | | | | | | | | | | | | | | | A device that supports Vconn Powered functionality must reflect this by setting bit0 of its VPD VDO to 1 or 0 if said functionality isn't supported. BUG=b:165934405 BRANCH=none TEST=make runtests Verified that returned VDO from chocodile_vpdmcu was correct. Signed-off-by: Sam Hurst <shurst@google.com> Change-Id: I2f7b6a66c09221f1d5c12831cd2e4b56510aecdd Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2748426 Reviewed-by: Diana Z <dzigterman@chromium.org>
* zephyr: add DPTF supportKeith Short2021-03-126-0/+33
| | | | | | | | | | | | | | | | | | | | | | Add a Kconfig option to enable DPTF support. Adds support for the following ACPI entries: EC_ACPI_MEM_FAN_DUTY (0x04) EC_ACPI_MEM_TEMP_ID (0x05) EC_ACPI_MEM_TEMP_THRESHOLD (0x06) EC_ACPI_MEM_TEMP_COMMIT (0x07) BUG=b:179886912 BRANCH=none TEST=zmake testall TEST=Boot zephyr-ec on Volteer, observe that ACPI warnings for ignored read/writes for DPTF commands are fixed. Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: I40cbe79e57c3d4687d828ec46fe0d51034e96bfc Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2757028 Reviewed-by: Simon Glass <sjg@chromium.org> Commit-Queue: Simon Glass <sjg@chromium.org>
* zephyr: Improve help text for ACPI supportKeith Short2021-03-121-3/+15
| | | | | | | | | | | | | | Expand on the help text for the CONFIG_PLATFORM_EC_ACPI option. BUG=none BRANCH=none TEST=zmake testall Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: Ib24f355ad22664805c8ab1ada84aa40ed6572637 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2757027 Reviewed-by: Simon Glass <sjg@chromium.org> Commit-Queue: Simon Glass <sjg@chromium.org>
* Jelboz: Dynamic charging current control.Jacky Wang2021-03-122-0/+90
| | | | | | | | | | | | | | | | | | 1. Limit Charging Current by thrmal sensor 0 temperature(Charger). 2. If temperature over or under 54C and keep 5s, Charging Current will change to next level. 3. Limit Charging Current table : 2200/1800/1700/1600 BUG=b:181085004 BRANCH=firmware-zork-13434.B TEST=make BOARD=shuboz 1. Verified pass by thermal team. Signed-off-by: Jacky Wang <jacky5_wang@pegatron.corp-partner.google.com> Change-Id: Ic2526db54815759e52b56c662a364237ff6d878f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2716585 Reviewed-by: Edward Hill <ecgh@chromium.org> Commit-Queue: Edward Hill <ecgh@chromium.org>
* TCPMv2: Add support for disabling type-2 BIST modeScott Collyer2021-03-124-1/+25
| | | | | | | | | | | | | | | | | | | | | | This CL adds a TCPCI method to disable BIST mode for the case where the TCPC does not handle the duration automatically. This is required for the ucpd driver as once type-2 BIST mode is started, the ucpd peripheral needs to be reset to stop. This CL also reduces the timer value from 60 msec to 55 msec to ensure that there is enough time for BIST to be stopped and still be in spec. BUG=b:182436876 BRANCH=None TEST=verifed on Quiche that when type-2 BIST is started then it stops when the timer in PE expires. This fixes TDA.2.1.1.1: BMC-PHY-TX-EYE Signed-off-by: Scott Collyer <scollyer@google.com> Change-Id: I59ee7ac0dead09ac3a1b5783cfa3fe9db238eb7e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2660803 Tested-by: Scott Collyer <scollyer@chromium.org> Reviewed-by: Diana Z <dzigterman@chromium.org> Commit-Queue: Scott Collyer <scollyer@chromium.org>
* kconfig: Add CONFIG_USB_PD_TCPC_VCONNRob Barnes2021-03-123-0/+15
| | | | | | | | | | | | | | | | Add CONFIG_USB_PD_TCPC_VCONN to Kconfig.usb. Also add CONFIG_VBOOT_HASH_RELOAD_WATCHDOG to allow list since it's a temporary config (b/182499153). BUG=None TEST=Build BRANCH=None Signed-off-by: Rob Barnes <robbarnes@google.com> Change-Id: Idde220f7d89a719686b3afba83c94b9973deca9d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2752431 Reviewed-by: Denis Brockus <dbrockus@chromium.org> Commit-Queue: Denis Brockus <dbrockus@chromium.org>
* Guybrush: Don't read GPIO_EN_KB_BL as ioexRob Barnes2021-03-121-2/+2
| | | | | | | | | | | | | | GPIO_EN_KB_BL is being read as an ioexpander gpio. This was true on Zork but on Guybrush it's a regular EC GPIO. BUG=None BRANCH=None TEST=Build Change-Id: I1ced4ebbb8c5cbd2dfca0e12528dfcb8fa47f789 Signed-off-by: Rob Barnes <robbarnes@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2755194 Reviewed-by: Diana Z <dzigterman@chromium.org>
* brya: Enable tablet modeBoris Mittelberg2021-03-124-1/+11
| | | | | | | | | | | | | Enable GMR sensor and tablet mode for Brya. BRANCH=none BUG=b:181368071 TEST=buildall passes, manually tested with a magnet Signed-off-by: Boris Mittelberg <bmbm@google.com> Change-Id: I3d408e6b6bdd2bc5da81203c0c4e80c2ff367c05 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2737240 Reviewed-by: Furquan Shaikh <furquan@chromium.org>
* USB PD: Lower SinkWaitCap timerDiana Z2021-03-121-1/+1
| | | | | | | | | | | | | | | | | Currently, our SinkWaitCap timer is about 20 ms below the maximum. Lower an additional 25 ms to ensure we're hard resetting consistently in time during testing. This should still offer relatively generous time for the partner to begin sending source capabilities. BRANCH=None BUG=b:173027500 TEST=make -j buildall Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: I308ad2c5590aeeed8179ed482cf03a784a852840 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2728946 Reviewed-by: Scott Collyer <scollyer@chromium.org> Commit-Queue: Scott Collyer <scollyer@chromium.org>
* TCPMv2: Detach before disabling PDAbe Levkoy2021-03-121-0/+1
| | | | | | | | | | | | | | | | Set TC state as if it were entering an Unattached state when entering an open state, so that accesses to TC state during open states return coherent results. BUG=b:182401047 TEST=Run ectool typecstatus with PD suspended; events are cleared BRANCH=firmware-volteer-13672.B-main Change-Id: I17d64459452c2671dddd8f4b6ff11124c09ace72 Signed-off-by: Abe Levkoy <alevkoy@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2752798 Reviewed-by: Diana Z <dzigterman@chromium.org> Commit-Queue: Diana Z <dzigterman@chromium.org>
* elemi: Remove CONFIG_SYSTEM_UNLOCKEDDevin Lu2021-03-121-2/+0
| | | | | | | | | | | | | Remove CONFIG_SYSTEM_UNLOCKED for firmware qual. BUG=none BRANCH=volteer TEST=make buildall Signed-off-by: Devin Lu <Devin.Lu@quantatw.com> Change-Id: Iba80311009ebd0b78dee68d7184e892564c43c40 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2744557 Reviewed-by: Keith Short <keithshort@chromium.org>
* elemi: Remove CONFIG_BYPASS_CBI_EEPROM_WP_CHECKDevin Lu2021-03-121-1/+0
| | | | | | | | | | | | | Remove CONFIG_BYPASS_CBI_EEPROM_WP_CHECK for firmware qual. BUG=none BRANCH=volteer TEST=make buildall Signed-off-by: Devin Lu <Devin.Lu@quantatw.com> Change-Id: Ie3af6ba0b6a2661c071150908a3748e3220c305c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2744556 Reviewed-by: Keith Short <keithshort@chromium.org>
* kconfig: Alias EN_PWR_A to EN_PWR_S5Rob Barnes2021-03-124-4/+2
| | | | | | | | | | | | | EN_PWR_A should alias to EN_PWR_S5. EN_PWR_Z1 is PSL_OUT. BUG=b:182512084 TEST=Build BRANCH=None Signed-off-by: Rob Barnes <robbarnes@google.com> Change-Id: Iabec65bb573d200a12e727d281f8c97cf1ee0ec4 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2753816 Reviewed-by: Diana Z <dzigterman@chromium.org>
* Mordin: Add one more SKUIDsDevin Lu2021-03-121-0/+1
| | | | | | | | | | | BUG=b:171755306 BRANCH=firmware-grunt-11031.B TEST=make buildall -j Signed-off-by: Devin Lu <Devin.Lu@quantatw.com> Change-Id: I45830335545206f665e84866e0b11a2c666d0101 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2752572 Reviewed-by: Edward Hill <ecgh@chromium.org>
* brya: remove CONFIG_BRINGUPBoris Mittelberg2021-03-121-1/+0
| | | | | | | | | | | | | Remove BRINGUP flag to allow proper cold reboot BRANCH=none BUG=b:182443498 TEST=buildall passes, manual test via `ectool reboot_ec cold` Signed-off-by: Boris Mittelberg <bmbm@google.com> Change-Id: I5a9d25ea9125acdec3645a6566965988eedb3e94 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2752436 Reviewed-by: Furquan Shaikh <furquan@chromium.org>
* brya: Enable LEDsBoris Mittelberg2021-03-124-2/+104
| | | | | | | | | | | | | Enable control of right and left LEDs, display charging status. BRANCH=none BUG=b:182329831 TEST=buildall passes, manual test with ectool Signed-off-by: Boris Mittelberg <bmbm@google.com> Change-Id: I1463102924a6300843f3381e1b66d88ae0096157 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2752345 Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
* dedede/raa489000: Set LPM exit debounce to 100msAseda Aboagye2021-03-118-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | For some reason, when the RAA489000 TCPC exits low power mode, CC status doesn't appear changed when using a servo v4. This causes us to think no connection is present and immediately but the IC back into low power mode. If we wait 100ms before querying the CC status reg, it seems that then the right values are reported. This commit adds a workaround by setting the LPM exit debounce time to 100ms. BUG=b:182429150,b:181308089 BRANCH=dedede TEST=Build and flash a board, verify that servo v4 with an external charger is detected. Signed-off-by: Aseda Aboagye <aaboagye@google.com> Change-Id: Ic0c2406fa20d0dad82adee865cd87c46d7126b9f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2752250 Tested-by: Aseda Aboagye <aaboagye@chromium.org> Auto-Submit: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Diana Z <dzigterman@chromium.org> Commit-Queue: Diana Z <dzigterman@chromium.org>
* zephyr: lazor: enable board version using GPIOJack Rosenthal2021-03-112-1/+7
| | | | | | | | | | | | | | | Lazor uses the Board ID pins to select the board version. Create the appropriate definitions in gpio_map.h and enable. BUG=b:102398910 BRANCH=none TEST=run "version" command, board version is 3 as expected for DVT Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: Ib2730e3fa6be01c1eacb2b986be72cd334b7ec76 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2752343 Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org>
* zephyr: add AP Kconfig options for Qualcomm SC7180Jack Rosenthal2021-03-112-0/+16
| | | | | | | | | | | | | | Add Kconfig options to enable support for Qualcomm SC7180 CPU. BUG=b:182398910 BRANCH=none TEST=compile for lazor Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: Ie3cf6b316f12af589cba3f2386a9d28d0d9c43ce Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2748279 Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org>
* zephyr: lazor: enable external power presence detection via GPIOJack Rosenthal2021-03-112-3/+6
| | | | | | | | | | | | | | | Enable the extpower_gpio.c module and connect the corresponding GPIOs and interrupts. BUG=b:182398910 BRANCH=none TEST=observe host mmap change when connecting/disconnecting AC Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: I6a25b859f26b5959871c5a2d948103f23aa13396 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2749428 Reviewed-by: Keith Short <keithshort@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org>
* zephyr: lazor: enable power buttonJack Rosenthal2021-03-112-2/+6
| | | | | | | | | | | | | | Enable the power button module and interrupt. BUG=b:182398910 BRANCH=none TEST=push power button, see UART print Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: I7e3d1cdf30e49d5179e746c941b51772f50b5c80 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2749426 Reviewed-by: Keith Short <keithshort@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org>
* zephyr: lazor: enable lid switchJack Rosenthal2021-03-112-1/+4
| | | | | | | | | | | | | | Enable the lid switch GPIO and module. BUG=b:182398910 BRANCH=none TEST=open and close lid, observe UART prints Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: I541eea9e6329aed5d89676c7f3937c7d73868535 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2749425 Reviewed-by: Keith Short <keithshort@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org>
* zephyr: lazor: enable PLATFORM_EC_HOSTCMDJack Rosenthal2021-03-111-1/+3
| | | | | | | | | | | | | | | | | | Enable host command support. This only enables the host command common code, which can currently compile. Further work may be required to get SPS interface with AP up and going. BUG=b:182398910 BRANCH=none TEST=flash on lazor, hcdebug command is present Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: I82114fe63d962072339b466450f0820038992020 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2749424 Reviewed-by: Keith Short <keithshort@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org>
* zephyr: lazor: populate gpiosJack Rosenthal2021-03-112-2/+310
| | | | | | | | | | | | | | | | | | Populate named-gpios dts from boards/lazor/gpio.inc. For the most part, util/gpios_to_zephyr_dts.c was used to generate this code. See the instructions in that file if you need to replicate this CL for another project. BUG=b:182398910 BRANCH=none TEST="gpioget" on lazor Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: I195f428a5d1849e159f4468e57459a83571a133e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2749768 Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org>
* zephyr: add support for trogdor/lazorJack Rosenthal2021-03-1111-0/+227
| | | | | | | | | | | | | | | | | | | | | | | Initial bringup for Lazor, featuring just a UART console, flash access, and basic commands. I structured the directories to look a little more like what we discussed in last week's meeting (putting the Zephyr "board" directory to be common to the baseboard, and putting variants under a directory categorized by baseboard). I hope we can go back to volteer/delbin and re-adopt this layout there too, as it's much cleaner and leads to less repeated code. BUG=b:182398910 BRANCH=none TEST=flash on lazor, test out UART and basic commands ("gettime", "flashinfo", etc.) Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: I411c47e9b9563d78349abbeebf71223ae41748a5 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2749765 Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org>
* zephyr: npcx: clock: add clock turbo/normal functionsJun Lin2021-03-111-0/+32
| | | | | | | | | | | | | | | | | | | | Implement the following functions in Zephyr: 1. clock_turbo 2. clock_normal 3. clock_enable_module With these, the CPU clock can speeds up when computing the hash value and goes back to normal when the computation is done. BRANCH=none BUG=b:182224114 TEST=Volteer no longer watchdog resets and can boot up to ChromeOS Signed-off-by: Jun Lin <CHLin56@nuvoton.com> Change-Id: I419cf68c4212fdc588b9fd2a08331c4e81ccf0a0 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2748197 Tested-by: CH Lin <chlin56@nuvoton.com> Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* servo_v4p1: Improve handling of DACs' faultsMichał Barnaś2021-03-111-18/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix handling CC2 line fault. CC2 line was not checked, instead, CC1 was used in both checks. Change message that appear on servo's console after detecting DACs' faults. Now, after detecting fault on CC lines, corresponding DAC will be disabled and fault will be cleared. BUG=b:168730704 BRANCH=main TEST=On servo's console execute commands as follows. For CC1: > i2cxfer w16 1 0x48 0x8 0x0080 > i2cxfer w 1 0x23 4 0x12 Short DUT_CC1 pin to ground. Message about CC1 DAC fault should appear on console. For CC2: > i2cxfer w16 1 0x49 0x8 0x0080 > i2cxfer w 1 0x23 4 0x22 Short DUT_CC2 pin to ground. Message about CC2 DAC fault should appear on console. Signed-off-by: Michał Barnaś <mb@semihalf.com> Change-Id: I32b727790dcc54355a5211a667c091287aa04b3e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2732017 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
* charger: Add new APIs for measured charge valuesAseda Aboagye2021-03-115-25/+123
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some of the charger ICs can provide measurements for the charge voltage and the charge current. This information is needed by the OCPC module. Previously, the charge_get_current() and charge_get_voltage() functions were modified to provide this information. However, those functions are intended to provide the set voltage and current targets for the charger IC. This commit adds a new set of APIs, charge_get_actual_current() and charge_get_actual_voltage() which provides the actual charge current and voltage if the charger IC is able to provide that information. BUG=b:182018616 BRANCH=dedede TEST=Build and flash madoo, verify that `charger` EC console command shows the set current and voltage targets instead of the measured values. Check that the `chgstate` command shows the measured values for use with the OCPC module. TEST=Verify that charging from the sub board works. TEST=Verify that resistances are still calculated and seem reasonable. Signed-off-by: Aseda Aboagye <aaboagye@google.com> Change-Id: I82565d18908d9ea0f54934787897937488e280e6 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2750866 Reviewed-by: Diana Z <dzigterman@chromium.org> Commit-Queue: Aseda Aboagye <aaboagye@chromium.org> Tested-by: Aseda Aboagye <aaboagye@chromium.org>
* Metaknight: modify thermal sensor/table labelYu-An Chen2021-03-112-14/+17
| | | | | | | | | | | | | | TEMP_SENSOR_1 -> TEMP_SENSOR_MEMORY TEMP_SENSOR_2 -> TEMP_SENSOR_CPU BUG=None BRANCH=dedede TEST=check ec console temps, temperature is correct. Signed-off-by: yu-an.chen@quanta.corp-partner.google.com Change-Id: I8b47cc39ee2fc226b8f50b76fe440b0bd68d11af Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2751319 Reviewed-by: Diana Z <dzigterman@chromium.org> Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
* Sasuke use RAA489000, and need more debounce time to exit low power mode.Jongpil Jung2021-03-111-0/+2
| | | | | | | | | | | | | | | | BRANCH=dedede BUG=b:182232263 TEST=verified Sasuke can be charged by dual power role dongle. verified Sasuke can use ethernet and power with type-c servo v4. Signed-off-by: Jongpil Jung <jongpil19.jung@samsung.com> Change-Id: I900cac732f0735715c08906fef5beb2990b0d30c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2752566 Tested-by: Jongpil Jung <jongpil19.jung@samsung.corp-partner.google.com> Tested-by: Edward Doan <edoan@chromium.org> Reviewed-by: Edward Doan <edoan@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
* collis: Initial EC imageMichael5 Chen12021-03-118-0/+1134
| | | | | | | | | | | | | | | | | | | Create the initial EC image for the collis variant by copying the copano reference board EC files into a new directory named for the variant. (Auto-Generated by create_initial_ec_image.sh version 1.5.0). BUG=b:182227204 BRANCH=None TEST=make BOARD=collis Signed-off-by: Michael5 Chen1 <michael5_chen1@pegatron.corp-partner.google.com> Change-Id: Idd409872bf244651d138dd2a102e084cc6349498 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2747557 Reviewed-by: Jacky Wang <jacky5_wang@pegatron.corp-partner.google.com> Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* zephyr: add a utility to convert gpio.inc to device treeJack Rosenthal2021-03-112-0/+120
| | | | | | | | | | | | | | | Add a developer-only utility for converting a gpio.inc file to DTS. I hope this gets deleted someday when we aren't doing PoCs anymore. BUG=none BRANCH=none TEST=compile/run instructions at top of file, BOARD=lazor Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: I354c8917bac0b82f904e07c3e029806ecb67d6d2 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2752795 Reviewed-by: Simon Glass <sjg@chromium.org>
* docs: zephyr: add some documentation on PoC device bringupJack Rosenthal2021-03-112-0/+50
| | | | | | | | | | | | | | | | Add documentation on how to bring up new Zephyr OS devices for devices and platforms which already have a CrOS EC OS implementation. Based this on Lazor bringup. BUG=none BRANCH=none TEST=view in gitiles Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: I1d7466bacdd35dc4c5f02e708e87ee748e097236 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2752794 Reviewed-by: Simon Glass <sjg@chromium.org>
* isl923x: Fix the calculation formula in raa489000_get_input_current()Raymond Chung2021-03-111-2/+3
| | | | | | | | | | | | | | | | The adapter current value is in 22.2mA increments. So must be fix calculation formula. IADP = (222 * ADC_value) / 10 BUG=None BRANCH=None TEST=make BOARD=sasuke Signed-off-by: Raymond Chung <raymondchung@ami.corp-partner.google.com> Change-Id: I4124e2a9e3c95e1b07060cbac766197886210e8a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2751316 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
* sasuke : lower input voltage on S0iXYongBeum.Ha2021-03-111-0/+22
| | | | | | | | | | | | | | Lower input voltage on S0iX to reduce power consumption BUG=b:182221344 BRANCH=None TEST=make -j BOARD=sasuke Change-Id: I96d7a9d48cc0f52910e80528fc8fec09818cd40a Signed-off-by: YongBeum.Ha <ybha@samsung.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2747532 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
* mancomb: Update mancomb compared to guybrushRob Barnes2021-03-114-456/+204
| | | | | | | | | | | | | | | | | | | | | Remove gpio not used by mancomb. Remove non required tasks. Remove keyboard functionality. Remove battery functionality. Add recovery buttons and BJ signals. Add DP and HDMI fault signals. Remove most charger functionality. Add USB hub signals. Remove hibernate support. BUG=b:174424094, b:181510382 TEST=Build BRANCH=None Change-Id: If956524a57db104abd399e25978298a828885dc2 Signed-off-by: Rob Barnes <robbarnes@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2727967 Reviewed-by: Diana Z <dzigterman@chromium.org>
* zephyr: don't make ec_features.c depend on ACPIJack Rosenthal2021-03-111-2/+2
| | | | | | | | | | | | | | | | ACPI is a concept of the x86 world only, but ARM devices require ec_features.c as well. Compile ec_features.c under the common CONFIG_PLATFORM_EC option. BUG=b:182398910 BRANCH=none TEST=compile lazor with host commands Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: Ic06d6ed26015de9ef7e26f6f5554ac3fb4e92f47 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2749423 Reviewed-by: Keith Short <keithshort@chromium.org>
* zephyr: include shim/chip/npcx directory for all npcx chipsJack Rosenthal2021-03-111-1/+1
| | | | | | | | | | | | | | CHIP_FAMILY only gets set for the npcx7m6fb chip, but all nuvoton chips appear to need this directory. BUG=b:182410932,b:182398910 BRANCH=none TEST=compile for lazor using npcx7m6fc chip configuration Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: I9e6a152b8c31c1bcd3141591863a7b78e03e3766 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2749422 Reviewed-by: Keith Short <keithshort@chromium.org>
* zephyr: Add a step-by-step guideSimon Glass2021-03-111-0/+42
| | | | | | | | | | | | | | Add a guide to make it easier for people to add a new Kconfig. BUG=b:181253613 BRANCH=none TEST=none Signed-off-by: Simon Glass <sjg@chromium.org> Change-Id: I2714c02f3541a07c18cfa1d4a40e6b75fb2aa4fa Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2749762 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-by: Denis Brockus <dbrockus@chromium.org>
* virtual_battery: add a few more propertiesIkjoon Jang2021-03-111-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | Recent version of kernel sbs-battery driver has properties currently unsupported by EC.This patch adds 4 more properties to remove annoying error messages from console: "power_supply sbs-12-000b: driver failed to report xxx" in kernel, "[3927380.033752 Unhandled VB reg 1b" in EC console. New properties added : - SB_AVERAGE_CURRENT(0xb): involves i2c transaction - SB_MAX_ERROR(0xc): returns a constant 3% - SB_CHARGING_CURRENT(0x14), SB_CHARGING_VOLTAGE(0x15): returns existing battery params BRANCH=none BUG=b:170921599 TEST=read properties from sbs sysfs knobs (current_avg capacity_error_margin constant_charge_current_max constant_charge_voltage_max) Change-Id: I681006899969da8466730eda155df935af22994f Signed-off-by: Ikjoon Jang <ikjn@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2747559 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* zephyr: Correct the config check scriptSimon Glass2021-03-111-3/+2
| | | | | | | | | | | | | | | | | | | | This currently looks for CONFIG options in the Kconfig files, but these all have a PLATFORM_EC prefix. Fix this. Also while we are here, combine the two sed expressions for config and menuconfig and don't allow trailing spaces, since these should not be present. BUG=b:181253613 BRANCH=none TEST=cherry-pick Rob's CL http://crrev.com/c/2659282 make BOARD=volteer -j30 See that it doesn't warn about CCD_USBC_PORT_NUMBER anymore Signed-off-by: Simon Glass <sjg@chromium.org> Change-Id: Iddcd4aa7884a9f10a5260aa8e71b4131ba550389 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2749761 Reviewed-by: Denis Brockus <dbrockus@chromium.org>
* asurada: enable virtual mux for DPEric Yilun Lin2021-03-112-0/+15
| | | | | | | | | | | | | | EC needs to inform AP the DP mode status with virtual mux or ANX7625 might miss the status change. BUG=b:181942052 TEST=ensure EC_HOST_EVENT_USB_MUX is set when DP status change BRANCH=main Change-Id: I079debdd59d80912b1a4668582ed673bfc79cf8a Signed-off-by: Eric Yilun Lin <yllin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2744809 Reviewed-by: Ting Shen <phoenixshen@chromium.org>