summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNico Huber <nico.h@gmx.de>2024-01-12 16:22:19 +0100
committerFelix Singer <service+coreboot-gerrit@felixsinger.de>2024-01-17 22:07:04 +0000
commit8b4677fbbf2dd9d748ecba023c4a07afcaa2d7d0 (patch)
tree723ac8d382a56e5f689cfe0f5f1e3405df83d750
parent059476d18c8e8e09fa5a42b1db24b965fa08f71a (diff)
soc/intel/elkhartlake: Drop redundant PcieRpEnable
The PcieRpEnable option is redundant to our on/off setting in the devicetrees. Let's use the common coreboot infracture instead. Thanks to Nicholas for doing all the mainboard legwork! Change-Id: I11c3c45eae0e1451d5c54c17b7e60300dedda8fa Signed-off-by: Nico Huber <nico.h@gmx.de> Signed-off-by: Nicholas Sudsgaard <devel+coreboot@nsudsgaard.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/79921 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Jan Samek <jan.samek@siemens.com> Reviewed-by: Felix Singer <service+coreboot-gerrit@felixsinger.de>
-rw-r--r--src/mainboard/intel/elkhartlake_crb/variants/ehlcrb/devicetree.cb8
-rw-r--r--src/mainboard/protectli/vault_ehl/devicetree.cb6
-rw-r--r--src/mainboard/siemens/fa_ehl/variants/fa_ehl/devicetree.cb3
-rw-r--r--src/mainboard/siemens/mc_ehl/variants/mc_ehl1/devicetree.cb6
-rw-r--r--src/mainboard/siemens/mc_ehl/variants/mc_ehl2/devicetree.cb3
-rw-r--r--src/mainboard/siemens/mc_ehl/variants/mc_ehl3/devicetree.cb4
-rw-r--r--src/mainboard/siemens/mc_ehl/variants/mc_ehl4/devicetree.cb6
-rw-r--r--src/mainboard/siemens/mc_ehl/variants/mc_ehl5/devicetree.cb3
-rw-r--r--src/soc/intel/elkhartlake/Makefile.inc2
-rw-r--r--src/soc/intel/elkhartlake/chip.c6
-rw-r--r--src/soc/intel/elkhartlake/chip.h1
-rw-r--r--src/soc/intel/elkhartlake/include/soc/pcie.h10
-rw-r--r--src/soc/intel/elkhartlake/pcie_rp.c10
-rw-r--r--src/soc/intel/elkhartlake/romstage/fsp_params.c13
14 files changed, 26 insertions, 55 deletions
diff --git a/src/mainboard/intel/elkhartlake_crb/variants/ehlcrb/devicetree.cb b/src/mainboard/intel/elkhartlake_crb/variants/ehlcrb/devicetree.cb
index 2c952bf9c1..732c39604d 100644
--- a/src/mainboard/intel/elkhartlake_crb/variants/ehlcrb/devicetree.cb
+++ b/src/mainboard/intel/elkhartlake_crb/variants/ehlcrb/devicetree.cb
@@ -42,14 +42,6 @@ chip soc/intel/elkhartlake
register "SkipCpuReplacementCheck" = "1"
# PCIe root ports related UPDs
- register "PcieRpEnable[0]" = "1"
- register "PcieRpEnable[1]" = "1"
- register "PcieRpEnable[2]" = "1"
- register "PcieRpEnable[3]" = "1"
- register "PcieRpEnable[4]" = "1"
- register "PcieRpEnable[5]" = "1"
- register "PcieRpEnable[6]" = "1"
-
register "PcieClkSrcUsage[0]" = "0x00"
register "PcieClkSrcUsage[1]" = "0x06"
register "PcieClkSrcUsage[2]" = "0x04"
diff --git a/src/mainboard/protectli/vault_ehl/devicetree.cb b/src/mainboard/protectli/vault_ehl/devicetree.cb
index d21383e8d6..bfb7937c71 100644
--- a/src/mainboard/protectli/vault_ehl/devicetree.cb
+++ b/src/mainboard/protectli/vault_ehl/devicetree.cb
@@ -43,12 +43,6 @@ chip soc/intel/elkhartlake
register "usb3_ports[3]" = "USB3_PORT_EMPTY"
# PCIe root ports related UPDs
- register "PcieRpEnable[0]" = "1"
- register "PcieRpEnable[1]" = "1"
- register "PcieRpEnable[2]" = "1"
- register "PcieRpEnable[4]" = "1"
- register "PcieRpEnable[6]" = "1"
-
register "PcieClkSrcUsage[0]" = "PCIE_CLK_NOTUSED"
register "PcieClkSrcUsage[1]" = "PCIE_CLK_FREE"
register "PcieClkSrcUsage[2]" = "PCIE_CLK_FREE"
diff --git a/src/mainboard/siemens/fa_ehl/variants/fa_ehl/devicetree.cb b/src/mainboard/siemens/fa_ehl/variants/fa_ehl/devicetree.cb
index 5bc393189b..5c6cbc060b 100644
--- a/src/mainboard/siemens/fa_ehl/variants/fa_ehl/devicetree.cb
+++ b/src/mainboard/siemens/fa_ehl/variants/fa_ehl/devicetree.cb
@@ -40,9 +40,6 @@ chip soc/intel/elkhartlake
register "SkipCpuReplacementCheck" = "1"
# PCIe root ports related UPDs
- register "PcieRpEnable[1]" = "1"
- register "PcieRpEnable[6]" = "1"
-
register "PcieClkSrcUsage[0]" = "PCIE_CLK_NOTUSED"
register "PcieClkSrcUsage[1]" = "PCIE_CLK_FREE"
register "PcieClkSrcUsage[2]" = "PCIE_CLK_NOTUSED"
diff --git a/src/mainboard/siemens/mc_ehl/variants/mc_ehl1/devicetree.cb b/src/mainboard/siemens/mc_ehl/variants/mc_ehl1/devicetree.cb
index 6994e8ca15..60c4b474c7 100644
--- a/src/mainboard/siemens/mc_ehl/variants/mc_ehl1/devicetree.cb
+++ b/src/mainboard/siemens/mc_ehl/variants/mc_ehl1/devicetree.cb
@@ -40,12 +40,6 @@ chip soc/intel/elkhartlake
register "SkipCpuReplacementCheck" = "1"
# PCIe root ports related UPDs
- register "PcieRpEnable[0]" = "1"
- register "PcieRpEnable[1]" = "1"
- register "PcieRpEnable[2]" = "1"
- register "PcieRpEnable[3]" = "1"
- register "PcieRpEnable[6]" = "1"
-
register "PcieClkSrcUsage[0]" = "PCIE_CLK_FREE"
register "PcieClkSrcUsage[1]" = "PCIE_CLK_FREE"
register "PcieClkSrcUsage[2]" = "PCIE_CLK_FREE"
diff --git a/src/mainboard/siemens/mc_ehl/variants/mc_ehl2/devicetree.cb b/src/mainboard/siemens/mc_ehl/variants/mc_ehl2/devicetree.cb
index f14c225a0b..abad9c7037 100644
--- a/src/mainboard/siemens/mc_ehl/variants/mc_ehl2/devicetree.cb
+++ b/src/mainboard/siemens/mc_ehl/variants/mc_ehl2/devicetree.cb
@@ -40,9 +40,6 @@ chip soc/intel/elkhartlake
register "SkipCpuReplacementCheck" = "1"
# PCIe root ports related UPDs
- register "PcieRpEnable[1]" = "1"
- register "PcieRpEnable[6]" = "1"
-
register "PcieClkSrcUsage[0]" = "PCIE_CLK_NOTUSED"
register "PcieClkSrcUsage[1]" = "PCIE_CLK_FREE"
register "PcieClkSrcUsage[2]" = "PCIE_CLK_NOTUSED"
diff --git a/src/mainboard/siemens/mc_ehl/variants/mc_ehl3/devicetree.cb b/src/mainboard/siemens/mc_ehl/variants/mc_ehl3/devicetree.cb
index 9a0142c3dd..3f4461624a 100644
--- a/src/mainboard/siemens/mc_ehl/variants/mc_ehl3/devicetree.cb
+++ b/src/mainboard/siemens/mc_ehl/variants/mc_ehl3/devicetree.cb
@@ -40,10 +40,6 @@ chip soc/intel/elkhartlake
register "SkipCpuReplacementCheck" = "1"
# PCIe root ports related UPDs
- register "PcieRpEnable[1]" = "1"
- register "PcieRpEnable[2]" = "1"
- register "PcieRpEnable[4]" = "1"
-
register "PcieClkSrcUsage[0]" = "PCIE_CLK_NOTUSED"
register "PcieClkSrcUsage[1]" = "PCIE_CLK_FREE"
register "PcieClkSrcUsage[2]" = "PCIE_CLK_FREE"
diff --git a/src/mainboard/siemens/mc_ehl/variants/mc_ehl4/devicetree.cb b/src/mainboard/siemens/mc_ehl/variants/mc_ehl4/devicetree.cb
index e99dd48f06..17d6780d37 100644
--- a/src/mainboard/siemens/mc_ehl/variants/mc_ehl4/devicetree.cb
+++ b/src/mainboard/siemens/mc_ehl/variants/mc_ehl4/devicetree.cb
@@ -40,12 +40,6 @@ chip soc/intel/elkhartlake
register "SkipCpuReplacementCheck" = "1"
# PCIe root ports related UPDs
- register "PcieRpEnable[0]" = "1"
- register "PcieRpEnable[1]" = "1"
- register "PcieRpEnable[2]" = "1"
- register "PcieRpEnable[3]" = "1"
- register "PcieRpEnable[4]" = "1"
-
register "PcieClkSrcUsage[0]" = "PCIE_CLK_FREE"
register "PcieClkSrcUsage[1]" = "PCIE_CLK_FREE"
register "PcieClkSrcUsage[2]" = "PCIE_CLK_FREE"
diff --git a/src/mainboard/siemens/mc_ehl/variants/mc_ehl5/devicetree.cb b/src/mainboard/siemens/mc_ehl/variants/mc_ehl5/devicetree.cb
index 53ea1f6e6b..43697beab8 100644
--- a/src/mainboard/siemens/mc_ehl/variants/mc_ehl5/devicetree.cb
+++ b/src/mainboard/siemens/mc_ehl/variants/mc_ehl5/devicetree.cb
@@ -40,9 +40,6 @@ chip soc/intel/elkhartlake
register "SkipCpuReplacementCheck" = "1"
# PCIe root ports related UPDs
- register "PcieRpEnable[1]" = "1"
- register "PcieRpEnable[6]" = "1"
-
register "PcieClkSrcUsage[0]" = "PCIE_CLK_NOTUSED"
register "PcieClkSrcUsage[1]" = "PCIE_CLK_FREE"
register "PcieClkSrcUsage[2]" = "PCIE_CLK_NOTUSED"
diff --git a/src/soc/intel/elkhartlake/Makefile.inc b/src/soc/intel/elkhartlake/Makefile.inc
index b02cebc8bf..b5f5f2ad74 100644
--- a/src/soc/intel/elkhartlake/Makefile.inc
+++ b/src/soc/intel/elkhartlake/Makefile.inc
@@ -22,6 +22,7 @@ bootblock-y += p2sb.c
romstage-y += espi.c
romstage-y += gpio.c
romstage-y += meminit.c
+romstage-y += pcie_rp.c
romstage-y += reset.c
ramstage-y += acpi.c
@@ -33,6 +34,7 @@ ramstage-y += fsp_params.c
ramstage-y += gpio.c
ramstage-y += lockdown.c
ramstage-y += p2sb.c
+ramstage-y += pcie_rp.c
ramstage-y += pmc.c
ramstage-y += reset.c
ramstage-y += systemagent.c
diff --git a/src/soc/intel/elkhartlake/chip.c b/src/soc/intel/elkhartlake/chip.c
index 20e46c04d8..194591d65a 100644
--- a/src/soc/intel/elkhartlake/chip.c
+++ b/src/soc/intel/elkhartlake/chip.c
@@ -14,14 +14,10 @@
#include <soc/intel/common/vbt.h>
#include <soc/itss.h>
#include <soc/pci_devs.h>
+#include <soc/pcie.h>
#include <soc/ramstage.h>
#include <soc/soc_chip.h>
-static const struct pcie_rp_group pch_rp_groups[] = {
- { .slot = PCH_DEV_SLOT_PCIE, .count = 7, .lcap_port_base = 1 },
- { 0 }
-};
-
#if CONFIG(HAVE_ACPI_TABLES)
const char *soc_acpi_name(const struct device *dev)
{
diff --git a/src/soc/intel/elkhartlake/chip.h b/src/soc/intel/elkhartlake/chip.h
index 204d073365..817689006c 100644
--- a/src/soc/intel/elkhartlake/chip.h
+++ b/src/soc/intel/elkhartlake/chip.h
@@ -212,7 +212,6 @@ struct soc_intel_elkhartlake_config {
uint8_t PchHdaAudioLinkSndwEnable[MAX_HD_AUDIO_SNDW_LINKS];
/* PCIe Root Ports */
- uint8_t PcieRpEnable[CONFIG_MAX_ROOT_PORTS];
uint8_t PcieRpHotPlug[CONFIG_MAX_ROOT_PORTS];
/* PCIe output clocks type to PCIe devices.
diff --git a/src/soc/intel/elkhartlake/include/soc/pcie.h b/src/soc/intel/elkhartlake/include/soc/pcie.h
new file mode 100644
index 0000000000..e7a35413a9
--- /dev/null
+++ b/src/soc/intel/elkhartlake/include/soc/pcie.h
@@ -0,0 +1,10 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#ifndef __SOC_ELKHARTLAKE_PCIE_H__
+#define __SOC_ELKHARTLAKE_PCIE_H__
+
+#include <intelblocks/pcie_rp.h>
+
+extern const struct pcie_rp_group pch_rp_groups[];
+
+#endif /* __SOC_ELKHARTLAKE_PCIE_H__ */
diff --git a/src/soc/intel/elkhartlake/pcie_rp.c b/src/soc/intel/elkhartlake/pcie_rp.c
new file mode 100644
index 0000000000..40606e9f50
--- /dev/null
+++ b/src/soc/intel/elkhartlake/pcie_rp.c
@@ -0,0 +1,10 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#include <intelblocks/pcie_rp.h>
+#include <soc/pci_devs.h>
+#include <soc/pcie.h>
+
+const struct pcie_rp_group pch_rp_groups[] = {
+ { .slot = PCH_DEV_SLOT_PCIE, .count = 7, .lcap_port_base = 1 },
+ { 0 }
+};
diff --git a/src/soc/intel/elkhartlake/romstage/fsp_params.c b/src/soc/intel/elkhartlake/romstage/fsp_params.c
index c7c71aaaee..d85f29160c 100644
--- a/src/soc/intel/elkhartlake/romstage/fsp_params.c
+++ b/src/soc/intel/elkhartlake/romstage/fsp_params.c
@@ -5,8 +5,10 @@
#include <device/device.h>
#include <fsp/util.h>
#include <intelblocks/cpulib.h>
+#include <intelblocks/pcie_rp.h>
#include <soc/iomap.h>
#include <soc/pci_devs.h>
+#include <soc/pcie.h>
#include <soc/romstage.h>
#include <soc/soc_chip.h>
@@ -19,9 +21,6 @@ enum {
static void soc_memory_init_params(FSP_M_CONFIG *m_cfg,
const struct soc_intel_elkhartlake_config *config)
{
- unsigned int i;
- uint32_t mask = 0;
-
/*
* If IGD is enabled, set IGD stolen size to 60MB.
* Otherwise, skip IGD init in FSP.
@@ -33,13 +32,7 @@ static void soc_memory_init_params(FSP_M_CONFIG *m_cfg,
m_cfg->SaGv = config->SaGv;
m_cfg->RMT = config->RMT;
- /* PCIe root port configuration */
- for (i = 0; i < ARRAY_SIZE(config->PcieRpEnable); i++) {
- if (config->PcieRpEnable[i])
- mask |= (1 << i);
- }
-
- m_cfg->PcieRpEnableMask = mask;
+ m_cfg->PcieRpEnableMask = pcie_rp_enable_mask(pch_rp_groups);
FSP_ARRAY_LOAD(m_cfg->PcieClkSrcUsage, config->PcieClkSrcUsage);
FSP_ARRAY_LOAD(m_cfg->PcieClkSrcClkReq, config->PcieClkSrcClkReq);