Commit Graph

29 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
Vic Yang
f229fabd8b Fix flash_overwrite unit test
This also moves flash related tests to use new 'hostcmd' console command.

BUG=chrome-os-partner:10262
TEST=Test passed
BRANCH=none

Change-Id: I5616bfa93bcde0beb4cb2baf2d38e8b5d827c275
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/30665
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
2012-08-19 09:56:32 -07:00
Randall Spangler
99a770b14c Clean up debug output
Should print with [%T prefix

BUG=none
TEST=if it boots, it works

Change-Id: I035c081ae3e8ad0088daf0bba404118e1a1f9b41
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/29480
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
2012-08-07 19:06:43 -07:00
Vic Yang
dbefb29f02 Fix unit tests
Recently, there have been several changes to LPC and host command modules.
This CL fixes unit tests after these changes.

BUG=none
TEST=All test passed.

Change-Id: I263716899af78a61e324fcd0b2636b948617a264
Reviewed-on: https://gerrit.chromium.org/gerrit/27354
Reviewed-by: Rong Chang <rongchang@chromium.org>
Tested-by: Vic Yang <victoryang@chromium.org>
Commit-Ready: Vic Yang <victoryang@chromium.org>
2012-07-13 02:10:46 -07:00
Vic Yang
1bd6146892 Add a test of flash read/write/erase test
This test checks physical read/write/erase functions are called
correctly.

BUG=chrome-os-partner:10261
TEST=Test passed.

Change-Id: Iff58f352bd732a0da9b7b7fe68c4bf87c84906a8
Reviewed-on: https://gerrit.chromium.org/gerrit/27144
Reviewed-by: Yung-Chieh Lo <yjlou%chromium.org@gtempaccount.com>
Tested-by: Vic Yang <victoryang@chromium.org>
Commit-Ready: Vic Yang <victoryang@chromium.org>
2012-07-13 01:13:20 -07:00
Vic Yang
37b295fd6e Add a test of flash overwrite
This test checks we cannot overwrite current running system image.

BUG=chrome-os-partner:10262
TEST=Test passed

Change-Id: I72be277c9de2114e72000a102d8b885e842ef15a
Reviewed-on: https://gerrit.chromium.org/gerrit/27006
Commit-Ready: Vic Yang <victoryang@chromium.org>
Reviewed-by: Vic Yang <victoryang@chromium.org>
Tested-by: Vic Yang <victoryang@chromium.org>
2012-07-10 00:35:58 -07:00
Vic Yang
d6086835e3 Add a test of charging state machine
This test checks charging state machine works correctly:
  - Charge when AC plugged. Discharge when AC unplugged.
  - Shutdown when over/under-temperature during discharging.
  - Stop charging when over/under-temperature during charging.

BUG=chrome-os-partner:10270
TEST=Test passed

Change-Id: I460645c70f5dcd30e258c43956ffe416c8bce906
Reviewed-on: https://gerrit.chromium.org/gerrit/26383
Reviewed-by: Rong Chang <rongchang@chromium.org>
Commit-Ready: Vic Yang <victoryang@chromium.org>
Tested-by: Vic Yang <victoryang@chromium.org>
2012-07-08 20:25:17 -07:00
Vic Yang
ed9d6282d4 Add a function to check no specific message comes from EC
This function has been defined and used in several tests. Let's
consolidate them into the helper class.

BUG=none
TEST=The four tests passed

Change-Id: I069bec84e0f2ce12ef9e8b7fe610f54bb58af0de
Reviewed-on: https://gerrit.chromium.org/gerrit/26534
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Commit-Ready: Vic Yang <victoryang@chromium.org>
Tested-by: Vic Yang <victoryang@chromium.org>
2012-07-02 20:36:57 -07:00
Vic Yang
f44db82873 Make 'typematic' test more robust
This test checks the keypress repeat speed. However, there is inevitable
delay incurred by each keypress and thus we cannot be 100% certain about
the number of keypress to expect. Let's set a range instead of expecting
a fixed amount of keypress.

BUG=chrome-os-partner:10287
TEST=Test passed

Change-Id: Ib43bead68e5497cd64251fb45fab522cbaf3ea86
Reviewed-on: https://gerrit.chromium.org/gerrit/26533
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Commit-Ready: Vic Yang <victoryang@chromium.org>
Tested-by: Vic Yang <victoryang@chromium.org>
2012-07-02 20:36:56 -07:00
Vic Yang
1c0f99d13f Fix compilation error of unit tests
VBOOTHASH task is needed for all unit tests to compile. Let's add it to
all task lists.

BUG=none
TEST=all test build success.

Change-Id: I378cd8bcdced193fe4751b33881f7d14ec88c935
Reviewed-on: https://gerrit.chromium.org/gerrit/26532
Reviewed-by: Rong Chang <rongchang@chromium.org>
Commit-Ready: Vic Yang <victoryang@chromium.org>
Tested-by: Vic Yang <victoryang@chromium.org>
2012-07-02 01:48:27 -07:00
Vic Yang
0909a66d90 Add a test of keyboard debouncing
This test checks keyboard debouncing works correctly.

BUG=chrome-os-partner:10284
TEST=Test passed

Change-Id: I0c984ecc9444b149da580ff0775cc81245b21a1e
Reviewed-on: https://gerrit.chromium.org/gerrit/26021
Commit-Ready: Vic Yang <victoryang@chromium.org>
Reviewed-by: Vic Yang <victoryang@chromium.org>
Tested-by: Vic Yang <victoryang@chromium.org>
2012-06-27 02:51:42 -07:00
Vic Yang
b96e04d2eb Add a test of keyboard typematic
This test checks when holding down a key for different length, typematic
works correctly.

BUG=chrome-os-partner:10287
TEST=Test passed.

Change-Id: I401db73098a98dc3367cedde31f8ec1c5d5f047b
Reviewed-on: https://gerrit.chromium.org/gerrit/26086
Commit-Ready: Vic Yang <victoryang@chromium.org>
Reviewed-by: Vic Yang <victoryang@chromium.org>
Tested-by: Vic Yang <victoryang@chromium.org>
2012-06-27 01:43:54 -07:00
Vic Yang
8b3634ee1f Add a test of i8042 scancode set
This test check correct scan code is sent when I8042_XLATE is enabled or
disabled.

BUG=chrome-os-partner:10286
TEST=Test passed

Change-Id: I939963cbecddb22506e64cb374667c7c2e5b4f8b
Reviewed-on: https://gerrit.chromium.org/gerrit/26096
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Commit-Ready: Vic Yang <victoryang@chromium.org>
Tested-by: Vic Yang <victoryang@chromium.org>
2012-06-27 00:55:04 -07:00
Vic Yang
1105a28a8c Add a test of checking keyboard de-ghosting
This test check when a ghost key appears, it is correctly ignored.

BUG=chrome-os-partner:10285
TEST=Test passed.

Change-Id: Ic5a6a9b5c78a969899df7c7a82f1c9d0c01b1325
Reviewed-on: https://gerrit.chromium.org/gerrit/25831
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Tested-by: Vic Yang <victoryang@chromium.org>
Commit-Ready: Vic Yang <victoryang@chromium.org>
2012-06-25 08:39:13 -07:00
Vic Yang
7eabcb4e69 Add a test of checking power button handling
This test checks power button is correctly debounced, and also check
power button press of different length are handled correctly.

BUG=chrome-os-partner:10273
TEST=Test passed

Change-Id: I18595c60896255d36326731d28bab55e64c6bca2
Reviewed-on: https://gerrit.chromium.org/gerrit/25505
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Tested-by: Vic Yang <victoryang@chromium.org>
Commit-Ready: Vic Yang <victoryang@chromium.org>
2012-06-25 07:15:52 -07:00
Vic Yang
7ae80c0552 Thermal engine unit test
This test checks for the functionality of thermal engine.

BUG=chrome-os-partner:10241
TEST=Test passed
     Disable thermal engine overheating warning and test failed

Change-Id: Ideb0ff9ee4bd1617b11c56dfa2578a3f406381ff
Reviewed-on: https://gerrit.chromium.org/gerrit/25370
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Tested-by: Vic Yang <victoryang@chromium.org>
Commit-Ready: Vic Yang <victoryang@chromium.org>
2012-06-25 07:15:50 -07:00
Vic Yang
b8be40607e Add a test of checking timer value when system jump
This test checks the sanity of timer value when jumping between images.

BUG=chrome-os-partner:9188
TEST=Test passed

Change-Id: If264e28e4ceec6ddb8325f3496825a40e7a038d8
Reviewed-on: https://gerrit.chromium.org/gerrit/25371
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Commit-Ready: Vic Yang <victoryang@chromium.org>
Tested-by: Vic Yang <victoryang@chromium.org>
2012-06-15 23:54:45 -07:00
Vincent Palatin
c4ac74a11d fix QEMU OS tests
- update strings which were modified by the message text "compression"
- updated QEMU which supports a couple of additional registers for LM4F
(getting internal oscillator calibration status and writing timer
counter through TAV)

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

BUG=chrome-os-partner:10008
TEST=make qemu-tests

Change-Id: Idf0ee13f354b4e14405e949861d426f3e4c3022b
Reviewed-on: https://gerrit.chromium.org/gerrit/24827
Reviewed-by: Vic Yang <victoryang@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
Commit-Ready: Vincent Palatin <vpalatin@chromium.org>
2012-06-07 20:01:49 -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
Randall Spangler
e9328ac4f6 Support dynamically changing the system clock
Add nopll command to turn off the PLL, reducing the system clock to 16Mhz.

Signed-off-by: Randall Spangler <rspangler@chromium.org>

BUG=chrome-os-partner:8798
TEST=manual

boot system
press power button to boot x86
temps   // should print all temperatures
timerinfo
timerinfo
timerinfo  // convince yourself this is counting up at about 1MHz
nopll  // this drops the system clock to 16MHz
temps   // should still print all temperatures
timerinfo
timerinfo
timerinfo  // should still be counting up at about 1MHz

Change-Id: Ie29ceb17af348148bffadf63d60c1b731f4c3f6d
2012-04-09 10:33:35 -07:00
Randall Spangler
a61d8db3d3 Change task messages to events
Signed-off-by: Randall Spangler <rspangler@chromium.org>

BUG=chrome-os-partner:7461
TEST=manual

make BOARD={bds,link,daisy}
make tests
flash link system and make sure it boots

Change-Id: I1241a1895c083e387e38ddab01ac346ca4474eb9
2012-04-06 09:06:53 -07:00
Vincent Palatin
a191591cf0 Update test scripts
Update test python scripts for recent trace modifications :
 - lack of firmware B
 - updated motd

Update QEMU to deal gracefully with various new registers accesses.

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

BUG=None
TEST=make qemu-tests

Change-Id: I59a53822193b7377fe5f61f75c951b6cd24fc54b
2012-03-15 21:25:48 +00:00
Vincent Palatin
40528fe87f fix test compilation for STM32L
There is no host command yet and the "hello" test is not using it.

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

BUG=None
TEST=make tests BOARD=discovery && make tests BOARD=link

Change-Id: Ib7f49f8e38270a8c537e352396b1966abc801511
2012-02-02 22:02:06 +00:00
Vincent Palatin
47c740e0b2 mutex: add unit testing
Exercise all basic use cases on mutexes.

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

BUG=None
TEST=make qemu-tests

Change-Id: I40de3ae59862db96b40a067c9ad54a978f5646b8
2012-01-25 18:23:48 +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
Vincent Palatin
e80eb4d558 Fix tests compilation
add newly added tasks.

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

BUG=None
TEST=make tests ; make qemu-tests

Change-Id: Ia0719303e20d4bc1befc7a9bb13df49a063df11a
2012-01-04 17:38:42 +00:00
Randall Spangler
84a286b1f4 Use #defined constants for IRQ names
Signed-off-by: Randall Spangler <rspangler@chromium.org>

BUG=none
TEST=none

Change-Id: If07ac671cef6b9d0e9fe0a96bf04455a3d2626ff
2011-12-19 13:48:05 -08:00
Randall Spangler
caba91fe27 Change register.h macros to use inline funcs without concatenate (##).
Signed-off-by: Randall Spangler <rspangler@chromium.org>

BUG=none
TEST=none

Change-Id: Ia8c54bfeff2351e8f76d97db558952a9d2ca9a45
2011-12-13 09:50:53 -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