# Can FreeBSD support ACARD ATP8620?



## rongsongshen (Feb 4, 2010)

I have a ACARD ATP8620 based combo board with 1 IDE/1 SATA/1 eSATA with NCQ and SATA port multiplex capability, is it possible to use under FreeBSD?

Thanks


----------



## SirDice (Feb 4, 2010)

Not sure but it looks like it would be supported by ahci(4).


----------



## rongsongshen (Feb 5, 2010)

Thanks. I will try it by load ahci driver


----------



## rongsongshen (Feb 5, 2010)

I have loaded ahci.ko, but it seems that the card still can not been driven:


```
none2@pci0:4:0:0:       class=0x010400 card=0x000d1191 chip=0x000d1191 rev=0x01 hdr=0x00
    vendor     = 'Acard Technology Corp.'
    device     = '2S1P PCI-X SATA(3G)/UDMA Combo Controller (ATP8620)'
    class      = mass storage
    subclass   = RAID
```


----------



## rongsongshen (Feb 5, 2010)

also, output from dmesg and kldstat:

```
bsdnas# dmesg |grep -i raid
pci4: <mass storage, RAID> at device 0.0 (no driver attached)
bsdnas#
bsdnas# kldstat -v |grep ahci
                62 pci/ata_ahci
 2    1 0xffffffff81022000 4f9d     ahci.ko (/boot/kernel/ahci.ko)
                415 ahci/ahcich
                416 pci/ahci
```


----------



## mav@ (Feb 5, 2010)

It has wrong subclass for AHCI controller. Show please full output of `pciconf -lvbc` for this device.


----------



## mav@ (Feb 5, 2010)

Googling shows that this controller is much alike to AHCI, but not compatible. Looks like it was made intentionally. I have no explanation of this, except some kind of madness.


----------



## DutchDaemon (Feb 6, 2010)

rongsongshen, use 

```
tags[/url] for posting system output.
```


----------



## rongsongshen (Feb 6, 2010)

Following are full output of command 'pciconf -lvbc'

