Something went wrong. Try again.
Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
Something went wrong. Try again.
6.8 kB · 152 lines
at master
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153.. SPDX-License-Identifier: GPL-2.0
=====================================Generic System Interconnect Subsystem=====================================
Introduction------------
This framework is designed to provide a standard kernel interface to controlthe settings of the interconnects on an SoC. These settings can be throughput,latency and priority between multiple interconnected devices or functionalblocks. This can be controlled dynamically in order to save power or providemaximum performance.
The interconnect bus is hardware with configurable parameters, which can beset on a data path according to the requests received from various drivers.An example of interconnect buses are the interconnects between variouscomponents or functional blocks in chipsets. There can be multiple interconnectson an SoC that can be multi-tiered.
Below is a simplified diagram of a real-world SoC interconnect bus topology.
::
+----------------+ +----------------+ | HW Accelerator |--->| M NoC |<---------------+ +----------------+ +----------------+ | | | +------------+ +-----+ +-------------+ V +------+ | | | DDR | | +--------+ | PCIe | | | +-----+ | | Slaves | +------+ | | ^ ^ | +--------+ | | C NoC | | | V V | | +------------------+ +------------------------+ | | +-----+ | |-->| |-->| |-->| CPU | | |-->| |<--| | +-----+ | Mem NoC | | S NoC | +------------+ | |<--| |---------+ | | |<--| |<------+ | | +--------+ +------------------+ +------------------------+ | | +-->| Slaves | ^ ^ ^ ^ ^ | | +--------+ | | | | | | V +------+ | +-----+ +-----+ +---------+ +----------------+ +--------+ | CPUs | | | GPU | | DSP | | Masters |-->| P NoC |-->| Slaves | +------+ | +-----+ +-----+ +---------+ +----------------+ +--------+ | +-------+ | Modem | +-------+
Terminology-----------
Interconnect provider is the software definition of the interconnect hardware.The interconnect providers on the above diagram are M NoC, S NoC, C NoC, P NoCand Mem NoC.
Interconnect node is the software definition of the interconnect hardwareport. Each interconnect provider consists of multiple interconnect nodes,which are connected to other SoC components including other interconnectproviders. The point on the diagram where the CPUs connect to the memory iscalled an interconnect node, which belongs to the Mem NoC interconnect provider.
Interconnect endpoints are the first or the last element of the path. Everyendpoint is a node, but not every node is an endpoint.
Interconnect path is everything between two endpoints including all the nodesthat have to be traversed to reach from a source to destination node. It mayinclude multiple master-slave pairs across several interconnect providers.
Interconnect consumers are the entities which make use of the data paths exposedby the providers. The consumers send requests to providers requesting variousthroughput, latency and priority. Usually the consumers are device drivers, thatsend request based on their needs. An example for a consumer is a video decoderthat supports various formats and image sizes.
Interconnect providers----------------------
Interconnect provider is an entity that implements methods to initialize andconfigure interconnect bus hardware. The interconnect provider drivers shouldbe registered with the interconnect provider core.
.. kernel-doc:: include/linux/interconnect-provider.h
.. kernel-doc:: drivers/interconnect/core.c :functions: icc_provider_init icc_provider_register icc_provider_deregister icc_node_create icc_node_create_dyn icc_node_destroy icc_node_add icc_node_del icc_nodes_remove icc_node_set_name icc_link_create icc_link_nodes
Interconnect consumers----------------------
Interconnect consumers are the clients which use the interconnect APIs toget paths between endpoints and set their bandwidth/latency/QoS requirementsfor these interconnect paths.
.. kernel-doc:: drivers/interconnect/core.c :functions: devm_of_icc_get of_icc_get_by_index of_icc_get icc_get icc_put icc_enable icc_disable icc_set_bw icc_set_tag icc_get_name
.. kernel-doc:: drivers/interconnect/bulk.c
Interconnect debugfs interfaces-------------------------------
Like several other subsystems interconnect will create some files for debuggingand introspection. Files in debugfs are not considered ABI so applicationsoftware shouldn't rely on format details change between kernel versions.
``/sys/kernel/debug/interconnect/interconnect_summary``:
Show all interconnect nodes in the system with their aggregated bandwidthrequest. Indented under each node show bandwidth requests from each device.
``/sys/kernel/debug/interconnect/interconnect_graph``:
Show the interconnect graph in the graphviz dot format. It shows allinterconnect nodes and links in the system and groups together nodes from thesame provider as subgraphs. The format is human-readable and can also be pipedthrough dot to generate diagrams in many graphical formats::
$ cat /sys/kernel/debug/interconnect/interconnect_graph | \ dot -Tsvg > interconnect_graph.svg
The ``test-client`` directory provides interfaces for issuing BW requests toany arbitrary path. Note that for safety reasons, this feature is disabled bydefault without a Kconfig to enable it. Enabling it requires code changes to``#define INTERCONNECT_ALLOW_WRITE_DEBUGFS``. Example usage::
cd /sys/kernel/debug/interconnect/test-client/
# Configure node endpoints for the path from CPU to DDR on # qcom/sm8550. echo chm_apps > src_node echo ebi > dst_node
# Get path between src_node and dst_node. This is only # necessary after updating the node endpoints. echo 1 > get
# Set desired BW to 1GBps avg and 2GBps peak. echo 1000000 > avg_bw echo 2000000 > peak_bw
# Vote for avg_bw and peak_bw on the latest path from "get". # Voting for multiple paths is possible by repeating this # process for different nodes endpoints. echo 1 > commit