Skip to contentSkip to conversation

mpc83xx: Add support for MPC83xx PCI-E controllers

PATCH New Anton Vorontsov 4 participants 5 messages Jan 8, 2009 – Jan 22, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 mpc83xx: Add support for MPC83xx PCI-E controllers

This patch adds support for MPC83xx PCI-E controllers in Root Complex mode.

The patch is based on Tony Li and Dave Liu work[1].

Though unlike the original patch, by default we don't register PCI-E buses for use in U-Boot, we only configure the controllers for future use in other OSes (Linux). This is done because we don't have enough of spare BATs to map all the PCI-E regions.

To actually use PCI-E in U-Boot, users should explicitly define CONFIG_83XX_GENERIC_PCIE_REGISTER_HOSES symbol in the board file. And only then U-Boot will able to access PCI-E, but at the cost of disabled address translation.

[1] http://lists.denx.de/pipermail/u-boot/2008-January/027630.html

---
 cpu/mpc83xx/Makefile          |    1 +
 cpu/mpc83xx/pcie.c            |  314 +++++++++++++++++++++++++++++++++++++++++
 cpu/mpc83xx/speed.c           |    4 +-
 include/asm-ppc/global_data.h |    2 +-
 include/asm-ppc/immap_83xx.h  |  119 +++++++++++++++-
 include/mpc83xx.h             |   67 +++++++--
 include/pci.h                 |    4 +
 7 files changed, 488 insertions(+), 23 deletions(-)
 create mode 100644 cpu/mpc83xx/pcie.c
cpu/mpc83xx/Makefile +1 -0
index fcb6a52..dd35e6b 100644
@@ -39,6 +39,7 @@ COBJS-y += ecc.o
 COBJS-$(CONFIG_QE) += qe_io.o
 COBJS-$(CONFIG_FSL_SERDES) += serdes.o
 COBJS-$(CONFIG_83XX_GENERIC_PCI) += pci.o
+COBJS-$(CONFIG_83XX_GENERIC_PCIE) += pcie.o
 COBJS-$(CONFIG_OF_LIBFDT) += fdt.o
 
 COBJS	:= $(COBJS-y)
cpu/mpc83xx/pcie.c new file +314 -0

314 lines not on this page · raw message

cpu/mpc83xx/speed.c +2 -2
index bf9bf36..4230099 100644
@@ -132,7 +132,7 @@ int get_clocks(void)
 	u32 qe_clk;
 	u32 brg_clk;
 #endif
-#if defined(CONFIG_MPC837X)
+#if defined(CONFIG_MPC837X) || defined(CONFIG_MPC831X)
 	u32 pciexp1_clk;
 	u32 pciexp2_clk;
 #endif
@@ -328,7 +328,7 @@ int get_clocks(void)
 	i2c2_clk = csb_clk; /* i2c-2 clk is equal to csb clk */
 #endif
 
