# Marvell 88SE6145



## ers (Nov 3, 2010)

Please help with a mystery to me with Marvell 88SE6145 PCI-express SATA2 hard disk controller with 4 connectors. Recently Marvel controller were added to FreeBSD (8.0 or 8.1) but maybe there is a difference between SX ans SE controller.

Marvell 88SE6145 is a second controller on VIA board equiped with 2TB seagate baracuda LP (512b per sector) hard drives. Drives working fine when connected to VIA controller. When connected to Marvell something is wrong.

Tested with 8.1-release, 8.1-stable 201010, 9.0-current 201010...

Is this controller supported? How to make this to work properly? Maybe I am doing something wrong or I do not know something?

Google, rtfm,... and similar do not helped me much...

- Drive is visible in /dev as /dev/ad12 (others too)
- Sysinstall see them but cannot do fdisk and disklabel on them
- smartctl -a /dev/ad12 is working and gives real info
- fdisk ad12 claims: "fdisk: could not detect sector size"


```
# diskinfo -c ad12
        512             # sectorsize
        2000398934016   # mediasize in bytes (1.8T)
        3907029168      # mediasize in sectors
        0               # stripesize
        0               # stripeoffset
        3876021         # Cylinders according to firmware.
        16              # Heads according to firmware.
        63              # Sectors according to firmware.
        ********        # Disk ident.

I/O command overhead:
diskinfo: read error or disk too small for test.: No such file or directory
```


```
# dmesg | grep ata

atapci0: <VIA AHCI controller> port 0xfc00-0xfc07,0xf800-0xf803,0xf400-0xf407,0xf000-0xf003,0xec00-0xec0f mem 0xdffff000-0xdffff3ff irq 21 at 
device 15.0 on pci0
atapci0: [ITHREAD]
atapci0: AHCI v1.00 controller with 4 3Gbps ports, PM supported
ata2: <ATA channel 0> on atapci0
ata2: [ITHREAD]
ata3: <ATA channel 1> on atapci0
ata3: [ITHREAD]
ata4: <ATA channel 2> on atapci0
ata4: [ITHREAD]
ata5: <ATA channel 3> on atapci0
ata5: [ITHREAD]
atapci1: <VIA ATA controller> port 0x1f0-0x1f7,0x3f6,0x170-0x177,0x376,0xe800-0xe80f at device 15.1 on pci0
ata0: <ATA channel 0> on atapci1
ata0: [ITHREAD]
ata1: <ATA channel 1> on atapci1
ata1: [ITHREAD]
atapci2: <Marvell 88SX6145 UDMA133 controller> port 0x9c00-0x9c07,0x9800-0x9803,0x9400-0x9407,0x9000-0x9003,0x8c00-0x8c0f mem 0xd3dff000-
0xd3dff3ff irq 16 at device 0.0 on pci130
atapci2: [ITHREAD]
atapci3: <AHCI SATA controller> on atapci2
atapci3: [ITHREAD]
atapci3: AHCI v1.00 controller with 5 3Gbps ports, PM supported
ata6: <ATA channel 0> on atapci3
ata6: [ITHREAD]
ata7: <ATA channel 1> on atapci3
ata7: [ITHREAD]
ata8: <ATA channel 2> on atapci3
ata8: [ITHREAD]
ata9: <ATA channel 3> on atapci3
ata9: [ITHREAD]
ata10: <ATA channel 0> on atapci2
ata10: [ITHREAD]
ad0: 38154MB <Seagate ST94811A 3.05> at ata0-master UDMA33
ad12: 1907729MB <Seagate ST32000542AS CC34> at ata6-master UDMA100 SATA 3Gb/s
```


