blob: 9c8f64573d56a146ede95ae8761d039d946eff2f [file] [log] [blame]
Subrata Banik91e89c52019-11-01 18:30:01 +05301/*
2 * This file is part of the coreboot project.
3 *
4 * Copyright (C) 2019 Intel Corp.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 2 of the License.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 */
15
16/*
17 * This file is created based on Intel Tiger Lake Processor SA Datasheet
18 * Document number: 571131
19 * Chapter number: 3
20 */
21
22#include <device/device.h>
23#include <device/pci.h>
24#include <intelblocks/systemagent.h>
25#include <soc/iomap.h>
26#include <soc/systemagent.h>
27
28/*
29 * SoC implementation
30 *
31 * Add all known fixed memory ranges for Host Controller/Memory
32 * controller.
33 */
34void soc_add_fixed_mmio_resources(struct device *dev, int *index)
35{
36 static const struct sa_mmio_descriptor soc_fixed_resources[] = {
37 { PCIEXBAR, CONFIG_MMCONF_BASE_ADDRESS, CONFIG_SA_PCIEX_LENGTH,
38 "PCIEXBAR" },
39 { MCHBAR, MCH_BASE_ADDRESS, MCH_BASE_SIZE, "MCHBAR" },
40 { DMIBAR, DMI_BASE_ADDRESS, DMI_BASE_SIZE, "DMIBAR" },
41 { EPBAR, EP_BASE_ADDRESS, EP_BASE_SIZE, "EPBAR" },
42 { REGBAR, REG_BASE_ADDRESS, REG_BASE_SIZE, "REGBAR" },
43 { EDRAMBAR, EDRAM_BASE_ADDRESS, EDRAM_BASE_SIZE, "EDRAMBAR" },
44 /*
45 * PMC pci device gets hidden from PCI bus due to Silicon
46 * policy hence binding PMCBAR aka PWRMBASE (offset 0x10) with
47 * SA resources to ensure that PMCBAR falls under PCI reserved
48 * memory range.
49 *
50 * Note: Don't add any more resource with same offset 0x10
51 * under this device space.
52 */
53 { PCI_BASE_ADDRESS_0, PCH_PWRM_BASE_ADDRESS, PCH_PWRM_BASE_SIZE,
54 "PMCBAR" },
55 };
56
57 sa_add_fixed_mmio_resources(dev, index, soc_fixed_resources,
58 ARRAY_SIZE(soc_fixed_resources));
59}
60
61/*
62 * SoC implementation
63 *
64 * Perform System Agent Initialization during Ramstage phase.
65 */
66void soc_systemagent_init(struct device *dev)
67{
68 /* Enable Power Aware Interrupt Routing */
69 enable_power_aware_intr();
70
71 /* Enable BIOS Reset CPL */
72 enable_bios_reset_cpl();
73}