summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorKumar Gala <galak@kernel.crashing.org>2010-07-08 22:37:44 -0500
committerKumar Gala <galak@kernel.crashing.org>2010-07-20 04:40:06 -0500
commit6525d51fa5790727c04c4883341bc8f58f8e3bb3 (patch)
tree128725920f92bc648385c74805d2f05e65171088 /drivers
parent75e73afd5784c0df6a5e35c5a5b2e2fce0296bc0 (diff)
downloadu-boot-imx-6525d51fa5790727c04c4883341bc8f58f8e3bb3.zip
u-boot-imx-6525d51fa5790727c04c4883341bc8f58f8e3bb3.tar.gz
u-boot-imx-6525d51fa5790727c04c4883341bc8f58f8e3bb3.tar.bz2
powerpc/85xx & 86xx: Rework ft_fsl_pci_setup to not require aliases
Previously we used an alias the pci node to determine which node to fixup or delete. Now we use the new fdt_node_offset_by_compat_reg to find the node to update. Additionally, we replace the code in each board with a single macro call that makes assumes uniform naming and reduces duplication in this area. Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/pci/fsl_pci_init.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/drivers/pci/fsl_pci_init.c b/drivers/pci/fsl_pci_init.c
index 5a63fa2..001e6eb 100644
--- a/drivers/pci/fsl_pci_init.c
+++ b/drivers/pci/fsl_pci_init.c
@@ -510,18 +510,25 @@ void fsl_pci_config_unlock(struct pci_controller *hose)
#include <libfdt.h>
#include <fdt_support.h>
-void ft_fsl_pci_setup(void *blob, const char *pci_alias,
- struct pci_controller *hose)
+void ft_fsl_pci_setup(void *blob, const char *pci_compat,
+ struct pci_controller *hose, unsigned long ctrl_addr)
{
- int off = fdt_path_offset(blob, pci_alias);
+ int off;
u32 bus_range[2];
+ phys_addr_t p_ctrl_addr = (phys_addr_t)ctrl_addr;
+
+ /* convert ctrl_addr to true physical address */
+ p_ctrl_addr = (phys_addr_t)ctrl_addr - CONFIG_SYS_CCSRBAR;
+ p_ctrl_addr += CONFIG_SYS_CCSRBAR_PHYS;
+
+ off = fdt_node_offset_by_compat_reg(blob, pci_compat, p_ctrl_addr);
if (off < 0)
return;
/* We assume a cfg_addr not being set means we didn't setup the controller */
if ((hose == NULL) || (hose->cfg_addr == NULL)) {
- fdt_del_node_and_alias(blob, pci_alias);
+ fdt_del_node(blob, off);
} else {
bus_range[0] = 0;
bus_range[1] = hose->last_busno - hose->first_busno;