/* Clear any SMI or wake events */ REG_GPE0_READ(R_QNC_GPE0BLK_GPE0S), REG_GPE0_READ(R_QNC_GPE0BLK_SMIS), REG_GPE0_OR(R_QNC_GPE0BLK_GPE0S, B_QNC_GPE0BLK_GPE0S_ALL), REG_GPE0_OR(R_QNC_GPE0BLK_SMIS, B_QNC_GPE0BLK_SMIS_ALL), REG_SCRIPT_END }; static const struct reg_script legacy_gpio_init[] = { /* Temporarily enable the legacy GPIO controller */ REG_PCI_WRITE32(R_QNC_LPC_GBA_BASE, IO_ADDRESS_VALID | LEGACY_GPIO_BASE_ADDRESS), /* Temporarily enable the GPE controller */ REG_PCI_WRITE32(R_QNC_LPC_GPE0BLK, IO_ADDRESS_VALID | GPE0_BASE_ADDRESS), REG_PCI_OR8(PCI_COMMAND, PCI_COMMAND_IO), REG_SCRIPT_END }; static const struct reg_script i2c_gpio_controller_init[] = { /* Temporarily enable the GPIO controller */ REG_PCI_WRITE32(PCI_BASE_ADDRESS_0, I2C_BASE_ADDRESS), REG_PCI_WRITE32(PCI_BASE_ADDRESS_1, GPIO_BASE_ADDRESS), REG_PCI_OR8(PCI_COMMAND, PCI_COMMAND_MEMORY), REG_SCRIPT_END }; static const struct reg_script hsuart_init[] = { /* Enable the HSUART */ REG_PCI_WRITE32(PCI_BASE_ADDRESS_0, UART_BASE_ADDRESS), REG_PCI_OR8(PCI_COMMAND, PCI_COMMAND_MEMORY),
else cmos_init(rtc_failed); } static const struct reg_script pch_misc_init_script[] = { /* Setup SLP signal assertion, SLP_S4=4s, SLP_S3=50ms */ REG_PCI_RMW16(GEN_PMCON_3, ~((3 << 4)|(1 << 10)), (1 << 3)|(1 << 11)|(1 << 12)), /* Prepare sleep mode */ REG_IO_RMW32(ACPI_BASE_ADDRESS + PM1_CNT, ~SLP_TYP, SCI_EN), /* Setup NMI on errors, disable SERR */ REG_IO_RMW8(0x61, ~0xf0, (1 << 2)), /* Disable NMI sources */ REG_IO_OR8(0x70, (1 << 7)), /* Indicate DRAM init done for MRC */ REG_PCI_OR8(GEN_PMCON_2, (1 << 7)), /* Enable BIOS updates outside of SMM */ REG_PCI_RMW8(0xdc, ~(1 << 5), 0), /* Clear status bits to prevent unexpected wake */ REG_MMIO_OR32(RCBA_BASE_ADDRESS + 0x3310, 0x0000002f), REG_MMIO_RMW32(RCBA_BASE_ADDRESS + 0x3f02, ~0x0000000f, 0), /* Enable PCIe Releaxed Order */ REG_MMIO_OR32(RCBA_BASE_ADDRESS + 0x2314, (1 << 31) | (1 << 7)), REG_MMIO_OR32(RCBA_BASE_ADDRESS + 0x1114, (1 << 15) | (1 << 14)), /* Setup SERIRQ, enable continuous mode */ REG_PCI_OR8(SERIRQ_CNTL, (1 << 7) | (1 << 6)), #if !CONFIG_SERIRQ_CONTINUOUS_MODE REG_PCI_RMW8(SERIRQ_CNTL, ~(1 << 6), 0), #endif REG_SCRIPT_END };
#include <device/pci_def.h> #include <device/pci_ids.h> #include <reg_script.h> #include <soc/intel/common/hda_verb.h> #include <soc/iomap.h> #include <soc/iosf.h> #include <soc/pci_devs.h> #include <soc/ramstage.h> static const struct reg_script init_ops[] = { /* Enable no snoop traffic. */ REG_PCI_OR16(0x78, 1 << 11), /* Configure HDMI codec connection. */ REG_PCI_OR32(0xc4, 1 << 1), REG_PCI_OR8(0x43, (1 << 3) | (1 << 6)), REG_IOSF_WRITE(IOSF_PORT_PMC, PUNIT_PWRGT_CONTROL, 0xc0), REG_IOSF_WRITE(IOSF_PORT_PMC, PUNIT_PWRGT_CONTROL, 0x00), /* Configure internal settings. */ REG_PCI_OR32(0xc0, 0x7 << 21), REG_PCI_OR32(0xc4, (0x3 << 26) | (1 << 13) | (1 << 10)), REG_PCI_WRITE32(0xc8, 0x82a30000), REG_PCI_RMW32(0xd0, ~(1 << 31), 0x0), /* Disable docking. */ REG_PCI_RMW8(0x4d, ~(1 << 7), 0), REG_SCRIPT_END, }; static const uint32_t hdmi_codec_verb_table[] = { /* coreboot specific header */ 0x80862882, /* vid did for hdmi codec */
#include <soc/pmc.h> #include <soc/pm.h> #include <cpu/x86/smm.h> #include <soc/pcr.h> #include <soc/ramstage.h> #if IS_ENABLED(CONFIG_CHROMEOS) #include <vendorcode/google/chromeos/chromeos.h> #endif static const struct reg_script pch_pmc_misc_init_script[] = { /* Setup SLP signal assertion, SLP_S4=4s, SLP_S3=50ms */ REG_PCI_RMW16(GEN_PMCON_B, ~((3 << 4)|(1 << 10)), (1 << 3)|(1 << 11)|(1 << 12)), REG_IO_RMW32(ACPI_BASE_ADDRESS + PM1_CNT, ~SLP_TYP, SCI_EN), /* Indicate DRAM init done for MRC */ REG_PCI_OR8(GEN_PMCON_A, (1 << 23)), REG_SCRIPT_END }; static void pch_pmc_add_mmio_resources(device_t dev) { struct resource *res; const u32 default_decode_base = PCH_PCR_BASE_ADDRESS; /* * Till PCI enumeration happens we need to allocate the PMC base * statically. Above the PCR base. */ if (PCH_PWRM_BASE_ADDRESS < default_decode_base) { res = new_resource(dev, PWRMBASE); res->base = PCH_PWRM_BASE_ADDRESS;
SPIBAR_HSFS_FLOCKDN), /* TC Lockdown */ REG_MMIO_OR32(RCBA_BASE_ADDRESS + 0x0050, (1 << 31)), /* BIOS Interface Lockdown */ REG_MMIO_OR32(RCBA_BASE_ADDRESS + GCS, (1 << 0)), /* Function Disable SUS Well Lockdown */ REG_MMIO_OR8(RCBA_BASE_ADDRESS + FDSW, (1 << 7)), /* Global SMI Lock */ REG_PCI_OR16(GEN_PMCON_1, SMI_LOCK), /* GEN_PMCON Lock */ REG_PCI_OR8(GEN_PMCON_LOCK, SLP_STR_POL_LOCK | ACPI_BASE_LOCK), /* PMSYNC */ REG_MMIO_OR32(RCBA_BASE_ADDRESS + PMSYNC_CONFIG, (1 << 31)), REG_SCRIPT_END }; static void broadwell_finalize(void *unused) { printk(BIOS_DEBUG, "Finalizing chipset.\n"); reg_script_run_on_dev(SA_DEV_ROOT, system_agent_finalize_script); reg_script_run_on_dev(PCH_DEV_LPC, pch_finalize_script);