SPRUIV7B May 2022 – September 2023 AM620-Q1 , AM623 , AM625 , AM625-Q1 , AM625SIP
This section describes the teardown procedure for generic block copy channels within the BCDMA. A channel teardown is initiated by the host by writing the teardown bit in the Channel N Real-time Control Register (<BCHANRT[a]_TRT_CTL> [30] TX_TEARDOWN). When the host initiates teardown, it can choose to perform either a graceful (no data loss) or forced teardown of the channel depending on the setting of the forced_teardown bit in the Channel N Real-time Control Register (<BCHANRT[a]_TRT_CTL> [28] TX_FORCED_TEARDOWN).
If the forced_teardown bit is clear, a normal teardown has been initiated. In this case, the BCDMA will do the following:
Stops performing any additional fetches for the channel.
Completes any packets normally for which a pointer/descriptor/data fetch has already been performed
Sets the tdown bit on the EOP data phase of the last packet to be sent (if any traffic was pending when teardown was initiated) or sends a zero byte packet with the tdown, sop, and eop bits asserted. This signals the destination thread that all of the data has been sent.
Clears the channel enable in the Channel N Global Configuration Register (<BCHANRT[a]_TRT_CTL> [31] TX_ENABLE).
Resets the channel state (including scoreboards, FIFOs, counters, statistics, etc.) to their after reset values.
Sets bit 31 of the BC Flow Reverse Ring Occupancy register to indicate that a teardown has completed.
If the current BC reverse ring occupancy is 0, issues an BC reverse ring completion up event which is then routed to an IA and can be further routed to any event consumer.
If the current BC Reverse ring occupancy is not 0 then a write to the doorbell with a negative value of the current occupancy will clear any remaining work but the forward ring pointer will remain the same. If the ring pointer needs to be reset then perform a write to any of the ring configuration registers.
If the forced_teardown bit is set, a destructive teardown has been initiated. In this case, the BCDMA will do the following:
Suspends any triggers to allow the channel to operate even if the trigger source is no longer functioning.
Completes any packets which have been fetched with or without transferring any data or generating events (the implementation has the option of doing whichever is simplest for that implementation).
Clears the channel enable in the Channel Global Configuration Register.
Resets the channel state (including scoreboards, FIFOs, counters, statistics, etc.) to their after reset values.
Sets bit 31 of the BC Flow Reverse Ring Occupancy register (<RINGRT[a]_RT_ROCC> [31] TDOWN_COMPLETE) to indicate that a teardown has completed.
If the current BC reverse ring occupancy is 0, issues an BC reverse ring completion up event which is then routed to an IA and can be further routed to any event consumer.
The host may issue a teardown on any channel at any time, regardless of whether the channel is actively transferring data or not.
The Host determines that a teardown using either of the following methods:
Periodically polling the teardown and enable bits for the channel
Waiting for an interrupt and observing the teardown complete bit is set in the channel’s default flow (first flow in channel) reverse occupancy register (<RINGRT[a]_RT_ROCC> [31] TDOWN_COMPLETE) for the channel.
Note that the teardown message will actually be written to the next available location in the ring following the last completed packet.