Skip to contentSkip to conversation

pci: mvebu: Add PCIe driver

PATCH New Stefan Roese 1 participant 3 messages Aug 11, 2015

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/3 pci: mvebu: Add PCIe driver

From: Anton Schubert <[email protected]>

This adds a PCI driver for the controllers found on Marvell MVEBU SoCs.

Besides the driver, this patch also removes the statically defined PCI MBUS windows. As they are not needed anymore, since this PCIe driver now creates the windows dynamically.

Tested on Armada XP db-mv784mp-gp eval board using an Intel E1000 PCIe card in all 3 PCIe slots. And on the Armada 38x db-88f6820-gp eval board using this Intel E1000 PCIe card in the PCIe 0 slot.

This port was done in cooperation with Anton Schubert.

---
 arch/arm/mach-mvebu/cpu.c |   8 -
 drivers/pci/Makefile      |   1 +
 drivers/pci/pci_mvebu.c   | 424 ++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 425 insertions(+), 8 deletions(-)
 create mode 100644 drivers/pci/pci_mvebu.c
arch/arm/mach-mvebu/cpu.c +0 -8
index fa82067..6f08811 100644
@@ -18,14 +18,6 @@
 #define DDR_SIZE_CS_OFF(n)	(0x0004 + ((n) << 3))
 
 static struct mbus_win windows[] = {
-	/* PCIE MEM address space */
-	{ MBUS_PCI_MEM_BASE, MBUS_PCI_MEM_SIZE,
-	  CPU_TARGET_PCIE13, CPU_ATTR_PCIE_MEM },
-
-	/* PCIE IO address space */
-	{ MBUS_PCI_IO_BASE, MBUS_PCI_IO_SIZE,
-	  CPU_TARGET_PCIE13, CPU_ATTR_PCIE_IO },
-
 	/* SPI */
 	{ MBUS_SPI_BASE, MBUS_SPI_SIZE,
 	  CPU_TARGET_DEVICEBUS_BOOTROM_SPI, CPU_ATTR_SPIFLASH },
drivers/pci/Makefile +1 -0
index adc238f..bcf8127 100644
@@ -21,6 +21,7 @@ obj-$(CONFIG_PCI_GT64120) += pci_gt64120.o
 obj-$(CONFIG_PCI_MSC01) += pci_msc01.o
 obj-$(CONFIG_PCIE_IMX) += pcie_imx.o
 obj-$(CONFIG_FTPCI100) += pci_ftpci100.o
+obj-$(CONFIG_PCI_MVEBU) += pci_mvebu.o
 obj-$(CONFIG_SH4_PCI) += pci_sh4.o
 obj-$(CONFIG_SH7751_PCI) +=pci_sh7751.o
 obj-$(CONFIG_SH7780_PCI) +=pci_sh7780.o
drivers/pci/pci_mvebu.c new file +424 -0

424 lines not on this page · raw message

Signature · 1 line
2.4.8
#1 lore raw

PATCH 2/3 arm: mvebu: db-mv784mp-gp: Enable PCI support

This patch enabled the MVEBU PCIe support on the db-mv784mp-gp AXP eval board. It also enabled the Intel E1000 driver support and adds the initialization of PCIe network controllers to the board code.

Cc Anton Schubert <[email protected]>
Cc Luka Perkov <[email protected]>
---
 board/Marvell/db-mv784mp-gp/db-mv784mp-gp.c | 7 +++++++
 include/configs/db-mv784mp-gp.h             | 8 ++++++++
 2 files changed, 15 insertions(+)
board/Marvell/db-mv784mp-gp/db-mv784mp-gp.c +7 -0
index 00ca878..84e3e96 100644
@@ -6,6 +6,7 @@
 
 #include <common.h>
 #include <miiphy.h>
+#include <netdev.h>
 #include <asm/io.h>
 #include <asm/arch/cpu.h>
 #include <asm/arch/soc.h>
@@ -82,6 +83,12 @@ int checkboard(void)
 	return 0;
 }
 
