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