| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Don't report stack overflow on a task that has been disabled.
Without this change, system safe mode will fail to recover from a
stackoverflow because the stackoverflow will be detected again, even
though the task has already been disabled.
BUG=b:278792557
TEST=System safe mode starts on boten after a stackoverflow
Change-Id: I59ab579c296d108dcd8c5aba9cb32bba6c7bbf54
Signed-off-by: Rob Barnes <robbarnes@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4455298
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-by: Boris Mittelberg <bmbm@google.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Enable unaligned access for cortext-m and. Add a unit test to validate
that unaligned access runs properly on both bloonchipper and dartmonkey.
Add benchmarks to measure the speed gain between aligned and unaligned
access.
BRANCH=none
BUG=b:239254184
TEST=test/run_device_tests.py -b dartmonkey -t unaligned_access
TEST=test/run_device_tests.py -b bloonchipper -t unaligned_access
Change-Id: I7d75433e6b7b33d7c82ad740dc85a8646d891c6a
Signed-off-by: Firas Sammoura <fsammoura@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4327795
Reviewed-by: Bobby Casey <bobbycasey@google.com>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The NPCX RO firmware image is composed of the 64-bytes NPCX image header
(start at flash offset 0) + EC firmware image. After the EC chip boots
up, the EC booter copies only the EC image part from the flash to the
CODE RAM. As a result, the value of the __data_lma_start should be
assigned to the end of the VMA of the .rodata section
(0x1008fcb0+0x4cb0=0x10094960) but the start of the LMA of .data
section (0x100949a0). Otherwise, it causes the init.s to copy the
incorrect Right-value to the global variable in the data section.
Sections:
Idx Name Size VMA LMA File off Algn
0 .header 00000040 10080000 10080000 00010000 2**0
CONTENTS, ALLOC, LOAD, READONLY, DATA
1 .text 0000fcb0 10080000 10080040 00020000 2**2
CONTENTS, ALLOC, LOAD, READONLY, CODE
2 .rodata 00004cb0 1008fcb0 1008fcf0 0002fcb0 2**3
CONTENTS, ALLOC, LOAD, READONLY, DATA
3 .vtable 00000000 200c0000 200c0000 00034960 2**0
CONTENTS, ALLOC, LOAD, READONLY, DATA
4 .bss 000029f8 200c0000 200c0000 00040000 2**3
ALLOC
5 .data 000001a8 200c29f8 100949a0 000429f8 2**3
CONTENTS, ALLOC, LOAD, DATA
BRANCH=none
BUG=b:271333155
TEST=Verified the EC can run with clang build by David on the helipilot
project.
Change-Id: Ic9b6a2089792242f6a126f6b886536dde4dcd35d
Signed-off-by: Jun Lin <CHLin56@nuvoton.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4333199
Reviewed-by: CH Lin <chlin56@nuvoton.com>
Tested-by: CH Lin <chlin56@nuvoton.com>
Reviewed-by: David Cross <davidmcross@google.com>
Reviewed-by: Bobby Casey <bobbycasey@google.com>
Tested-by: David Cross <davidmcross@google.com>
Commit-Queue: Bobby Casey <bobbycasey@google.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Instead of comparing the CROS_COMPILE path to magic strings, just set
the arch specific flags CMAKE_SYSTEM_PROCESSOR and OPENSSL_NO_ASM in
core/$(CORE)/toolchain.mk
This also has the advantage of working when CROSS_COMPILE is set to
something odd, not in the chroot, like in gitlab builds.
BRANCH=None
BUG=b:248508087, b:273639386
TEST=make buildall
Change-Id: I0c823e321892a04e1f063d8fa0ce386428f5dc6c
Signed-off-by: Jeremy Bettis <jbettis@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4477525
Tested-by: Jeremy Bettis <jbettis@chromium.org>
Auto-Submit: Jeremy Bettis <jbettis@chromium.org>
Commit-Queue: Yi Chou <yich@google.com>
Commit-Queue: Jeremy Bettis <jbettis@chromium.org>
Reviewed-by: Yi Chou <yich@google.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is a reland of commit 1eb725490d0e7ff726b9edcf11579080a412a02f
Original change's description:
> tree: Remove the stale boringssl AES code
>
> BUG=b:248508087, b:273639386
> TEST=make runhosttests -j
> TEST=make buildall -j
> BRANCH=none
>
> Change-Id: If4d7ee558871debdca5998c51d75c1062dce2a50
> Signed-off-by: Yi Chou <yich@google.com>
> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4388275
> Reviewed-by: Tom Hughes <tomhughes@chromium.org>
BUG=b:248508087, b:273639386
TEST=make runhosttests -j
TEST=make buildall -j
BRANCH=none
Force-Relevant-Builds: all
Change-Id: Ifac2e67d3f347be07a4ab880398029a694fa357d
Signed-off-by: Yi Chou <yich@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4464660
Reviewed-by: Tom Hughes <tomhughes@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add task_enabled function that simply check if a task is enabled or not.
BUG=b:278792557
BRANCH=None
TEST=Manually tested
Change-Id: I0faccec603bc6d0226ad2ecbde2d90a6c233dd74
Signed-off-by: Rob Barnes <robbarnes@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4455297
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This reverts commit 2e03009c0dccc4ae9683d3b7d761e900b3cf2c46.
Reason for revert: Breaks postsubmit b/279174496
Original change's description:
> Reland "tree: Remove the stale boringssl AES code"
>
> This is a reland of commit 1eb725490d0e7ff726b9edcf11579080a412a02f
>
> Original change's description:
> > tree: Remove the stale boringssl AES code
> >
> > BUG=b:248508087, b:273639386
> > TEST=make runhosttests -j
> > TEST=make buildall -j
> > BRANCH=none
> >
> > Change-Id: If4d7ee558871debdca5998c51d75c1062dce2a50
> > Signed-off-by: Yi Chou <yich@google.com>
> > Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4388275
> > Reviewed-by: Tom Hughes <tomhughes@chromium.org>
>
> BUG=b:248508087, b:273639386
> TEST=make runhosttests -j
> TEST=make buildall -j
> BRANCH=none
>
> Signed-off-by: Yi Chou <yich@google.com>
> Change-Id: Ifca00792d0568ed767a1c9aea4953eb7a93c1c92
> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4439570
> Reviewed-by: Tom Hughes <tomhughes@chromium.org>
Bug: b:248508087, b:273639386
Change-Id: I4c44cdd75a9cc38e3e0e688d91f2a64b908ae61d
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4459598
Tested-by: Jonathon Murphy <jpmurphy@google.com>
Reviewed-by: Tom Hughes <tomhughes@chromium.org>
Auto-Submit: Jonathon Murphy <jpmurphy@google.com>
Owners-Override: Jonathon Murphy <jpmurphy@google.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is a reland of commit 1eb725490d0e7ff726b9edcf11579080a412a02f
Original change's description:
> tree: Remove the stale boringssl AES code
>
> BUG=b:248508087, b:273639386
> TEST=make runhosttests -j
> TEST=make buildall -j
> BRANCH=none
>
> Change-Id: If4d7ee558871debdca5998c51d75c1062dce2a50
> Signed-off-by: Yi Chou <yich@google.com>
> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4388275
> Reviewed-by: Tom Hughes <tomhughes@chromium.org>
BUG=b:248508087, b:273639386
TEST=make runhosttests -j
TEST=make buildall -j
BRANCH=none
Signed-off-by: Yi Chou <yich@google.com>
Change-Id: Ifca00792d0568ed767a1c9aea4953eb7a93c1c92
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4439570
Reviewed-by: Tom Hughes <tomhughes@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This reverts commit 1eb725490d0e7ff726b9edcf11579080a412a02f.
Reason for revert: break the build of chromeos-base/chromeos-fpmcu-unittests.
Original change's description:
> tree: Remove the stale boringssl AES code
>
> BUG=b:248508087, b:273639386
> TEST=make runhosttests -j
> TEST=make buildall -j
> BRANCH=none
>
> Change-Id: If4d7ee558871debdca5998c51d75c1062dce2a50
> Signed-off-by: Yi Chou <yich@google.com>
> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4388275
> Reviewed-by: Tom Hughes <tomhughes@chromium.org>
Bug: b:248508087, b:273639386
Change-Id: I81f5035e25bed8e98516072a6f2a7a609fd6eede
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4439431
Commit-Queue: Yi Chou <yich@google.com>
Tested-by: Yi Chou <yich@google.com>
Reviewed-by: Howard Yang <hcyang@google.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
BUG=b:248508087, b:273639386
TEST=make runhosttests -j
TEST=make buildall -j
BRANCH=none
Change-Id: If4d7ee558871debdca5998c51d75c1062dce2a50
Signed-off-by: Yi Chou <yich@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4388275
Reviewed-by: Tom Hughes <tomhughes@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add the CONFIG_SYSTEM_SAFE_MODE_PRINT_STACK option for
printing the faulting process stack to the console buffer.
This must be done in safe mode because the console buffer
ignores log messages while in an ISR.
This option is on by default when system safe mode is enabled.
get_panic_stack_pointer is a new overidable function that each
architecture needs to implement to support this feature. The default
implementation returns 0, which will result in no stack being printed.
This is a workaround until coredumps are fully supported.
BUG=b:266084064
BRANCH=None
TEST=System safe mode zephyr test passes
Stack print observed on boten, guybrush, and skyrim boards.
LOW_COVERAGE_REASON=Cortex-M and NDS32 specific code cannot be tested
Change-Id: Ied78ab7e6edca9cfa97c50323d94e39a3fca0eef
Signed-off-by: Rob Barnes <robbarnes@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4301695
Reviewed-by: Boris Mittelberg <bmbm@google.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
https://crrev.com/c/4390608 introduced our own sbrk implementation,
which uses the equivalent __shared_mem_buf symbol, so "end" is no longer
needed.
BRANCH=none
BUG=b:234181908
TEST=./util/compare_build.sh -b all => MATCH
Change-Id: Ic763378785e48b01eeedbb23b3a1f6b68339c357
Signed-off-by: Tom Hughes <tomhughes@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4396775
Reviewed-by: Peter Marheine <pmarheine@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add support for entering system safe mode on nds32 based EC. This is
accomplished by returning from exception handler with iret.
BUG=b:269606355
BRANCH=dedede
TEST=Pass system safe mode tast test (with modified Kernel and AP).
Change-Id: Iac87b5ebd55ce0224b277257e137dffb7d764263
Signed-off-by: Rob Barnes <robbarnes@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4334213
Reviewed-by: Keith Short <keithshort@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This reverts commit 98e00bb45940f1cf31216a20c7441364d43fd8fb.
Reason for revert: On MKBP based boards, host_set_single_event will result in a mutex lock, which will fail when inside the panic ISR. See b/267681436.
Original change's description:
> panic: Publish EC_HOST_EVENT_PANIC on panic
>
> Publish EC_HOST_EVENT_PANIC when a panic occurs.
>
> The kernel may use this event to clean up before the system is reset
> (e.g. sync the drive).
>
> This will be a no-op if the kernel doesn't handle it.
>
> BUG=b:258195448
> BRANCH=None
> TEST=Observe event in kernel. Pass panic_event unit test.
>
> Change-Id: I34b9847778bf17dd113e81158bbbdf999ad2ca33
> Signed-off-by: Rob Barnes <robbarnes@google.com>
> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4063818
> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com>
Bug: b:258195448
Change-Id: I772ef77ec7e4661f1c98658b94e73941ad74d4f2
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4225911
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
Tested-by: Rob Barnes <robbarnes@google.com>
Reviewed-by: Ricardo Quesada <ricardoq@chromium.org>
Commit-Queue: Rob Barnes <robbarnes@google.com>
Auto-Submit: Rob Barnes <robbarnes@google.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A lot of code in common/ and elsewhere use DECLARE_IRQ() to designate an
interrupt handler, and set a priority.
This CL makes it possible for board code to override the priorities set
in common code via DECLARE_IRQ(), in case of special considerations.
BUG=b:266832220
TEST=./util/compare_build.sh -b {discovery,munna}
Change-Id: Ied7afe110301b578178159c51033be7fd86abc1f
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4216265
Tested-by: Jes Klinke <jbk@chromium.org>
Commit-Queue: Jes Klinke <jbk@chromium.org>
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The STM32F0 family (Cortex-M0) makes use of copying the vector table
into SRAM, and the core/cortex-m0/ec.lds.S declares a data section for
this purpose, put as the very first SRAM address in order to satisfy
alignmen requirements. For other Cortex-M0 chips besides the STM32F0,
the linker section exists, but is empty as no data is declared to go
into it. (Any particular board could decide to declare space, copy the
vector table, and modify the VTOR register, if they wanted, though.)
This CL copies the linker section declaration from cortex-m0/ into
cortex-m/, such that boards using other kinds of Cortex-M can also
optionally copy their vector table into SRAM.
BUG=b:266832220
TEST=./util/compare_build.sh -b {discovery,munna}
Change-Id: I6222f360f52ec4928327860fd1bf78860dfba120
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4216264
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
Commit-Queue: Jes Klinke <jbk@chromium.org>
Tested-by: Jes Klinke <jbk@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fix checkpatch error:
> Prefer 'unsigned int' to bare use of 'unsigned'
BUG=b:262047616
TEST=./util/compare_build.sh -b all -j 120
=> MATCH
BRANCH=none
Change-Id: Ibf82332a1e1ea0a0a03d3993336e24883e495e05
Signed-off-by: Andrea Grandi <agrandi@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4126483
Reviewed-by: Tom Hughes <tomhughes@chromium.org>
Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Publish EC_HOST_EVENT_PANIC when a panic occurs.
The kernel may use this event to clean up before the system is reset
(e.g. sync the drive).
This will be a no-op if the kernel doesn't handle it.
BUG=b:258195448
BRANCH=None
TEST=Observe event in kernel. Pass panic_event unit test.
Change-Id: I34b9847778bf17dd113e81158bbbdf999ad2ca33
Signed-off-by: Rob Barnes <robbarnes@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4063818
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add HOOK_BODY_DETECT_CHANGE hook when CONFIG_BODY_DETECTION is
enabled to notify body detection's state is changing.
BRANCH=none
BUG=b:232946420
TEST=zmake build winterhold and confirm that the notification of
the hook has been received.
Change-Id: Ied9afeef41ee14d7f2de1b423d94600d076bb975
Signed-off-by: Leila Lin <leilacy_lin@compal.corp-partner.google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4054308
Tested-by: LeilaCY Lin <leilacy_lin@compal.corp-partner.google.com.test-google-a.com>
Reviewed-by: Elthan Huang <elthan_huang@compal.corp-partner.google.com>
Reviewed-by: Diana Z <dzigterman@chromium.org>
Commit-Queue: LeilaCY Lin <leilacy_lin@compal.corp-partner.google.com.test-google-a.com>
Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
BRANCH=none
BUG=b:261636413
TEST=./test/run_device_tests.py -b dartmonkey -t global_initialization
=> PASS
Cq-Depend: chromium:4083816
Signed-off-by: Tom Hughes <tomhughes@chromium.org>
Change-Id: Ia7e9069a6a030c81cb0697346baa9a08861e56cb
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4081571
Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com>
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
Reviewed-by: Bobby Casey <bobbycasey@google.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Basic implementation of system safe mode recovery.
System safe mode is a recovery mode that may be started after
a fault/panic. It allows the AP to collect info about the fault
and system state before the system resets
This CL includes support for Zephyr EC and legacy CrOS EC
BUG=b:249128225
BRANCH=None
TEST=./twister -s
external/platform/ec/zephyr/test/rw_safe_mode/rw_safe_mode.default
Manually tested on skyrim
Change-Id: I15139bb082011485b54e4ca7813839940bf5401a
Signed-off-by: Rob Barnes <robbarnes@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4029604
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Sort all includes in test with the clang-format rules used by
the zephyr project.
BRANCH=None
BUG=b:247100970
TEST=zmake build -a
TEST=./twister --clobber -v -i
TEST=make -j72 buildall_only runtests
TEST=zmake compare-builds -a
Signed-off-by: Jeremy Bettis <jbettis@google.com>
Change-Id: Iae52f99a3a8b5623c1c92722c325ca92816fa856
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4052760
Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com>
Reviewed-by: Aaron Massey <aaronmassey@google.com>
Auto-Submit: Jeremy Bettis <jbettis@chromium.org>
Commit-Queue: Jeremy Bettis <jbettis@chromium.org>
Tested-by: Jeremy Bettis <jbettis@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Sort all headers in core with the clang-format rules used by the
zephyr project.
BRANCH=None
BUG=b:247100970
TEST=zmake build -a
TEST=./twister --clobber -v -i
TEST=make -j$(nproc) buildall_only runtests
TEST=zmake compare-builds
Signed-off-by: Jeremy Bettis <jbettis@google.com>
Change-Id: Ie1dafb879dca3fcb9254025da8a70b5cd169481d
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4047095
Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com>
Auto-Submit: Jeremy Bettis <jbettis@chromium.org>
Tested-by: Jeremy Bettis <jbettis@chromium.org>
Commit-Queue: Al Semjonovs <asemjonovs@google.com>
Reviewed-by: Al Semjonovs <asemjonovs@google.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Shifting left by 32 is undefined behavior. An AND operation with
mask of 0xffffffff is meaningless, so just avoid it.
BUG=b:64477774
BRANCH=none
TEST=none
Signed-off-by: Boris Mittelberg <bmbm@google.com>
Change-Id: Ibcb3359f453345caee01936c074a9c0ae5aff7dc
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4021135
Tested-by: Peter Marheine <pmarheine@chromium.org>
Reviewed-by: Peter Marheine <pmarheine@chromium.org>
Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When examining code size, it appears that the builtins in compiler-rt
(especially for division) are larger than the ones in the EC source
code:
armv7m-cros-eabi-readelf -s ./build/servo_v4p1/RW/ec.RW.elf | sort -k3 -n -r
__udivsi3: 418 bytes
__aeabi_uidiv: 418 bytes
Compiling with clang before this change:
RO: 15560 bytes in flash and 864 bytes in RAM still available on servo_v4p1
RW: 848 bytes in flash and 7144 bytes in RAM still available on servo_v4p1
After this change:
RO: 16456 bytes in flash and 864 bytes in RAM still available on servo_v4p1
RW: 1232 bytes in flash and 7144 bytes in RAM still available on servo_v4p1
BRANCH=none
BUG=b:256193799
TEST=make buildall
Signed-off-by: Tom Hughes <tomhughes@chromium.org>
Change-Id: I21eab7fba10795e7821be79d141002a009d396a5
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4021114
Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com>
Reviewed-by: Diana Z <dzigterman@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Tests are printing a message after passing "Stack smashing detected"
Fix this by refusing to print a stacktrace if sz - offset would be a
negative number.
BRANCH=None
BUG=None
TEST=Ran fan test
LOW_COVERAGE_REASON=core/host is only test code
Signed-off-by: Jeremy Bettis <jbettis@google.com>
Change-Id: I1587b7b1388132fc18c12957201cd20236ec8f41
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4005657
Auto-Submit: Jeremy Bettis <jbettis@chromium.org>
Tested-by: Jeremy Bettis <jbettis@chromium.org>
Commit-Queue: Jeremy Bettis <jbettis@chromium.org>
Reviewed-by: Peter Marheine <pmarheine@chromium.org>
Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When trying to build a unit test that links against googletest, we get
the following errors:
ld.lld: error: section '.image.RO' will not fit in region 'FLASH':
overflowed by 811597840 bytes
ld.lld: error: section '.image.RO.key' will not fit in region 'FLASH':
overflowed by 811597840 bytes
ld.lld: error: section '.image.RO.key' will not fit in region 'FLASH':
overflowed by 811598672 bytes
ld.lld: error: section '.image.ROLLBACK' will not fit in region 'FLASH':
overflowed by 811598672 bytes
ld.lld: error: section '.image.ROLLBACK' will not fit in region 'FLASH':
overflowed by 811598716 bytes
Looking at the sections in the ELF file, we see that .init_array is
being put at a really large address:
armv7m-cros-eabi-objdump -h \
./build/dartmonkey/fpsensor_hw/RW/fpsensor_hw.RW.elf
Sections:
Idx Name Size VMA LMA File off Algn
10 .init_array 0000000c 38800000 38800000 000b0000 2**2
CONTENTS, ALLOC, LOAD, DATA
11 .init_array.100 00000004 3880000c 3880000c 000b000c 2**2
.init_array consists of read-only data (const data array of
self-relative pointers to functions), so it can go in the .ro_data
section.
See
https://developer.arm.com/documentation/dui0475/c/the-arm-c-and-c---libraries/c---initialization--construction-and-destruction
for details.
BRANCH=none
BUG=b:234181908, b:254530679
TEST=make BOARD=dartmonkey test-fpsensor_hw -j
TEST=./util/compare_build.sh -b all -j 120
=> MATCH
Signed-off-by: Tom Hughes <tomhughes@chromium.org>
Change-Id: If6566763452e3f5f87767b0f4999d6db8e6c1572
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3971946
Reviewed-by: Andrea Grandi <agrandi@google.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
BRANCH=none
BUG=b:172020503, b:255967867
TEST=CC=clang make BOARD=arcada_ish -j
TEST=./util/compare_build.sh -b all -j 120
=> MATCH
Signed-off-by: Tom Hughes <tomhughes@chromium.org>
Change-Id: I91f6f1e28646f7be821050cca870fa2a396c1e50
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3977109
Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com>
Reviewed-by: Eric Yilun Lin <yllin@google.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We're jumping through a lot of hoops trying to get the compiler to do
what we want with inline assembly. It's making the code hard to read and
subject to not-well-defined behavior of the compiler. The pure assembly
is unambiguous.
Before this change:
080164c0 <exception_panic>:
80164c0: 4b08 ldr r3, [pc, #32] ; (80164e4 <exception_panic+0x24>)
80164c2: 4809 ldr r0, [pc, #36] ; (80164e8 <exception_panic+0x28>)
80164c4: 469c mov ip, r3
80164c6: f3ef 8109 mrs r1, PSP
80164ca: f3ef 8205 mrs r2, IPSR
80164ce: 466b mov r3, sp
80164d0: c0fe stmia r0!, {r1, r2, r3, r4, r5, r6, r7}
80164d2: 4641 mov r1, r8
80164d4: 464a mov r2, r9
80164d6: 4653 mov r3, sl
80164d8: 465c mov r4, fp
80164da: 4675 mov r5, lr
80164dc: c03e stmia r0!, {r1, r2, r3, r4, r5}
80164de: 46e5 mov sp, ip
80164e0: f7ff ffb4 bl 801644c <report_panic>
80164e4: 20003f70 .word 0x20003f70
80164e8: 20003f74 .word 0x20003f74
After this change:
08016334 <exception_panic>:
8016334: 4b08 ldr r3, [pc, #32] ; (8016358 <pstack>)
8016336: 4809 ldr r0, [pc, #36] ; (801635c <pregs>)
8016338: 469c mov ip, r3
801633a: f3ef 8109 mrs r1, PSP
801633e: f3ef 8205 mrs r2, IPSR
8016342: 466b mov r3, sp
8016344: c0fe stmia r0!, {r1, r2, r3, r4, r5, r6, r7}
8016346: 4641 mov r1, r8
8016348: 464a mov r2, r9
801634a: 4653 mov r3, sl
801634c: 465c mov r4, fp
801634e: 4675 mov r5, lr
8016350: c03e stmia r0!, {r1, r2, r3, r4, r5}
8016352: 46e5 mov sp, ip
8016354: f000 f890 bl 8016478 <report_panic>
08016358 <pstack>:
8016358: 20003f70 .word 0x20003f70
0801635c <pregs>:
801635c: 20003f74 .word 0x20003f74
BRANCH=none
BUG=b:172020503
TEST=compare disassembly of exception_panic (see above)
TEST=make BOARD=discovery-stm32f072 test-panic
openocd -c "set BOARD discovery-stm32f072" \
-c "set BUILD_DIR build/discovery-stm32f072/panic" \
-f board/discovery-stm32f072/openocd-flash.cfg
screen /dev/ttyUSB1
> runtest
Signed-off-by: Tom Hughes <tomhughes@chromium.org>
Change-Id: Id11c06a14475a81746fa355d0a07e82616574e10
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3299275
Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
BRANCH=none
BUG=b:172020503
TEST=Using https://crrev.com/c/3299275:
make BOARD=discovery-stm32f072 -j
manually inspect generated file:
build/discovery-stm32f072/RW/core/cortex-m0/asm_offsets.h
Signed-off-by: Tom Hughes <tomhughes@chromium.org>
Change-Id: I6c5a982a88ed1e77f8e98b9a0a451d52d5c03a87
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3299274
Reviewed-by: Diana Z <dzigterman@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
BUG=none
BRANCH=none
TEST=none
Signed-off-by: Bobby Casey <bobbycasey@google.com>
Change-Id: Ia4e032b80ade37a8ad0dcfda1f4236ad6cdb2277
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3956159
Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com>
Reviewed-by: Andrea Grandi <agrandi@google.com>
Reviewed-by: Tom Hughes <tomhughes@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
These macros are easier to read and use than the underlying pragmas.
BRANCH=none
BUG=b:172020503
TEST=make buildall
Signed-off-by: Tom Hughes <tomhughes@chromium.org>
Change-Id: I2f67cbb3f83230b7e1a6a4512471bbd2bec0498f
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3872552
Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It's always enabled in the core/<core>/core_config.h files. The
following script demonstrates that it's enabled in all boards:
for board in `make print-boards`; do
make print-configs board="${board}" | grep -q CONFIG_SOFTWARE_PANIC
if [ $? -ne 0 ]; then
echo "${board} failed"
exit 1
fi
done
BRANCH=none
BUG=none
TEST=make buildall
Cq-Depend: chromium:3943248
Signed-off-by: Tom Hughes <tomhughes@chromium.org>
Change-Id: If683b244f17b48bedf3699f2b24e83b5ad6e849e
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3933255
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
__exidx_start and __exidx_end indicate the start and end of the
exception index table, which is described in more detail in "Exception
Handling ABI for ARM Architecture":
https://github.com/ARM-software/abi-aa/blob/60a8eb8c55e999d74dac5e368fc9d7e36e38dda4/ehabi32/ehabi32.rst#54the-object-producer-interface
__exidx_start and __exidx_end are referenced in libunwind, so they need
to be defined. If __exidx_start and __exidx_end are equal, libunwind
will interpret the exception index table as empty, which means the
exception can not be caught, and std::terminate() is called, which is
what we want. The test in https://crrev.com/c/3932262 verifies this
behavior.
See
https://github.com/llvm/llvm-project/blob/b3c5da73b71908c59b12ef0feadfde56bad222b5/libunwind/src/AddressSpace.hpp#L515-L522
BRANCH=none
BUG=b:234181908
TEST=make buildall
Signed-off-by: Tom Hughes <tomhughes@chromium.org>
Change-Id: I8551ca94fce16ec34770f9204282af14667e7c43
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3857943
Reviewed-by: Andrea Grandi <agrandi@google.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
panic_set_reason() and panic_get_reason() are called from
system_common_pre_init() if CONFIG_SOFTWARE_PANIC is enabled. A followup
commit removes CONFIG_SOFTWARE_PANIC since all boards enable it, so we
need stub implementations for the host in order to successfully compile.
LOW_COVERAGE_REASON=legacy code
BRANCH=none
BUG=none
TEST=make buildall
Signed-off-by: Tom Hughes <tomhughes@chromium.org>
Change-Id: I33322b593f707f3c8937f4a7cd2189841b197aa1
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3935024
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This reverts commit 9935980b106f49cf524b07e83c6333cde3294cd3.
Reason for revert: Found a less intrusive option.
Original change's description:
> Makefile: Only set host toolchain if exists
>
> To fix building outside of the chroot, only set the
> CROSS_COMPILE_HOST_DEFAULT to x86_64-pc-linux-gnu- if the compiler
> actually exists.
>
> BRANCH=None
> BUG=b:246424843
> TEST=make test-coverage # in chroot
> TEST=make test-coverage # in gitlab docker
> TEST=emerge-corsola chromeos-ec
>
> Force-Relevant-Builds: all
> Signed-off-by: Jeremy Bettis <jbettis@google.com>
> Change-Id: Icc134eb987033012188a7c77860d8115c41b4df4
> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3902029
> Tested-by: Jeremy Bettis <jbettis@chromium.org>
> Commit-Queue: Jeremy Bettis <jbettis@chromium.org>
> Auto-Submit: Jeremy Bettis <jbettis@chromium.org>
> Reviewed-by: Yuval Peress <peress@google.com>
> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
> Code-Coverage: Aaron Massey <aaronmassey@google.com>
Bug: b:246424843
CQ-Depend: chromium:3905359
Change-Id: I629f72e949165dbd62f8c5beca73ce0e6c317d10
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3905358
Tested-by: Jeremy Bettis <jbettis@chromium.org>
Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
Reviewed-by: Tom Hughes <tomhughes@chromium.org>
Reviewed-by: Aaron Massey <aaronmassey@google.com>
Commit-Queue: Jeremy Bettis <jbettis@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
To fix building outside of the chroot, only set the
CROSS_COMPILE_HOST_DEFAULT to x86_64-pc-linux-gnu- if the compiler
actually exists.
BRANCH=None
BUG=b:246424843
TEST=make test-coverage # in chroot
TEST=make test-coverage # in gitlab docker
TEST=emerge-corsola chromeos-ec
Force-Relevant-Builds: all
Signed-off-by: Jeremy Bettis <jbettis@google.com>
Change-Id: Icc134eb987033012188a7c77860d8115c41b4df4
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3902029
Tested-by: Jeremy Bettis <jbettis@chromium.org>
Commit-Queue: Jeremy Bettis <jbettis@chromium.org>
Auto-Submit: Jeremy Bettis <jbettis@chromium.org>
Reviewed-by: Yuval Peress <peress@google.com>
Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
Code-Coverage: Aaron Massey <aaronmassey@google.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When building with portage, the build fails if we use the "unprefixed"
compiler (e.g., "g++"). Explicitly use the prefixed compiler when
building for the host.
BRANCH=none
BUG=b:246424843
TEST=emerge-hatch chromeos-ec
Force-Relevant-Builds: all
Signed-off-by: Tom Hughes <tomhughes@chromium.org>
Change-Id: I50d2b437374bf6857b19151edb5eaea24a7330c3
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3894407
Reviewed-by: Eric Yilun Lin <yllin@google.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The pragma disables a warning and then immediately re-enables it, which
has no effect.
BRANCH=none
BUG=b:172020503
TEST=./util/compare_build.sh -b all -j 120
=> MATCH
Signed-off-by: Tom Hughes <tomhughes@chromium.org>
Change-Id: I5e50a8886cf093a21c2f9385ce60fa950749f962
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3872551
Reviewed-by: Denis Brockus <dbrockus@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This updates the API for console commands
from "int cmd(int argc, char **argv)"
to "int cmd(int argc, const char **argv)"
which is more accurate and in line with common convention.
BRANCH=none
BUG=b:244387210
TEST="make buildall" passes
TEST="zmake build -a" passes
TEST="util/compare_build.sh -b all" passes
TEST="./twister -v -T zephyr/test" passes
Cq-Depend: chrome-internal:4960125
Cq-Depend: chrome-internal:4959932
Change-Id: I57de9f35b85b8f3c7119df36aefb2abf25d2625f
Signed-off-by: Caveh Jalali <caveh@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3863941
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
Reviewed-by: Tom Hughes <tomhughes@chromium.org>
Reviewed-by: Keith Short <keithshort@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Remove these includes as they're not needed in this header. Instead,
the includes should go where they're actually being used.
BRANCH=none
BUG=b:240574048
TEST=make buildall -j
TEST=zmake build -a
Signed-off-by: Yuval Peress <peress@google.com>
Change-Id: I64b10af3216654b2a20caa1cabd267661a0bca39
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3791980
Reviewed-by: Tristan Honscheid <honscheid@google.com>
Commit-Queue: Tristan Honscheid <honscheid@google.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is the last non-standard format overloading "%p", so we can change
it to the standard "%p" format.
Using standard format specifiers makes it easier to switch between the
"builtin" EC standard library and the C standard library provided by the
toolchain (or Zephyr).
BRANCH=none
BUG=b:238433667, b:234181908
TEST=On icetower v0.1 with servo_micro and J-Trace attached:
Before change:
> rw 536870912
read 0x20000000 = 0x45dbfce2
After change:
> rw 536870912
read 0x20000000 = 0x45dbfce2
Signed-off-by: Tom Hughes <tomhughes@chromium.org>
Change-Id: Id5680ab07af5352d463df42daadff1619c06c9af
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3756180
Reviewed-by: Eric Yilun Lin <yllin@google.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
_sbrk in newlib (embedded C standard library implementation) expects the
"end" symbol to point to the start of free memory.
BRANCH=none
BUG=b:234181908
TEST=./util/compare_build.sh -j 120
=> MATCH
Signed-off-by: Tom Hughes <tomhughes@chromium.org>
Change-Id: I9f206e2ed5f050d92b579e0b65b05be40f929093
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3766504
Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The latest clang complains about missing 'void' in function
definition if it's specified in the declaration:
core/cortex-m/vecttable.c:23:21: error: a function declaration without a
prototype is deprecated in all versions of C
[-Werror,-Wstrict-prototypes]
void default_handler()
^
void
BRANCH=none
BUG=b:230345382, b:172020503
TEST=./util/compare_build.sh -b all -j 120
=> MATCH
Signed-off-by: Tom Hughes <tomhughes@chromium.org>
Change-Id: I5a3d95203cc6cbb59676f4a66876a4a6f2946e31
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3750108
Reviewed-by: Ting Shen <phoenixshen@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
| |
BUG=b:236386294
BRANCH=none
TEST=none
Tricium: disable
Change-Id: Iafd5b2ee41f980ee448ff63b68dad19a70563903
Signed-off-by: Jack Rosenthal <jrosenth@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3749470
Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
| |
BUG=b:236386294
BRANCH=none
TEST=none
Change-Id: I55e35249e1eaa05f25d704568aed7bec9d5f89aa
Signed-off-by: Jack Rosenthal <jrosenth@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3729840
Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
| |
BUG=b:236386294
BRANCH=none
TEST=none
Change-Id: I6a506bffda1dd6c0174b327fa6b612f3df20ad66
Signed-off-by: Jack Rosenthal <jrosenth@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3729816
Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
| |
BUG=b:236386294
BRANCH=none
TEST=none
Change-Id: I6476e2382f5f8a74b1e30380b9003d94a33e722a
Signed-off-by: Jack Rosenthal <jrosenth@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3729828
Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
| |
BUG=b:236386294
BRANCH=none
TEST=none
Change-Id: If7765817f6b011a170d3efa14c8953cf46dbee89
Signed-off-by: Jack Rosenthal <jrosenth@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3729864
Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
|