[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

SOLVED Re: TS-219P eSATA not available



On Sat, 2009-08-08 at 13:37 +0200, John Holland wrote:
> Hi,
>
> the attempt to connect a eSATA external disk on the hardware failed.
>
> According to Martins' web page concerning the hardware, it uses the chip
> JMB362 PCI Express to SATA II Host Controller for external disks access.
> Performing a 'lspci' reveled that the PCIe channel is not active and
> seems PCI is not being properly initialized.
>
> Does anyone know how to patch the kernel to enable PCI and thus allowing
> the system to identify the discrete SATA Controler?
>

Actually it was quite simple:

enable pcie on the TS-219P
-- snip exclusively --
--- linux-source-2.6.30/arch/arm/mach-kirkwood/ts219-setup.c	2009-06-10 05:05:27.000000000 +0200
+++ linux-source-2.6.30.new/arch/arm/mach-kirkwood/ts219-setup.c	2009-08-08 20:12:24.000000000 +0200
@@ -206,6 +206,15 @@

 }

+static int __init ts219_pci_init(void)
+{
+	if (machine_is_ts219())
+		kirkwood_pcie_init();
+
+	return 0;
+}
+subsys_initcall(ts219_pci_init);
+
 MACHINE_START(TS219, "QNAP TS-119/TS-219")
 	/* Maintainer: Martin Michlmayr <tbm@cyrius.com> */
 	.phys_io	= KIRKWOOD_REGS_PHYS_BASE,
-- snip exclusively --

allow the kernel to setup the eSATA chip
-- snip exclusively --
--- /boot/config-2.6.30-bpo.1-kirkwood	2009-07-20 12:08:36.000000000 +0200
+++ /boot/config-2.6.30-bpopci.1-kirkwood	2009-08-09 12:04:33.000000000 +0200
@@ -1096,7 +1097,7 @@
 CONFIG_ATA=m
 # CONFIG_ATA_NONSTANDARD is not set
 CONFIG_SATA_PMP=y
-# CONFIG_SATA_AHCI is not set
+CONFIG_SATA_AHCI=m
 # CONFIG_SATA_SIL24 is not set
 CONFIG_ATA_SFF=y
 # CONFIG_SATA_SVW is not set
-- snip exclusively --

$ uname -a
Linux georgia 2.6.30-bpopci.1-kirkwood #1 Sun Aug 9 12:48:48 CEST 2009 armv5tel GNU/Linux

