diff --git a/firmware/include/utility.h b/firmware/include/utility.h index ddfd3d1841..931789cbf7 100644 --- a/firmware/include/utility.h +++ b/firmware/include/utility.h @@ -43,6 +43,13 @@ #define VbAssert(expr) #endif +/* Optional, up to the BIOS */ +#ifdef VBOOT_EASTER_EGG +#define VBEASTEREGG(A,B) VbExEasterEgg(A,B) +#else +#define VBEASTEREGG(A,B) +#endif + /* Combine [msw] and [lsw] uint16s to a uint32_t with its [msw] and * [lsw] forming the most and least signficant 16-bit words. */ diff --git a/firmware/lib/include/vboot_display.h b/firmware/lib/include/vboot_display.h index 57688aed90..8dc22606f9 100644 --- a/firmware/lib/include/vboot_display.h +++ b/firmware/lib/include/vboot_display.h @@ -19,5 +19,7 @@ VbError_t VbDisplayDebugInfo(VbCommonParams* cparams, VbNvContext *vncptr); VbError_t VbCheckDisplayKey(VbCommonParams* cparams, uint32_t key, VbNvContext *vncptr); +void VbExEasterEgg(VbCommonParams* cparams, VbNvContext *vncptr); + #endif /* VBOOT_REFERENCE_VBOOT_DISPLAY_H_ */ diff --git a/firmware/lib/vboot_api_kernel.c b/firmware/lib/vboot_api_kernel.c index 99ad799976..ed2881039f 100644 --- a/firmware/lib/vboot_api_kernel.c +++ b/firmware/lib/vboot_api_kernel.c @@ -109,7 +109,7 @@ VbError_t VbBootNormal(VbCommonParams* cparams, LoadKernelParams* p) { /* Developer mode delays. All must be multiples of DEV_DELAY_INCREMENT */ #define DEV_DELAY_INCREMENT 250 /* Delay each loop, in msec */ #define DEV_DELAY_BEEP1 20000 /* Beep for first time at this time */ -#define DEV_DELAY_BEEP2 21000 /* Beep for second time at this time */ +#define DEV_DELAY_BEEP2 20500 /* Beep for second time at this time */ #define DEV_DELAY_TIMEOUT 30000 /* Give up at this time */ #define DEV_DELAY_TIMEOUT_SHORT 2000 /* Give up at this time (short delay) */ @@ -153,7 +153,7 @@ VbError_t VbBootDeveloper(VbCommonParams* cparams, LoadKernelParams* p) { case ' ': case 0x1B: /* Enter, space, or ESC = reboot to recovery */ - VBDEBUG(("VbBootDeveloper() - user pressed ENTER/SPACE/ESC")); + VBDEBUG(("VbBootDeveloper() - user pressed ENTER/SPACE/ESC\n")); VbSetRecoveryRequest(VBNV_RECOVERY_RW_DEV_SCREEN); return 1; case 0x04: @@ -185,7 +185,6 @@ VbError_t VbBootDeveloper(VbCommonParams* cparams, LoadKernelParams* p) { default: VbCheckDisplayKey(cparams, key, &vnc); break; - /* TODO: xyzzy easter egg check */ } } diff --git a/firmware/lib/vboot_display.c b/firmware/lib/vboot_display.c index 9d759a8660..b09c77485a 100644 --- a/firmware/lib/vboot_display.c +++ b/firmware/lib/vboot_display.c @@ -461,8 +461,19 @@ VbError_t VbDisplayDebugInfo(VbCommonParams* cparams, VbNvContext *vncptr) { } +#define MAGIC_WORD_LEN 5 +#define MAGIC_WORD "xyzzy" +static uint8_t MagicBuffer[MAGIC_WORD_LEN]; + VbError_t VbCheckDisplayKey(VbCommonParams* cparams, uint32_t key, VbNvContext *vncptr) { + int i; + + /* Update key buffer */ + for(i=1; i