Commit graph

5 commits

Author SHA1 Message Date
Grant Likely
78119fd106 of/irq: Fix bug in interrupt parsing refactor.
Commit 2361613206, "of/irq: Refactor interrupt-map parsing" introduced
a bug. The irq parsing will fail for some nodes that don't have a reg
property. It is fixed by deferring the check for reg until it is
actually needed. Also adjust the testcase data to catch the bug.

Signed-off-by: Grant Likely <grant.likely@linaro.org>
Tested-by: Stephen Warren <swarren@nvidia.com>
Tested-by: Ming Lei <tom.leiming@gmail.com>
Tested-by: Stephen Warren <swarren@nvidia.com>
Cc: Rob Herring <rob.herring@calxeda.com>
2013-11-03 23:16:35 +00:00
Grant Likely
79d9701559 of/irq: create interrupts-extended property
The standard interrupts property in device tree can only handle
interrupts coming from a single interrupt parent. If a device is wired
to multiple interrupt controllers, then it needs to be attached to a
node with an interrupt-map property to demux the interrupt specifiers
which is confusing. It would be a lot easier if there was a form of the
interrupts property that allows for a separate interrupt phandle for
each interrupt specifier.

This patch does exactly that by creating a new interrupts-extended
property which reuses the phandle+arguments pattern used by GPIOs and
other core bindings.

Signed-off-by: Grant Likely <grant.likely@linaro.org>
Acked-by: Tony Lindgren <tony@atomide.com>
Acked-by: Kumar Gala <galak@codeaurora.org>
[grant.likely: removed versatile platform hunks into separate patch]
Cc: Rob Herring <rob.herring@calxeda.com>
2013-10-28 16:48:14 -07:00
Grant Likely
a9f10ca76d of: Add testcases for interrupt parsing
This patch extends the DT selftest code with some test cases for the
interrupt parsing functions.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
2013-10-24 11:43:21 +01:00
Grant Likely
7aff0fe330 of: Add of_property_match_string() to find index into a string list
Add a helper function for finding the index of a string in a string
list property.  This helper is useful for bindings that use a separate
*-name property for attaching names to tuples in another property such
as 'reg' or 'gpios'.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
2012-01-28 10:29:20 -07:00
Grant Likely
53a42093d9 of: Add device tree selftests
Add some runtime test cases for the library of device tree parsing functions.

v2: - Add testcase for phandle with 0 args
    - Don't run testcases if testcase data isn't present in device tree

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
2011-12-12 13:40:16 -07:00