a deep dive into mipi debug for i3csm

37
1 | © 2021 MIPI Alliance, Inc. A Deep Dive into MIPI Debug for I3C SM

Upload: others

Post on 29-Nov-2021

4 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: A Deep Dive into MIPI Debug for I3CSM

1 | © 2021 MIPI Alliance, Inc.

A Deep Dive intoMIPI Debug for I3CSM

Page 2: A Deep Dive into MIPI Debug for I3CSM

2 | © 2021 MIPI Alliance, Inc.

Webinar Agenda

• Overview of MIPI Debug for I3C• Network Adaptors• Debug Common Command Codes (CCCs)• Session Management and Debug Resets• I3C In-Band Interrupts for Debug Events• Debug Ecosystem• Conclusions

Page 3: A Deep Dive into MIPI Debug for I3CSM

3 | © 2020 MIPI Alliance, Inc.

A Deep Dive intoMIPI Debug for I3CSM

Matthew SchnoorIntel Corporation

MIPI Debug Working Group

Page 4: A Deep Dive into MIPI Debug for I3CSM

4 | © 2021 MIPI Alliance, Inc.

DTS

Application Processor

DTS

Modem PMIC

I3C TargetI3C Ctrl & Target

Network Interface

I3C Ctrl & Target Software DTS

Switch/Mux

For USBType-C

US

B Ty

pe-C

R

ecep

tacl

e

I3C Host Controller

SBU Pins

About MIPI Debug for I3C

Enables new debug interface standard, where existing interface solutions (e.g., JTAG/cJTAG, I2C, UART) are falling short

• Enables debug of multiple components on the board

• Debug and test system (DTS) can attach to external pins, yet still use the application processor and modem as DTS

• Must work if application processor is powered down (e.g., low power state)

Page 5: A Deep Dive into MIPI Debug for I3CSM

5 | © 2021 MIPI Alliance, Inc.

MIPI Debug for I3C Key Features

• Uses core capabilities of MIPI I3C® or MIPI I3C BasicSM

• Allows dedicated or shared bus topologies

• Handles debug communication over defined byte-oriented streaming interface ports that can support different protocols

• Allows the target system (TS) to expose multiple debug interfaces/ports (referred to as Network Adaptors) from a single physical connection

• Allows the debug and test system (DTS) to send broadcast or directed action requests (e.g., halt, reset)

• Allow the TS to send event indications via IBIs (e.g., triggers, requests)

Page 6: A Deep Dive into MIPI Debug for I3CSM

6 | © 2021 MIPI Alliance, Inc.

I3C Network Layer (i.e., I3C Target)

DBGOPCODE CCC

Inbound Data Flow Control

Outbound Data Flow Control

IBI

GlobalIBI Logic

I3C Bus

I3C Read Transfer

Debug Function

Inbo

und

FIFO

Out

boun

d FI

FO

DBGACTION CCC

Debug Actions

I3C Write Transfer

Network Adapter Configuration, Control, and Status

Version

Status

Session Management State Machine

Enable

FIFO Action

FIFO Threshold

Configuration

I3C Transport Layer

Network Adaptor

Inbo

und

Pipe

Out

boun

d Pi

pe

Conceptual System DiagramMIPI Debug WG Functional Layering Diagram

Debug for I3C Functional Diagram

I3C Link Layer

I3C Link Layer

I3C Transport & Network

Layer

I3C Transport & Network

Layer

DTS TS

DebugApplications

DebugApplicationsApplication(s)

DebugApplications

DebugApplicationsSources

InfrastructureInfrastructureInfrastructure

NetworkAdaptor NetworkAdaptor NetworkAdaptor

Driver nDriver nDriver

NetworkAdaptorNetworkAdaptorNetworkAdaptor

Debug for I3CSpecifications

Page 7: A Deep Dive into MIPI Debug for I3CSM

7 | © 2021 MIPI Alliance, Inc.

I3C Network Layer (i.e., I3C Target)

DBGOPCODE CCC

Inbound Data Flow Control

Outbound Data Flow Control

IBI

GlobalIBI Logic

I3C Bus

I3C Read Transfer

Debug Function

Inbo

und

FIFO

Out

boun

d FI

FO

DBGACTION CCC

Debug Actions

I3C Write Transfer

Network Adapter Configuration, Control, and Status

Version

Status

Session Management State Machine

Enable

FIFO Action

FIFO Threshold

Configuration

I3C Transport Layer

Network Adaptor

