Youness Alaoui has uploaded this change for review. ( https://review.coreboot.org/23682
Change subject: soc/intel/skylake: Add IOMMU support
......................................................................
soc/intel/skylake: Add IOMMU support
Sets up the IOMMU if VT-d is supported by the chipset. Once the
MCHBAR and the IBDF/HBDF are set, the ACPI DMAR table should be
properly filled with those values.
This work is based on the IOMMU work on sandybridge [1] by Nico
Huber.
Tested on Purism Librem 13 v2
[1] Commits bb9469c4 and b2dae793
Change-Id: Ifadaa11340406d1da0f98813589d20118744cc6f
Signed-off-by: Youness Alaoui <youness.alaoui(a)puri.sm>
---
M src/soc/intel/skylake/Makefile.inc
M src/soc/intel/skylake/bootblock/pch.c
M src/soc/intel/skylake/include/soc/iomap.h
A src/soc/intel/skylake/include/soc/iommu.h
A src/soc/intel/skylake/iommu.c
M src/soc/intel/skylake/romstage/systemagent.c
M src/soc/intel/skylake/systemagent.c
7 files changed, 112 insertions(+), 3 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/82/23682/1
diff --git a/src/soc/intel/skylake/Makefile.inc b/src/soc/intel/skylake/Makefile.inc
index ef95cf7..a358f35 100644
--- a/src/soc/intel/skylake/Makefile.inc
+++ b/src/soc/intel/skylake/Makefile.inc
@@ -37,6 +37,7 @@
romstage-y += pmutil.c
romstage-$(CONFIG_PLATFORM_USES_FSP2_0) += reset.c
romstage-y += spi.c
+romstage-y += iommu.c
romstage-$(CONFIG_UART_DEBUG) += uart.c
ramstage-$(CONFIG_HAVE_ACPI_TABLES) += acpi.c
diff --git a/src/soc/intel/skylake/bootblock/pch.c b/src/soc/intel/skylake/bootblock/pch.c
index 34cfaa3..0f97d1d 100644
--- a/src/soc/intel/skylake/bootblock/pch.c
+++ b/src/soc/intel/skylake/bootblock/pch.c
@@ -28,6 +28,7 @@
#include <intelblocks/smbus.h>
#include <soc/bootblock.h>
#include <soc/iomap.h>
+#include <soc/iommu.h>
#include <soc/p2sb.h>
#include <soc/pch.h>
#include <soc/pci_devs.h>
@@ -59,6 +60,13 @@
* selected by bits 1:0
*/
pci_write_config8(dev, HPTC_OFFSET, HPTC_ADDR_ENABLE_BIT);
+
+ /* Assign unique bus/dev/fn for I/O APIC and HPET */
+ pci_write_config16(dev, PCH_P2SB_IBDF,
+ PCH_IOAPIC_PCI_BUS << 8 | PCH_IOAPIC_PCI_SLOT << 3);
+
+ pci_write_config16(dev, PCH_P2SB_HBDF,
+ PCH_HPET_PCI_BUS << 8 | PCH_HPET_PCI_SLOT << 3);
}
void bootblock_pch_early_init(void)
diff --git a/src/soc/intel/skylake/include/soc/iomap.h b/src/soc/intel/skylake/include/soc/iomap.h
index 0a573ac..cc38e2e 100644
--- a/src/soc/intel/skylake/include/soc/iomap.h
+++ b/src/soc/intel/skylake/include/soc/iomap.h
@@ -54,6 +54,10 @@
#define HPET_BASE_ADDRESS 0xfed00000
+#define IOMMU_BASE_ADDRESS1 0xfed90000ULL
+#define IOMMU_BASE_ADDRESS2 0xfed91000ULL
+#define IOMMU_BASE_SIZE 0x1000
+
#define PCH_PWRM_BASE_ADDRESS 0xfe000000
#define PCH_PWRM_BASE_SIZE 0x10000
diff --git a/src/soc/intel/skylake/include/soc/iommu.h b/src/soc/intel/skylake/include/soc/iommu.h
new file mode 100644
index 0000000..56df714
--- /dev/null
+++ b/src/soc/intel/skylake/include/soc/iommu.h
@@ -0,0 +1,30 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2018 Purism SPC
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
+
+#ifndef _SOC_IOMMU_H_
+#define _SOC_IOMMU_H_
+
+#include <stdint.h>
+
+#define PCH_IOAPIC_PCI_BUS 0xF0
+#define PCH_IOAPIC_PCI_SLOT 0x1F
+
+#define PCH_HPET_PCI_BUS 0x00
+#define PCH_HPET_PCI_SLOT 0x1F
+
+void skylake_init_iommu(void);
+
+#endif
diff --git a/src/soc/intel/skylake/iommu.c b/src/soc/intel/skylake/iommu.c
new file mode 100644
index 0000000..81028de
--- /dev/null
+++ b/src/soc/intel/skylake/iommu.c
@@ -0,0 +1,50 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2015 secunet Security Networks AG
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; version 2 of
+ * the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
+#include <stdint.h>
+
+#include <device/device.h>
+#include <intelblocks/systemagent.h>
+#include <soc/iomap.h>
+#include <soc/iommu.h>
+#include <soc/pci_devs.h>
+#include <soc/systemagent.h>
+
+void skylake_init_iommu(void)
+{
+ static const struct sa_mmio_descriptor iommu_fixed_mch_resources[] = {
+ {IOMMU1BAR, IOMMU_BASE_ADDRESS1, IOMMU_BASE_SIZE, "IOMMU1BAR"},
+ {IOMMU2BAR, IOMMU_BASE_ADDRESS2, IOMMU_BASE_SIZE, "IOMMU2BAR"},
+ };
+
+ if (pci_read_config32(SA_DEV_ROOT, CAPID0_A) & VTDD)
+ return;
+
+ /* setup BARs */
+ sa_set_mch_bar(iommu_fixed_mch_resources,
+ ARRAY_SIZE(iommu_fixed_mch_resources));
+
+ /* lock policies */
+ write32((void *)(IOMMU_BASE_ADDRESS1 + 0xff0), 0x80000000);
+
+ const struct device *const azalia = dev_find_slot(0, PCH_DEVFN_HDA);
+ if (azalia && azalia->enabled) {
+ write32((void *)(IOMMU_BASE_ADDRESS2 + 0xff0), 0x20000000);
+ write32((void *)(IOMMU_BASE_ADDRESS2 + 0xff0), 0xa0000000);
+ } else {
+ write32((void *)(IOMMU_BASE_ADDRESS2 + 0xff0), 0x80000000);
+ }
+}
diff --git a/src/soc/intel/skylake/romstage/systemagent.c b/src/soc/intel/skylake/romstage/systemagent.c
index 8f2fb33..e7a2f4a 100644
--- a/src/soc/intel/skylake/romstage/systemagent.c
+++ b/src/soc/intel/skylake/romstage/systemagent.c
@@ -18,6 +18,7 @@
#include <device/device.h>
#include <intelblocks/systemagent.h>
#include <soc/iomap.h>
+#include <soc/iommu.h>
#include <soc/romstage.h>
#include <soc/systemagent.h>
@@ -34,12 +35,15 @@
{ EDRAMBAR, EDRAM_BASE_ADDRESS, EDRAM_BASE_SIZE, "EDRAMBAR" },
};
- /* Set Fixed MMIO addresss into PCI configuration space */
+ /* Set Fixed MMIO addresses into PCI configuration space */
sa_set_pci_bar(soc_fixed_pci_resources,
ARRAY_SIZE(soc_fixed_pci_resources));
- /* Set Fixed MMIO addresss into MCH base address */
+ /* Set Fixed MMIO addresses into MCH base address */
sa_set_mch_bar(soc_fixed_mch_resources,
ARRAY_SIZE(soc_fixed_mch_resources));
- /* Enable PAM regisers */
+ /* Enable PAM registers */
enable_pam_region();
+ /* Enable IOMMU. This will set the IOMMU Fixed MMIO addresses into
+ * MCH base address if device has IOMMU capabilities */
+ skylake_init_iommu();
}
diff --git a/src/soc/intel/skylake/systemagent.c b/src/soc/intel/skylake/systemagent.c
index 8af995d..880593d 100644
--- a/src/soc/intel/skylake/systemagent.c
+++ b/src/soc/intel/skylake/systemagent.c
@@ -15,6 +15,7 @@
* GNU General Public License for more details.
*/
+#include <arch/io.h>
#include <cpu/x86/msr.h>
#include <console/console.h>
#include <delay.h>
@@ -23,6 +24,7 @@
#include <soc/cpu.h>
#include <soc/iomap.h>
#include <soc/msr.h>
+#include <soc/pci_devs.h>
#include <soc/systemagent.h>
/*
@@ -42,9 +44,19 @@
{ GDXCBAR, GDXC_BASE_ADDRESS, GDXC_BASE_SIZE, "GDXCBAR" },
{ EDRAMBAR, EDRAM_BASE_ADDRESS, EDRAM_BASE_SIZE, "EDRAMBAR" },
};
+ static const struct sa_mmio_descriptor iommu_fixed_resources[] = {
+ { IOMMU1BAR, IOMMU_BASE_ADDRESS1, IOMMU_BASE_SIZE, "IOMMU1" },
+ { IOMMU2BAR, IOMMU_BASE_ADDRESS2, IOMMU_BASE_SIZE, "IOMMU2" },
+ };
+ struct device *const root_dev = dev_find_slot(0, SA_DEVFN_ROOT);
sa_add_fixed_mmio_resources(dev, index, soc_fixed_resources,
ARRAY_SIZE(soc_fixed_resources));
+
+ /* Add IOMMU Fixed resources only if we have VT-d capability. */
+ if (root_dev && !(pci_read_config32(root_dev, CAPID0_A) & VTDD))
+ sa_add_fixed_mmio_resources(dev, index, iommu_fixed_resources,
+ ARRAY_SIZE(iommu_fixed_resources));
}
/*
--
To view, visit https://review.coreboot.org/23682
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifadaa11340406d1da0f98813589d20118744cc6f
Gerrit-Change-Number: 23682
Gerrit-PatchSet: 1
Gerrit-Owner: Youness Alaoui <snifikino(a)gmail.com>
Youness Alaoui has uploaded this change for review. ( https://review.coreboot.org/23680
Change subject: intel/fsp: Fix TPM initialization when vboot is disabled
......................................................................
intel/fsp: Fix TPM initialization when vboot is disabled
A change introduced by commit fe4983e5 [1] in order to prevent
re-initialization of the TPM if already setup in verstage
had the wrong logic in the if statement, causing the TPM
to never be initialized if vboot is disabled.
The RESUME_PATH_SAME_AS_BOOT config is enabled by default for
ARCH_X86 and therefore the if statement would be false. The
behavior that was intended was probably meant to use an OR
instead of an AND.
[1] https://review.coreboot.org/#/c/coreboot/+/14106/
Change-Id: Ic43d1aa31a296386c7eab6d997f9b701e9ea0fe5
Signed-off-by: Youness Alaoui <youness.alaoui(a)puri.sm>
---
M src/drivers/intel/fsp1_1/romstage.c
1 file changed, 2 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/80/23680/1
diff --git a/src/drivers/intel/fsp1_1/romstage.c b/src/drivers/intel/fsp1_1/romstage.c
index 69ea786..6c80ce7 100644
--- a/src/drivers/intel/fsp1_1/romstage.c
+++ b/src/drivers/intel/fsp1_1/romstage.c
@@ -172,8 +172,8 @@
* in verstage and used to verify romstage.
*/
if (IS_ENABLED(CONFIG_LPC_TPM) &&
- !IS_ENABLED(CONFIG_RESUME_PATH_SAME_AS_BOOT) &&
- !IS_ENABLED(CONFIG_VBOOT_STARTS_IN_BOOTBLOCK))
+ (!IS_ENABLED(CONFIG_RESUME_PATH_SAME_AS_BOOT) ||
+ !IS_ENABLED(CONFIG_VBOOT_STARTS_IN_BOOTBLOCK)))
init_tpm(params->power_state->prev_sleep_state ==
ACPI_S3);
}
--
To view, visit https://review.coreboot.org/23680
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic43d1aa31a296386c7eab6d997f9b701e9ea0fe5
Gerrit-Change-Number: 23680
Gerrit-PatchSet: 1
Gerrit-Owner: Youness Alaoui <snifikino(a)gmail.com>
Justin TerAvest has uploaded this change for review. ( https://review.coreboot.org/23679
Change subject: DRAFT: Normalize GPIO initialization on kahlee.
......................................................................
DRAFT: Normalize GPIO initialization on kahlee.
This makes the flow for GPIO initialization more closely folllow that
for other boards.
Note: This will probably break gardenia so this can't go in as is, but
I'm curious about comments on the strategy here.
Change-Id: Ic97db96581a69798b193a6bdeb93644f6a74fc9d
Signed-off-by: Justin TerAvest <teravest(a)chromium.org>
---
M src/mainboard/google/kahlee/Makefile.inc
M src/mainboard/google/kahlee/bootblock/bootblock.c
A src/mainboard/google/kahlee/ramstage.c
M src/mainboard/google/kahlee/variants/baseboard/gpio.c
M src/mainboard/google/kahlee/variants/baseboard/include/baseboard/variants.h
M src/mainboard/google/kahlee/variants/kahlee/gpio.c
M src/soc/amd/stoneyridge/bootblock/bootblock.c
M src/soc/amd/stoneyridge/chip.c
A src/soc/amd/stoneyridge/include/soc/ramstage.h
M src/soc/amd/stoneyridge/include/soc/southbridge.h
M src/soc/amd/stoneyridge/southbridge.c
11 files changed, 86 insertions(+), 26 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/79/23679/1
diff --git a/src/mainboard/google/kahlee/Makefile.inc b/src/mainboard/google/kahlee/Makefile.inc
index 770a999..514373e 100644
--- a/src/mainboard/google/kahlee/Makefile.inc
+++ b/src/mainboard/google/kahlee/Makefile.inc
@@ -25,6 +25,7 @@
ramstage-y += chromeos.c
ramstage-y += ec.c
ramstage-y += OemCustomize.c
+ramstage-y += ramstage.c
verstage-y += chromeos.c
verstage-y += ec.c
diff --git a/src/mainboard/google/kahlee/bootblock/bootblock.c b/src/mainboard/google/kahlee/bootblock/bootblock.c
index 90c8acb..244abe0 100644
--- a/src/mainboard/google/kahlee/bootblock/bootblock.c
+++ b/src/mainboard/google/kahlee/bootblock/bootblock.c
@@ -13,12 +13,18 @@
* GNU General Public License for more details.
*/
+#include <baseboard/variants.h>
#include <bootblock_common.h>
#include <soc/southbridge.h>
#include <variant/ec.h>
void bootblock_mainboard_init(void)
{
+ size_t num_gpios;
+ const struct soc_amd_stoneyridge_gpio *gpios;
+ gpios = variant_early_gpio_table(&num_gpios);
+ sb_program_gpios(gpios, num_gpios);
+
/* Enable the EC as soon as we have visibility */
mainboard_ec_init();
diff --git a/src/mainboard/google/kahlee/ramstage.c b/src/mainboard/google/kahlee/ramstage.c
new file mode 100644
index 0000000..7fdf495
--- /dev/null
+++ b/src/mainboard/google/kahlee/ramstage.c
@@ -0,0 +1,27 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2018 Google Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
+#include <baseboard/variants.h>
+#include <soc/ramstage.h>
+#include <soc/southbridge.h>
+
+void ramstage_mainboard_init(void)
+{
+ size_t num_gpios;
+ const struct soc_amd_stoneyridge_gpio *gpios;
+ gpios = variant_gpio_table(&num_gpios);
+ sb_program_gpios(gpios, num_gpios);
+}
+
diff --git a/src/mainboard/google/kahlee/variants/baseboard/gpio.c b/src/mainboard/google/kahlee/variants/baseboard/gpio.c
index a6bcea5..8d90174 100644
--- a/src/mainboard/google/kahlee/variants/baseboard/gpio.c
+++ b/src/mainboard/google/kahlee/variants/baseboard/gpio.c
@@ -258,13 +258,14 @@
{ GPIO_135, Function1, FCH_GPIO_PULL_UP_ENABLE | INPUT },
};
-const __attribute__((weak)) const struct soc_amd_stoneyridge_gpio
- *board_get_gpio(size_t *size)
+const struct soc_amd_stoneyridge_gpio *variant_early_gpio_table(size_t *size)
{
- if (GPIO_TABLE_BOOTBLOCK) {
- *size = ARRAY_SIZE(gpio_set_stage_reset);
- return gpio_set_stage_reset;
- }
+ *size = ARRAY_SIZE(gpio_set_stage_reset);
+ return gpio_set_stage_reset;
+}
+
+const struct soc_amd_stoneyridge_gpio *variant_gpio_table(size_t *size)
+{
*size = ARRAY_SIZE(gpio_set_stage_ram);
return gpio_set_stage_ram;
}
diff --git a/src/mainboard/google/kahlee/variants/baseboard/include/baseboard/variants.h b/src/mainboard/google/kahlee/variants/baseboard/include/baseboard/variants.h
index bf14ef4..5bbc11d 100644
--- a/src/mainboard/google/kahlee/variants/baseboard/include/baseboard/variants.h
+++ b/src/mainboard/google/kahlee/variants/baseboard/include/baseboard/variants.h
@@ -26,5 +26,7 @@
int variant_mainboard_read_spd(uint8_t spdAddress, char *buf, size_t len);
int variant_get_xhci_oc_map(uint16_t *usb_oc_map);
int variant_get_ehci_oc_map(uint16_t *usb_oc_map);
+const struct soc_amd_stoneyridge_gpio *variant_early_gpio_table(size_t *size);
+const struct soc_amd_stoneyridge_gpio *variant_gpio_table(size_t *size);
#endif /* __BASEBOARD_VARIANTS_H__ */
diff --git a/src/mainboard/google/kahlee/variants/kahlee/gpio.c b/src/mainboard/google/kahlee/variants/kahlee/gpio.c
index e357c7e..d1cc017 100644
--- a/src/mainboard/google/kahlee/variants/kahlee/gpio.c
+++ b/src/mainboard/google/kahlee/variants/kahlee/gpio.c
@@ -96,12 +96,14 @@
{GPIO_119, Function2, FCH_GPIO_PULL_UP_ENABLE | OUTPUT_H },
};
-const struct soc_amd_stoneyridge_gpio *board_get_gpio(size_t *size)
+const struct soc_amd_stoneyridge_gpio *variant_early_gpio_table(size_t *size)
{
- if (GPIO_TABLE_BOOTBLOCK) {
- *size = ARRAY_SIZE(gpio_set_stage_reset);
- return gpio_set_stage_reset;
- }
+ *size = ARRAY_SIZE(gpio_set_stage_reset);
+ return gpio_set_stage_reset;
+}
+
+const struct soc_amd_stoneyridge_gpio *variant_gpio_table(size_t *size)
+{
*size = ARRAY_SIZE(gpio_set_stage_ram);
return gpio_set_stage_ram;
}
diff --git a/src/soc/amd/stoneyridge/bootblock/bootblock.c b/src/soc/amd/stoneyridge/bootblock/bootblock.c
index 709b413..3eff5eb 100644
--- a/src/soc/amd/stoneyridge/bootblock/bootblock.c
+++ b/src/soc/amd/stoneyridge/bootblock/bootblock.c
@@ -125,8 +125,6 @@
post_code(0x37);
do_agesawrapper(agesawrapper_amdinitreset, "amdinitreset");
- sb_program_gpio();
-
post_code(0x38);
/* APs will not exit amdinitearly */
do_agesawrapper(agesawrapper_amdinitearly, "amdinitearly");
diff --git a/src/soc/amd/stoneyridge/chip.c b/src/soc/amd/stoneyridge/chip.c
index d3a8bc4..bd48c74 100644
--- a/src/soc/amd/stoneyridge/chip.c
+++ b/src/soc/amd/stoneyridge/chip.c
@@ -24,6 +24,7 @@
#include <soc/cpu.h>
#include <soc/northbridge.h>
#include <soc/pci_devs.h>
+#include <soc/ramstage.h>
#include <soc/southbridge.h>
#include <amdblocks/psp.h>
#include <amdblocks/agesawrapper.h>
@@ -89,9 +90,16 @@
dev->ops = &stoneyridge_i2c_mmio_ops;
}
+/* Mainboard GPIO configuration */
+__attribute__((weak)) void ramstage_mainboard_init(void)
+{
+ printk(BIOS_DEBUG, "WEAK: %s/%s called\n", __FILE__, __func__);
+}
+
static void soc_init(void *chip_info)
{
southbridge_init(chip_info);
+ ramstage_mainboard_init();
setup_bsp_ramtop();
}
diff --git a/src/soc/amd/stoneyridge/include/soc/ramstage.h b/src/soc/amd/stoneyridge/include/soc/ramstage.h
new file mode 100644
index 0000000..014c48b
--- /dev/null
+++ b/src/soc/amd/stoneyridge/include/soc/ramstage.h
@@ -0,0 +1,21 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2018 Google Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
+#ifndef _SOC_RAMSTAGE_H_
+#define _SOC_RAMSTAGE_H_
+
+void ramstage_mainboard_init(void);
+
+#endif
diff --git a/src/soc/amd/stoneyridge/include/soc/southbridge.h b/src/soc/amd/stoneyridge/include/soc/southbridge.h
index f4d6b17..259e8b5 100644
--- a/src/soc/amd/stoneyridge/include/soc/southbridge.h
+++ b/src/soc/amd/stoneyridge/include/soc/southbridge.h
@@ -350,9 +350,13 @@
/**
* @brief program a particular set of GPIO
*
+ * @param gpio_ptr = pointer to array of gpio configurations
+ * @param size = number of entries in array
+ *
* @return none
*/
-void sb_program_gpio(void);
+void sb_program_gpios(const struct soc_amd_stoneyridge_gpio *gpio_ptr,
+ size_t size);
/**
* @brief Find the size of a particular wide IO
*
diff --git a/src/soc/amd/stoneyridge/southbridge.c b/src/soc/amd/stoneyridge/southbridge.c
index 735642f..a14213f 100644
--- a/src/soc/amd/stoneyridge/southbridge.c
+++ b/src/soc/amd/stoneyridge/southbridge.c
@@ -155,15 +155,13 @@
return irq_association;
}
-void sb_program_gpio(void)
+void sb_program_gpios(const struct soc_amd_stoneyridge_gpio *gpio_ptr,
+ size_t size)
{
void *tmp_ptr;
- const struct soc_amd_stoneyridge_gpio *gpio_ptr;
- size_t size;
uint8_t control, mux, index;
printk(BIOS_SPEW, "GPIO programming stage %s\n", STR_GPIO_STAGE);
- gpio_ptr = board_get_gpio(&size);
for (index = 0; index < size; index++) {
mux = gpio_ptr[index].function;
control = gpio_ptr[index].control;
@@ -181,14 +179,6 @@
printk(BIOS_SPEW, "End GPIO programming\n");
}
-static void sb_program_gpio_ram(void *unused)
-{
- sb_program_gpio();
-}
-
-BOOT_STATE_INIT_ENTRY(BS_WRITE_TABLES, BS_ON_ENTRY,
- sb_program_gpio_ram, NULL);
-
/**
* @brief Find the size of a particular wide IO
*
--
To view, visit https://review.coreboot.org/23679
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic97db96581a69798b193a6bdeb93644f6a74fc9d
Gerrit-Change-Number: 23679
Gerrit-PatchSet: 1
Gerrit-Owner: Justin TerAvest <teravest(a)chromium.org>
Lijian Zhao has uploaded this change for review. ( https://review.coreboot.org/23677
Change subject: intel/fsp: Update cannonlake fsp header
......................................................................
intel/fsp: Update cannonlake fsp header
Update Cannonlake FSP header to revision 7.x.25.31. Following changes
had been made:
TBD
TEST=NONE
Signed-off-by: Lijian Zhao <lijian.zhao(a)intel.com>
Change-Id: I32e976eacf39d2cd75f8288c86d1de1a54c194c6
---
M src/vendorcode/intel/fsp/fsp2_0/cannonlake/FspmUpd.h
M src/vendorcode/intel/fsp/fsp2_0/cannonlake/FspsUpd.h
A src/vendorcode/intel/fsp/fsp2_0/cannonlake/FsptUpd.h
M src/vendorcode/intel/fsp/fsp2_0/cannonlake/MemInfoHob.h
4 files changed, 207 insertions(+), 19 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/77/23677/1
diff --git a/src/vendorcode/intel/fsp/fsp2_0/cannonlake/FspmUpd.h b/src/vendorcode/intel/fsp/fsp2_0/cannonlake/FspmUpd.h
index d504f96..d014f81 100644
--- a/src/vendorcode/intel/fsp/fsp2_0/cannonlake/FspmUpd.h
+++ b/src/vendorcode/intel/fsp/fsp2_0/cannonlake/FspmUpd.h
@@ -474,9 +474,21 @@
**/
UINT8 CpuTraceHubMemReg1Size;
-/** Offset 0x00F6
+/** Offset 0x00F6 - Enable or Disable Peci C10 Reset command
+ Enable or Disable Peci C10 Reset command; <b>0: Disable;</b> 1: Enable.
+ $EN_DIS
**/
- UINT8 UnusedUpdSpace3[6];
+ UINT8 PeciC10Reset;
+
+/** Offset 0x00F7 - Enable or Disable Peci Sx Reset command
+ Enable or Disable Peci Sx Reset command; <b>0: Disable;</b> 1: Enable.
+ $EN_DIS
+**/
+ UINT8 PeciSxReset;
+
+/** Offset 0x00F8
+**/
+ UINT8 UnusedUpdSpace3[4];
/** Offset 0x00FC - Enable Intel HD Audio (Azalia)
0: Disable, 1: Enable (Default) Azalia controller
@@ -691,9 +703,24 @@
**/
UINT8 DmiGen3RxCtlePeaking[4];
-/** Offset 0x0144
+/** Offset 0x0144 - Thermal Velocity Boost Ratio clipping
+ 0(Default): Disabled, 1: Enabled. This service controls Core frequency reduction
+ caused by high package temperatures for processors that implement the Intel Thermal
+ Velocity Boost (TVB) feature
+ 0: Disabled, 1: Enabled
**/
- UINT8 UnusedUpdSpace6[4];
+ UINT8 TvbRatioClipping;
+
+/** Offset 0x0145 - Thermal Velocity Boost voltage optimization
+ 0: Disabled, 1: Enabled(Default). This service controls thermal based voltage optimizations
+ for processors that implement the Intel Thermal Velocity Boost (TVB) feature.
+ 0: Disabled, 1: Enabled
+**/
+ UINT8 TvbVoltageOptimization;
+
+/** Offset 0x0146
+**/
+ UINT8 UnusedUpdSpace6[2];
/** Offset 0x0148 - PEG Gen3 RxCTLEp per-Bundle control
Range: 0-15, 12 is default for each bundle, must be specified based upon platform design
@@ -1374,8 +1401,8 @@
**/
UINT8 PchSmbAlertEnable;
-/** Offset 0x0463 - ReservedSecurityPreMem
- Reserved for Security Pre-Mem
+/** Offset 0x0463 - ReservedPchPreMem
+ Reserved for Pch Pre-Mem
$EN_DIS
**/
UINT8 ReservedPchPreMem[13];
@@ -2428,7 +2455,7 @@
**/
UINT8 Gen3SwEqEnableVocTest;
-/** Offset 0x0537 - PPCIe Rx Compliance Testing Mode
+/** Offset 0x0537 - PCIe Rx Compliance Testing Mode
Disabled(0x0)(Default): Normal Operation - Disable PCIe Rx Compliance testing, Enabled(0x1):
PCIe Rx Compliance Test Mode - PEG controller is in Rx Compliance Testing Mode;
it should only be set when doing PCIe compliance testing
@@ -2522,7 +2549,7 @@
/** Offset 0x0583 - BdatTestType
Indicates the type of Memory Training data to populate into the BDAT ACPI table.
- 0:Rank Marign Tool, 1:Margin2D
+ 0:Rank Margin Tool, 1:Margin2D
**/
UINT8 BdatTestType;
@@ -2542,11 +2569,17 @@
**/
UINT16 BiosSize;
-/** Offset 0x0594 - SecurityTestRsvd
+/** Offset 0x0594 - TxtAcheckRequest
+ Enable/Disable. When Enabled, it will forcing calling TXT Acheck once.
+ $EN_DIS
+**/
+ UINT8 TxtAcheckRequest;
+
+/** Offset 0x0595 - SecurityTestRsvd
Reserved for SA Pre-Mem Test
$EN_DIS
**/
- UINT8 SecurityTestRsvd[4];
+ UINT8 SecurityTestRsvd[3];
/** Offset 0x0598 - Smbus dynamic power gating
Disable or Enable Smbus dynamic power gating.
diff --git a/src/vendorcode/intel/fsp/fsp2_0/cannonlake/FspsUpd.h b/src/vendorcode/intel/fsp/fsp2_0/cannonlake/FspsUpd.h
index 0285dd1..0f3577a 100644
--- a/src/vendorcode/intel/fsp/fsp2_0/cannonlake/FspsUpd.h
+++ b/src/vendorcode/intel/fsp/fsp2_0/cannonlake/FspsUpd.h
@@ -1093,15 +1093,22 @@
**/
UINT16 ImonSlope1[5];
-/** Offset 0x0324 - ReservedCpuPostMemProduction
+/** Offset 0x0324 - CPU VR Power Delivery Design
+ Used to communicate the power delivery design capability of the board. This value
+ is an enum of the available power delivery segments that are defined in the Platform
+ Design Guide.
+**/
+ UINT32 VrPowerDeliveryDesign;
+
+/** Offset 0x0328 - ReservedCpuPostMemProduction
Reserved for CPU Post-Mem Production
$EN_DIS
**/
UINT8 ReservedCpuPostMemProduction[1];
-/** Offset 0x0325
+/** Offset 0x0329
**/
- UINT8 UnusedUpdSpace10[33];
+ UINT8 UnusedUpdSpace10[29];
/** Offset 0x0346 - Enable DMI ASPM
Deprecated.
@@ -1869,7 +1876,6 @@
0x19: 20kOhm weak pull-up - Enable/disable SerialIo I2C0,I2C1,I2C2,I2C3,I2C4,I2C5
pads termination respectively. One byte for each controller, byte0 for I2C0, byte1
for I2C1, and so on.
- 0x1:None, 0x13:1kOhm WPU, 0x15:5kOhm WPU, 0x19:20kOhm WPU
**/
UINT8 PchSerialIoI2cPadsTermination[6];
@@ -2283,7 +2289,7 @@
**/
UINT8 ChapDeviceEnable;
-/** Offset 0x07B2 - Skip PAM regsiter lock
+/** Offset 0x07B2 - Skip PAM register lock
Enable: PAM register will not be locked by RC, platform code should lock it, Disable(Default):
PAM registers will be locked by RC
$EN_DIS
@@ -2830,9 +2836,10 @@
**/
UINT16 PsysPmax;
-/** Offset 0x0858
+/** Offset 0x0858 - Interrupt Response Time Limit of C-State LatencyContol0
+ Interrupt Response Time Limit of C-State LatencyContol0.Range of value 0 to 0x3FF
**/
- UINT8 Reserved0[2];
+ UINT16 CstateLatencyControl0Irtl;
/** Offset 0x085A - Interrupt Response Time Limit of C-State LatencyContol1
Interrupt Response Time Limit of C-State LatencyContol1.Range of value 0 to 0x3FF
@@ -3074,8 +3081,7 @@
UINT8 PchUnlockGpioPads;
/** Offset 0x08C2 - PCH Unlock SBI access
- This unlock the SBI lock bit to allow SBI after post time. 0: Lock SBI access; 1:
- Unlock SBI access.
+ Deprecated
$EN_DIS
**/
UINT8 PchSbiUnlock;
diff --git a/src/vendorcode/intel/fsp/fsp2_0/cannonlake/FsptUpd.h b/src/vendorcode/intel/fsp/fsp2_0/cannonlake/FsptUpd.h
new file mode 100644
index 0000000..eeba7ae
--- /dev/null
+++ b/src/vendorcode/intel/fsp/fsp2_0/cannonlake/FsptUpd.h
@@ -0,0 +1,136 @@
+/** @file
+
+Copyright (c) 2018, Intel Corporation. All rights reserved.<BR>
+
+Redistribution and use in source and binary forms, with or without modification,
+are permitted provided that the following conditions are met:
+
+* Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+* Redistributions in binary form must reproduce the above copyright notice, this
+ list of conditions and the following disclaimer in the documentation and/or
+ other materials provided with the distribution.
+* Neither the name of Intel Corporation nor the names of its contributors may
+ be used to endorse or promote products derived from this software without
+ specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ THE POSSIBILITY OF SUCH DAMAGE.
+
+ This file is automatically generated. Please do NOT modify !!!
+
+**/
+
+#ifndef __FSPTUPD_H__
+#define __FSPTUPD_H__
+
+#include <FspUpd.h>
+
+#pragma pack(1)
+
+
+/** Fsp T Core UPD
+**/
+typedef struct {
+
+/** Offset 0x0020
+**/
+ UINT32 MicrocodeRegionBase;
+
+/** Offset 0x0024
+**/
+ UINT32 MicrocodeRegionSize;
+
+/** Offset 0x0028
+**/
+ UINT32 CodeRegionBase;
+
+/** Offset 0x002C
+**/
+ UINT32 CodeRegionSize;
+
+/** Offset 0x0030
+**/
+ UINT8 Reserved[16];
+} FSPT_CORE_UPD;
+
+/** Fsp T Configuration
+**/
+typedef struct {
+
+/** Offset 0x0040 - PcdSerialIoUartDebugEnable
+ Enable SerialIo Uart debug library with/without initializing SerialIo Uart device in FSP.
+ 0:Disable, 1:Enable and Initialize, 2:Enable without Initializing
+**/
+ UINT8 PcdSerialIoUartDebugEnable;
+
+/** Offset 0x0041 - PcdSerialIoUartNumber - FSPT
+ Select SerialIo Uart Controller for debug. Note: If UART0 is selected as CNVi BT
+ Core interface, it cannot be used for debug purpose.
+ 0:SerialIoUart0, 1:SerialIoUart1, 2:SerialIoUart2
+**/
+ UINT8 PcdSerialIoUartNumber;
+
+/** Offset 0x0042 - PcdSerialIoUart0PinMuxing - FSPT
+ Select SerialIo Uart0 pin muxing. Setting valid only if PcdSerialIoUartNumber is
+ set to UART0.
+ 0:default pins, 1:pins muxed with CNV_BRI/RGI
+**/
+ UINT8 PcdSerialIoUart0PinMuxing;
+
+/** Offset 0x0043
+**/
+ UINT8 UnusedUpdSpace0;
+
+/** Offset 0x0044
+**/
+ UINT32 PcdSerialIoUartInputClock;
+
+/** Offset 0x0048 - Pci Express Base Address
+ Base address to be programmed for Pci Express
+**/
+ UINT64 PcdPciExpressBaseAddress;
+
+/** Offset 0x0050 - Pci Express Region Length
+ Region Length to be programmed for Pci Express
+**/
+ UINT32 PcdPciExpressRegionLength;
+
+/** Offset 0x0054
+**/
+ UINT8 ReservedFsptUpd1[44];
+} FSP_T_CONFIG;
+
+/** Fsp T UPD Configuration
+**/
+typedef struct {
+
+/** Offset 0x0000
+**/
+ FSP_UPD_HEADER FspUpdHeader;
+
+/** Offset 0x0020
+**/
+ FSPT_CORE_UPD FsptCoreUpd;
+
+/** Offset 0x0040
+**/
+ FSP_T_CONFIG FsptConfig;
+
+/** Offset 0x0080
+**/
+ UINT16 UpdTerminator;
+} FSPT_UPD;
+
+#pragma pack()
+
+#endif
diff --git a/src/vendorcode/intel/fsp/fsp2_0/cannonlake/MemInfoHob.h b/src/vendorcode/intel/fsp/fsp2_0/cannonlake/MemInfoHob.h
index 435eccb..941a891 100644
--- a/src/vendorcode/intel/fsp/fsp2_0/cannonlake/MemInfoHob.h
+++ b/src/vendorcode/intel/fsp/fsp2_0/cannonlake/MemInfoHob.h
@@ -84,6 +84,19 @@
} SiMrcVersion;
//
+// Matches MrcChannelSts enum in MRC
+//
+#ifndef CHANNEL_NOT_PRESENT
+#define CHANNEL_NOT_PRESENT 0 // There is no channel present on the controller.
+#endif
+#ifndef CHANNEL_DISABLED
+#define CHANNEL_DISABLED 1 // There is a channel present but it is disabled.
+#endif
+#ifndef CHANNEL_PRESENT
+#define CHANNEL_PRESENT 2 // There is a channel present and it is enabled.
+#endif
+
+//
// Matches MrcDimmSts enum in MRC
//
#ifndef DIMM_ENABLED
--
To view, visit https://review.coreboot.org/23677
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I32e976eacf39d2cd75f8288c86d1de1a54c194c6
Gerrit-Change-Number: 23677
Gerrit-PatchSet: 1
Gerrit-Owner: Lijian Zhao <lijian.zhao(a)intel.com>