Help with getting a Marvell 9230 to work
#1
Hey all,

I recently got a RockPro64 and installed the Armbian Desktop image to it. 

I want to use this as a NAS, so I bought a iocrest marvell 9230 sata card (non raid) but I'm not sure about how I get it to work. Are there any drivers or settings I need to change? None of the drives I'm plugging into it are being read. Right now when I type lspci into the terminal I get this 
Quote:01:00.0 SATA controller: Marvell Technology Group Ltd. 88SE9230 PCIe SATA 6Gb/s Controller (rev 11)

and when I try to get more info using lspci -vvv I get 

Quote:root@localhost:~# lspci -vvv
00:00.0 PCI bridge: Device 1d87:0100 (prog-if 00 [Normal decode])
Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx+
Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
Latency: 0
Interrupt: pin A routed to IRQ 244
Bus: primary=00, secondary=01, subordinate=01, sec-latency=0
I/O behind bridge: 00000000-00000fff
Memory behind bridge: fa000000-fa0fffff
Prefetchable memory behind bridge: 00000000-000fffff
Secondary status: 66MHz- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- <SERR- <PERR-
BridgeCtl: Parity- SERR- NoISA- VGA- MAbort- >Reset- FastB2B-
PriDiscTmr- SecDiscTmr- DiscTmrStat- DiscTmrSERREn-
Capabilities: [80] Power Management version 3
Flags: PMEClk- DSI- D1+ D2- AuxCurrent=0mA PME(D0+,D1+,D2-,D3hot+,D3cold-)
Status: D0 NoSoftRst+ PME-Enable- DSel=0 DScale=0 PME-
Capabilities: [90] MSI: Enable+ Count=1/1 Maskable+ 64bit+
Address: 00000000fee30040  Data: 0000
Masking: 00000000  Pending: 00000000
Capabilities: [b0] MSI-X: Enable- Count=1 Masked-
Vector table: BAR=0 offset=00000000
PBA: BAR=0 offset=00000008
Capabilities: [c0] Express (v2) Root Port (Slot+), MSI 00
DevCap: MaxPayload 256 bytes, PhantFunc 0
ExtTag- RBE+
DevCtl: Report errors: Correctable+ Non-Fatal+ Fatal+ Unsupported+
RlxdOrd+ ExtTag- PhantFunc- AuxPwr- NoSnoop+
MaxPayload 128 bytes, MaxReadReq 512 bytes
DevSta: CorrErr- UncorrErr- FatalErr- UnsuppReq- AuxPwr- TransPend-
LnkCap: Port #0, Speed 5GT/s, Width x4, ASPM L1, Exit Latency L0s <256ns, L1 <8us
ClockPM- Surprise- LLActRep- BwNot+ ASPMOptComp+
LnkCtl: ASPM Disabled; RCB 128 bytes Disabled- CommClk+
ExtSynch- ClockPM- AutWidDis- BWInt+ AutBWInt+
LnkSta: Speed 2.5GT/s, Width x1, TrErr- Train- SlotClk+ DLActive- BWMgmt- ABWMgmt-
SltCap: AttnBtn- PwrCtrl- MRL- AttnInd- PwrInd- HotPlug- Surprise-
Slot #0, PowerLimit 0.000W; Interlock- NoCompl-
SltCtl: Enable: AttnBtn- PwrFlt- MRL- PresDet- CmdCplt- HPIrq- LinkChg-
Control: AttnInd Off, PwrInd Off, Power+ Interlock-
SltSta: Status: AttnBtn- PowerFlt- MRL+ CmdCplt- PresDet- Interlock-
Changed: MRL- PresDet- LinkState-
RootCtl: ErrCorrectable- ErrNon-Fatal- ErrFatal- PMEIntEna+ CRSVisible-
RootCap: CRSVisible-
RootSta: PME ReqID 0000, PMEStatus- PMEPending-
DevCap2: Completion Timeout: Range B, TimeoutDis+, LTR+, OBFF Via message ARIFwd+
DevCtl2: Completion Timeout: 50us to 50ms, TimeoutDis-, LTR-, OBFF Disabled ARIFwd-
LnkCtl2: Target Link Speed: 2.5GT/s, EnterCompliance- SpeedDis-
Transmit Margin: Normal Operating Range, EnterModifiedCompliance- ComplianceSOS-
Compliance De-emphasis: -6dB
LnkSta2: Current De-emphasis Level: -3.5dB, EqualizationComplete-, EqualizationPhase1-
EqualizationPhase2-, EqualizationPhase3-, LinkEqualizationRequest-
Capabilities: [100 v2] Advanced Error Reporting
UESta: DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt- UnxCmplt- RxOF- MalfTLP- ECRC- UnsupReq- ACSViol-
UEMsk: DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt- UnxCmplt- RxOF- MalfTLP- ECRC- UnsupReq- ACSViol-
UESvrt: DLP+ SDES+ TLP- FCP+ CmpltTO- CmpltAbrt- UnxCmplt- RxOF+ MalfTLP+ ECRC- UnsupReq- ACSViol-
CESta: RxErr- BadTLP- BadDLLP- Rollover- Timeout- NonFatalErr-
CEMsk: RxErr- BadTLP- BadDLLP- Rollover- Timeout- NonFatalErr+
AERCap: First Error Pointer: 00, GenCap+ CGenEn- ChkCap+ ChkEn-
Capabilities: [274 v1] Transaction Processing Hints
Interrupt vector mode supported
Device specific mode supported
Steering table in TPH capability structure
Kernel driver in use: pcieport

