1/* Copyright (c) 2013 The Chromium OS Authors. All rights reserved.
2 * Use of this source code is governed by a BSD-style license that can be
3 * found in the LICENSE file.
4 *
5 * High-level firmware API for loading and verifying rewritable firmware.
6 * (Firmware Portion)
7 */
8
9#ifndef VBOOT_REFERENCE_LOAD_FIRMWARE_FW_H_
10#define VBOOT_REFERENCE_LOAD_FIRMWARE_FW_H_
11
12#include "vboot_api.h"
13#include "vboot_nvstorage.h"
14#include "vboot_struct.h"
15
16/**
17 * Load the rewritable firmware.
18 *
19 * Pass the common and firmware params from VbSelectFirmware(), and a
20 * VbNvContext.  Caller is responsible for calling VbNvSetup() and
21 * VbNvTeardown() on the VbNvContext.
22 *
23 * Returns VBERROR_SUCCESS if successful.  If unsuccessful, sets a recovery
24 * reason via VbNvStorage and returns an error code.
25 */
26int LoadFirmware(VbCommonParams *cparams, VbSelectFirmwareParams *fparams,
27		 VbNvContext *vnc);
28
29#endif  /* VBOOT_REFERENCE_LOAD_FIRMWARE_FW_H_ */
30