1 /* SPDX-License-Identifier: GPL-2.0-only */ 2 3 #ifndef SCH5545_BOARD_EC_H 4 #define SCH5545_BOARD_EC_H 5 6 #include <stdint.h> 7 8 #define READ_OP 0 9 #define WRITE_OP 1 10 11 #define EC_HWM_LDN 1 12 #define EC_GPIO_LDN 2 13 14 /* EC GPIO configuration */ 15 #define EC_GPIO_PP (0 << 0) 16 #define EC_GPIO_OD (1 << 0) 17 #define EC_GPIO_FUNC0 (0 << 4) 18 #define EC_GPIO_FUNC1 (1 << 4) 19 #define EC_GPIO_FUNC2 (2 << 4) 20 #define EC_GPIO_FUNC3 (3 << 4) 21 22 struct ec_val_reg { 23 uint8_t val; 24 uint16_t reg; 25 }; 26 27 enum { 28 TDP_16 = 0x10, 29 TDP_32 = 0x20, 30 TDP_COMMON = 0xff, 31 }; 32 33 typedef struct ec_val_reg_tdp { 34 uint8_t val; 35 uint16_t reg; 36 uint8_t tdp; 37 } ec_chassis_tdp_t; 38 39 uint16_t sch5545_get_ec_fw_version(void); 40 void sch5545_update_ec_firmware(uint16_t ec_version); 41 void sch5545_ec_early_init(void); 42 void sch5545_ec_hwm_early_init(void); 43 void sch5545_ec_hwm_init(void *unused); 44 45 #endif // SCH5545_BOARD_EC_H 46