Increase stack size slightly for vboot hash task since the vboot
SHA256 function allocates ~300 bytes of stack data. Reduce stack size
for watchdog, power LED, and a few other tasks with simple call trees
where we can be sure an error path isn't going to blow past the
reduced stack.
This frees up ~1KB of RAM on STM32.
BUG=chrome-os-partner:13814
BRANCH=all
TEST=boot system; shmem should show more unused RAM; taskinfo should show
tasks still have unused stack
Change-Id: I47d6b77564a0180d15d86667cc0566a8919b776e
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/32608
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Basically re-use the gec lock code from flashrom package.
BUG=chrome-os-partner:12319
TEST=Build and run on link. Only build on snow.
while true; do ectool hello; done & ; run 10 instances.
; expect all instances runs okay.
Signed-off-by: Louis Yung-Chieh Lo <yjlou@chromium.org>
Change-Id: I11d5824f46810c6f5a04a564a81387cdea081697
Reviewed-on: https://gerrit.chromium.org/gerrit/29763
Reviewed-by: Randall Spangler <rspangler@chromium.org>
When we need to mock modules in a unit test, we need a way to mock
the actual modules. This CL enables mock of given source files.
For example, if we need to mock watchdog for test 'foo', we can add to
test/build.mk: "core-mock-foo-watchdog.o=fake_watchdog.o", and then
implement its own watchdog in fake_watchdog.c.
Signed-off-by: Vic Yang <victoryang@chromium.org>
BUG=chrome-os-partner:10356
TEST=Set a mock fake_watchdog.c and check the test is compiled with
fake_watchdog.c instead of watchdog.c.
Change-Id: I4a0afb589a49dad7c4d6faf8926438085cdc46cf
Reviewed-on: https://gerrit.chromium.org/gerrit/24942
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Commit-Ready: Vic Yang <victoryang@chromium.org>
Tested-by: Vic Yang <victoryang@chromium.org>
BUG=chrome-os-partner:7459
TEST=manual
In the chroot:
cd src/platform/ec
make BOARD=link
The firmware image (build/link/ec.bin) is signed with dev-keys. Reflash the
EC and try it, and it should verify and reboot into RW A.
Additional tests (setting USE_RO_NORMAL, poking random values into VBLOCK_A
or FW_MAIN_A to force RW B to run, etc.) are left as an exercise for the
reader. I've done them and they work, though.
Change-Id: I29a23ea69aef02a11aebd4af3b043f6864723523
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Add a parameter to define the chip variant and pass it to build/make
processes.
Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
BUG=chrome-os-partner:9057
TEST=make BOARD=daisy ; make BOARD=adv ; make BOARD=discovery
Change-Id: I87b65b582ed5fc2cf5966446e15224ac15e328e9
If we include a header file within board/daisy/board.h then the code in the
top-level Makefile which transforms the configuration into make variables
cannot locate the header file. We get a warning:
$ make BOARD=daisy clean
board/daisy/board.h:11:20: fatal error: common.h: No such file or directory
compilation terminated.
To fix this, pass the include directories to the preprocessor also.
BUG=none
TEST=manual:
add common.h header to board/daisy/board.h; make BOARD=daisy clean;
see that no warning is issued
Change-Id: I04b718e014490a3f6008b7d03afce4d79a38eb56
Signed-off-by: Simon Glass <sjg@chromium.org>
Add build information (date/time/builder) which can be displayed at the
EC console.
Generate a version from the board name and the branch tag.
Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
BUG=chromium-os:27013
TEST=on BDS, run version command on the console.
inspect the built binary.
Change-Id: Idb1f68898ba6b811d02919f17ab4536ed9f8934a
If we have a private/ directory, check the build.mk there and build the
content, else safely ignore that part of the build.
Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
BUG=None
TEST="make BOARD=link" with and without a private directory containing
some code with new console commands. Run the firmware and check if the console
commands are actually present.
Change-Id: I690ed97be24d029628e4acf508299dcbab657100
Add an arch include folder. Implement sqrtf for Cortex-M in math.h.
BUG=chrome-os-partner:7920
TEST=none
Change-Id: Ib7b480b6a0bf7760f014a1f73df54673a9016cb6
Signed-off-by: Vic Yang <victoryang@chromium.org>
Current makefile takes CONFIG_* flags from $(CHIP)/config.h . This
CL adds $(BOARD)/board.h and a sample charger config flag.
Signed-off-by: Rong Chang <rongchang@google.com>
BUG=chrome-os-partner:7917
TEST=build bds,link board and check warning and error messages.
Change-Id: I1f13d24da6b18c014f40f941ef7245487e5ccc81
Preparatory work to introduce a second SoC : 3/5
We split the drivers files which contain SoC specific drivers from the
OS files which only depend the actual CPU core.
Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
BUG=None
TEST=run EC firmware on BDS and test a few commands on the console.
Change-Id: I598f8b23e074da9bd6b0e2ce6689c1075fe854f0
You can now enable/disable tasks more easily.
To conditionally compile a C file depending on the task FOO activation,
just write something like that in the build.mk file :
common-$(CONFIG_TASK_FOO)+=foo_source.o
Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
BUG=None
TEST=make all BOARD=link && make qemu-tests
Change-Id: I760fb248e1599d13190ccd937a68ef47da17b510
Build is the system doing the build (e.g. 64-bit linux) and host is the
target platform on top of the ec (e.g. 32-bit Chromium OS).
Necessary to get ectool properly compiling for Chromium OS.
Signed-off-by: Randall Spangler <rspangler@chromium.org>
BUG=none
TEST=make && file build/bds/util/ectool; ectool should be a 32-bit binary
Change-Id: I50eba4c164ece236646a7c6087b1b86769beeb28