Skip to content

Commit df08ac0

Browse files
paliLorenzo Pieralisi
authored andcommitted
PCI: mvebu: Setup PCIe controller to Root Complex mode
This driver operates only in Root Complex mode, so ensure that hardware is properly configured in Root Complex mode. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Pali Rohár <[email protected]> Signed-off-by: Lorenzo Pieralisi <[email protected]>
1 parent e7a0187 commit df08ac0

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

drivers/pci/controller/pci-mvebu.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
#define PCIE_MASK_ENABLE_INTS 0x0f000000
5656
#define PCIE_CTRL_OFF 0x1a00
5757
#define PCIE_CTRL_X1_MODE 0x0001
58+
#define PCIE_CTRL_RC_MODE BIT(1)
5859
#define PCIE_STAT_OFF 0x1a04
5960
#define PCIE_STAT_BUS 0xff00
6061
#define PCIE_STAT_DEV 0x1f0000
@@ -213,7 +214,12 @@ static void mvebu_pcie_setup_wins(struct mvebu_pcie_port *port)
213214

214215
static void mvebu_pcie_setup_hw(struct mvebu_pcie_port *port)
215216
{
216-
u32 cmd, mask;
217+
u32 ctrl, cmd, mask;
218+
219+
/* Setup PCIe controller to Root Complex mode. */
220+
ctrl = mvebu_readl(port, PCIE_CTRL_OFF);
221+
ctrl |= PCIE_CTRL_RC_MODE;
222+
mvebu_writel(port, ctrl, PCIE_CTRL_OFF);
217223

218224
/* Disable Root Bridge I/O space, memory space and bus mastering. */
219225
cmd = mvebu_readl(port, PCIE_CMD_OFF);

0 commit comments

Comments
 (0)