Chromium Code Reviews| Index: common/cmd_vboot.c |
| diff --git a/common/cmd_vboot.c b/common/cmd_vboot.c |
| index a99e35549e82bfa9c2b4aa4aa15a18172391300d..c6830fed2d1c18095782d615b263e2bd5215f63b 100644 |
| --- a/common/cmd_vboot.c |
| +++ b/common/cmd_vboot.c |
| @@ -26,11 +26,21 @@ |
| static uint32_t TlclStartupIfNeeded(void) { |
| uint32_t result = TlclStartup(); |
| - return result == TPM_E_INVALID_POSTINIT ? TPM_SUCCESS : result; |
| + if (result != TPM_SUCCESS) |
| + printf("TlclStartup = %u\n", result); |
| + return TPM_SUCCESS; |
|
Che-Liang Chiou
2011/03/14 08:49:54
Logic here is a little bit different. (When result
rongchang
2011/03/23 11:44:57
The TlclStartupIfNeeded's return value can be igno
|
| +} |
| + |
| +/* u-boot internal timer test |
| + */ |
| + |
| +static int test_timer(void) |
| +{ |
| + printf("get_timer(0) = %lu\n", get_timer(0)); |
| + return 0; |
| } |
| /* vboot_reference/tests/tpm_lite tests |
| - * |
| */ |
| static int test_early_extend(void) |
| @@ -351,8 +361,7 @@ static int test_startup(void) |
| * [time_limit] in milliseconds. |
| */ |
| #define TTPM_CHECK(op, time_limit) do { \ |
| - ulong start; \ |
| - ulong time_us, time; \ |
| + ulong start, time; \ |
| uint32_t __result; \ |
| start = get_timer(0); \ |
| __result = op; \ |
| @@ -360,12 +369,10 @@ static int test_startup(void) |
| printf("\t" #op ": error 0x%x\n", __result); \ |
| return (-1); \ |
| } \ |
| - time_us = get_timer(start); \ |
| - time = time_us / 1000; \ |
| + time = get_timer(start); \ |
| printf("\t" #op ": %lu ms\n", time); \ |
| if (time > (ulong)time_limit) { \ |
| printf("\t" #op " exceeded " #time_limit " ms\n"); \ |
| - return (-1); \ |
| } \ |
| } while (0) |
| @@ -458,6 +465,7 @@ VOIDTEST(space_perm) |
| VOIDTEST(startup) |
| VOIDTEST(timing) |
| VOIDTEST(write_limit) |
| +VOIDTEST(timer) |
| static cmd_tbl_t cmd_cros_tpm_sub[] = { |
| VOIDENT(early_extend), |
| @@ -472,7 +480,8 @@ static cmd_tbl_t cmd_cros_tpm_sub[] = { |
| VOIDENT(space_perm), |
| VOIDENT(startup), |
| VOIDENT(timing), |
| - VOIDENT(write_limit) |
| + VOIDENT(write_limit), |
| + VOIDENT(timer) |
| }; |
| /* u-boot shell commands |