diff --git a/src/board/system76/common/pwm.c b/src/board/system76/common/pwm.c index 4135913..44e1449 100644 --- a/src/board/system76/common/pwm.c +++ b/src/board/system76/common/pwm.c @@ -26,7 +26,7 @@ void pwm_init(void) { // Turn off CPU fan (temperature control in peci_get_fan_duty) DCR2 = 0; -#if CONFIG_EC_ITE_IT5570E +#if CONFIG_EC_ITE_IT5570E || CONFIG_EC_ITE_IT5571E // Reload counters when they reach 0 instead of immediately PWMLCCR = 0xFF; #endif diff --git a/src/ec/ite/ec.c b/src/ec/ite/ec.c index 8e43d0a..4553e97 100644 --- a/src/ec/ite/ec.c +++ b/src/ec/ite/ec.c @@ -17,7 +17,7 @@ void ec_init(void) { } void ec_read_post_codes(void) { -#if CONFIG_EC_ITE_IT5570E +#if CONFIG_EC_ITE_IT5570E || CONFIG_EC_ITE_IT5571E while (P80H81HS & 1) { uint8_t p80h = P80HD; uint8_t p81h = P81HD; diff --git a/src/ec/ite/ec.mk b/src/ec/ite/ec.mk index 2a4608b..e131993 100644 --- a/src/ec/ite/ec.mk +++ b/src/ec/ite/ec.mk @@ -21,6 +21,10 @@ CFLAGS+=-DCONFIG_EC_ITE_IT5570E=1 # 0x0E00-0x1000 is used for AP communication. So this is brought down to 2048, # which matches IT8587E limits SRAM_SIZE=2048 +else ifeq ($(CONFIG_EC_ITE_IT5571E), y) +# The IT5571E is effectively the same as the IT5570E. +CFLAGS+=-DCONFIG_EC_ITE_IT5571E=1 +SRAM_SIZE=2048 else $(error Unsupported EC) endif diff --git a/src/ec/ite/espi.c b/src/ec/ite/espi.c index 0ad66d5..98ba571 100644 --- a/src/ec/ite/espi.c +++ b/src/ec/ite/espi.c @@ -2,7 +2,7 @@ #include -#if CONFIG_EC_ITE_IT5570E +#if CONFIG_EC_ITE_IT5570E || CONFIG_EC_ITE_IT5571E // Not all wires are defined or implemented // Index 2 - AP to EC @@ -68,4 +68,4 @@ void vw_set(struct VirtualWire *vw, enum VirtualWireState state) __critical { *vw->index = index; } -#endif // CONFIG_EC_ITE_IT5570E +#endif // CONFIG_EC_ITE_IT5570E || CONFIG_EC_ITE_IT5571E diff --git a/src/ec/ite/i2c.c b/src/ec/ite/i2c.c index 30f4ae6..c9fe9fe 100644 --- a/src/ec/ite/i2c.c +++ b/src/ec/ite/i2c.c @@ -32,7 +32,7 @@ struct I2C __code I2C_1 = { .trasla = TRASLAB, }; -#if CONFIG_EC_ITE_IT5570E +#if CONFIG_EC_ITE_IT5570E || CONFIG_EC_ITE_IT5571E struct I2C __code I2C_4 = { .hosta = HOSTAE, .hoctl = HOCTLE, diff --git a/src/ec/ite/include/ec/gctrl.h b/src/ec/ite/include/ec/gctrl.h index ba2b79b..ee0504a 100644 --- a/src/ec/ite/include/ec/gctrl.h +++ b/src/ec/ite/include/ec/gctrl.h @@ -8,7 +8,7 @@ volatile uint8_t __xdata __at(0x2006) RSTS; volatile uint8_t __xdata __at(0x200A) BADRSEL; volatile uint8_t __xdata __at(0x200D) SPCTRL1; -#if CONFIG_EC_ITE_IT5570E +#if CONFIG_EC_ITE_IT5570E || CONFIG_EC_ITE_IT5571E volatile uint8_t __xdata __at(0x2030) P80H81HS; volatile uint8_t __xdata __at(0x2031) P80HD; volatile uint8_t __xdata __at(0x2032) P81HD; diff --git a/src/ec/ite/include/ec/gpio.h b/src/ec/ite/include/ec/gpio.h index e821b63..b7b9391 100644 --- a/src/ec/ite/include/ec/gpio.h +++ b/src/ec/ite/include/ec/gpio.h @@ -58,7 +58,7 @@ volatile uint8_t __xdata __at(0x16FE) GCR15; volatile uint8_t __xdata __at(0x16E0) GCR16; volatile uint8_t __xdata __at(0x16E1) GCR17; volatile uint8_t __xdata __at(0x16E2) GCR18; -#if CONFIG_EC_ITE_IT5570E +#if CONFIG_EC_ITE_IT5570E || CONFIG_EC_ITE_IT5571E volatile uint8_t __xdata __at(0x16E4) GCR19; volatile uint8_t __xdata __at(0x16E5) GCR20; volatile uint8_t __xdata __at(0x16E6) GCR21; diff --git a/src/ec/ite/include/ec/i2c.h b/src/ec/ite/include/ec/i2c.h index fdb19ac..4b2a947 100644 --- a/src/ec/ite/include/ec/i2c.h +++ b/src/ec/ite/include/ec/i2c.h @@ -7,7 +7,7 @@ extern struct I2C __code I2C_0; extern struct I2C __code I2C_1; -#if CONFIG_EC_ITE_IT5570E +#if CONFIG_EC_ITE_IT5570E || CONFIG_EC_ITE_IT5571E extern struct I2C __code I2C_4; #endif diff --git a/src/ec/ite/include/ec/intc.h b/src/ec/ite/include/ec/intc.h index 34fb1d2..99fc81a 100644 --- a/src/ec/ite/include/ec/intc.h +++ b/src/ec/ite/include/ec/intc.h @@ -107,7 +107,7 @@ volatile uint8_t __xdata __at(0x114D) IER18; volatile uint8_t __xdata __at(0x114E) IELMR18; volatile uint8_t __xdata __at(0x114F) IPOLR18; -#if CONFIG_EC_ITE_IT5570E +#if CONFIG_EC_ITE_IT5570E || CONFIG_EC_ITE_IT5571E volatile uint8_t __xdata __at(0x1150) ISR19; volatile uint8_t __xdata __at(0x1151) IER19; volatile uint8_t __xdata __at(0x1152) IELMR19; diff --git a/src/ec/ite/include/ec/pwm.h b/src/ec/ite/include/ec/pwm.h index 43b96fb..89ded7b 100644 --- a/src/ec/ite/include/ec/pwm.h +++ b/src/ec/ite/include/ec/pwm.h @@ -62,7 +62,7 @@ volatile uint8_t __xdata __at(0x1823) ZTIER; // Tachometer switch control register volatile uint8_t __xdata __at(0x1848) TSWCTLR; -#if CONFIG_EC_ITE_IT5570E +#if CONFIG_EC_ITE_IT5570E || CONFIG_EC_ITE_IT5571E // PWM Load Counter Control Register volatile uint8_t __xdata __at(0x185A) PWMLCCR; #endif diff --git a/src/ec/ite/include/ec/smbus.h b/src/ec/ite/include/ec/smbus.h index 75d0b40..586af4a 100644 --- a/src/ec/ite/include/ec/smbus.h +++ b/src/ec/ite/include/ec/smbus.h @@ -95,7 +95,7 @@ volatile uint8_t __xdata __at(0x1C44) RESLADR2B; // SMCLK timing setting for channel B volatile uint8_t __xdata __at(0x1C41) SCLKTSB; -#if CONFIG_EC_ITE_IT5570E +#if CONFIG_EC_ITE_IT5570E || CONFIG_EC_ITE_IT5571E // Host status for channel E volatile uint8_t __xdata __at(0x1CA0) HOSTAE; // Host control for channel E diff --git a/src/ec/ite/intc.c b/src/ec/ite/intc.c index bbe000f..da7d512 100644 --- a/src/ec/ite/intc.c +++ b/src/ec/ite/intc.c @@ -38,7 +38,7 @@ static const struct IrqGroup irqs[] = { IRQ_GROUP(16), IRQ_GROUP(17), IRQ_GROUP(18), -#if CONFIG_EC_ITE_IT5570E +#if CONFIG_EC_ITE_IT5570E || CONFIG_EC_ITE_IT5571E IRQ_GROUP(19), IRQ_GROUP(20), IRQ_GROUP(21),