Theory of Operation
R
38
SATA Programmer’s Reference Manual
//
BYTE bMAP = OS_ReadPCI( 0x90); // read the map register
//
// It is assumed that the port is enabled and the device and PHY are not in a
// slumber state as this is required in order for the port presence bits to be
// accurate.
//
BYTE bPCS = OS_ReadPCI( 0x92); // read the port/status control register
//
// check the status of port 0
//
INT iPort0Status, iPort1Status, iAllStatus = 0;
//
// make sure the P-ATA is not the primary channel
//
if( bMAP < 0x06) {
//
// Not P-ATA device. Must be SATA.
//
if( bPCS & 0x10)
iPort0Status = 1; // Port 0 device present
if( bPCS & 0x20)
iPort1Status = 1; // Port 1 device present
// Now we need to figure out which is master and slave (if applicable)
if( !(bMAP & 0x01)) { // is Port 0 master?
// Port 0 is master
iAllStatus = iPort0Status;
// check if combined mode
if( bMAP & 0x04) // Is combined mode?
// yes, set the slave device status (Port 1)
iAllStatus |= iPort1Status << 1;
}
else {
// Port 1 is master
iAllStatus = iPort1Status;
if( bMAP & 0x04) // Is combined mode?
// yes, set the slave device status (Port 0)
iAllStatus |= iPort0Status << 1;
}
}
else
// P-ATA does not support this. Indicate connect status unknown
iAllStatus = -1;
//
Summary of Contents for 82801EB
Page 6: ...R 6 SATA Programmer s Reference Manual This page is intentionally left blank...
Page 8: ...Introduction R 8 SATA Programmer s Reference Manual This page is intentionally left blank...
Page 10: ...Conventions R 10 SATA Programmer s Reference Manual This page is intentionally left blank...
Page 59: ...Theory of Operation R SATA Programmer s Reference Manual 59...