Re: Realtek RTS5209 (was: Re: Intel AHCI RAID controller in Sony VAIO Z23 laptop)

2012-05-31 Thread Dave Anderson
On Thu, 31 May 2012, Stefan Sperling wrote:

>On Thu, May 31, 2012 at 10:53:22AM +0200, Paul de Weerd wrote:
>> I've recently bought a new Sony laptop, VPCZ23C5E.  Some things on
>> this machine work fine (sound, suspend, wired network), some things
>> don't (X, resume, wireless).
>
>I suppose the card reader won't work either:
>
>> "Realtek RTS5209 Card Reader" rev 0x01 at pci2 dev 0 function 0 not 
>> configured
>
>I have exactly this chip in a new laptop and am trying to write a driver
>for it based on information from the linux driver.
>I haven't got it working yet but I'll send you a diff once I have
>something to show.
>
>It's not an easy task for me and progress is somewhat slower than
>I expected so if anyone wants to help that would be great.

I've got one of those too, and can help with testing and perhaps in
other ways: while I've no experience (other than some code-reading) with
BSD internals I have done driver/internals work on a couple of other
systems.

Dave

-- 
Dave Anderson




Re: Intel AHCI RAID controller in Sony VAIO Z23 laptop

2012-05-31 Thread Mike Belopuhov
On Thu, May 31, 2012 at 10:53 +0200, Paul de Weerd wrote:
> I've recently bought a new Sony laptop, VPCZ23C5E.  Some things on
> this machine work fine (sound, suspend, wired network), some things
> don't (X, resume, wireless).  One of the problems I have is that
> -current doesn't find any disks behind the pciide(4), which is a
> "Intel 82081HBM RAID".  sthen@ suggested I revert 1.163 of
> dev/pci/ahci.c, which was the clue I needed to getting things working.
> 
> I built a kernel with the following diff applied:
> 
> Index: ahci.c
> ===
> RCS file: /cvs/src/sys/dev/pci/ahci.c,v
> retrieving revision 1.188
> diff -u -r1.188 ahci.c
> --- ahci.c5 May 2012 10:10:12 -   1.188
> +++ ahci.c31 May 2012 08:19:39 -
> @@ -504,6 +504,8 @@
>   NULL,   ahci_intel_attach },
>   { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82801HBM_AHCI,
>   NULL,   ahci_intel_attach },
> + { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82801HBM_RAID,
> + NULL,   ahci_intel_attach },
>   { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82801I_AHCI_1,
>   NULL,   ahci_intel_attach },
>   { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82801I_AHCI_2,
> 
> Now, the controller attaches as ahci(4) and disks are found behind it.
> Here's the relevant portion of the diff between the before and after
> dmesg:
> 
> -pciide0 at pci0 dev 31 function 2 "Intel 82081HBM RAID" rev 0x04: DMA, 
> channel 0 wired to native-PCI, channel 1 wired to native-PCI
> -pciide0: using apic 0 int 22 for native-PCI interrupt
> +ahci0 at pci0 dev 31 function 2 "Intel 82081HBM RAID" rev 0x04: msi, AHCI 1.3
> +scsibus0 at ahci0: 32 targets
> +sd0 at scsibus0 targ 0 lun 0:  SCSI3 0/direct 
> fixed naa.5f0043584d30
> +sd0: 61057MB, 512 bytes/sector, 125045424 sectors, thin
> +sd1 at scsibus0 targ 1 lun 0:  SCSI3 0/direct 
> fixed naa.5f0043584d30
> +sd1: 61057MB, 512 bytes/sector, 125045424 sectors, thin
> 
> The BIOS on this machine does not offer any settings for configuring
> the mode the controller is set to, nor does the "RAID controller BIOS"
> (which I used to move from 'raid-0' to no raid) allow me to set it as
> a 'regular' AHCI controller.
> 
> So, I'd very much like to see the above diff (or something like it) go
> in, but it basically undoes the 1.163 revision which wasn't commited
> without a reason of course.  Any ideas what the best solution would be
> here ?
> 
> Included below are dmesgs from the non-working snapshot (April 24th
> snap), which was installed to a umass sd; the dmesg from the new
> kernel (with the diff above applied); pcidump -vx output and sysctl hw
> output.
> 
> Paul 'WEiRD' de Weerd
> 
> 

well, this is indeed an ID of a mobile SATA controller in the RAID mode.
the only reason to undo that revision just for 82801HBM_RAID would be
because it's a mobile version and laptop bioses are too crippled to allow
users to change the mode themselves.



Re: Realtek RTS5209 (was: Re: Intel AHCI RAID controller in Sony VAIO Z23 laptop)

2012-05-31 Thread Paul de Weerd
Hi Stefan,

On Thu, May 31, 2012 at 11:20:19AM +0200, Stefan Sperling wrote:
| On Thu, May 31, 2012 at 10:53:22AM +0200, Paul de Weerd wrote:
| > I've recently bought a new Sony laptop, VPCZ23C5E.  Some things on
| > this machine work fine (sound, suspend, wired network), some things
| > don't (X, resume, wireless).
| 
| I suppose the card reader won't work either:
| 
| > "Realtek RTS5209 Card Reader" rev 0x01 at pci2 dev 0 function 0 not 
configured

I have to admit I haven't tried this yet.  Too many things aren't
working on this machine currently, the SD card reader would be nice to
have, but definitely isn't at the top of the list for me ;)

The real issue (at least, for me) is the Sandy Bridge video - it
doesn't work with X (yet) and it turns out that it is responsible for
the non-working resume (resume works fine except for video; I can
blindly reboot the machine)

| I have exactly this chip in a new laptop and am trying to write a driver
| for it based on information from the linux driver.
| I haven't got it working yet but I'll send you a diff once I have
| something to show.

Would be happy to try it out!

Thanks,

Paul 'WEiRD' de Weerd

-- 
>[<++>-]<+++.>+++[<-->-]<.>+++[<+
+++>-]<.>++[<>-]<+.--.[-]
 http://www.weirdnet.nl/ 



Realtek RTS5209 (was: Re: Intel AHCI RAID controller in Sony VAIO Z23 laptop)

2012-05-31 Thread Stefan Sperling
On Thu, May 31, 2012 at 10:53:22AM +0200, Paul de Weerd wrote:
> I've recently bought a new Sony laptop, VPCZ23C5E.  Some things on
> this machine work fine (sound, suspend, wired network), some things
> don't (X, resume, wireless).

I suppose the card reader won't work either:

> "Realtek RTS5209 Card Reader" rev 0x01 at pci2 dev 0 function 0 not configured

I have exactly this chip in a new laptop and am trying to write a driver
for it based on information from the linux driver.
I haven't got it working yet but I'll send you a diff once I have
something to show.

It's not an easy task for me and progress is somewhat slower than
I expected so if anyone wants to help that would be great.



Intel AHCI RAID controller in Sony VAIO Z23 laptop

2012-05-31 Thread Paul de Weerd
I've recently bought a new Sony laptop, VPCZ23C5E.  Some things on
this machine work fine (sound, suspend, wired network), some things
don't (X, resume, wireless).  One of the problems I have is that
-current doesn't find any disks behind the pciide(4), which is a
"Intel 82081HBM RAID".  sthen@ suggested I revert 1.163 of
dev/pci/ahci.c, which was the clue I needed to getting things working.

I built a kernel with the following diff applied:

Index: ahci.c
===
RCS file: /cvs/src/sys/dev/pci/ahci.c,v
retrieving revision 1.188
diff -u -r1.188 ahci.c
--- ahci.c  5 May 2012 10:10:12 -   1.188
+++ ahci.c  31 May 2012 08:19:39 -
@@ -504,6 +504,8 @@
NULL,   ahci_intel_attach },
{ PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82801HBM_AHCI,
NULL,   ahci_intel_attach },
+   { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82801HBM_RAID,
+   NULL,   ahci_intel_attach },
{ PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82801I_AHCI_1,
NULL,   ahci_intel_attach },
{ PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82801I_AHCI_2,

Now, the controller attaches as ahci(4) and disks are found behind it.
Here's the relevant portion of the diff between the before and after
dmesg:

-pciide0 at pci0 dev 31 function 2 "Intel 82081HBM RAID" rev 0x04: DMA, channel 
0 wired to native-PCI, channel 1 wired to native-PCI
-pciide0: using apic 0 int 22 for native-PCI interrupt
+ahci0 at pci0 dev 31 function 2 "Intel 82081HBM RAID" rev 0x04: msi, AHCI 1.3
+scsibus0 at ahci0: 32 targets
+sd0 at scsibus0 targ 0 lun 0:  SCSI3 0/direct 
fixed naa.5f0043584d30
+sd0: 61057MB, 512 bytes/sector, 125045424 sectors, thin
+sd1 at scsibus0 targ 1 lun 0:  SCSI3 0/direct 
fixed naa.5f0043584d30
+sd1: 61057MB, 512 bytes/sector, 125045424 sectors, thin

The BIOS on this machine does not offer any settings for configuring
the mode the controller is set to, nor does the "RAID controller BIOS"
(which I used to move from 'raid-0' to no raid) allow me to set it as
a 'regular' AHCI controller.

So, I'd very much like to see the above diff (or something like it) go
in, but it basically undoes the 1.163 revision which wasn't commited
without a reason of course.  Any ideas what the best solution would be
here ?

Included below are dmesgs from the non-working snapshot (April 24th
snap), which was installed to a umass sd; the dmesg from the new
kernel (with the diff above applied); pcidump -vx output and sysctl hw
output.

Paul 'WEiRD' de Weerd


Full dmesg (snapshot from last month):

OpenBSD 5.1-current (GENERIC.MP) #288: Tue Apr 24 15:39:02 MDT 2012
dera...@amd64.openbsd.org:/usr/src/sys/arch/amd64/compile/GENERIC.MP
real mem = 8501063680 (8107MB)
avail mem = 8252411904 (7870MB)
mainbus0 at root
bios0 at mainbus0: SMBIOS rev. 2.6 @ 0xe6020 (18 entries)
bios0: vendor INSYDE version "R1010H5" date 07/28/2011
bios0: Sony Corporation VPCZ23C5E
acpi0 at bios0: rev 2
acpi0: sleep states S0 S3 S4 S5
acpi0: tables DSDT FACP TCPA ASF! HPET APIC MCFG SLIC WDAT SSDT BOOT SSDT ASPT 
SSDT SSDT SSDT SSDT
acpi0: wakeup devices EHC1(S3) EHC2(S3) HDEF(S0) WLAN(S0) RP01(S0) RMSC(S0) 
RP02(S0) NXUC(S3) RP03(S3) RLAN(S3) RP04(S3) RP07(S3) PEG0(S0) PEGP(S0)
acpitimer0 at acpi0: 3579545 Hz, 24 bits
acpihpet0 at acpi0: 14318179 Hz
acpimadt0 at acpi0 addr 0xfee0: PC-AT compat
cpu0 at mainbus0: apid 0 (boot processor)
cpu0: Intel(R) Core(TM) i7-2640M CPU @ 2.80GHz, 2794.03 MHz
cpu0: 
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,SBF,SSE3,PCLMUL,MWAIT,DS-CPL,VMX,SMX,EST,TM2,SSSE3,CX16,xTPR,PDCM,SSE4.1,SSE4.2,x2APIC,POPCNT,AES,XSAVE,AVX,NXE,LONG,LAHF
cpu0: 256KB 64b/line 8-way L2 cache
cpu0: apic clock running at 99MHz
cpu1 at mainbus0: apid 1 (application processor)
cpu1: Intel(R) Core(TM) i7-2640M CPU @ 2.80GHz, 2793.65 MHz
cpu1: 
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,SBF,SSE3,PCLMUL,MWAIT,DS-CPL,VMX,SMX,EST,TM2,SSSE3,CX16,xTPR,PDCM,SSE4.1,SSE4.2,x2APIC,POPCNT,AES,XSAVE,AVX,NXE,LONG,LAHF
cpu1: 256KB 64b/line 8-way L2 cache
cpu2 at mainbus0: apid 2 (application processor)
cpu2: Intel(R) Core(TM) i7-2640M CPU @ 2.80GHz, 2793.65 MHz
cpu2: 
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,SBF,SSE3,PCLMUL,MWAIT,DS-CPL,VMX,SMX,EST,TM2,SSSE3,CX16,xTPR,PDCM,SSE4.1,SSE4.2,x2APIC,POPCNT,AES,XSAVE,AVX,NXE,LONG,LAHF
cpu2: 256KB 64b/line 8-way L2 cache
cpu3 at mainbus0: apid 3 (application processor)
cpu3: Intel(R) Core(TM) i7-2640M CPU @ 2.80GHz, 2793.66 MHz
cpu3: 
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,SBF,SSE3,PCLMUL,MWAIT,DS-CPL,VMX,SMX,EST,TM2,SSSE3,CX16,xTPR,PDCM,SSE4.1,SSE4.2,x2APIC,POPCNT,AES,XSAVE,AVX,NXE,LONG,LAHF
cpu