- 14 1月, 2015 1 次提交
-
-
由 Murali Karicheri 提交于
fix the dev_dbg to display the offset which is the calculated dma_pfn_offset value and set later in the code. Signed-off-by: NMurali Karicheri <m-karicheri2@ti.com> Signed-off-by: NRob Herring <robh@kernel.org>
-
- 02 12月, 2014 2 次提交
-
-
由 Will Deacon 提交于
This patch extends of_dma_configure so that it sets up the IOMMU for a device, as well as the coherent/non-coherent DMA mapping ops. Acked-by: NArnd Bergmann <arnd@arndb.de> Acked-by: NMarek Szyprowski <m.szyprowski@samsung.com> Tested-by: NRobin Murphy <robin.murphy@arm.com> Signed-off-by: NWill Deacon <will.deacon@arm.com>
-
由 Will Deacon 提交于
set_arch_dma_coherent_ops is called from of_dma_configure in order to swizzle the architectural dma-mapping functions over to a cache-coherent implementation. This is currently implemented only for ARM. In anticipation of re-using this mechanism for IOMMU-backed dma-mapping ops too, this patch replaces the function with a broader arch_setup_dma_ops callback which will be extended in future. Acked-by: NArnd Bergmann <arnd@arndb.de> Acked-by: NMarek Szyprowski <m.szyprowski@samsung.com> Tested-by: NRobin Murphy <robin.murphy@arm.com> Signed-off-by: NWill Deacon <will.deacon@arm.com>
-
- 25 11月, 2014 1 次提交
-
-
由 Pantelis Antoniou 提交于
Add OF notifier handler needed for creating/destroying platform devices according to dynamic runtime changes in the DT live tree. Signed-off-by: NPantelis Antoniou <pantelis.antoniou@konsulko.com> Signed-off-by: NGrant Likely <grant.likely@linaro.org>
-
- 20 11月, 2014 1 次提交
-
-
由 Grant Likely 提交于
of_platform_populate() takes a subset of the device tree and turns it into a set of platform_devices. At the same time it sets the OF_POPULATED_BUS flag in each bus nodes so that of_platform_depopulate() can undo the operation at a later time. However, it doesn't set the flag on the root of the population tree which means that dynamic modifications of the device tree at runtime will not create/destroy devices correctly. Fix of_platform_populate() to set the OF_POPULATED_BUS flag on the node it is called with. Signed-off-by: NGrant Likely <grant.likely@linaro.org> Cc: Rob Herring <robh+dt@kernel.org> Cc: Pantelis Antoniou <pantelis.antoniou@konsulko.com> Cc: Pawel Moll <pawel.moll@arm.com>
-
- 05 11月, 2014 1 次提交
-
-
由 Grant Likely 提交于
Currently the devices created by drivers/of/platform.c get created at the root of /sys/devices. This goes against the typical pattern for sysfs where the top level /sys/devices structure contains categories of devices, and the structure of devices is placed below that. To fix this, make the code in drivers/of/platform.c follow the drivers/base/platform.c behaviour, and use &platform_bus as the default parent for all new platform_devices and amba_devices. This change has been discussed for a long time, but nobody has actually acted on it. Userspace code that expects to find devices under a fixed /sys/devices/... path will be affected. It isn't /supposed/ to do that, but if anyone complains then I'll add a default-off workaround option to put them back into the root. Signed-off-by: NGrant Likely <grant.likely@linaro.org> Acked-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org> Acked-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Rob Herring <robh+dt@kernel.org> Cc: Arnd Bergmann <arnd@arndb.de>
-
- 22 9月, 2014 1 次提交
-
-
由 Robin Murphy 提交于
Commit 591c1e ("of: configure the platform device dma parameters) introduced a common mechanism to configure DMA from DT properties. AMBA devices created from DT can take advantage of this, too. Signed-off-by: NRobin Murphy <robin.murphy@arm.com> Acked-by: NWill Deacon <will.deacon@arm.com> Acked-by: NRob Herring <robh@kernel.org> Signed-off-by: NCatalin Marinas <catalin.marinas@arm.com>
-
- 07 7月, 2014 1 次提交
-
-
由 Grant Likely 提交于
of_platform_destroy does not work properly, since the tree population test was iterating on all devices having as its parent the given platform device. The check was intended to check whether any other platform or amba devices created by of_platform_populate were still populated, but instead checked for every kind of device. This is wrong, since platform devices typically create a subsystem regular device and set themselves as parents. Instead, go ahead and call the unregister functions for any devices created with of_platform_populate. The driver core will take care of unbinding drivers, and drivers are responsible for getting rid of any child devices that weren't created by of_platform_populate. Signed-off-by: NGrant Likely <grant.likely@linaro.org> Signed-off-by: NPantelis Antoniou <pantelis.antoniou@konsulko.com>
-
- 17 6月, 2014 1 次提交
-
-
由 Guenter Roeck 提交于
Commit bf5db2fb (microblaze: Use generic device.h) removes the microblaze specific pdev_archdata and dma_mask. At the same time, commit 591c1ee4 (of: configure the platform device dma parameters) initializes the just removed field. This causes all microblaze builds to fail. Drop the unnecessary initialization. Cc: Michal Simek <michal.simek@xilinx.com> Signed-off-by: NGuenter Roeck <linux@roeck-us.net> Acked-by: NMichal Simek <monstr@monstr.eu> Signed-off-by: NRob Herring <robh@kernel.org>
-
- 04 6月, 2014 1 次提交
-
-
由 Michal Simek 提交于
pdev_archdata dma_mask is completely unused. Use generic device.h Signed-off-by: NMichal Simek <michal.simek@xilinx.com>
-
- 23 5月, 2014 2 次提交
-
-
由 Grant Likely 提交于
There is now a way to ensure all platform devices get a unique name when populated from the device tree, and the DCR_NATIVE code path is broken anyway. PowerPC Cell (PS3) is the only platform that actually uses this path. Most likely nobody will notice if it is killed. Remove the code and associated ugly #ifdef. The user-visible impact of this patch is that any DCR device on Cell will get a new name in the /sys/devices hierarchy. Signed-off-by: NGrant Likely <grant.likely@linaro.org> Cc: Rob Herring <robh@kernel.org> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
-
由 Grant Likely 提交于
The way the driver core is implemented, every device using the same bus type is required to have a unique name because a symlink to each device is created in the appropriate /sys/bus/*/devices directory, and two identical names causes a collision. The current code handles the requirement by using an globally incremented counter that is appended to the device name. It works, but it means any change to device registration will change the assigned numbers. Instead, if we build up the name by using information from the parent nodes, then it can be guaranteed to be unique without adding a random number to the end of it. Signed-off-by: NGrant Likely <grant.likely@linaro.org> Cc: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar> Cc: Rob Herring <robh@kernel.org>
-
- 16 5月, 2014 1 次提交
-
-
由 Pawel Moll 提交于
In "Device Tree powered" systems, platform devices are usually massively populated with of_platform_populate() call, executed at some level of initcalls, either by generic architecture or by platform-specific code. There are situations though where certain devices must be created (and bound with drivers) before all the others. This presents a challenge, as devices created explicitly would be created again by of_platform_populate(). This patch tries to solve that issue in a generic way, adding a "populated" flag for a DT node description. Subsequent of_platform_populate() will skip such nodes (and its children) in a similar way to the non-available ones. This patch also adds of_platform_depopulate() as an operation complementary to the _populate() one. It removes a platform or an amba device populated from the Device Tree, together with its all children (leaving, however, devices without associated of_node untouched) clearing the "populated" flag on the way. Signed-off-by: NPawel Moll <pawel.moll@arm.com> Reviewed-by: NRob Herring <robh@kernel.org> Acked-by: NGrant Likely <grant.likely@linaro.org>
-
- 14 5月, 2014 2 次提交
-
-
由 Rob Herring 提交于
of_can_translate_address only checks some conditions for address translation, but does not check other conditions like having range properties. The checks it does do are redundant with __of_address_translate. The only difference is printing a message or not. Since we only have a single caller that does the full translation anyway, just remove of_can_translate_address and quiet the error message. Cc: Grant Likely <grant.likely@linaro.org> Signed-off-by: NRob Herring <robh@kernel.org> Tested-by: NFrank Rowand <frank.rowand@sonymobile.com> Reviewed-by: NFrank Rowand <frank.rowand@sonymobile.com>
-
由 Rob Herring 提交于
Using non-translatable addresses in platform device names is wrong because they may not be globally unique. Just use the default naming with a global index if the address cannot be translated instead. of_can_translate_address has the same checks as of_translate_address, so we can remove it here as well. Reported-by: N"Ivan T. Ivanov" <iivanov@mm-sol.com> Cc: Josh Cartwright <joshc@codeaurora.org> Cc: Courtney Cavin <courtney.cavin@sonymobile.com> Cc: Bjorn Andersson <bjorn@kryo.se> Cc: Grant Likely <grant.likely@linaro.org> Signed-off-by: NRob Herring <robh@kernel.org> Tested-by: NIvan T. Ivanov <iivanov@mm-sol.com> Tested-by: NFrank Rowand <frank.rowand@sonymobile.com> Reviewed-by: NFrank Rowand <frank.rowand@sonymobile.com>
-
- 07 5月, 2014 1 次提交
-
-
由 Santosh Shilimkar 提交于
Retrieve DMA configuration from DT and setup platform device's DMA parameters. The DMA configuration in DT has to be specified using "dma-ranges" and "dma-coherent" properties if supported. We setup dma_pfn_offset using "dma-ranges" and dma_coherent_ops using "dma-coherent" device tree properties. The set_arch_dma_coherent_ops macro has to be defined by arch if it supports coherent dma_ops. Otherwise, set_arch_dma_coherent_ops() is declared as nop. Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Russell King <linux@arm.linux.org.uk> Cc: Arnd Bergmann <arnd@arndb.de> Cc: Olof Johansson <olof@lixom.net> Cc: Grant Likely <grant.likely@linaro.org> Cc: Catalin Marinas <catalin.marinas@arm.com> Cc: Linus Walleij <linus.walleij@linaro.org> Reviewed-by: NRob Herring <robh@kernel.org> Signed-off-by: NGrygorii Strashko <grygorii.strashko@ti.com> Signed-off-by: NSantosh Shilimkar <santosh.shilimkar@ti.com>
-
- 25 4月, 2014 1 次提交
-
-
由 Rob Herring 提交于
Currently we get the following kind of errors if we try to use interrupt phandles to irqchips that have not yet initialized: irq: no irq domain found for /ocp/pinmux@48002030 ! ------------[ cut here ]------------ WARNING: CPU: 0 PID: 1 at drivers/of/platform.c:171 of_device_alloc+0x144/0x184() Modules linked in: CPU: 0 PID: 1 Comm: swapper/0 Not tainted 3.12.0-00038-g42a9708 #1012 (show_stack+0x14/0x1c) (dump_stack+0x6c/0xa0) (warn_slowpath_common+0x64/0x84) (warn_slowpath_null+0x1c/0x24) (of_device_alloc+0x144/0x184) (of_platform_device_create_pdata+0x44/0x9c) (of_platform_bus_create+0xd0/0x170) (of_platform_bus_create+0x12c/0x170) (of_platform_populate+0x60/0x98) This is because we're wrongly trying to populate resources that are not yet available. It's perfectly valid to create irqchips dynamically, so let's fix up the issue by resolving the interrupt resources when platform_get_irq is called. And then we also need to accept the fact that some irqdomains do not exist that early on, and only get initialized later on. So we can make the current WARN_ON into just into a pr_debug(). We still attempt to populate irq resources when we create the devices. This allows current drivers which don't use platform_get_irq to continue to function. Once all drivers are fixed, this code can be removed. Suggested-by: NRussell King <linux@arm.linux.org.uk> Signed-off-by: NRob Herring <robh@kernel.org> Signed-off-by: NTony Lindgren <tony@atomide.com> Tested-by: NTony Lindgren <tony@atomide.com> Cc: stable@vger.kernel.org # v3.10+ Signed-off-by: NGrant Likely <grant.likely@linaro.org>
-
- 04 11月, 2013 1 次提交
-
-
由 Rob Herring 提交于
Platform devices created by DT code don't initialize dma_mask pointer to anything. Set it to coherent_dma_mask by default if the architecture code has not set it. Signed-off-by: NRob Herring <rob.herring@calxeda.com>
-
- 31 10月, 2013 1 次提交
-
-
由 Russell King 提交于
AMBA Primecell devices always treat streaming and coherent DMA exactly the same, so there's no point in having the masks separated. Acked-by: NGrant Likely <grant.likely@linaro.org> Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
-
- 15 10月, 2013 1 次提交
-
-
由 Marek Szyprowski 提交于
This reverts commit 9d8eab7a. 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: NMarek Szyprowski <m.szyprowski@samsung.com> Signed-off-by: NGrant Likely <grant.likely@linaro.org>
-
- 10 9月, 2013 1 次提交
-
-
Add error reporting to of_amba_device_create() so the user knows when (and why) some device tree nodes fail to initialize. [ The issue was spotted on Universal C210 board (using revision 0 of ARM Exynos4210 SoC) on which initialization was silently failing for PL330 MDMA1 device tree node (it was using the wrong addres resulting in amba_device_add() returning -ENODEV). ] Signed-off-by: NBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Signed-off-by: NKyungmin Park <kyungmin.park@samsung.com> Signed-off-by: NGrant Likely <grant.likely@linaro.org>
-
- 27 8月, 2013 1 次提交
-
-
由 Marek 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: NMarek Szyprowski <m.szyprowski@samsung.com> Acked-by: NKyungmin Park <kyungmin.park@samsung.com> Acked-by: NMichal Nazarewicz <mina86@mina86.com> Acked-by: NTomasz Figa <t.figa@samsung.com> Acked-by: NStephen Warren <swarren@nvidia.com> Reviewed-by: NRob Herring <rob.herring@calxeda.com>
-
- 24 7月, 2013 1 次提交
-
-
由 Mark Brown 提交于
It is not used outside of this file so doesn't need to be in the global namespace. Signed-off-by: NMark Brown <broonie@linaro.org> Signed-off-by: NGrant Likely <grant.likely@linaro.org>
-
- 18 2月, 2013 1 次提交
-
-
由 Grant Likely 提交于
This reverts commit aac73f34. That commit causes two kinds of breakage; it breaks registration of AMBA devices when one of the parent nodes already contains overlapping resource regions, and it breaks calls to request_region() by device drivers in certain conditions where there are overlapping memory regions. Both of these problems can probably be fixed, but it is better to back out the commit and get a proper fix designed before trying again. Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
-
- 06 2月, 2013 1 次提交
-
-
由 Grant Likely 提交于
This allows platform_device_add a chance to call insert_resource on all of the resources from OF. At a minimum this fills in proc/iomem and presumably makes resource tracking and conflict detection work better. However, it has the side effect of moving all OF generated platform devices from /sys/devices to /sys/devices/platform/. It /shouldn't/ break userspace because userspace is not supposed to depend on the full path (because userspace always does what it is supposed to, right?). This may cause breakage if either: 1) any two nodes in a given device tree have overlapping & staggered regions (ie. 0x80..0xbf and 0xa0..0xdf; where one is not contained within the other). In this case one of the devices will fail to register and an exception will be needed in platform_device_add() to complain but not fail. 2) any device calls request_mem_region() on a region larger than specified in the device tree. In this case the device node may be wrong, or the driver is overreaching. In either case I'd like to know about any problems and fix them. Please test. Despite the above, I'm still fairly confident that this patch is in good shape. I'd like to put it into linux-next, but would appreciate some bench testing from others before I do; particularly on PowerPC machines. v2: Remove powerpc special-case Cc: Jason Gunthorpe <jgunthorpe@obsidianresearch.com> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Rob Herring <rob.herring@calxeda.com> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
-
- 09 1月, 2013 1 次提交
-
-
由 Javi Merino 提交于
15c3597d (dt/platform: allow device name to be overridden) added a lookup parameter to of_platform_populate() but did not update the documentation. This patch adds the missing documentation entry. Cc: Grant Likely <grant.likely@secretlab.ca> Cc: Jiri Kosina <trivial@kernel.org> Signed-off-by: NJavi Merino <javi.merino@arm.com> Signed-off-by: NJiri Kosina <jkosina@suse.cz>
-
- 18 10月, 2012 1 次提交
-
-
由 Kim Phillips 提交于
drivers/of/platform.c:110:59: warning: incorrect type in argument 2 (different base types) drivers/of/platform.c:110:59: expected restricted __be32 const [usertype] *addr drivers/of/platform.c:110:59: got unsigned int const [usertype] *[assigned] reg Signed-off-by: NKim Phillips <kim.phillips@freescale.com> Signed-off-by: NRob Herring <rob.herring@calxeda.com>
-
- 03 8月, 2012 1 次提交
-
-
由 Stephen Warren 提交于
It's quite legitimate for a DT node to specify #size-cells=0. One example is a node that's used to collect a number of non-memory-mapped devices. In that scenario, there may be multiple child nodes with the same name (type) thus necessitating the use of unit addresses in node names, and reg properties: / { regulators { compatible = "simple-bus"; #address-cells = <1>; #size-cells = <0>; regulator@0 { compatible = "regulator-fixed"; reg = <0>; ... }; regulator@1 { compatible = "regulator-fixed"; reg = <1>; ... }; ... }; }; However, #size-cells=0 prevents translation of reg property values into the parent node's address space. In turn, this triggers the kernel to emit error messages during boot, such as: prom_parse: Bad cell count for /regulators/regulator@0 To prevent printing these error messages for legitimate DT content, a number of changes are made: 1) of_get_address()/of_get_pci_address() are modified only to validate the value of #address-cells, and not #size-cells. 2) of_can_translate_address() is added to indicate whether address translation is possible. 3) of_device_make_bus_id() is modified to name devices based on the translated address only where possible, and otherwise fall back to using the (first cell of the) raw untranslated address. 4) of_device_alloc() is modified to create memory resources for a device only if the address can be translated into the CPU's address space. Signed-off-by: NStephen Warren <swarren@nvidia.com> Signed-off-by: NRob Herring <rob.herring@calxeda.com>
-
- 07 7月, 2012 1 次提交
-
-
由 Lee Jones 提交于
Sometimes it doesn't make any sense for a node to have an address. In this case device lookup will always be unsuccessful because we currently assume every node will have a reg property. This patch changes the semantics so that the resource address and the lookup address will only be compared if one exists. Things like AUXDATA() rely on of_dev_lookup to return the lookup entry of a particular device in order to do things like apply platform_data to a device. However, this is currently broken for nodes which do not have a reg property, meaning that platform_data can not be passed in those cases. Acked-by: NRob Herring <rob.herring@calxeda.com> Acked-by: NArnd Bergmann <arnd@arndb.de> Signed-off-by: NLee Jones <lee.jones@linaro.org>
-
- 14 6月, 2012 1 次提交
-
-
由 Stephen Warren 提交于
Without this, modules can't use this API, leading to build failures. Signed-off-by: NStephen Warren <swarren@nvidia.com> Signed-off-by: NRob Herring <rob.herring@calxeda.com>
-
- 27 2月, 2012 1 次提交
-
-
由 Grant Likely 提交于
Sparc has its own helpers for translating address ranges when the device tree is parsed at boot time, and it isn't able to use of_platform_populate(). However, there are some device drivers that want to use that function on other DT enabled platforms (ie. TWL4030). This patch adds an empty of_platform_populate() implementation that returns an error when CONFIG_OF_ADDRESS is not selected. Signed-off-by: NGrant Likely <grant.likely@secretlab.ca> Cc: Benoit Cousson <b-cousson@ti.com> Cc: Samuel Ortiz <sameo@linux.intel.com>
-
- 25 1月, 2012 1 次提交
-
-
由 Russell King 提交于
Convert DT code to use the new amba_device_alloc APIs. Acked-by: NRob Herring <rob.herring@calxeda.com> Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
-
- 13 12月, 2011 1 次提交
-
-
由 Grant Likely 提交于
There is no requirement to override name entries in auxdata. Fix the entry matching to use .compatible instead of .name to find the end of the list. Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
-
- 04 11月, 2011 1 次提交
-
-
由 Olof Johansson 提交于
* Correct description of of_platform_bus_create to match implementation * Remove a level of indentation in of_dev_lookup Signed-off-by: NOlof Johansson <olof@lixom.net> Acked-by: NGrant Likely <grant.likely@secretlab.ca> Signed-off-by: NRob Herring <rob.herring@calxeda.com>
-
- 08 7月, 2011 1 次提交
-
-
由 Kumar Gala 提交于
We have a long standing issues with platform devices not have a valid dma_mask pointer. This hasn't been an issue to date as no platform device has tried to set its dma_mask value to a non-default value. Acked-by: NGreg Kroah-Hartman <gregkh@suse.de> Signed-off-by: NKumar Gala <galak@kernel.crashing.org>
-
- 22 6月, 2011 4 次提交
-
-
由 Grant Likely 提交于
Some platform code has specific requirements on the naming of devices. This patch allows callers of of_platform_populate() to provide a device name lookup table. Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
-
由 Grant Likely 提交于
Add a function to create amba_devices (i.e. primecell peripherals) from device tree nodes. The device tree scanning is done by the of_platform_populate() function which can call of_amba_device_create based on a match table entry. Nodes with a "arm,primecell-periphid" property can override the h/w peripheral id value. Based on the original work by Jeremy Kerr. Signed-off-by: NJeremy Kerr <jeremy.kerr@canonical.com> Acked-by: NLinus Walleij <linus.walleij@linaro.org> Signed-off-by: NRob Herring <rob.herring@calxeda.com> Reviewed-by: NArnd Bergmann <arnd@arndb.de> [grant.likely: add Jeremy's original s-o-b line, changes from review comments, and moved all code to drivers/of/platform.c] Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
-
由 Grant Likely 提交于
of_platform_populate() is similar to of_platform_bus_probe() except that it strictly enforces that all device nodes must have a compatible property, and it can be used to register devices (not buses) which are children of the root node. Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
-
由 Grant Likely 提交于
No need for most platforms to define their own bus table when calling of_platform_populate(). Supply a stock one. Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
-
- 24 3月, 2011 1 次提交
-
-
由 Grant Likely 提交于
There are no users of OF_NO_DEEP_PROBE, and of_match_node() now gracefully handles being passed a NULL pointer, so the checks at the top of of_platform_bus_probe can be dropped. While at it, consolidate the root node pointer check to be easier to read and tidy up related comments. Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
-