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