1 /* SPDX-License-Identifier: GPL-2.0-only */
4 #include <superio/fintek/common/fan_control.h>
5 #include <amdblocks/lpc.h>
6 #include <device/pci_ops.h>
7 #include <soc/pci_devs.h>
12 /* Boundaries in celsius, sections in percent */
13 static u8 cpu_boudaries
[FINTEK_BOUNDARIES_SIZE
] = {
20 static u8 system_boudaries
[FINTEK_BOUNDARIES_SIZE
] = {
27 static u8 cpu_section
[FINTEK_SECTIONS_SIZE
] = {
35 static u8 system_section
[FINTEK_SECTIONS_SIZE
] = {
43 struct fintek_fan cpu_fan
= {
48 FAN_TYPE_PWM_PUSH_PULL
,
53 FAN_FOLLOW_INTERPOLATION
,
58 struct fintek_fan system_fan
= {
68 FAN_FOLLOW_INTERPOLATION
,
73 static void init_fan_control(void *unused
)
75 /* Open a LPC IO access to 0x0220-0x0227 */
76 pci_or_config32(SOC_LPC_DEV
, LPC_IO_PORT_DECODE_ENABLE
, DECODE_ENABLE_SERIAL_PORT2
);
82 BOOT_STATE_INIT_ENTRY(BS_POST_DEVICE
, BS_ON_ENTRY
, init_fan_control
, NULL
);