+int board_eth_init(bd_t *bis)
+{
+	cpu_eth_init(bis); /* Built in controller(s) come first */
+	return pci_eth_init(bis);
+}
+
 #ifdef CONFIG_RESET_PHY_R
 /* Configure and enable MV88E1545 PHY */
 void reset_phy(void)
include/configs/db-mv784mp-gp.h +8 -0
index 2b177d7..a503465 100644
@@ -33,6 +33,7 @@
 #define CONFIG_CMD_ENV
 #define CONFIG_CMD_I2C
 #define CONFIG_CMD_IDE
+#define CONFIG_CMD_PCI
 #define CONFIG_CMD_PING
 #define CONFIG_CMD_SF
 #define CONFIG_CMD_SPI
@@ -94,6 +95,13 @@
 #define CONFIG_DOS_PARTITION
 #endif /* CONFIG_CMD_IDE */
 
+/* PCIe support */
+#define CONFIG_PCI
+#define CONFIG_PCI_MVEBU
+#define CONFIG_PCI_PNP
+#define CONFIG_PCI_SCAN_SHOW
+#define CONFIG_E1000	/* enable Intel E1000 support for testing */
+
 /*
  * mv-common.h should be defined after CMD configs since it used them
  * to enable certain macros
Signature · 1 line
2.4.8
#2 lore raw

PATCH 3/3 arm: mvebu: db-88f6820-gp: Enable PCI support

In reply to Stefan Roese

This patch enabled the MVEBU PCIe support on the db-88f6820-gp A38x eval board. It also enabled the Intel E1000 driver support and adds the initialization of PCIe network controllers to the board code.

Cc Anton Schubert <[email protected]>
Cc Luka Perkov <[email protected]>
Cc Dirk Eibach <[email protected]>
---
 board/Marvell/db-88f6820-gp/db-88f6820-gp.c | 7 +++++++
 include/configs/db-88f6820-gp.h             | 8 ++++++++
 2 files changed, 15 insertions(+)
board/Marvell/db-88f6820-gp/db-88f6820-gp.c +7 -0
index e661fa1..d3da6fc 100644
@@ -7,6 +7,7 @@
 #include <common.h>
 #include <i2c.h>
 #include <miiphy.h>
+#include <netdev.h>
 #include <asm/io.h>
 #include <asm/arch/cpu.h>
 #include <asm/arch/soc.h>
@@ -132,3 +133,9 @@ int checkboard(void)
 
 	return 0;
 }
+
+int board_eth_init(bd_t *bis)
+{
+	cpu_eth_init(bis); /* Built in controller(s) come first */
+	return pci_eth_init(bis);
+}
include/configs/db-88f6820-gp.h +8 -0
index 7c32edb..1dd4182 100644
@@ -41,6 +41,7 @@
 #define CONFIG_CMD_FS_GENERIC
 #define CONFIG_CMD_I2C
 #define CONFIG_CMD_MMC
+#define CONFIG_CMD_PCI
 #define CONFIG_CMD_PING
 #define CONFIG_CMD_SCSI
 #define CONFIG_CMD_SF
@@ -106,6 +107,13 @@
 #define CONFIG_SYS_NETA_INTERFACE_TYPE	PHY_INTERFACE_MODE_RGMII
 #define PHY_ANEG_TIMEOUT	8000	/* PHY needs a longer aneg time */
 
+/* PCIe support */
+#define CONFIG_PCI
+#define CONFIG_PCI_MVEBU
+#define CONFIG_PCI_PNP
+#define CONFIG_PCI_SCAN_SHOW
+#define CONFIG_E1000	/* enable Intel E1000 support for testing */
+
 #define CONFIG_SYS_CONSOLE_INFO_QUIET	/* don't print console @ startup */
 #define CONFIG_SYS_ALT_MEMTEST
 
Signature · 1 line
2.4.8