* [UBOOT PATCH 1/2] arm64: versal: Map PCIe 0x6/0x7 regions for PCIE_DW_AMD
2026-12-03 7:11 [UBOOT PATCH 0/2] Versal Premium Gen 2 CPM6 PCIe support updates Pranav Sanwal
@ 2026-12-03 7:11 ` Pranav Sanwal
2026-12-03 7:11 ` [UBOOT PATCH 2/2] pci: dw_amd: Release CPM6 controller reset before link training Pranav Sanwal
1 sibling, 0 replies; 3+ messages in thread
From: Pranav Sanwal @ 2026-12-03 7:11 UTC (permalink / raw)
To: u-boot; +Cc: git, michal.simek
The 0x600000000 and 0x700000000 device regions in versal_mem_map[] are
only mapped when PCIE_AMD_CPM is enabled. Versal Premium Gen 2 uses
PCIE_DW_AMD, whose CPM6 controller has its DBI and config space in the
0x600000000 region. Enable these regions for PCIE_DW_AMD as well.
Signed-off-by: Pranav Sanwal <pranav.sanwal@amd.com>
---
arch/arm/mach-versal/cpu.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/arm/mach-versal/cpu.c b/arch/arm/mach-versal/cpu.c
index 5edb0a736e5..9123c8e8168 100644
--- a/arch/arm/mach-versal/cpu.c
+++ b/arch/arm/mach-versal/cpu.c
@@ -22,7 +22,7 @@
DECLARE_GLOBAL_DATA_PTR;
-#if CONFIG_IS_ENABLED(PCIE_AMD_CPM)
+#if CONFIG_IS_ENABLED(PCIE_AMD_CPM) || CONFIG_IS_ENABLED(PCIE_DW_AMD)
#define VERSAL_MEM_MAP_USED 5
#else
#define VERSAL_MEM_MAP_USED 3
@@ -61,7 +61,7 @@ static struct mm_region versal_mem_map[VERSAL_MEM_MAP_MAX] = {
.attrs = PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRNE) |
PTE_BLOCK_NON_SHARE |
PTE_BLOCK_PXN | PTE_BLOCK_UXN
-#if CONFIG_IS_ENABLED(PCIE_AMD_CPM)
+#if CONFIG_IS_ENABLED(PCIE_AMD_CPM) || CONFIG_IS_ENABLED(PCIE_DW_AMD)
}, {
.virt = 0x600000000UL,
.phys = 0x600000000UL,
--
2.43.7
^ permalink raw reply related [flat|nested] 3+ messages in thread* [UBOOT PATCH 2/2] pci: dw_amd: Release CPM6 controller reset before link training
2026-12-03 7:11 [UBOOT PATCH 0/2] Versal Premium Gen 2 CPM6 PCIe support updates Pranav Sanwal
2026-12-03 7:11 ` [UBOOT PATCH 1/2] arm64: versal: Map PCIe 0x6/0x7 regions for PCIE_DW_AMD Pranav Sanwal
@ 2026-12-03 7:11 ` Pranav Sanwal
1 sibling, 0 replies; 3+ messages in thread
From: Pranav Sanwal @ 2026-12-03 7:11 UTC (permalink / raw)
To: u-boot; +Cc: git, michal.simek
The CPM6 PCIe controller comes out of power-on in reset and must be
taken out of reset before the link can be trained.
Acquire the optional controller reset from the 'resets' property and
pulse it before host init on CPM6. A missing 'resets' property (or
reset support not being built) is not an error; any other failure to
get the reset fails the probe. MDB5 is brought up by firmware and is
not affected.
Signed-off-by: Pranav Sanwal <pranav.sanwal@amd.com>
---
drivers/pci/pcie_dw_amd.c | 45 +++++++++++++++++++++++++++++++++++++++
1 file changed, 45 insertions(+)
diff --git a/drivers/pci/pcie_dw_amd.c b/drivers/pci/pcie_dw_amd.c
index 9e545d6ec7e..9b06176bffb 100644
--- a/drivers/pci/pcie_dw_amd.c
+++ b/drivers/pci/pcie_dw_amd.c
@@ -9,6 +9,7 @@
#include <dm.h>
#include <log.h>
#include <pci.h>
+#include <reset.h>
#include <wait_bit.h>
#include <asm/gpio.h>
@@ -68,6 +69,7 @@
/* PCIe spec timing requirements */
#define PCIE_RESET_CONFIG_WAIT_MS 100
#define PCIE_T_PERST_WAIT_MS 1
+#define PCIE_T_PVPERL_WAIT_MS 100
/**
* enum amd_dw_pcie_version - AMD DesignWare PCIe controller variant
@@ -193,6 +195,42 @@ static void amd_dw_pcie_host_init(struct amd_dw_pcie *pcie)
pcie_dw_setup_host(pci);
}
+static bool amd_dw_pcie_is_cpm6(const struct amd_dw_pcie *pcie)
+{
+ return pcie->version == AMD_DW_PCIE_CPM6_HOST0 ||
+ pcie->version == AMD_DW_PCIE_CPM6_HOST1;
+}
+
+static int amd_dw_pcie_ctrl_reset(struct udevice *dev)
+{
+ struct reset_ctl ctrl_rst;
+ int ret;
+
+ ret = reset_get_by_index(dev, 0, &ctrl_rst);
+ if (ret == -ENOENT || ret == -ENOTSUPP) {
+ dev_dbg(dev, "no controller reset\n");
+ return 0;
+ }
+ if (ret) {
+ dev_err(dev, "failed to get controller reset: %d\n", ret);
+ return ret;
+ }
+
+ ret = reset_assert(&ctrl_rst);
+ if (!ret) {
+ mdelay(PCIE_T_PVPERL_WAIT_MS);
+ ret = reset_deassert(&ctrl_rst);
+ }
+ if (ret)
+ dev_err(dev, "failed to pulse controller reset: %d\n", ret);
+ else
+ mdelay(PCIE_RESET_CONFIG_WAIT_MS);
+
+ reset_free(&ctrl_rst);
+
+ return ret;
+}
+
static void amd_dw_pcie_request_gpio(struct udevice *dev)
{
struct gpio_desc perst_gpio;
@@ -278,10 +316,17 @@ static int amd_dw_pcie_probe(struct udevice *dev)
{
struct amd_dw_pcie *pcie = dev_get_priv(dev);
struct pcie_dw *pci = &pcie->dw;
+ int ret;
/* Set first bus number */
pci->first_busno = dev_seq(dev);
+ if (amd_dw_pcie_is_cpm6(pcie)) {
+ ret = amd_dw_pcie_ctrl_reset(dev);
+ if (ret)
+ return ret;
+ }
+
amd_dw_pcie_request_gpio(dev);
amd_dw_pcie_host_init(pcie);
amd_dw_pcie_start_link(pcie);
--
2.43.7
^ permalink raw reply related [flat|nested] 3+ messages in thread