Inbo

und

Pipe

Out

boun

d Pi

pe

Conceptual Target System Diagrame.g., Internal TAP network,

Debug Registers, Trace Infrastructure

Debug “Extensions”

Debug-specific Transport Layer Logic

(i.e., beyond base I3C)

Specific to the debug function(s) on the given

SoC. TS may have several Network Adaptors

Common Logic per Network Adaptor “Extensions”

Defined by the Debug for I3C specification

Page 8: A Deep Dive into MIPI Debug for I3CSM

8 | © 2021 MIPI Alliance, Inc.

Network Adaptor

• A mechanism used for communicating with debug functions within the TS

• Contains either an Inbound data pipe, an Outbound data pipe, or both – Accessed via I3C Private Write and Private Read transfers

• Mapped to a single instance of a debug function with a particular protocol – Maximum 16 instances– Each Network Adaptor does not have to use a unique protocol

Page 9: A Deep Dive into MIPI Debug for I3CSM

9 | © 2021 MIPI Alliance, Inc.

Supported Network Adaptor ProtocolsProtocol Direction Details

SneakPeek Protocol (SPP)

Inbound & Outbound

Used for debug communication to a SneakPeek Command Engine. Bi-directional transfer of blocks of bytes (SPTBs) formatted to TinySPP

Trace Wrapper Protocol (TWP)

Outbound Used for trace data output from trace infrastructure. Uni-directional transfer of a stream of bytes formatted to TWP

System Trace Protocol (STP)

Outbound Used for trace data output from a System Trace Macrocell. Uni-directional transfer of a stream of bytes formatted to STP

Simplified Address-Mapped Protocol (SAM)

Inbound & Outbound

Used for communication with simple address-mapped access to TS resources

UART Inbound & Outbound

Used for communication with character-oriented software agents such as scanf()/printf(),or a GDB monitor. Bi-directional transfer of bytes

Implementation-Defined

Inbound & Outbound

Implementation-defined function not described in this specification

Page 10: A Deep Dive into MIPI Debug for I3CSM

10 | © 2021 MIPI Alliance, Inc.

Example Implementation of Network Adaptors

I3C Bus

Debug Actions

SneakPeekNetwork Adaptor

Index 0

STPNetwork Adaptor

Index 2

TWPNetwork Adaptor

Index 5

UARTNetwork Adaptor

Index 14

SneakPeek Engine STM TWP Formatter scanf()

printf()

Trace Source

Trace SourceSyS-T Software

SAMNetwork Adaptor

Index 4

SAM Debug Engine

Debug-Specific HandlingI3C Network & Transport Layer (i.e., I3C Target)

Page 11: A Deep Dive into MIPI Debug for I3CSM

11 | © 2021 MIPI Alliance, Inc.

Network Adaptor Details: SPP

Protocol Direction Details

SneakPeek Protocol (SPP)

Inbound & Outbound

Used for debug communication to a SneakPeekCommand Engine. Bi-directional transfer of blocks of bytes (SPTBs) formatted to TinySPP

SPP provides a richer address-mapped mechanism for read+writetransactions, to replace dedicated interfaces (such as JTAG).

Each SneakPeek Transfer Block (SPTB) is a single I3C Private Write or Private Read transfer.

Reference: https://www.mipi.org/specifications/spp

Page 12: A Deep Dive into MIPI Debug for I3CSM

12 | © 2021 MIPI Alliance, Inc.

CP #1 CP #2 CP #3

SPTB #1 (with Command Packets)

SPP Payload from DTS to TS

S/Sr Sr/PACKTS Dynamic Address / RnW=0

Network Adaptor Details: SPP

SPP write: SPTB(Command Packets)DTS à TS

Page 13: A Deep Dive into MIPI Debug for I3CSM

13 | © 2021 MIPI Alliance, Inc.

RP #1 RP #2 RP #3

SPTB #1 with Response Packets

SPP Payload from TS to DTS

S/Sr Sr/PACKTS Dynamic Address / RnW=1

Network Adaptor Details: SPP

SPP read: SPTB(Response Packets)DTS ß TS

Page 14: A Deep Dive into MIPI Debug for I3CSM

14 | © 2021 MIPI Alliance, Inc.

Network Adaptor Details: TWP

Protocol Direction Details

Trace Wrapper Protocol (TWP)

Outbound Used for trace data output from trace infrastructure. Uni-directional transfer of a stream of bytes formatted to TWP

TWP enables trace data output from multiple trace sources.

