Skip to content

Commit b80f1a6

Browse files
committed
docs: i3c_controller: Add documentation
Signed-off-by: Jorge Marques <jorge.marques@analog.com>
1 parent 66f4861 commit b80f1a6

File tree

6 files changed

+1312
-0
lines changed

6 files changed

+1312
-0
lines changed
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
.. _i3c_controller core:
2+
3+
I3C Controller Core
4+
================================================================================
5+
6+
.. hdl-component-diagram::
7+
8+
The I3C Controller Core peripheral forms the heart of the I3C Controller.
9+
It is responsible for handling a I3C Controller commands and translates it into
10+
low-level I3C bus transactions.
11+
12+
Files
13+
-------------------------------------------------------------------------------
14+
15+
.. list-table::
16+
:widths: 25 75
17+
:header-rows: 1
18+
19+
* - Name
20+
- Description
21+
* - :git-hdl:`master:library/i3c_controller/i3c_controller_core/i3c_controller_core.v`
22+
- Verilog source for the peripheral.
23+
* - :git-hdl:`master:library/i3c_controller/i3c_controller_core/i3c_controller_core.tcl`
24+
- TCL script to generate the Vivado IP-integrator project for the peripheral.
25+
26+
27+
Configuration Parameters
28+
--------------------------------------------------------------------------------
29+
30+
.. hdl-parameters::
31+
32+
Signal and Interface Pins
33+
--------------------------------------------------------------------------------
34+
35+
.. hdl-interfaces::
36+
37+
Theory of Operation
38+
--------------------------------------------------------------------------------
39+
Lines changed: 150 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,150 @@
1+
.. _i3c_controller host_interface:
2+
3+
I3C Controller Host Interface
4+
================================================================================
5+
6+
.. hdl-component-diagram::
7+
8+
The I3C Controller Host Interface peripheral allows asynchronous interrupt-driven memory-mapped
9+
access to a I3C Controller Control Interface.
10+
This is typically used in combination with a software program to dynamically
11+
generate I3C transactions.
12+
13+
The peripheral also has support for providing memory-mapped access to one or more
14+
:ref:`i3c_controller offload-interface` cores and change its content dynamically at
15+
runtime.
16+
17+
Files
18+
--------------------------------------------------------------------------------
19+
20+
.. list-table::
21+
:widths: 25 75
22+
:header-rows: 1
23+
24+
* - Name
25+
- Description
26+
* - :git-hdl:`master:library/i3c_controller/i3c_controller_host_interface/i3c_controller_host_interface.v`
27+
- Verilog source for the peripheral.
28+
* - :git-hdl:`master:library/i3c_controller/i3c_controller_host_interface/i3c_controller_host_interface.tcl`
29+
- TCL script to generate the Vivado IP-integrator project for the peripheral.
30+
31+
Configuration Parameters
32+
--------------------------------------------------------------------------------
33+
34+
.. hdl-parameters::
35+
36+
Signal and Interface Pins
37+
--------------------------------------------------------------------------------
38+
39+
.. hdl-interfaces::
40+
41+
* - s_axi_aclk
42+
- All ``s_axi`` signals and ``irq`` are synchronous to this clock.
43+
* - s_axi_aresetn
44+
- Synchronous active-low reset.
45+
Resets the internal state of the peripheral.
46+
* - s_axi
47+
- AXI-Lite bus slave.
48+
Memory-mapped AXI-lite bus that provides access to modules register map.
49+
* - irq
50+
- Level-High Interrupt.
51+
Interrupt output of the module. Is asserted when at least one of the
52+
modules interrupt is pending and unmasked.
53+
* - offload_trigger
54+
- On offload operation, assert to start a burst.
55+
* - sdio
56+
- Group of byte stream interfaces (``SDI``, ``SDO``, and ``IBI``),
57+
internally connected to thei respective FIFOs.
58+
* - offload_sdi
59+
- SDI output of the :ref:`i3c_controller offload-interface`,
60+
generally consumed to a DMA.
61+
* - cmdp
62+
- Parsed :ref:`i3c_controller command_descriptors` to instruct the
63+
:ref:`i3c_controller core`.
64+
* - rmap
65+
- Interface give the :ref:`i3c_controller core` access to some register map
66+
addresses.
67+
68+
Register Map
69+
--------------------------------------------------------------------------------
70+
71+
.. hdl-regmap::
72+
:name: i3c_controller_host_interface
73+
74+
Theory of Operation
75+
--------------------------------------------------------------------------------
76+
77+
FIFOs
78+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
79+
80+
81+
Synchronization Events
82+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
83+
84+
85+
.. _i3c_controller interrupts:
86+
87+
Interrupts
88+
--------------------------------------------------------------------------------
89+
90+
The I3C Controller Host Interface peripheral has 8 internal interrupts, which are
91+
asserted when:
92+
93+
* ``CMD_ALMOST_EMPTY``: the level falls bellow the almost empty level.
94+
* ``CMDR_ALMOST_FULL``: the level rises above the almost full level.
95+
* ``SDO_ALMOST_EMPTY``: the level falls bellow the almost empty level.
96+
* ``SDI_ALMOST_FULL``: the level rises above the almost full level.
97+
* ``IBI_ALMOST_FULL``: the level rises above the almost full level.
98+
* ``CMDR_PENDING``: a new :ref:`i3c_controller cmdr` event arrives.
99+
* ``IBI_PENDING``: a new IBI event arrives.
100+
* ``DAA_PENDING``: a peripheral requested an address during the DAA.
101+
102+
The peripheral has 1 external interrupt which is supposed to be connected to the
103+
upstream interrupt controller.
104+
The external interrupt is a logical OR-operation over the internal interrupts,
105+
meaning if at least one of the internal interrupts is asserted the external
106+
interrupt is asserted and only if all internal interrupts are de-asserted the
107+
external interrupt is de-asserted.
108+
109+
In addition, each interrupt has a mask bit which can be used to stop the propagation
110+
of the internal interrupt to the external interrupt.
111+
If an interrupt is masked it will count towards the external interrupt state as if
112+
it were not asserted.
113+
114+
The mask bits can be modified by writing to the ``IRQ_MASK`` register.
115+
The raw interrupt status can be read from the ``IRQ_SOURCE`` register and the
116+
combined state of the ``IRQ_MASK`` and raw interrupt state can be read from the
117+
``IRQ_PENDING`` register:
118+
119+
.. code::
120+
121+
IRQ_PENDING = IRQ_SOURCE & IRQ_MASK;
122+
IRQ = |IRQ_PENDING;
123+
124+
FIFO Threshold Interrupts
125+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
126+
127+
The FIFO threshold interrupts can be used by software for flow control of the
128+
streams, for example,
129+
listen to the FIFO level interrupts during data transfer to and from the FIFOs
130+
to avoid data loss.
131+
132+
The FIFO threshold interrupt is asserted when then FIFO level rises above the
133+
watermark and is automatically de-asserted when the level drops below the
134+
watermark.
135+
136+
Pending Interrupts
137+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
138+
139+
The pending interrupt ``*_PENDING`` is asserted when a new sync event is received
140+
from a stream.
141+
For information about the ``CMDR`` see :ref:`i3c_controller cmdr`, and about the
142+
``IBI`` see :ref:`i3c_controller ibi`.
143+
144+
An application that generated a pending interrupt instruction can use this interrupt
145+
to be notified when the instruction has been completed.
146+
For example, for a ``cmd`` instruction, it has completed when the ``CMDR_PENDING``
147+
is received.
148+
149+
To de-assert the interrupt, the application needs to acknowledge its reception
150+
by writing 1 to the associated bit at the ``IRQ_PENDING`` register.

