aboutsummaryrefslogtreecommitdiff
path: root/board/tqc/tqm85xx/tqm85xx.c
diff options
context:
space:
mode:
authorKumar Gala2009-09-02 09:03:08 -0500
committerKumar Gala2009-09-08 09:10:07 -0500
commit3e7b6c1f2db5ec31f9e7dbc3e0cbca602167a46a (patch)
treea10000c36ecf3385327c86e27955a74718e67680 /board/tqc/tqm85xx/tqm85xx.c
parent5052a771cf1722c37c732f3c340775b55fbe3a22 (diff)
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/tqc/tqm85xx/tqm85xx.c')
-rw-r--r--board/tqc/tqm85xx/tqm85xx.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/board/tqc/tqm85xx/tqm85xx.c b/board/tqc/tqm85xx/tqm85xx.c
index 277edcd14e8..3931ec5036f 100644
--- a/board/tqc/tqm85xx/tqm85xx.c
+++ b/board/tqc/tqm85xx/tqm85xx.c
@@ -561,8 +561,7 @@ static inline void init_pci1(void)
/* PORPLLSR[16] */
uint pci_clk_sel = gur->porpllsr & MPC85xx_PORDEVSR_PCI1_SPD;
- uint pci_agent = (host_agent == 3) || (host_agent == 4 ) ||
- (host_agent == 6);
+ uint pci_agent = is_fsl_pci_agent(LAW_TRGT_IF_PCI_1, host_agent);
uint pci_speed = CONFIG_SYS_CLK_FREQ; /* PCI PSPEED in [4:5] */
@@ -630,11 +629,10 @@ static inline void init_pcie1(void)
uint host_agent = (gur->porbmsr & MPC85xx_PORBMSR_HA) >> 16;
volatile ccsr_fsl_pci_t *pci = (ccsr_fsl_pci_t *)CONFIG_SYS_PCIE1_ADDR;
struct pci_controller *hose = &pcie1_hose;
- int pcie_ep = (host_agent == 0) || (host_agent == 2 ) ||
- (host_agent == 3);
+ int pcie_ep = is_fsl_pci_agent(LAW_TRGT_IF_PCIE_1, host_agent);
struct pci_region *r = hose->regions;
- int pcie_configured = io_sel >= 1;
+ int pcie_configured = is_fsl_pci_cfg(LAW_TRGT_IF_PCIE_1, io_sel);
if (pcie_configured && !(gur->devdisr & MPC85xx_DEVDISR_PCIE)){
printf ("PCIe: %s, base address %x",