-
Notifications
You must be signed in to change notification settings - Fork 6
The sub system interface (SIF)
The sub-system interface (SIF) is the interface to exchange data between the sub (input/output) processor (IOP) and the main (R5900) processor and other devices connected to the main bus. The IOP handles, in whole or in part, most of the peripheral devices, including for example USB OHCI interrupts.
DMA controllers (DMACs) for the IOP and the R5900 operate in cooperation through a bidirectional FIFO in the SIF. There are three DMA channels: SIF0 (sub-to-main), SIF1 (main-to-sub) and SIF2 (bidirectional). Data is transferred in packets with a tag attached to each packet. The tag contains the memory addresses in the IOP and R5900 address spaces and the size of the data to transfer.
There are two mailbox type registers, the SMFLAG (sub-to-main) and MSFLAG (main-to-sub), used to indicate certain events. The MAINADDR and SUBADDR registers indicate the R5900 and IOP addresses where SIF commands are transferred by the DMAC.
The IOP can assert interrupts via IRQ_INTC_SBUS.
This SIF kernel module resets the IOP during initialisation. The IOP follows a certain boot protocol, with the following steps:
- The kernel allocates a DMA memory buffer that the IOP can use to send commands. The kernel advertises this buffer by writing to the MAINADDR register.
- The kernel reads the provisional SUBADDR register to obtain the corresponding command buffer for the IOP.
- The kernel clears the SIF_STATUS_BOOTEND flag in the SMFLAG register.
- The kernel issues the SIF_CMD_RESET_CMD command to the IOP.
- The kernel indicates that the SIF and system commands are ready by setting the SIF_STATUS_SIFINIT and SIF_STATUS_CMDINIT flags in the SMFLAG register.
- The kernel waits for the IOP to set the SIF_STATUS_BOOTEND flag in the SMFLAG register.
- The kernel indicates that the boot is completed by updating its MAINADDR and setting the %SIF_STATUS_CMDINIT and %SIF_STATUS_BOOTEND flags in the MSFLAG register. The %SIF_UNKNF260 register is set to 0xff.
- The kernel reads the final SUBADDR register to obtain the command buffer for the IOP.
- EE Overview, version 6.0, Sony Computer Entertainment Inc., p. 47.