-#if defined(CONFIG_MPC837X)
+#if defined(CONFIG_MPC837X) || defined(CONFIG_MPC831X)
 	switch ((sccr & SCCR_PCIEXP1CM) >> SCCR_PCIEXP1CM_SHIFT) {
 	case 0:
 		pciexp1_clk = 0;
include/asm-ppc/global_data.h +1 -1
index 2bb50b4..e5a3b2c 100644
@@ -75,7 +75,7 @@ typedef	struct	global_data {
 	u32 lbiu_clk;
 	u32 lclk_clk;
 	u32 pci_clk;
-#if defined(CONFIG_MPC837X)
+#if defined(CONFIG_MPC837X) || defined(CONFIG_MPC831X)
 	u32 pciexp1_clk;
 	u32 pciexp2_clk;
 #endif
include/asm-ppc/immap_83xx.h +113 -6

144 lines not on this page · raw message

include/mpc83xx.h +53 -14

94 lines not on this page · raw message

include/pci.h +4 -0
index eebe8a8..072273b 100644
@@ -382,6 +382,8 @@ extern void pci_cfgfunc_config_device(struct pci_controller* hose, pci_dev_t dev
 
 #define MAX_PCI_REGIONS		7
 
+#define INDIRECT_TYPE_NO_PCIE_LINK	1
+
 /*
  * Structure of a PCI controller (host bridge)
  */
@@ -394,6 +396,8 @@ struct pci_controller {
 	volatile unsigned int *cfg_addr;
 	volatile unsigned char *cfg_data;
 
+	int indirect_type;
+
 	struct pci_region regions[MAX_PCI_REGIONS];
 	int region_count;
 
Signature · 1 line
1.5.6.5
#1 lore raw

PATCH 1/3 mpc83xx: Add support for MPC83xx PCI-E controllers

Quoted 16 lines

This patch adds support for MPC83xx PCI-E controllers in Root Complex mode.

The patch is based on Tony Li and Dave Liu work[1].

Though unlike the original patch, by default we don't register PCI-E buses for use in U-Boot, we only configure the controllers for future use in other OSes (Linux). This is done because we don't have enough of spare BATs to map all the PCI-E regions.

To actually use PCI-E in U-Boot, users should explicitly define CONFIG_83XX_GENERIC_PCIE_REGISTER_HOSES symbol in the board file. And only then U-Boot will able to access PCI-E, but at the cost of disabled
address translation.

Quoted 4 lines

[1] http://lists.denx.de/pipermail/u-boot/2008-January/027630.html

#2 lore raw

PATCH 1/3 mpc83xx: Add support for MPC83xx PCI-E controllers

Quoted 16 lines · On Thu, 8 Jan 2009 06:46:55 -0000 "Liu Dave" <[email protected]> wrote:
Quoted 16 lines

This patch adds support for MPC83xx PCI-E controllers in Root Complex mode.

The patch is based on Tony Li and Dave Liu work[1].

Though unlike the original patch, by default we don't register PCI-E buses for use in U-Boot, we only configure the controllers for future use in other OSes (Linux). This is done because we don't have enough of spare BATs to map all the PCI-E regions.

To actually use PCI-E in U-Boot, users should explicitly define CONFIG_83XX_GENERIC_PCIE_REGISTER_HOSES symbol in the board file. And only then U-Boot will able to access PCI-E, but at the cost of disabled
address translation.

Quoted 6 lines
Quoted 4 lines

[1] http://lists.denx.de/pipermail/u-boot/2008-January/027630.html

applied to u-boot-mpc83xx next.

Thanks all,

Kim

#3 lore raw

PATCH 1/3 mpc83xx: Add support for MPC83xx PCI-E controllers

In reply to Anton Vorontsov

cpu/mpc83xx/pcie.c line 88

Quoted 7 lines

+static void mpc83xx_pcie_register_hose(int bus, struct pci_region *reg,

cpu/mpc83xx/pcie.c new file +4 -0
+				       u8 link)
+{
+	extern void disable_addr_trans(void); /* start.S */
+	static struct pci_controller pcie_hose[PCIE_MAX_BUSES];

If PCIe use the hose which is different from PCI hose, after u-boot booting, the command 'pci' only find the PCI controller and device, but not find the PCIe controller and PCIe devices.

#4 lore raw

PATCH 1/3 mpc83xx: Add support for MPC83xx PCI-E controllers

Quoted 10 lines

cpu/mpc83xx/pcie.c line 88

Quoted 6 lines

+static void mpc83xx_pcie_register_hose(int bus, struct pci_region *reg,

cpu/mpc83xx/pcie.c new file +4 -0
+				       u8 link)
+{
+	extern void disable_addr_trans(void); /* start.S */
+	static struct pci_controller pcie_hose[PCIE_MAX_BUSES];

If PCIe use the hose which is different from PCI hose, after u-boot booting, the command 'pci' only find the PCI controller and device, but not find the PCIe controller and PCIe devices.

Please post the patch as reference.

Thanks