2020-04-05 15:47:07 +02:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
2020-03-25 07:06:22 +01:00
|
|
|
|
|
|
|
#include <device/device.h>
|
2020-05-26 16:29:45 +02:00
|
|
|
#include <delay.h>
|
2020-03-25 07:06:22 +01:00
|
|
|
#include <device/pci.h>
|
|
|
|
#include <device/pci_ops.h>
|
|
|
|
#include <intelblocks/systemagent.h>
|
2020-05-26 16:29:45 +02:00
|
|
|
#include <intelblocks/power_limit.h>
|
2020-03-25 07:06:22 +01:00
|
|
|
#include <soc/iomap.h>
|
2020-05-26 16:29:45 +02:00
|
|
|
#include <soc/soc_chip.h>
|
2020-03-25 07:06:22 +01:00
|
|
|
#include <soc/systemagent.h>
|
|
|
|
|
|
|
|
/*
|
|
|
|
* SoC implementation
|
|
|
|
*
|
|
|
|
* Add all known fixed memory ranges for Host Controller/Memory
|
|
|
|
* controller.
|
|
|
|
*/
|
|
|
|
void soc_add_fixed_mmio_resources(struct device *dev, int *index)
|
|
|
|
{
|
|
|
|
static const struct sa_mmio_descriptor soc_fixed_resources[] = {
|
2021-01-29 11:35:16 +01:00
|
|
|
{ PCIEXBAR, CONFIG_MMCONF_BASE_ADDRESS, CONFIG_MMCONF_LENGTH,
|
2020-03-25 07:06:22 +01:00
|
|
|
"PCIEXBAR" },
|
|
|
|
{ MCHBAR, MCH_BASE_ADDRESS, MCH_BASE_SIZE, "MCHBAR" },
|
|
|
|
{ DMIBAR, DMI_BASE_ADDRESS, DMI_BASE_SIZE, "DMIBAR" },
|
|
|
|
{ EPBAR, EP_BASE_ADDRESS, EP_BASE_SIZE, "EPBAR" },
|
|
|
|
{ REGBAR, REG_BASE_ADDRESS, REG_BASE_SIZE, "REGBAR" },
|
|
|
|
{ EDRAMBAR, EDRAM_BASE_ADDRESS, EDRAM_BASE_SIZE, "EDRAMBAR" },
|
|
|
|
};
|
|
|
|
|
|
|
|
sa_add_fixed_mmio_resources(dev, index, soc_fixed_resources,
|
|
|
|
ARRAY_SIZE(soc_fixed_resources));
|
|
|
|
|
|
|
|
/* Add Vt-d resources if VT-d is enabled */
|
|
|
|
if ((pci_read_config32(dev, CAPID0_A) & VTD_DISABLE))
|
|
|
|
return;
|
|
|
|
|
|
|
|
sa_add_fixed_mmio_resources(dev, index, soc_vtd_resources,
|
|
|
|
ARRAY_SIZE(soc_vtd_resources));
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* SoC implementation
|
|
|
|
*
|
|
|
|
* Perform System Agent Initialization during Ramstage phase.
|
|
|
|
*/
|
|
|
|
void soc_systemagent_init(struct device *dev)
|
|
|
|
{
|
2020-05-26 16:29:45 +02:00
|
|
|
struct soc_power_limits_config *soc_config;
|
|
|
|
config_t *config;
|
|
|
|
|
2020-03-25 07:06:22 +01:00
|
|
|
/* Enable Power Aware Interrupt Routing */
|
|
|
|
enable_power_aware_intr();
|
|
|
|
|
|
|
|
/* Enable BIOS Reset CPL */
|
|
|
|
enable_bios_reset_cpl();
|
2020-05-26 16:29:45 +02:00
|
|
|
|
|
|
|
mdelay(1);
|
|
|
|
config = config_of_soc();
|
|
|
|
soc_config = &config->power_limits_config;
|
|
|
|
set_power_limits(MOBILE_SKU_PL1_TIME_SEC, soc_config);
|
2020-03-25 07:06:22 +01:00
|
|
|
}
|