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:
		
				
					committed by
					
						 Tim Crawford
						Tim Crawford
					
				
			
			
				
	
			
			
			
						parent
						
							13dd6a1038
						
					
				
				
					commit
					dc482dd11a
				
			| @@ -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 | ||||
|   | ||||
| @@ -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; | ||||
|   | ||||
| @@ -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 | ||||
|   | ||||
| @@ -2,7 +2,7 @@ | ||||
|  | ||||
| #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 | ||||
| // 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 | ||||
|   | ||||
| @@ -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, | ||||
|   | ||||
| @@ -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; | ||||
|   | ||||
| @@ -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; | ||||
|   | ||||
| @@ -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 | ||||
|  | ||||
|   | ||||
| @@ -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; | ||||
|   | ||||
| @@ -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 | ||||
|   | ||||
| @@ -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 | ||||
|   | ||||
| @@ -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), | ||||
|   | ||||
		Reference in New Issue
	
	Block a user