01:00.0 SATA controller: Marvell Technology Group Ltd. 88SE9230 PCIe SATA 6Gb/s Controller (rev 11) (prog-if 01 [AHCI 1.0])
Subsystem: Marvell Technology Group Ltd. 88SE9230 PCIe SATA 6Gb/s Controller
Control: I/O+ Mem+ BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
Interrupt: pin A routed to IRQ 243
Region 0: I/O ports at 0000
Region 1: I/O ports at 0000
Region 2: I/O ports at 0000
Region 3: I/O ports at 0000
Region 4: I/O ports at 0000
Region 5: Memory at fa040000 (32-bit, non-prefetchable) [size=2K]
Expansion ROM at fa000000 [size=256K]
Capabilities: [40] Power Management version 3
Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot+,D3cold-)
Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-
Capabilities: [50] MSI: Enable- Count=1/1 Maskable- 64bit-
Address: fee30040  Data: 0000
Capabilities: [70] Express (v2) Legacy Endpoint, MSI 00
DevCap: MaxPayload 512 bytes, PhantFunc 0, Latency L0s <1us, L1 <8us
ExtTag- AttnBtn- AttnInd- PwrInd- RBE+ FLReset-
DevCtl: Report errors: Correctable- Non-Fatal- Fatal- Unsupported-
RlxdOrd+ ExtTag- PhantFunc- AuxPwr- NoSnoop-
MaxPayload 128 bytes, MaxReadReq 512 bytes
DevSta: CorrErr- UncorrErr- FatalErr- UnsuppReq- AuxPwr- TransPend-
LnkCap: Port #0, Speed 5GT/s, Width x2, ASPM L0s L1, Exit Latency L0s <512ns, L1 <64us
ClockPM- Surprise- LLActRep- BwNot- ASPMOptComp-
LnkCtl: ASPM Disabled; RCB 64 bytes Disabled- CommClk+
ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt-
LnkSta: Speed 2.5GT/s, Width x1, TrErr- Train- SlotClk+ DLActive- BWMgmt- ABWMgmt-
DevCap2: Completion Timeout: Not Supported, TimeoutDis+, LTR-, OBFF Not Supported
DevCtl2: Completion Timeout: 50us to 50ms, TimeoutDis-, LTR-, OBFF Disabled
LnkCtl2: Target Link Speed: 5GT/s, EnterCompliance- SpeedDis-
Transmit Margin: Normal Operating Range, EnterModifiedCompliance- ComplianceSOS-
Compliance De-emphasis: -6dB
LnkSta2: Current De-emphasis Level: -3.5dB, EqualizationComplete-, EqualizationPhase1-
EqualizationPhase2-, EqualizationPhase3-, LinkEqualizationRequest-
Capabilities: [e0] SATA HBA v0.0 BAR4 Offset=00000004
Capabilities: [100 v1] Advanced Error Reporting
UESta: DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt- UnxCmplt- RxOF- MalfTLP- ECRC- UnsupReq- ACSViol-
UEMsk: DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt- UnxCmplt- RxOF- MalfTLP- ECRC- UnsupReq- ACSViol-
UESvrt: DLP+ SDES+ TLP- FCP+ CmpltTO- CmpltAbrt- UnxCmplt- RxOF+ MalfTLP+ ECRC- UnsupReq- ACSViol-
CESta: RxErr- BadTLP- BadDLLP- Rollover- Timeout- NonFatalErr-
CEMsk: RxErr- BadTLP- BadDLLP- Rollover- Timeout- NonFatalErr+
AERCap: First Error Pointer: 00, GenCap- CGenEn- ChkCap- ChkEn-


