aboutsummaryrefslogtreecommitdiff
path: root/src/soc/intel/common/nvm.h
diff options
context:
space:
mode:
authorAaron Durbin <adurbin@chromium.org>2016-12-03 22:08:20 -0600
committerAaron Durbin <adurbin@chromium.org>2016-12-15 07:51:35 +0100
commit31be2c969eed74510c3546bad0dbb9a7334f5843 (patch)
treea7b5d682bfe421a34454d320ec78d04e6911f71b /src/soc/intel/common/nvm.h
parentf1f322b1a883e3d50a1907e29b5aa333a0f795a8 (diff)
soc/intel/common: remove mrc cache assumptions
Update the mrc cache implementation to use region_file. Instead of relying on memory-mapped access and pointer arithmetic use the region_devices and region_file to obtain the latest data associated with the region. This removes the need for the nvm wrapper as the region_devices can be used directly. Thus, the library is more generic and can be extended to work on different boot mediums. BUG=chrome-os-partner:56151 Change-Id: Ic14e2d2f7339e50256b4a3a297fc33991861ca44 Signed-off-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: https://review.coreboot.org/17717 Tested-by: build bot (Jenkins) Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
Diffstat (limited to 'src/soc/intel/common/nvm.h')
-rw-r--r--src/soc/intel/common/nvm.h16
1 files changed, 2 insertions, 14 deletions
diff --git a/src/soc/intel/common/nvm.h b/src/soc/intel/common/nvm.h
index 074a2ce406..1e32ed8637 100644
--- a/src/soc/intel/common/nvm.h
+++ b/src/soc/intel/common/nvm.h
@@ -16,24 +16,12 @@
#ifndef _COMMON_NVM_H_
#define _COMMON_NVM_H_
-#include <stddef.h>
-
-/* Determine if area is erased. returns 1 if erased. 0 otherwise. */
-int nvm_is_erased(const void *start, size_t size);
-
-/* Erase region according to start and size. Returns < 0 on error else 0. */
-int nvm_erase(void *start, size_t size);
-
-/* Write data to NVM. Returns 0 on success < 0 on error. */
-int nvm_write(void *start, const void *data, size_t size);
+#include <commonlib/region.h>
/* Determine if flash device is write protected */
int nvm_is_write_protected(void);
/* Apply protection to a range of flash */
-int nvm_protect(void *start, size_t size);
-
-/* Map MMIO address to actual address in flash */
-uint32_t nvm_mmio_to_flash_offset(void *p);
+int nvm_protect(const struct region *region);
#endif /* _COMMON_NVM_H_ */