Let's introduce the Interconnect subsystem based on the Linux framework which is used to vote for bandwidth across multiple SoC busses.
Each bus endpoints are materialised as "nodes" which are linked together, and the DT will specify a pair of nodes to enable and set a bandwidth on the route betweeen those endpoints. The hardware resources that provide those nodes and provides the way to vote for the bandwidth are called "providers". The Interconnect uclass code is heavily based on the Linux one, with some small differences: - nodes are allocated as udevices instead of Linux idr_alloc() - tag management is minimal, only normal xlate is supported - dynamic IDs is not implemented - getting nodes states at probe is not implemented - providers are probed on demand while the nodes links are traversed DM Testsuite is provided, testing all the API and nodes lifetime. Qcom implementation depends on: - https://lore.kernel.org/all/[email protected]/ Signed-off-by: Neil Armstrong <[email protected]> --- Changes in v2: - Simplified nodes linking, looking for nodes at traversal instead of complexe debice reparent - Populates nodes at bind time, only probinf nodes and providers when a path if found - With proper refcounting the node lifetime is safe - DM test is added, testing with a small graph that calculations are good - Fixed plenty of typo and errors, and dropped useless code - Dropped RFC since DM test is available, and code works as expected - Link to v1: https://lore.kernel.org/r/[email protected] --- Neil Armstrong (7): Introduce the Interconnect Subsystem interconnect: add DM test suite MAINTAINERS: add myself as Maintainer of Interconnect interconnect: add support for the Qualcomm RPMh helpers interconnect: add support for the SM8650 SoC ufs: qcom: vote for interconnect bandwidth on probe qcom_defconfig: enable interconnect for SM8650 MAINTAINERS | 10 + arch/sandbox/dts/test.dts | 36 + arch/sandbox/include/asm/interconnect.h | 19 + configs/qcom_defconfig | 3 + configs/sandbox64_defconfig | 2 + configs/sandbox_defconfig | 2 + drivers/Kconfig | 2 + drivers/Makefile | 1 + drivers/interconnect/Kconfig | 22 + drivers/interconnect/Makefile | 8 + drivers/interconnect/interconnect-uclass.c | 548 +++++++ drivers/interconnect/qcom/Kconfig | 12 + drivers/interconnect/qcom/Makefile | 7 + drivers/interconnect/qcom/bcm-voter.c | 340 +++++ drivers/interconnect/qcom/bcm-voter.h | 19 + drivers/interconnect/qcom/icc-rpmh.c | 222 +++ drivers/interconnect/qcom/icc-rpmh.h | 129 ++ drivers/interconnect/qcom/sm8650.c | 1664 ++++++++++++++++++++++ drivers/interconnect/qcom/sm8650.h | 144 ++ drivers/interconnect/sandbox-interconnect-test.c | 89 ++ drivers/interconnect/sandbox-interconnect.c | 338 +++++ drivers/ufs/ufs-qcom.c | 13 + include/dm/uclass-id.h | 2 + include/interconnect-uclass.h | 74 + include/interconnect.h | 81 ++ test/dm/Makefile | 1 + test/dm/interconnect.c | 148 ++ 27 files changed, 3936 insertions(+) --- base-commit: b8cea886d50e6c09985256e546904d640f600e4d change-id: 20251003-topic-interconnect-next-4ed75aecc01c Best regards, -- Neil Armstrong <[email protected]>

