summaryrefslogtreecommitdiff
path: root/drivers/of/Kconfig
AgeCommit message (Collapse)Author
2021-10-07of: net: move of_net under net/Jakub Kicinski
Rob suggests to move of_net.c from under drivers/of/ somewhere to the networking code. Suggested-by: Rob Herring <robh@kernel.org> Signed-off-by: Jakub Kicinski <kuba@kernel.org> Reviewed-by: Rob Herring <robh@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2021-06-02of: Drop reserved mem dependency on DMA_DECLARE_COHERENT and DMA_CMARob Herring
Reserved memory regions can be used for more than just DMA regions, so only enabling on DMA_DECLARE_COHERENT (via HAS_DMA) or DMA_CMA is wrong. This effectively doesn't matter except for the few cases arches select NO_DMA. At least, these users of RESERVEDMEM_OF_DECLARE depend on reserved memory support: arch/riscv/mm/init.c:RESERVEDMEM_OF_DECLARE(elfcorehdr, "linux,elfcorehdr", elfcore_hdr_setup); drivers/memory/tegra/tegra210-emc-table.c:RESERVEDMEM_OF_DECLARE(tegra210_emc_table, "nvidia,tegra210-emc-table", drivers/soc/fsl/qbman/bman_ccsr.c:RESERVEDMEM_OF_DECLARE(bman_fbpr, "fsl,bman-fbpr", bman_fbpr); drivers/soc/fsl/qbman/qman_ccsr.c:RESERVEDMEM_OF_DECLARE(qman_fqd, "fsl,qman-fqd", qman_fqd); drivers/soc/fsl/qbman/qman_ccsr.c:RESERVEDMEM_OF_DECLARE(qman_pfdr, "fsl,qman-pfdr", qman_pfdr); Let's simplify things and enable OF_RESERVED_MEM when OF_EARLY_FLATTREE is enabled. Cc: Christoph Hellwig <hch@lst.de> Signed-off-by: Rob Herring <robh@kernel.org> Link: https://lore.kernel.org/r/20210527223217.1572631-1-robh@kernel.org
2020-10-10net: phy: Move of_mdio from drivers/of to drivers/net/mdioCalvin Johnson
Better place for of_mdio.c is drivers/net/mdio. Move of_mdio.c from drivers/of to drivers/net/mdio Signed-off-by: Calvin Johnson <calvin.johnson@oss.nxp.com> Acked-by: Rob Herring <robh@kernel.org> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2020-01-28of: Add OF_DMA_DEFAULT_COHERENT & select it on powerpcMichael Ellerman
There's an OF helper called of_dma_is_coherent(), which checks if a device has a "dma-coherent" property to see if the device is coherent for DMA. But on some platforms devices are coherent by default, and on some platforms it's not possible to update existing device trees to add the "dma-coherent" property. So add a Kconfig symbol to allow arch code to tell of_dma_is_coherent() that devices are coherent by default, regardless of the presence of the property. Select that symbol on powerpc when NOT_COHERENT_CACHE is not set, ie. when the system has a coherent cache. Fixes: 92ea637edea3 ("of: introduce of_dma_is_coherent() helper") Cc: stable@vger.kernel.org # v3.16+ Reported-by: Christian Zigotzky <chzigotzky@xenosoft.de> Tested-by: Christian Zigotzky <chzigotzky@xenosoft.de> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org> Signed-off-by: Rob Herring <robh@kernel.org>
2019-02-20dma-mapping: improve selection of dma_declare_coherent availabilityChristoph Hellwig
This API is primarily used through DT entries, but two architectures and two drivers call it directly. So instead of selecting the config symbol for random architectures pull it in implicitly for the actual users. Also rename the Kconfig option to describe the feature better. Signed-off-by: Christoph Hellwig <hch@lst.de> Acked-by: Paul Burton <paul.burton@mips.com> # MIPS Acked-by: Lee Jones <lee.jones@linaro.org> Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-02-13of: select OF_RESERVED_MEM automaticallyChristoph Hellwig
The OF_RESERVED_MEM can be used if we have either CMA or the generic declare coherent code built and we support the early flattened DT. So don't bother making it a user visible options that is selected by most configs that fit the above category, but just select it when the requirements are met. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Rob Herring <robh@kernel.org>
2018-03-04of: change overlay apply input data from unflattened to FDTFrank Rowand
Move duplicating and unflattening of an overlay flattened devicetree (FDT) into the overlay application code. To accomplish this, of_overlay_apply() is replaced by of_overlay_fdt_apply(). The copy of the FDT (aka "duplicate FDT") now belongs to devicetree code, which is thus responsible for freeing the duplicate FDT. The caller of of_overlay_fdt_apply() remains responsible for freeing the original FDT. The unflattened devicetree now belongs to devicetree code, which is thus responsible for freeing the unflattened devicetree. These ownership changes prevent early freeing of the duplicated FDT or the unflattened devicetree, which could result in use after free errors. of_overlay_fdt_apply() is a private function for the anticipated overlay loader. Update unittest.c to use of_overlay_fdt_apply() instead of of_overlay_apply(). Move overlay fragments from artificial locations in drivers/of/unittest-data/tests-overlay.dtsi into one devicetree source file per overlay. This led to changes in drivers/of/unitest-data/Makefile and drivers/of/unitest.c. - Add overlay directives to the overlay devicetree source files so that dtc will compile them as true overlays into one FDT data chunk per overlay. - Set CFLAGS for drivers/of/unittest-data/testcases.dts so that symbols will be generated for overlay resolution of overlays that are no longer artificially contained in testcases.dts - Unflatten and apply each unittest overlay FDT using of_overlay_fdt_apply(). - Enable the of_resolve_phandles() check for whether the unflattened overlay is detached. This check was previously disabled because the overlays from tests-overlay.dtsi were not unflattened into detached trees. - Other changes to unittest.c infrastructure to manage multiple test FDTs built into the kernel image (access by name instead of arbitrary number). - of_unittest_overlay_high_level(): previously unused code to add properties from the overlay_base devicetree to the live tree was triggered by the restructuring of tests-overlay.dtsi and thus testcases.dts. This exposed two bugs: (1) the need to dup a property before adding it, and (2) property 'name' is auto-generated in the unflatten code and thus will be a duplicate in the __symbols__ node - do not treat this duplicate as an error. Signed-off-by: Frank Rowand <frank.rowand@sony.com>
2018-02-06Merge tag 'pci-v4.16-changes' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci Pull PCI updates from Bjorn Helgaas: - skip AER driver error recovery callbacks for correctable errors reported via ACPI APEI, as we already do for errors reported via the native path (Tyler Baicar) - fix DPC shared interrupt handling (Alex Williamson) - print full DPC interrupt number (Keith Busch) - enable DPC only if AER is available (Keith Busch) - simplify DPC code (Bjorn Helgaas) - calculate ASPM L1 substate parameter instead of hardcoding it (Bjorn Helgaas) - enable Latency Tolerance Reporting for ASPM L1 substates (Bjorn Helgaas) - move ASPM internal interfaces out of public header (Bjorn Helgaas) - allow hot-removal of VGA devices (Mika Westerberg) - speed up unplug and shutdown by assuming Thunderbolt controllers don't support Command Completed events (Lukas Wunner) - add AtomicOps support for GPU and Infiniband drivers (Felix Kuehling, Jay Cornwall) - expose "ari_enabled" in sysfs to help NIC naming (Stuart Hayes) - clean up PCI DMA interface usage (Christoph Hellwig) - remove PCI pool API (replaced with DMA pool) (Romain Perier) - deprecate pci_get_bus_and_slot(), which assumed PCI domain 0 (Sinan Kaya) - move DT PCI code from drivers/of/ to drivers/pci/ (Rob Herring) - add PCI-specific wrappers for dev_info(), etc (Frederick Lawler) - remove warnings on sysfs mmap failure (Bjorn Helgaas) - quiet ROM validation messages (Alex Deucher) - remove redundant memory alloc failure messages (Markus Elfring) - fill in types for compile-time VGA and other I/O port resources (Bjorn Helgaas) - make "pci=pcie_scan_all" work for Root Ports as well as Downstream Ports to help AmigaOne X1000 (Bjorn Helgaas) - add SPDX tags to all PCI files (Bjorn Helgaas) - quirk Marvell 9128 DMA aliases (Alex Williamson) - quirk broken INTx disable on Ceton InfiniTV4 (Bjorn Helgaas) - fix CONFIG_PCI=n build by adding dummy pci_irqd_intx_xlate() (Niklas Cassel) - use DMA API to get MSI address for DesignWare IP (Niklas Cassel) - fix endpoint-mode DMA mask configuration (Kishon Vijay Abraham I) - fix ARTPEC-6 incorrect IS_ERR() usage (Wei Yongjun) - add support for ARTPEC-7 SoC (Niklas Cassel) - add endpoint-mode support for ARTPEC (Niklas Cassel) - add Cadence PCIe host and endpoint controller driver (Cyrille Pitchen) - handle multiple INTx status bits being set in dra7xx (Vignesh R) - translate dra7xx hwirq range to fix INTD handling (Vignesh R) - remove deprecated Exynos PHY initialization code (Jaehoon Chung) - fix MSI erratum workaround for HiSilicon Hip06/Hip07 (Dongdong Liu) - fix NULL pointer dereference in iProc BCMA driver (Ray Jui) - fix Keystone interrupt-controller-node lookup (Johan Hovold) - constify qcom driver structures (Julia Lawall) - rework Tegra config space mapping to increase space available for endpoints (Vidya Sagar) - simplify Tegra driver by using bus->sysdata (Manikanta Maddireddy) - remove PCI_REASSIGN_ALL_BUS usage on Tegra (Manikanta Maddireddy) - add support for Global Fabric Manager Server (GFMS) event to Microsemi Switchtec switch driver (Logan Gunthorpe) - add IDs for Switchtec PSX 24xG3 and PSX 48xG3 (Kelvin Cao) * tag 'pci-v4.16-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci: (140 commits) PCI: cadence: Add EndPoint Controller driver for Cadence PCIe controller dt-bindings: PCI: cadence: Add DT bindings for Cadence PCIe endpoint controller PCI: endpoint: Fix EPF device name to support multi-function devices PCI: endpoint: Add the function number as argument to EPC ops PCI: cadence: Add host driver for Cadence PCIe controller dt-bindings: PCI: cadence: Add DT bindings for Cadence PCIe host controller PCI: Add vendor ID for Cadence PCI: Add generic function to probe PCI host controllers PCI: generic: fix missing call of pci_free_resource_list() PCI: OF: Add generic function to parse and allocate PCI resources PCI: Regroup all PCI related entries into drivers/pci/Makefile PCI/DPC: Reformat DPC register definitions PCI/DPC: Add and use DPC Status register field definitions PCI/DPC: Squash dpc_rp_pio_get_info() into dpc_process_rp_pio_error() PCI/DPC: Remove unnecessary RP PIO register structs PCI/DPC: Push dpc->rp_pio_status assignment into dpc_rp_pio_get_info() PCI/DPC: Squash dpc_rp_pio_print_error() into dpc_rp_pio_get_info() PCI/DPC: Make RP PIO log size check more generic PCI/DPC: Rename local "status" to "dpc_status" PCI/DPC: Squash dpc_rp_pio_print_tlp_header() into dpc_rp_pio_print_error() ...
2018-01-17PCI: Move OF-related PCI functions into PCI coreRob Herring
Following what has been done for other subsystems, move the remaining PCI related code out of drivers/of/ and into drivers/pci/of.c With this, we can kill a few kconfig symbols. Signed-off-by: Rob Herring <robh@kernel.org> [bhelgaas: minor whitespace, comment cleanups] Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Cc: Frank Rowand <frowand.list@gmail.com>
2018-01-08of: Use SPDX license tag for DT filesRob Herring
Convert remaining DT files to use SPDX-License-Identifier tags. Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Cc: Paul Mackerras <paulus@samba.org> Cc: Pantelis Antoniou <pantelis.antoniou@konsulko.com> Reviewed-by: Frank Rowand <frank.rowand@sony.com> Reviewed-by: Philippe Ombredanne <pombredanne@nexb.com> Signed-off-by: Rob Herring <robh@kernel.org>
2017-12-12of: enable unittests on UMLRob Herring
The unittests can run on UML, but OF_IRQ and OF_ADDRESS need to be enabled. Rework the kconfig dependencies to enable the unittests. The unittests cannot build on Sparc, so we need to add an explicit dependency for !SPARC. There's one failure in overlay tests because the base DT is not unflattened early. Cc: Thomas Meyer <thomas@m3y3r.de> Signed-off-by: Rob Herring <robh@kernel.org>
2017-10-16of: make kobject and bin_attribute support configurableRob Herring
Having device_nodes be kobjects is only needed if sysfs or OF_DYNAMIC is enabled. Otherwise, having a kobject in struct device_node is unnecessary bloat in minimal kernel configurations. Likewise, bin_attribute is only needed in struct property when sysfs is enabled, so we can make it configurable too. Tested-by: Nicolas Pitre <nico@linaro.org> Reviewed-by: Frank Rowand <frowand.list@gmail.com> Acked-by: Grant Likely <grant.likely@secretlab.ca> Signed-off-by: Rob Herring <robh@kernel.org>
2016-09-23mtd: Kill the OF_MTD Kconfig optionBoris Brezillon
Commit d48f62b9a0a0 ("mtd: nand: move of_get_nand_xxx() helpers into nand_base.c") removed the drivers/of/of_mtd.c file but did not remove the associated OF_MTD Kconfig option. Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
2016-06-28of_mdio: select fixed phy support unconditionallyArnd Bergmann
Calling the fixed-phy functions when CONFIG_FIXED_PHY=m as a previous change tried cannot work if the caller is in built-in code: drivers/of/built-in.o: In function `of_phy_register_fixed_link': of_reserved_mem.c:(.text+0x85e0): undefined reference to `fixed_phy_register' Making of_mdio depend on 'FIXED_PHY || !FIXED_PHY' would solve this dependency by enforcing that OF_MDIO itself becomes a loadable module when FIXED_PHY=y, but that creates a different dependency as it breaks any built-in ethernet driver that uses of_mdio. Making FIXED_PHY a bool option also cannot work, since it depends on PHYLIB, which again is tristate. This version now uses 'select FIXED_PHY' to ensure that the fixed-phy portion of of_mdio is not optional. The main downside of this is a small increase in code size for cases that do not need fixed phy support, but it should avoid all of the link-time problems. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Fixes: d1bd330a229f ("of_mdio: Enable fixed PHY support if driver is a module") Acked-by: Randy Dunlap <rdunlap@infradead.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2016-04-15of, numa: Add NUMA of binding implementation.David Daney
Add device tree parsing for NUMA topology using device "numa-node-id" property in distance-map and cpu nodes. This is a complete rewrite of a previous patch by: Ganapatrao Kulkarni<gkulkarni@caviumnetworks.com> Signed-off-by: David Daney <david.daney@cavium.com> Acked-by: Rob Herring <robh@kernel.org> Signed-off-by: Will Deacon <will.deacon@arm.com>
2015-10-27of: add config option to enable building of all dtbsRob Herring
Enable building all dtb files when CONFIG_OF_ALL_DTBS is enabled. The dtbs are not really dependent on a platform being enabled or any other kernel config, so for testing coverage it is convenient to build all of the dtbs. In order to only build dtbs, this option can be used by creating an allno.config file containing: CONFIG_COMPILE_TEST=y CONFIG_OF=y CONFIG_OF_ALL_DTBS=y And then running: make KCONFIG_ALLCONFIG=1 allnoconfig make dtbs While building the dtbs themselves don't need a cross compiler, the scripts dependency does need one. This can be hacked around by commenting out "subdir-y += mod" in scripts/Makefile. Signed-off-by: Rob Herring <robh@kernel.org> Cc: Frank Rowand <frowand.list@gmail.com> Cc: Grant Likely <grant.likely@linaro.org>
2015-07-27of: add HAS_IOMEM depends to OF_ADDRESSRob Herring
On UML builds, of_address.c fails to compile: ../drivers/of/address.c:873:2: error: implicit declaration of function ‘ioremap’ [-Werror=implicit-function-declaration] This is due to CONFIG_OF now being user selectable. Add a dependency on HAS_IOMEM to OF_ADDRESS in order to fix this. Signed-off-by: Rob Herring <robh@kernel.org> Cc: Grant Likely <grant.likely@linaro.org>
2015-06-04of: make unittest select OF_EARLY_FLATTREE instead of depend on itRob Herring
The DT unittest currently requires an arch (typically) to select OF_EARLY_FLATTREE. Remove this dependency by selecting it directly so that the unittest can be enabled easily on any architecture. With this and the prior commit, we can easily enable and run unittests starting with x86 defconfig rather than hunting for the combination of config options to enable OF on x86. Signed-off-by: Rob Herring <robh@kernel.org> Cc: Geert Uytterhoeven <geert@linux-m68k.org> Cc: Pantelis Antoniou <pantelis.antoniou@konsulko.com> Acked-by: Grant Likely <grant.likely@lianro.org>
2015-06-04of: make CONFIG_OF user selectableRob Herring
With the addition of overlays, it is now plausible to use DT on any arch and without an arch using it at boot time. It is also desirable to expand the compile coverage of the DT code. Make CONFIG_OF user selectable by converting the menu to menuconfig. Signed-off-by: Rob Herring <robh@kernel.org> Acked-by: Geert Uytterhoeven <geert@linux-m68k.org> Acked-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com> Acked-by: Grant Likely <grant.likely@lianro.org>
2015-04-24Merge tag 'devicetree-for-4.1' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux Pull second batch of devicetree updates from Rob Herring: "As Grant mentioned in the first devicetree pull request, here is the 2nd batch of DT changes for 4.1. The main remaining item here is the endianness bindings and related 8250 driver support. - DT endianness specification bindings - big-endian 8250 serial support - DT overlay unittest updates - various DT doc updates - compile fixes for OF_IRQ=n" * tag 'devicetree-for-4.1' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux: frv: add io{read,write}{16,32}be functions mn10300: add io{read,write}{16,32}be functions Documentation: DT bindings: add doc for Altera's SoCFPGA platform of: base: improve of_get_next_child() kernel-doc Doc: dt: arch_timer: discourage clock-frequency use of: unittest: overlay: Keep track of created overlays of/fdt: fix allocation size for device node path serial: of_serial: Support big-endian register accesses serial: 8250: Add support for big-endian MMIO accesses of: Document {little,big,native}-endian bindings of/fdt: Add endianness helper function for early init code of: Add helper function to check MMIO register endianness of/fdt: Remove "reg" data prints from early_init_dt_scan_memory of: add vendor prefix for Artesyn of: Add dummy of_irq_to_resource_table() for IRQ_OF=n of: OF_IRQ should depend on IRQ_DOMAIN
2015-04-14of: OF_IRQ should depend on IRQ_DOMAINGeert Uytterhoeven
If CONFIG_IRQ_DOMAIN=n: drivers/of/irq.c: In function ‘of_irq_get’: drivers/of/irq.c:406: error: implicit declaration of function ‘irq_find_host’ drivers/of/irq.c:406: warning: assignment makes pointer from integer without a cast make[2]: *** [drivers/of/irq.o] Error 1 Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Rob Herring <robh@kernel.org>
2015-03-27of: Allow selection of OF_DYNAMIC and OF_OVERLAY if OF_UNITTESTGeert Uytterhoeven
Currently OF_DYNAMIC and OF_OVERLAY are not visible to the user, and are selected automatically only when needed. Allow them to be enabled manually to improve device tree unit test coverage. Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: Grant Likely <grant.likely@linaro.org>
2015-03-02of: Drop superfluous dependance for OF_OVERLAYMatwey V. Kornilov
The whole menu already depends on OF, so there is no need to additionaly specify it. Suggested-by: Paul Bolle <pebolle@tiscali.nl> Signed-off-by: Matwey V. Kornilov <matwey@sai.msu.ru> Signed-off-by: Rob Herring <robh@kernel.org>
2015-03-02of: Add prompt for OF_OVERLAY configMatwey V. Kornilov
Signed-off-by: Matwey V. Kornilov <matwey@sai.msu.ru> Signed-off-by: Rob Herring <robh@kernel.org>
2015-01-13Removes OF_UNITTEST dependency on OF_DYNAMIC config symbolGaurav Minocha
This patch intends to remove the unittests dependency on the functions defined in dynamic.c. So, rather than calling of_attach_node defined in dynamic.c, minimal functionality required to attach a new node is re-defined in unittest.c. Also, now after executing the tests the test data is not removed from the device tree so there is no need to call of_detach_node. Tested with and without OF_DYNAMIC enabled on ppc, arm and x86 Signed-off-by: Gaurav Minocha <gaurav.minocha.os@gmail.com> Signed-off-by: Rob Herring <robh@kernel.org>
2014-11-26of: remove select of non-existant OF_DEVICE config symbolGrant Likely
The OF_OVERLAY option selects OF_DEVICE, but OF_DEVICE was removed in commit ba166e900b, "of: remove CONFIG_OF_DEVICE". Remove the unnecessary select. Signed-off-by: Grant Likely <grant.likely@linaro.org> Reported-by: Paul Bolle <pebolle@tiscali.nl> Cc: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
2014-11-24of/overlay: Introduce DT overlay supportPantelis Antoniou
Overlays are a method to dynamically modify part of the kernel's device tree with dynamically loaded data. Add the core functionality to parse, apply and remove an overlay changeset. The core functionality takes care of managing the overlay data format and performing the add and remove. Drivers are expected to use the overlay functionality to support custom expansion busses commonly found on consumer development boards like the BeagleBone or Raspberry Pi. The overlay code uses CONFIG_OF_DYNAMIC changesets to perform the low level work of modifying the devicetree. Documentation about internal and APIs is provided in Documentation/devicetree/overlay-notes.txt v2: - Switch from __of_node_alloc() to __of_node_dup() - Documentation fixups - Remove 2-pass processing of properties - Remove separate ov_lock; just use the DT mutex. v1: - Drop delete capability using '-' prefix. The '-' prefixed names are valid properties and nodes and there is no need for it just yet. - Do not update special properties - name & phandle ones. - Change order of node attachment, so that the special property update works. Signed-off-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com> Signed-off-by: Grant Likely <grant.likely@linaro.org>
2014-11-19of/fdt: export fdt blob as /sys/firmware/fdtArd Biesheuvel
Create a new /sys entry '/sys/firmware/fdt' to export the FDT blob that was passed to the kernel by the bootloader. This allows userland applications such as kexec to access the raw binary. The fact that this node does not reside under /sys/firmware/device-tree is deliberate: FDT is also used on arm64 UEFI/ACPI systems to communicate just the UEFI and ACPI entry points, but the FDT is never unflattened and used to configure the system. A CRC32 checksum is calculated over the entire FDT blob, and verified at late_initcall time. The sysfs entry is instantiated only if the checksum is valid, i.e., if the FDT blob has not been modified in the mean time. Otherwise, a warning is printed. Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Signed-off-by: Grant Likely <grant.likely@linaro.org>
2014-11-04of/unittest: Rename selftest.c to unittest.cGrant Likely
This is unit testing code. It should use that name because it makes more sense than 'selftest'. Rename the files to match and rename the config variable. Signed-off-by: Grant Likely <grant.likely@linaro.org>
2014-10-04of/selftest: Use the resolver to fixup phandlesGrant Likely
The selftest data ends up causing duplicate phandles in the live tree for the time that the testcase data is inserted into the live tree. This is obviously a bad situation because anything attempting to read the tree while the selftests are running make resolve phandles to one of the testcase data nodes. Fix the problem by using the of_resolve_phandles() function to eliminate duplicates. Signed-off-by: Grant Likely <grant.likely@linaro.org> Cc: Pantelis Antoniou <pantelis.antoniou@konsulko.com> Cc: Gaurav Minocha <gaurav.minocha.os@gmail.com>
2014-10-04of: Introduce Device Tree resolve support.Pantelis Antoniou
Introduce support for dynamic device tree resolution. Using it, it is possible to prepare a device tree that's been loaded on runtime to be modified and inserted at the kernel live tree. Export of of_resolve and bug fix of double free by Guenter Roeck <groeck@juniper.net> Signed-off-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com> [grant.likely: Don't need to select CONFIG_OF_DYNAMIC and CONFIG_OF_DEVICE] [grant.likely: Don't need to depend on OF or !SPARC] [grant.likely: Factor out duplicate code blocks into single function] Signed-off-by: Grant Likely <grant.likely@linaro.org>
2014-08-03of: Fixing OF Selftest build errorGaurav Minocha
This patch is to fix following error while compiling OF selftests. "drivers/of/selftest.c:617:2: error: implicit declaration of function 'of_fdt_unflatten_tree'" Now, CONFIG_OF_SELFTEST depends on CONFIG_OF_EARLY_FLATTREE so that the broken configuration cannot be selected. Ultimately it would be a good idea to allow CONFIG_OF_SELFTEST to select CONFIG_OF_EARLY_FLATTREE, but there is a dependency problem on i386 and x86_64 that causes dtc to not get built and causes the build to fail. That problem needs to be fixed first. Signed-off-by: Gaurav Minocha <gaurav.minocha.os@gmail.com> Signed-off-by: Grant Likely <grant.likely@linaro.org>
2014-07-25Adding selftest testdata dynamically into live treeGaurav Minocha
This patch attaches selftest's device tree data (required by /drivers/of/selftest.c) dynamically into live device tree. First, it links selftest device tree data into the kernel image and then iterates over all the nodes and attaches them into the live tree. Once the testcases are complete, it removes the data attached. This patch will remove the manual process of addition and removal of selftest device tree data into the machine's dts file. Tested successfully with current selftest's testcases. Signed-off-by: Gaurav Minocha <gaurav.minocha.os@gmail.com> [glikely: Removed ability to build as a module and fixed no-devicetree bug] Signed-off-by: Grant Likely <grant.likely@linaro.org>
2014-04-30of/fdt: Convert FDT functions to use libfdtRob Herring
The kernel FDT functions predate libfdt and are much more limited in functionality. Also, the kernel functions and libfdt functions are not compatible with each other because they have different definitions of node offsets. To avoid this incompatibility and in preparation to add more FDT parsing functions which will need libfdt, let's first convert the existing code to use libfdt. The FDT unflattening, top-level FDT scanning, and property retrieval functions are converted to use libfdt. The scanning code should be re-worked to be more efficient and understandable by using libfdt to find nodes directly by path or compatible strings. Signed-off-by: Rob Herring <robh@kernel.org> Tested-by: Michal Simek <michal.simek@xilinx.com> Tested-by: Grant Likely <grant.likely@linaro.org> Tested-by: Stephen Chivers <schivers@csc.com>
2014-03-19Merge branch 'devicetree/next-reserved-mem' into devicetree/nextGrant Likely
2014-03-11of: remove /proc/device-treeGrant Likely
The same data is now available in sysfs, so we can remove the code that exports it in /proc and replace it with a symlink to the sysfs version. Tested on versatile qemu model and mpc5200 eval board. More testing would be appreciated. v5: Fixed up conflicts with mainline changes Signed-off-by: Grant Likely <grant.likely@secretlab.ca> Cc: Rob Herring <rob.herring@calxeda.com> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: David S. Miller <davem@davemloft.net> Cc: Nathan Fontenot <nfont@linux.vnet.ibm.com> Cc: Pantelis Antoniou <panto@antoniou-consulting.com>
2014-03-11drivers: of: add initialization code for dynamic reserved memoryMarek Szyprowski
This patch adds support for dynamically allocated reserved memory regions declared in device tree. Such regions are defined by 'size', 'alignment' and 'alloc-ranges' properties. Based on previous code provided by Josh Cartwright <joshc@codeaurora.org> Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Signed-off-by: Grant Likely <grant.likely@linaro.org>
2014-02-20of: Allows to use the PCI translator without the PCI coreGregory CLEMENT
Translating an address from a PCI node of the device-tree into a CPU physical address doesn't require the core PCI support. Those translations are just related to the device tree itself. The use case to translate an address from a PCI node without actually using the PCI core support is when one needs to access the PCI controller without accessing any PCI devices. Marvell SoCs, such as Kirkwood, Dove or Armada XP for instance, come with an IP of a PCI controller. In the registers of this controller are stored the ID and the revision of a SoC. With this patch it will be possible to read the SoC ID of a board without any PCI device and then without the PCI core support. Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com> Tested-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com> Reviewed-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com> Signed-off-by: Grant Likely <grant.likely@linaro.org>
2013-12-30of/Kconfig: Spelling s/one/once/Geert Uytterhoeven
Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org> Signed-off-by: Rob Herring <robh@kernel.org>
2013-11-12Merge tag 'devicetree-for-3.13' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/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() ...
2013-11-08dt: disable self-tests for !OF_IRQRob Herring
Fix OF selftest compile on sparc which does not enable OF_IRQ. drivers/of/selftest.c:177: undefined reference to `of_irq_parse_one' drivers/of/selftest.c:197: undefined reference to `of_irq_parse_one' drivers/of/selftest.c:248: undefined reference to `of_irq_parse_one' Signed-off-by: Rob Herring <rob.herring@calxeda.com> Acked-by: Grant Likely <grant.likely@linaro.org>
2013-10-15Revert "drivers: of: add initialization code for dma reserved memory"Marek Szyprowski
This reverts commit 9d8eab7af79cb4ce2de5de39f82c455b1f796963. There is still no consensus on the bindings for the reserved memory and various drawbacks of the proposed solution has been shown, so the best now is to revert it completely and start again from scratch later. Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Signed-off-by: Grant Likely <grant.likely@linaro.org>
2013-09-09Merge branch 'for-v3.12' of ↵Linus Torvalds
git://git.linaro.org/people/mszyprowski/linux-dma-mapping Pull DMA mapping update from Marek Szyprowski: "This contains an addition of Device Tree support for reserved memory regions (Contiguous Memory Allocator is one of the drivers for it) and changes required by the KVM extensions for PowerPC architectue" * 'for-v3.12' of git://git.linaro.org/people/mszyprowski/linux-dma-mapping: ARM: init: add support for reserved memory defined by device tree drivers: of: add initialization code for dma reserved memory drivers: of: add function to scan fdt nodes given by path drivers: dma-contiguous: clean source code and prepare for device tree
2013-08-27drivers: of: add initialization code for dma reserved memoryMarek Szyprowski
This patch adds device tree support for contiguous and reserved memory regions defined in device tree. Large memory blocks can be reliably reserved only during early boot. This must happen before the whole memory management subsystem is initialized, because we need to ensure that the given contiguous blocks are not yet allocated by kernel. Also it must happen before kernel mappings for the whole low memory are created, to ensure that there will be no mappings (for reserved blocks) or mapping with special properties can be created (for CMA blocks). This all happens before device tree structures are unflattened, so we need to get reserved memory layout directly from fdt. Later, those reserved memory regions are assigned to devices on each device structure initialization. Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Acked-by: Kyungmin Park <kyungmin.park@samsung.com> Acked-by: Michal Nazarewicz <mina86@mina86.com> Acked-by: Tomasz Figa <t.figa@samsung.com> Acked-by: Stephen Warren <swarren@nvidia.com> Reviewed-by: Rob Herring <rob.herring@calxeda.com>
2013-08-23i2c: move OF helpers into the coreWolfram Sang
I2C of helpers used to live in of_i2c.c but experience (from SPI) shows that it is much cleaner to have this in the core. This also removes a circular dependency between the helpers and the core, and so we can finally register child nodes in the core instead of doing this manually in each driver. So, fix the drivers and documentation, too. Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2013-06-12of: remove CONFIG_OF_DEVICERob Herring
CONFIG_OF_DEVICE is always selected when CONFIG_OF is enabled, so remove it and simplify of_platform.h and of_device.h headers. This also fixes !OF compiles using of_platform_populate. Signed-off-by: Rob Herring <rob.herring@calxeda.com> Acked-by: Arnd Bergmann <arnd@arndb.de> Tested-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Grant Likely <grant.likely@linaro.org>
2012-12-07of_i2c: sparc: Allow OF_I2C for sparcAndreas Larsson
Signed-off-by: Andreas Larsson <andreas@gaisler.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-05-24Merge tag 'gpio-for-linus' of git://git.secretlab.ca/git/linux-2.6Linus Torvalds
Pull GPIO driver changes from Grant Likely: "Lots of gpio changes, both to core code and drivers. Changes do touch architecture code to remove the need for separate arm/gpio.h includes in most architectures. Some new drivers are added, and a number of gpio drivers are converted to use irq_domains for gpio inputs used as interrupts. Device tree support has been amended to allow multiple gpio_chips to use the same device tree node. Remaining changes are primarily bug fixes." * tag 'gpio-for-linus' of git://git.secretlab.ca/git/linux-2.6: (33 commits) gpio/generic: initialize basic_mmio_gpio shadow variables properly gpiolib: Remove 'const' from data argument of gpiochip_find() gpio/rc5t583: add gpio driver for RICOH PMIC RC5T583 gpiolib: quiet gpiochip_add boot message noise gpio: mpc8xxx: Prevent NULL pointer deref in demux handler gpio/lpc32xx: Add device tree support gpio: Adjust of_xlate API to support multiple GPIO chips gpiolib: Implement devm_gpio_request_one() gpio-mcp23s08: dbg_show: fix pullup configuration display Add support for TCA6424A gpio/omap: (re)fix wakeups on level-triggered GPIOs gpio/omap: fix broken context restore for non-OFF mode transitions gpio/omap: fix missing check in *_runtime_suspend() gpio/omap: remove cpu_is_omapxxxx() checks from *_runtime_resume() gpio/omap: remove suspend/resume callbacks gpio/omap: remove retrigger variable in gpio_irq_handler gpio/omap: remove saved_wakeup field from struct gpio_bank gpio/omap: remove suspend_wakeup field from struct gpio_bank gpio/omap: remove saved_fallingdetect, saved_risingdetect gpio/omap: remove virtual_irq_start variable ... Conflicts: drivers/gpio/gpio-samsung.c
2012-04-13spi/devicetree: Move devicetree support code into spi directoryGrant Likely
The SPI device tree support code isn't shared by any other subsystem. It can be moved into the core drivers/spi directory and the exported symbol can be removed. Signed-off-by: Grant Likely <grant.likely@secretlab.ca> Cc: Rob Herring <rob.herring@calxeda.com>
2012-04-07gpio: Move DT support code into drivers/gpioGrant Likely
The code in drivers/of/gpio.c isn't shared by any other subsystem since it is all gpiolib specific. drivers/gpio is a better place to maintain these functions. Signed-off-by: Grant Likely <grant.likely@secretlab.ca> Cc: Rob Herring <rob.herring@calxeda.com> Cc: Linus Walleij <linus.walleij@stericsson.com>