U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Neil Armstrong <neil.armstrong@linaro.org>
To: u-boot@lists.denx.de, Tom Rini <trini@konsulko.com>,
	 Simon Glass <sjg@chromium.org>,
	Casey Connolly <casey.connolly@linaro.org>
Cc: u-boot-qcom@groups.io,
	Ilias Apalodimas <ilias.apalodimas@linaro.org>,
	 Jerome Forissier <jerome.forissier@linaro.org>,
	 Dinesh Maniyam <dinesh.maniyam@altera.com>,
	 Sughosh Ganu <sughosh.ganu@linaro.org>,
	 Mattijs Korpershoek <mkorpershoek@kernel.org>,
	 Hrushikesh Salunke <h-salunke@ti.com>,
	Anurag Dutta <a-dutta@ti.com>,
	 Svyatoslav Ryhel <clamor95@gmail.com>,
	Ion Agorria <ion@agorria.com>,
	 "Kory Maincent (TI.com)" <kory.maincent@bootlin.com>,
	 Mario Six <mario.six@gdsys.cc>,
	Christian Marangi <ansuelsmth@gmail.com>,
	 Heiko Schocher <hs@nabladev.com>,
	 Guillaume La Roque <glaroque@baylibre.com>,
	 Miquel Raynal <miquel.raynal@bootlin.com>,
	Peng Fan <peng.fan@nxp.com>,  Michal Simek <michal.simek@amd.com>,
	 Heinrich Schuchardt <xypron.glpk@gmx.de>,
	 Pieter Van Trappen <pieter.van.trappen@cern.ch>,
	 Alexander Graf <agraf@csgraf.de>,
	Quentin Schulz <quentin.schulz@cherry.de>,
	 Rasmus Villemoes <ravi@prevas.dk>,
	Greg Malysa <malysagreg@gmail.com>,
	 Arturs Artamonovs <arturs.artamonovs@analog.com>,
	 Vasileios Bimpikas <vasileios.bimpikas@analog.com>,
	 Utsav Agarwal <utsav.agarwal@analog.com>,
	 Ian Roberts <ian.roberts@timesys.com>,
	 Nathan Barrett-Morrison <nathan.morrison@timesys.com>,
	 Alif Zakuan Yuslaimi <alif.zakuan.yuslaimi@altera.com>,
	 Stefan Roese <stefan.roese@mailbox.org>,
	Sumit Garg <sumit.garg@kernel.org>,
	 Bhupesh Sharma <bhupesh.linux@gmail.com>,
	 Neha Malcom Francis <n-francis@ti.com>,
	 Marek Vasut <marek.vasut+renesas@mailbox.org>,
	 Varadarajan Narayanan <quic_varada@quicinc.com>,
	Sam Day <me@samcday.com>,
	 Sam Protsenko <semen.protsenko@linaro.org>,
	Marek Vasut <marex@denx.de>,
	 Alper Nebi Yasak <alpernebiyasak@gmail.com>,
	 Oliver Gaskell <Oliver.Gaskell@analog.com>,
	 Paul Sajna <sajattack@postmarketos.org>,
	 Neil Armstrong <neil.armstrong@linaro.org>
Subject: [PATCH v5 0/7] Implement the Generic System Interconnect Subsystem for U-Boot
Date: Thu, 20 Nov 2025 09:12:51 +0100	[thread overview]
Message-ID: <20251120-topic-interconnect-next-v5-0-e8a82720da5d@linaro.org> (raw)

Let's introduce the Generic System Interconnect subsystem based on
the counterpart Linux framework which is used to vote for bandwidth
across multiple SoC busses.

Documentation for the Linux Generic System Interconnect Subsystem can
be found at [1].

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 between 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
- getting nodes states at probe is not implemented
- providers are probed on demand while the nodes links are traversed
- nodes are populated on bind
- id management is simplified, static IDs and dynamics IDs can be used
- identical consume API as Linux, only implementation differs

DM Testsuite is provided, testing all the API and nodes lifetime.

A first implementation for Qualcomm SoCs using the RPMh subsystem
is added, bandwidth vote is required to have full bandwidth for
storage devices and enabling some subsystem like Display to access
the DDR memory.

[1] https://docs.kernel.org/driver-api/interconnect.html

Qcom implementation depends on:
- https://lore.kernel.org/all/20250711143851.1490617-2-aswin.murugan@oss.qualcomm.com/

Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
---
Changes in v5:
- Fixed memory allocation issues fixing sandbox tests on CI
  - req allocations were not zero-ed, leading to funky avg values
  - xlate nodes mapping tables were not freed on drivers unbind, leading to memory leak
- Link to v4: https://patch.msgid.link/20251118-topic-interconnect-next-v4-0-9c00d6b19add@linaro.org

Changes in v4:
- Rebased on upstream next to prepare for a PR
- Link to v3: https://lore.kernel.org/r/20251010-topic-interconnect-next-v3-0-b384713283a8@linaro.org

Changes in v3:
- Add doc page, hevily based on the linux one
- Documented all the structs and functions
- Removed id field from icc_node, now using the device driver_data
- icc_node id is not an ulong, can accept a pointer for dynamic id
- Removed all functions call with icc_provider, now using the struct device only
- Removed the icc_node provider entry, now only using dev->parent
- Removed the interconnect pre_remove and pre_unbind, they are not needed
- Removed more unused struct entries
- Fixed the icc_path alloc, added the called dev to print errors with dev_err()
- Removed IDs in sandbox interconnect, uses the "dynamic id" using the node pointers as ID
- Now of_icc_get/_index will return NULL is prop is missing, like for Linux
- Cleaned all the debug() calls, added new ones to track the bw agregations
- Renamed node_find() to icc_node_find() to avoid name collision
- Moved icc_node busy check to icc_node_busy()
- Now icc_node_create passes the ID via driver_data
- Added more bw test after put() calls, moved enable() after disable()
- Used "Generic System Interconnect Subsystem" when possible
- Dropped the icc_node init_avg/init_peak which is a Linux thing for sync_state
- Dropped icc_node_add
- Link to v2: https://lore.kernel.org/r/20251008-topic-interconnect-next-v2-0-c46e94dd328e@linaro.org

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/20251003-topic-interconnect-next-v1-0-955eef068b6e@linaro.org

