blob: 1e32ed8637d7c0c578007f77936779119353d059 [file] [log] [blame]
Aaron Durbin9a7d7bc2013-09-07 00:41:48 -05001/*
2 * This file is part of the coreboot project.
3 *
Duncan Lauried8c4f2b2014-04-22 10:46:06 -07004 * Copyright (C) 2014 Google Inc.
Aaron Durbin9a7d7bc2013-09-07 00:41:48 -05005 *
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 Durbin9a7d7bc2013-09-07 00:41:48 -050014 */
15
Duncan Lauried8c4f2b2014-04-22 10:46:06 -070016#ifndef _COMMON_NVM_H_
17#define _COMMON_NVM_H_
Aaron Durbin9a7d7bc2013-09-07 00:41:48 -050018
Aaron Durbin31be2c92016-12-03 22:08:20 -060019#include <commonlib/region.h>
Aaron Durbin9a7d7bc2013-09-07 00:41:48 -050020
Duncan Lauriea32b6b92015-01-15 15:49:07 -080021/* Determine if flash device is write protected */
22int nvm_is_write_protected(void);
23
24/* Apply protection to a range of flash */
Aaron Durbin31be2c92016-12-03 22:08:20 -060025int nvm_protect(const struct region *region);
Alexandru Gagniuc92206412016-03-03 10:58:30 -080026
Duncan Lauried8c4f2b2014-04-22 10:46:06 -070027#endif /* _COMMON_NVM_H_ */