avago Avago Technologies
  bosch Bosch Sensortec GmbH
  brcm  Broadcom Corporation
 +capella       Capella Microsystems, Inc
  cavium        Cavium, Inc.
+ cdns  Cadence Design Systems Inc.
  chrp  Common Hardware Reference Platform
+ chunghwa      Chunghwa Picture Tubes Ltd.
  cirrus        Cirrus Logic, Inc.
  cortina       Cortina Systems, Inc.
  dallas        Maxim Integrated Products (formerly Dallas Semiconductor)
 
        return pci_common_swizzle(dev, pinp);
  }
  
- static int __init pci_v3_map_irq_dt(const struct pci_dev *dev, u8 slot, u8 pin)
- {
-       struct of_irq oirq;
-       int ret;
 -static int irq_tab[4] __initdata = {
 -      IRQ_AP_PCIINT0, IRQ_AP_PCIINT1, IRQ_AP_PCIINT2, IRQ_AP_PCIINT3
 -};
--
-       ret = of_irq_map_pci(dev, &oirq);
-       if (ret) {
-               dev_err(&dev->dev, "of_irq_map_pci() %d\n", ret);
-               /* Proper return code 0 == NO_IRQ */
-               return 0;
-       }
 -/*
 - * map the specified device/slot/pin to an IRQ.  This works out such
 - * that slot 9 pin 1 is INT0, pin 2 is INT1, and slot 10 pin 1 is INT1.
 - */
 -static int __init pci_v3_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
 -{
 -      int intnr = ((slot - 9) + (pin - 1)) & 3;
--
-       return irq_create_of_mapping(oirq.controller, oirq.specifier,
-                                    oirq.size);
 -      return irq_tab[intnr];
--}
--
  static struct hw_pci pci_v3 __initdata = {
        .swizzle                = pci_v3_swizzle,
        .setup                  = pci_v3_setup,
 
  
  extern void kdump_move_device_tree(void);
  
- #ifdef CONFIG_NUMA
- extern int of_node_to_nid(struct device_node *device);
- #else
- static inline int of_node_to_nid(struct device_node *device) { return 0; }
- #endif
- #define of_node_to_nid of_node_to_nid
 -/* cache lookup */
 -struct device_node *of_find_next_cache_node(struct device_node *np);
--
  extern void of_instantiate_rtc(void);
  
  extern int of_get_ibm_chip_id(struct device_node *np);
 
        of_alias_scan(early_init_dt_alloc_memory_arch);
  }
  
+ /**
+  * unflatten_and_copy_device_tree - copy and create tree of device_nodes from flat blob
+  *
+  * Copies and unflattens the device-tree passed by the firmware, creating the
+  * tree of struct device_node. It also fills the "name" and "type"
+  * pointers of the nodes so the normal device-tree walking functions
+  * can be used. This should only be used when the FDT memory has not been
+  * reserved such is the case when the FDT is built-in to the kernel init
+  * section. If the FDT memory is reserved already then unflatten_device_tree
+  * should be used instead.
+  */
+ void __init unflatten_and_copy_device_tree(void)
+ {
+       int size = __be32_to_cpu(initial_boot_params->totalsize);
+       void *dt = early_init_dt_alloc_memory_arch(size,
+               __alignof__(struct boot_param_header));
+ 
+       if (dt) {
+               memcpy(dt, initial_boot_params, size);
+               initial_boot_params = dt;
+       }
+       unflatten_device_tree();
+ }
+ 
  #endif /* CONFIG_OF_EARLY_FLATTREE */
 -
 -/* Feed entire flattened device tree into the random pool */
 -static int __init add_fdt_randomness(void)
 -{
 -      if (initial_boot_params)
 -              add_device_randomness(initial_boot_params,
 -                              be32_to_cpu(initial_boot_params->totalsize));
 -
 -      return 0;
 -}
 -core_initcall(add_fdt_randomness);
 
        hw.private_data   = (void **)&pcie;
        hw.setup          = mvebu_pcie_setup;
        hw.scan           = mvebu_pcie_scan_bus;
-       hw.map_irq        = mvebu_pcie_map_irq;
+       hw.map_irq        = of_irq_parse_and_map_pci;
        hw.ops            = &mvebu_pcie_ops;
        hw.align_resource = mvebu_pcie_align_resource;
 +      hw.add_bus        = mvebu_pcie_add_bus;
  
        pci_common_init(&hw);
  }