summaryrefslogtreecommitdiff
path: root/core
Commit message (Collapse)AuthorAgeFilesLines
* cr50: set cc-name to gcc to avoid build errorsVadim Sukhomlinov2022-12-011-3/+5
| | | | | | | | | | | | | | | | | | | | | | | Some change in ChromeOS chroot caused different defaults, so cc-name switched from `gcc` to `clang` in compiler autodetection for host target, but never was set to `gcc` by board/chip/core. Adding setting `cc-name:=gcc` for core/cortex-m/build.mk to use specific toolchain. BUG=b:260904818 TEST=make buildall -j Change-Id: Ic0b8ffade9fa4d82bd265add8b7906be7d98f7c1 Signed-off-by: Vadim Sukhomlinov <sukhomlinov@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4071387 Reviewed-by: Vadim Bendebury <vbendeb@chromium.org> Commit-Queue: Vadim Sukhomlinov <sukhomlinov@chromium.org> Auto-Submit: Vadim Sukhomlinov <sukhomlinov@chromium.org> Tested-by: Vadim Sukhomlinov <sukhomlinov@chromium.org> Reviewed-by: Vadim Sukhomlinov <sukhomlinov@chromium.org> Commit-Queue: Vadim Bendebury <vbendeb@chromium.org> Code-Coverage: Vadim Sukhomlinov <sukhomlinov@chromium.org>
* fix ChromiumOS authors and whitespace warningsMary Ruthven2022-09-1328-28/+28
| | | | | | | | | | | BUG=none TEST=none Change-Id: I61b0b0106a43f723ec3bc805eb190aef00bbd05b Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3894391 Reviewed-by: Vadim Bendebury <vbendeb@chromium.org> Commit-Queue: Vadim Bendebury <vbendeb@chromium.org>
* coil: replace non-inclusive terms with "placeholder"Mary Ruthven2021-11-192-4/+3
| | | | | | | | | | BUG=b:173227629 TEST=make buildall -j Change-Id: I2b203dfe45416aa3b632f6f788d14264b08f44e0 Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3293252 Reviewed-by: Vadim Sukhomlinov <sukhomlinov@chromium.org>
* coil: replace non-inclusive terms with "validity"Mary Ruthven2021-11-191-1/+1
| | | | | | | | | | BUG=b:173227629 TEST=make buildall -j Change-Id: Iaf8028984cc58cc4108907fdba4ea4b38c43cf70 Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3293250 Reviewed-by: Vadim Sukhomlinov <sukhomlinov@chromium.org>
* Revert "ec: Add a task_reset function."Mary Ruthven2021-11-181-342/+24
| | | | | | | | | | | | This reverts commit 9cb1b936e76809cb68419c3ff3612e17fec81e9c. BUG=b:200823466 TEST=make buildall -j Change-Id: I82d322106022d70f9df3b7b618526ce8adf7e846 Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3289991 Reviewed-by: Vadim Sukhomlinov <sukhomlinov@chromium.org>
* Revert "npcx: system: Add support for npcx7 series ec"Mary Ruthven2021-11-181-6/+0
| | | | | | | | | | | | This reverts commit 375b60776156036ef458069c408e5ed4b24692f0. BUG=b:200823466 TEST=make buildall -j Change-Id: Ifdb60cbeab9409c9afeb0860f9510b6c8fd9cb58 Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3273464 Reviewed-by: Vadim Sukhomlinov <sukhomlinov@chromium.org>
* Revert "npcx: bypass for CSAE issue if CONFIG_LOW_POWER_IDLE is disabled"Mary Ruthven2021-11-181-12/+0
| | | | | | | | | | | | This reverts commit ebe3caeb69aeaa9144701415decc3e6647df01cd. BUG=b:200823466 TEST=make buildall -j Change-Id: I53b5c29ab306e4b3c9abfaad7d78db46dc62c72a Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3273452 Reviewed-by: Vadim Sukhomlinov <sukhomlinov@chromium.org>
* Revert "chip/npcx: Add support for pad-switching UART"Mary Ruthven2021-11-181-4/+0
| | | | | | | | | | | | This reverts commit ab9084fd2a70a505e0e43b39e0ad40876e4853fc. BUG=b:200823466 TEST=make buildall -j Change-Id: I2bc23607e4658260bd83c8f9c85d24fe1f9131a2 Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3273444 Reviewed-by: Vadim Sukhomlinov <sukhomlinov@chromium.org>
* Revert "system: Log PC and task id on watchdog"Mary Ruthven2021-11-181-3/+0
| | | | | | | | | | | | | | This reverts commit 0037fb8dfcd7136d40e608ad9973331bd82d9a80. Merge conflict RESET_FLAG_WATCHDOG renamed to EC_RESET_FLAG_WATCHDOG BUG=b:200823466 TEST=make buildall -j Change-Id: Icf366b474e54c66a01ed68b6650b60d234a14064 Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3273439 Reviewed-by: Vadim Sukhomlinov <sukhomlinov@chromium.org>
* Revert "stm32/usb: Add HOOK_USB_PM_CHANGE, called when USB is resumed/suspended"Mary Ruthven2021-11-181-6/+0
| | | | | | | | | | | | This reverts commit 76927bdc5a17ddbdc9fc601b761c2a4984ecc1e9. BUG=b:200823466 TEST=make buildall -j Change-Id: Iae1cf9c676788ffaf9367b0755356950e9ee8ca6 Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3273437 Reviewed-by: Vadim Sukhomlinov <sukhomlinov@chromium.org>
* Revert "stm32: add internal flash support for STM32H7 family"Mary Ruthven2021-11-181-5/+0
| | | | | | | | | | | | This reverts commit 730491df202e5b14e489a5ab31a78e47fcd47af3. BUG=b:200823466 TEST=make buildall -j Change-Id: I40cee7c13ff0070fc6df9e73ab2dde4b9311ed02 Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3273433 Reviewed-by: Vadim Sukhomlinov <sukhomlinov@chromium.org>
* Revert "cortex-m: enable I-cache on ARMv7-M"Mary Ruthven2021-11-182-48/+0
| | | | | | | | | | | | This reverts commit f23f45e74e4c0aff7116a832556d194747997ffe. BUG=b:200823466 TEST=make buildall -j Change-Id: I5a4c344725c77bf6507a967c11d557d0c62cd01b Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3273432 Reviewed-by: Vadim Sukhomlinov <sukhomlinov@chromium.org>
* Revert "core: add chip-specific memory regions definition mechanism"Mary Ruthven2021-11-181-18/+0
| | | | | | | | | | | | This reverts commit b42dd73603844c03b44d88a4513df330ee168496. BUG=b:200823466 TEST=make buildall -j Change-Id: I42b0fb4b0b5b0b08b9db45c57adb79ad2f111a26 Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3273431 Reviewed-by: Vadim Sukhomlinov <sukhomlinov@chromium.org>
* Revert "cortex-m: add D-cache support"Mary Ruthven2021-11-184-97/+6
| | | | | | | | | | | | This reverts commit edbfb3a43b6c4e1dd28f6d00a59896cae198f68b. BUG=b:200823466 TEST=make buildall -j Change-Id: Iafdc81e9cb1593fea49ffcce1577edd7b5a14b1b Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3273421 Reviewed-by: Vadim Sukhomlinov <sukhomlinov@chromium.org>
* Revert "common: add BASE_CHANGE hook"Mary Ruthven2021-11-182-8/+0
| | | | | | | | | | | | This reverts commit af908bfce225415c01d56b3f57cfc399d8485d3e. BUG=b:200823466 TEST=make buildall -j Change-Id: I36277d725500101097ad45a55173877688848797 Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3273413 Reviewed-by: Vadim Sukhomlinov <sukhomlinov@chromium.org>
* Revert "tcpm:it83xx: GRL-USB-PD TDA2.1.2.2 BIST test"Mary Ruthven2021-11-182-8/+0
| | | | | | | | | | | | This reverts commit 09d4918f464b69390f0c2d12cdd8c6aeafcb2cae. BUG=b:200823466 TEST=make buildall -j Change-Id: Ia3384f0334516dd8b6b01cc78c3dac42128d5752 Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3273410 Reviewed-by: Vadim Sukhomlinov <sukhomlinov@chromium.org>
* Revert "core/cortex-m*/task: Record 32-bit exception times"Mary Ruthven2021-11-181-14/+7
| | | | | | | | | | | | This reverts commit 9f4852b7e9bbceb1fadb04eb68da43037f0b09d5. BUG=b:200823466 TEST=make buildall -j Change-Id: I716e68cf43c2f388efc54534d4a19735dcde0f3b Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3273404 Reviewed-by: Vadim Sukhomlinov <sukhomlinov@chromium.org>
* Revert "core/cortex-m: Support chip with no flash."Mary Ruthven2021-11-181-16/+2
| | | | | | | | | | | | | | This reverts commit 59364c835d14689c55e66551cd48c668814541df. BUG=b:200823466 TEST=make buildall -j merge conflict in core/cortex-m/ec.lds.S Change-Id: Id1dbb33326ed3cda673c3225d686d340f8f98114 Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3273403 Reviewed-by: Vadim Sukhomlinov <sukhomlinov@chromium.org>
* Revert "core/cortex-m: Support prevent chip memory region from GC."Mary Ruthven2021-11-181-10/+0
| | | | | | | | | | | | This reverts commit 216ab1e1d8d74bc722d3e322b2460802e93a5df9. BUG=b:200823466 TEST=make buildall -j Change-Id: I172f980a255ec824b263ffa836359b4cbe947892 Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3273402 Reviewed-by: Vadim Sukhomlinov <sukhomlinov@chromium.org>
* Revert "mt_scp: Add functions to clean/invalidated selected ranges of D-cache"Mary Ruthven2021-11-181-4/+4
| | | | | | | | | | | | This reverts commit 153c90a2026f1ae56705e4880e2461354d1ac9af. BUG=b:200823466 TEST=make buildall -j Change-Id: I672b5f2f4703309f7034b39da051b76f3571330d Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3273398 Reviewed-by: Vadim Sukhomlinov <sukhomlinov@chromium.org>
* Revert "mt_scp: Support ROM section on internal SRAM."Mary Ruthven2021-11-181-4/+20
| | | | | | | | | | | | | | This reverts commit 4a2a450ca48278b9f701461799df54faa6c4c395. Merge conflict in core/cortex-m/ec.lds.S BUG=b:200823466 TEST=make buildall -j Change-Id: I52ae029a574aadc4de96f8e9d68076d9bea03ae5 Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3273393 Reviewed-by: Vadim Sukhomlinov <sukhomlinov@chromium.org>
* Revert "USB-PD: Add hook for PD connect event"Mary Ruthven2021-11-182-8/+0
| | | | | | | | | | | | This reverts commit 608e6a4ca4a8cb46004db986f8b71c81b99b7786. BUG=b:200823466 TEST=make buildall -j Change-Id: Ic09ce1d4e796f2a742ed6c16473c1789b6a6087d Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3273384 Reviewed-by: Vadim Sukhomlinov <sukhomlinov@chromium.org>
* Revert "mt_scp: Add support to store some code in DRAM"Mary Ruthven2021-11-181-11/+0
| | | | | | | | | | | | This reverts commit d7579bd4589d08eeabf7c01f055b925acb7aed67. BUG=b:200823466 TEST=make buildall -j Change-Id: I442a932753e8a4745ac5002c165cf9309cb770ff Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3273369 Reviewed-by: Vadim Sukhomlinov <sukhomlinov@chromium.org>
* Revert "core: Allow .bss and .data sections in DRAM"Mary Ruthven2021-11-181-68/+3
| | | | | | | | | | | | This reverts commit 0528c46598c8c89f04b7129722de50e178b62aa2. BUG=b:200823466 TEST=make buildall -j Change-Id: I7777cf51e2fee18975ae8267df9af4d2ac266de8 Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3273368 Reviewed-by: Vadim Sukhomlinov <sukhomlinov@chromium.org>
* Revert "common/system: refactor some confusing ifdefs"Mary Ruthven2021-11-181-2/+2
| | | | | | | | | | | | This reverts commit 3e1c72ea23fe3c37f5a4e4e8bceea38c0322ba31. BUG=b:200823466 TEST=make buildall -j Change-Id: I172b5fd55529754d913f4d18258beccac0bade58 Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3273364 Reviewed-by: Vadim Sukhomlinov <sukhomlinov@chromium.org>
* Revert "task: Add task_enable_task() and task_disable_task()"Mary Ruthven2021-11-181-13/+0
| | | | | | | | | | | | This reverts commit 60c1f84d024395fac90f144ad5a027f56b5ff3d0. BUG=b:200823466 TEST=make buildall -j Change-Id: I4a3f6a809288fa803c24057056d70cb6f42ed578 Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3273360 Reviewed-by: Vadim Sukhomlinov <sukhomlinov@chromium.org>
* Revert "kukui_scp: support CONFIG_PRESERVE_LOGS"Mary Ruthven2021-11-181-13/+0
| | | | | | | | | | | | This reverts commit 99d0d6e76c6c9e566a664bdb76f2e3c6db221cbd. BUG=b:200823466 TEST=make buildall -j Change-Id: Ia431f76fbd5c2fbc648803105d0d801084843349 Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3273356 Reviewed-by: Vadim Sukhomlinov <sukhomlinov@chromium.org>
* core-m/m0: reformat linker script with spacesMary Ruthven2021-11-181-429/+429
| | | | | | | | | | | | | | | Temporarily use spaces instead of tabs so we can cleanly revert linker script cls. Reformat the linker script again after the reverts are done. BUG=b:200823466 TEST=make buildall -j Change-Id: Id0a21581b657e5efc8e00745ef9ce7f6b279e563 Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3273186 Reviewed-by: Vadim Sukhomlinov <sukhomlinov@chromium.org>
* cortex-m: remove mpustabilize-14345.B-cr50_stabstabilize-14336.B-cr50_stabMary Ruthven2021-11-103-389/+0
| | | | | | | | | | BUG=b:200823466 TEST=make buildall -j Change-Id: I32b77ab6a5f63c6313a65cf28bb69fa88cec122e Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3273185 Reviewed-by: Vadim Sukhomlinov <sukhomlinov@chromium.org>
* remove core/riscv-rv32iMary Ruthven2021-11-1013-1968/+0
| | | | | | | | | | BUG=b:200823466 TEST=make buildall -j Change-Id: I04e2c947375257955f0b2ed5f52593ea8d6083f3 Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3273182 Reviewed-by: Vadim Sukhomlinov <sukhomlinov@chromium.org>
* remove cortex-m0Mary Ruthven2021-11-1028-5821/+0
| | | | | | | | | | | | Cr50 doesn't use cortex-m0. Remove it. BUG=b:200823466 TEST=make buildall -j Change-Id: I46c43b9963b69e9784b39e09ed727954d3ec69c2 Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3273179 Reviewed-by: Vadim Sukhomlinov <sukhomlinov@chromium.org>
* remove core/minute-iaMary Ruthven2021-11-1019-3009/+0
| | | | | | | | | | BUG=b:200823466 TEST=make buildall -j Change-Id: Iaa1c4e12e8ae5403097a6b2a37e20962d54d58b0 Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3273178 Reviewed-by: Vadim Sukhomlinov <sukhomlinov@chromium.org>
* cr50: add run-time detection of gcc version to support gcc 11.2 LTOVadim Sukhomlinov2021-10-141-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | With planned upgrade to gcc 11.2 we need to make sure it will not fail cr50 build as it will be a reason to revert. gcc 11.2 gives us 1768 b back after TPM2 LTO, but it changes default linker behavior and produce LTO object file during partial link unless -flinker-output=nolto-rel is used. This option however fail 8.3 build. Also, gcc 11.2 introduced new optimization path IPA modref which doesn't play nice with LTO and partial link used together, causing gcc crash. To overcome this issue add -fno-ipa-modref when gcc 11.2 is used. This results in almost no impact on code size. BUG=none TEST=make BOARD=cr50 tested with gcc 8.3 and gcc 11.2 Signed-off-by: Vadim Sukhomlinov <sukhomlinov@google.com> Change-Id: I78a3b3403e84dc4a426dede02b399d9d249ece81 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3218577 Reviewed-by: Vadim Sukhomlinov <sukhomlinov@chromium.org> Reviewed-by: Patrick Georgi <pgeorgi@chromium.org> Reviewed-by: Andrey Pronin <apronin@chromium.org> Tested-by: Vadim Sukhomlinov <sukhomlinov@chromium.org> Commit-Queue: Vadim Sukhomlinov <sukhomlinov@chromium.org>
* cr50: place .text.fips_checksum immediately after FIPS modulefirmware-chameleon-14280.B-cr50_stabVadim Sukhomlinov2021-10-121-10/+15
| | | | | | | | | | | | | | | | | | | | .text.fips_checksum section was placed after .text which resulted in different address for it. Since address of this section is used in FIPS module it resulted in different digest computed. BUG=b:138578318 TEST=make BOARD=cr50, check map file to ensure .text.fips_checksum is just after FIPS module. Signed-off-by: Vadim Sukhomlinov <sukhomlinov@google.com> Change-Id: Ia054fec9191eac8818dcde139320eddbd7c8085b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3218580 Reviewed-by: Vadim Sukhomlinov <sukhomlinov@chromium.org> Reviewed-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-by: Mary Ruthven <mruthven@chromium.org> Commit-Queue: Vadim Sukhomlinov <sukhomlinov@chromium.org> Tested-by: Vadim Sukhomlinov <sukhomlinov@chromium.org> Auto-Submit: Vadim Sukhomlinov <sukhomlinov@chromium.org>
* ap_ro_verification: add implementation of the new schemeVadim Bendebury2021-10-021-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The new AP RO verification approach, version 2, places the AP RO verification structures in the AP RO itself, as described below. A new section is included in AP RO FMAP, called RO_GSCVD, which contains all information necessary to verify the AP RO: gsc_verification_data (GVD) structure, GVD signature, the platform key to verify the signature and the root key to verify the platform key. GVD contains an array of AP RO ranges to be verified and the hash of the contents of those ranges. The signature of the GVD is followed by the public platform key, which allows to verify the GVD signature. The platform key in turn is signed by the root key, and the public root key is also present in RO_GSCVD, this allows to validate the platform key. The hash of the public root key is hardcoded in the GSC firmware, this gives the GSC the ability to verify the chain of objects in the RO_GSCVD FMAP area starting with the root key. This implementation supports both old and new AP RO verification schemes as follows. The structure describing data saved in the dedicated GSC flash page has been enhanced to support both old and new AP RO verification schemes. To maintain backwards compatibility the 16 bit header field version is converted into two byte fields, version and type. The new version is 1 and the new verification scheme type is 1, the old verification scheme type value is set to zero. If a V1 structure is found in the H1 hash page, but verification fails, a V2 verification is attempted just in case the RO was reprogrammed and now includes RO_GSCVD area in FMAP. The hash of the root key is saved in the text section named .rodata.root_key_hash. As presented, tests/devkeys/kernel_subkey.vbpubk from the vboot_reference tree is used as the root key. The label of the section where the hash is stored will allow the signer to replace the test key hash with the prod root key hash. Verification process is moved to the TPM task context to satisfy the increased stack requirements of V2 calculations. This provides an additional benefit: verification can be triggered by the AP issuing the vendor command. A CCD capability will be added in a follow up CL to restrict conditions when the AP can invoke verification. BUG=b:199904580 TEST=prepared an AP RO image containing RO_GSCVD and verified that the AP RO can be verified, and that the local cache of the GVD is successfully stored and allows to speed up verification. Experiments have shown that verifying the entire chain starting with the root key take 670 ms. Verifying of approximately 70KB of AP RO takes 200 ms. Verified that V1 AP RO verification is still working as expected, and that V2 can take over in case the AP RO was updated with an RO_GSCVD image, and the V1 check does not pass any more. Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Change-Id: I1397376cd0394888da2cda16c0126a313f07d426 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3172256 Reviewed-by: Andrey Pronin <apronin@chromium.org> Reviewed-by: Vadim Sukhomlinov <sukhomlinov@chromium.org>
* chip/g: fix gcc 11.2 build issuesVadim Sukhomlinov2021-10-011-1/+1
| | | | | | | | | | | | | | | | | | | | | For some reason didn't spot earlier another unnecessary complains of gcc 11.2 in private-cr5x builds with make buildall -j. Made it so BOARD can override settings done by CHIP even though CHIP is loaded later. These settings should apply to both CFLAGS and LDFLAGS due to LTO build. BUG=none TEST=make buildall -j Signed-off-by: Vadim Sukhomlinov <sukhomlinov@google.com> Change-Id: I8880c518b23778cccf969909e330e9e2d62b5fae Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3194984 Reviewed-by: Vadim Sukhomlinov <sukhomlinov@chromium.org> Reviewed-by: Vadim Bendebury <vbendeb@chromium.org> Tested-by: Vadim Sukhomlinov <sukhomlinov@chromium.org> Commit-Queue: Vadim Sukhomlinov <sukhomlinov@chromium.org> Auto-Submit: Vadim Sukhomlinov <sukhomlinov@chromium.org>
* cr50: add support for upcoming update to gcc 11.2 in coreboot-sdkVadim Sukhomlinov2021-09-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Coreboot-sdk is going to be updated to gcc 11.2 soon. Preliminary tests show that cr50 can successfully be compiled with it, however default warnings seems produce to many false positive errors. Disable string-overflow to make code compile. I tried to fix it, but found nothing to fix. Example in dcrypto_bn.c:1323 it complains: if (!rand64(ctx->rnd) board/cr50/dcrypto/dcrypto_bn.c: In function 'dcrypto_modexp_blinded': board/cr50/dcrypto/dcrypto_bn.c:1323:14: warning: 'rand64' accessing 8 bytes in a region of size 0 [-Wstringop-overflow=] 1323 | if (!rand64(ctx->rnd)) | ^ board/cr50/dcrypto/dcrypto_bn.c:1323:14: note: referencing argument 1 of type 'uint32_t *' board/cr50/dcrypto/dcrypto_bn.c:1160:13: note: in a call to function 'rand64' 1160 | static bool rand64(uint32_t dst[2]) | ^ board/cr50/tpm2/ecc.c: In function '_cpri__EccPointMultiply': board/cr50/tpm2/ecc.c:81:25: warning: 'p256_to_bin' accessing 32 bytes in a region of size 1 [-Wstringop-overflow=] 81 | p256_to_bin(&out_x, out->x.b.buffer); | ^ board/cr50/tpm2/ecc.c:81:25: note: referencing argument 2 of type 'uint8_t *' board/cr50/dcrypto/p256.c:119:6: note: in a call to function 'p256_to_bin' 119 | void p256_to_bin(const p256_int *src, uint8_t dst[P256_NBYTES]) Common pattern is when function prototype defines pointer as an array of specified type. Interestingly, that in case of ctx->rnd, rnd is uint32_t rnd[2], so complain is unnecessary. In case of ecc it's hard to explain that there is enough space. BUG=None TEST=make buildall -j Signed-off-by: Vadim Sukhomlinov <sukhomlinov@google.com> Change-Id: I6bc071e4b536095535b9766d14600f5cb491f118 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3183334 Reviewed-by: Vadim Sukhomlinov <sukhomlinov@chromium.org> Reviewed-by: Andrey Pronin <apronin@chromium.org> Tested-by: Vadim Sukhomlinov <sukhomlinov@chromium.org> Commit-Queue: Vadim Sukhomlinov <sukhomlinov@chromium.org>
* cr50: move fips checksum into its own sectionMary Ruthven2021-09-071-6/+11
| | | | | | | | | | | | | | This change moves the fips checksum into its own section, so objcopy can be used to update the fips checksum in the elf files. BUG=none TEST=make buildall -j Change-Id: I8004c7efaf607eabd2932ecb9fdf377e0c68b6c0 Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3120046 Reviewed-by: Vadim Sukhomlinov <sukhomlinov@chromium.org> Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
* cr50: add placeholder for FIPS module at fixed locationVadim Sukhomlinov2021-07-011-0/+23
| | | | | | | | | | | | | | | | | | | We compute sha256 for this block to check integrity, but don't use position independent code, so placing block closer to start of code with as much constant address as possible to prevent sudden relocations from breaking self-integrity check. BUG=b:138578318 TEST=make buildall -j Signed-off-by: Vadim Sukhomlinov <sukhomlinov@google.com> Change-Id: I81289fec8ed7fc73b34e2334c45c360cdabbcd88 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2988196 Reviewed-by: Vadim Sukhomlinov <sukhomlinov@chromium.org> Reviewed-by: Mary Ruthven <mruthven@chromium.org> Tested-by: Vadim Sukhomlinov <sukhomlinov@chromium.org> Auto-Submit: Vadim Sukhomlinov <sukhomlinov@chromium.org> Commit-Queue: Mary Ruthven <mruthven@chromium.org>
* coil: CONFIG_I2C_SLAVE->CONFIG_I2C_PERIPHMary Ruthven2021-01-071-3/+3
| | | | | | | | | | BUG=b:175244613 TEST=make buildall -j Change-Id: Icd2d47a031c5132cb9bca618c5c5ed8cd9e80c07 Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2611756 Reviewed-by: Namyoon Woo <namyoon@chromium.org>
* coil: remove nds32factory-dalboz-13695.B-cr50_stabMary Ruthven2020-12-2219-2684/+0
| | | | | | | | | | | | | core/nds uses words we're removing for coil. Remove it, because cr50 doesn't use it. BUG=b:175244613 TEST=make buildall -j Change-Id: I9621ed67347241b2c847d4005e714a0051ab0274 Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2600300 Reviewed-by: Namyoon Woo <namyoon@chromium.org>
* cortex-m/m0: Reformat linkers script with tabsCraig Hesling2019-11-262-604/+635
| | | | | | | | | | | | | | This is just a cleanup of the linker scripts for cortex-m chips. This brings no functional change. BRANCH=none BUG=none TEST=make buildall Change-Id: If9fa43157e8955fed7c7426b910c6af957794b0b Signed-off-by: Craig Hesling <hesling@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1930392 Reviewed-by: Jett Rink <jettrink@chromium.org>
* core/nds32 and riscv-rv32i/ec.lds.S: no assert if section is not presenttim2019-11-222-2/+4
| | | | | | | | | | | | | | | When the h2ram section is not present, we don't need the assert to check the space whether enough or not. BUG=none BRANCH=none TEST=No error when we don't define configration of CONFIG_HOSTCMD_x86 or CONFIG_H2RAM_SIZE. Change-Id: Id5d0e674f65cfdb220bc996c597740390000d861 Signed-off-by: tim <tim2.lin@ite.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1868132 Reviewed-by: Jett Rink <jettrink@chromium.org>
* ish: chip enablement of ish5.4 on tgl rvp platformLeifu Zhao2019-11-091-1/+3
| | | | | | | | | | | | | | | | | Chip level enablement of ish5.4 on tgl rvp platform. BUG=b:141519691 BRANCH=none TEST=tested on tgl rvp Signed-off-by: Leifu Zhao <leifu.zhao@intel.com> Change-Id: I3f6249e1816d81deec0420a12b093918ee7fbddc Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1846788 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-by: Leifu Zhao <leifu.zhao@intel.corp-partner.google.com> Commit-Queue: Leifu Zhao <leifu.zhao@intel.corp-partner.google.com> Tested-by: Leifu Zhao <leifu.zhao@intel.corp-partner.google.com> Auto-Submit: Leifu Zhao <leifu.zhao@intel.corp-partner.google.com>
* host: remove leftovers from using system clock in testsJack Rosenthal2019-10-251-21/+0
| | | | | | | | | | | | | | There was some leftover constants and a #include we are no longer using due to using a monotonic counter, clean it up. BUG=chromium:1013701 BRANCH=none TEST=buildall Change-Id: Ieeb130aef9ee89d65459f52c8f34753c30c3c388 Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1879335 Reviewed-by: Edward Hill <ecgh@chromium.org>
* test: don't rely on system time for testsJett Rink2019-10-141-6/+10
| | | | | | | | | | | | | | | | Instead of relying on the host's clock, we need to monotonically increase a timestamp. This gives tests predictability. BRANCH=none BUG=chromium:1013701 TEST=ran usb_prl over 100 times without failure Change-Id: Id4a1e9a8cbd9dd44509747916c9073444d71af5c Signed-off-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1860474 Tested-by: Edward Hill <ecgh@chromium.org> Reviewed-by: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Edward Hill <ecgh@chromium.org>
* usbc: fix flaky testsJett Rink2019-10-101-0/+5
| | | | | | | | | | | | | | | | | | | | | | Change waits in USBC tests to 1 MSEC. When we wait and don't care, wait for much longer. We also need to ensure that the lower priority task actually ran when we are trying to cycle the state machine. If the entire process is starved then we have to do some manual checking. Added more prints statements to help debug failing tests. BRANCH=none BUG=none TEST=repeat all tests 100 times without failure Change-Id: I12e0f0fa5247a24c87a4ff457e2be684991f0cad Signed-off-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1837995 Commit-Queue: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Edward Hill <ecgh@chromium.org> Reviewed-by: Denis Brockus <dbrockus@chromium.org>
* Remove uses of %lEvan Green2019-10-052-7/+4
| | | | | | | | | | | | | | | | | | | | | | | This change removes uses of %l from the EC side of the EC codebase. This is done because the semantics of %l within printf have changed, and there are concerns that new calls to printf will be cherry-picked into old firmware branches without the printf changes. So, in preparation for disallowing %l in master, remove occurrences of %l. This change was done by manually fixing up anything found under the EC directory with the following regex: %[0-9*.-]*l[^l] Remember that anything on the host machine is fine as-is, since the host printf never changed. BUG=chromium:984041 TEST=make -j buildall BRANCH=None Change-Id: I2a97433ddab5bfb8a6031ca4ff1d3905289444e2 Signed-off-by: Evan Green <evgreen@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1834603 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* printf: Fix formatting errorsEvan Green2019-10-051-1/+1
| | | | | | | | | | | | | | | | | | | This change fixes the printf formatting errors found by the compile-time prinf format checker. The errors fall into a few categories: 1. Incorrect size specifier (missing or extra l). 2. Missing or extra arguments. 3. Bad line splitting. BUG=chromium:984041 TEST=make -j buildall BRANCH=none Change-Id: I5618097a581210b9fcbfc81560dec050ae30b61c Signed-off-by: Evan Green <evgreen@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1819653 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* printf: Convert %l to %llEvan Green2019-10-054-17/+18
| | | | | | | | | | | | | | | | | | | | | In order to make our printf more standard, utilize %ll for long long arguments, rather than %l. This does cost a little bit in flash space for that extra l in a couple of places, but enables us to turn on compile-time printf format checking. For this commit only, the semantics are such that both %l and %ll take 64-bit arguments. In the next commit, %l goes to its correct behavior of taking a sizeof(long) argument. BUG=chromium:984041 TEST=make -j buildall BRANCH=none Cq-Depend:chrome-internal:1863686,chrome-internal:1860161,chrome-internal:1914029 Change-Id: I18081b55a8dbf5ef8ec15fc499ca75e59d31da58 Signed-off-by: Evan Green <evgreen@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1819652 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>