summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--chip/it83xx/ec2i_chip.h2
-rw-r--r--chip/it83xx/lpc.c6
2 files changed, 4 insertions, 4 deletions
diff --git a/chip/it83xx/ec2i_chip.h b/chip/it83xx/ec2i_chip.h
index 7b9fe1cf4e..47417c050a 100644
--- a/chip/it83xx/ec2i_chip.h
+++ b/chip/it83xx/ec2i_chip.h
@@ -11,7 +11,7 @@
#define P80L_P80LB 0
#define P80L_P80LE 0x3F
#define P80L_P80LC 0
-#define P80L_BRAM_BANK1_MAX_SIZE 0x3F
+#define P80L_BRAM_BANK1_SIZE_MASK 0x3F
/* Index list of the host interface registers of PNPCFG */
enum host_pnpcfg_index {
diff --git a/chip/it83xx/lpc.c b/chip/it83xx/lpc.c
index 1ffc82d117..3f7dc82a57 100644
--- a/chip/it83xx/lpc.c
+++ b/chip/it83xx/lpc.c
@@ -534,8 +534,8 @@ void pm3_ibf_interrupt(void)
pm_clear_ibf(LPC_HOST_PORT_80H);
/* read OK */
if ((ec2i_r & 0xff00) == EC2I_READ_SUCCESS) {
- new_p80_idx = ec2i_r & P80L_BRAM_BANK1_MAX_SIZE;
- for (i = 0; i < P80L_BRAM_BANK1_MAX_SIZE; i++) {
+ new_p80_idx = ec2i_r & P80L_BRAM_BANK1_SIZE_MASK;
+ for (i = 0; i < (P80L_P80LE - P80L_P80LB + 1); i++) {
if (++p80l_index > P80L_P80LE)
p80l_index = P80L_P80LB;
port_80_write(IT83XX_BRAM_BANK1(p80l_index));
@@ -668,7 +668,7 @@ static void lpc_init(void)
ec2i_r = ec2i_read(HOST_INDEX_DSLDC6);
/* read OK */
if ((ec2i_r & 0xff00) == EC2I_READ_SUCCESS)
- p80l_index = ec2i_r & P80L_BRAM_BANK1_MAX_SIZE;
+ p80l_index = ec2i_r & P80L_BRAM_BANK1_SIZE_MASK;
}
/*