[oi-dev] AMD Hudson SATA

Jim Klimov jimklimov at cos.ru
Thu Aug 30 10:07:23 UTC 2012


Hi all,

I am struggling to get AHCI working with my new Thinkpad E335 notebook.
According to OI Device Driver utility, it includes an "AMD Hudson SATA
Controller" when it is BIOS-enabled into SATA (AHCI) mode.

However, only twice of a dozen bootups did it see the HDD behind it,
once was in the shop when I was testing the notebook for compatibility ;)

The system did install and work stably with the controller in
"Compatibility mode" (seeing the disk as CMDK IDE), but I'd prefer
SATA working in a stable manner. Apparently, some port-reset hints,
etc. are in order as for some other controllers in the driver.

I'm trying to give a spin to recent bug report on similar issue,
but I'd take into account that my box has a different devid
(mine is pci1022,7804):
https://www.illumos.org/issues/3099

Do I understand correctly that it is enough to patch ahci.c and build
the driver and replace one on the laptop?

# gdiff -Nabur usr/src/uts/common/io/sata/adapters/ahci/ahci.c.orig 
usr/src/uts/common/io/sata/adapters/ahci/ahci.c

--- usr/src/uts/common/io/sata/adapters/ahci/ahci.c.orig 
2012-04-19 02:17:42.110503288 +0400
+++ usr/src/uts/common/io/sata/adapters/ahci/ahci.c     2012-08-30 
13:57:09.358521233 +0400
@@ -4118,6 +4118,31 @@
                     "is set 0xf and no port multiplier is attached", NULL);
         }

+       /* AMD Hudson D3 AHCI 0x1002 : 0x7801, reportedly similar to 
SB700/750
+        * See: https://www.illumos.org/issues/3099
+        * I'll also try 0x7804 as on my box
+        */
+       if (ahci_ctlp->ahcictl_venid == 0x1002 &&
+           ( ahci_ctlp->ahcictl_devid == 0x7801 ||
+             ahci_ctlp->ahcictl_devid == 0x7804 ) ) {
+               ahci_ctlp->ahcictl_cap |= AHCI_CAP_COMMU_32BIT_DMA;
+//             ahci_ctlp->ahcictl_cap |= AHCI_CAP_INIT_PORT_RESET;
+               ahci_ctlp->ahcictl_cap |= AHCI_CAP_SRST_NO_HOSTPORT;
+
+               AHCIDBG(AHCIDBG_INIT, ahci_ctlp,
+                   "AMD Hudson D3 cannot do 64-bit DMA for communication "
+                   "memory descriptors though CAP indicates support, "
+                   "so force it to use 32-bit DMA", NULL);
+//             AHCIDBG(AHCIDBG_INIT, ahci_ctlp,
+//                 "AMD Hudson D3 need to do a port reset during 
initialization",
+//                 NULL);
+               AHCIDBG(AHCIDBG_INIT, ahci_ctlp,
+                   "AMD Hudson D3 will get software reset failure if 
pmport "
+                   "is set 0xf and no port multiplier is attached", NULL);
+       }
+
+
+
         /*
          * Check if capabilities list is supported and if so,
          * get initial capabilities pointer and clear bits 0,1.




Thanks for suggestions,
//Jim Klimov




More information about the oi-dev mailing list