blob: 0848ea5bab5c05947d607147777113a282c57513 [file] [log] [blame]
Aaron Durbinc6588c52015-05-15 13:15:34 -05001/*
2 * This file is part of the coreboot project.
3 *
4 * Copyright 2015 Google Inc.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 2 of the License.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc.
18 */
19
20#ifndef _BOOT_DEVICE_H_
21#define _BOOT_DEVICE_H_
22
23#include <region.h>
24
25/* Return the region_device for the read-only boot device. */
26const struct region_device *boot_device_ro(void);
27
28/*
29 * Create a sub-region of the read-only boot device.
30 * Returns 0 on success, < 0 on error.
31 */
32int boot_device_ro_subregion(const struct region *sub,
33 struct region_device *subrd);
34
35/*
36 * Initialize the boot device. This may be called multiple times within
37 * a stage so boot device implementations should account for this behavior.
38 **/
39void boot_device_init(void);
40
41#endif /* _BOOT_DEVICE_H_ */