Sundance Technology

ST201

PRELIMINARY draft 2

8.Verify EepromBusy is false.

9.Issue WriteRegister command (opcode = 01 aaaa aaaa)

Step 4 through 8 may be skipped for certain types of EEPROM devices.

ADAPTER TXDMA SEQUENCE

Beginning with the host system writing to the TxD- MAListPtr register (when starting from an empty TxDMAList, for instance), the ST201 performs the following procedure during transfers of TxDMA frames.

1.Verifies the TxDMAListPtr is non-zero.

2.Verifies not in the TxDMAHalt state.

3.Fetches the second dword from the TFD pointed to by TxDMAListPtr and writes this value into the TxFIFO.

4.One by one, fetches the TxDMAFragAddr/TxD- MAFragLen entries from the TFD, and moves the associated data fragments to the TxFIFO.

5.Sets the TxDMAComplete bit in the TFD.

6.If TxDMAHalt is in effect, waits until a TxD- MAResume is issued.

7.If a transmit under run has occurred, waits until the host system sets the TxReset bit.

8.Re-fetches the TFC and, if the TxDMAIndicate bit is set, sets TxDMAComplete (which may in turn cause an interrupt if the IntEnable masks are set appropriately)

9.Fetches the TxDMANextPtr from the current TFD. If TxDMANextPtr is zero, the TxDMA Logic becomes idle. If polling is disabled (TxD- MAPollPeriod is zero), the TxDMA Logic waits for a non-zero value to be written to TxDMAL- istPtr. If polling is enabled (TxDMAPollPeriod is non-zero), the old value in TxDMAListPtr is preserved, and the ST201 polls on TxDMAN- extPtr in the TFD until it fetches a non-zero value from it. If the value fetched from TxD- MANextPtr is non-zero, then the value is loaded into TxDMAListPtr, advancing the ST201 to the new TFD.

10.With a new TFD to process, the ST201 returns to step 2.

ADDING TFD’S TO THE END OF THE TXDMALIST

The following sequence describes the process for adding TFD’s to the end of the TxDMAList when TxDMA polling is disabled (TxDMAPollPeriod is zero).

1.Set the TxDMAHalt bit.

2.Wait for the TxDMAHalt to complete by polling on TxDMAHalted bit.

3.Update TxDMANextPtr in the last TFD in the

TxDMAList with the address of the TFD being added.

4.Read TxDMAListPtr.

5.If TxDMAListPtr is zero, write the address of the new TFD to TxDMAListPtr.

6.Resume the TxDMA Logic by setting TxD- MAResume bit. The TxDMA Logic will become idle when it fetches a zero TxDMANextPtr value from a TFD. One way to restart the TxDMA process is by writing a non-zero value to TxDMAListPtr.

When polling is enabled (TxDMAPollPeriod is non- zero), TFD’s can be added to the end of the TxD- MAList with no register accesses by writing the address of the new TFD in the last TFD’s TxD- MANextPtr field.

INSERTING A TFD AT THE HEAD OF THE TXDMALIST

TFD’s cannot be added before the active TFD in the TxDMAList, they can only be added after the active (unfinished) TFD. The following sequence describes the process for adding TFD’s to the head of the TxDMAList when TxDMA polling is disabled (TxDMAPollPeriod is zero).

1.Set TxDMAHalt bit.

2.Wait for the TxDMAHalt to complete by polling the TxDMAHalted bit. When halted, the TxD- MAListPtr register will hold the address of the TFD which just completed transfer into the ST201 (the “last TFD in the TxDMAList”).

3.Find the last TFD in the TxDMAList, corre- sponding to the TFD at the address held in the TxDMAListPtr register. This will also be the last TFD in the TxDMAList with the TxDMACom- plete bit set.

4.Copy the value in the “last TFD’s”TxDMANex- tPtr into the TxDMANextPtr field of the TFD to be inserted.

5.Update TxDMANextPtr field in the “last TFD” with the address of the inserted TFD.

6.Read TxDMAListPtr.

7.If TxDMAListPtr is zero, write the address of the inserted TFD to TxDMAListPtr.

8.Resume the TxDMA Logic by setting TxD- MAResume.

When polling is enabled (TxDMAPollPeriod is non- zero), TFD’s can be inserted to the head of the TxDMAList with no register accesses as follows.

1.Find the first TFD in the list with TxDMACom- plete bit cleared (the “first TFD”).

2.Set the “first TFD’s”TxDMANextPtr to zero.

3.Check the TxDMAComplete bit of “the first TFD”. If clear, proceed to the next step. If set, it’s too late to insert the new TFD at the loca-

24

Page 24
Image 24
Sundance Spas ST201 manual Adapter Txdma Sequence, Adding TFD’S to the END of the Txdmalist