---
Neil Armstrong (7):
      Introduce the Generic System Interconnect Subsystem
      interconnect: add DM test suite
      MAINTAINERS: add myself as Maintainer of the Generic System Interconnect Subsystem
      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                                      |   11 +
 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 +
 doc/api/index.rst                                |    1 +
 doc/api/interconnect.rst                         |  117 ++
 drivers/Kconfig                                  |    2 +
 drivers/Makefile                                 |    1 +
 drivers/interconnect/Kconfig                     |   22 +
 drivers/interconnect/Makefile                    |    8 +
 drivers/interconnect/interconnect-uclass.c       |  545 +++++++
 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             |  224 +++
 drivers/interconnect/qcom/icc-rpmh.h             |  130 ++
 drivers/interconnect/qcom/sm8650.c               | 1665 ++++++++++++++++++++++
 drivers/interconnect/qcom/sm8650.h               |  144 ++
 drivers/interconnect/sandbox-interconnect-test.c |   89 ++
 drivers/interconnect/sandbox-interconnect.c      |  303 ++++
 drivers/ufs/ufs-qcom.c                           |   13 +
 include/dm/uclass-id.h                           |    2 +
 include/interconnect-uclass.h                    |  136 ++
 include/interconnect.h                           |  155 ++
 test/dm/Makefile                                 |    1 +
 test/dm/interconnect.c                           |  195 +++
 29 files changed, 4204 insertions(+)
---
base-commit: eb7a61d2cd7b24265c884dadf05ba20778ba99cd
change-id: 20251003-topic-interconnect-next-4ed75aecc01c

Best regards,
-- 
Neil Armstrong <neil.armstrong@linaro.org>


             reply	other threads:[~2025-11-20  8:14 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-20  8:12 Neil Armstrong [this message]
2025-11-20  8:12 ` [PATCH v5 1/7] Introduce the Generic System Interconnect Subsystem Neil Armstrong
2025-11-20  8:12 ` [PATCH v5 2/7] interconnect: add DM test suite Neil Armstrong
2025-11-20  8:12 ` [PATCH v5 3/7] MAINTAINERS: add myself as Maintainer of the Generic System Interconnect Subsystem Neil Armstrong
2025-11-20  8:12 ` [PATCH v5 4/7] interconnect: add support for the Qualcomm RPMh helpers Neil Armstrong
2025-11-20  8:12 ` [PATCH v5 5/7] interconnect: add support for the SM8650 SoC Neil Armstrong
2025-11-20  8:12 ` [PATCH v5 6/7] ufs: qcom: vote for interconnect bandwidth on probe Neil Armstrong
2025-11-20  8:12 ` [PATCH v5 7/7] qcom_defconfig: enable interconnect for SM8650 Neil Armstrong
2025-11-20  9:44 ` [PATCH v5 0/7] Implement the Generic System Interconnect Subsystem for U-Boot Neil Armstrong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251120-topic-interconnect-next-v5-0-e8a82720da5d@linaro.org \
    --to=neil.armstrong@linaro.org \
    --cc=Oliver.Gaskell@analog.com \
    --cc=a-dutta@ti.com \
    --cc=agraf@csgraf.de \
    --cc=alif.zakuan.yuslaimi@altera.com \
    --cc=alpernebiyasak@gmail.com \
    --cc=ansuelsmth@gmail.com \
    --cc=arturs.artamonovs@analog.com \
    --cc=bhupesh.linux@gmail.com \
    --cc=casey.connolly@linaro.org \
    --cc=clamor95@gmail.com \
    --cc=dinesh.maniyam@altera.com \
    --cc=glaroque@baylibre.com \
    --cc=h-salunke@ti.com \
    --cc=hs@nabladev.com \
    --cc=ian.roberts@timesys.com \
    --cc=ilias.apalodimas@linaro.org \
    --cc=ion@agorria.com \
    --cc=jerome.forissier@linaro.org \
    --cc=kory.maincent@bootlin.com \
    --cc=malysagreg@gmail.com \
    --cc=marek.vasut+renesas@mailbox.org \
    --cc=marex@denx.de \
    --cc=mario.six@gdsys.cc \
    --cc=me@samcday.com \
    --cc=michal.simek@amd.com \
    --cc=miquel.raynal@bootlin.com \
    --cc=mkorpershoek@kernel.org \
    --cc=n-francis@ti.com \
    --cc=nathan.morrison@timesys.com \
    --cc=peng.fan@nxp.com \
    --cc=pieter.van.trappen@cern.ch \
    --cc=quentin.schulz@cherry.de \
    --cc=quic_varada@quicinc.com \
    --cc=ravi@prevas.dk \
    --cc=sajattack@postmarketos.org \
    --cc=semen.protsenko@linaro.org \
    --cc=sjg@chromium.org \
    --cc=stefan.roese@mailbox.org \
    --cc=sughosh.ganu@linaro.org \
    --cc=sumit.garg@kernel.org \
    --cc=trini@konsulko.com \
    --cc=u-boot-qcom@groups.io \
    --cc=u-boot@lists.denx.de \
    --cc=utsav.agarwal@analog.com \
    --cc=vasileios.bimpikas@analog.com \
    --cc=xypron.glpk@gmx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox