- 29 5月, 2015 1 次提交
-
-
由 Joachim Eastwood 提交于
It's a common operation for device drivers to retrive the data member from of_device_id struct in their probe function. Most driver end up doing: const struct of_device_id *match; match = of_match_device(driver_of_match, &pdev->dev); driver->data = match->data; With the of_device_get_match_data helper function all this can done in one go. Signed-off-by: NJoachim Eastwood <manabian@gmail.com> [robh: add missing inline to dummmy declaration] Signed-off-by: NRob Herring <robh@kernel.org>
-
- 17 4月, 2015 1 次提交
-
-
由 Baruch Siach 提交于
Add two new facts to of_get_next_child() documentation: * of_get_next_child() returns NULL when there is not next child * of_get_next_child() decrements the refcount of prev Signed-off-by: NBaruch Siach <baruch@tkos.co.il> Signed-off-by: NRob Herring <robh@kernel.org>
-
- 15 4月, 2015 6 次提交
-
-
由 Pantelis Antoniou 提交于
During the course of the overlay selftests some of them remain applied. While this does not pose a real problem, make sure you track them and destroy them at the end of the test. Signed-off-by: NPantelis Antoniou <pantelis.antoniou@konsulko.com> Signed-off-by: NRob Herring <robh@kernel.org>
-
由 Ricky Liang 提交于
The allocation size of device node path is off by one which drops the '\0' terminator. Signed-off-by: NRicky Liang <jcliang@chromium.org> Signed-off-by: NRob Herring <robh@kernel.org>
-
由 Kevin Cernekee 提交于
Provide a libfdt-based equivalent for of_device_is_big_endian(), suitable for use in the early_init_* functions. 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>
-
由 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>
-
由 Florian Fainelli 提交于
Commit 51975db0 ("of/flattree: merge early_init_dt_scan_memory() common code") consolidated some code from PowerPC (typically big-endian), and ended-up adding a pr_debug() printing reg properties in big-endian (DT native) format, not CPU endian. This debug print suffers from two problems: - we only print 4 "reg" values, while there could be more on typical systems having multiple memory ranges - we print these 4 "reg" values in FDT endianess, that is big-endian, and these values could be confusing for little-endian configurations Since we are already printing the base address and size of the memory regions parsed by early_init_dt_scan_memory() later in a way that is both endian correct, and takes into account arbitrary number of memory banks, just remove that part of the debug print. Suggested-by: NFrank Rowand <frowand.list@gmail.com> Signed-off-by: NFlorian Fainelli <f.fainelli@gmail.com> Signed-off-by: NRob Herring <robh@kernel.org>
-
由 Geert 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: NGeert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: NRob Herring <robh@kernel.org>
-
- 29 3月, 2015 7 次提交
-
-
由 Grant Likely 提交于
The previous commit, "of/unittest: early return from test skips tests" exposed broken tests for the of_platform_unpopulate() function. The problem was the populate and depopulate calls were not symmetrical like they were intended to be, and unpopulate depends on the parent device to have it's of_node pointer pointing to the parent device node. Fix these bugs so that the test case works correctly. In the process, the test_bus used as a container for the test devices has been changed from a statically allocated struct device (which is bad) to a properly allocated device with a .release() method (which is good). This stops the test code from being a bad example of abusing the device model. Signed-off-by: NGrant Likely <grant.likely@linaro.org> Cc: Frank Rowand <frank.rowand@sonymobile.com> Cc: Pantelis Antoniou <pantelis.antoniou@konsulko.com> Cc: Pawel Moll <pawel.moll@arm.com>
-
由 Frank Rowand 提交于
Fix bugs pointed out by checkpatch: Mis-coding of two if statements caused early return from function. Number of tests completed increased from 102 to 107. Number of tests failed increased from 0 to 2. Signed-off-by: NFrank Rowand <frank.rowand@sonymobile.com> Signed-off-by: NGrant Likely <grant.likely@linaro.org>
-
由 Frank Rowand 提交于
Fix warnings pointed out by checkpatch. Checkpatch warns: externs should be avoided in .c files Reducing pain for future maintainers - adding a comment so that anyone trying to find where the extern data is created will be able to find it. (grep will not find that location) Signed-off-by: NFrank Rowand <frank.rowand@sonymobile.com> Signed-off-by: NGrant Likely <grant.likely@linaro.org>
-
由 Frank Rowand 提交于
Fix warnings pointed out by checkpatch. No bug fixes, but reduce the number of checkpatch warnings so that future problems will stand out better. Signed-off-by: NFrank Rowand <frank.rowand@sonymobile.com> Signed-off-by: NGrant Likely <grant.likely@linaro.org>
-
由 Frank Rowand 提交于
Fix bug pointed out by checkpatch. Splitting string incorrectly removed a space between two words. Signed-off-by: NFrank Rowand <frank.rowand@sonymobile.com> Signed-off-by: NGrant Likely <grant.likely@linaro.org>
-
由 Frank Rowand 提交于
Fix warnings pointed out by checkpatch. No bugs fixed, but the test code should be a good example of how to use the devicetree API. Signed-off-by: NFrank Rowand <frank.rowand@sonymobile.com> Signed-off-by: NGrant Likely <grant.likely@linaro.org>
-
由 Sergei Shtylyov 提交于
of_get_mac_address() basically does the same thing thrice, every time with a different property name, so it makes sense to factor out the repetitive code into separate function. While at it, we can start using ETH_ALEN instead of the bare number and drop unnecessary parens around the property length check. The resulting ARM object file is 100 bytes less in size than before the patch. Signed-off-by: NSergei Shtylyov <sergei.shtylyov@cogentembedded.com> Acked-by: NDavid S. Miller <davem@davemloft.net> Acked-by: NFlorian Fainelli <f.fainelli@gmail.com> Signed-off-by: NGrant Likely <grant.likely@linaro.org>
-
- 28 3月, 2015 3 次提交
-
-
由 Benjamin Herrenschmidt 提交于
The "sdc" node is missing the ranges property, it needs to be treated as having an empty one otherwise translation fails for its children. Fixes 746c9e9f, "of/base: Fix PowerPC address parsing hack" Tested-by: NSteven Rostedt <rostedt@goodmis.org> Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: NGrant Likely <grant.likely@linaro.org> Cc: Stable <stable@vger.kernel.org> # v3.18+
-
由 Geert 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: NGeert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: NGrant Likely <grant.likely@linaro.org>
-
由 Benjamin Herrenschmidt 提交于
The "sdc" node is missing the ranges property, it needs to be treated as having an empty one otherwise translation fails for its children. Fixes 746c9e9f, "of/base: Fix PowerPC address parsing hack" Tested-by: NSteven Rostedt <rostedt@goodmis.org> Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: NGrant Likely <grant.likely@linaro.org> Cc: Stable <stable@vger.kernel.org> # v3.18+
-
- 25 3月, 2015 2 次提交
-
-
由 Wang Long 提交于
This patch just replace the string 'selftest' with 'unittest' in OF unittest and data and binding file. I have tested it successfully on ARM. Signed-off-by: NWang Long <long.wanglong@huawei.com> Signed-off-by: NRob Herring <robh@kernel.org>
-
由 Frank Rowand 提交于
If CONFIG_OF_UNITTEST=y then a kernel image make will always cause .version to be incremented, even if there are not source changes. This is caused by a lack of dependency tracking and checking for drivers/of/unittest-data/testcases.dtb.o. Signed-off-by: NFrank Rowand <frank.rowand@sonymobile.com> Signed-off-by: NRob Herring <robh@kernel.org>
-
- 19 3月, 2015 4 次提交
-
-
由 Peter Hurley 提交于
This reverts commit 2fa645cb. The assumption that at least 1 preferred console will be registered when the stdout-path property is set is invalid, which can result in _no_ consoles. Signed-off-by: NPeter Hurley <peter@hurleysoftware.com> Signed-off-by: NRob Herring <robh@kernel.org>
-
由 Brian Norris 提交于
Commit 106937e8 ("of: fix handling of '/' in options for of_find_node_by_path()") caused a regression in OF handling of stdout-path. While it fixes some cases which have '/' after the ':', it breaks cases where there is more than one '/' *before* the ':'. For example, it breaks this boot string stdout-path = "/rdb/serial@f040ab00:115200"; So rather than doing sequentialized checks (first for '/', then for ':'; or vice versa), to get the correct behavior we need to check for the first occurrence of either one of them. It so happens that the handy strcspn() helper can do just that. Fixes: 106937e8 ("of: fix handling of '/' in options for of_find_node_by_path()") Signed-off-by: NBrian Norris <computersforpeace@gmail.com> Cc: stable@vger.kernel.org # 3.19 Acked-by: NLeif Lindholm <leif.lindholm@linaro.org> Signed-off-by: NRob Herring <robh@kernel.org>
-
由 Brian Norris 提交于
There were regressions seen with commit 106937e8 ("of: fix handling of '/' in options for of_find_node_by_path()"), where we couldn't handle extra '/' before the ':'. Let's test for this now. Confirmed that this test fails without the previous patch and passes when patched. All other tests pass. Signed-off-by: NBrian Norris <computersforpeace@gmail.com> Acked-by: NLeif Lindholm <leif.lindholm@linaro.org> Signed-off-by: NRob Herring <robh@kernel.org>
-
由 Laurent Pinchart 提交于
The error code paths that require cleanup use a goto to jump to the cleanup code and return an error code. However, the error code variable res, which is initialized to -EINVAL when declared, is then overwritten with the return value of of_parse_phandle_with_args(), and reused as the return code from of_irq_parse_one(). This leads to an undetermined error being returned instead of the expected -EINVAL value. Fix it. Signed-off-by: NLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Cc: stable@vger.kernel.org # 3.13+ Signed-off-by: NRob Herring <robh@kernel.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>
-
- 13 3月, 2015 1 次提交
-
-
由 Murali Karicheri 提交于
Calculate the dma_mask and coherent_dma_mask based on the dma-range values set in DT for the device. Limit the mask to lower of the default mask and mask calculated. Signed-off-by: NMurali Karicheri <m-karicheri2@ti.com> Signed-off-by: NBjorn Helgaas <bhelgaas@google.com> Reviewed-by: NCatalin Marinas <catalin.marinas@arm.com> CC: Joerg Roedel <joro@8bytes.org> CC: Grant Likely <grant.likely@linaro.org> CC: Rob Herring <robh+dt@kernel.org> CC: Will Deacon <will.deacon@arm.com> CC: Russell King <linux@arm.linux.org.uk> CC: Arnd Bergmann <arnd@arndb.de> CC: Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>
-
- 12 3月, 2015 1 次提交
-
-
由 Florian Fainelli 提交于
Export of_mdio_parse_addr() which allows parsing a given Ethernet PHY node MDIO address, verify it is within the allowed range, and return its value. This is going to be useful for the DSA code which needs to deal with multiple layers of MDIO buses. Signed-off-by: NFlorian Fainelli <f.fainelli@gmail.com> Acked-by: NRob Herring <robh@kernel.org> Signed-off-by: NDavid S. Miller <davem@davemloft.net>
-
- 10 3月, 2015 7 次提交
-
-
由 Peter Hurley 提交于
Add testcase variants with '/' in the options string to test for scan beyond end path name terminated by ':'. Signed-off-by: NPeter Hurley <peter@hurleysoftware.com> Signed-off-by: NRob Herring <robh@kernel.org>
-
由 Leif Lindholm 提交于
Ensure proper handling of paths with appended options (after ':'), where those options may contain a '/'. Fixes: 7914a7c5 ("of: support passing console options with stdout-path") Reported-by: NPeter Hurley <peter@hurleysoftware.com> Signed-off-by: NLeif Lindholm <leif.lindholm@linaro.org> Cc: <stable@vger.kernel.org> # 3.19 Signed-off-by: NRob Herring <robh@kernel.org>
-
由 Wang Long 提交于
This patch fix the wrong expected value of of_property_match_string in of_selftest_property_string. Signed-off-by: NWang Long <long.wanglong@huawei.com> Signed-off-by: NRob Herring <robh@kernel.org>
-
由 Wang Long 提交于
Remove the duplicate of_changeset_init. In of_selftest_changeset testcase, the "struct of_changeset chgset" is initialized twice, but only once is enough. so, drop the first initializtion code. Signed-off-by: NWang Long <long.wanglong@huawei.com> Signed-off-by: NRob Herring <robh@kernel.org>
-
由 Arnd Bergmann 提交于
The unittest fails to link if I2C or I2C_MUX is a loadable module: drivers/built-in.o: In function `selftest_i2c_mux_remove': unittest.c:(.text+0xb0ce4): undefined reference to `i2c_del_mux_adapter' This changes the newly added IS_ENABLED() checks to use IS_BUILTIN() instead, which evaluates to false if the other driver is a module. Reported-by: NChen Gang <gang.chen.5i5j@gmail.com> Signed-off-by: NArnd Bergmann <arnd@arndb.de> Fixes: d5e75500 ("of: unitest: Add I2C overlay unit tests.") Signed-off-by: NRob Herring <robh@kernel.org>
-
由 Fabio Estevam 提交于
Commit 3e7f7626 ("of/overlay: Do not generate duplicate nodes") removed the only use of the 'grandchild' variable, which leads to the following build warning: drivers/of/overlay.c: In function 'of_overlay_apply_single_device_node': drivers/of/overlay.c:89:31: warning: unused variable 'grandchild' [-Wunused-variable] struct device_node *tchild, *grandchild; ^ Remove this unused variable. Signed-off-by: NFabio Estevam <fabio.estevam@freescale.com> Signed-off-by: NRob Herring <robh@kernel.org>
-
由 Peter Hurley 提交于
Support for devicetree serial consoles via 'stdout-path' causes bootconsoles to be disabled when the vt dummy console loads, since there is no preferred console (the preferred console is not added until the device is probed). Ensure there is at least a preferred console, even if never matched. Requires: "console: Fix console name size mismatch" Cc: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: NPeter Hurley <peter@hurleysoftware.com> Signed-off-by: NRob Herring <robh@kernel.org>
-
- 04 3月, 2015 4 次提交
-
-
由 Murali Karicheri 提交于
Add of_pci_dma_configure() to allow updating the DMA configuration of the PCI device using the configuration from DT of the parent of the root bridge device. Use the newly added APIs pci_get/put_host_bridge_device() for implementing this. [bhelgaas: fold in fix for host bridges with no parent OF device] Tested-by: Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com> (AMD Seattle) Signed-off-by: NMurali Karicheri <m-karicheri2@ti.com> Signed-off-by: NBjorn Helgaas <bhelgaas@google.com> Reviewed-by: NCatalin Marinas <catalin.marinas@arm.com> Acked-by: NRob Herring <robh+dt@kernel.org> Acked-by: NWill Deacon <will.deacon@arm.com> CC: Joerg Roedel <joro@8bytes.org> CC: Grant Likely <grant.likely@linaro.org> CC: Russell King <linux@arm.linux.org.uk> CC: Arnd Bergmann <arnd@arndb.de>
-
由 Murali Karicheri 提交于
Fix the dma-range size when the DT attribute is missing, i.e., set size to dev->coherent_dma_mask + 1 instead of dev->coherent_dma_mask. Also add code to check invalid values of size configured in DT and log error. Tested-by: Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com> (AMD Seattle) Signed-off-by: NMurali Karicheri <m-karicheri2@ti.com> Signed-off-by: NBjorn Helgaas <bhelgaas@google.com> Reviewed-by: NCatalin Marinas <catalin.marinas@arm.com> Acked-by: NWill Deacon <will.deacon@arm.com> CC: Joerg Roedel <joro@8bytes.org> CC: Grant Likely <grant.likely@linaro.org> CC: Rob Herring <robh+dt@kernel.org> CC: Russell King <linux@arm.linux.org.uk> CC: Arnd Bergmann <arnd@arndb.de>
-
由 Murali Karicheri 提交于
Move of_dma_configure() to device.c so it can be re-used for PCI devices to obtain DMA configuration from DT. Also add a second argument so that for PCI, the DT node of root bus host bridge can be used to obtain the DMA configuration for the slave PCI device. Tested-by: Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com> (AMD Seattle) Signed-off-by: NMurali Karicheri <m-karicheri2@ti.com> Signed-off-by: NBjorn Helgaas <bhelgaas@google.com> Reviewed-by: NCatalin Marinas <catalin.marinas@arm.com> Acked-by: NWill Deacon <will.deacon@arm.com> Acked-by: NRob Herring <robh+dt@kernel.org> CC: Joerg Roedel <joro@8bytes.org> CC: Grant Likely <grant.likely@linaro.org> CC: Russell King <linux@arm.linux.org.uk> CC: Arnd Bergmann <arnd@arndb.de>
-
由 Murali Karicheri 提交于
of_iommu_configure() is called from of_dma_configure() to setup iommu ops using DT property. This API is currently used for platform devices for which DMA configuration (including IOMMU ops) may come from the device's parent. To extend this functionality for PCI devices, this API needs to take a parent node ptr as an argument instead of assuming device's parent. This is needed since for PCI, the DMA configuration may be defined in the DT node of the root bus bridge's parent device. Currently only dma-range is used for PCI and IOMMU is not supported. Return error if the device is PCI. Add "parent" parameter (a struct device_node *) to of_iommu_configure(). Tested-by: Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com> (AMD Seattle) Signed-off-by: NMurali Karicheri <m-karicheri2@ti.com> Signed-off-by: NBjorn Helgaas <bhelgaas@google.com> Reviewed-by: NCatalin Marinas <catalin.marinas@arm.com> Acked-by: NRob Herring <robh+dt@kernel.org> Acked-by: NWill Deacon <will.deacon@arm.com> CC: Joerg Roedel <joro@8bytes.org> CC: Grant Likely <grant.likely@linaro.org> CC: Russell King <linux@arm.linux.org.uk> CC: Arnd Bergmann <arnd@arndb.de>
-
- 02 3月, 2015 2 次提交
-
-
由 Mark Brown 提交于
The overlay code uses IDRs but does not explicitly include the header providing the interface, instead relying on an implicit inclusion. Make the dependency explicit to avoid potential future build issues if the implicit inclusion goes away. Signed-off-by: NMark Brown <broonie@kernel.org> Signed-off-by: NRob Herring <robh@kernel.org>
-
由 Matwey V. Kornilov 提交于
The whole menu already depends on OF, so there is no need to additionaly specify it. Suggested-by: NPaul Bolle <pebolle@tiscali.nl> Signed-off-by: NMatwey V. Kornilov <matwey@sai.msu.ru> Signed-off-by: NRob Herring <robh@kernel.org>
-