TWP Frames can be spread across one or more I3C Private Read transfers.

Reference: https://www.mipi.org/specifications/twp

Page 15: A Deep Dive into MIPI Debug for I3CSM

15 | © 2021 MIPI Alliance, Inc.

S/Sr TS Dynamic Address / RnW=1 ACK

n+2

n+1n Sr/P

TWP Frame n

TWP Frame n + 1

TWP Frame n + 2

TWP Frame Synchronization

S/Sr TS Dynamic Address / RnW=1 ACK Sr/P

TWP Frame n + 3

n+3

Network Adaptor Details: TWP

TWP read Frame(s):DTS ß TS

Page 16: A Deep Dive into MIPI Debug for I3CSM

16 | © 2021 MIPI Alliance, Inc.

Network Adaptor Details: STP

Protocol Direction Details

System Trace Protocol (STP)

Outbound Used for trace data output from a System Trace Macrocell. Uni-directional transfer of a stream of bytes formatted to STP

STP enables trace data output from application-specific trace protocols

STP Packets can be spread across one or more I3C Private Read transfers

Reference: https://www.mipi.org/specifications/stp

Page 17: A Deep Dive into MIPI Debug for I3CSM

17 | © 2021 MIPI Alliance, Inc.

S/Sr TS Dynamic Address / RnW=1 ACK

n+3

n+1n Sr/P

STP Packet n

STP Packet n + 1

STP Packet n + 3

STP Packet n + 2 (Synchronization)

S/Sr TS Dynamic Address / RnW=1 ACK Sr/Pn + 2

STP Packet n + 4

n+4

S/Sr TS Dynamic Address / RnW=1 ACK Sr/Pn+4

n + 2

Network Adaptor Details: STP

STP read Packet(s):DTS ß TS

Page 18: A Deep Dive into MIPI Debug for I3CSM

18 | © 2021 MIPI Alliance, Inc.

Network Adaptor Details: SAMProtocol Direction Details

Simplified Address-Mapped Protocol

(SAM)

Inbound & Outbound

Used for communication with simple address-mapped access to TS resources

SAM provides a simple address-mapped mechanism for read+writetransactions, intended for register or memory access.

SAM commands can be GET, SET, READ or WRITE.

• SET + WRITE commands use one I3C Private Write.

• GET + READ commands use “Write-then-Read” semantics: one I3C Private Write followed by one I3C Private Read.

Page 19: A Deep Dive into MIPI Debug for I3CSM

19 | © 2021 MIPI Alliance, Inc.

Command Byte Parameter Byte(s) Optional Data Byte(s)

SAM Payload from DTS to TS

S/Sr Sr/PACKTS Dynamic Address / RnW=0

SET or WRITE Commands

Network Adaptor Details: SAM

SAM SET or WRITE command example:DTS à TS

Page 20: A Deep Dive into MIPI Debug for I3CSM

20 | © 2021 MIPI Alliance, Inc.

Command Byte Parameter Byte(s)

SAM Payload from DTS to TS

S/Sr Sr/PACKTS Dynamic Address / RnW=0

Data Byte(s)

SAM Payload from TS to DTS

S/Sr Sr/PACKTS Dynamic Address / RnW=1

GET or READ Commands

Network Adaptor Details: SAM

SAM GET or READ command example:DTS ß TS

Writethen

Read

Page 21: A Deep Dive into MIPI Debug for I3CSM

21 | © 2021 MIPI Alliance, Inc.

Debug Common Command Codes (CCC)

Defined CCCs specifically for use by the debug logic:

• DBGOPCODE – Direct CCC (0xD7) – Request a particular operation of a given Network Adaptor that is part of the TS.– Can be Write only, or Write-then-Read, or both (per opcode)

• DBGACTION – Direct (0xD8) or Broadcast (0x58)– Initiate one or more particular debug actions on a single TS (Direct) or all TS

instances (Broadcast) on the I3C bus

Page 22: A Deep Dive into MIPI Debug for I3CSM

22 | © 2021 MIPI Alliance, Inc.

Debug Common Command Codes (CCC)

• DBGOPCODE – Direct CCC (0xD7) opcodes:Opcode Format Purpose

CAPABILITIES Read only(Write-then-Read)

Read Debug for I3C version and capabilities

CFG Write / Read Configure polling vs. interrupts

START_NA Write / Read Network Adaptor start session (and status)

STOP_NA Write / Read Network Adaptor stop session (and status)

