ITE: drivers/bbram: add magic number to compare in initial

BBRAM content should be cleared when boot from cutoff. Compare magic
number to decide whether to clear entire BBRAM.

Signed-off-by: Tim Lin <tim2.lin@ite.corp-partner.google.com>
This commit is contained in:
Tim Lin 2021-12-24 17:33:39 +08:00 committed by Anas Nashif
commit 95ba8e3fe4
2 changed files with 49 additions and 2 deletions

View file

@ -1,4 +1,4 @@
/*
/*
* Copyright (c) 2020 ITE Corporation. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/
@ -1876,6 +1876,24 @@ struct gctrl_it8xxx2_regs {
/* bit[2] = 1: Enable global reset. */
#define IT8XXX2_GCTRL_GRST BIT(2)
/**
*
* (22xxh) Battery-backed SRAM (BRAM) registers
*
*/
#ifndef __ASSEMBLER__
/* Battery backed RAM indices. */
#define BRAM_MAGIC_FIELD_OFFSET 0xbc
enum bram_indices {
/* This field is used to indicate BRAM is valid or not. */
BRAM_IDX_VALID_FLAGS0 = BRAM_MAGIC_FIELD_OFFSET,
BRAM_IDX_VALID_FLAGS1,
BRAM_IDX_VALID_FLAGS2,
BRAM_IDX_VALID_FLAGS3
};
#endif /* !__ASSEMBLER__ */
#ifndef __ASSEMBLER__
/*
* EC2I bridge registers