- 17 10月, 2017 3 次提交
-
-
由 Rob Herring 提交于
In preparation to make kobject element in struct device_node optional, provide and use a macro to return the kobject pointer. The only user outside the DT core is the driver core. Acked-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org> Tested-by: NNicolas Pitre <nico@linaro.org> Reviewed-by: NFrank Rowand <frowand.list@gmail.com> Acked-by: NGrant Likely <grant.likely@secretlab.ca> Signed-off-by: NRob Herring <robh@kernel.org>
-
由 Rob Herring 提交于
Only Sparc and CONFIG_OF_DYNAMIC use the struct property._flags field, so make it conditional shrinking struct property a bit. Tested-by: NNicolas Pitre <nico@linaro.org> Reviewed-by: NFrank Rowand <frowand.list@gmail.com> Acked-by: NGrant Likely <grant.likely@secretlab.ca> Signed-off-by: NRob Herring <robh@kernel.org>
-
由 Rob Herring 提交于
Only Sparc uses unique_id, so remove it for FDT builds and shrink struct property a bit making the unflattened DT less of a memory hog. Tested-by: NNicolas Pitre <nico@linaro.org> Reviewed-by: NFrank Rowand <frowand.list@gmail.com> Acked-by: NGrant Likely <grant.likely@secretlab.ca> Signed-off-by: NRob Herring <robh@kernel.org>
-
- 22 7月, 2017 1 次提交
-
-
由 Sakari Ailus 提交于
Instead of relying on the struct fwnode_handle type field, define fwnode_operations structs for all separate types of fwnodes. To find out the type, compare to the ops field to relevant ops structs. This change has two benefits: 1. it avoids adding the type field to each and every instance of struct fwnode_handle, thus saving memory and 2. makes the ops field the single factor that defines both the types of the fwnode as well as defines the implementation of its operations, decreasing the possibility of bugs when developing code dealing with fwnode internals. Suggested-by: NRob Herring <robh@kernel.org> Signed-off-by: NSakari Ailus <sakari.ailus@linux.intel.com> Reviewed-by: NMika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
-
- 22 6月, 2017 1 次提交
-
-
由 Sakari Ailus 提交于
The device and fwnode property API supports Devicetree, ACPI and pset properties. The implementation of this functionality for each firmware type was embedded in the fwnode property core. Move it out to firmware type specific locations, making it easier to maintain. Depends-on: ("of: Move OF property and graph API from base.c to property.c") Signed-off-by: NSakari Ailus <sakari.ailus@linux.intel.com> Reviewed-by: NMika Westerberg <mika.westerberg@linux.intel.com> Acked-by: NRob Herring <robh@kernel.org> Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
-
- 15 6月, 2017 1 次提交
-
-
由 Geert Uytterhoeven 提交于
Most of_device_*() functions have dummy versions for CONFIG_OF=n, but of_device_compatible_match() hasn't. Fix that to improve the ability to do compile-testing. Fixes: b9c13fe3 ("dt: Add of_device_compatible_match()") Signed-off-by: NGeert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: NRob Herring <robh@kernel.org>
-
- 01 6月, 2017 2 次提交
-
-
由 Sakari Ailus 提交于
Turn to_of_node() into a macro in order to support both const and non-const use. Additionally make the fwnode argument to is_of_node() const as well. Signed-off-by: NSakari Ailus <sakari.ailus@linux.intel.com> Reviewed-by: NKieran Bingham <kieran.bingham+renesas@ideasonboard.com> Signed-off-by: NRob Herring <robh@kernel.org>
-
由 Sakari Ailus 提交于
On the expense of a little bit more complexity in the of_fwnode_handle() macro, make the macro result in NULL in case its argument is NULL while still referencing it only once. Signed-off-by: NSakari Ailus <sakari.ailus@linux.intel.com> Reviewed-by: NKieran Bingham <kieran.bingham+renesas@ideasonboard.com> Signed-off-by: NRob Herring <robh@kernel.org>
-
- 03 4月, 2017 1 次提交
-
-
由 Alistair Popple 提交于
There is of_property_read_u32_index but no u64 variant. This patch adds one similar to the u32 version for u64. Signed-off-by: NAlistair Popple <alistair@popple.id.au> Acked-by: NRob Herring <robh@kernel.org> Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
-
- 29 3月, 2017 1 次提交
-
-
由 Sakari Ailus 提交于
of_fwnode_handle() returns a struct fwnode_handle of the struct device_node. This may be used on the fwnode property API. Use a macro instead of a function in order to support const and non-const arguments. Signed-off-by: NSakari Ailus <sakari.ailus@linux.intel.com> Reviewed-by: NMika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
-
- 17 1月, 2017 1 次提交
-
-
由 Sudeep Holla 提交于
It is useful to have helper function just to get the number of cache levels for a given logical cpu. We can obtain the same by just checking the level at which the last cache is present. This patch adds support to find the level of the last cache for a given cpu. It will be used on ARM64 platform where the device tree provides the information for the additional non-architected/transparent/external last level caches that are not integrated with the processors. Cc: Mark Rutland <mark.rutland@arm.com> Suggested-by: NRob Herring <robh+dt@kernel.org> Acked-by: NRob Herring <robh+dt@kernel.org> Tested-by: NTan Xiaojun <tanxiaojun@huawei.com> Signed-off-by: NSudeep Holla <sudeep.holla@arm.com> [will: use u32 instead of int for cache_level] Signed-off-by: NWill Deacon <will.deacon@arm.com>
-
- 10 12月, 2016 1 次提交
-
-
由 Rob Herring 提交于
This reverts commit e5269794.
-
- 18 11月, 2016 1 次提交
-
-
由 Sudeep Holla 提交于
Currently platforms/drivers needing to get the machine model name are replicating the same snippet of code. In some case, the OF reference counting is either missing or incorrect. This patch adds support to read the machine model name either using the "model" or the "compatible" property in the device tree root node to the core OF/DT code. This can be used to remove all the duplicate code snippets doing exactly same thing later. Cc: Rob Herring <robh+dt@kernel.org> Cc: Frank Rowand <frowand.list@gmail.com> Cc: Arnd Bergmann <arnd@arndb.de> Signed-off-by: NSudeep Holla <sudeep.holla@arm.com> Signed-off-by: NRob Herring <robh@kernel.org>
-
- 11 11月, 2016 1 次提交
-
-
由 Alan Tull 提交于
This patch add of overlay notifications. When DT overlays are being added, some drivers/subsystems need to see device tree overlays before the changes go into the live tree. This is distinct from reconfig notifiers that are post-apply or post-remove and which issue very granular notifications without providing access to the context of a whole overlay. The following 4 notificatons are issued: OF_OVERLAY_PRE_APPLY OF_OVERLAY_POST_APPLY OF_OVERLAY_PRE_REMOVE OF_OVERLAY_POST_REMOVE In the case of pre-apply notification, if the notifier returns error, the overlay will be rejected. This patch exports two functions for registering/unregistering notifications: of_overlay_notifier_register(struct notifier_block *nb) of_overlay_notifier_unregister(struct notifier_block *nb) The of_mutex is held during these notifications. The notification data includes pointers to the overlay target and the overlay: struct of_overlay_notify_data { struct device_node *overlay; struct device_node *target; }; Signed-off-by: NAlan Tull <atull@opensource.altera.com> Acked-by: NRob Herring <robh@kernel.org> Acked-by: NMoritz Fischer <moritz.fischer@ettus.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
- 15 9月, 2016 1 次提交
-
-
由 Richard Fitzgerald 提交于
Add a new set of array reading functions that take a minimum and maximum size limit and will fail if the property size is not within the size limits. This makes it more convenient for drivers that use variable-size DT arrays which must be bounded at both ends - data must be at least N entries but must not overflow the array it is being copied into. It is also more efficient than making this functionality out of existing public functions and avoids duplication. The existing array functions have been left in the API, since there are a very large number of clients of those functions and their existing functionality is still useful. This avoids turning a small API improvement into a major kernel rework. The old functions have been turned into mininmal static inlines calling the new functions. The old functions had no upper limit on the actual size of the dts entry, to preserve this functionality rather than keeping two near-identical implementations, if the new function is called with max=0 there is no limit on the size of the dts entry but only the min number of elements are read. Signed-off-by: NRichard Fitzgerald <rf@opensource.wolfsonmicro.com> Signed-off-by: NRob Herring <robh@kernel.org>
-
- 20 7月, 2016 1 次提交
-
-
由 Benjamin Herrenschmidt 提交于
This provides an equivalent of of_fdt_match() for non-flat trees. This is more practical than matching an array of of_device_id structs when converting a bunch of existing users of of_fdt_match(). Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org> Acked-by: NRob Herring <robh@kernel.org> Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
-
- 28 6月, 2016 1 次提交
-
-
由 Daniel Lezcano 提交于
The macro OF_DECLARE_1 expect a void (*func)(struct device_node *) while the OF_DECLARE_2 expect a int (*func)(struct device_node *, struct device_node *). The second one allows to pass an init function returning a value, which make possible to call the functions in the table and check the return value in order to catch at a higher level the errors and handle them from there instead of doing a panic in each driver (well at least this is the case for the clkevt). Unfortunately the OF_DECLARE_1 does not allow that and that lead to some code duplication and crappyness in the drivers. The OF_DECLARE_1 is used by all the clk drivers and the clocksource/clockevent drivers. It is not possible to do the change in one shot as we have to change all the init functions. The OF_DECLARE_2 specifies an init function prototype with two parameters with the node and its parent. The latter won't be used, ever, in the timer drivers. Introduce a OF_DECLARE_1_RET macro to be used, and hopefully we can smoothly and iteratively change the users of OF_DECLARE_1 to use the new macro instead. Signed-off-by: NDaniel Lezcano <daniel.lezcano@linaro.org> Acked-by: NRob Herring <robh@kernel.org>
-
- 26 6月, 2016 1 次提交
-
-
由 Adam Thomson 提交于
For device nodes in both DT and ACPI, it possible to have named child nodes which contain properties (an existing example being gpio-leds). This adds a function to find a named child node for a device which can be used by drivers for property retrieval. For DT data node name matching, of_node_cmp() and similar functions are made available outside of CONFIG_OF block so the new function can reference these for DT and non-DT builds. For ACPI data node name matching, a helper function is also added which returns false if CONFIG_ACPI is not set, otherwise it performs a string comparison on the data node name. This avoids using the acpi_data_node struct for non CONFIG_ACPI builds, which would otherwise cause a build failure. Signed-off-by: NAdam Thomson <Adam.Thomson.Opensource@diasemi.com> Acked-by: NSathyanarayana Nujella <sathyanarayana.nujella@intel.com> Acked-by: NRob Herring <robh@kernel.org> Acked-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 03 6月, 2016 1 次提交
-
-
由 Kuninori Morimoto 提交于
commit 93c667ca ("of: *node argument to of_parse_phandle_with_args should be const") changed to const for struct device node *np, but it cares CONFIG_OF case only, !CONFIG_OF case need it too. Signed-off-by: NKuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: NRob Herring <robh@kernel.org>
-
- 28 4月, 2016 1 次提交
-
-
由 Heikki Krogerus 提交于
Since fwnode may hold ERR_PTR(-ENODEV) or it may be NULL, the fwnode type checks is_of_node(), is_acpi_node() and is is_pset_node() need to consider it. Using IS_ERR_OR_NULL() to check it. Fixes: 0d67e0fa (device property: fix for a case of use-after-free) Reported-by: NDan Carpenter <dan.carpenter@oracle.com> Signed-off-by: NHeikki Krogerus <heikki.krogerus@linux.intel.com> [ rjw: Subject & changelog ] Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
-
- 20 4月, 2016 4 次提交
-
-
由 Joerg Roedel 提交于
This helper function can be used to copy the arguments of a phandle to an array. Signed-off-by: NJoerg Roedel <jroedel@suse.de> Signed-off-by: NRob Herring <robh@kernel.org>
-
由 Joerg Roedel 提交于
With this macro any user can easily iterate over a list of phandles. The patch also converts __of_parse_phandle_with_args() to make use of the macro. The of_count_phandle_with_args() function is not converted, because the macro hides the return value of of_phandle_iterator_init(), which is needed in there. Signed-off-by: NJoerg Roedel <jroedel@suse.de> Signed-off-by: NRob Herring <robh@kernel.org>
-
由 Joerg Roedel 提交于
Move the code to walk over the phandles out of the loop in __of_parse_phandle_with_args() to a separate function that just works with the iterator handle: of_phandle_iterator_next(). Signed-off-by: NJoerg Roedel <jroedel@suse.de> Signed-off-by: NRob Herring <robh@kernel.org>
-
由 Joerg Roedel 提交于
This struct carrys all necessary information to iterate over a list of phandles and extract the arguments. Add an init-function for the iterator and make use of it in __of_parse_phandle_with_args(). Signed-off-by: NJoerg Roedel <jroedel@suse.de> Signed-off-by: NRob Herring <robh@kernel.org>
-
- 16 4月, 2016 1 次提交
-
-
由 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: NDavid Daney <david.daney@cavium.com> Acked-by: NRob Herring <robh@kernel.org> Signed-off-by: NWill Deacon <will.deacon@arm.com>
-
- 04 3月, 2016 1 次提交
-
-
由 David Rivshin 提交于
The of_property_{read,count,match}_string* family of functions never modify the struct device_node pointer that is passed in, so there is no reason for it to be non-const. Equivalent functions for all other types already take a 'const struct device_node *np'. Signed-off-by: NDavid Rivshin <drivshin@allworx.com> Signed-off-by: NRob Herring <robh@kernel.org>
-
- 25 1月, 2016 1 次提交
-
-
由 Masahiro Yamada 提交于
The users of this macro (OF_EARLYCON_DECLARE, CLK_OF_DECLARE, IRQCHIP_DECLARE, etc.) are only parsed in the early boot stage. Such symbols contained in modules are never used. This commit fixes the link error introduced by commit b8d20e06 ("serial: 8250_uniphier: add earlycon support"); the combination of CONFIG_SERIAL_8250_UNIPHIER=m and CONFIG_SERIAL_8250_CONSOLE=y fails to link: ERROR: "early_serial8250_setup" [drivers/tty/serial/8250/8250_uniphier.ko] undefined! Fixes: b8d20e06 ("serial: 8250_uniphier: add earlycon support") Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com> Acked-by: NArnd Bergmann <arnd@arndb.de> Signed-off-by: NRob Herring <robh@kernel.org>
-
- 11 11月, 2015 1 次提交
-
-
由 Guenter Roeck 提交于
If OF_ADDRESS is not configured, builds can fail with errors such as drivers/net/ethernet/hisilicon/hns_mdio.c: In function 'hns_mdio_bus_name': drivers/net/ethernet/hisilicon/hns_mdio.c:411:3: error: implicit declaration of function 'of_translate_address' as currently seen when building sparc:allmodconfig. Introduce a static inline function if OF_ADDRESS is not configured to fix the build failure. Return OF_BAD_ADDR in this case. For this to work, the definition of OF_BAD_ADDR has to be moved outside CONFIG_OF conditional code. Fixes: 876133d3 ("net: hisilicon: add OF dependency") Cc: Arnd Bergmann <arnd@arndb.de> Signed-off-by: NGuenter Roeck <linux@roeck-us.net> Reviewed-by: NArnd Bergmann <arnd@arndb.de> Reviewed-by: NFrank Rowand <frank.rowand@sonymobile.com> Signed-off-by: NRob Herring <robh@kernel.org>
-
- 26 8月, 2015 1 次提交
-
-
由 Andy Shevchenko 提交于
Potentially one of platform can support both ACPI and OF. In that case when we call to_of_node() for non-OF fwnode types we will get non-NULL result, which is wrong. Check for the type and return a correspondent result. Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: NMika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
-
- 25 6月, 2015 1 次提交
-
-
由 Alexander Sverdlin 提交于
Commit 8a0662d9 introduced of_node and acpi_node symbols in global namespace but there were already ~63 of_node local variables or function parameters (no single acpi_node though, but anyway). After debugging undefined but used of_node local varible (which turned out to reference static function of_node() instead) it became clear that the names for the functions are too short and too generic for global scope. Signed-off-by: NAlexander Sverdlin <alexander.sverdlin@gmail.com> Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
-
- 23 6月, 2015 1 次提交
-
-
由 Suman Anna 提交于
Define stub implementation for of_find_node_by_phandle() API so that users of this API can build properly even when CONFIG_OF is not defined. Fixes x86 randconfig build failure of remoteproc. Signed-off-by: NSuman Anna <s-anna@ti.com> [robh: add details on fixing remoteproc compile] Signed-off-by: NRob Herring <robh@kernel.org>
-
- 04 6月, 2015 1 次提交
-
-
由 Konstantin Khlebnikov 提交于
Node 0 might be offline as well as any other numa node, in this case kernel cannot handle memory allocation and crashes. Signed-off-by: NKonstantin Khlebnikov <khlebnikov@yandex-team.ru> Fixes: 0c3f061c ("of: implement of_node_to_nid as a weak function") Signed-off-by: NGrant Likely <grant.likely@linaro.org>
-
- 28 5月, 2015 2 次提交
-
-
由 Geert Uytterhoeven 提交于
Signed-off-by: NGeert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: NRob Herring <robh@kernel.org>
-
由 Pantelis Antoniou 提交于
We need those to be visible even when compiling with CONFIG_OF disabled, since even the empty of_node_*_flag() method use the flag. Signed-off-by: NPantelis Antoniou <pantelis.antoniou@konsulko.com> Acked-by: NWolfram Sang <wsa+renesas@sang-engineering.com> Signed-off-by: NRob Herring <robh@kernel.org>
-
- 27 5月, 2015 1 次提交
-
-
由 Sudeep Holla 提交于
Commit 5590f319 ("drivers/core/of: Add symlink to device-tree from devices with an OF node") adds the symlink `of_node` for each device pointing to it's device tree node while creating/initialising it. However the devicetree sysfs is created and setup in of_init which is executed at core_initcall level. For all the devices created before of_init, the following error is thrown: "Error -2(-ENOENT) creating of_node link" Like many other components in driver model, initialize the sysfs support for OF/devicetree from driver_init so that it's ready before any devices are created. Fixes: 5590f319 ("drivers/core/of: Add symlink to device-tree from devices with an OF node") Suggested-by: NRob Herring <robh+dt@kernel.org> Cc: Grant Likely <grant.likely@linaro.org> Cc: Pawel Moll <pawel.moll@arm.com> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: NSudeep Holla <sudeep.holla@arm.com> Tested-by: NRobert Schwebel <r.schwebel@pengutronix.de> Acked-by: NRob Herring <robh@kernel.org> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
- 25 5月, 2015 1 次提交
-
-
由 Sudeep Holla 提交于
Commit 5590f319 ("drivers/core/of: Add symlink to device-tree from devices with an OF node") adds the symlink `of_node` for each device pointing to it's device tree node while creating/initialising it. However the devicetree sysfs is created and setup in of_init which is executed at core_initcall level. For all the devices created before of_init, the following error is thrown: "Error -2(-ENOENT) creating of_node link" Like many other components in driver model, initialize the sysfs support for OF/devicetree from driver_init so that it's ready before any devices are created. Fixes: 5590f319 ("drivers/core/of: Add symlink to device-tree from devices with an OF node") Suggested-by: NRob Herring <robh+dt@kernel.org> Cc: Grant Likely <grant.likely@linaro.org> Cc: Pawel Moll <pawel.moll@arm.com> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: NSudeep Holla <sudeep.holla@arm.com> Tested-by: NRobert Schwebel <r.schwebel@pengutronix.de> Acked-by: NRob Herring <robh@kernel.org> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
- 15 4月, 2015 1 次提交
-
-
由 Kevin Cernekee 提交于
SoC peripherals can come in several different flavors: - little-endian: registers always need to be accessed in LE mode (so the kernel should perform a swap if the CPU is running BE) - big-endian: registers always need to be accessed in BE mode (so the kernel should perform a swap if the CPU is running LE) - native-endian: the bus will automatically swap accesses, so the kernel should never swap Introduce a function that checks an OF device node to see whether it contains a "big-endian" or "native-endian" property. For the former case, always return true. For the latter case, return true iff the kernel was built for BE (implying that the BE MMIO accessors do not perform a swap). Otherwise return false, assuming LE registers. LE registers are assumed by default because most existing drivers (libahci, serial8250, usb) always use readl/writel in the absence of instructions to the contrary, so that will be our fallback. Signed-off-by: NKevin Cernekee <cernekee@gmail.com> Reviewed-by: NPeter Hurley <peter@hurleysoftware.com> Acked-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: NRob Herring <robh@kernel.org>
-
- 28 3月, 2015 1 次提交
-
-
由 Pantelis Antoniou 提交于
Introduce empty node and property flag accessors when CONFIG_OF is not defined. This allows us to use them without ifdef'ing them in places where it makes sense to do so. Signed-off-by: NPantelis Antoniou <pantelis.antoniou@konsulko.com> Acked-by: NRob Herring <robh@kernel.org> Signed-off-by: NGrant Likely <grant.likely@linaro.org>
-
- 18 3月, 2015 1 次提交
-
-
由 Wolfram Sang 提交于
I2C supports adding adapters using either a dynamic or fixed id. The latter is provided by aliases in the DT case. To prevent id collisions of those two types, install this function which gives us the highest fixed id, so we can then let the dynamically created ones come after this highest number. Signed-off-by: NWolfram Sang <wsa+renesas@sang-engineering.com> Acked-by: NRob Herring <robh@kernel.org> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
- 04 12月, 2014 1 次提交
-
-
由 Grant Likely 提交于
The ->next pointer in struct device_node is a hanger-on from when it was used to iterate over the whole tree by a particular device_type property value. Those days are long over, but the fdt unflattening code still uses it to put nodes in the unflattened tree into the same order as node in the flat tree. By reworking the unflattening code to reverse the list after unflattening all the children of a node, the pointer can be dropped which gives a small amount of memory savings. Signed-off-by: NGrant Likely <grant.likely@linaro.org> Acked-by: NFrank Rowand <frank.rowand@sonymobile.com> Cc: Gaurav Minocha <gaurav.minocha.os@gmail.com>
-