Commit Graph

14 Commits

Author SHA1 Message Date
Randall Spangler
a3d62a3700 Switch to variable-size stacks
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>
2012-09-09 11:00:34 -07:00
Louis Yung-Chieh Lo
03d4ed278d Add GEC lock mechanism.
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>
2012-08-10 09:28:34 -07:00
Vic Yang
cca78cfcfd Modify Makefile to allow insertion of mock modules
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>
2012-06-14 07:06:07 -07:00
Bill Richardson
8101b71316 Enable verified boot for EC firmware
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>
2012-05-10 17:27:36 -07:00
Vincent Palatin
a9ceb116c7 introducing chip variant for stm32 family [2/3]
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
2012-05-01 17:13:33 -07:00
Simon Glass
ee753a7ed1 Pass include directories to C preprocessor
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>
2012-04-10 13:46:18 -07:00
Vincent Palatin
a94e3277b3 update versioning information stored in the EC
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
2012-03-02 16:46:26 +00:00
Vincent Palatin
dd3a4a4b7d build private files if present
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
2012-02-16 00:53:22 +00:00
Vic Yang
94fb8ee096 Sqrt function for Cortex-M
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>
2012-02-16 05:43:29 +08:00
Rong Chang
57c581891d Add board configuration flags in board.h
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
2012-02-06 14:45:20 -08:00
Vincent Palatin
cf9fcef328 Move OS files to a CPU specific directory
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
2012-01-25 22:50:07 +00:00
Vincent Palatin
d356dea61e Add modularity to the build
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
2012-01-24 23:17:07 +00:00
Randall Spangler
bc4c1b4eb9 Separate utility build for build and host utils
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
2011-12-08 10:55:27 -08:00
Vincent Palatin
e24fa592d2 Initial sources import 3/3
source files mainly done by Vincent.

Signed-off-by: Vincent Palatin <vpalatin@chromium.org>

Change-Id: Ic2d1becd400c9b4b4a14d4a243af1bdf77d9c1e2
2011-12-07 19:10:02 +00:00