Page MenuHomeFreeBSD

Use common fdt_intr_to_rl() function, enhance that to handle interrupt-extended properties, remove duplicated code.
ClosedPublic

Authored by ian on Sep 20 2014, 8:02 PM.
Tags
None
Referenced Files
Unknown Object (File)
May 5 2024, 1:14 PM
Unknown Object (File)
Apr 28 2024, 3:41 PM
Unknown Object (File)
Dec 19 2023, 11:32 PM
Unknown Object (File)
Nov 14 2023, 11:58 AM
Unknown Object (File)
Nov 12 2023, 12:46 AM
Unknown Object (File)
Nov 10 2023, 10:05 PM
Unknown Object (File)
Nov 9 2023, 6:57 PM
Unknown Object (File)
Nov 8 2023, 5:56 PM
Subscribers
None

Details

Summary

We have multiple nearly-identical copies of code to walk through a node's interrupts=<...> property creating resource list entries. This change makes fdt_intr_to_rl() the one true copy of that code and removes the copies of it from other places.

This also adds handling of the interrupts-extended property, which allows specifying multiple interrupts for a node where each interrupt can have a separate interrupt-parent. The bindings for this state that the property cells contain an xref phandle to the interrupt parent followed by whatever interrupt info that parent normally expects. This leads to having a variable number of icells per interrupt in the property. For example you could have <&intc1 1 &intc2 26 9 0 &intc3 9 4>.

Test Plan

Compile-tested. Run-tested on wandboard only right now.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

ian retitled this revision from to Use common fdt_intr_to_rl() function, enhance that to handle interrupt-extended properties, remove duplicated code..
ian updated this object.
ian edited the test plan for this revision. (Show Details)
ian added reviewers: nwhitehorn, ARM.
ian set the repository for this revision to rS FreeBSD src repository - subversion.

Cleans up a few unused variable warnings, and fixes the WII build by including dev/fdt/fdt_common.c for both fdt and aim options/devices.

This will probably break all non-FDT Open Firmware platforms, which do not include anything in sys/dev/fdt into their kernels. It's possible that the change to conf/files.powerpc fixes it, but it highlights a more general issue: there is nothing whatever FDT-specific about the code. Could you move the function into dev/ofw/ofw_bus_subr.c? That's where these things belong.

A minor comment on the algorithm: I think all of the OF_searchencprop() calls are bogus and should be OF_getencprop(), at least per the spec. Are you aware of any boards that require OF_searchencprop()? The code itself otherwise looks fine.

You helped me add that OF_searchencprop() stuff a few months ago because I was tripping over malformed data on some platform, I forget which one.

Right! Then we should keep that.

ian updated this revision to Diff 1763.

Closed by commit rS272109 (authored by @ian).