summaryrefslogtreecommitdiff
path: root/zephyr
Commit message (Collapse)AuthorAgeFilesLines
* zephyr: kohaku: Delete configs set to NPCX defaultsKeith Short2021-06-111-31/+1
| | | | | | | | | | | | | | Delete the Kconfig options that are now setup by default for the NPCX7 chipset. BUG=none BRANCH=none TEST=zmake testall Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: I7bfca4a85e2b469e0f9e6d59f873851ca081cf29 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2954921 Reviewed-by: Yuval Peress <peress@chromium.org>
* zephyr: trogdor: delete NPCX common configsKeith Short2021-06-111-32/+1
| | | | | | | | | | | | | | | Delete the Kconfig options that are now setup by default for the NPCX7 chipset. BUG=none BRANCH=none TEST=zmake testall TEST=build and run zephyr on lazor Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: Ia815bfddb56fc1113a1bc6664317328ade4a83ff Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2951221 Reviewed-by: Yuval Peress <peress@chromium.org>
* zephyr: npcx: Move common config defaultsKeith Short2021-06-112-0/+134
| | | | | | | | | | | | | | | Create Kconfig.npcx7 to set the config defaults that are required by the NPCX7 chipset. BUG=none BRANCH=none TEST=zmake testall TEST=Build and run lazor Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: I41cad23dfe7c57438b6126e0210c9f7223dfc834 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2951220 Reviewed-by: Yuval Peress <peress@chromium.org>
* zephyr: Fix warning about duplicated CONFIG_I2CKeith Short2021-06-111-1/+1
| | | | | | | | | | | | | | | | | CONFIG_I2C is defined by the Kconfig system and added to the generated file <autoconf.h>. Remove the explicit definition of CONFIG_I2C to fix the warning. BUG=none BRANCH=none TEST=zmake testall Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: I4a034bc8234ee0bcc9454e2aceceade8a35c5257 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2954920 Reviewed-by: Yuval Peress <peress@chromium.org> Reviewed-by: Denis Brockus <dbrockus@chromium.org> Commit-Queue: Yuval Peress <peress@chromium.org>
* zephyr: Support DP hotplug detect with a GPIOSimon Glass2021-06-112-0/+30
| | | | | | | | | | | | | | | | Add Kconfig support for USB_PD_DP_HPD_GPIO and the associated option so we can support this feature. BUG=b:189855648 BRANCH=none TEST=with other CLs, build asurada for Zephyr Signed-off-by: Simon Glass <sjg@chromium.org> Change-Id: Iffee7fea469ac85fb9b41715fdd5bb767994584e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2941883 Reviewed-by: Denis Brockus <dbrockus@chromium.org> Tested-by: Denis Brockus <dbrockus@chromium.org> Commit-Queue: Denis Brockus <dbrockus@chromium.org>
* zephyr: Allow use of the custom bc12_ports[] arraySimon Glass2021-06-112-1/+17
| | | | | | | | | | | | | | | | At present we don't support this feature on Zephyr. It is needed for Asurada so add a proper Kconfig for it. BUG=b:189855648 BRANCH=none TEST=with other CLs, build asurada for Zephyr Signed-off-by: Simon Glass <sjg@chromium.org> Change-Id: Ifb4c79f3feeb7541339632bbccc575fa106ffb78 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2941882 Reviewed-by: Denis Brockus <dbrockus@chromium.org> Tested-by: Denis Brockus <dbrockus@chromium.org> Commit-Queue: Denis Brockus <dbrockus@chromium.org>
* zephyr: Add help for the ITE TCPM driversSimon Glass2021-06-111-3/+8
| | | | | | | | | | | | | | | | | | These Kconfigs are missing the help text. Add some. Also drop the unnecessary and confusing 'default n' lines nearby. Once people see these in the code, they will multiply. BUG=b:189855648 BRANCH=none TEST=with other CLs, build asurada for Zephyr Signed-off-by: Simon Glass <sjg@chromium.org> Change-Id: I8d6a327a2fbd57a0f25244e85424692c0d808b3f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2941821 Reviewed-by: Denis Brockus <dbrockus@chromium.org> Tested-by: Denis Brockus <dbrockus@chromium.org> Commit-Queue: Denis Brockus <dbrockus@chromium.org>
* zephyr: Tidy up PLATFORM_EC_USB_PORT_POWER_DUMB_CUSTOM_HOOKSimon Glass2021-06-111-4/+3
| | | | | | | | | | | | | | | | This Kconfig should use tabs for indentation, rather than spaces. Fix it. BUG=b:189855648 BRANCH=none TEST=with other CLs, build asurada for Zephyr Signed-off-by: Simon Glass <sjg@chromium.org> Change-Id: I25eed9ece49cdfe477e5107b6689d8a3890a82a9 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2941820 Reviewed-by: Denis Brockus <dbrockus@chromium.org> Tested-by: Denis Brockus <dbrockus@chromium.org> Commit-Queue: Denis Brockus <dbrockus@chromium.org>
* zephyr: Add support for MAINTAIN_VBATSimon Glass2021-06-112-0/+12
| | | | | | | | | | | | | | | Add a Kconfig for this feature so that it can be used on Zephyr. BUG=b:189855648 BRANCH=none TEST=with other CLs, build asurada for Zephyr Signed-off-by: Simon Glass <sjg@chromium.org> Change-Id: I699fe81b3f4ad8c03b90a0c8371a927df5bc3e78 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2941819 Reviewed-by: Denis Brockus <dbrockus@chromium.org> Tested-by: Denis Brockus <dbrockus@chromium.org> Commit-Queue: Denis Brockus <dbrockus@chromium.org>
* zephyr: Add support for OTG powerSimon Glass2021-06-112-2/+27
| | | | | | | | | | | | | | | | | Add Kconfigs for this feature so it can be enabled on Zephyr. The driver determines the availability of this feature but it must be specifically enabled by the board. BUG=b:189855648 BRANCH=none TEST=with other CLs, build asurada for Zephyr Signed-off-by: Simon Glass <sjg@chromium.org> Change-Id: Iaeae49039b8a76c2dd42804127644920480697a7 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2941818 Reviewed-by: Denis Brockus <dbrockus@chromium.org> Tested-by: Denis Brockus <dbrockus@chromium.org> Commit-Queue: Denis Brockus <dbrockus@chromium.org>
* zephyr: asurada: Correct ec_batt_pres_odlSimon Glass2021-06-112-1/+4
| | | | | | | | | | | | | | | This has the wrong enum. Fix it. BUG=b:189855648 BRANCH=none TEST=with other CLs, build asurada for Zephyr Signed-off-by: Simon Glass <sjg@chromium.org> Change-Id: Ie465d662c463e043e2123d91f21f6771552ae025 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2941816 Reviewed-by: Denis Brockus <dbrockus@chromium.org> Commit-Queue: Denis Brockus <dbrockus@chromium.org> Tested-by: Denis Brockus <dbrockus@chromium.org>
* zephyr: lazor: Clean up includesDawid Niedzwiecki2021-06-111-1/+1
| | | | | | | | | | | | | | | | Don't include config_chip.h directly in the platform-specific i2c.c source file, use i2c.h instead. It will remove the build warning. BUG=b:188885798 BRANCH=none TEST='zmake testall' and make sure there are no warnings Signed-off-by: Dawid Niedzwiecki <dn@semihalf.com> Change-Id: I1309cd4e1888df2125c66c9bde56520e3485b201 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2953282 Reviewed-by: Yuval Peress <peress@chromium.org> Commit-Queue: Yuval Peress <peress@chromium.org>
* zephyr: lazor: remove the WLC I2C bus from dtsWai-Hong Tam2021-06-111-5/+0
| | | | | | | | | | | | | | | | The WLC I2C bus on Lazor is used for other purposes: GPIO and NC. Remove the bus from dts, such that it won't appear in the i2c_ports[]. The `i2cscan` won't scan this bus. BUG=b:182398910 BRANCH=None TEST=Tested the `i2cscan` command (need to enable a CONFIG). Change-Id: Id1d029c380726e8846f93a04a666441a537421de Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2954724 Reviewed-by: Keith Short <keithshort@chromium.org>
* zephyr: npcx: get valid bit-depth of RAM_PD registers via DT macroMulin Chao2021-06-101-5/+9
| | | | | | | | | | | | | | | | | Use DT macro to get valid bit-depth of RAM_PD registers instead of a constant value. Since it is a general solution for saving power in no-psl mode, this CL replaces the prefix 'NPCX7_' with 'NPCX_'. BUG=b:188409672 BRANCH=none TEST=Build and flash on lazor and npcx9 evb. Hibernate lazor platform by typing 'hibernate' console command. Then, wake it up via lid open. Signed-off-by: Mulin Chao <mlchao@nuvoton.com> Change-Id: Iaf19761cc16f992cfcf06077ac222637e2544e5f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2948708 Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* zmake: test final file output sizeYuval Peress2021-06-102-1/+102
| | | | | | | | | | | | | | | | | | | | | | Zephyr's build allows the image to consume the full flash size (CONFIG_FLASH_SIZE) since it doesn't assume anything about how chromium lays out the images (using RO/RW). This means that in systems with 512Kb of flash space, images taking up more than 256Kb will successfully build (even though the final image will be larger than 512Kb). Add a check in the output packers for the final size. This test ignores by default the .elf extension. BRANCH=none BUG=b:190435084 TEST=Added unit tests TEST=build brya Signed-off-by: Yuval Peress <peress@chromium.org> Change-Id: I94f1657d0ff44d79920ae5e8e7f11edf1580de05 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2948169 Reviewed-by: Denis Brockus <dbrockus@chromium.org>
* zephyr: enable watchdog configRuibin Chang2021-06-092-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Enable watchdog config on board it8xxx2_evb and hayato. BUG=b:187190711 BRANCH=none TEST=on it8xxx2_evb, 1.console cmd "waitms 1500": print message and not reset 21-05-20 13:38:06.302 --- UART initialized after reboot --- 21-05-20 13:38:06.315 [Image: RO, it8xxx2_evb_zephyr_v2.0.8855-5b 2021-05-20 13] 21-05-20 13:38:06.333 [Reset cause: unknown] 21-05-20 13:38:06.340 ec wdt init 21-05-20 13:38:07.453 Watchdog deadline is close! 21-05-20 13:38:07.851 [1.569641 event set 0x0000000000002000] 21-05-20 13:38:07.869 [1.581176 hostcmd init 0x0000000000002000] 21-05-20 13:38:07.954 uart:~$ 2.console cmd "waitms 1601": print message and reset 21-05-20 13:41:33.908 --- UART initialized after reboot --- 21-05-20 13:41:33.919 [Image: RO, it8xxx2_evb_zephyr_v2.0.8855+5b 2021-05-20 13] 21-05-20 13:41:33.935 [Reset cause: unknown] 21-05-20 13:41:33.942 ec wdt init 21-05-20 13:41:35.055 Watchdog deadline is close! 21-05-20 13:41:35.560 *** Booting Zephyr OS build zephyr -v2.5.0-87-ga0c36e043cf* Cq-Depend: chromium:2936162 Change-Id: Ia465951d71043a469ed78d4089dfb6af30c5999e Signed-off-by: Ruibin Chang <Ruibin.Chang@ite.com.tw> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2905171 Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* zephyr: asurada: Add more I2C informationSimon Glass2021-06-092-0/+24
| | | | | | | | | | | | | | | Add the I2C ports used by USB-C, so we can support charging. BUG=b:189855648 BRANCH=none TEST=with other CLs, build asurada for Zephyr Signed-off-by: Simon Glass <sjg@chromium.org> Change-Id: I59ce2ad3b9158cf01dac7d89ab56c46c668a07e4 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2941813 Reviewed-by: Denis Brockus <dbrockus@chromium.org> Commit-Queue: Denis Brockus <dbrockus@chromium.org> Tested-by: Denis Brockus <dbrockus@chromium.org>
* zephyr: hooks: suppress hook warning for call already processingFabio Baltieri2021-06-091-1/+5
| | | | | | | | | | | | | | | | | | | Suppress warning for -EINVAL on k_delayed_work_submit. It indicates that the work is already pending or executing, which is normally harmless. Verified it for charge_manager_refresh. BRANCH=none BUG=b:190214907 TEST=build and run on volteer Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com> Change-Id: I7048ad15bbb99fc43b663b4f2c6624166a05f0dd Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2949054 Reviewed-by: Yuval Peress <peress@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Yuval Peress <peress@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* zephyr: asurada: Add battery informationSimon Glass2021-06-093-0/+16
| | | | | | | | | | | | | | | | Add battery information so we can support charging. BUG=b:189855648 BRANCH=none TEST=with other CLs, build asurada for Zephyr Signed-off-by: Simon Glass <sjg@chromium.org> Change-Id: I638c5789a2a494bdf811c13f66d5b892f4ebded2 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2941812 Reviewed-by: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Yuval Peress <peress@chromium.org> Commit-Queue: Denis Brockus <dbrockus@chromium.org> Tested-by: Denis Brockus <dbrockus@chromium.org>
* zepyr: npcx: clean keyboard driverYuval Peress2021-06-094-2/+7
| | | | | | | | | | | | | | | | | | | | | | The current cros,kb-raw-npcx driver relies on the label cros_kb_raw instead of the compatible string like it should. Since currently, it doesn't make sense for there to be more than one instance of the driver, a new BUILD_ASSERT check is added to make sure that if the driver is added via Kconfig, it is also used exactly once. Further, the creation of the driver via DEVICE_DEFINE is now using DT_DRV_COMPAT to create the instance. BRANCH=none BUG=b:190457512 TEST=build brya, volteer, and lazor Signed-off-by: Yuval Peress <peress@chromium.org> Change-Id: I242c0f2f20a6d89cad7ab4269fc4c854aa29554b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2944624 Reviewed-by: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Dawid Niedzwiecki <dawidn@google.com> Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* zephyr: driver: add ST accel_lis2dw12Denis Brockus2021-06-091-3/+7
| | | | | | | | | | | | | | | | | Fixed a couple of post-merge Kconfig requests. BUG=b:180980668,b:189857004 BRANCH=none TEST=make buildall TEST=zmake configure -b $PROJ_HAYATO Signed-off-by: Denis Brockus <dbrockus@google.com> Change-Id: Ie891450909196cae10b4f6bdf2009f0338bb988e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2947227 Commit-Queue: Denis Brockus <dbrockus@chromium.org> Tested-by: Denis Brockus <dbrockus@chromium.org> Auto-Submit: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org>
* zephyr: add new config for adjusting leading timeRuibin Chang2021-06-092-3/+12
| | | | | | | | | | | | | | | | | | | | For the ITE chip, use CONFIG_WDT_ITE_WARNING_LEADING_TIME_MS instead of CONFIG_PLATFORM_EC_WATCHDOG_WARNING_LEADING_TIME_MS. BUG=b:187190711 BRANCH=none TEST=zmake -lDEBUG configure -B zephyr/build -b zephyr/projects/it8xxx2_evb zmake -lDEBUG configure -B zephyr/build -b zephyr/projects/asurada/hayato Cq-Depend: chromium:2936162 Change-Id: If4d61d72763de9326a3056b6848f0ca90f27746c Signed-off-by: Ruibin Chang <Ruibin.Chang@ite.com.tw> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2914711 Commit-Queue: Keith Short <keithshort@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org>
* include/flash: rename the APIsTim Lin2021-06-091-23/+23
| | | | | | | | | | | | | | | | The names conflict when enabling both Zephyr's flash driver and CONFIG_FLASH_CROS option. Rename all the APIs in include/flash.h BUG=b:187192628 BRANCH=none TEST=make buildall -j4 Signed-off-by: Tim Lin <tim2.lin@ite.corp-partner.google.com> Change-Id: If1fd0ea28fa9f5cec1c1daa8f72f63eb7a0e6500 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2931749 Commit-Queue: Keith Short <keithshort@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org> Reviewed-by: Denis Brockus <dbrockus@chromium.org>
* zephyr: lazor: Enable I2C_PASSTHRU_RESTRICTED configDawid Niedzwiecki2021-06-093-1/+21
| | | | | | | | | | | | | | | | | Enable the I2C_PASSTHRU_RESTRICTED config for Lazor. Define board_allow_i2c_passthru function in platform-specific code. BUG=b:188885798 BRANCH=none TEST=Verify that I2C_PASSTHRU command works properly e.g. DUT displays the battery level correctly. Signed-off-by: Dawid Niedzwiecki <dn@semihalf.com> Change-Id: Icf8a13f1c3aaecc660322a2153654c70c1accd7b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2939675 Reviewed-by: Yuval Peress <peress@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* zephyr: asurada: Add the rest of the ADC channelsSimon Glass2021-06-092-2/+15
| | | | | | | | | | | | | | | | | A few of these are missing. Update them so we can use the full ADC capabilities, needed for Zephyr. BUG=b:189855648 BRANCH=none TEST=with other CLs, build asurada for Zephyr Signed-off-by: Simon Glass <sjg@chromium.org> Change-Id: I9d52404086b3aa8dda847a015a264d1fcfd805f9 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2941811 Reviewed-by: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Denis Brockus <dbrockus@chromium.org> Tested-by: Denis Brockus <dbrockus@chromium.org>
* zmake: Add utility for getting value from autoconf.hYuval Peress2021-06-092-0/+27
| | | | | | | | | | | | | | | | | | | Kconfig generates an autoconf.h header from the various Kconfig files. These values (such as CONFIG_FLASH_SIZE) may not be obvious to find. This is especially true since some Kconfig values are passed in from zmake while others reside in Kconfig files. Add a utility to get the #define value from the autoconf.h that's generated during the build. BRANCH=none BUG=b:190435084 TEST=Added unit tests Signed-off-by: Yuval Peress <peress@chromium.org> Change-Id: Id2c1f05a809e17f67a435209e35606ffd7245174 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2948168 Reviewed-by: Denis Brockus <dbrockus@chromium.org>
* zmake: fix test timeoutYuval Peress2021-06-091-1/+3
| | | | | | | | | | | | | | | In CQ some tests that require file access may take a long time. Update the deadline for the tests to 1 minute which matches the deadline of tests in test_util.py. BRANCH=none BUG=b:188492664 TEST=run pytest (but the real test will be in CQ) Signed-off-by: Yuval Peress <peress@chromium.org> Change-Id: I00b15667bf4bdbbfe8101b21a58aefdce6d4ec91 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2948164 Reviewed-by: Denis Brockus <dbrockus@chromium.org>
* zephyr: trogdor: Disable host command debug outputKeith Short2021-06-091-0/+6
| | | | | | | | | | | | | | Disable the host command debugging by default. This matches the Chromium-EC configuration and lessens the amount of console spam. BUG=none BRANCH=none TEST=Build zephyr for lazor, verify hostcmd console channel is disabled. Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: I5420a6fcb4f71c71f0c00e2de8c087b87925b3f1 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2947581 Reviewed-by: Wai-Hong Tam <waihong@google.com>
* zephyr: Add CONFIG_PLATFORM_EC_CONSOLE_CHANNELKeith Short2021-06-093-2/+26
| | | | | | | | | | | | | | | | | Add a KConfig option to enable/disable the CONFIG_CONSOLE_CHANNEL option. Enabled by default, but can be turned off to save code space. BUG=b:180421120 BRANCH=none TEST=zmake testall TEST=Boot lazor, verify 'chan' command is present or not based on this config. Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: I9f5f10582ef6161a38bb2f5f7f48bae631ba9cf6 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2946964 Commit-Queue: Wai-Hong Tam <waihong@google.com> Reviewed-by: Wai-Hong Tam <waihong@google.com>
* zephyr: brya: enable keyboardYuval Peress2021-06-093-2/+45
| | | | | | | | | | | | BRANCH=none BUG=b:188605676 TEST=`ksstate on` in EC console, observe keyboard matrix in real time Signed-off-by: Yuval Peress <peress@chromium.org> Change-Id: I1b0d26b4ade8298bc91dec2df274d9a159e9bc39 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2932462 Reviewed-by: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org>
* zephyr: Add I2C_PASSTHRU_RESTRICTED configDawid Niedzwiecki2021-06-092-0/+13
| | | | | | | | | | | | | | Add the I2C_PASSTHRU_RESTRICTED config to Zephyr. BUG=b:188885798 BRANCH=none TEST=zmake testall Signed-off-by: Dawid Niedzwiecki <dn@semihalf.com> Change-Id: I8338921da350cbe0a24f12686aa6ff06de57eca6 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2939674 Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* zephyr: Fix I2C_PASSTHRU host commandDawid Niedzwiecki2021-06-084-0/+35
| | | | | | | | | | | | | | | | | | | | ZephyrEC uses different I2C port numbers than CrosEC does, so convert the received remote port via I2C_PASSTHRU command into a proper one. The conversion is done based on a new property remote-port, which tells what port number is used by external components like kernel. The change fixes an issue with unexpected entering OTG mode by the charger. BUG=b:188885798 BRANCH=none TEST=Flash Lazor and make sure that no "charge problem" prints are displayed. Signed-off-by: Dawid Niedzwiecki <dn@semihalf.com> Change-Id: Id00265a3abf286ca59cbecb38ff7933d75e0d361 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2933296 Reviewed-by: Yuval Peress <peress@chromium.org>
* zephyr: brya: enable espiYuval Peress2021-06-072-0/+10
| | | | | | | | | | | | BRANCH=none BUG=b:188605676 TEST=build and flash brya Signed-off-by: Yuval Peress <peress@chromium.org> Change-Id: I204e114a460a0648dfc47da14d63ce3beb19e821 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2942930 Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* zephyr: dts: Move cros_kb_raw node to npcx.dtsiWealian Liao2021-06-073-75/+89
| | | | | | | | | | | | | | | | | | | | | | | cros-kb-raw@400a3000 is a npcx chip node. Move it to npcx.dtsi & overwrite the pin control setting in the corresponding dts file. For the status property in cros_kb_raw, npcx kbsan only has one hardware instance. NPCX cros_kb_raw driver doesn't use status property to enable the device. Remove status setting in cros_kb_raw node. Compared with 'gpio.inc' for boards based on trogdor, the keyboard doesn't use KSO13, 14. Remove KSO13, 14 in 'trogdor.dts'. BUG=none BRANCH=none TEST=zmake testall TEST=Check all keys work on volteer & lazor by "ksstate on". Signed-off-by: Wealian Liao <whliao@nuvoton.corp-partner.google.com> Change-Id: Ie352b91ee13b18fa9079001ab7c3685f059ba299 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2931750 Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* zephyr: gpio: skip unimplemented GPIOsYuval Peress2021-06-071-0/+3
| | | | | | | | | | | | | | | | | When setting up the callbacks, we should skip unimplemented GPIs, otherwise we run into a fatal error during init. BRANCH=none BUG=b:188605676 TEST=build and flash brya Signed-off-by: Yuval Peress <peress@chromium.org> Change-Id: Ic8a97fa3b714453a2b1b23073b070cb28598b4e2 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2944735 Reviewed-by: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Denis Brockus <dbrockus@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* zephyr: asurada: Enable MotionSenseDenis Brockus2021-06-077-3/+223
| | | | | | | | | | | | | | | BUG=b:189857004 BRANCH=none TEST=zmake testall TEST=Flash on hayato and check sensors Signed-off-by: Denis Brockus <dbrockus@google.com> Change-Id: I9426b5a9cb2673da0ec8280aa15768815f47014c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2934359 Tested-by: Denis Brockus <dbrockus@chromium.org> Auto-Submit: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Yuval Peress <peress@chromium.org> Commit-Queue: Yuval Peress <peress@chromium.org>
* zephyr: driver: add ST accel_lis2dw12Denis Brockus2021-06-077-0/+109
| | | | | | | | | | | | | | | BUG=b:180980668,b:189857004 BRANCH=none TEST=make buildall TEST=zmake configure -b $PROJ_HAYATO Signed-off-by: Denis Brockus <dbrockus@google.com> Change-Id: Ib743f0dbcc4a9731ccb575344413f161cd0dbba2 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2944617 Tested-by: Denis Brockus <dbrockus@chromium.org> Auto-Submit: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Yuval Peress <peress@chromium.org> Commit-Queue: Yuval Peress <peress@chromium.org>
* zephyr: brya: move config hostcmd to the right placeYuval Peress2021-06-071-1/+3
| | | | | | | | | | | | BRANCH=none BUG=none TEST=build brya Signed-off-by: Yuval Peress <peress@chromium.org> Change-Id: I6e41df8ddea88f8f1df719e7140cf8e5ee0fd479 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2942929 Reviewed-by: Denis Brockus <dbrockus@chromium.org> Commit-Queue: Denis Brockus <dbrockus@chromium.org>
* zephyr: npcx9: implement system_download_from_flashYuval Peress2021-06-063-2/+113
| | | | | | | | | | | BRANCH=none BUG=b:188605676 TEST=run `sysjump RW` on brya Signed-off-by: Yuval Peress <peress@chromium.org> Change-Id: Ic771a0452cd044355dd2a0e0f32fa6e2d3711a44 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2936009 Reviewed-by: Keith Short <keithshort@chromium.org>
* zephyr: npcx9: add __start_gdma function to .lowpower_ram2 sectionYuval Peress2021-06-064-6/+81
| | | | | | | | | | | | | This function is needed for the flash api workaround. BRANCH=none BUG=b:188605676 TEST=build brya Signed-off-by: Yuval Peress <peress@chromium.org> Change-Id: I3ddd72e7664755f07bc967695b1502a43af3e57a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2936008 Reviewed-by: Keith Short <keithshort@chromium.org>
* zephyr: npcx9: implement system_mpu_configYuval Peress2021-06-062-0/+83
| | | | | | | | | | | | | This function is taken from chip/npcx/ and is used for the flash workaround. BRANCH=none BUG=b:188605676 TEST=build brya Signed-off-by: Yuval Peress <peress@chromium.org> Change-Id: I70775523d180a602c08f7059f0fe003c05007edf Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2936007
* zephyr: Add config to enable resume-init/suspend-complete hooksWai-Hong Tam2021-06-052-0/+14
| | | | | | | | | | | | | Add the new PLATFORM_EC_CHIPSET_RESUME_INIT_HOOK option to Zephyr Kconfig. BRANCH=None BUG=b:190224781, b:183054226 TEST=Pending test. The following CL enables the option. Change-Id: I98b8c19fa53ef59ca58a8aafd4bde00dc8e8ed58 Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2941805 Reviewed-by: Simon Glass <sjg@chromium.org>
* zephyr: Add config to emulate sysrq eventsWai-Hong Tam2021-06-052-0/+18
| | | | | | | | | | | | | Add the new PLATFORM_EC_EMULATED_SYSRQ option to Zephyr Kconfig. BRANCH=None BUG=b:190224781 TEST=Pending test. The following CL enables the option. Change-Id: I8baf204045a95c3e0d39a448cb3cf2c9bc4d9a2a Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2940581 Reviewed-by: Simon Glass <sjg@chromium.org>
* zephyr: Default not enable the flash read/erase/write commandsWai-Hong Tam2021-06-051-1/+0
| | | | | | | | | | | | | | It matches the original CrOS EC setting, which is not enable these commands. BRANCH=None BUG=b:190224781 TEST=Checked the flashread, flasherase, flashwrite not enabled. Change-Id: Ie8e09c2cc5c97e9d7d693e14fc838c976893addf Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2940580 Reviewed-by: Simon Glass <sjg@chromium.org>
* zephyr: Default not enable throttling APWai-Hong Tam2021-06-053-1/+2
| | | | | | | | | | | | | | | Only x86 boards requires throttling AP. ARM boards don't. Change the default to not enable it. It matches the original CrOS EC setting. BRANCH=None BUG=b:190224781 TEST=Checked the apthrottle command not enabled on Lazor. Built the Volteer image without error. Change-Id: I47b38ed3cd4050cebcce9d7b8edd48686dc64fad Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2940579 Reviewed-by: Simon Glass <sjg@chromium.org>
* zephyr: asurada: Enable main displayDenis Brockus2021-06-041-1/+6
| | | | | | | | | | | | | | BUG=b:180980668 BRANCH=none TEST=boot and see if the display enables Signed-off-by: Denis Brockus <dbrockus@google.com> Change-Id: I080f0a0be417fe63a2b25b41bcdae3d2188bf5d6 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2940566 Tested-by: Denis Brockus <dbrockus@chromium.org> Auto-Submit: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* COIL: espi: replace VW_SLAVE_BTLD_STATUS_DONE with ↵Caveh Jalali2021-06-041-22/+22
| | | | | | | | | | | | | | | | | VW_PERIPHERAL_BTLD_STATUS_DONE This replaces VW_SLAVE_BTLD_STATUS_DONE with VW_PERIPHERAL_BTLD_STATUS_DONE. BRANCH=none BUG=b:163885307 TEST=buildall, compare_build.sh pass Change-Id: I0b8c71fa7e590dc89357e22aafce0b67717af183 Signed-off-by: Caveh Jalali <caveh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2938041 Reviewed-by: Harry Cutts <hcutts@chromium.org> Commit-Queue: Harry Cutts <hcutts@chromium.org>
* zephyr: npcx9: Add linker elements needed for flash api workaroundYuval Peress2021-06-042-0/+39
| | | | | | | | | | | | BRANCH=none BUG=b:188605676 TEST=build brya Signed-off-by: Yuval Peress <peress@chromium.org> Change-Id: I900f4af147e048a374b56875579d838deaa17eae Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2936006 Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* zephyr: npcx9: add kconfig option for flash api workaroundYuval Peress2021-06-042-0/+10
| | | | | | | | | | | | | | This is needed for the ES1 version of the npcx9 chip. BRANCH=none BUG=b:188605676 TEST=none Signed-off-by: Yuval Peress <peress@chromium.org> Change-Id: I80ddc717165788248f8260050fc55ffb0bd4d11e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2927770 Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* zmake: Change lcov excludesJeremy Bettis2021-06-041-3/+8
| | | | | | | | | | | | | | | | | | | | | Some of the drivers were being excluded from the coverage report because of symlinks in the build/zephyr/test directory, which matched */test/*. Changed to be */ec/test/* and */ec/zephyr/test/*. Also exclude the emulators, as they should not affect coverage numbers. BUG=b:183007888 TEST=sudo emerge zephyr-build-tools && \ zmake coverage build/zmake-coverage BRANCH=None Signed-off-by: Jeremy Bettis <jbettis@google.com> Change-Id: I95aa2655f0396672c25b7c317e1e08c403703510 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2937741 Tested-by: Jeremy Bettis <jbettis@chromium.org> Auto-Submit: Jeremy Bettis <jbettis@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Jeremy Bettis <jbettis@chromium.org>