docs/library/i3c_controller/index.rst

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
.. _i3c_controller:
2+
3+
I3C Controller
4+
================================================================================
5+
6+
.. toctree::
7+
:hidden:
8+
9+
Host Interface<i3c_controller_host_interface>
10+
Core Module<i3c_controller_core>
11+
Interface<interface>
12+
13+
I3C Controller is subset of the I3C-basic specification to interface peripherals
14+
such as ADCs through I3C.
15+
16+
It consist out of two sub-modules which communicate over well defined interfaces.
17+
The :ref:`i3c_controller core` is a lean but powerful execution module, which
18+
implements the I3C bus control logic.
19+
It is controlled by a command stream generated by the :ref:`i3c_controller host_interface`,
20+
which parses the :ref:`i3c_controller command_descriptors`.
21+
22+
The :ref:`i3c_controller offload-interface` operation mode allows to execute
23+
a pre-programmed command stream when triggered by an external event, allowing for
24+
minimal latency.
25+
26+
27+
Sub-modules
28+
--------------------------------------------------------------------------------
29+
30+
* :ref:`i3c_controller host_interface`: Memory mapped software accessible
31+
interface to a I3C Controller command stream and/or offload cores.
32+
* :ref:`i3c_controller core`: Main module which executes a I3C Controller command
33+
stream and implements the I3C bus interface logic.
34+
35+
Interfaces
36+
--------------------------------------------------------------------------------
37+
38+
* :ref:`i3c_controller control-interface`: Command descriptors.
39+
* :ref:`i3c_controller offload-interface`: Command descriptors for cyclic operation,
40+
with SDI data generally consumed by a DMA.
41+
42+
Software
43+
--------------------------------------------------------------------------------
44+
45+
* :git-linux:`Linux Driver <i3c:drivers/i3c/master/adi-i3c-master.c>`:
46+
Linux driver for the I3C Controller.
47+
* :ref:`i3c_controller instruction-format`: Overview of the I3C Controller
48+
instruction format.

0 commit comments

Comments
 (0)