This message is from the T13 list server.

Hale, The flow you suggest is heavy-handed.  Might I suggest some more
lenient methods?  Read more below.  MKE.

If you find a disabled controller, the device doesn't implement device
hiding, which is probably a bad idea.  However an OS doesn't need to
blue-screen, just don't start a driver for this controller or the driver
should just not set up device objects for itself or run any ATA/ATAPI
device command cycles.

The BAR should never be -1, and if they are programmed for anything that
seems unexpected (memory, plus 0 or -1 address) the driver doesn't need
to bugcheck, but rather can re-program the controller for legacy
operation.  If BAR4 is bad the driver must run PIO cycles.

The worst idea is to bugcheck just because the BAR's are programmed and
the controller is set for legacy operation.  PCI enumerators have no
idea that we're legacy when it sees BAR's to fill out, so it just fills
them out.

And finally there's no limitation to running DMA cycles if you can't
take an interrupt.  Running without interrupts is SOP for Windows during
Crashdump and Hibernation file writing.  When under an OS the OS must
deal with the interrupt mapping, and in DOS the BIOS will map the
interrupt to one of the base IRQ's (15 or lower).

Regards, MKE.

 

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Hale
Landis
Sent: Friday, February 20, 2004 9:52 AM
To: [EMAIL PROTECTED] 
Subject: RE: [t13] How to detect whether a host adapter complies with
1510 D

This message is from the T13 list server.


Note: In these steps "zero" means either 00000000H or 00000001H, one
is zero in memory space and the other is zero in I/O space. Some
controllers use 00000000H instead of the more "correct" value
00000001H.

1) Scan system's PCI config space looking for ATA host controllers -
they probably have 0101H, 0180H or some other 01xxH value in the
class code - avoid SCSI controllers that also have 01xxH class code
values.

2) For each ATA controller found:

2a) Is it enabled? If no, blue screen.

2b) If any BARx (x=0 to 4) is ffffffffh, blue screen.

2c) Is it in legacy or native mode?

2d) If legacy mode and any BARx (x=0 to 3) not zero (see note), 
    blue screen.

2e) If native mode and any BARx (x=0 to 3) is zero (see note), 
    blue screen.

2f) If native mode and any BARx (x=0 to 3) not in I/O space, 
    blue screen.

2g) If BAR4 zero (see note), blue screen.

2h) If BAR4 not in I/O space, blue screen.

3a) if legacy mode  
       Pri Cmd block I/O address is 01f0H
       Pri Ctrl Block I/O address is 03F6H
    else 
       Pri Cmd block I/O address is (BAR0&0x0000fffeH)
       Pri Ctrl block I/O address is ((BAR1&0x0000fffeH)+2)
    Pri BMIDE regs I/O adress is (BAR4&0x0000fffeH)

3b) If legacy mode 
       Sec Cmd block I/O address is 0170H
       Sec Ctrl block I/O address is 0376H
    else
       Sec Cmd block I/O address is (BAR2&0x0000fffeH)
       Sec Cmd block I/O address is ((BAR3&0x0000fffeH)+2)
    Sec BMIDE regs I/O address is ((BAR4&0x0000fffeH)+8)

4) If you must use interrupts, and you must if you want to use DMA
commands, then have fun figuring that out (PIC/APIC?, what is IRQ to
INT mapping? etc?).

Enjoy.

Hale


*** Hale Landis *** www.ata-atapi.com ***



Reply via email to