summaryrefslogtreecommitdiffstats
path: root/drivers/of
Commit message (Collapse)AuthorAgeFilesLines
...
* of: partition: only create partition node when partitions existSascha Hauer2017-03-311-1/+8
| | | | | | | | | With the legacy partition binding we did not modify the device node when no partition exist, but with the new binding we would create the "partitions" node with compatible = "fixed-partitions". Prevent that by catching the absence of partitions early. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* of: partition: Make partition fixup independent from mtd devicesSascha Hauer2017-03-311-18/+27
| | | | | | | | The of partition parser is not only used for mtd device, but also for regular block devices, so make the of_mtd_fixup code independent of mtd devices also, so that other devices can be fixed up, too. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* of: partition: support 64bit partition sizesSascha Hauer2017-03-301-4/+13
| | | | | | | | Do not assume that #address-cells and #size-cells are both 1. Parse them appropriately to support devices > 4GuB. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mtd: of: Make used partition binding configurableSascha Hauer2017-03-301-7/+77
| | | | | | | | | | | | | | So far we used the legacy partition binding when fixing up the mtd partition nodes. Change this to default to the new binding with a "partitions" submode. Make this behaviour configurable though: This creates a new of_binding device variable for mtd devices. This can be set to: - "new": Use the new partition binding (default) - "legacy": Use the old partition binding - "donttouch": Do not touch the partition node Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* of: partition: Move of_mtd_fixup to drivers/of/Sascha Hauer2017-03-301-0/+69
| | | | | | | | Move the fixup code where the parser code is already. Since the code will not only be used for mtd in the future drivers/of/ is a better place than drivers/mtd/. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* treewide: Use of_property_write_string() where appropriateSascha Hauer2017-03-301-1/+1
| | | | | | | Replace users which use of_set_property() to set a property to a string with of_property_write_string(). Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* of: Add of_property_write_string()Sascha Hauer2017-03-301-0/+22
| | | | | | | Setting a property to a string is used many times. Create a convenience function for it. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/efi'Sascha Hauer2017-03-131-1/+1
|\
| * efi: move x86 efi boot support to x86 archJean-Christophe PLAGNIOL-VILLARD2017-02-271-1/+1
| | | | | | | | | | | | | | prepare to drop the efi arch as efi boot up is not arch sepecific Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | of: base: Use scoring in DT device matchingAndrey Smirnov2017-03-091-16/+21
|/ | | | | | | | | | | | | | | | Port Linux kernel algorithm for both of_device_is_compatible() and of_match_node(). With this change former now returns a score on the scale of 0 to INT_MAX/2, and the latter goes through all compatiblity entries and selects the entry that has the best matching score. This is needed for SoCs where IP blocks are backwards compatible and corresponding OF nodes can proclaim compatibility with several entries found in driver's compatiblity table. One such example would be PIO pinctrl block on AT91SAM9x5 SoCs which declare compatibility with with both "atmel,at91sam9x5-pinctrl" and "atmel,at91rm9200-pinctrl". Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/imx'Sascha Hauer2017-02-131-6/+6
|\
| * of: partitions: force "partitions" subnodeSascha Hauer2017-01-191-6/+6
| | | | | | | | | | | | | | | | | | The binding states that a subnode containing partition subnodes should have the name "partitions". Enforce this so that we do not parse nodes with other names which may have partition descriptions for other disks. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | of_path: only handle no driver for device if it is on a busIan Abbott2017-01-131-1/+1
|/ | | | | | | | | | This fixes a regression in __of_find_path() for flash devices created by the cadence-quadspi driver, which do not have 'dev->driver' set. Such devices do not have 'dev->bus' set either, so we can use that to qualify the existing test. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* of: Use %pa to print resource_size_t typeSascha Hauer2017-01-101-1/+1
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* of: base: add chosen node if it does not exist when adding initrdPhilipp Zabel2017-01-091-2/+2
| | | | | | | | | If the chosen node does not exist, of_add_initrd fails to pass the initrd to the kernel. Instead it should create the chosen node, just like of_fixup_bootargs does. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/state'Sascha Hauer2016-11-141-0/+3
|\
| * of_path: handle no driver for deviceSascha Hauer2016-10-201-0/+3
| | | | | | | | | | | | | | | | | | in __of_find_path it can happen that there is a device, but there is no driver for this device because it hasn't been probed yet. Return -ENODEV in this case to let the caller know that it has to try later again. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/misc'Sascha Hauer2016-11-142-2/+2
|\ \
| * | of: fix typosAntony Pavlov2016-10-182-2/+2
| |/ | | | | | | | | Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | of: of_find_path: Add support for new partition bindingSascha Hauer2016-11-111-1/+6
| | | | | | | | | | | | | | The partitions now may be in a subnode of the actual device node. Eventually go another step up in the hierarchy if required. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | of: partitions: Support new bindingSascha Hauer2016-11-111-0/+7
|/ | | | | | | The new binding recommends to put the partitions into a subnode with compatible "fixed-partitions". Add support for this binding. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* of: base: import of_get_cpu_node() from linux-v4.7-rc2Antony Pavlov2016-07-071-0/+86
| | | | | Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/misc'Sascha Hauer2016-06-141-0/+2
|\
| * of: base: Match simple-mfd devicesSascha Hauer2016-05-231-0/+2
| | | | | | | | | | | | | | Some simple-buses are now considered to be simple-mfd devices. Match them aswell. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | of: Add missing includeSascha Hauer2016-05-241-1/+1
|/ | | | | | | drivers/of/device.c has the implementation for of_match_device(), so also include the header which has the prototype. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/pci'Sascha Hauer2016-05-092-1/+34
|\
| * OF: Port of_match_device() and of_device_get_match_data()Andrey Smirnov2016-04-282-1/+34
| | | | | | | | | | | | | | | | | | Port of_match_device() and of_device_get_match_data() from Linux kernel code. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Acked-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/misc'Sascha Hauer2016-05-093-40/+108
|\ \
| * | of: fix of_tree_for_each_node_from() macroBoris Brezillon2016-04-281-32/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | of_tree_for_each_node_from() is supposed to iterate over all DT nodes after the one pointed by the from parameter, but with the current of_next_node() implementation we cannot access the root node. Patch of_next_node() to point to root_node when from is NULL. Doing that also simplifies users of of_tree_for_each_node_from() which were duplicating the logic to point to the root_node when from is NULL. Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | drivers/of: Always compile of_path.c with OF supportSascha Hauer2016-04-281-2/+2
| | | | | | | | | | | | | | | | | | | | | of_find_path() is a OF specific library function, so always compile it when OF support is enabled. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | of: preserve /memreserve/ entriesSascha Hauer2016-04-251-6/+100
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | Some dts files for the Kernel specify a reserved memory area using the /memreserve/ dtc directive. These entries get lost during unflattening/flattening the device tree and are never passed to the Kernel. This patch fixes this behaviour. This is done by copying the entries into a /memreserve node in the unflattened tree and moving them back during flattening the tree. The entries added by barebox dynamically are appended to the static entries from the original dtb. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* / string: Fix (v)asprintf prototypesSascha Hauer2016-04-154-4/+5
|/ | | | | | | | | | Our asprintf and vasprintf have different prototypes than the glibc functions. This causes trouble when we want to share barebox code with userspace code. Change the prototypes for (v)asprintf to match the glibc prototypes. Since the current (v)asprintf are convenient to use change the existing functions to b(v)asprintf. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Convert users of PRINTF_CONVERSION_RESOURCE to %paSascha Hauer2016-01-151-2/+5
| | | | | | | | printf now supports printing resource_size_t directly, convert all users of the previously used PRINTF_CONVERSION_RESOURCE over to %pa. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* of_path: Drop possible further extensions of device-path propertySascha Hauer2016-01-081-95/+28
| | | | | | | | | | Originally it was intended to further extend the multi string property device-path further with more elements, like for example a filename. It turned out though that this is too complex and instead of further extending the property we should instead create additional properties, so this mechanism is removed with this patch to make the code simpler. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* environment: Support env from file in a file-system via device treeTrent Piepho2016-01-082-2/+52
| | | | | | | | | | | | | | | Current barebox,environment node only allows specifying a raw device or partition to load an environment from. Some boards, like OMAP and SoCFPGA, instead want to use a file located in a FAT filesystem. Extend the device tree bindings with a new property 'file-path' that will trigger this behavior. This allows any board using this driver to get the env from a file or from a raw device, instead of each machine type being either raw device only or file only. Signed-off-by: Trent Piepho <tpiepho@kymetacorp.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* of_path: Fix bug with partitions, simply codeTrent Piepho2016-01-081-18/+29
| | | | | | | | | | | | | | | | | | | | | | In commit 75b682795eafb2385556a9642f09e0af96a1264a using a path that has a partition description broke. Fix this and simpfy the code some. There is no need to loop over each string in the path property: it's defined to have at most one parition description, no extant dts has more than one, and how it would handle more than one didn't make sense anyway. Once not looping, __of_find_path() just needs the partition description text, not both the original node and property name to look it up from. When using a partition description, don't lookup the cdev of the node just to replace it with the partition's cdev. Signed-off-by: Trent Piepho <tpiepho@kymetacorp.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/state'Sascha Hauer2015-12-081-37/+59
|\
| * of_path: add of_find_path_by_node()Marc Kleine-Budde2015-11-271-1/+16
| | | | | | | | | | | | | | | | | | This patch adds the function of_find_path_by_node(), which is similar to of_find_path(), but it translates a device tree node into a barebox device path directly. Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * of_path: of_find_path() factor out device detection logic into separate functionMarc Kleine-Budde2015-11-271-37/+44
| | | | | | | | | | | | | | | | This patch factors out the device detection logic into separate function, so that it can be used from another function. Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | of: mtd: Import of_get_nand_ecc_{step_size, strength} from LinuxSebastian Hesselbarth2015-11-231-0/+34
|/ | | | | | | | This imports DT helpers for MTD ECC step size and strength from Linux kernel. Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* of_path: Allow pointing directly to the partitionSascha Hauer2015-09-011-5/+9
| | | | | | | | We could only point to partitions in the device tree by using &norflash, "partname:barebox-environment". Allow to point to the partition directly without having to parse the partition labels. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* cdev: Add function to find cdev by device_nodeSascha Hauer2015-09-011-2/+2
| | | | | | | | | | This adds a device_node member to struct cdev and a function to find a cdev by device_node. This also removes the setting of cdev->dev->device_node in the of partition parser. We must not set the device since it may not refer to a partition but to a whole device with partitions. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/vpl'Sascha Hauer2015-08-071-0/+206
|\
| * of_graph: add of_graph_port_is_availableSascha Hauer2015-07-131-0/+22
| | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * of: import of_graph functionsSascha Hauer2015-07-131-0/+167
| | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * of: base: implement of_get_next_childSascha Hauer2015-07-131-0/+17
| | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | of/base: fix typoJan Luebbe2015-07-091-1/+1
|/ | | | | Signed-off-by: Jan Luebbe <jluebbe@debian.org> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* of: export of_platform_device_createSascha Hauer2015-07-021-1/+1
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* fdt: of_unflatten_dtb(): remove left over "root" argument from inline docMarc Kleine-Budde2015-05-151-1/+0
| | | | | | | | | | | | | In commit d384b5639fc1 of: Drop devicetree merge support the signature of of_unflatten_dtb() was changed, but the inline documentation was forgotten to adjust. This patch removes the left over "root" argument from the doc. Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/misc'Sascha Hauer2015-05-062-30/+11
|\