Files
OpenCellular/include/vboot.h
Randall Spangler acf6f963a1 Flash pre-init reboots if it needs to clear protection registers
BUG=chrome-os-partner:11171
TEST=manual

1. Clear some of the writable-bits in the flash registers
> ww 0x400fe40c 0xffff1234
write 0x400fe40c = 0xffff1234
> rw 0x400fe40c
read 0x400fe40c = 0xffff1234
2. Reset using power+refresh
3. Register should be clear again
> rw 0x400fe40c
read 0x400fe40c = 0xffffffff
4. Sysinfo should indicate reset-pin reason AND hard-reset reason
> sysinfo
Reset flags: 0x0000000a (reset-pin power-on)
5. Reset using power+refresh
6. Sysinfo should indicate reset-pin reason only
> sysinfo
Reset flags: 0x00000002 (reset-pin)
7. Clear writable-bits again
> ww 0x400fe40c 0xffff1234
write 0x400fe40c = 0xffff1234
8. Jump to another image.  This should NOT trigger a hard reset.
> sysjump A
> sysinfo
Reset flags: 0x00000402 (reset-pin sysjump)

Change-Id: Ie1d6af2acc68217bb82faae464798ee85d63d1ea
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/27540
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
2012-07-16 17:49:10 -07:00

38 lines
984 B
C

/* Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
/* Verified boot module for Chrome EC */
#ifndef __CROS_EC_VBOOT_H
#define __CROS_EC_VBOOT_H
#include "common.h"
/*
* Check verified boot signatures, and jump to one of the RW images if
* necessary.
*/
int vboot_check_signature(void);
/* Initialize the module. */
int vboot_init(void);
/* These are the vboot commands available via LPC. */
enum vboot_command {
VBOOT_CMD_GET_FLAGS,
VBOOT_CMD_SET_FLAGS,
VBOOT_NUM_CMDS,
};
/*
* These are the flags transferred across LPC. At the moment, only the devmode
* flag can be set, and only because it's faked. Ultimately this functionality
* will be moved elsewhere.
*/
#define VBOOT_FLAGS_IMAGE_MASK 0x03 /* enum system_image_copy_t */
#define VBOOT_FLAGS_UNUSED 0x04 /* was fake dev-mode bit */
#endif /* __CROS_EC_VBOOT_H */