# AHCI not working on sata port 5 & 6



## olav (Nov 8, 2010)

I have an Asus M4A78L-M LE motherboard with 6 sata ports that can be configured as AHCI. In the manual it says the following.



> When SATA 1/2/3/4/5/6 are configured as [AHCI], only SATA 1/2/3/4 can be detected
> under OS. Ensure to install the AHCI driver, so that you can use SATA 1/2/3/4/5/6 in
> AHCI mode under OS



That means that when I have set all ports to AHCI only the first 4 show during BIOS boot. The last two are "hidden". But when FreeBSD loads, it detects those last two hard drives and they work fine. Except that AHCI isn't enabled.

The driver for sata port 5 & 6 is only available for Windows, are there any workarounds for this?


----------



## mav@ (Nov 8, 2010)

I have some M4A78... board. It worked fine on my tests. Give more information about your problem. Verbose dmesg would be perfect. Consider using new ahci(4) driver.


----------



## wblock@ (Nov 8, 2010)

olav said:
			
		

> The driver for sata port 5 & 6 is only available for Windows, are there any workarounds for this?



Do you have the latest version of the BIOS?


----------



## olav (Nov 9, 2010)

Here is my dmesg log:


```
FreeBSD 8.1-RELEASE #0: Mon Jul 19 02:36:49 UTC 2010
    [email]root@mason.cse.buffalo.edu[/email]:/usr/obj/usr/src/sys/GENERIC amd64
Timecounter "i8254" frequency 1193182 Hz quality 0
CPU: AMD Athlon(tm) II X2 240 Processor (2812.65-MHz K8-class CPU)
  Origin = "AuthenticAMD"  Id = 0x100f62  Family = 10  Model = 6  Stepping = 2
  Features=0x178bfbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CLFLUSH,MMX,FXSR,SSE,SSE2,HTT>
  Features2=0x802009<SSE3,MON,CX16,POPCNT>
  AMD Features=0xee500800<SYSCALL,NX,MMX+,FFXSR,Page1GB,RDTSCP,LM,3DNow!+,3DNow!>
  AMD Features2=0x37ff<LAHF,CMP,SVM,ExtAPIC,CR8,ABM,SSE4A,MAS,Prefetch,OSVW,IBS,SKINIT,WDT>
  TSC: P-state invariant
real memory  = 4294967296 (4096 MB)
avail memory = 4082024448 (3892 MB)
ACPI APIC Table: <112409 APIC1653>
FreeBSD/SMP: Multiprocessor System Detected: 2 CPUs
FreeBSD/SMP: 1 package(s) x 2 core(s)
 cpu0 (BSP): APIC ID:  0
 cpu1 (AP): APIC ID:  1
ACPI Warning: Optional field Pm2ControlBlock has zero address or length: 0x       0       0/0x1 (20100331/tbfadt-655)
ioapic0 <Version 2.1> irqs 0-23 on motherboard
kbd1 at kbdmux0
acpi0: <112409 XSDT1653> on motherboard
acpi0: [ITHREAD]
acpi0: Power Button (fixed)
acpi0: reservation of fee00000, 1000 (3) failed
acpi0: reservation of ffb80000, 80000 (3) failed
acpi0: reservation of fec10000, 20 (3) failed
acpi0: reservation of fed40000, 5000 (3) failed
acpi0: reservation of 0, a0000 (3) failed
acpi0: reservation of 100000, dff00000 (3) failed
ACPI HPET table warning: Sequence is non-zero (2)
Timecounter "ACPI-safe" frequency 3579545 Hz quality 850
acpi_timer0: <32-bit timer at 3.579545MHz> port 0x808-0x80b on acpi0
cpu0: <ACPI CPU> on acpi0
cpu1: <ACPI CPU> on acpi0
acpi_hpet0: <High Precision Event Timer> iomem 0xfed00000-0xfed003ff on acpi0
Timecounter "HPET" frequency 14318180 Hz quality 900
pcib0: <ACPI Host-PCI bridge> port 0xcf8-0xcff on acpi0
pci0: <ACPI PCI bus> on pcib0
pcib1: <ACPI PCI-PCI bridge> at device 1.0 on pci0
pci1: <ACPI PCI bus> on pcib1
vgapci0: <VGA-compatible display> port 0xc000-0xc0ff mem 0xfc000000-0xfdffffff,0xfe9f0000-0xfe9fffff,0xfe800000-0xfe8fffff irq 18 at device 5.0 on pci1
pcib2: <ACPI PCI-PCI bridge> irq 16 at device 4.0 on pci0
pci2: <ACPI PCI bus> on pcib2
atapci0: <SiI 3132 SATA300 controller> port 0xdc00-0xdc7f mem 0xfeaffc00-0xfeaffc7f,0xfeaf8000-0xfeafbfff irq 16 at device 0.0 on pci2
atapci0: [ITHREAD]
ata2: <ATA channel 0> on atapci0
ata2: [ITHREAD]
ata3: <ATA channel 1> on atapci0
ata3: [ITHREAD]
pcib3: <ACPI PCI-PCI bridge> irq 18 at device 6.0 on pci0
pci3: <ACPI PCI bus> on pcib3
alc0: <Atheros AR8131 PCIe Gigabit Ethernet> port 0xec00-0xec7f mem 0xfebc0000-0xfebfffff irq 18 at device 0.0 on pci3
alc0: 15872 Tx FIFO, 15360 Rx FIFO
alc0: Using 1 MSI message(s).
alc0: 4GB boundary crossed, switching to 32bit DMA addressing mode.
miibus0: <MII bus> on alc0
atphy0: <Atheros F1 10/100/1000 PHY> PHY 0 on miibus0
atphy0:  10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseT-FDX, auto
alc0: Ethernet address: 48:5b:39:09:9a:0a
alc0: [FILTER]
ahci0: <ATI IXP700 AHCI SATA controller> port 0xb000-0xb007,0xa000-0xa003,0x9000-0x9007,0x8000-0x8003,0x7000-0x700f mem 0xfe7ffc00-0xfe7fffff irq 22 at device 17.0 on pci0
ahci0: [ITHREAD]
ahci0: AHCI v1.10 with 4 3Gbps ports, Port Multiplier supported
ahcich0: <AHCI channel> at channel 0 on ahci0
ahcich0: [ITHREAD]
ahcich1: <AHCI channel> at channel 1 on ahci0
ahcich1: [ITHREAD]
ahcich2: <AHCI channel> at channel 2 on ahci0
ahcich2: [ITHREAD]
ahcich3: <AHCI channel> at channel 3 on ahci0
ahcich3: [ITHREAD]
ohci0: <OHCI (generic) USB controller> mem 0xfe7fe000-0xfe7fefff irq 16 at device 18.0 on pci0
ohci0: [ITHREAD]
usbus0: <OHCI (generic) USB controller> on ohci0
ohci1: <OHCI (generic) USB controller> mem 0xfe7fd000-0xfe7fdfff irq 16 at device 18.1 on pci0
ohci1: [ITHREAD]
usbus1: <OHCI (generic) USB controller> on ohci1
ehci0: <EHCI (generic) USB 2.0 controller> mem 0xfe7ff800-0xfe7ff8ff irq 17 at device 18.2 on pci0
ehci0: [ITHREAD]
usbus2: EHCI version 1.0
usbus2: <EHCI (generic) USB 2.0 controller> on ehci0
ohci2: <OHCI (generic) USB controller> mem 0xfe7fc000-0xfe7fcfff irq 18 at device 19.0 on pci0
ohci2: [ITHREAD]
usbus3: <OHCI (generic) USB controller> on ohci2
ohci3: <OHCI (generic) USB controller> mem 0xfe7fb000-0xfe7fbfff irq 18 at device 19.1 on pci0
ohci3: [ITHREAD]
usbus4: <OHCI (generic) USB controller> on ohci3
ehci1: <EHCI (generic) USB 2.0 controller> mem 0xfe7ff400-0xfe7ff4ff irq 19 at device 19.2 on pci0
ehci1: [ITHREAD]
usbus5: EHCI version 1.0
usbus5: <EHCI (generic) USB 2.0 controller> on ehci1
pci0: <serial bus, SMBus> at device 20.0 (no driver attached)
atapci1: <ATI IXP700/800 UDMA133 controller> port 0x1f0-0x1f7,0x3f6,0x170-0x177,0x376,0xff00-0xff0f at device 20.1 on pci0
ata0: <ATA channel 0> on atapci1
ata0: [ITHREAD]
ata1: <ATA channel 1> on atapci1
ata1: [ITHREAD]
isab0: <PCI-ISA bridge> at device 20.3 on pci0
isa0: <ISA bus> on isab0
pcib4: <ACPI PCI-PCI bridge> at device 20.4 on pci0
pci4: <ACPI PCI bus> on pcib4
ohci4: <OHCI (generic) USB controller> mem 0xfe7fa000-0xfe7fafff irq 18 at device 20.5 on pci0
ohci4: [ITHREAD]
usbus6: <OHCI (generic) USB controller> on ohci4
acpi_button0: <Power Button> on acpi0
atrtc0: <AT realtime clock> port 0x70-0x71 irq 8 on acpi0
ppc0: <Parallel port> port 0x378-0x37f irq 7 on acpi0
ppc0: Generic chipset (NIBBLE-only) in COMPATIBLE mode
ppc0: [ITHREAD]
ppbus0: <Parallel port bus> on ppc0
plip0: <PLIP network interface> on ppbus0
plip0: [ITHREAD]
lpt0: <Printer> on ppbus0
lpt0: [ITHREAD]
lpt0: Interrupt-driven port
ppi0: <Parallel I/O> on ppbus0
atkbdc0: <Keyboard controller (i8042)> port 0x60,0x64 irq 1 on acpi0
atkbd0: <AT Keyboard> irq 1 on atkbdc0
kbd0 at atkbd0
atkbd0: [GIANT-LOCKED]
atkbd0: [ITHREAD]
uart0: <16550 or compatible> port 0x3f8-0x3ff irq 4 flags 0x10 on acpi0
uart0: [FILTER]
sc0: <System console> at flags 0x100 on isa0
sc0: VGA <16 virtual consoles, flags=0x300>
vga0: <Generic ISA VGA> at port 0x3c0-0x3df iomem 0xa0000-0xbffff on isa0
acpi_throttle0: <ACPI CPU Throttling> on cpu0
hwpstate0: <Cool`n'Quiet 2.0> on cpu0
Timecounters tick every 1.000 msec
usbus0: 12Mbps Full Speed USB v1.0
usbus1: 12Mbps Full Speed USB v1.0
usbus2: 480Mbps High Speed USB v2.0
usbus3: 12Mbps Full Speed USB v1.0
usbus4: 12Mbps Full Speed USB v1.0
usbus5: 480Mbps High Speed USB v2.0
usbus6: 12Mbps Full Speed USB v1.0
ugen0.1: <ATI> at usbus0
uhub0: <ATI OHCI root HUB, class 9/0, rev 1.00/1.00, addr 1> on usbus0
ugen1.1: <ATI> at usbus1
uhub1: <ATI OHCI root HUB, class 9/0, rev 1.00/1.00, addr 1> on usbus1
ugen2.1: <ATI> at usbus2
uhub2: <ATI EHCI root HUB, class 9/0, rev 2.00/1.00, addr 1> on usbus2
ugen3.1: <ATI> at usbus3
uhub3: <ATI OHCI root HUB, class 9/0, rev 1.00/1.00, addr 1> on usbus3
ugen4.1: <ATI> at usbus4
uhub4: <ATI OHCI root HUB, class 9/0, rev 1.00/1.00, addr 1> on usbus4
ugen5.1: <ATI> at usbus5
uhub5: <ATI EHCI root HUB, class 9/0, rev 2.00/1.00, addr 1> on usbus5
ugen6.1: <ATI> at usbus6
uhub6: <ATI OHCI root HUB, class 9/0, rev 1.00/1.00, addr 1> on usbus6
ad0: 476940MB <WDC WD5000AAKB-00UKA0 07.01N01> at ata0-master UDMA100 
ad2: 476940MB <WDC WD5000AAJB-00YRA0 12.01C02> at ata1-master UDMA100 SATA
ad3: 476940MB <WDC WD5000AAJB-00YRA0 12.01C02> at ata1-slave UDMA100 SATA
uhub6: 2 ports with 2 removable, self powered
uhub0: 3 ports with 3 removable, self powered
uhub1: 3 ports with 3 removable, self powered
uhub3: 3 ports with 3 removable, self powered
uhub4: 3 ports with 3 removable, self powered
ada0 at ahcich0 bus 0 scbus0 target 0 lun 0
ada0: <WDC WD5000AAKS-00YGA0 12.01C02> ATA-8 SATA 2.x device
ada0: 300.000MB/s transfers (SATA 2.x, UDMA6, PIO 8192bytes)
ada0: Command Queueing enabled
ada0: 476940MB (976773168 512 byte sectors: 16H 63S/T 16383C)
ada1 at ahcich1 bus 0 scbus1 target 0 lun 0
ada1: <ST3500320AS SD15> ATA-8 SATA 1.xad4: 476940MB <WDC WD5000AAKS-00TMA0 12.01C01> at ata2-master UDMA100 SATA 3Gb/s
 device
