Programmer’s Guide

Buffer allocation

The I3C IP block uses a single shared SRAM, the ‘message buffer’, to implement all of the logical queues and data FIFOs within the design, including both the Controller and the Target sides.

The allocation of this buffer is entirely under software control, and should be determined by which queues and FIFOs are being used, along with their anticipated data rates. The configuration must be set before enabling either Controller or Target operation.

The hardware provides a default configuration so that the IP block is operable after coming out of reset, even if the configuration has not been modified. It should, however, be noted that this configuration is conservative and anticipates the heaviest use case with all supported Virtual Targets configured and used; if fewer Virtual Targets are activated, the configuration should be modified to achieve better use of the memory.

The default buffer allocation, with the queues and FIFOs arranged in ascending order of buffer offset (in DWORDs) is shown below:

DescriptionRegisterMin offset (incl).Max offset (incl).
Controller Tx DataCTRL_TXBUF_CONFIG0x000x7f
Controller Rx DataCTRL_RXBUF_CONFIG0x800xff
Command QueueCOMMAND_QUEUE_CONFIG0x1000x11f
Response QueueRESPONSE_QUEUE_CONFIG0x1200x12f
IBI Data QueueIBI_CONFIG0x1300x1af
IBI Status DescsIBI_STAT_CONFIG0x1b00x1cf
Target 0 Tx DataTARG_TXBUF_CONFIG_00x1d00x20f
Target 1 Tx DataTARG_TXBUF_CONFIG_10x2100x24f
Target 2 Tx DataTARG_TXBUF_CONFIG_20x2500x28f
Target 3 Tx DataTARG_TXBUF_CONFIG_30x2900x2cf
Target Rx DataTARG_RXBUF_CONFIG0x2d00x36f
Target IBI DataTARG_IBI_CONFIG0x3700x3af
Target 0 Tx DescsTARG_TXDESC_CONFIG_00x3b00x3b7
Target 1 Tx DescsTARG_TXDESC_CONFIG_10x3b80x3bf
Target 2 Tx DescsTARG_TXDESC_CONFIG_20x3c00x3c7
Target 3 Tx DescsTARG_TXDESC_CONFIG_30x3c80x3cf
Target Rx DescsTARG_RXDESC_CONFIG0x3d00x3df
Target IBI StatDTARG_IBIDESC_CONFIG0x3e00x3ef
Target ASync EventTARG_ASYNC_CONFIG0x3f00x3ff

Each of the queues/FIFOs has a configuration register that specifies the minimum and maximum offsets, in DWORDs, within the message buffer. Both offsets are inclusive and it is the responsibility of the software to ensure overlaps do not occur because otherwise undefined behavior will result.

Timer Intervals

The IP block contains a number of timers for measuring the duration of I3C bus states, such as the ‘Bus Available’ and ‘Bus Idle’ conditions. The longest of these time intervals is the 50 ms ‘Dead Bus Recovery’ interval, whilst the shortest interval is the ‘Bus Available’ condition at just 1 microsecond.

In order to support this wide variation in time intervals across the large range of supported IP clock frequencies, the timer granularity (in IP clock cycles) varies on a per-timer basis as illustrated by the following tables, at the extremes of the supported clock frequency range.

Minimum supported clock frequency, 50 MHz:

TimerDefault IntervalWidth (bits)Shift amountUnit at 50 MHzMax interval
Command Retrying800 uss.785.1 us1.5 ms
Targ Bus Idle200 uss.761.3 us360 us
TE0 Recovery60 uss.74320 ns100 us
Targ Reset5 uss.7020 ns7.5 us
Targ Bus Avail1 uss.7020 ns3.5 us
Read stalled150 uss.761.3 us310 us
Ctrl Bus Avail1 uss.7020 ns3.5 us
Dead Bus Recov50 mss.714330 us92 ms

Maximum supported clock frequency, 1.5 GHz

TimerDefault IntervalWidth (bits)Shift amountUnit at 1.5 GHzMax interval
Command Retrying800 uss.7135.5 us1.7 ms
Targ Bus Idle200 uss.7111.4 us370 us
TE0 Recovery60 uss.79340 ns100 us
Targ Reset5 uss.7521 ns7.7 us
Targ Bus Avail1 uss.7521 ns3.7 us
Read stalled150 uss.7111.4 us320 us
Ctrl Bus Avail1 uss.7521 ns3.7 us
Dead Bus Recov50 mss.719350 us94 ms

All times are quoted to two significant figures. It may be seen from the above tables how the shift amount achieves almost exactly the same granularity of timer adjustment despite the large disparity in IP clock frequency.

The timers are independent of each other and share no logic or synchronization beyond the fact that they are all updated by the single IP clock signal.

If the hardware-calculated default interval is found to be inadequate, e.g. in the event of oscillator frequency inaccuracy, an adjustment may be made by software using the appropriate field of INTERVAL_TIME0 or INTERVAL_TIME1 as illustrated below. The adjustment values are reset to 0, meaning that the unmodified default interval is used.

Time intervals are specified as two’s complement 8-bit signed offsets added to the default values calculated by the hardware:

  • interval_clks = (hw_default_us * clks_per_us) + (signed_adj << shift)

The shift values, as illustrated in the tables above, are adjusted according to log2(clks_per_us) with the result that the adjustment has about the same time range, irrespective of the IP clock frequency.

Clock frequencies:

  • 50 MHz to 64 MHz, both inclusive: base weighting applies and the shift value are as shown in the 50 MHz table above.
  • From 64 MHz (exclusive) to 128 MHz (inclusive): adjustments have twice the base weighting; shifts are increased by 1.
  • From 128 MHz (excl.) to 256 MHz (incl.): adjustments have 4 times the base weighting; shifts are increased by 2…
  • From 256 MHz (excl.) to 512 MHz (incl.): adjustments have 8 times the base weighting.
  • From 512 MHz (excl.) to 1024 MHz (incl.): adjustments have 16 times the base weighting.
  • From 1024 MHz (excl.) to 1500 MHz (incl.): adjustments have 32 times the base weighting; shifts are increased by 5.

Target Reset Detector pads

The Target Reset Detector observes SCL and SDA through its own inputs, rstdet_scl and rstdet_sda (see the Integration Notes). Where these inputs are connected through a pin multiplexer, software must route them to the same pads as scl and sda before the detector is activated.

IBI Payload Fetching

A number of I3C Targets are too slow to be able to return data for Private Read transfers at the full SDR0/HDR-DDR signaling speed.

When the Host Controller is issuing a Private Read transfer, the signaling mode/rate is specified in a Command Descriptor, but when fetching the payload data for an In-Band Interrupt, there is no Command Descriptor available so the hardware cannot determine the required signaling speed.

The HCI Specification does, however, allow the specification of a signaling mode for ‘Auto-Command’ reads (HCI Table 130, AUTOCMD_MODE field), so this IP block also uses the value in that field when fetching the IBI payload data. If that field has been set to HDR-DDR for Auto-Command operation, the IBI Payload of the device will be fetched with SDR0 signaling, since IBIs are not supported in HDR modes.

If a Target is known, through retrieval of its maxRd value (4.3.7.3.18), to be too slow to support SDR0 signaling, the AUTOCMD_MODE of its DAT entry should be set to a lower signaling speed before the collection of In-Band Interrupt payloads from that Target is enabled.