PCI IDE Controller Base Address Register setting

Darmawan Salihun darmawan_salihun at yahoo.com
Mon Jan 3 20:02:37 UTC 2011


--- On Mon, 1/3/11, Alexander Motin <mav at FreeBSD.org> wrote:

> From: Alexander Motin <mav at FreeBSD.org>
> Subject: Re: PCI IDE Controller Base Address Register setting
> To: "John Baldwin" <jhb at freebsd.org>
> Cc: "Darmawan Salihun" <darmawan_salihun at yahoo.com>, freebsd-hackers at freebsd.org
> Date: Monday, January 3, 2011, 1:08 PM
> > On Saturday, January 01, 2011
> 2:58:12 pm Darmawan Salihun wrote:
> >> So, I found out that it seems the
> >> allocation of I/O ports for the IDE controller is
> just fine.
> >> However, the primary IDE channel is shared
> between
> >> an IDE interface  and a CF card. Moreover,
> Linux detects
> >> DMA bug, because all drives connected to the
> interface would be
> >> in PIO mode :-/
> >> If all drives on the primary channel are "forced"
> to PIO mode, then
> >> shouldn't the "IDE PCI bus master register"
> (offset 20h per SFF-8038i)
> >> along with the command register (offset 4h), are
> set to indicate the
> >> controller doesn't support bus mastering?
> 
> I don't think that BIOS should change controller
> capabilities depending on attached drives, may be except may
> be for workarounding some known bugs/incompatibilities.
> Otherwise this will just make hot-plug things tricky and
> unpredictable.
> 
> >> Anyway, is it possible for devices on _the same_
> channel to use
> >> different setting in FreeBSD? For example, the
> primary slave
> >> is using UDMA66 while the primary master is using
> PIO-4.
> >> Or such configuration is considered invalid.
> 
> Yes, it is possible. If automatic negotiation doesn't
> succeed for some reason, you may limit initial mode for each
> specific device using hint.ata.X.devY.mode loader tunables,
> added not so long ago. After boot it can also be tuned
> per-device via atacontrol or camcontrol tools, depending on
> ATA stack used.
> 
> >> The AMDLX800-CS5536 board I'm working with has
> different connectors
> >> for the primary master and primary slave.
> Moreover, the chipset
> >> supports different setting in primary master and
> primary slave.
> 
> There are few other controllers not supporting such
> configurations, but it is handled by their specific
> drivers.
> 
> -- Alexander Motin
> 

I get the following log message upon booting with "boot -Dv":
==============================
ata0: <ATA channel 0> on atapci0
ata0: reset tp1 mask=03 ostat0=50 ostat1=50
ata0: stat0=0x80 err=0x00 lsb=0x00 msb=0x00
ata0: stat0=0x50 err=0x01 lsb=0x00 msb=0x00
ata0: stat1=0x50 err=0x01 lsb=0x00 msb=0x00
ata0: reset tp2 stat0=50 stat1=50 devices=0x3
...
ata0: Identifying devices: 00000003
ata0: New devices: 00000003
...
ata0-slave: pio=PIO4 wdma=WDMA2 udma=UDMA100 cable=80 wire
ata0-master: pio=PIO1 wdma=UNSUPPORTED udma=UNSUPPORTED cable=40 wire
...
ad0: FAILURE setting PIO1 on CS5536 chip
ad0: 488MB <STI Flash 6.2.0 Rev 6.2.0> at ata0-master BIOSPIO
...
GEOM: newdisk ad0
ad0: Adaptec check1 failed
ad0: LSI(v3) check1 failed
ad0: FAILURE - READ status=51<READY,DSC,ERROR> error=c4<ICRC,UNCORRECTABLE,ABORTED> LBA=0
...
ad1: setting PIO4 on CS5536 chip
ad1: setting UDMA100 on CS5536 chip
ad1: 38150MB <Seagate ST340014A 3.06> at ata0-slave UDMA100
...
GEOM: newdisk ad1
...
ad1: FAILURE - READ_DMA status=51<READY,DSC,ERROR> error=84<ICRC,ABORTED> LBA=78132575
ad1: FAILURE - READ_DMA status=51<READY,DSC,ERROR> error=84<ICRC,ABORTED> LBA=78132591
...
======================
I have several questions: 
1. How FreeBSD sets the PIO mode on the target IDE controller? 
what could've caused it to fail like the message above?

2. It seems to me that setting the UDMA100 in the 
AMD CS5536 IDE controller went just fine (in the log above). 
But, FreeBSD fails when it tries to read something from the drive. 
Does it mean the UDMA100 "mode" failed to be set correctly 
in the IDE controller? 

3. As I'm currently trying to fix the bug in the BIOS for the particular 
board used to boot FreeBSD, what would you suggest to fix it? 

Thank you very much. 

Kind Regards, 

Darmawan




      


More information about the freebsd-hackers mailing list