Add basic support for IT5571E

The IT5571E is nearly identical to the IT5570E.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
This commit is contained in:
Tim Crawford
2023-08-14 20:15:53 -06:00
committed by Tim Crawford
parent 13dd6a1038
commit dc482dd11a
12 changed files with 16 additions and 12 deletions

View File

@ -26,7 +26,7 @@ void pwm_init(void) {
// Turn off CPU fan (temperature control in peci_get_fan_duty) // Turn off CPU fan (temperature control in peci_get_fan_duty)
DCR2 = 0; 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 // Reload counters when they reach 0 instead of immediately
PWMLCCR = 0xFF; PWMLCCR = 0xFF;
#endif #endif

View File

@ -17,7 +17,7 @@ void ec_init(void) {
} }
void ec_read_post_codes(void) { void ec_read_post_codes(void) {
#if CONFIG_EC_ITE_IT5570E #if CONFIG_EC_ITE_IT5570E || CONFIG_EC_ITE_IT5571E
while (P80H81HS & 1) { while (P80H81HS & 1) {
uint8_t p80h = P80HD; uint8_t p80h = P80HD;
uint8_t p81h = P81HD; uint8_t p81h = P81HD;

View File

@ -21,6 +21,10 @@ CFLAGS+=-DCONFIG_EC_ITE_IT5570E=1
# 0x0E00-0x1000 is used for AP communication. So this is brought down to 2048, # 0x0E00-0x1000 is used for AP communication. So this is brought down to 2048,
# which matches IT8587E limits # which matches IT8587E limits
SRAM_SIZE=2048 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 else
$(error Unsupported EC) $(error Unsupported EC)
endif endif

View File

@ -2,7 +2,7 @@
#include <ec/espi.h> #include <ec/espi.h>
#if CONFIG_EC_ITE_IT5570E #if CONFIG_EC_ITE_IT5570E || CONFIG_EC_ITE_IT5571E
// Not all wires are defined or implemented // Not all wires are defined or implemented
// Index 2 - AP to EC // Index 2 - AP to EC
@ -68,4 +68,4 @@ void vw_set(struct VirtualWire *vw, enum VirtualWireState state) __critical {
*vw->index = index; *vw->index = index;
} }
#endif // CONFIG_EC_ITE_IT5570E #endif // CONFIG_EC_ITE_IT5570E || CONFIG_EC_ITE_IT5571E

View File

@ -32,7 +32,7 @@ struct I2C __code I2C_1 = {
.trasla = TRASLAB, .trasla = TRASLAB,
}; };
#if CONFIG_EC_ITE_IT5570E #if CONFIG_EC_ITE_IT5570E || CONFIG_EC_ITE_IT5571E
struct I2C __code I2C_4 = { struct I2C __code I2C_4 = {
.hosta = HOSTAE, .hosta = HOSTAE,
.hoctl = HOCTLE, .hoctl = HOCTLE,

View File

@ -8,7 +8,7 @@
volatile uint8_t __xdata __at(0x2006) RSTS; volatile uint8_t __xdata __at(0x2006) RSTS;
volatile uint8_t __xdata __at(0x200A) BADRSEL; volatile uint8_t __xdata __at(0x200A) BADRSEL;
volatile uint8_t __xdata __at(0x200D) SPCTRL1; 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(0x2030) P80H81HS;
volatile uint8_t __xdata __at(0x2031) P80HD; volatile uint8_t __xdata __at(0x2031) P80HD;
volatile uint8_t __xdata __at(0x2032) P81HD; volatile uint8_t __xdata __at(0x2032) P81HD;

View File

@ -58,7 +58,7 @@ volatile uint8_t __xdata __at(0x16FE) GCR15;
volatile uint8_t __xdata __at(0x16E0) GCR16; volatile uint8_t __xdata __at(0x16E0) GCR16;
volatile uint8_t __xdata __at(0x16E1) GCR17; volatile uint8_t __xdata __at(0x16E1) GCR17;
volatile uint8_t __xdata __at(0x16E2) GCR18; 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(0x16E4) GCR19;
volatile uint8_t __xdata __at(0x16E5) GCR20; volatile uint8_t __xdata __at(0x16E5) GCR20;
volatile uint8_t __xdata __at(0x16E6) GCR21; volatile uint8_t __xdata __at(0x16E6) GCR21;

View File

@ -7,7 +7,7 @@
extern struct I2C __code I2C_0; extern struct I2C __code I2C_0;
extern struct I2C __code I2C_1; 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; extern struct I2C __code I2C_4;
#endif #endif

View File

@ -107,7 +107,7 @@ volatile uint8_t __xdata __at(0x114D) IER18;
volatile uint8_t __xdata __at(0x114E) IELMR18; volatile uint8_t __xdata __at(0x114E) IELMR18;
volatile uint8_t __xdata __at(0x114F) IPOLR18; 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(0x1150) ISR19;
volatile uint8_t __xdata __at(0x1151) IER19; volatile uint8_t __xdata __at(0x1151) IER19;
volatile uint8_t __xdata __at(0x1152) IELMR19; volatile uint8_t __xdata __at(0x1152) IELMR19;

View File

@ -62,7 +62,7 @@ volatile uint8_t __xdata __at(0x1823) ZTIER;
// Tachometer switch control register // Tachometer switch control register
volatile uint8_t __xdata __at(0x1848) TSWCTLR; 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 // PWM Load Counter Control Register
volatile uint8_t __xdata __at(0x185A) PWMLCCR; volatile uint8_t __xdata __at(0x185A) PWMLCCR;
#endif #endif

View File

@ -95,7 +95,7 @@ volatile uint8_t __xdata __at(0x1C44) RESLADR2B;
// SMCLK timing setting for channel B // SMCLK timing setting for channel B
volatile uint8_t __xdata __at(0x1C41) SCLKTSB; 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 // Host status for channel E
volatile uint8_t __xdata __at(0x1CA0) HOSTAE; volatile uint8_t __xdata __at(0x1CA0) HOSTAE;
// Host control for channel E // Host control for channel E

View File

@ -38,7 +38,7 @@ static const struct IrqGroup irqs[] = {
IRQ_GROUP(16), IRQ_GROUP(16),
IRQ_GROUP(17), IRQ_GROUP(17),
IRQ_GROUP(18), IRQ_GROUP(18),
#if CONFIG_EC_ITE_IT5570E #if CONFIG_EC_ITE_IT5570E || CONFIG_EC_ITE_IT5571E
IRQ_GROUP(19), IRQ_GROUP(19),
IRQ_GROUP(20), IRQ_GROUP(20),
IRQ_GROUP(21), IRQ_GROUP(21),