I'm seeing malfunctions and errors but I really don't know what they mean. 

Any help would be super appreciated!
#2
9230 controller seems to need a udev rule to do AHCI binding. There's some info about it in PCI-E add-on Success & Failures
thread:

(09-09-2018, 12:02 PM)xtract Wrote: I have been able run  a sata card based on Marvell 88SE9230, with 4 ports.

...

To get the rp64 I had to manually bind the ahci driver to the pcie card, adding a udev rule:

Code:
root@rockpro64:~# cat /etc/udev/rules.d/99-marvell.rules 
RUN+="/bin/bash -c 'echo 0000:01:00.0 > /sys/bus/pci/drivers/ahci/bind'"

You could try that. I have a bit different rule myself but essentially it does the same thing. It activates only when Marvell 9230 controller is found. Works in Ubuntu, maybe in Armbian too.
Code:
$ cat /etc/udev/rules.d/99-marvell.rules
ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x1b4b", ATTR{device}=="0x9230", RUN+="/bin/bash -c 'echo %k > /sys/bus/pci/drivers/ahci/bind'"
#3
(05-05-2019, 01:37 AM)nuumio Wrote: 9230 controller seems to need a udev rule to do AHCI binding. There's some info about it in PCI-E add-on Success & Failures
thread:

(09-09-2018, 12:02 PM)xtract Wrote: I have been able run  a sata card based on Marvell 88SE9230, with 4 ports.

...

To get the rp64 I had to manually bind the ahci driver to the pcie card, adding a udev rule:

Code:
root@rockpro64:~# cat /etc/udev/rules.d/99-marvell.rules 
RUN+="/bin/bash -c 'echo 0000:01:00.0 > /sys/bus/pci/drivers/ahci/bind'"

You could try that. I have a bit different rule myself but essentially it does the same thing. It activates only when Marvell 9230 controller is found. Works in Ubuntu, maybe in Armbian too.
Code:
$ cat /etc/udev/rules.d/99-marvell.rules
ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x1b4b", ATTR{device}=="0x9230", RUN+="/bin/bash -c 'echo %k > /sys/bus/pci/drivers/ahci/bind'"


Yeah! I saw that in my research, but I still had a couple questions. I don't have that file in my udev folder though. Is it something I need to create myself? And if so, is there any content inside of that file, or is it just blank? I've switched to Ubuntu because it seems like that has more support for the marvell chips. 

Thank you for the help as well!
#4
(05-05-2019, 08:31 AM)epoliqui Wrote: Yeah! I saw that in my research, but I still had a couple questions. I don't have that file in my udev folder though. Is it something I need to create myself? And if so, is there any content inside of that file, or is it just blank? I've switched to Ubuntu because it seems like that has more support for the marvell chips. 

You'll have to create that file and then copy/paste this one line into it:

Code:
ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x1b4b", ATTR{device}=="0x9230", RUN+="/bin/bash -c 'echo %k > /sys/bus/pci/drivers/ahci/bind'"

Edit: Adding the line above /etc/udev/rules.d/99-marvell.rules will make the change permanent.


