4 synchronous negotiation and transfer, Synchronous negotiation and transfer – Avago Technologies LSI53C1010 User Manual
Page 216

9-18
SCRIPTS Programming Topics
/* SODR MSB Full?*/
if (IORead8(PCIDevice->base_addr2+SSTAT2) & 0x40)
Bytes_remaining++;
/* Now update the TI entry */
rw_buffer_table[RW_DATA_BUF1 +
Current_SG_Entry].address -= Bytes_remaining;
rw_buffer_table[RW_DATA_BUF1 +
Current_SG_Entry].count += Bytes_remaining;
/* update the jump offset into the SG list */
rw_script[(INT) (Ent_RW_Offset_patch_do/4) + 1] =
(ULONG) Current_SG_Entry * 8;
/*clear the dma fifo to get any left over data out */
RMWon(PCIDevice->base_addr2+CTEST3, 0x04);
/* start the disconnect script */
iowrite32(PCIDeviceIOBase, getPhysAddr(rw_script) +
Ent_RW_Handle_Phase);
}
9.4 Synchronous Negotiation and Transfer
The SCRIPTS processor negotiates a set of parameters for each
synchronous device on the SCSI bus. The parameters for each SCSI
device are saved in memory and reloaded into the registers before
communication resumes between the set of devices. A sample
synchronous negotiation SCRIPTS program is supplied in
“Multithreaded SCRIPTS Example.”
After the target receives acceptable
synchronous parameters during the Message In phase, an interrupt
returns control to the interrupt service routine. This programs the clock
dividers and the synchronous parameters in the SCTNL3 and SXFER
registers. These parameters are saved for this synchronous device.
When this device is selected again, you can use the SELECT FROM
command to indicate table indirect addressing. If table indirect
addressing is used, the SCNTL3, SDID, and SXFER registers are loaded
from the table entry. If the device reselects the initiator, reload these
parameters into the registers before the data transfer begins. One
method for loading them is the table indirect Select instruction with the
alternate address jump programmed to the next instruction. This
instruction must be executed after determining the ITLQ nexus and
loading the DSA to point to the proper I/O data structure. Example code
for these steps is shown in