```
# pciconf -lbcv   [I]//with removed NIC, usb and vga for short[/I]

hostb0@pci0:0:0:0:      class=0x060000 card=0xaa0e1106 chip=0x03141106 rev=0x00 hdr=0x00
    vendor     = 'VIA Technologies, Inc.'
    device     = 'CN700/VN800/P4M800CE/Pro Host Bridge'
    class      = bridge
    subclass   = HOST-PCI
    bar   [10] = type Prefetchable Memory, range 32, base 0xda000000, size 33554432, enabled
    cap 02[80] = AGP v3 8x 4x SBA disabled
    cap 01[50] = powerspec 2  supports D0 D3  current D0
hostb1@pci0:0:0:1:      class=0x060000 card=0x00000000 chip=0x13141106 rev=0x00 hdr=0x00
    vendor     = 'VIA Technologies, Inc.'
    device     = 'CN700/VN800/P4M800CE/Pro Standard Host Bridge'
    class      = bridge
    subclass   = HOST-PCI
hostb2@pci0:0:0:2:      class=0x060000 card=0x00000000 chip=0x23141106 rev=0x00 hdr=0x00
    vendor     = 'VIA Technologies, Inc.'
    device     = 'CN700/VN800/P4M800CE/Pro Standard Host Bridge'
    class      = bridge
    subclass   = HOST-PCI
hostb3@pci0:0:0:3:      class=0x060000 card=0x00000000 chip=0x32081106 rev=0x00 hdr=0x00
    vendor     = 'VIA Technologies, Inc.'
    device     = 'CPU to PCI Bridge (PT890)'
    class      = bridge
    subclass   = HOST-PCI
hostb4@pci0:0:0:4:      class=0x060000 card=0x00000000 chip=0x43141106 rev=0x00 hdr=0x00
    vendor     = 'VIA Technologies, Inc.'
    device     = 'CN700/VN800/P4M800CE/Pro Host Bridge'
    class      = bridge
    subclass   = HOST-PCI
hostb5@pci0:0:0:7:      class=0x060000 card=0x00000000 chip=0x73141106 rev=0x00 hdr=0x00
    vendor     = 'VIA Technologies, Inc.'
    device     = 'CN700/VN800/P4M800CE/Pro Host Bridge'
    class      = bridge
    subclass   = HOST-PCI
pcib1@pci0:0:1:0:       class=0x060400 card=0x00000000 chip=0xb1981106 rev=0x00 hdr=0x01
    vendor     = 'VIA Technologies, Inc.'
    device     = 'ProSavageDDR P4X600,Apollo KT400/A/600 CPU to AGP Bridge'
    class      = bridge
    subclass   = PCI-PCI
    cap 01[70] = powerspec 2  supports D0 D1 D3  current D0
atapci0@pci0:0:15:0:    class=0x010601 card=0xaa0e1106 chip=0x62871106 rev=0x20 hdr=0x00
    vendor     = 'VIA Technologies, Inc.'
    device     = 'VT8251 AHCI Controller'
    class      = mass storage
    subclass   = SATA
    bar   [10] = type I/O Port, range 32, base 0xfc00, size  8, enabled
    bar   [14] = type I/O Port, range 32, base 0xf800, size  4, enabled
    bar   [18] = type I/O Port, range 32, base 0xf400, size  8, enabled
    bar   [1c] = type I/O Port, range 32, base 0xf000, size  4, enabled
    bar   [20] = type I/O Port, range 32, base 0xec00, size 16, enabled
    bar   [24] = type Memory, range 32, base 0xdffff000, size 1024, enabled
    cap 01[c0] = powerspec 2  supports D0 D3  current D0
    cap 05[e0] = MSI supports 1 message
atapci1@pci0:0:15:1:    class=0x01018a card=0xaa0e1106 chip=0x05711106 rev=0x07 hdr=0x00
    vendor     = 'VIA Technologies, Inc.'
    device     = 'Bus Master IDE Controller (VT82C686B/VT823x/A/C)'
    class      = mass storage
    subclass   = ATA
    bar   [20] = type I/O Port, range 32, base 0xe800, size 16, enabled
    cap 01[c0] = powerspec 2  supports D0 D3  current D0

isab0@pci0:0:17:0:      class=0x060100 card=0xaa0e1106 chip=0x32871106 rev=0x00 hdr=0x00
    vendor     = 'VIA Technologies, Inc.'
    device     = 'VT8251 Standard PCI to ISA Bridge'
    class      = bridge
    subclass   = PCI-ISA
    cap 01[c0] = powerspec 2  supports D0 D3  current D0
hostb6@pci0:0:17:7:     class=0x060000 card=0x287e1106 chip=0x287e1106 rev=0x00 hdr=0x00
    vendor     = 'VIA Technologies, Inc.'
    device     = 'VT8251 Ultra VLINK Controller'
    class      = bridge
    subclass   = HOST-PCI
    cap 08[58] = HT interrupt
hostb7@pci0:0:19:0:     class=0x060000 card=0x00000000 chip=0x287b1106 rev=0x00 hdr=0x00
    vendor     = 'VIA Technologies, Inc.'
    device     = 'VT8251 Standard PCI to PCIe Bridge'
    class      = bridge
    subclass   = HOST-PCI
pcib2@pci0:0:19:1:      class=0x060401 card=0x00000000 chip=0x287a1106 rev=0x00 hdr=0x01
    vendor     = 'VIA Technologies, Inc.'
    device     = 'VT8251 Standard PCI to PCI Bridge'
    class      = bridge
    subclass   = PCI-PCI

pcib4@pci0:128:0:0:     class=0x060400 card=0x287c1106 chip=0x287c1106 rev=0x00 hdr=0x01
    vendor     = 'VIA Technologies, Inc.'
    device     = 'VT8251 Standard PCIe Root Port'
    class      = bridge
    subclass   = PCI-PCI
    cap 10[40] = PCI-Express 1 root port max data 128(128) link x1(x1)
    cap 01[68] = powerspec 2  supports D0 D3  current D0
    cap 05[70] = MSI supports 1 message, 64 bit
    cap 08[88] = HT MSI fixed address window disabled at 0xfee00000
    cap 0d[90] = PCI Bridge card=0x287c1106
pcib5@pci0:128:0:1:     class=0x060400 card=0x287d1106 chip=0x287d1106 rev=0x00 hdr=0x01
    vendor     = 'VIA Technologies, Inc.'
    device     = 'VT8251 Standard PCIe Root Port'
    class      = bridge
    subclass   = PCI-PCI
    cap 10[40] = PCI-Express 1 root port max data 128(128) link x1(x1)
    cap 01[68] = powerspec 2  supports D0 D3  current D0
    cap 05[70] = MSI supports 1 message, 64 bit
    cap 08[88] = HT MSI fixed address window disabled at 0xfee00000
    cap 0d[90] = PCI Bridge card=0x287d1106

atapci2@pci0:130:0:0:   class=0x01048f card=0x00000000 chip=0x614511ab rev=0xa1 hdr=0x00
    vendor     = 'Marvell Semiconductor (Was: Galileo Technology Ltd)'
    device     = 'Add-on IC to provide 4x SATA Ports, attached to ICH7 (SthBridge?) via PCI-Express. (88SE6145)'
    class      = mass storage
    subclass   = RAID
    bar   [10] = type I/O Port, range 32, base 0x9c00, size  8, enabled
    bar   [14] = type I/O Port, range 32, base 0x9800, size  4, enabled
    bar   [18] = type I/O Port, range 32, base 0x9400, size  8, enabled
    bar   [1c] = type I/O Port, range 32, base 0x9000, size  4, enabled
    bar   [20] = type I/O Port, range 32, base 0x8c00, size 16, enabled
    bar   [24] = type Memory, range 32, base 0xd3dff000, size 1024, enabled
    cap 01[48] = powerspec 2  supports D0 D1 D3  current D0
    cap 05[50] = MSI supports 1 message
    cap 10[e0] = PCI-Express 1 legacy endpoint max data 128(128) link x1(x1)
```