$ dmesg
[    0.240000] pci 0000:00:00.0: reg 10 64bit mmio: [0xf1000000-0xf10fffff]
[    0.240000] pci 0000:00:00.0: reg 18 32bit mmio: [0x000000-0x1fffffff]
[    0.240000] pci 0000:00:00.0: supports D1 D2
[    0.240000] pci 0000:00:01.0: reg 24 32bit mmio: [0x40000000-0x40001fff]
[    0.240000] pci 0000:00:01.0: reg 30 32bit mmio: [0x000000-0x00ffff]
[    0.240000] pci 0000:00:01.0: PME# supported from D3hot
[    0.240000] pci 0000:00:01.0: PME# disabled
[    0.240000] pci 0000:00:01.1: reg 10 io port: [0xfff8-0xffff]
[    0.240000] pci 0000:00:01.1: reg 14 io port: [0xfffc-0xffff]
[    0.240000] pci 0000:00:01.1: reg 18 io port: [0xfff8-0xffff]
[    0.240000] pci 0000:00:01.1: reg 1c io port: [0xfffc-0xffff]
[    0.240000] pci 0000:00:01.1: reg 20 io port: [0xfff0-0xffff]
[    0.240000] PCI: bus0: Fast back to back transfers disabled
[    0.240000] pci 0000:00:01.1: BAR 4: error updating (0xf2000001 != 0x000001)
[    0.240000] pci 0000:00:01.1: BAR 0: error updating (0xf2000011 != 0x000011)
[    0.240000] pci 0000:00:01.1: BAR 2: error updating (0xf2000019 != 0x000019)
[    0.240000] pci 0000:00:01.1: BAR 1: error updating (0xf2000021 != 0x000021)
[    0.240000] pci 0000:00:01.1: BAR 3: error updating (0xf2000025 != 0x000025)
--snip--
[   16.880000] ahci 0000:00:01.0: version 3.0
[   16.900000] ahci 0000:00:01.0: AHCI 0001.0000 32 slots 2 ports 3 Gbps 0x3 impl SATA mode
[   16.900000] ahci 0000:00:01.0: flags: 64bit ncq pm led clo pmp pio slum part
[   17.060000] scsi2 : ahci
[   17.060000] scsi3 : ahci
[   17.060000] ata3: SATA max UDMA/133 abar m8192@0xe0010000 port 0xe0010100 irq 9
[   17.070000] ata4: SATA max UDMA/133 abar m8192@0xe0010000 port 0xe0010180 irq 9
[   17.490000] ata3: SATA link down (SStatus 0 SControl 300)
[   17.490000] ata4: SATA link down (SStatus 0 SControl 300)
--snip--
[  632.040000] ata4: exception Emask 0x10 SAct 0x0 SErr 0x4050000 action 0xe frozen
[  632.050000] ata4: irq_stat 0x00400040, connection status changed
[  632.050000] ata4: SError: { PHYRdyChg CommWake DevExch }
[  632.060000] ata4: hard resetting link
[  636.110000] ata4: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
[  636.110000] ata4.00: ATA-7: ST9200420AS, 3.AAA, max UDMA/133
[  636.120000] ata4.00: 390721968 sectors, multi 0: LBA48 NCQ (depth 31/32)
[  636.130000] ata4.00: configured for UDMA/133
[  636.130000] ata4: EH complete
[  636.130000] scsi 3:0:0:0: Direct-Access     ATA      ST9200420AS      3.AA PQ: 0 ANSI: 5
[  636.150000] sd 3:0:0:0: [sdc] 390721968 512-byte hardware sectors: (200 GB/186 GiB)
[  636.160000] sd 3:0:0:0: [sdc] Write Protect is off
[  636.160000] sd 3:0:0:0: [sdc] Mode Sense: 00 3a 00 00
[  636.160000] sd 3:0:0:0: [sdc] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[  636.170000]  sdc: sdc1
[  636.200000] sd 3:0:0:0: [sdc] Attached SCSI disk
[  756.540000] kjournald starting.  Commit interval 5 seconds
[  756.540000] EXT3 FS on sdc1, internal journal
[  756.550000] EXT3-fs: mounted filesystem with ordered data mode.


$ sudo lspci -v -v
00:00.0 Memory controller: Marvell Technology Group Ltd. Device 6281 (rev 02)
	Subsystem: Marvell Technology Group Ltd. Device 11ab
	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, Cache Line Size: 32 bytes
	Interrupt: pin A routed to IRQ 9
	Region 0: Memory at <ignored> (64-bit, prefetchable)
	Capabilities: [40] Power Management version 3
		Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot-,D3cold-)
		Status: D0 PME-Enable- DSel=0 DScale=0 PME-
	Capabilities: [50] Message Signalled Interrupts: Mask- 64bit+ Queue=0/0 Enable-
		Address: 0000000000000000  Data: 0000
	Capabilities: [60] Express (v1) Root Port (Slot-), MSI 00
		DevCap:	MaxPayload 128 bytes, PhantFunc 0, Latency L0s <256ns, L1 <1us
			ExtTag- 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 2.5GT/s, Width x1, ASPM L0s L1, Latency L0 <256ns, L1 unlimited
			ClockPM+ Suprise- LLActRep- BwNot-
		LnkCtl:	ASPM Disabled; RCB 128 bytes Disabled- Retrain- CommClk-
			ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt-
		LnkSta:	Speed 2.5GT/s, Width x1, TrErr- Train- SlotClk+ DLActive- BWMgmt- ABWMgmt-
		RootCtl: ErrCorrectable- ErrNon-Fatal- ErrFatal- PMEIntEna- CRSVisible-
		RootCap: CRSVisible-
		RootSta: PME ReqID 0000, PMEStatus- PMEPending-
	Capabilities: [100] Advanced Error Reporting <?>