```
bsdnas# pciconf -lvbc
hostb0@pci0:0:0:0:      class=0x060000 card=0x464c8086 chip=0x27708086 rev=0x02 hdr=0x00
    vendor     = 'Intel Corporation'
    device     = 'Host Bridge/DRAM Controller (82945G/GZ/P/PL)'
    class      = bridge
    subclass   = HOST-PCI
    cap 09[e0] = vendor (length 9) Intel cap 5 version 1
vgapci0@pci0:0:2:0:     class=0x030000 card=0x464c8086 chip=0x27728086 rev=0x02 hdr=0x00
    vendor     = 'Intel Corporation'
    device     = 'Integrated Graphics Device (82945G/GZ)'
    class      = display
    subclass   = VGA
    bar   [10] = type Memory, range 32, base 0x90300000, size 524288, enabled
    bar   [14] = type I/O Port, range 32, base 0x40e0, size  8, enabled
    bar   [18] = type Prefetchable Memory, range 32, base 0x80000000, size 268435456, enabled
    bar   [1c] = type Memory, range 32, base 0x90380000, size 262144, enabled
    cap 05[90] = MSI supports 1 message
    cap 01[d0] = powerspec 2  supports D0 D3  current D0
none0@pci0:0:27:0:      class=0x040300 card=0xd6038086 chip=0x27d88086 rev=0x01 hdr=0x00
    vendor     = 'Intel Corporation'
    device     = '82801G (ICH7 Family) High Definition Audio'
    class      = multimedia
    subclass   = HDA
    bar   [10] = type Memory, range 64, base 0x903c0000, size 16384, enabled
    cap 01[50] = powerspec 2  supports D0 D3  current D0
    cap 05[60] = MSI supports 1 message, 64 bit
    cap 10[70] = PCI-Express 1 root endpoint max data 128(128) link x0(x0)
pcib1@pci0:0:28:0:      class=0x060400 card=0x00000000 chip=0x27d08086 rev=0x01 hdr=0x01
    vendor     = 'Intel Corporation'
    device     = '82801G (ICH7 Family) PCIe Root Port'
    class      = bridge
    subclass   = PCI-PCI
    cap 10[40] = PCI-Express 1 root port max data 128(128) link x1(x1)
    cap 05[80] = MSI supports 1 message
    cap 0d[90] = PCI Bridge card=0x00000000
    cap 01[a0] = powerspec 2  supports D0 D3  current D0
pcib2@pci0:0:28:2:      class=0x060400 card=0x00000000 chip=0x27d48086 rev=0x01 hdr=0x01
    vendor     = 'Intel Corporation'
    device     = '82801G (ICH7 Family) PCIe Root Port'
    class      = bridge
    subclass   = PCI-PCI
    cap 10[40] = PCI-Express 1 root port max data 128(128) link x0(x1)
    cap 05[80] = MSI supports 1 message
    cap 0d[90] = PCI Bridge card=0x00000000
    cap 01[a0] = powerspec 2  supports D0 D3  current D0
pcib3@pci0:0:28:3:      class=0x060400 card=0x00000000 chip=0x27d68086 rev=0x01 hdr=0x01
    vendor     = 'Intel Corporation'
    device     = '82801G (ICH7 Family) PCIe Root Port'
    class      = bridge
    subclass   = PCI-PCI
    cap 10[40] = PCI-Express 1 root port max data 128(128) link x0(x1)
    cap 05[80] = MSI supports 1 message
    cap 0d[90] = PCI Bridge card=0x00000000
    cap 01[a0] = powerspec 2  supports D0 D3  current D0
uhci0@pci0:0:29:0:      class=0x0c0300 card=0x464c8086 chip=0x27c88086 rev=0x01 hdr=0x00
    vendor     = 'Intel Corporation'
    device     = '82801G (ICH7 Family) USB Universal Host Controller'
    class      = serial bus
    subclass   = USB
    bar   [20] = type I/O Port, range 32, base 0x4080, size 32, enabled
uhci1@pci0:0:29:1:      class=0x0c0300 card=0x464c8086 chip=0x27c98086 rev=0x01 hdr=0x00
    vendor     = 'Intel Corporation'
    device     = '82801G (ICH7 Family) USB Universal Host Controller'
    class      = serial bus
    subclass   = USB
    bar   [20] = type I/O Port, range 32, base 0x4060, size 32, enabled
uhci2@pci0:0:29:2:      class=0x0c0300 card=0x464c8086 chip=0x27ca8086 rev=0x01 hdr=0x00
    vendor     = 'Intel Corporation'
    device     = '82801G (ICH7 Family) USB Universal Host Controller'
    class      = serial bus
    subclass   = USB
    bar   [20] = type I/O Port, range 32, base 0x4040, size 32, enabled
uhci3@pci0:0:29:3:      class=0x0c0300 card=0x464c8086 chip=0x27cb8086 rev=0x01 hdr=0x00
    vendor     = 'Intel Corporation'
    device     = '82801G (ICH7 Family) USB Universal Host Controller'
    class      = serial bus
    subclass   = USB
    bar   [20] = type I/O Port, range 32, base 0x4020, size 32, enabled
ehci0@pci0:0:29:7:      class=0x0c0320 card=0x464c8086 chip=0x27cc8086 rev=0x01 hdr=0x00
    vendor     = 'Intel Corporation'
    device     = '82801G (ICH7 Family) USB 2.0 Enhanced Host Controller'
    class      = serial bus
    subclass   = USB
    bar   [10] = type Memory, range 32, base 0x903c4000, size 1024, enabled
    cap 01[50] = powerspec 2  supports D0 D3  current D0
    cap 0a[58] = EHCI Debug Port at offset 0xa0 in map 0x14
pcib4@pci0:0:30:0:      class=0x060401 card=0x464c8086 chip=0x244e8086 rev=0xe1 hdr=0x01
    vendor     = 'Intel Corporation'
    device     = '82801 Family (ICH2/3/4/5/6/7/8/9,63xxESB) Hub Interface to PCI Bridge'
    class      = bridge
    subclass   = PCI-PCI
    cap 0d[50] = PCI Bridge card=0x464c8086
isab0@pci0:0:31:0:      class=0x060100 card=0x464c8086 chip=0x27b88086 rev=0x01 hdr=0x00
    vendor     = 'Intel Corporation'
    device     = 'Intel 82801GB/GR (ICH7 Family) LPC Interface Controller - 27B8 (945GL)'
    class      = bridge
    subclass   = PCI-ISA
    cap 09[e0] = vendor (length 12) Intel cap 1 version 0
                 features: Quick Resume, SATA RAID-5, 6 PCI-e x1 slots, SATA RAID-0/1/10, SATA AHCI
atapci0@pci0:0:31:1:    class=0x01018a card=0x464c8086 chip=0x27df8086 rev=0x01 hdr=0x00
    vendor     = 'Intel Corporation'
    device     = '82801G (ICH7 Family) Ultra ATA Storage Controller'
    class      = mass storage
    subclass   = ATA
    bar   [10] = type I/O Port, range 32, base 0x1f0, size  8, enabled
    bar   [14] = type I/O Port, range 32, base 0x3f4, size  1, enabled
    bar   [18] = type I/O Port, range 32, base 0x170, size  8, enabled
    bar   [1c] = type I/O Port, range 32, base 0x374, size  1, enabled
    bar   [20] = type I/O Port, range 32, base 0x40b0, size 16, enabled
atapci1@pci0:0:31:2:    class=0x01018f card=0x464c8086 chip=0x27c08086 rev=0x01 hdr=0x00
    vendor     = 'Intel Corporation'
    device     = '82801GB/GR/GH (ICH7 Family) Serial ATA Storage Controller'
    class      = mass storage
    subclass   = ATA
    bar   [10] = type I/O Port, range 32, base 0x40c8, size  8, enabled
    bar   [14] = type I/O Port, range 32, base 0x40ec, size  4, enabled
    bar   [18] = type I/O Port, range 32, base 0x40c0, size  8, enabled
    bar   [1c] = type I/O Port, range 32, base 0x40e8, size  4, enabled
    bar   [20] = type I/O Port, range 32, base 0x40a0, size 16, enabled
    cap 01[70] = powerspec 2  supports D0 D3  current D0
none1@pci0:0:31:3:      class=0x0c0500 card=0x464c8086 chip=0x27da8086 rev=0x01 hdr=0x00
    vendor     = 'Intel Corporation'
    device     = '82801G (ICH7 Family) SMBus Controller'
    class      = serial bus
    subclass   = SMBus
    bar   [20] = type I/O Port, range 32, base 0x4000, size 32, enabled
re0@pci0:1:0:0: class=0x020000 card=0x00018086 chip=0x813610ec rev=0x02 hdr=0x00
    vendor     = 'Realtek Semiconductor'
    device     = 'RTL8100E/RTL8101E/RTL8102E-GR (RTL8100-8101E-8102E-PCIEXPRESS)'
    class      = network
    subclass   = ethernet
    bar   [10] = type I/O Port, range 32, base 0x3000, size 256, enabled
    bar   [18] = type Memory, range 64, base 0x90200000, size 4096, enabled
    bar   [20] = type Prefetchable Memory, range 64, base 0x90000000, size 65536, enabled
    cap 01[40] = powerspec 3  supports D0 D1 D2 D3  current D0
    cap 05[50] = MSI supports 1 message, 64 bit enabled with 1 message
    cap 10[70] = PCI-Express 2 endpoint IRQ 2 max data 128(256) link x1(x1)
    cap 11[ac] = MSI-X supports 2 messages in map 0x20
    cap 03[cc] = VPD
none2@pci0:4:0:0:       class=0x010400 card=0x000d1191 chip=0x000d1191 rev=0x01 hdr=0x00
    vendor     = 'Acard Technology Corp.'
    device     = '2S1P PCI-X SATA(3G)/UDMA Combo Controller (ATP8620)'
    class      = mass storage
    subclass   = RAID
    bar   [10] = type I/O Port, range 32, base 0x2000, size 256, enabled
    bar   [14] = type I/O Port, range 32, base 0x1c00, size 256, enabled
    bar   [18] = type I/O Port, range 32, base 0x1800, size 256, enabled
    bar   [1c] = type I/O Port, range 32, base 0x1400, size 256, enabled
    bar   [20] = type I/O Port, range 32, base 0x1000, size 256, enabled
    bar   [24] = type Memory, range 32, base 0x90100000, size 4096, enabled
    cap 01[40] = powerspec 2  supports D0 D1 D2 D3  current D0
    cap 07[48] = PCI-X supports 133MHz, 1024 burst read, 3 split transactions
bsdnas#
```


----------



## rayddteam (Sep 14, 2011)

rongsongshen said:
			
		

> Following are full output of command 'pciconf -lvbc'


Hi,

if you still have that ATP8620 based card, you may be interesting to test my driver.
Driver not support SATA, because my embedded into small device and only CF card attached to it.

Also i have not yet fixed DMA problems, so i reduce supported modes to PIO4.

But if you or someone else will test that driver, you will be able to easy rise limit by change notyet to 1 in code below:


```
static int
ata_atp2860_setmode(device_t dev, int target, int mode)
{
#ifdef notyet
       return (min(mode, ATA_UDMA6));
#else
       return (min(mode, ATA_PIO4));
#endif
}
```

Please let me know, driver works for you or not, etc.

Patch here:
http://my.ddteam.net/files/2011-09-14_ATP8620_support.patch

ray [at] zrouter [dot] org or ray@freebsd

Thanks!


----------