FIFO_THRESHOLD Write / Read Network Adaptor FIFO threshold settings

FIFO_ACTION Write / Read Network Adaptor FIFO other actions

SELECT Write only Select Network Adaptor

REPORT_ERROR Write only Inform Network Adaptor of received error

Page 23: A Deep Dive into MIPI Debug for I3CSM

23 | © 2021 MIPI Alliance, Inc.

Debug Common Command Codes (CCC)

• DBGACTION – Direct (0xD8) or Broadcast (0x58)– Build a set of actions, in continuous CCC framing

Value Name Purpose

0x00 DBGRST Debug Reset

0x01 STARTSET Start a set of actions

0x02 EXECSET Execute the set of actions

0x03 – 0x7F Reserved -

0x80 – 0xFF IMPDEF Implementation defined

Page 24: A Deep Dive into MIPI Debug for I3CSM

24 | © 2021 MIPI Alliance, Inc.

I3C Network Layer (i.e., I3C Target)

DBGOPCODE CCC

Inbound Data Flow Control

Outbound Data Flow Control

IBI

GlobalIBI Logic

I3C Bus

I3C Read Transfer

Debug FunctionIn

boun

d FI

FO

Out

boun

d FI

FODBGACTION

CCC

Debug Actions

I3C Write Transfer

Network Adapter Configuration, Control, and Status

Version

Status

Session Management State Machine

Enable

FIFO Action

FIFO Threshold

Configuration

I3C Transport Layer

Network Adaptor

Inbo

und

Pipe

Out

boun

d Pi

pe

Network Adaptor Session Management

Concept of Session Management• Each Network Adaptor is managed by

its internal state machine• DTS can start/stop transactions by

using DBGOPCODE CCC

• Specific meanings of TS state transitions will depend on the Network Adaptor type.

Page 25: A Deep Dive into MIPI Debug for I3CSM

25 | © 2021 MIPI Alliance, Inc.

Debug Resets

• How to reset Debug logic in TS?

– DBGACTION CCC with ‘DBGRST’ value 0x00

or

– RSTACT CCC (w/ Defining Byte 0x03) followed by I3C Target Reset Pattern

Page 26: A Deep Dive into MIPI Debug for I3CSM

26 | © 2021 MIPI Alliance, Inc.

I3C Transport & Network Layer

DebugApplications

DebugApplicationsOther SoC Logic

Debug Function

NetworkAdaptor(s)

NetworkAdaptor(s)NetworkAdaptor(s)

Deb

ug R

eset

I3C

Per

iphe

ral

Who

le T

aget

Internal Memory (e.g., Dynamic Address)

I3C Link Layer

Mechanism:• DBGACTION CCC DBGRST

Action (I3C v1.0 or later)• Target Reset with RSTACT

Defining Byte of 0x03 (I3C v1.1 or later)

Mechanism:• Target Reset of I3C

Peripheral (I3C v1.1 or later)

Mechanism:• Target Reset of

Whole Chip (I3C v1.1 or later)

Debug Resets and Layers

Page 27: A Deep Dive into MIPI Debug for I3CSM

27 | © 2021 MIPI Alliance, Inc.

Debug In-Band Interrupts

Defined three mandatory data byte (MDB) identifiers specifically for debug events: • DBGSTATUS – (MDB = 0x5C) Used to indicate a change in status

– e.g., FIFO threshold met, session stopped, processor halted

• DBGERROR – (MDB = 0x5D) Used to indicate an error condition– e.g., I3C transport layer error or an error in the Network Adaptor

• DBGDATAREADY – (MDB = 0xAD) Used to indicate data is ready in a given outbound FIFO– A specific Pending Read Notification for debug data

Page 28: A Deep Dive into MIPI Debug for I3CSM

28 | © 2021 MIPI Alliance, Inc.

Additional Data[0..N](Optional)

/ T

Error Code

/ T

Debug IBI DBGERROR

Cause/ T=1ha

ndof

f

S

Target (TS) Address

/ R (i.e. IBI from TS)

/ ACK (ActvCtrl)Sr

P

7’h7E/ W / ACK

P

Target Addr/ RnW / ACK

CCC ...

End of this IBI readback

5'b11101

0x5D

3'b010

Additional Data[0..N](Optional)

/ T

Network Adaptor Index

and Sub-Cause

/ T

Debug IBI DBGSTATUS

Cause / T=1ha

ndof

fS

Target (TS) Address

/ R (i.e. IBI from TS)

