Angel Pons | f4702c2 | 2020-04-03 01:22:49 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Vladimir Serbinenko | b1ccccc | 2014-02-19 22:20:14 +0100 | [diff] [blame] | 2 | |
Vladimir Serbinenko | b1ccccc | 2014-02-19 22:20:14 +0100 | [diff] [blame] | 3 | #include <console/console.h> |
| 4 | #include <cpu/x86/smm.h> |
Kyösti Mälkki | f1b58b7 | 2019-03-01 13:43:02 +0200 | [diff] [blame] | 5 | #include <device/pci_ops.h> |
Kyösti Mälkki | 661ad46 | 2020-12-29 06:26:21 +0200 | [diff] [blame] | 6 | #include <soc/nvs.h> |
Arthur Heymans | 548f33a | 2018-05-15 16:34:50 +0200 | [diff] [blame] | 7 | #include <southbridge/intel/common/pmutil.h> |
Angel Pons | 95de231 | 2020-02-17 13:08:53 +0100 | [diff] [blame] | 8 | #include <northbridge/intel/ironlake/ironlake.h> |
Vladimir Serbinenko | b1ccccc | 2014-02-19 22:20:14 +0100 | [diff] [blame] | 9 | #include <ec/acpi/ec.h> |
Vladimir Serbinenko | b1ccccc | 2014-02-19 22:20:14 +0100 | [diff] [blame] | 10 | |
Vladimir Serbinenko | b1ccccc | 2014-02-19 22:20:14 +0100 | [diff] [blame] | 11 | void mainboard_smi_gpi(u32 gpi_sts) |
| 12 | { |
| 13 | } |
| 14 | |
Vladimir Serbinenko | b1ccccc | 2014-02-19 22:20:14 +0100 | [diff] [blame] | 15 | int mainboard_smi_apmc(u8 data) |
| 16 | { |
Vladimir Serbinenko | b1ccccc | 2014-02-19 22:20:14 +0100 | [diff] [blame] | 17 | u8 tmp; |
Vladimir Serbinenko | b1ccccc | 2014-02-19 22:20:14 +0100 | [diff] [blame] | 18 | switch (data) { |
Vladimir Serbinenko | b1ccccc | 2014-02-19 22:20:14 +0100 | [diff] [blame] | 19 | case APM_CNT_ACPI_ENABLE: |
| 20 | tmp = pci_read_config8(PCI_DEV(0, 0x1f, 0), 0xbb); |
| 21 | tmp &= ~0x03; |
| 22 | tmp |= 0x02; |
| 23 | pci_write_config8(PCI_DEV(0, 0x1f, 0), 0xbb, tmp); |
| 24 | break; |
| 25 | case APM_CNT_ACPI_DISABLE: |
| 26 | tmp = pci_read_config8(PCI_DEV(0, 0x1f, 0), 0xbb); |
| 27 | tmp &= ~0x03; |
| 28 | tmp |= 0x01; |
| 29 | pci_write_config8(PCI_DEV(0, 0x1f, 0), 0xbb, tmp); |
| 30 | break; |
| 31 | default: |
| 32 | break; |
| 33 | } |
| 34 | return 0; |
| 35 | } |