| 1 |
|
| 2 |
|
| 3 |
#include <acpi/acpi.h> |
| 4 |
#include <device/pci_ops.h> |
| 5 |
#include <console/console.h> |
| 6 |
#include <cpu/x86/smm.h> |
| 7 |
#include <device/device.h> |
| 8 |
#include <device/mmio.h> |
| 9 |
#include <device/pci.h> |
| 10 |
#include <device/pci_ids.h> |
| 11 |
#include <intelblocks/pmc.h> |
| 12 |
#include <soc/iomap.h> |
| 13 |
#include <soc/pm.h> |
| 14 |
#include <soc/pmc.h> |
| 15 |
#include <soc/pci_devs.h> |
| 16 |
#include <soc/ramstage.h> |
| 17 |
|
| 18 |
static void pch_power_options(struct device *dev) { } |
| 19 |
|
| 20 |
|
| 21 |
int pmc_soc_get_resources(struct pmc_resource_config *cfg) |
| 22 |
{ |
| 23 |
cfg->pwrmbase_offset = PMC_PWRM_BASE; |
| 24 |
cfg->pwrmbase_addr = DEFAULT_PWRM_BASE; |
| 25 |
cfg->pwrmbase_size = DEFAULT_PWRM_SIZE; |
| 26 |
cfg->abase_offset = PMC_ACPI_BASE; |
| 27 |
cfg->abase_addr = DEFAULT_PMBASE; |
| 28 |
cfg->abase_size = DEFAULT_PMBASE_SIZE; |
| 29 |
|
| 30 |
return 0; |
| 31 |
} |
| 32 |
|
| 33 |
static void pch_set_acpi_mode(void) |
| 34 |
{ |
| 35 |
if (!acpi_is_wakeup_s3()) { |
| 36 |
apm_control(APM_CNT_ACPI_DISABLE); |
| 37 |
} |
| 38 |
} |
| 39 |
|
| 40 |
void pmc_soc_init(struct device *dev) |
| 41 |
{ |
| 42 |
uint32_t pwrm_base = pci_read_config32(dev, PMC_PWRM_BASE) & MASK_PMC_PWRM_BASE; |
| 43 |
|
| 44 |
printk(BIOS_DEBUG, "pch: %s\n", __func__); |
| 45 |
|
| 46 |
|
| 47 |
pci_write_config16(dev, PCI_COMMAND, PCI_COMMAND_MASTER | |
| 48 |
PCI_COMMAND_MEMORY | |
| 49 |
PCI_COMMAND_IO); |
| 50 |
|
| 51 |
|
| 52 |
pch_power_options(dev); |
| 53 |
|
| 54 |
|
| 55 |
pch_set_acpi_mode(); |
| 56 |
|
| 57 |
|
| 58 |
|
| 59 |
|
| 60 |
|
| 61 |
|
| 62 |
|
| 63 |
if (!CONFIG(USE_PM_ACPI_TIMER)) |
| 64 |
setbits8((volatile void *)(uintptr_t)(pwrm_base + PCH_PWRM_ACPI_TMR_CTL), |
| 65 |
ACPI_TIM_DIS); |
| 66 |
} |