summaryrefslogtreecommitdiff
path: root/docs/zephyr
Commit message (Collapse)AuthorAgeFilesLines
* doc: zephyr_troubleshooting: add a note about macro expansionFabio Baltieri2023-05-151-2/+12
| | | | | | | | | | | | | | | Add a note about the new config option CONFIG_COMPILER_TRACK_MACRO_EXPANSION, and also add an example on how to disable LTO without changing the project file itself. BUG=none TEST=check the page on gitiles Change-Id: I3af8b5ba4f8a0e59a419e426baa4d5460040e86c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4516858 Commit-Queue: Fabio Baltieri <fabiobaltieri@google.com> Tested-by: Fabio Baltieri <fabiobaltieri@google.com> Reviewed-by: Keith Short <keithshort@chromium.org>
* docs: Update docs on testcase.yaml to use new fields for conf filesTristan Honscheid2023-04-151-4/+12
| | | | | | | | | | | | | | | | | | | | | | Update our documentation to highlight the use of the new `extra_conf_files`, `extra_overlay_confs`, and `extra_dtc_overlay_files` YAML fields instead of specifying these in CMake variables in `extra_args` in `testcase.yaml` files. These new fields are more readable and were introduced in upstream Zephyr earlier this year. The plan is to eventually deprecate the ability to specify confs and overlays through extra_args upstream following a migration. BUG=None BRANCH=None TEST=None Change-Id: I3db0b0dcbb24a8dc1f6e38214d7538e6dca50dfb Signed-off-by: Tristan Honscheid <honscheid@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4428296 Reviewed-by: Yuval Peress <peress@google.com> Commit-Queue: Yuval Peress <peress@google.com>
* doc: test.md: add links for getting on discordEric Peers2023-04-101-3/+4
| | | | | | | | | | | | | | | | Add links for how to register/get an invite to the Zephyr discord server. BUG=none BRANCH=none TEST=loaded in chrome and checked for correct render + click on links. Signed-off-by: Eric Peers <epeers@google.com> Change-Id: Ib2600bf09f8b258da429925c07f457c308214662 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4412617 Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* doc: zephyr_troubleshooting: add some notes about tests and gdbFabio Baltieri2023-04-031-0/+35
| | | | | | | | | | | | | | Add a note about recompiling tests without rerunning twister and using gdb on a test generated binary. BRANCH=none BUG=none TEST=checked the page on gitiles Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com> Change-Id: Iaaa18d18e4be79d95793932f2848245571484b96 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4393513 Reviewed-by: Yuval Peress <peress@google.com>
* zmake: use CONFIG_COMPILER_SAVE_TEMPS for save-tempsFabio Baltieri2023-04-031-1/+7
| | | | | | | | | | | | | | | | | | There's now a dedicated Kconfig option for enabling save-temps, switch the zmake save-temps flag to use that instead of EXTRA_CFLAGS directly. Update the troubleshooting documentation as well while we are at it. BRANCH=none BUG=none TEST=python3 -m zmake build --save-temps rex Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com> Cq-Depend: chromium:4393983 Change-Id: I04ecf7cee5134da095c5b3656df2c4f7fdad2056 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4393512 Commit-Queue: Keith Short <keithshort@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org>
* zephyr: zmake: Drop dead testing codeJack Rosenthal2023-03-291-8/+0
| | | | | | | | | | | | | | | A bunch of code was leftover after the twister migration. Delete all references to running tests in zmake. BUG=b:242563072 BRANCH=i don't care stop bothering me TEST=unit tests pass Change-Id: I99b5ff0ae22f74ebecddc6b4dfb0cb5f2b498ea3 Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4380141 Reviewed-by: Tristan Honscheid <honscheid@google.com> Commit-Queue: Tristan Honscheid <honscheid@google.com>
* doc: zephyr: add more information to the missing __device_dts_ord pointFabio Baltieri2023-03-091-1/+3
| | | | | | | | | | | | | | | Add a note in to the __device_dts_ord bit to point out at where to find the reference. BRANCH=none BUG=none TEST=view on gitiles Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com> Change-Id: I230edd1df47a67006315077eed65f04c10963446 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4264114 Reviewed-by: Yuval Peress <peress@google.com> Commit-Queue: Yuval Peress <peress@google.com>
* zephyr: remove shi node and add references to shi0Michał Barnaś2023-02-141-4/+3
| | | | | | | | | | | | | | | | | | | This commit removes the references to internal shi node in device tree and changes them to shi0 from the Zephyr device trees. Changes also the compatible string from internal to upstream one by removing the 'cros' prefix and removes the binding files. BRANCH=main BUG=b:265763662 TEST=run the host commands test on affected boards LOW_COVERAGE_REASON=No tests are available for EC on-chip peripherals. Change-Id: Iefdba23680d7734013de128f1b8878bac2c96cfa Signed-off-by: Michał Barnaś <mb@semihalf.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4180585 Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Michał Barnaś <barnas@google.com> Tested-by: Michał Barnaś <barnas@google.com>
* docs: Update test doc with new twister test path conventionTristan Honscheid2023-02-011-8/+5
| | | | | | | | | | | | | | | Twister changed up how the `-s` parameter works, so update the docs with new instructions on how to use it. BUG=None BRANCH=None TEST=Tested command locally Change-Id: I114b0dce356602cd82e6cbe11487d266889b8890 Signed-off-by: Tristan Honscheid <honscheid@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4214751 Reviewed-by: Abe Levkoy <alevkoy@chromium.org> Commit-Queue: Abe Levkoy <alevkoy@chromium.org>
* zephyr: mkbp: split the node compatible in twoFabio Baltieri2022-12-231-2/+2
| | | | | | | | | | | | | | | | | Split the mkbp node binding in two nodes, normal and host. This adds the automatic Kconfig entries that can be used to control the option and simplify few macros. BRANCH=none BUG=none TEST=cq dry run TEST=zmake compare-builds -a Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com> Change-Id: I8a4825e616557a981a700c13517e76a3fd86ea07 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4117086 Reviewed-by: Wai-Hong Tam <waihong@google.com> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com>
* zephyr: leds: select PLATFORM_EC_LED_DT automaticallyFabio Baltieri2022-12-081-1/+0
| | | | | | | | | | | | | | | | Select PLATFORM_EC_LED_DT automatically when the LED policy node is find in the devicetree. Drop the remaining LED DT options from the config files. BRANCH=none BUG=none TEST=cq dry run Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com> Change-Id: Ia406abed7e9ca36a2952c59d34daa15a9db76c0e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4054627 Reviewed-by: Yuval Peress <peress@google.com> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com>
* zephyr: leds: move led value in the pwm led bindingFabio Baltieri2022-11-221-13/+11
| | | | | | | | | | | | | | | | | | Similarly to the gpio led binding, the pwm led binding is using phandle cells as values. Fix up the code to use a separate property instead, at this point the -config binding is not needed anymore and we can use the upstream pwm-leds directly. BRANCH=none BUG=b:242826402 TEST=validated the resulting structure with gdb TEST=zmake build -a; ./twister Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com> Change-Id: Iec480da15e2ff5e356bad11fbfb6031d4d56353a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4031269 Reviewed-by: Sam Hurst <shurst@google.com> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com>
* zephyr: leds: move led value in the gpio led bindingFabio Baltieri2022-11-211-8/+8
| | | | | | | | | | | | | | | | | | | | | The current cros-ec,gpio-led-pins binding is leaking values into the named-gpios binding. That's an incorrect way of using the devicetree and only works because named-gpios is not currently using the value cell and because we control the binding. Move the values in a separate property within the cros-ec,gpio-led-pins binding. BRANCH=none BUG=b:242826402 TEST=validated the resulting structure with gdb TEST=zmake build -a; ./twister Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com> Change-Id: I77a09b25cc69c5faed254da38316104b304c8f5e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4031268 Reviewed-by: Al Semjonovs <asemjonovs@google.com> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com>
* docs: twister: Update docs for new twister -s flag behaviorTristan Honscheid2022-11-161-6/+21
| | | | | | | | | | | | | | | An upstream change modified the way the `-s` flag works in Twister. This CL updates places in our docs that reference this flag. BRANCH=None BUG=None TEST=None Signed-off-by: Tristan Honscheid <honscheid@google.com> Change-Id: Ib610c6c8779dea3842cbf33c82f95e18c1fed99d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4028959 Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com> Reviewed-by: Yuval Peress <peress@google.com>
* zephyr: bindings: rename named-cbi-ssfc to cros-ec,cbi-ssfcFabio Baltieri2022-11-091-10/+10
| | | | | | | | | | | | | | Rename the SSFC dts bindings for consistency with the FW_CONFIG ones. BRANCH=none BUG=none TEST=cq dry run Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com> Change-Id: Ic47e60948ca6cf3face5903ecbfc8d9b3d0b6c7e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3999727 Reviewed-by: Abe Levkoy <alevkoy@chromium.org> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com>
* zephyr: Update documentation for project organizationKeith Short2022-11-079-59/+436
| | | | | | | | | | | | | | Update the documentation for the program and project organization. BUG=b:254064666 BRANCH=none TEST=View docs in preview mode. Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: Ifd647eafa9e0ca9d1d60528fa75f54244b154426 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3968445 Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com> Reviewed-by: Wai-Hong Tam <waihong@google.com>
* ec: Remove all zassume usagesJeremy Bettis2022-10-311-32/+5
| | | | | | | | | | | | | | | | | | | | Since zassume is being used in scenarios where no one would use ztest_test_skip(), convert all zassumes to zasserts. BRANCH=None BUG=b:256650891 TEST=./twister Signed-off-by: Jeremy Bettis <jbettis@google.com> Change-Id: I1dc806e25f64f8dbef6f7d10cfe2f46ea4887e61 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3937539 Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com> Auto-Submit: Jeremy Bettis <jbettis@chromium.org> Tested-by: Jeremy Bettis <jbettis@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Aaron Massey <aaronmassey@google.com> Commit-Queue: Jeremy Bettis <jbettis@chromium.org> Commit-Queue: Aaron Massey <aaronmassey@google.com>
* docs: Update Zephyr testing documentationYuval Peress2022-10-172-226/+187
| | | | | | | | | | | | | | | | Update the documentation for testing on Zephyr to reflect the latest tools and features. Removed docs/zephyr/zephyr_testing.md since it was only intended to be used for the fix-it week. BRANCH=none BUG=none TEST=none Signed-off-by: Yuval Peress <peress@google.com> Change-Id: I54cb53af7d051e2ea1c3813f3907773c4e52f83a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3945693 Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* zephyr: docs: add USBC documentationSam Hurst2022-09-261-0/+67
| | | | | | | | | | | | | | | Add documentation for configuring USBC. BUG=b:208437225 TEST=Browse doc in gerrit BRANCH=main Signed-off-by: Sam Hurst <shurst@google.com> Change-Id: Ibb4a25bb76673b29600a8d4e405792604d67e702 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3440847 Reviewed-by: Diana Z <dzigterman@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org>
* zephyr: docs: add TCPC documentationSam Hurst2022-09-261-0/+65
| | | | | | | | | | | | | | Document the TCPC Kconfig.tcpm options BUG=b:208437225 TEST=Browse doc in gerrit BRANCH=main Signed-off-by: Sam Hurst <shurst@google.com> Change-Id: I7e917d823dbb18208257d84d6b441e59b19228e7 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3811790 Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* zephyr: docs: add SS Mux and Retimer documentationSam Hurst2022-09-261-0/+93
| | | | | | | | | | | | | | | Document the Retimer Kconfig.retimer and SS Mux Kconfig.usbc_ss_mux options BUG=b:208437225 TEST=Browse doc in gerrit BRANCH=main Signed-off-by: Sam Hurst <shurst@google.com> Change-Id: I55fc6b247357e8f7a90111c209eaffc6f925bf2e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3451008 Commit-Queue: Keith Short <keithshort@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org>
* zephyr: docs: add PPC documentationSam Hurst2022-09-261-0/+69
| | | | | | | | | | | | | | Document the PPC Kconfig.ppc options BUG=b:208437225 TEST=Browse doc in gerrit BRANCH=main Signed-off-by: Sam Hurst <shurst@google.com> Change-Id: I35ebfc7929438e49d6fbaa82c16d204956277de4 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3451257 Commit-Queue: Keith Short <keithshort@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org>
* zephyr: docs: add PD documentationSam Hurst2022-09-261-0/+131
| | | | | | | | | | | | | | Document the PD Kconfig.pd options and sub-options BUG=b:208437225 TEST=Browse doc in gerrit BRANCH=main Signed-off-by: Sam Hurst <shurst@google.com> Change-Id: I2a6e1e193637bc5089b6f77e135745e27c46c7b8 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3451256 Reviewed-by: Keith Short <keithshort@chromium.org>
* zephyr: rework temperature sensorsDawid Niedzwiecki2022-09-201-6/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Rework how the temperature sensors are presented in dts files. A temperature sensor has to be declared independently from the named-temp-sensors node. The sensor nodes have to specify all properties that are handled by driver- i2c port/address, used adc channel etc. Children nodes of the named-temp-sensors set meta values needed for EC code like enum-names, power-good-pin and temperature thresholds. Also, every child node has a pointer to a physical temperature sensor. It implicates a different way of indexing the temperature sensors. This change is done to separate defining physical sensors from metadata for EC application and move some sensors onto i2c buses BUG=b:240619570 TEST=zmake build -a && ./twister -T zephyr/test/ && make sure temperature sensors work with the "temps" EC CC BRANCH=main Signed-off-by: Dawid Niedzwiecki <dn@semihalf.com> Change-Id: Ia0dfc0b98455e8e28233c17d5feff27a7cc5b96d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3879364 Commit-Queue: Dawid Niedzwiecki <dawidn@google.com> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com> Reviewed-by: Keith Short <keithshort@chromium.org>
* Update license boilerplate text in source code filesMike Frysinger2022-09-121-1/+1
| | | | | | | | | | | | | | | 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>
* zephyr: shim: drop the EEPROM_CBI labelFabio Baltieri2022-08-171-1/+0
| | | | | | | | | | | | | | | The node is referenced using the cbi_eeprom nodelabel already so the label here is redundant. BRANCH=none BUG=b:239165779 TEST=zmake testall Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com> Cq-Depend: chromium:3776882 Change-Id: Ice9f3df7ed9874176252872dcd31a3adb25fac7b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3776917 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* zephyr: tests: Add doc with fix-it week resourcesTristan Honscheid2022-08-121-0/+53
| | | | | | | | | | | | | | A central place to link material for fix-it week participants. BUG=None BRANCH=None TEST=None Signed-off-by: Tristan Honscheid <honscheid@google.com> Change-Id: Icb7ecf9772067da0da6bb36d86b1184c3449a614 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3824960 Reviewed-by: Yuval Peress <peress@google.com> Tested-by: Yuval Peress <peress@google.com>
* doc: add some zephyr troubleshooting documentationFabio Baltieri2022-08-122-1/+188
| | | | | | | | | | | | | | Document few bits of information used to troubleshoot various problems we hit while doing the rex port. BRANCH=none BUG=none TEST=view on gitiles Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com> Change-Id: Ic89e3308940237346cbc16e2d320c0835bf5ecb8 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3802286 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* zephyr: doc: add a note about alternate function GPIOsFabio Baltieri2022-08-101-1/+11
| | | | | | | | | | | | | | | | | | | | On NPCX platforms some pins default to a specific (non GPIO) function after reset, but are switched to GPIO in the initialization code. This may be confusing if one is only referencing the manual default pin multiplexing configuration. Adding a note about that in the GPIO doc page to reference this behavior. BRANCH=none BUG=b:241734677 TEST=check the page on gitiles Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com> Change-Id: I3f6fa9f93c339771e15ac5b62c53442b28d1d2ba Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3817775 Reviewed-by: Madhu P <mparuchuri@google.com> Reviewed-by: Al Semjonovs <asemjonovs@google.com>
* Reland "zephyr: Make ZEPHYR_BASE not an environment variable""Jack Rosenthal2022-08-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit ab36e4ff4322b9c3bcdb59ecaf19e055b1365545. The original CL landed at CL:3811715, but was reverted, as we broke the ebuild case, as we dropped environment variables from the ninja call. This reland is exactly the same, but re-adds the environment to the ninja call: Change-Id: Id57845a3dca0cc05f9cafa55db337885f88a327a --- a/zephyr/zmake/zmake/zmake.py +++ b/zephyr/zmake/zmake/zmake.py @@ -782,6 +782,8 @@ class Zmake: errors="replace", + # TODO(b/239619222): Filter os.environ for ninja. + env=os.environ, ) BUG=b:239619222 BRANCH=none TEST=zmake testall emerge-brya-zephyr chromeos-zephyr Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: I62aa1672c3aa463fa36166b980fe6879aac04c40 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3820643 Reviewed-by: Abe Levkoy <alevkoy@chromium.org> Commit-Queue: Abe Levkoy <alevkoy@chromium.org>
* Revert "zephyr: Make ZEPHYR_BASE not an environment variable"Jack Rosenthal2022-08-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit d16be8f98d81d7e589935d1c6c78ec4430a8960d. Reason for revert: suspected at fault for b/241489955 (suspect we're stripping ccache environment variables in ninja call) BUG=b:241489955 TEST=CQ Original change's description: > zephyr: Make ZEPHYR_BASE not an environment variable > > To minimize the amount of environment variable dependency we have, move > ZEPHYR_BASE (used to find the "Zephyr" CMake package) from an > environment variable to a CMake definition. > > This makes our only required environment variable PATH, so we can do a > complete environment scrub for all commands executed. > > BUG=b:239619222 > BRANCH=none > TEST=zmake testall > > Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> > Change-Id: Ie34a9e1f49177649cf0e54c95d73b41bd1b94992 > Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3811715 > Reviewed-by: Abe Levkoy <alevkoy@chromium.org> Bug: b:239619222 Change-Id: I9cfdb04fc61d013ba670049c5dbbeeca7de4893c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3813042 Auto-Submit: Jack Rosenthal <jrosenth@chromium.org> Tested-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-by: Fabio Baltieri <fabiobaltieri@google.com> Commit-Queue: Jeremy Bettis <jbettis@chromium.org> Reviewed-by: Jeremy Bettis <jbettis@chromium.org> Tested-by: Bob Moragues <moragues@chromium.org>
* zephyr: Make ZEPHYR_BASE not an environment variableJack Rosenthal2022-08-041-1/+1
| | | | | | | | | | | | | | | | | | To minimize the amount of environment variable dependency we have, move ZEPHYR_BASE (used to find the "Zephyr" CMake package) from an environment variable to a CMake definition. This makes our only required environment variable PATH, so we can do a complete environment scrub for all commands executed. BUG=b:239619222 BRANCH=none TEST=zmake testall Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: Ie34a9e1f49177649cf0e54c95d73b41bd1b94992 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3811715 Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
* zephyr: Delete CONFIG_PLATFORM_EC_ADCKeith Short2022-08-011-23/+8
| | | | | | | | | | | | | | | | | | | CONFIG_PLATFORM_EC_ADC is redundant with the Zephyr Kconfig option, CONFIG_ADC. Use the Zephyr option directly. Note - projects based on the "minimal" config do not compare. The minimal config disabled CONFIG_ADC, but the CONFIG_PLATFORM_EC_ADC_CMD was still enabled. With this CL, CONFIG_PLATFORM_EC_ADC_CMD now depends on CONFIG_ADC. BUG=none BRANCH=none TEST=zmake testall --static; compare binaries Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: I129a3f490abd5c8234bc06ed6f86f2d7ff8a13b0 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3791659 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* zephyr: Change final output binary to ec.binJeremy Bettis2022-07-291-1/+1
| | | | | | | | | | | | | | | | | | For backwards compatibility set the final output binary to ec.bin instead of zephyr.bin. Remove some references to zephr.bin. BRANCH=None BUG=b:239887568 TEST=zmake build -a ; ls build/zephyr/*/output Signed-off-by: Jeremy Bettis <jbettis@google.com> Change-Id: I9840699505ef97e338b5552de3237f5f6741c8e3 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3788136 Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Jeremy Bettis <jbettis@chromium.org> Tested-by: Jeremy Bettis <jbettis@chromium.org>
* zephyr: move bc12 node under i2c busDawid Niedzwiecki2022-07-281-23/+16
| | | | | | | | | | | | | | | | Move all bc12 nodes under the i2c bus nodes instead of named-usbc-port nodes. The change should simplify the upstream process of the bc12 chip drivers. BUG=b:228240586 TEST=zmake testall; make sure all bc12 chip works BRANCH=main Signed-off-by: Dawid Niedzwiecki <dn@semihalf.com> Change-Id: Icbf961ccc3846da53c3841bb616c3706a1876b53 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3763906 Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* zephyr: rework i2c enumsDawid Niedzwiecki2022-07-284-28/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add additional enum that is created based on used I2C ports from devicetree. Use the new enums to create i2c enums listed in the named-i2c-ports node. The named-i2c-port enums that point to the same i2c port have the same value. The change should allow getting the i2c enum value from the named-i2c-ports node and the i2c port node(the node created by the chip vendor) alternately. It will be useful in process of moving usbc chips e.g. bc12 under the i2c bus, not in the named-usbc-port node. Since i2c enums using the same port have the same value, the i2c_physical_ports is no longer needed. The commit reduces the usage of memory a bit because I2C_PORT_COUNT is lower and initialization of i2c_physical_ports isn't needed. Also, change how the enum values are defined in the dts files. Only one node should be created per physical i2c port and define multiple enum values. BUG=b:228240586 TEST=zmake testall; make sure all i2c ports work BRANCH=main Signed-off-by: Dawid Niedzwiecki <dn@semihalf.com> Change-Id: I95c3f6845cfb71a69d408f33a6c7b22383f10028 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3763905 Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Dawid Niedzwiecki <dawidn@google.com>
* zephyr: npcx_evb: add GPIO_VOLTAGE_1P8 flag supportMulin Chao2022-07-261-10/+10
| | | | | | | | | | | | | | | | | | Add GPIO_VOLTAGE_1P8 flag support at the related board DT file and remove unused `def-lvol-io-list` node. BRANCH=none BUG=b:239636081 TEST=passed 'zmake build npcx7/npcx9 --clobber' Signed-off-by: Mulin Chao <mlchao@nuvoton.com> Cq-Depend: chromium:3782768, chromium:3782769, chromium:3782770 Change-Id: I594a7a8bf942bd79ba830cdb277e133a1dfec191 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3771325 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org> Reviewed-by: Fabio Baltieri <fabiobaltieri@google.com> Commit-Queue: Keith Short <keithshort@chromium.org>
* docs: zephyr: LEDsParth Malkan2022-07-202-1/+224
| | | | | | | | | | | | | | Add a Zephyr doc for setting up LEDs on a board. BRANCH=none BUG=b:222105941 TEST=Browse in Gerrit TEST=Reviewers Change-Id: If92586ed51593d51f7b786e076db0718fa3e31ff Signed-off-by: Parth Malkan <parthmalkan@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3677553 Reviewed-by: Keith Short <keithshort@chromium.org>
* zephyr: temp: drop label usage for temperature senorsFabio Baltieri2022-07-181-1/+0
| | | | | | | | | | | | | | | Zephyr is moving in the direction of reemoving the label property, for identifying the temperature sensor we can use the node name directly. BRANCH=none BUG=b:239165779 TEST=zmake testall TEST=flash brya, ran the "temps" console command Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com> Change-Id: I75e47f79c74787067fe4040ba6fccb7734a33d17 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3763913 Reviewed-by: Keith Short <keithshort@chromium.org>
* zephyr: adc: drop label usage for ADC channelsFabio Baltieri2022-07-181-5/+0
| | | | | | | | | | | | | | | | | | Zephyr is moving in the direction of reemoving the label property, for the ADC usage it's redundant as we can use the node name directly. Change the shim ADC driver to use the node name and drop the label property from the binding, nodes and documentation. BRANCH=none BUG=b:239165779 TEST=zmake testall TEST=flash brya, ran the "adc" console command Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com> Change-Id: I245abe11647c0f15ff5bee3ae42cc20e1fa9faa0 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3763907 Reviewed-by: Al Semjonovs <asemjonovs@google.com>
* rt1718s: support device binding for TCPC and BC1.2Eric Yilun Lin2022-07-151-0/+6
| | | | | | | | | | | | | | | | support RichTek RT1718S BC1.2 and TCPC device binding BUG=b:227359727 TEST=zmake build -a BRANCH=none Change-Id: I3c13781e9bc53fa269295d900903d38ac91b1f0d Signed-off-by: Eric Yilun Lin <yllin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3721945 Commit-Queue: Eric Yilun Lin <yllin@google.com> Reviewed-by: Ting Shen <phoenixshen@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org> Tested-by: Eric Yilun Lin <yllin@google.com>
* test: Remove TEST_CHECK macroBobby Casey2022-07-071-1/+0
| | | | | | | | | | | | | | | | | | | | | The TEST_CHECK macro returns a value (from the calling function) on either success or failure. This differs from all other TEST_* macros in test_util.h, which only return on failure. Returning on failure is appropriate and allows short circuiting a test on the first failure but returning on success results in short circuiting after the first successful check and bypassing subsequent checks. This behavior is somewhat confusing and easy to miss during review. BRANCH=none BUG=b:238120333 TEST=make runhosttests TEST=./util/compare_build.sh -b all -j 120 => MATCH Signed-off-by: Bobby Casey <bobbycasey@google.com> Change-Id: I3777b427aa5e20a91689f86fc37daadffacf27f3 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3748830 Reviewed-by: Tom Hughes <tomhughes@chromium.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* zephyr: Add PLATFORM_EC_MAX_SENSOR_FREQ_MILLIHZGwendal Grignou2022-06-171-0/+2
| | | | | | | | | | | | | | | | | | | | | By default, maximal sensor ODR are capped at 250Mhz. However, some EC are too slow and can missed samples, failing CTS test. Add a variable to reduce the maximal ODR allowed. This variable sets CONFIG_EC_MAX_SENSOR_FREQ_MILLIHZ. BUG=b:206571439 BRANCH=none TEST=Check in loop that all samples are timestamp properly: while true ; do tast run localhost:22552 hardware.SensorIioserviceHard sleep 1 done Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Change-Id: I3093ec22b0a7ab53481198ca8ad9c8c89e461d43 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3668645 Reviewed-by: Yuval Peress <peress@google.com>
* docs: zephyr: add an initial Zephyr BC1.2 doc pageTomasz Michalec2022-05-241-0/+104
| | | | | | | | | | | | | | | | Add documentation for configuring BC1.2 on Zephyr. BRANCH=none BUG=b:222107104 TEST=none Signed-off-by: Tomasz Michalec <tm@semihalf.com> Change-Id: I6bbe32b151eff552da4233dbf33d6707e62263d4 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3644435 Commit-Queue: Tomasz Michalec <tmichalec@google.com> Reviewed-by: Ting Shen <phoenixshen@chromium.org> Tested-by: Tomasz Michalec <tmichalec@google.com> Reviewed-by: Tristan Honscheid <honscheid@google.com>
* zephyr: Remove PLATFORM_EC_ACCELGYRO_LSM6DSO_AS_BASEGwendal Grignou2022-05-231-10/+0
| | | | | | | | | | | | | | | This variable is never used. Fixes commit 36e753deee0 ("Nissa: Add base and lid sensor to nivviks config") BUG=b:212477477 BRANCH=none TEST=zmake testall; zmake build nivviks Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Change-Id: I7e10e3b86ea855bf0da5ef3e5aaa5ad44a80c847 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3611724 Reviewed-by: Yuval Peress <peress@google.com>
* zephyr: Remove CONFIG_PLATFORM_EC_ACCEL_INTERRUPTSGwendal Grignou2022-05-231-2/+0
| | | | | | | | | | | | | | Since CONFIG_ACCEL_INTERRUPTS is gone, this variable is not necessary anymore. BUG=b:230401133 BRANCH=asurada,dedede,brya TEST=zmake testall; zmake build herobrine Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Change-Id: I5e6fcfa746a7c2f8f5536847d1b1054387ce8cc0 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3612217 Reviewed-by: Yuval Peress <peress@google.com>
* zephyr: shim: update all pwms nodes to include frequency/periodFabio Baltieri2022-04-281-4/+2
| | | | | | | | | | | | | | | Update all pwms entries to include a frequency/period specification, so that it can be used by higher level drivers. BRANCH=none BUG=b:230093078 TEST=zmake testall Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com> Change-Id: I6965f19a688a4cc85fbb0d2dac78c4bed34c8cef Cq-Depend: chromium:3613422 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3602882 Reviewed-by: Wai-Hong Tam <waihong@google.com>
* zephyr: shim: set a placeholder period cell for pwms propertyFabio Baltieri2022-04-251-2/+2
| | | | | | | | | | | | | | | | | | | | Update all pwms entries to set a period property. This is part of an ongoing standardization effort in the PWM subsystem in Zephyr, for the moment just set a "0" placeholder (it's not used by any high level driver), will followup setting it to the target value once we'll have the frequency dt macro available, and then use them in the higher level driver and deprecate the old frequency label properties on a later stage. BRANCH=none BUG=b:230093078 TEST=zmake testall Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com> Cq-Depend: chromium:3605349, chromium:3605359 Change-Id: I38cc7ab4cbbb8a7e256a913e3c592aa7ffd55000 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3602884 Reviewed-by: Yuval Peress <peress@google.com>
* zephyr: zmake: Add test_args to project configurationJack Rosenthal2022-04-221-0/+4
| | | | | | | | | | | | | | | | | | | | | For tests, provide a mechanism to pass extra arguments on the command line to the test binary. A temporary directory is provided to place temp files. The purpose of doing so can be seen in the modified BUILD.py for the drivers test: the drivers test has been littering a `flash.bin` file in the working directory, and we'd like to stop that if we can. BUG=b:230107609 BRANCH=none TEST=zmake test test-drivers -> no flash.bin litter Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: I52e9ed68489eea46b109e0e553bd6cf26c23a64a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3602223 Reviewed-by: Abe Levkoy <alevkoy@chromium.org> Reviewed-by: Aaron Massey <aaronmassey@google.com> Commit-Queue: Aaron Massey <aaronmassey@google.com>
* zephyr: Add charger docAaron Massey2022-04-151-0/+291
| | | | | | | | | | | | | | Document configuring the charger chip on a Zephyr enabled board. BRANCH=none BUG=b:216366887 TEST=gerrit gitiles view of markdown Signed-off-by: Aaron Massey <aaronmassey@google.com> Change-Id: Ie1fcf2824c1d3a6a580427748f49347fbd0159fa Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3522749 Reviewed-by: Al Semjonovs <asemjonovs@google.com> Reviewed-by: Keith Short <keithshort@chromium.org>