blob: 3964a9508c0c213abd35e6dca725676b91362389 [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.
Aaron Durbinc6588c52015-05-15 13:15:34 -050014 */
15
16#ifndef _BOOT_DEVICE_H_
17#define _BOOT_DEVICE_H_
18
Aaron Durbindc9f5cd2015-09-08 13:34:43 -050019#include <commonlib/region.h>
Aaron Durbinc6588c52015-05-15 13:15:34 -050020
21/* Return the region_device for the read-only boot device. */
22const struct region_device *boot_device_ro(void);
23
24/*
25 * Create a sub-region of the read-only boot device.
26 * Returns 0 on success, < 0 on error.
27 */
28int boot_device_ro_subregion(const struct region *sub,
29 struct region_device *subrd);
30
31/*
32 * Initialize the boot device. This may be called multiple times within
33 * a stage so boot device implementations should account for this behavior.
34 **/
35void boot_device_init(void);
36
37#endif /* _BOOT_DEVICE_H_ */