요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
============================
Linux kernel SLIMbus support
============================
Overview
========
What is SLIMbus?
----------------
SLIMbus (Serial Low Power Interchip Media Bus) is a specification developed by
MIPI (Mobile Industry Processor Interface) alliance. The bus uses master/slave
configuration, and is a 2-wire multi-drop implementation (clock, and data).
Currently, SLIMbus is used to interface between application processors of SoCs
(System-on-Chip) and peripheral components (typically codec). SLIMbus uses
Time-Division-Multiplexing to accommodate multiple data channels, and
a control channel.
The control channel is used for various control functions such as bus
management, configuration and status updates. These messages can be unicast (e.g.
reading/writing device specific values), or multicast (e.g. data channel
reconfiguration sequence is a broadcast message announced to all devices)
A data channel is used for data-transfer between 2 SLIMbus devices. Data
channel uses dedicated ports on the device.
Hardware description:
---------------------
SLIMbus specification has different types of device classifications based on
their capabilities.
A manager device is responsible for enumeration, configuration, and dynamic
channel allocation. Every bus has 1 active manager.
A generic device is a device providing application functionality (e.g. codec).
Framer device is responsible for clocking the bus, and transmitting frame-sync
and framing information on the bus.
Each SLIMbus component has an interface device for monitoring physical layer.
Typically each SoC contains SLIMbus component having 1 manager, 1 framer device,
1 generic device (for data channel support), and 1 interface device.
External peripheral SLIMbus component usually has 1 generic device (for
functionality/data channel support), and an associated interface device.
The generic device's registers are mapped as 'value elements' so that they can
be written/read using SLIMbus control channel exchanging control/status type of
information.
In case there are multiple framer devices on the same bus, manager device is
responsible to select the active-framer for clocking the bus.
Per specification, SLIMbus uses "clock gears" to do power management based on
current frequency and bandwidth requirements. There are 10 clock gears and each
gear changes the SLIMbus frequency to be twice its previous gear.
Each device has a 6-byte enumeration-address and the manager assigns every
device with a 1-byte logical address after the devices report presence on the
bus.
Software description:
---------------------
There are 2 types of SLIMbus drivers:
slim_controller represents a 'controller' for SLIMbus. This driver should
implement duties needed by the SoC (manager device, associated
interface device for monitoring the layers and reporting errors, default
framer device).
slim_device represents the 'generic device/component' for SLIMbus, and a
slim_driver should implement driver for that slim_device.
Device notifications to the driver:
-----------------------------------
Since SLIMbus devices have mechanisms for reporting their presence, the
framework allows drivers to bind when corresponding devices report their
presence on the bus.
However, it is possible that the driver needs to be probed
first so that it can enable corresponding SLIMbus device (e.g. power it up and/or
take it out of reset). To support that behavior, the framework allows drivers
to probe first as well (e.g. using standard DeviceTree compatibility field).
This creates the necessity for the driver to know when the device is functional
(i.e. reported present). device_up callback is used for that reason when the
device reports present and is assigned a logical address by the controller.
Similarly, SLIMbus devices 'report absent' when they go down. A 'device_down'
callback notifies the driver when the device reports absent and its logical
address assignment is invalidated by the controller.
Another notification "boot_device" is used to notify the slim_driver when
controller resets the bus. This notification allows the driver to take necessary
steps to boot the device so that it's functional after the bus has been reset.
Driver and Controller APIs:
---------------------------
.. kernel-doc:: include/linux/slimbus.h
:internal:
.. kernel-doc:: drivers/slimbus/slimbus.h
:internal:
.. kernel-doc:: drivers/slimbus/core.c
:export:
Clock-pause:
------------
SLIMbus mandates that a reconfiguration sequence (known as clock-pause) be
broadcast to all active devices on the bus before the bus can enter low-power
mode. Controller uses this sequence when it decides to enter low-power mode so
that corresponding clocks and/or power-rails can be turned off to save power.
Clock-pause is exited by waking up framer device (if controller driver initiates
exiting low power mode), or by toggling the data line (if a slave device wants
to initiate it).
Clock-pause APIs:
~~~~~~~~~~~~~~~~~
.. kernel-doc:: drivers/slimbus/sched.c
:export:
Messaging:
----------
The framework supports regmap and read/write apis to exchange control-information
with a SLIMbus device. APIs can be synchronous or asynchronous.
The header file <linux/slimbus.h> has more documentation about messaging APIs.
Messaging APIs:
~~~~~~~~~~~~~~~
.. kernel-doc:: drivers/slimbus/messaging.c
:export:
Streaming APIs:
~~~~~~~~~~~~~~~
.. kernel-doc:: drivers/slimbus/stream.c
:export:
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.
Linux SLIMbus 지원
1-4이 문서는 Linux kernel의 SLIMbus 지원과 hardware·software model, power management 및 messaging API를 설명합니다.
============================
Linux kernel SLIMbus support
============================
SLIMbus topology와 channel
5-26SLIMbus(Serial Low Power Interchip Media Bus)는 MIPI(Mobile Industry Processor Interface) alliance가 개발한 specification입니다. Master/slave configuration을 사용하며 clock과 data의 두 wire로 구성된 multi-drop bus입니다.
현재는 주로 SoC application processor와 codec 같은 peripheral component 사이 interface로 사용합니다. Time-Division Multiplexing으로 여러 data channel과 하나의 control channel을 수용합니다.
Control channel은 bus management, configuration, status update에 사용됩니다. Device-specific value read/write는 unicast이고 모든 device에 알리는 data-channel reconfiguration sequence는 multicast broadcast입니다.
Data channel은 두 SLIMbus device 사이 data transfer에 사용하며 device의 dedicated port를 이용합니다.
2-wire multi-drop bus에서 control과 여러 data channel을 time division으로 multiplex합니다.
Overview
========
What is SLIMbus?
----------------
SLIMbus (Serial Low Power Interchip Media Bus) is a specification developed by
MIPI (Mobile Industry Processor Interface) alliance. The bus uses master/slave
configuration, and is a 2-wire multi-drop implementation (clock, and data).
Currently, SLIMbus is used to interface between application processors of SoCs
(System-on-Chip) and peripheral components (typically codec). SLIMbus uses
Time-Division-Multiplexing to accommodate multiple data channels, and
a control channel.
The control channel is used for various control functions such as bus
management, configuration and status updates. These messages can be unicast (e.g.
reading/writing device specific values), or multicast (e.g. data channel
reconfiguration sequence is a broadcast message announced to all devices)
A data channel is used for data-transfer between 2 SLIMbus devices. Data
channel uses dedicated ports on the device.
Device class, clock gear와 address
27-58SLIMbus specification은 capability에 따라 device를 분류합니다. Manager device는 enumeration, configuration, dynamic channel allocation을 맡으며 bus마다 active manager가 하나 있습니다.
Generic device는 codec 같은 application 기능을 제공합니다. Framer device는 bus clocking과 frame-sync·framing information 전송을 담당하고, 각 SLIMbus component의 interface device는 physical layer를 monitor합니다.
일반적인 SoC component에는 manager 하나, framer 하나, data-channel용 generic device 하나, interface device 하나가 있습니다. External peripheral component는 보통 generic device와 연결된 interface device를 가집니다.
Generic device register는 value element로 mapping되어 control channel로 control·status 정보를 읽고 쓸 수 있습니다. Framer가 여러 개면 manager가 bus clocking에 사용할 active framer를 선택합니다.
SLIMbus는 현재 frequency와 bandwidth 요구에 따라 power를 관리하는 10개의 clock gear를 사용합니다. 각 gear는 바로 이전 gear의 두 배 frequency입니다.
각 device는 6-byte enumeration address를 가지며, bus에 presence를 보고하면 manager가 1-byte logical address를 할당합니다.
Bus당 active manager는 하나이며 logical address assignment도 manager가 담당합니다.
Hardware description:
---------------------
SLIMbus specification has different types of device classifications based on
their capabilities.
A manager device is responsible for enumeration, configuration, and dynamic
channel allocation. Every bus has 1 active manager.
A generic device is a device providing application functionality (e.g. codec).
Framer device is responsible for clocking the bus, and transmitting frame-sync
and framing information on the bus.
Each SLIMbus component has an interface device for monitoring physical layer.
Typically each SoC contains SLIMbus component having 1 manager, 1 framer device,
1 generic device (for data channel support), and 1 interface device.
External peripheral SLIMbus component usually has 1 generic device (for
functionality/data channel support), and an associated interface device.
The generic device's registers are mapped as 'value elements' so that they can
be written/read using SLIMbus control channel exchanging control/status type of
information.
In case there are multiple framer devices on the same bus, manager device is
responsible to select the active-framer for clocking the bus.
Per specification, SLIMbus uses "clock gears" to do power management based on
current frequency and bandwidth requirements. There are 10 clock gears and each
gear changes the SLIMbus frequency to be twice its previous gear.
Each device has a 6-byte enumeration-address and the manager assigns every
device with a 1-byte logical address after the devices report presence on the
bus.
Controller와 generic device driver
59-70SLIMbus driver는 두 종류입니다. `slim_controller`는 SLIMbus controller를 나타내며 SoC에 필요한 manager, layer monitoring·error reporting용 interface device, default framer 역할을 구현해야 합니다.
`slim_device`는 SLIMbus의 generic device 또는 component를 나타내며 `slim_driver`가 해당 device의 driver를 구현합니다.
Controller driver가 bus-level 역할을 맡고 slim_driver가 generic function device에 bind합니다.
Software description:
---------------------
There are 2 types of SLIMbus drivers:
slim_controller represents a 'controller' for SLIMbus. This driver should
implement duties needed by the SoC (manager device, associated
interface device for monitoring the layers and reporting errors, default
framer device).
slim_device represents the 'generic device/component' for SLIMbus, and a
slim_driver should implement driver for that slim_device.
Presence와 bus-reset notification
71-91SLIMbus device는 presence를 보고할 수 있으므로 framework는 대응 device가 bus에 나타날 때 driver를 bind할 수 있습니다.
반대로 driver가 먼저 probe되어 power를 켜거나 reset을 해제해야 device가 활성화되는 경우도 있습니다. Framework는 standard DeviceTree compatibility field 등을 이용한 probe-first 동작도 허용합니다.
이 경우 driver는 device가 언제 functional 상태가 되는지 알아야 합니다. Device가 presence를 보고하고 controller가 logical address를 할당하면 `device_up` callback이 호출됩니다.
Device가 내려가면서 absent를 보고하고 controller가 logical address assignment를 invalidate하면 `device_down` callback이 driver에 알립니다.
Controller가 bus를 reset하면 `boot_device` notification이 `slim_driver`에 전달됩니다. Driver는 bus reset 뒤 device를 다시 functional 상태로 만들기 위한 boot 절차를 수행할 수 있습니다.
Probe 시점과 presence 시점이 달라도 callback으로 functional state와 logical address 유효성을 동기화합니다.
Device notifications to the driver:
-----------------------------------
Since SLIMbus devices have mechanisms for reporting their presence, the
framework allows drivers to bind when corresponding devices report their
presence on the bus.
However, it is possible that the driver needs to be probed
first so that it can enable corresponding SLIMbus device (e.g. power it up and/or
take it out of reset). To support that behavior, the framework allows drivers
to probe first as well (e.g. using standard DeviceTree compatibility field).
This creates the necessity for the driver to know when the device is functional
(i.e. reported present). device_up callback is used for that reason when the
device reports present and is assigned a logical address by the controller.
Similarly, SLIMbus devices 'report absent' when they go down. A 'device_down'
callback notifies the driver when the device reports absent and its logical
address assignment is invalidated by the controller.
Another notification "boot_device" is used to notify the slim_driver when
controller resets the bus. This notification allows the driver to take necessary
steps to boot the device so that it's functional after the bus has been reset.
Driver와 controller API source
92-102Driver·controller API의 kernel-doc은 public header `include/linux/slimbus.h`, internal driver header `drivers/slimbus/slimbus.h`, core implementation `drivers/slimbus/core.c`에서 가져옵니다.
Driver and Controller APIs:
---------------------------
.. kernel-doc:: include/linux/slimbus.h
:internal:
.. kernel-doc:: drivers/slimbus/slimbus.h
:internal:
.. kernel-doc:: drivers/slimbus/core.c
:export:
Clock-pause low-power sequence
103-117SLIMbus가 low-power mode에 들어가기 전에 clock-pause라고 부르는 reconfiguration sequence를 bus의 모든 active device에 broadcast해야 합니다.
Controller가 low-power mode 진입을 결정하면 이 sequence를 사용해 관련 clock과 power rail을 끄고 전력을 절약합니다.
Controller driver가 low-power mode 종료를 시작하면 framer device를 깨워 clock-pause를 끝냅니다. Slave device가 종료를 시작하려면 data line을 toggle합니다.
Clock-pause API는 `drivers/slimbus/sched.c`의 exported function으로 문서화됩니다.
Broadcast reconfiguration 뒤 clock·rail을 끄고 framer wake 또는 data-line toggle로 bus를 재개합니다.
Clock-pause:
------------
SLIMbus mandates that a reconfiguration sequence (known as clock-pause) be
broadcast to all active devices on the bus before the bus can enter low-power
mode. Controller uses this sequence when it decides to enter low-power mode so
that corresponding clocks and/or power-rails can be turned off to save power.
Clock-pause is exited by waking up framer device (if controller driver initiates
exiting low power mode), or by toggling the data line (if a slave device wants
to initiate it).
Clock-pause APIs:
~~~~~~~~~~~~~~~~~
.. kernel-doc:: drivers/slimbus/sched.c
:export:
Control messaging API
118-128Framework는 SLIMbus device와 control information을 교환하기 위한 regmap과 read/write API를 지원합니다. API는 synchronous 또는 asynchronous 방식일 수 있습니다.
Messaging API의 자세한 설명은 `<linux/slimbus.h>`에 있으며 kernel-doc은 `drivers/slimbus/messaging.c`의 exported function을 가져옵니다.
Driver가 regmap 또는 read/write API로 value element와 control·status 정보를 교환합니다.
Messaging:
----------
The framework supports regmap and read/write apis to exchange control-information
with a SLIMbus device. APIs can be synchronous or asynchronous.
The header file <linux/slimbus.h> has more documentation about messaging APIs.
Messaging APIs:
~~~~~~~~~~~~~~~
.. kernel-doc:: drivers/slimbus/messaging.c
:export:
Streaming API source
129-132SLIMbus streaming API는 `drivers/slimbus/stream.c`의 exported function으로 문서화됩니다.
Streaming APIs:
~~~~~~~~~~~~~~~
.. kernel-doc:: drivers/slimbus/stream.c
:export:
요약과 해설
slimbus.rst:1-132SLIMbus는 2-wire TDM bus에서 control channel과 여러 data channel을 운반합니다. Manager가 enumeration·logical address·channel과 active framer를 관리하고, Linux framework는 presence·absence·bus reset callback, clock-pause power sequence, synchronous·asynchronous messaging과 streaming API를 제공합니다.