Files
OpenCellular/common/vboot.c
Randall Spangler 42187535e4 Remove fake dev switch
BUG=chrome-os-partner:9922
TEST=manual

Press power+refresh+d.
From ec console, 'optget'.  No reference to fake dev switch
From host, 'ectool vboot'.  Should see either 'fake_dev=0' or no mention of fake dev switch at all.

Change-Id: I66bc5e926d6e639b206563e764bcc730cce9227c
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/27061
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
2012-07-10 14:56:05 -07:00

53 lines
1.3 KiB
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 */
#include "board.h"
#include "config.h"
#include "console.h"
#include "eoption.h"
#include "host_command.h"
#include "system.h"
#include "vboot.h"
/* Console output macros */
#define CPUTS(outstr) cputs(CC_VBOOT, outstr)
#define CPRINTF(format, args...) cprintf(CC_VBOOT, format, ## args)
int vboot_pre_init(void)
{
/* FIXME(wfrichar): crosbug.com/p/7453: should protect flash */
return EC_SUCCESS;
}
/****************************************************************************/
/* Host commands */
static int host_cmd_vboot(uint8_t *data, int *resp_size)
{
struct ec_params_vboot_cmd *ptr =
(struct ec_params_vboot_cmd *)data;
uint8_t v;
switch (ptr->in.cmd) {
case VBOOT_CMD_GET_FLAGS:
v = VBOOT_FLAGS_IMAGE_MASK & system_get_image_copy();
ptr->out.get_flags.val = v;
*resp_size = sizeof(struct ec_params_vboot_cmd);
break;
case VBOOT_CMD_SET_FLAGS:
v = ptr->in.set_flags.val;
break;
default:
CPRINTF("[%T LB bad cmd 0x%x]\n", ptr->in.cmd);
return EC_RES_INVALID_PARAM;
}
return EC_RES_SUCCESS;
}
DECLARE_HOST_COMMAND(EC_CMD_VBOOT_CMD, host_cmd_vboot);