aboutsummaryrefslogtreecommitdiff
path: root/src/security/vboot/vbnv_flash.c
diff options
context:
space:
mode:
authorArthur Heymans <arthur@aheymans.xyz>2019-11-20 19:47:10 +0100
committerPatrick Georgi <pgeorgi@google.com>2019-11-29 09:05:04 +0000
commit344e86bb3baff8f89c1335c190dbee050176e058 (patch)
tree31d3d610d0cd1b5bad9f96d8513f896b3c949404 /src/security/vboot/vbnv_flash.c
parent7255610d9fe0867de50add6890653f14da676c06 (diff)
security/vboot: Drop CAR_GLOBAL_MIGRATION support
Change-Id: I9dee03da028b9111b685e325368815a86e444a47 Signed-off-by: Arthur Heymans <arthur@aheymans.xyz> Reviewed-on: https://review.coreboot.org/c/coreboot/+/37028 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Diffstat (limited to 'src/security/vboot/vbnv_flash.c')
-rw-r--r--src/security/vboot/vbnv_flash.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/security/vboot/vbnv_flash.c b/src/security/vboot/vbnv_flash.c
index 86c43cd302..58d3aba2a7 100644
--- a/src/security/vboot/vbnv_flash.c
+++ b/src/security/vboot/vbnv_flash.c
@@ -13,7 +13,6 @@
* GNU General Public License for more details.
*/
-#include <arch/early_variables.h>
#include <commonlib/region.h>
#include <console/console.h>
#include <fmap.h>
@@ -41,7 +40,7 @@ struct vbnv_flash_ctx {
/* Cache of the current nvdata */
uint8_t cache[BLOB_SIZE];
};
-static struct vbnv_flash_ctx vbnv_flash CAR_GLOBAL;
+static struct vbnv_flash_ctx vbnv_flash;
/*
* This code assumes that flash is erased to 1-bits, and write operations can
@@ -60,7 +59,7 @@ static inline int can_overwrite(uint8_t current, uint8_t new)
static int init_vbnv(void)
{
- struct vbnv_flash_ctx *ctx = car_get_var_ptr(&vbnv_flash);
+ struct vbnv_flash_ctx *ctx = &vbnv_flash;
struct region_device *rdev = &ctx->vbnv_dev;
uint8_t buf[BLOB_SIZE];
uint8_t empty_blob[BLOB_SIZE];
@@ -116,7 +115,7 @@ static int init_vbnv(void)
static int erase_nvram(void)
{
- struct vbnv_flash_ctx *ctx = car_get_var_ptr(&vbnv_flash);
+ struct vbnv_flash_ctx *ctx = &vbnv_flash;
const struct region_device *rdev = &ctx->vbnv_dev;
if (rdev_eraseat(rdev, 0, region_device_sz(rdev)) < 0) {
@@ -130,7 +129,7 @@ static int erase_nvram(void)
void read_vbnv_flash(uint8_t *vbnv_copy)
{
- struct vbnv_flash_ctx *ctx = car_get_var_ptr(&vbnv_flash);
+ struct vbnv_flash_ctx *ctx = &vbnv_flash;
if (!ctx->initialized)
if (init_vbnv())
@@ -141,7 +140,7 @@ void read_vbnv_flash(uint8_t *vbnv_copy)
void save_vbnv_flash(const uint8_t *vbnv_copy)
{
- struct vbnv_flash_ctx *ctx = car_get_var_ptr(&vbnv_flash);
+ struct vbnv_flash_ctx *ctx = &vbnv_flash;
int new_offset;
int i;
const struct region_device *rdev = &ctx->vbnv_dev;