aboutsummaryrefslogtreecommitdiff
path: root/lib/utils/cppc
diff options
context:
space:
mode:
authorSamuel Holland <samuel.holland@sifive.com>2024-11-11 14:02:46 -0800
committerAnup Patel <anup@brainfault.org>2024-11-28 17:13:05 +0530
commit1ccc52c427f3f3b2244798cb1895d32a23abe36c (patch)
tree6c2d625dde9745fe29b5cbe52580f0c8b0dd5bc8 /lib/utils/cppc
parentdf1c1000014049d95d65de831f9015a2dcf9fa34 (diff)
downloadopensbi-1ccc52c427f3f3b2244798cb1895d32a23abe36c.zip
opensbi-1ccc52c427f3f3b2244798cb1895d32a23abe36c.tar.gz
opensbi-1ccc52c427f3f3b2244798cb1895d32a23abe36c.tar.bz2
lib: utils/fdt: Add helpers for generic driver initialization
Currently, each driver subsystem contains its own code for matching drivers against the platform's devicetree blob. This bloats firmware size because the several FDT scanning loops are almost exact copies of each other, and is confusing because the loops do have some subtle differences. Furthermore, the existing match algorithm is inefficient: it scans the FDT structure separately for each driver in the list. A faster algorithm scans the FDT blob only once, matching all drivers in the list for each `compatible` property seen. Add new helpers implementing this faster algorithm. Since they must iterate through the list of drivers, the driver structure cannot be opaque. However, since the driver list is an array of pointers, the `struct fdt_driver` can be embedded in a subsystem-specific driver structure if needed. These three helpers cover all existing use cases for driver initialization within OpenSBI. An additional benefit of centralized driver initialization is the consistent use of fdt_node_is_enabled(). Signed-off-by: Samuel Holland <samuel.holland@sifive.com> Reviewed-by: Anup Patel <anup@brainfault.org>
Diffstat (limited to 'lib/utils/cppc')
0 files changed, 0 insertions, 0 deletions