요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
.. SPDX-License-Identifier: GPL-2.0
=====================================
Generic System Interconnect Subsystem
=====================================
Introduction
------------
This framework is designed to provide a standard kernel interface to control
the settings of the interconnects on an SoC. These settings can be throughput,
latency and priority between multiple interconnected devices or functional
blocks. This can be controlled dynamically in order to save power or provide
maximum performance.
The interconnect bus is hardware with configurable parameters, which can be
set on a data path according to the requests received from various drivers.
An example of interconnect buses are the interconnects between various
components or functional blocks in chipsets. There can be multiple interconnects
on 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 NoC
and Mem NoC.
Interconnect node is the software definition of the interconnect hardware
port. Each interconnect provider consists of multiple interconnect nodes,
which are connected to other SoC components including other interconnect
providers. The point on the diagram where the CPUs connect to the memory is
called an interconnect node, which belongs to the Mem NoC interconnect provider.
Interconnect endpoints are the first or the last element of the path. Every
endpoint is a node, but not every node is an endpoint.
Interconnect path is everything between two endpoints including all the nodes
that have to be traversed to reach from a source to destination node. It may
include multiple master-slave pairs across several interconnect providers.
Interconnect consumers are the entities which make use of the data paths exposed
by the providers. The consumers send requests to providers requesting various
throughput, latency and priority. Usually the consumers are device drivers, that
send request based on their needs. An example for a consumer is a video decoder
that supports various formats and image sizes.
Interconnect providers
----------------------
Interconnect provider is an entity that implements methods to initialize and
configure interconnect bus hardware. The interconnect provider drivers should
be registered with the interconnect provider core.
.. kernel-doc:: include/linux/interconnect-provider.h
Interconnect consumers
----------------------
Interconnect consumers are the clients which use the interconnect APIs to
get paths between endpoints and set their bandwidth/latency/QoS requirements
for these interconnect paths. These interfaces are not currently
documented.
Interconnect debugfs interfaces
-------------------------------
Like several other subsystems interconnect will create some files for debugging
and introspection. Files in debugfs are not considered ABI so application
software 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 bandwidth
request. 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 all
interconnect nodes and links in the system and groups together nodes from the
same provider as subgraphs. The format is human-readable and can also be piped
through 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 to
any arbitrary path. Note that for safety reasons, this feature is disabled by
default 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
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.
Generic System Interconnect
1-21문서 제목은 `Generic System Interconnect Subsystem`입니다. Framework는 SoC interconnect 설정을 제어하는 standard kernel interface를 제공합니다. 설정에는 연결된 여러 device·functional block 사이 throughput, latency, priority가 포함되며 power 절감이나 maximum performance를 위해 동적으로 제어할 수 있습니다.
Interconnect bus는 configurable parameter를 가진 hardware입니다. 여러 driver가 보낸 request에 따라 data path의 parameter를 설정합니다. Chipset의 component·functional block 사이 interconnect가 한 예이며, SoC에는 multi-tier로 연결된 여러 interconnect가 있을 수 있습니다.
Consumer requirement가 hardware path 설정으로 집계되는 흐름입니다.
Framework가 path별로 다루는 대표 requirement입니다.
SoC interconnect topology
22-51원문의 simplified topology는 HW accelerator, CPU·GPU·DSP·modem·PCIe, DDR와 여러 slave가 M NoC, S NoC, C NoC, P NoC, Mem NoC를 통해 다단계로 연결되는 실제 SoC 구조를 나타냅니다. 원문 ASCII diagram을 그대로 보존하고 같은 연결을 표와 흐름으로 정리했습니다.
::
+----------------+ +----------------+
| 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 |
+-------+
원문 topology의 주요 provider·source·destination 관계입니다.
한 endpoint request가 여러 provider를 지나는 예입니다.
Interconnect terminology
52-77Interconnect provider는 interconnect hardware의 software definition입니다. 위 topology의 M NoC, S NoC, C NoC, P NoC, Mem NoC가 provider입니다.
Interconnect node는 interconnect hardware port의 software definition입니다. Provider 하나는 여러 node로 이루어지고, node는 다른 provider를 포함한 SoC component에 연결됩니다. CPU가 memory에 연결되는 diagram 지점도 Mem NoC provider에 속한 interconnect node입니다.
Interconnect endpoint는 path의 첫 element 또는 마지막 element입니다. 모든 endpoint는 node지만 모든 node가 endpoint인 것은 아닙니다.
Interconnect path는 source node에서 destination node까지 도달할 때 거쳐야 하는 모든 node를 포함한 두 endpoint 사이 전체입니다. 여러 provider에 걸쳐 여러 master-slave pair를 포함할 수 있습니다.
Interconnect consumer는 provider가 노출한 data path를 사용하는 entity입니다. Consumer는 throughput, latency, priority request를 provider에 보냅니다. 보통 필요에 따라 request를 보내는 device driver이며, 다양한 format과 image size를 지원하는 video decoder가 한 예입니다.
Provider·node·endpoint·path·consumer의 포함 관계입니다.
Video decoder 같은 consumer가 endpoint path를 사용하는 흐름입니다.
Interconnect provider
78-86Interconnect provider는 interconnect bus hardware를 initialize·configure하는 method를 구현하는 entity입니다. Provider driver는 interconnect provider core에 등록해야 합니다. Provider API kernel-doc source는 `include/linux/interconnect-provider.h`입니다.
.. kernel-doc:: include/linux/interconnect-provider.h
Hardware-specific driver와 generic core의 관계입니다.
Interconnect consumer
87-94Interconnect consumer는 interconnect API를 사용해 endpoint 사이 path를 얻고 그 path에 bandwidth, latency, QoS requirement를 설정하는 client입니다. 이 interface는 현재 문서화되어 있지 않습니다.
현재 미문서화된 interface가 수행하는 두 핵심 단계입니다.
Interconnect debugfs
95-116Interconnect subsystem은 debugging과 introspection용 debugfs file을 만듭니다. Debugfs는 ABI가 아니므로 application software는 kernel version 사이 format detail에 의존해서는 안 됩니다.
`/sys/kernel/debug/interconnect/interconnect_summary`는 system의 모든 interconnect node와 aggregate bandwidth request를 보여 줍니다. 각 node 아래에는 device별 bandwidth request가 indent되어 표시됩니다.
`/sys/kernel/debug/interconnect/interconnect_graph`는 system의 모든 node와 link를 Graphviz dot format으로 보여 주고 같은 provider의 node를 subgraph로 묶습니다. Human-readable이며 `dot`에 pipe해 여러 graphic format의 diagram을 만들 수 있습니다.
$ cat /sys/kernel/debug/interconnect/interconnect_graph | \
dot -Tsvg > interconnect_graph.svg
Summary와 graph의 정보·안정성입니다.
Debugfs dot graph를 SVG로 변환합니다.
Debugfs test-client
117-140`test-client` directory는 임의 path에 bandwidth request를 발행하는 interface를 제공합니다. 안전을 위해 enable하는 Kconfig 없이 default disabled이며, 사용하려면 `#define INTERCONNECT_ALLOW_WRITE_DEBUGFS`를 바꾸는 code change가 필요합니다.
예제는 qcom/sm8550에서 CPU에서 DDR로 가는 path의 `src_node=chm_apps`, `dst_node=ebi`를 설정합니다. Endpoint를 바꾼 뒤 `get`에 1을 써 path를 얻고, average 1 GBps에 해당하는 `avg_bw=1000000`, peak 2 GBps에 해당하는 `peak_bw=2000000`을 설정한 뒤 `commit`에 1을 써 vote합니다. 다른 endpoint로 과정을 반복하면 여러 path에 vote할 수 있습니다.
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
CPU→DDR example의 debugfs file과 값입니다.
Endpoint 설정에서 vote commit까지의 순서입니다.
요약과 해설
interconnect.rst:1-140Generic interconnect framework는 여러 provider와 node로 이루어진 SoC data path를 표현하고 consumer의 bandwidth·latency·priority request를 hardware 설정으로 집계합니다. Debugfs graph와 test-client는 강력하지만 stable ABI가 아니며 test write 기능은 안전상 기본 비활성입니다.