summaryrefslogtreecommitdiff
path: root/board/freescale/mpc8641hpcn
diff options
context:
space:
mode:
authorKumar Gala <galak@kernel.crashing.org>2009-09-02 09:03:08 -0500
committerTom Rix <Tom.Rix@windriver.com>2009-10-03 09:04:17 -0500
commit865f24dc92d03928c09b7f20a3133823e53c1ac3 (patch)
tree455bd68614d879f650e82fe44f445d903a85e38c /board/freescale/mpc8641hpcn
parent8b8376e81ca725772fa7a3e1b58ca55a761cdf1d (diff)
downloadu-boot-imx-865f24dc92d03928c09b7f20a3133823e53c1ac3.zip
u-boot-imx-865f24dc92d03928c09b7f20a3133823e53c1ac3.tar.gz
u-boot-imx-865f24dc92d03928c09b7f20a3133823e53c1ac3.tar.bz2
ppc/8xxx: Refactor code to determine if PCI is enabled & agent/host
Refactor the code into a simple bitmask lookup table that determines if a given PCI controller is enabled and if its in host/root-complex or agent/end-point mode. Each processor in the PQ3/MPC86xx family specified different encodings for the cfg_host_agt[] and cfg_IO_ports[] boot strapping signals. Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Diffstat (limited to 'board/freescale/mpc8641hpcn')
-rw-r--r--board/freescale/mpc8641hpcn/mpc8641hpcn.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/board/freescale/mpc8641hpcn/mpc8641hpcn.c b/board/freescale/mpc8641hpcn/mpc8641hpcn.c
index fab4fae..1a08afa 100644
--- a/board/freescale/mpc8641hpcn/mpc8641hpcn.c
+++ b/board/freescale/mpc8641hpcn/mpc8641hpcn.c
@@ -155,15 +155,14 @@ void pci_init_board(void)
uint devdisr = gur->devdisr;
uint io_sel = (gur->pordevsr & MPC8641_PORDEVSR_IO_SEL)
>> MPC8641_PORDEVSR_IO_SEL_SHIFT;
+ int pcie_configured = is_fsl_pci_cfg(LAW_TRGT_IF_PCIE_1, io_sel);
#ifdef DEBUG
uint host1_agent = (gur->porbmsr & MPC8641_PORBMSR_HA)
>> MPC8641_PORBMSR_HA_SHIFT;
uint pex1_agent = (host1_agent == 0) || (host1_agent == 1);
#endif
- if ((io_sel == 2 || io_sel == 3 || io_sel == 5
- || io_sel == 6 || io_sel == 7 || io_sel == 0xF)
- && !(devdisr & MPC86xx_DEVDISR_PCIEX1)) {
+ if (pcie_configured && !(devdisr & MPC86xx_DEVDISR_PCIEX1)) {
debug("PCI-EXPRESS 1: %s \n", pex1_agent ? "Agent" : "Host");
debug("0x%08x=0x%08x ", &pci->pme_msg_det, pci->pme_msg_det);
if (pci->pme_msg_det) {