]> git.sur5r.net Git - u-boot/blobdiff - drivers/pci/pci_common.c
mtd: spi: Correct parameters for s25fs512s flash
[u-boot] / drivers / pci / pci_common.c
index 1755914b4eb9f86790ea91d27efabab0992b3ad3..9f2d2678e37e14abc38a1eab0caabda85b7c33ae 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * Copyright (c) 2014 Google, Inc
  *
@@ -6,8 +7,6 @@
  *
  * (C) Copyright 2002, 2003
  * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
- *
- * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #include <common.h>
@@ -89,7 +88,7 @@ __weak int pci_skip_dev(struct pci_controller *hose, pci_dev_t dev)
                /*
                 * Only skip configuration if "pciconfighost" is not set
                 */
-               if (getenv("pciconfighost") == NULL)
+               if (env_get("pciconfighost") == NULL)
                        return 1;
 #else
                return 1;
@@ -181,11 +180,6 @@ phys_addr_t pci_hose_bus_to_phys(struct pci_controller *hose,
                return phys_addr;
        }
 
-#ifdef CONFIG_DM_PCI
-       /* The root controller has the region information */
-       hose = pci_bus_to_hose(0);
-#endif
-
        /*
         * if PCI_REGION_MEM is set we do a two pass search with preference
         * on matches that don't have PCI_REGION_SYS_MEMORY set
@@ -236,6 +230,13 @@ int __pci_hose_phys_to_bus(struct pci_controller *hose,
        return 1;
 }
 
+/*
+ * pci_hose_phys_to_bus(): Convert physical address to bus address
+ * @hose:      PCI hose of the root PCI controller
+ * @phys_addr: physical address to convert
+ * @flags:     flags of pci regions
+ * @return bus address if OK, 0 on error
+ */
 pci_addr_t pci_hose_phys_to_bus(struct pci_controller *hose,
                                phys_addr_t phys_addr,
                                unsigned long flags)
@@ -248,11 +249,6 @@ pci_addr_t pci_hose_phys_to_bus(struct pci_controller *hose,
                return bus_addr;
        }
 
-#ifdef CONFIG_DM_PCI
-       /* The root controller has the region information */
-       hose = pci_bus_to_hose(0);
-#endif
-
        /*
         * if PCI_REGION_MEM is set we do a two pass search with preference
         * on matches that don't have PCI_REGION_SYS_MEMORY set