Skip to content

Commit d3d334c

Browse files
GTLin08kartben
authored andcommitted
drivers/bbram: Enable bbram driver for it51xxx series
The BBRAM driver of it51xxx is compatible with it8xxx2. Signed-off-by: Tim Lin <[email protected]>
1 parent 16f2b2f commit d3d334c

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

dts/riscv/ite/it51xxx.dtsi

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -971,6 +971,14 @@
971971
#wuc-cells = <1>;
972972
};
973973

974+
bbram: bb-ram@f02200 {
975+
#address-cells = <1>;
976+
#size-cells = <1>;
977+
compatible = "ite,it8xxx2-bbram";
978+
status = "okay";
979+
reg = <0x00f02200 0x80>;
980+
};
981+
974982
i2cbase: i2cbase@f04100 {
975983
compatible = "ite,it51xxx-i2cbase";
976984
reg = <0x00f04100 1

soc/ite/ec/it51xxx/chip_chipregs.h

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,24 @@ struct gctrl_it51xxx_regs {
339339
#define gctrl_ite_ec_regs gctrl_it51xxx_regs
340340
#define GCTRL_ITE_EC_REGS_BASE GCTRL_IT51XXX_REGS_BASE
341341

342+
/**
343+
*
344+
* (22xxh) Battery-backed SRAM (BRAM) registers
345+
*
346+
*/
347+
#ifndef __ASSEMBLER__
348+
/* Battery backed RAM indices. */
349+
#define BRAM_MAGIC_FIELD_OFFSET 0x7c
350+
351+
enum bram_indices {
352+
/* This field is used to indicate BRAM is valid or not. */
353+
BRAM_IDX_VALID_FLAGS0 = BRAM_MAGIC_FIELD_OFFSET,
354+
BRAM_IDX_VALID_FLAGS1,
355+
BRAM_IDX_VALID_FLAGS2,
356+
BRAM_IDX_VALID_FLAGS3
357+
};
358+
#endif /* !__ASSEMBLER__ */
359+
342360
/**
343361
*
344362
* (42xxh) SMBus Interface for target (SMB) registers

0 commit comments

Comments
 (0)