Line 213... |
Line 213... |
|
|
/* power-on and hardware reset */
|
/* power-on and hardware reset */
|
void ata_devices_hw_reset(ata_devices *devices, int reset_signal)
|
void ata_devices_hw_reset(ata_devices *devices, int reset_signal)
|
{
|
{
|
/* display debug information */
|
/* display debug information */
|
TRACE("ata_devices_hw_reset.\n");
|
TRACE(reset_signal ? "Starting reset\n" : "Finishing reset\n");
|
|
|
/* find device 0 */
|
/* find device 0 */
|
if((devices->device[0].conf.stream) && (devices->device[1].conf.stream)) {
|
if((devices->device[0].conf.stream) && (devices->device[1].conf.stream)) {
|
/* this one is simple, device0 is device0 */
|
/* this one is simple, device0 is device0 */
|
|
|
Line 255... |
Line 255... |
D E V I C E S _ D O _ C O N T R O L _ R E G I S T E R
|
D E V I C E S _ D O _ C O N T R O L _ R E G I S T E R
|
|
|
Handles - software reset
|
Handles - software reset
|
- Interrupt enable bit
|
- Interrupt enable bit
|
*/
|
*/
|
void ata_device_do_control_register(ata_device *device)
|
static void ata_device_do_control_register(ata_device *device)
|
{
|
{
|
/* TODO respond to new values of nIEN */
|
/* TODO respond to new values of nIEN */
|
/* if device not selected, respond to new values of nIEN & SRST */
|
/* if device not selected, respond to new values of nIEN & SRST */
|
|
|
/* check if SRST bit is set */
|
/* check if SRST bit is set */
|
Line 311... |
Line 311... |
|
|
|
|
/*
|
/*
|
D E V I C E S _ D O _ C O M M A N D _ R E G I S T E R
|
D E V I C E S _ D O _ C O M M A N D _ R E G I S T E R
|
*/
|
*/
|
void ata_device_do_command_register(ata_device *device)
|
static void ata_device_do_command_register(ata_device *device)
|
{
|
{
|
/* check BSY & DRQ */
|
/* check BSY & DRQ */
|
if ( (device->regs.status & ATA_SR_BSY) || (device->regs.status & ATA_SR_DRQ) )
|
if ( (device->regs.status & ATA_SR_BSY) || (device->regs.status & ATA_SR_DRQ) )
|
if (device->regs.command != DEVICE_RESET)
|
if (device->regs.command != DEVICE_RESET)
|
WARN("ata_device_write, writing a command while BSY or DRQ asserted.");
|
WARN("ata_device_write, writing a command while BSY or DRQ asserted.\n");
|
|
|
/* check if device selected */
|
/* check if device selected */
|
if ( (device->regs.device_head & ATA_DHR_DEV) == device->internals.dev )
|
if ( (device->regs.device_head & ATA_DHR_DEV) == device->internals.dev )
|
ata_device_execute_cmd(device);
|
ata_device_execute_cmd(device);
|
else
|
else
|