00:01.0 SATA controller: JMicron Technologies, Inc. JMicron 20360/20363 AHCI Controller (rev 03) (prog-if 01 [AHCI 1.0])
	Subsystem: JMicron Technologies, Inc. JMicron 20360/20363 AHCI 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-
	Latency: 0, Cache Line Size: 32 bytes
	Interrupt: pin A routed to IRQ 9
	Region 5: Memory at e0010000 (32-bit, non-prefetchable) [size=8K]
	[virtual] Expansion ROM at e0000000 [disabled] [size=64K]
	Capabilities: [68] Power Management version 2
		Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot+,D3cold-)
		Status: D0 PME-Enable- DSel=0 DScale=0 PME-
	Capabilities: [50] Express (v1) Legacy Endpoint, MSI 01
		DevCap:	MaxPayload 128 bytes, PhantFunc 0, Latency L0s <64ns, L1 <1us
			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 #1, Speed 2.5GT/s, Width x1, ASPM L0s, Latency L0 unlimited, L1 unlimited
			ClockPM- Suprise- LLActRep- BwNot-
		LnkCtl:	ASPM Disabled; RCB 64 bytes Disabled- Retrain- CommClk-
			ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt-
		LnkSta:	Speed 2.5GT/s, Width x1, TrErr- Train- SlotClk+ DLActive- BWMgmt- ABWMgmt-
	Kernel driver in use: ahci
	Kernel modules: ahci

00:01.1 IDE interface: JMicron Technologies, Inc. JMicron 20360/20363 AHCI Controller (rev 03) (prog-if 85 [Master SecO PriO])
	Subsystem: JMicron Technologies, Inc. JMicron 20360/20363 AHCI 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 B routed to IRQ 9
	Region 0: I/O ports at f2000010 [disabled] [size=8]
	Region 1: I/O ports at f2000020 [disabled] [size=4]
	Region 2: I/O ports at f2000018 [disabled] [size=8]
	Region 3: I/O ports at f2000024 [disabled] [size=4]
	Region 4: I/O ports at f2000000 [disabled] [size=16]
	Capabilities: [68] Power Management version 2
		Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot-,D3cold-)
		Status: D0 PME-Enable- DSel=0 DScale=0 PME-


$ lsmod
Module                  Size  Used by
ipv6                  285076  28
nfsd                  258156  9
exportfs                4184  1 nfsd
nfs                   283992  0
lockd                  72668  2 nfsd,nfs
fscache                42200  1 nfs
nfs_acl                 3396  2 nfsd,nfs
auth_rpcgss            39708  2 nfsd,nfs
sunrpc                199420  10 nfsd,nfs,lockd,nfs_acl,auth_rpcgss
ext2                   63784  1
loop                   14972  0
evdev                   9284  1
mv643xx_eth            26096  0
ehci_hcd               34048  0
libphy                 23012  1 mv643xx_eth
usbcore               137416  2 ehci_hcd
gpio_keys               4104  0
ahci                   28692  1
ext3                  124384  8
jbd                    46804  1 ext3
mbcache                 8216  2 ext2,ext3
raid1                  22036  8
raid0                   7392  1
md_mod                 91700  11 raid1,raid0
sd_mod                 34408  22
crc_t10dif              1880  1 sd_mod
sata_mv                29184  18
libata                169172  2 ahci,sata_mv
scsi_mod              151452  2 sd_mod,libata

$ sudo hdparm -Tt /dev/sdc1
/dev/sdc1:
 Timing cached reads:   628 MB in  2.00 seconds = 313.50 MB/sec
 Timing buffered disk reads:  184 MB in  3.00 seconds =  61.28 MB/sec

$ dd if=/dev/zero of=test.file bs=$((1024*1024*256)) count=8
8+0 records in
8+0 records out
2147483648 bytes (2.1 GB) copied, 42.986 s, 50.0 MB/s

$ dd of=/dev/null if=test.file bs=$((1024*1024*256)) count=8
8+0 records in
8+0 records out
2147483648 bytes (2.1 GB) copied, 33.9106 s, 63.3 MB/s


I don't know if the ts-219 init patch above will adversely effect the
TS-[12]19 hardware; on the TS-219P it seems to be working;)



>
> TIA,
>
> John
>
> ___________________________________________
>
> Cellent Finance Solutions AG
>
> Firmensitz: Calwer Straße 33, 70173 Stuttgart
> Registergericht: Amtsgericht Stuttgart, HRB 720743
> Vorstand: Thomas Wild
> Vorsitzender des Aufsichtsrats: Rudolf Zipf

___________________________________________

Cellent Finance Solutions AG

Firmensitz: Calwer Straße 33, 70173 Stuttgart
Registergericht: Amtsgericht Stuttgart, HRB 720743
Vorstand: Thomas Wild
Vorsitzender des Aufsichtsrats: Rudolf Zipf


Reply to: