i3c_peripheral_programmers_model
i3c_peripheral_programmers_model
Revision history
Revision Date Description Author
1.04c 03/17/17 4/15/17 Spec should now be complete to match the Slave PK
6/29/17 use. Added some clarifications. Clarified some
more details on errors.
Added note on when EVENT status is signaled.
IBIOK and the like now IBIDIS.
Vendor ID and Time control freq/acc can be an
MMR now.
Added OFFLINE and DYNADDR optional use.
0.91d 11/21/16 Added DDRMATCH status and moved PK
CHANDLED and EVENT and EVDET.
Added TXFULL and RXEMPTY bits as well as
OWRITE error (over write). Clarify status raw bits
that are SDR only vs. HDR. S0/S1 handling.
0.9c 08/22/16 ERRWARN vs. error. CTRL bit to flush TB buff. PK
Now just WDATAB and WDATABE and
RDATAB. Removed END from DATACTRL.
Moved FLUSH to 0.
BAMATCH register field, FLUSHFB added.
Mistake in the offset of CONFIG in title.
0.8d 7/30/16 Added more status/interrupt causes. PK
Added CCC vs. CHANDLED. Fixed INTSTAT on
CHANDLED. Defined ID reg.
0.3 4/4/16 Updated with new regs and config info. PK
st
0.1 10/11/15 1 draft – requirements and arch PK
Contents
1. Introduction ............................................................................................................ 3
2. Master vs. Slave for I3C ........................................................................................ 3
2.1 Requirements for Master .........................................................................4
2.2 Requirements for Slave ...........................................................................4
2.3 I3C Slave acting as a normal I2C Slave on I3C buses ...........................4
2.4 Understanding Offline and Hot-Join for re-joining bus ............................4
3. Registers of Digital block...................................................................................... 5
3.1 CONFIG @ 0x004 – I3C Configuration register ......................................7
3.2 STATUS @ 0x008 – I3C Status register .................................................8
3.3 CTRL @ 0x00C – I3C Control register..................................................11
3.4 INTSET, INTCLR, INTMASKED @ 0x010, 0x014, 0x18 – Interrupt
enable control registers (if configured for Interrupts) ............................12
3.5 ERRWARN @ 0x01C – I3C Error and Waning register ........................14
3.6 DMACTRL @ 0x020 – DMA Control register (if configured for DMA)...15
3.7 DATACTRL @ 0x02C – Data control register (and FIFO if configured for
FIFO) .....................................................................................................16
3.8 WDATAB @ 0x030 – Write Byte Data (to-bus) register ........................17
3.9 WDATABE @ 0x034 – Write Byte Data as End (to-bus) register .........17
3.1 MWDATAH @ 0x038 – Write Half-word Data (to-bus) register ............18
3.2 MWDATAHE @ 0x03C – Write Half-word Data as End (to-bus)
register ..................................................................................................18
3.3 RDATAB @ 0x040 – Read Byte Data (from-bus) register ....................18
3.1 RDATAH @ 0x048 – Read Half-word Data (from-bus) register ............19
3.1 CAPABILITIES @ 0x060 – Dynamic Address register .........................19
3.2 DYNADDR @ 0x064 – Dynamic Address register ................................21
3.1 MAXLIMITS @ 0x068 – Maximum limits set by I3C Master (if configured
for Limits) ..............................................................................................21
3.1 PARTNO @ 0x06C – Register to allow Application to set I3C Part
number ID (if configured for Part-number from app) .............................21
3.1 IDEXT @ 0x070 – Register to allow Application to set I3C ID
components (if configured for ID parts from app)..................................22
3.1 VENDORID @ 0x074 – Register to allow Application to set I3C Vendor
ID (if configured for VID from app) ........................................................22
3.1 TCCLOCK @ 0x078 – Register to allow Application to indicate
Frequency and accuracy of time-control clock (if enabled) ...................22
3.1 ID @ 0xFFC – Optional BlockID ...........................................................23
NXP Semiconductors I3C
1. Introduction
MIPI I3C is a follow on to i2c which has major improvements in use and power, as well as providing an
alternative to SPI for mid-speed. In particular:
• 2 wire multi-drop bus capable of 12MHz clock speeds with up to 11 devices
o While using standard pads (vs. i2c special pads) with 4mA drive
o Slave addresses are dynamically assigned – does not require a static address
§ But, slaves may have a static address at start
o Slaves may use inbound clock as the peripheral clock
§ So devices may have slow/inaccurate clocks internally
o For read from Slave, Slave normally ends the read, but Master may terminate
§ Unlike i2c and SPI with the problems of Master having to “know” length
• In-Band interrupts, allowing Slaves to notify Master
o Can be both equivalent to a separate GPIO, but can also be directly data bearing
o Prioritized so that if multiple Slaves wish to interrupt at the same time, the order is resolved
§ Dynamic addresses used for this, so priority controlled by Master
o Interrupts can be started even when Master is not active on the bus, and yet no free running
clock needed
o Time-stamping option to allow resolution of initial event vs. when interrupt gets through
• Built-in Commands in separate “space” to not collide with normal Master->Slave messages
o Controls bus behavior, modes and states, low power state, enquiries, etc.
o Has additional room for new built-in commands to be used by other groups
• Organized forms of multi-master:
o Slave which can request Master to allow it to message another Slave, yet not needing to
generate its own clock – called Peer-to-Peer
o Secondary Masters which can use clean handoffs between each Master
• Hot-join onto bus allows devices to come on-line later than initial bus bringup
o May be due to late wake up (power up) or physical insertion
o Provides clean method for notification.
• Mixed i2c and i3c capable
o I3C has support for certain legacy i2c devices on the bus
o I3C Slave devices capable of operating on i2c buses
o Also support for bridging (to i2c, SPI, UART, etc.)
• High data rate modes also optionally available
o Only Master and the specific Slave has to support – other Slaves know how to ignore
o Has an HDR-DDR form which is about 2x the data rate of SDR (so about 20Mbps)
o Has an HDR-TSP (ternary symbols) which are up to 3x the data rate (so about 30Mbps)
• Slaves as small as <2K gates.
o Allowing for fully state machine driven as well as using processor
• Masters as small as 2.5K gates
o Relies on processor to handle
The I3C peripheral supports the full feature set, but uses parameterization to allow reduction of the logic to
what is needed.
3. If DA is retained in separate always-on memory, then the DYNADDR register as writable mechanism
may be used along with the CONFIG.OFFLINE bit.
The OFFLINE bit of the CONFIG register may be set when SLVENA is set to 1. This will cause the peripheral
to safely rejoin the bus. It does this by ensuring the I3C bus is not in HDR mode, using the same approach as
st
S0/S1 exit does: wait for 1 of HDR Exit Pattern, or 60µs of SCL and SDA unchanging.
Note that after using OFFLINE, the peripheral still cannot safely use IBI until it sees a STOP (which ensures
that the next START is safe to use for IBI).
st
If the App needs to do an IBI right away, it should wait for the 1 of STOP (see STATUS), or 200µs of SCL
and SDA being High. This can be done using the STATUS and INTSET controls. If the STATUS indicates the
bus is not busy and the peripheral will interrupt on START or STOP, then use of a timer to measure 200µs can
be used. If the timer goes off with no START or STOP, then it is safe to use IBI. If a START causes an
interrupt, the timer should be turned off and STOP waited for. If STOP causes an interrupt, it is safe to use IBI.
0x02C RW DATACTRL Allows control of data buffering FIFO Fields only if FIFO
and indicates current buffer state. enabled.
0x030 WO WDATAB Write a byte of data, including use Available unless external
th
of a 9 bit to mark as end (last FIFO
byte)
0x068 RO MAXLIMITS Indicates the limits set by the If enabled to track this.
Master (or the original requested
limits).
8 RW IDRAND If 1, PARTNO is a random value. If 0 (or Only if enabled for in the block
not configured for), PARTNO is a part along with PARTNO register.
number and instance.
9 RW OFFLINE If 1 when SLVENA set to 1, will wait for Only possible if CLK_SLOW is
either 60us of bus quiet or HDR Exit used, so only if IBI or MR or HJ.
Pattern; this ensures that bus is not in
HDR mode and so can safely track SDR.
23:16 RW BAMATCH Bus Available condition match value for Only if enabled for events such as
current “Slow clock”. This provides the IBI or MR or HJ, and if enabled to
count of the slow clock to count out 1us provide this as a register.
(or more) to allow an IBI to drive SDA
Width is limited to
Low when the Master is not doing so. CLK_SLOW_BITS
The max width, and so max value, is
controlled by the block.
31:25 RW SADDR If allowed by the block: Sets i2c 7 bit If enabled to use one and to be
Static address, else should be 0. provided by SW. Block may
provided in HW as well.
Activity status
1 RO STMSG Is 1 if this bus Slave is listening to the bus traffic or Will include
responding. If STNOSTOP=1, then this will be 0 when a unhandled
non-matching address seen until next repeated START or CCCs
STOP.
10 R/W1C STOP A STOP state was present on the bus since last cleared.
The STNOTSTOP state will also indicate if in stop.
Note: A fast STOP/START combination may not trigger this
status. START will always be set in that case. This bit is
from a stopped state being detected.
11 RO RX PEND Receiving a message from Master, which is not being See also
handled by block (not a CCC internally processed). FIFO status
For all but External FIFO, this uses DATACTRL RXTRIG, in
which defaults to not-empty. DATACRTL
If DMA is enabled for RX, DMA will be signaled as well. if FIFO is
Will self-clear if data is read (FIFO and non-FIFO). available
13 R/W1C DACHG The Slave Dynamic Address has been assigned, re-
assigned, or reset (lost) and is now in that state of being
valid or none.
16 R/W1C HDRMATCH An HDR command matched this device’s I3C Dynamic Only if HDR
st
Address. The Command will be available as the 1 byte is
and RXPEND will be set, whether read or write. The MSb supported.
of that command byte also indicates if a read or a write.
If a read, and there are to-bus bytes waiting, the command
will be ACKed and the data sent back, else it will be
NACKed.
Note that when this is set, the ERRWARN bit should be
checked, as the HPAR error may have be encountered
after signaling this (the parity is after the destination
address and CMD).
18 R/W1C EVENT Slave: Pending IBI, P2P, MR, or Hot-Join has been sent as Only if
requested. See upper status for details. configured
Note that for IBI, this occurs on the ACK if no IBI byte, and to support
after the 1 IBIDATA byte has been sent. So, if time control events.
is used, those will go out after this EVENT is signaled.
24 RO IBIDIS Is 1 if IBIs are disabled at this time. Note that CTRL Only if
requests will be held off while disabled. enabled for
block to
process.
25 RO MRDIS Is 1 if Master Requests are Disabled at this time. Note that Only if
CTRL requests will be held off while disabled. enabled for
block to
process.
1 1ms of latency
2 100ms of latency
3 10s of latency
1:0 RW EVENT If set to non-0, will request an event. Once requested, If block is
STATUS.EVENT and EVDET will show the status as it configured for
progresses. Once completed, the field will automatically one or more of
return to 0. Once non-0, only 0 can be written (to cancel) these.
until done. Time control is
separately
Value Meaning configured.
0 Normal mode. If set to 0 after was a non-0
value, will cancel if not already in flight.
15:8 RW IBIDATA Data byte to go with an IBI, if enabled for it. If enabled If block is
(was in BCR), then it is required. configured for
IBI data.
19:16 RW PENDINT Should be set to the pending interrupt that GETSTATUS Controlled with
CCC will return. This should be maintained by the the CCC
Application if used and configured, as the Master will read handling
this. parameter.
If not configured, the GETSTATUS field will return 1 if an
IBI is pending, and 0 otherwise.
31:24 RW VENDINFO Should be set to the Vendor Reserved field that Controlled with
GETSTATUS CCC will return. This should be maintained the CCC
by the Application if used and configured, as the Master handling
will read this. parameter.
If not configured, the GETSTATUS field will always return
a 0.
3.4 INTSET, INTCLR, INTMASKED @ 0x010, 0x014, 0x18 – Interrupt enable control
registers (if configured for Interrupts)
The Interrupt registers, if enabled in the block, allow masking interrupt sources as well as checking which have
activated. The normal method is to Enable an interrupt and then once it fires, it is either cleared by writing the
STATUS register or cleared by action on the corresponding data register. The Interrupt is level held, meaning
it stays set until the cause is cleared one way or the other. The block prevents races so that if a new event
comes in, it will not be lost.
The table below shows all 3 registers, with the Type indicating INTSET (R/W1S), INTCLR (WO), and
INTMASKED (RO, is STATUS&INTSET).
INTSET allows setting enables for interrupts (connecting the corresponding STATUS source to causing an
IRQ to the processor).
INTCLR allows clearing interrupt enables without read-modify-write problems.
INTMASKED allows checking status bits in terms of which are holding the IRQ, if any.
11 R/W1S, RX PEND Interrupt when Receiving a message from Master, FIFO and
W1C, which is not being handled by block (excludes CCCs DMA use
and RO being handled automatically). only if
If FIFO, then RX fullness trigger. configured
If DMA, then message end.
See also REQ in STATUS for context.
14 R/W1S, CCC For CCCs not handled by the block, RXPEND will For CCCs
W1C, also interrupt and the STATUS REQ field will that the
and RO indicate it is a CCC. block is
Note that the handling of broadcast vs. direct write not
vs. direct read are all subtly different. The direct enabled
read ones likely do not provide enough time to to
respond, but the i3c spec allows a single retry, process.
buying more time.
configured
features.
16 R/W1S, DDRMATCHED Interrupt when DDR matched for Read or Write Only if
W1C, command. HDR
and RO enabled
18 R/W1S, EVENT Slave: Interrupt when Pending IBI, P2P, MR, or Hot- Only if
W1C, Join has been sent as requested. See STATUS for configured
and RO details (EVDET). to support
events.
0 R/W1C ORUN The internal from-bus buffer/FIFO was overrun (too many chars coming in
and not drained by the app fast enough).
1 R/W1C URUN The internal to-bus buffer/FIFO was underrun during data read (app did
not provide the data fast enough). The END bit or register should be used
if that was the last one.
2 R/W1C URUNNACK The internal to-bus buffer/FIFO was underrun in the read header and so
the block NACKed the header.
3 R/W1C TERM The Master terminated a read from Slave when an END was not set (on
same or previous).
4 R/W1C INVSTART Invalid start with SCL falling while SDA=1 in STOP condition.
8 R/W1C SPAR SDR Parity error on message from Master. This will also set the
GETSTATUS Protocol Error sticky bit (cleared on GETSTATUS read).
For Read, this will be set if a Read Abort (timeout) occurs due to Master
not driving clock for >100µs during an I3C SDR Read.
9 R/W1C HPAR HDR Parity error or framing error on message from Master. Note that the
corresponding CMD or Data that had the error will normally be in the RX
buffer (read via RDATAB).
10 R/W1C HCRC HDR-DDR CRC error on message from Master. This calls into question
the data from the whole DDR command frame. Note that this includes an
HDR Restart or Exit being issued before an HDR-DDR message from
Master is complete.
11 R/W1C S0S1 S0 or S1 error has occurred and the Slave is locked waiting on an HDR
Exit Pattern. Writing 1 to this will cause it to release the lock, but that
should be used with great care. Normally, it will clear automatically when
an Exit Pattern is detected. So, writing 1 should only be used under
controlled circumstances to avoid problems. It will then wait for a START
(or repeated START) or STOP to operate normally.
16 R/W1C OREAD The RDATAB register was read for more bytes than were available by
app.
3.6 DMACTRL @ 0x020 – DMA Control register (if configured for DMA)
The DMA Control register allows for DMA to be used for inbound messages and outbound messages. This is
only available if configured for it.
DMA is limited in value for Slave use. This is because the Slave has to be reactive to what happens. The two
common use models:
1. From-bus collection to avoid being overrun. The CONFIG MATCHSS bit is set, and then the processor
enables the interrupts for START, and STOP, as well as enabling the DMA to collect the data. The
START or STOP interrupt will only occur after a message directed to the Slave (MATCHED bit set),
and the DMA copied data can then be examined.
2. To-bus for larger reads. Since I3C and I2C reads are preceded by a write which indicates what will be
read (or in response to an IBI from the Slave), the DMA can be used to push through the data.
Note that for I3C, the last value needs to be handled by the processor unless the DMA moves wider
words to be able to set the END bit (i.e. 16-bit values when byte mode or 32-bit values when in half-
word)
Note that for I2C, the last value is determined by the Master, so the DMA may end early or may run
out and the Master still wants more.
1:0 RW DMAFB DMA Read (From-bus) trigger. If enabled with 1 or 2, If configured for
will request DMA on RX trigger (see DATACTL). It DMA and not
will request until empty unless DMA setup as trigger. external FIFO.
Note: will cancel on ERRORWARN (since cannot be
as planned).
Value Meaning
Value Meaning
Value Meaning
0, 1 Byte
3 reserved
3.7 DATACTRL @ 0x02C – Data control register (and FIFO if configured for FIFO)
The Data control register simply assists in data control when no FIFO, and assists in FIFO when the FIFO is
available (regardless of size). This allows some control over the FIFO behavior. In particular, it allows control
of when to interrupt on fullness/emptiness and also controls behavior related to width, when not 1 byte wide.
5:4 RW TXTRIG Trigger level for TX emptiness If Internal FIFO enabled for to-bus, has
when FIFOed. Affects interrupt full meaning. If just 2 or 3 byte (ping
pong) buffer, then only 0 is special to
and DMA (if enabled). The defaults mean “empty”. That is, 0 will cause
is 3 TXNOTFULL to be true only if TX FIFO
is empty, so Half word write can be
Value Meaning used; 1, 2, and 3 will set TXNOTFULL
when not full.
0 Trigger on empty
7:6 RW RXTRIG Trigger level for RX fullness when If Internal FIFO available for from-bus,
FIFOed. Affects interrupt and DMA has full meaning. If just 2 or 3 byte (ping
(if enabled). pong) buffer, then only 3 is special to
mean at least 2 bytes in). That is, 3 will
Value Meaning set RXPEND only if 2 or 3 bytes are in
RX FIFO, so Half word read can be
0 Trigger on not empty
used; 0, 1, and 2 will set RXPEND if not
1 Trigger ¼ or more full empty.
20:16 RO TXCOUNT Count of bytes in TX Always Available, but has less meaning
if external FIFO is used (since this will
28:24 RO RXCOUNT Count of bytes in RX be only of local buffers).
30 RO TXFULL Is 1 if TX is full
A byte should not be written unless there is room, as indicated by the TXNOTFULL bit being set in the
STATUS register.
7:0 RO LSB 1st byte read from Master If not external FIFO and if configured for
nd
half-word data
15:8 RO MSB 2 byte read from Master
15:12 RO CCCHANDLE Indicates who handles CCCs between block and app:
• Bit 0 = 1: Block handles events, activities, status, HDR, and if
enabled for it, ID and static address related
• Bit 1 = 1: Block handles max read and write length as well as max
data speed.
• Bit 2 = 1: GETSTATUS CCC will return the CTRL register’s
PENDINT and ACTSTATE fields.
• Bit 3 = 1: GETSTATUS CCC will return the CTRL register’s
VENDINFO (vendor info) bits.
22 - - reserved
25:23 RO EXTFIFO Indicates External FIFOs is enabled. If not, check FIFOTX and FIFORX for
internal FIFO.
• 0 = no external FIFO.
• 1 = standard available/free external FIFO
• 2 = request track external FIFO
• 3= reserved
3.1 MAXLIMITS @ 0x068 – Maximum limits set by I3C Master (if configured for
Limits)
The Max limits may or may not be enabled in the HW, including max read and write length. If they are, the
current setting (including default request) shows up in this register.
11:0 RW MAXRD Maximum read length. Must be between 16 and saturation at 4095 (means is set
to that or higher).
App should not set higher than Master sets, only smaller.
Default: non-0 if set by parameters in HW config.
27:16 RW MAXWR Maximum write length. Must be between 8 and saturation at 4095 (means is set
to that or higher).
App should not set higher than Master sets, only smaller.
Default: non-0 if set by parameters in HW config.
3.1 PARTNO @ 0x06C – Register to allow Application to set I3C Part number ID (if
configured for Part-number from app)
The Part number is normally hard coded into the hardware, but if the application needs to set it, this allows
that. It is only available if configured for a register based part number. Note that part number includes instance
as well. The application must write a value into this field since 0 is not normally valid.
3.1 IDEXT @ 0x070 – Register to allow Application to set I3C ID components (if
configured for ID parts from app)
The ID extension fields of Instance (from Part number), DCR, and BCR are normally set in the HW. But. If
configured, the Application must set them instead.
3:0 RW INSTANCE Set the Instance of the ID if configured. Would not be used if PARTNO is
provided by the application.
15:8 RW DCR Set the DCR (device type) register if configured for it.
23:16 RW BCR Set the BCR (Bus capabilities) register if configured for it. This controls
features like Peer-to-peer or 2ndary master, Slow speed requirements, etc.
3.1 VENDORID @ 0x074 – Register to allow Application to set I3C Vendor ID (if
configured for VID from app)
The MIPI Vendor ID is normally hard coded into the hardware, but if the application needs to set it, this allows
that. It is only available if configured for a register based VID. The default will be set from the constant field
and so usually will be the chip vendor. If using the chip vendor ID, the PARTNO must then not collide with
other uses.
MIPI Vendor ID is available to all companies, MIPI member or not; it only takes a request via the mipi.org
website.
7:0 RW ACCURACY Clock accuracy in 1/10ths of %. So, If time control used and if Reg
1.5% is 15. form is selected.
Default: set by parameters if
configured.
15:8 RW FREQ Clock frequency in 0.5MHz steps (e.g. If time control used and if Reg
10MHz is 20). form is selected.
31:0 RO ID Meaning is specific to each use. Default: Parameter sets this value.