----------



## mav@ (Nov 4, 2010)

That sounds strange. I haven't tested that specific model, but as soon as AHCI driver detects it - It should work. I would recommend you to try also new ahci(4) driver. It should support the SATA part of that chip, combining with ata(4) for PATA.


----------



## ers (Nov 4, 2010)

Yes, it is very strange and for this reason I ask for help here... Hardware is recognised but it is probably _recognized wrong_. I think the problem could be in wrong recognition by ahci driver (SX not SE model). This board has available only 4 SATA connectors and PATA is not used (no connector).

Could you be more specific about *new ahci driver* and ata? What do you suggest? How to test it? How to enable it?

If you mean kldload and "pci/ata_marvell" then it is loaded and "atapci/ata_ahci_ata" and also "ataraid" and "mpt"raid"...

For now there is no data there so I can make some more tests. Let us take advantage of this...


```
# kldstat
Id Refs Address    Size     Name
 1    1 0xc0400000 bb5504   kernel (/boot/kernel/kernel)


# kldstat -v | grep ahci
                70 pci/ata_ahci
                69 atapci/ata_ahci_ata


# kldstat -v |grep ata
                94 ataraid
                64 ata
                93 ata/ad
                92 pci/ata_via
                91 pci/ata_sis
                90 pci/ata_sii
                89 pci/ata_serverworks
                88 pci/ata_promise
                87 pci/ata_nvidia
                86 pci/ata_netcell
                85 pci/ata_national
                84 pci/ata_micron
                83 pci/ata_marvell
                82 pci/ata_jmicron
                81 pci/ata_ite
                80 pci/ata_intel
                79 pci/ata_highpoint
                78 pci/ata_cyrix
                77 pci/ata_cypress
                76 pci/ata_cenatek
                75 pci/ata_ati
                74 pci/ata_amd
                73 pci/ata_adaptec
                72 pci/ata_ali
                71 pci/ata_acard
                70 pci/ata_ahci
                69 atapci/ata_ahci_ata
                68 pci/atapci
                67 atapci/ata
                66 isa/ata
                65 pccard/ata
                98 ata/ast
                97 ata/afd
                96 ata/acd


#kldstat -v |grep raid
                94 ataraid
                205 mpt_raid
```


----------



## mav@ (Nov 4, 2010)

AHCI driver doesn't need to know specific controller, unless one violates the standard. I have no idea about SX/SE difference and I have never tested 88SE6145. I just assumed it is the same as 88SX6121 I have, just with 4 SATA ports.

ahci(4) driver is separate kernel module. In case of this controller, as it doesn't declares AHCI compatibility correctly, it can attach on top of atamarvell driver instead of ataahci. You should be ready that using ahci(4) instead of ataahci will use completely different ATA infrastructure for these disks. Main external difference - respective disk devices will be named as adaX instead of adX.


----------



## ers (Nov 4, 2010)

```
ahci_load="YES"
```
 in loader.conf loaded new ahci driver and then adaX drives appeared fully accesible.

Thanks, this solved my problem.


----------