If you want to try and see if it will help you can run following in terminal (this won't work over reboot, but should work immediately in current session):
Code:
echo "0000:01:00.0" | sudo tee /sys/bus/pci/drivers/ahci/bind
#5
So the sata controller is being recognized, and I'm assuming it works, but none of my hard drives are working with this.

Using lsblk I get no hard drives, only my emmc and ram. 

lspci gives me 

Quote:01:00.0 SATA controller: Marvell Technology Group Ltd. 88SE9230 PCIe SATA 6Gb/s Controller (rev 11)

    Subsystem: Marvell Technology Group Ltd. 88SE9230 PCIe SATA 6Gb/s Controller
    Flags: bus master, fast devsel, latency 0, IRQ 231
    I/O ports at 0000
    I/O ports at 0000
    I/O ports at 0000
    I/O ports at 0000
    I/O ports at 0000
    Memory at fa010000 (32-bit, non-prefetchable)
    Expansion ROM at fa000000 [disabled]
    Capabilities: <access denied>
    Kernel driver in use: ahci

I've tried using the sata controller in my PC, along with the hard drives and sata cables, and it all seems to be working fine. It's just not working on my rp64. 

I've moved onto the most recent build of ayufan's ubuntu minimal.
#6
I have similar problem, this is my 88SE9230:
Code:
01:00.0 SATA controller: Marvell Technology Group Ltd. 88SE9230 PCIe SATA 6Gb/s Controller (rev 11) (prog-if 01 [AHCI 1.0])
       Subsystem: Marvell Technology Group Ltd. 88SE9230 PCIe SATA 6Gb/s Controller
       Flags: bus master, fast devsel, latency 0, IRQ 247
       I/O ports at 0000
       I/O ports at 0000
       I/O ports at 0000
       I/O ports at 0000
       I/O ports at 0000
       Memory at fa040000 (32-bit, non-prefetchable) [size=2K]
       Expansion ROM at fa000000 [size=256K]
       Capabilities: [40] Power Management version 3
       Capabilities: [50] MSI: Enable+ Count=1/1 Maskable- 64bit-
       Capabilities: [70] Express Legacy Endpoint, MSI 00
       Capabilities: [e0] SATA HBA v0.0
       Capabilities: [100] Advanced Error Reporting
       Kernel driver in use: ahci


And it can't recognize my disks, lsblk also show me only SD card, i use OpenMediaVault stretch armhf
Someone know what is wrong?

I found solution, i updated to newest ayufan kernel 5 and my disk is visible and working all good, pls try:
look at:
https://github.com/ayufan-rock64/linux-b...upgrade.md

You can use releases (not pre-releases) so skip first step.
#7
Great tips! 
I have been fighting with my St-labs A-520 sata controller based on the 9230 chipset and was just about to give up when I saw your post! 
Updating to kernel 5.1 solved all the problems I had with the board!
Now rocking 2x Toshiba N300 6TB NAS drives in RAID 1 and 1x crucial 120GB ssd as a quicker drive for websites and other services.
Amazing how it now just works
Linux newbie learning programming as a hobby!

Pinebook Pro running bionic ubuntu
Rockpro64 4gb v2.1 in the NAS enclosure running omv
Rock64 1gb as a retrogaming station

#8
(07-12-2019, 12:18 PM)Meatball Wrote: Great tips! 
I have been fighting with my St-labs A-520 sata controller based on the 9230 chipset and was just about to give up when I saw your post! 
Updating to kernel 5.1 solved all the problems I had with the board!
Now rocking 2x Toshiba N300 6TB NAS drives in RAID 1 and 1x crucial 120GB ssd as a quicker drive for websites and other services.
Amazing how it now just works

Hi Meatball,

Could you tell me which is the exact kernel you're using ?
I have a sata controller based on the 9230 chipset too.
I've installed this one: linux-image-5.1.0-1114-ayufan-g097e5be61be4 in Openmediavault 5 but I still don't see my HDD.

With Ayufan's kernel and Openmediavault 5 using the last Ayufan's pre-release (0.10.12) : it's not working
With Ayufan's kernel 5.6 and Openmediavault 4 using the last Ayufan's Release (0.9.14): it's working.
What I mean by working: the system see the HDD.
All these tests have been made with the Pine's PSU.

Thank you.
Music Lover first.
IT Lover second.
RockPro64 owner 4G with WD Red 4T
#9
(05-05-2019, 09:57 AM)nuumio Wrote: Yeah! I saw that in my research, but I still had a couple questions. I don't have that file in my udev folder though. Is it something I need to create myself? And if so, is there any content inside of that file, or is it just blank? I've switched to Ubuntu because it seems like that has more support for the marvell chips. 

You'll have to create that file and then copy/paste this one line into it:

Code:
ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x1b4b", ATTR{device}=="0x9230", RUN+="/bin/bash -c 'echo %k > /sys/bus/pci/drivers/ahci/bind'"

Edit: Adding the line above /etc/udev/rules.d/99-marvell.rules will make the change permanent.

This method worked with Ayufan's kernel and Openmediavault 5 using the last Ayufan's pre-release (0.10.12).
Music Lover first.
IT Lover second.
RockPro64 owner 4G with WD Red 4T
#10
For the record, Debian unstable now supports the Marvell 88SE9235, so I expect the 9230 is probably supported as well. Tested with kernel 5.7.10. No custom udev rule required.


Possibly Related Threads…
Thread Author Replies Views Last Post
  Sata Raid Marvell 4port 9235 stuartiannaylor 1 3,074 07-04-2019, 08:12 PM
Last Post: stuartiannaylor
  Getting any IR remote to work with the RockPro64 ? michbucanon 0 2,351 05-15-2019, 03:47 AM
Last Post: michbucanon

Forum Jump:


Users browsing this thread: 1 Guest(s)