ada1: 150.000MB/s transfers (SATA 1.x, UDMA6, PIO 8192bytes)
ada1: Command Queueing enabled
ada1: 476940MB (976773168 512 byte sectors: 16H 63S/T 16383C)
ada2 at ahcich2 bus 0 scbus2 target 0 lun 0
ada2: <WDC WD5000AAKS-00A7B0 01.03B01> ATA-8 SATA 2.x device
ada2: 300.000MB/s transfers (SATA 2.x, UDMA6, PIO 8192bytes)
ada2: Command Queueing enabled
ada2: 476940MB (976773168 512 byte sectors: 16H 63S/T 16383C)
ada3 at ahcich3 bus 0 scbus3 target 0 lun 0
ada3: <WDC WD5000AAKS-22A7B0 01.03B01> ATA-8 SATA 2.x device
ada3: 300.000MB/s transfers (SATA 2.x, UDMA6, PIO 8192bytes)
ada3: Command Queueing enabled
ada3: 476940MB (976773168 512 byte sectors: 16H 63S/T 16383C)
ad6: 476940MB <Seagate ST3500320AS SD15> at ata3-master UDMA100 SATA 1.5Gb/s
SMP: AP CPU #1 Launched!
Root mount waiting for: usbus5 usbus2
Root mount waiting for: usbus5 usbus2
uhub2: 6 ports with 6 removable, self powered
uhub5: 6 ports with 6 removable, self powered
ugen2.2: <Kingston> at usbus2
umass0: <Kingston DataTraveler 2.0, class 0/0, rev 2.00/1.00, addr 2> on usbus2
umass0:  SCSI over Bulk-Only; quirks = 0x0000
Root mount waiting for: usbus2
umass0:4:0:-1: Attached to scbus4
da0 at umass-sim0 bus 0 scbus4 target 0 lun 0
da0: <Kingston DataTraveler 2.0 PMAP> Removable Direct Access SCSI-0 device 
da0: 40.000MB/s transfers
da0: 3826MB (7835648 512 byte sectors: 255H 63S/T 487C)
Root mount waiting for: GMIRROR usbus2
ugen2.3: <Kingston> at usbus2
umass1: <Kingston DataTraveler 2.0, class 0/0, rev 2.00/1.00, addr 3> on usbus2
umass1:  SCSI over Bulk-Only; quirks = 0x0000
Root mount waiting for: GMIRROR usbus2
umass1:5:1:-1: Attached to scbus5
da1 at umass-sim1 bus 1 scbus5 target 0 lun 0
da1: <Kingston DataTraveler 2.0 PMAP> Removable Direct Access SCSI-0 device 
da1: 40.000MB/s transfers
da1: 3826MB (7835648 512 byte sectors: 255H 63S/T 487C)
```

The new ahci(4) driver is in 8.1-Stable? I should have told it in the first post, but anyway I run FreeBSD 8.1-RELEASE


----------



## mav@ (Nov 9, 2010)

Your ATA controller runs in combined mode. It is BIOS duty to configure it, not driver. Check that you have latest BIOS version and try to play with it's settings.


----------



## olav (Nov 9, 2010)

Hmm, I removed two IDE drives with a IDE->SATA adapter connected to an additional SATA controller and now it boots with all six drives with AHCI :OO

And the reason I removed them was because they were Ã¼ber slow, write speed was as low as 15MB/s.


----------

