Debian Codegraph @

src/soc/intel/xeon_sp/ibl/soc_pch.c

raw symbols SCIP
1 /* SPDX-License-Identifier: GPL-2.0-only */
2
3 #include <assert.h>
4 #include <console/console.h>
5 #include <device/pci_ops.h>
6 #include <soc/bootblock.h>
7 #include <soc/pci_devs.h>
8 #include <soc/pmc.h>
9 #include <soc/soc_pch.h>
10
11 static void soc_config_acpibase(void)
12 {
13 /* Disable IO command in PMC Device first before changing Base Address */
14 uint16_t reg16 = pci_read_config16(PCH_DEV_PMC, PCI_COMMAND);
15 pci_write_config16(PCH_DEV_PMC, PCI_COMMAND,
16 reg16 & ~(PCI_COMMAND_IO | PCI_COMMAND_MASTER));
17
18 /* Program ACPI Base */
19 pci_write_config32(PCH_DEV_PMC, ABASE, ACPI_BASE_ADDRESS);
20
21 /* Enable Bus Master and IO Space */
22 pci_or_config16(PCH_DEV_PMC, PCI_COMMAND, (PCI_COMMAND_IO | PCI_COMMAND_MASTER));
23
24 uint32_t data = pci_read_config32(PCH_DEV_PMC, ABASE);
25 assert(ACPI_BASE_ADDRESS == (data & ~PCI_BASE_ADDRESS_IO_ATTR_MASK));
26 printk(BIOS_INFO, "%s : pmbase = %x\n", __func__, (int)data);
27 }
28
29 void bootblock_pch_init(void)
30 {
31 /*
32 * Enabling ABASE for accessing PM1_STS, PM1_EN, PM1_CNT
33 */
34 soc_config_acpibase();
35 }
36
37 void early_pch_init(void)
38 {
39 }