summaryrefslogtreecommitdiff
path: root/Makefile
Commit message (Collapse)AuthorAgeFilesLines
* Remove proxy config flags for unit testsVic Yang2013-08-041-4/+1
| | | | | | | | | | | | | | | This moves per-test config flags from test_config.mk to test_config.h, where one can define/undefine config flags for individual test. BUG=chrome-os-partner:19235 TEST=Pass all tests BRANCH=None Change-Id: I096aded2007881433d3b6414d37f8bfdc6a2c45c Signed-off-by: Vic Yang <victoryang@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/64367 Reviewed-by: Vincent Palatin <vpalatin@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org>
* Fix extracting CONFIG tokens from config.hRandall Spangler2013-07-171-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We need to use cpp -dM instead of -dN, because -dN doesn't process #undef statements. That is, if you have " #define CONFIG_FOO" " #undef CONFIG_FOO" then -dN will happily print both lines, which results in CONFIG_FOO being defined when processing the makefile. -dM processes the defines and undefs so that the resulting list of macros only includes those that are defined. We didn't notice this before, because we temporarily commented out config statements instead of #undef'ing them - or the configs which were undef'd only resulted in conditional non-compilation of pieces of code inside a file instead of the whole file not being compiled. This change also tidily alphabetizes the resulting configs. It also better filters CONFIGs to ensure that " #define __CROS_EC_CONFIG_CHIP_H" does not show up as a CONFIG_CHIP_H token, as it did previously. BUG=chrome-os-partner:20985 BRANCH=none (though may be needed if any future cherry-picked change requires undefining a CONFIG) TEST=Add #undef CONFIG_ADC to the end of config.h and see that the ADC module is not compiled. Also helps to add $(info $(_flag_cfg)) to the Makefile to see the list of tokens, and verify that CONFIG_ADC is not among them. Change-Id: I18db60099e87857473ba54c3c9fff1116d4f1a93 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/62230 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* Make a top-level config.h file to include sub-configsRandall Spangler2013-07-161-4/+2
| | | | | | | | | | | | | | | | | This file will soon contain the exhaustive list of all CONFIG defines and their descriptions. Chip-level configs are renamed to config_chip.h to avoid naming conflicts. BUG=chrome-os-partner:18343 BRANCH=none TEST=build all platforms Change-Id: I9e94146f5b4c016894bd3ae3d371c4b9f3f69afe Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/62122 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* Add I8042 keyboard unit testVic Yang2013-07-111-0/+3
| | | | | | | | | | | | | This tests I8042 scancode and typematic. BUG=chrome-os-partner:19236 TEST=Pass all tests many times. BRANCH=None Change-Id: I8457b7b807b694b0bae32abf1647961f946dc5e1 Signed-off-by: Vic Yang <victoryang@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/61553 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* Make test-list a per-board parameterVic Yang2013-04-291-0/+1
| | | | | | | | | | | | | | Some tests are not applicable to all boards. This change makes test-list a per-board parameter so a test can be enabled/disabled for individual boards. Also disable all the tests that don't compile now. BUG=chrome-os-partner:18598 TEST=make tests for all boards BRANCH=None Change-Id: Id2d18e23856f5c64dbdc7c6ca5949f8ad61b5cc0 Signed-off-by: Vic Yang <victoryang@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/49452
* Replace generated CONFIG_TASK_ macros with HAS_TASK_Bill Richardson2013-04-241-1/+1
| | | | | | | | | | | | | | | CONFIG_ macros should be set directly. Expanding the task names in the same way made it difficult to tell what was a configuration choice and what was due to changes in ec.tasklist BUG=chrome-os-partner:18343 TEST=build all, run link BRANCH=none Change-Id: Ib82e34f974238ee2dd216f33b701b6f4c6a4f1f1 Signed-off-by: Bill Richardson <wfrichar@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/49098 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* Exclude chipset task from test binariesVic Yang2013-04-111-1/+1
| | | | | | | | | | | | | | | For most tests, we don't need to power the AP. Let's exclude chipset task to save memory space. BUG=chrome-os-partner:18598 TEST=Run pingpong test on Spring BRANCH=none Change-Id: I545c5b3e1c27b0067d4ffe09a7971d32b75d6039 Signed-off-by: Vic Yang <victoryang@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/47833 Reviewed-by: Randall Spangler <rspangler@chromium.org> Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* Only includes necessary tasks for test binariesVic Yang2013-04-101-3/+12
| | | | | | | | | | | | | | | | | | | | This changes current TASK() syntax to TASK_BASE() and TASK_NORMAL(), where TASK_BASE is necessary for the EC to boot on a board and TASK_NORMAL represents the task that can be removed in a test binary. Tasks introduced by a test should be listed as TASK_TEST(). Note that this CL breaks current tests (many of them are broken anyway), which will be fixed in up coming CLs. BUG=chrome-os-partner:18598 TEST=Build link/bds/spring/snow/daisy/mccroskey. (mccroskey failed for unrelated issue) BRANCH=none Change-Id: Ic645cdae0906ed21dc473553f1f43c2537ec4bb9 Signed-off-by: Vic Yang <victoryang@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/47531
* Clean up vboot hash supportRandall Spangler2012-10-251-1/+0
| | | | | | | | | | | | | | | | | | This copies the parts of sha256.c that we need from vboot_reference, and removes the explicit dependency on vboot_reference. That dependency was a good idea when we were doing full verified boot in the EC, but is now overkill and makes it harder for others to reuse the EC code. This also lets us call EC functions directly instead of needing vboot_stub.cc; that reduces code size by ~100 bytes. BUG=chrome-os-partner:15579 BRANCH=none TEST=vboot_hash ro, then compare with result of sha256sum build/link/ec.RO.flat Change-Id: I0f236174291df3e7f3c75e960fe9ab32af305a61 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/36589 Reviewed-by: Bill Richardson <wfrichar@chromium.org>
* Switch to variable-size stacksRandall Spangler2012-09-091-1/+1
| | | | | | | | | | | | | | | | | | | | 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>
* Add GEC lock mechanism.Louis Yung-Chieh Lo2012-08-101-0/+1
| | | | | | | | | | | | | | 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>
* Modify Makefile to allow insertion of mock modulesVic Yang2012-06-141-8/+9
| | | | | | | | | | | | | | | | | | | | 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>
* Enable verified boot for EC firmwareBill Richardson2012-05-101-0/+3
| | | | | | | | | | | | | | | | | | | | 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>
* introducing chip variant for stm32 family [2/3]Vincent Palatin2012-05-011-2/+2
| | | | | | | | | | | | 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
* Pass include directories to C preprocessorSimon Glass2012-04-101-3/+5
| | | | | | | | | | | | | | | | | | | | 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>
* update versioning information stored in the ECVincent Palatin2012-03-021-1/+1
| | | | | | | | | | | | | | | 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
* build private files if presentVincent Palatin2012-02-161-1/+3
| | | | | | | | | | | | | | 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
* Sqrt function for Cortex-MVic Yang2012-02-161-1/+1
| | | | | | | | | | 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>
* Add board configuration flags in board.hRong Chang2012-02-061-1/+2
| | | | | | | | | | | 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
* Move OS files to a CPU specific directoryVincent Palatin2012-01-251-2/+4
| | | | | | | | | | | | | | 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
* Add modularity to the buildVincent Palatin2012-01-241-5/+17
| | | | | | | | | | | | | | 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
* Separate utility build for build and host utilsRandall Spangler2011-12-081-1/+1
| | | | | | | | | | | | | | 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
* Initial sources import 3/3Vincent Palatin2011-12-071-0/+33
source files mainly done by Vincent. Signed-off-by: Vincent Palatin <vpalatin@chromium.org> Change-Id: Ic2d1becd400c9b4b4a14d4a243af1bdf77d9c1e2