]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
ppc/85xx: Move to using fsl_setup_hose on TQM 85xx
authorKumar Gala <galak@kernel.crashing.org>
Wed, 4 Nov 2009 17:39:55 +0000 (11:39 -0600)
committerKumar Gala <galak@kernel.crashing.org>
Tue, 5 Jan 2010 19:49:07 +0000 (13:49 -0600)
We can use fsl_setup_hose to determine if we are a agent/end-point or
a host.  Rather than using some SoC specific register we can just look
at the PCI cfg space of the host controller to determine this.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
board/tqc/tqm85xx/tqm85xx.c

index 3931ec5036f93fbd49843f25c2924f5ab41a15d4..aa7827e1ec6febc121ff9f285e9e2b2a82a71692 100644 (file)
@@ -549,7 +549,6 @@ static inline void init_pci1(void)
 {
        volatile ccsr_gur_t *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR);
 #ifdef CONFIG_PCI1
-       uint host_agent = (gur->porbmsr & MPC85xx_PORBMSR_HA) >> 16;
        volatile ccsr_fsl_pci_t *pci = (ccsr_fsl_pci_t *)CONFIG_SYS_PCI1_ADDR;
        struct pci_controller *hose = &pci1_hose;
        struct pci_region *r = hose->regions;
@@ -561,7 +560,7 @@ static inline void init_pci1(void)
        /* PORPLLSR[16] */
        uint pci_clk_sel = gur->porpllsr & MPC85xx_PORDEVSR_PCI1_SPD;
 
-       uint pci_agent = is_fsl_pci_agent(LAW_TRGT_IF_PCI_1, host_agent);
+       int pci_agent = fsl_setup_hose(hose, CONFIG_SYS_PCI1_ADDR);
 
        uint pci_speed = CONFIG_SYS_CLK_FREQ;   /* PCI PSPEED in [4:5] */
 
@@ -626,14 +625,15 @@ static inline void init_pcie1(void)
        volatile ccsr_gur_t *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR);
 #ifdef CONFIG_PCIE1
        uint io_sel = (gur->pordevsr & MPC85xx_PORDEVSR_IO_SEL) >> 19;
-       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 = is_fsl_pci_agent(LAW_TRGT_IF_PCIE_1, host_agent);
+       int pcie_ep;
        struct pci_region *r = hose->regions;
 
        int pcie_configured = is_fsl_pci_cfg(LAW_TRGT_IF_PCIE_1, io_sel);
 
+       pcie_ep = fsl_setup_hose(hose, CONFIG_SYS_PCIE1_ADDR);
+
        if (pcie_configured && !(gur->devdisr & MPC85xx_DEVDISR_PCIE)){
                printf ("PCIe:  %s, base address %x",
                        pcie_ep ? "End point" : "Root complex", (uint)pci);