/ ACK (ActvCtrl)Sr

P

7’h7E/ W / ACK

P

Target Addr/ RnW / ACK

CCC ...

End of this IBI readback

5'b11100

0x5C

3'b010

Debug In-Band Interrupts (example)

Page 29: A Deep Dive into MIPI Debug for I3CSM

29 | © 2021 MIPI Alliance, Inc.

Read Data Byte [1]

/ T

Read Data Byte [2]

/ T...

Read Data Byte [0]

/ T Next ...

P

Srhand

off

Network Adaptor

Index/ T=0

Debug IBI DBGDATAREADY

Cause/ T=1ha

ndof

f

S

Target (TS) Address

/ R (i.e. IBI from TS)

/ ACK (ActvCtrl)

P

P

Target Addr/ R / ACK

End of this IBI readback

5'b01101

0xAD

3'b101Pending Read Notification

Recommended… (SDR example shown)

Sr

End of Pending Read, contract fulfilled

Debug In-Band Interrupts (example)

Data sent with I3C Pending Read Notification contract, initiated by

I3C Controller after IBI

Page 30: A Deep Dive into MIPI Debug for I3CSM

30 | © 2021 MIPI Alliance, Inc.

Debug Ecosystem Components

• I3C Target interface extensions– Implementing support for Debug CCCs, IBIs and connection to debug

functions via Network Adaptors

• I3C Controller interface to DTS Host– MIPI I3C HCISM available for a standard Host Controller– USB-IF Device Class standard is in development…

• Debug connectors that include I3C serial pins– Not yet defined, stay tuned…

Page 31: A Deep Dive into MIPI Debug for I3CSM

31 | © 2021 MIPI Alliance, Inc.

Conclusions

• MIPI I3C® provides a scalable, multi-mastering debug interfacethat can connect power-managed components on a platform.– It meets newer requirements/use cases that legacy interfaces (e.g.,

JTAG/cJTAG, I2C, UART) do not.

• The MIPI Debug for I3C specification extends the I3C bus interface for debug:– Builds on the core I3C capabilities, including two wires, hot-join, IBI, multi-

drop, broadcast messaging and multi-mastering– Adds debug/test-specific CCCs and standardizes the data exchange

mechanisms

Page 32: A Deep Dive into MIPI Debug for I3CSM

32 | © 2021 MIPI Alliance, Inc.

For more information…• MIPI Alliance website:

http://mipi.org• MIPI Debug WG page:

https://www.mipi.org/specifications/debug• MIPI Architecture Overview for Debug whitepaper:

https://www.mipi.org/sites/default/files/mipi_Architecture-Overview-for-Debug_v1-2.pdf

• MIPI I3C page: https://mipi.org/specifications/i3c-sensor-specification

• MIPI Debug for I3C page: https://mipi.org/specifications/debug-i3c

Page 33: A Deep Dive into MIPI Debug for I3CSM

33 | © 2020 MIPI Alliance, Inc.

Questions and Answers

Page 34: A Deep Dive into MIPI Debug for I3CSM

34 | © 2020 MIPI Alliance, Inc.

Thank you!

Page 35: A Deep Dive into MIPI Debug for I3CSM

35 | © 2020 MIPI Alliance, Inc.

Backup Slides

Page 36: A Deep Dive into MIPI Debug for I3CSM

36 | © 2021 MIPI Alliance, Inc.

Network Adaptors: Key Differences

Capability SneakPeak(TinySPP)

SAM UART

Separate debug functions per Adaptor Up to 8 Up to 16 1

Function discovery and identifiers Yes Yes No

Function handling Multiple methods Address/Data only N/A

Addressable space 64-bit 32-bit N/A

Commands provided Rd, Wr, Wr+Rd, Loops, Triggers

Rd, Wr N/A

Largest transfer size (bytes) 2^7 - 1 2^16 - 1 N/A

Address pointers (per function) Yes Optional N/A

Many more advanced capabilities Yes No No

Page 37: A Deep Dive into MIPI Debug for I3CSM

37 | © 2021 MIPI Alliance, Inc.

Debug Ecosystem

• DTS connections via USB– Developing new USB-IF Device Class for I3C Controller– Work is in progress…

USB-to-I3C Adapter

Application Processor

Modem PMIC

I3C TargetI3C Ctrl & Target

I3C Ctrl & Target Software DTS

Switch/Mux

For USBType-C

US

B Ty

pe-C

R

ecep

tacl

e

SBU Pins