From: Linus Torvalds Date: Tue, 12 Nov 2013 07:52:17 +0000 (+0900) Subject: Merge tag 'devicetree-for-3.13' of git://git.kernel.org/pub/scm/linux/kernel/git... X-Git-Tag: v3.13-rc1~117 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=10d0c9705e80bbd3d587c5fad24599aabaca6688;p=profile%2Fivi%2Fkernel-x86-ivi.git Merge tag 'devicetree-for-3.13' of git://git./linux/kernel/git/robh/linux Pull devicetree updates from Rob Herring: "DeviceTree updates for 3.13. This is a bit larger pull request than usual for this cycle with lots of clean-up. - Cross arch clean-up and consolidation of early DT scanning code. - Clean-up and removal of arch prom.h headers. Makes arch specific prom.h optional on all but Sparc. - Addition of interrupts-extended property for devices connected to multiple interrupt controllers. - Refactoring of DT interrupt parsing code in preparation for deferred probe of interrupts. - ARM cpu and cpu topology bindings documentation. - Various DT vendor binding documentation updates" * tag 'devicetree-for-3.13' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux: (82 commits) powerpc: add missing explicit OF includes for ppc dt/irq: add empty of_irq_count for !OF_IRQ dt: disable self-tests for !OF_IRQ of: irq: Fix interrupt-map entry matching MIPS: Netlogic: replace early_init_devtree() call of: Add Panasonic Corporation vendor prefix of: Add Chunghwa Picture Tubes Ltd. vendor prefix of: Add AU Optronics Corporation vendor prefix of/irq: Fix potential buffer overflow of/irq: Fix bug in interrupt parsing refactor. of: set dma_mask to point to coherent_dma_mask of: add vendor prefix for PHYTEC Messtechnik GmbH DT: sort vendor-prefixes.txt of: Add vendor prefix for Cadence of: Add empty for_each_available_child_of_node() macro definition arm/versatile: Fix versatile irq specifications. of/irq: create interrupts-extended property microblaze/pci: Drop PowerPC-ism from irq parsing of/irq: Create of_irq_parse_and_map_pci() to consolidate arch code. of/irq: Use irq_of_parse_and_map() ... --- 10d0c9705e80bbd3d587c5fad24599aabaca6688 diff --cc Documentation/devicetree/bindings/vendor-prefixes.txt index 04eab45,1809eae..ce95ed1 --- a/Documentation/devicetree/bindings/vendor-prefixes.txt +++ b/Documentation/devicetree/bindings/vendor-prefixes.txt @@@ -15,9 -16,10 +16,11 @@@ auo AU Optronics Corporatio 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) diff --cc arch/arm/mach-integrator/pci_v3.c index c9c5a33,a87e510..c5e01b2 --- a/arch/arm/mach-integrator/pci_v3.c +++ b/arch/arm/mach-integrator/pci_v3.c @@@ -808,22 -809,21 +808,6 @@@ static u8 __init pci_v3_swizzle(struct 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, diff --cc arch/powerpc/include/asm/prom.h index bf09e5a,7687f82..d977b9b --- a/arch/powerpc/include/asm/prom.h +++ b/arch/powerpc/include/asm/prom.h @@@ -44,13 -39,9 +39,6 @@@ void of_parse_dma_window(struct device_ 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); diff --cc drivers/of/fdt.c index a4fa9ad,5c47910..2fa024b --- a/drivers/of/fdt.c +++ b/drivers/of/fdt.c @@@ -801,4 -910,39 +909,28 @@@ void __init unflatten_device_tree(void 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); diff --cc drivers/pci/host/pci-mvebu.c index 80b2250,07ddb3a..c269e43 --- a/drivers/pci/host/pci-mvebu.c +++ b/drivers/pci/host/pci-mvebu.c @@@ -732,10 -693,9 +719,10 @@@ static void mvebu_pcie_enable(struct mv 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); }