|
| 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. |
0 commit comments