--- old/usr/src/man/man7d/nv_sata.7d	Thu Jan 16 19:58:19 2014
+++ new/usr/src/man/man7d/nv_sata.7d	Thu Jan 16 19:58:19 2014
@@ -1,11 +1,12 @@
 '\" te
 .\" Copyright (c) 2008, Sun Microsystems, Inc.  All Rights Reserved
+.\" Copyright 2011 Nexenta Systems, Inc.  All rights reserved.
 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
-.TH NV_SATA 7D "Jul 22, 2008"
+.TH nv_sata 7D "25 Sep 2011"
 .SH NAME
-nv_sata \- Nvidia ck804/mcp55 SATA controller driver
+nv_sata \- NVIDIA CK804/MCP04/MCP51/MCP55/MCP61 SATA controller driver
 .SH SYNOPSIS
 .LP
 .nf
@@ -15,8 +16,8 @@
 .SH DESCRIPTION
 .sp
 .LP
-The \fBnv_sata\fR driver is a SATA HBA driver that supports Nvidia ck804 and
-mcp55 SATA HBA controllers.      Note that while these Nvidia controllers
+The \fBnv_sata\fR driver is a SATA HBA driver that supports NVIDIA CK804/MCP04 
+and MCP51/MCP55/MCP61 SATA HBA controllers. Note that while these controllers
 support standard SATA features including SATA-II drives, NCQ, hotplug and ATAPI
 drives, the driver currently does not support NCQ features.
 .SH CONFIGURATION
--- old/usr/src/pkg/manifests/driver-storage-nv_sata.mf	Thu Jan 16 19:58:19 2014
+++ new/usr/src/pkg/manifests/driver-storage-nv_sata.mf	Thu Jan 16 19:58:19 2014
@@ -21,6 +21,7 @@
 
 #
 # Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright 2011 Nexenta Systems, Inc.  All rights reserved.
 #
 
 #
@@ -31,8 +32,9 @@
 <include global_zone_only_component>
 set name=pkg.fmri value=pkg:/driver/storage/nv_sata@$(PKGVERS)
 set name=pkg.description \
-    value="Nvidia ck804 pro / mcp55 pro combo SATA driver"
-set name=pkg.summary value="Nvidia ck804 pro / mcp55 pro combo SATA driver"
+    value="NVIDIA CK804/MCP04/MCP51/MCP55/MCP61 SATA controller driver"
+set name=pkg.summary \
+    value="NVIDIA CK804/MCP04/MCP51/MCP55/MCP61 SATA controller driver"
 set name=info.classification value=org.opensolaris.category.2008:Drivers/Ports
 set name=variant.arch value=i386
 dir path=kernel group=sys
@@ -43,7 +45,12 @@
 driver name=nv_sata class=scsi-self-identifying perms="* 0644 root sys" \
     alias=pci10de,266 \
     alias=pci10de,267 \
+    alias=pci10de,36 \
+    alias=pci10de,37e \
     alias=pci10de,37f \
+    alias=pci10de,3e \
+    alias=pci10de,3f6 \
+    alias=pci10de,3f7 \
     alias=pci10de,54 \
     alias=pci10de,55
 file path=kernel/drv/$(ARCH64)/nv_sata group=sys
--- old/usr/src/uts/common/io/sata/adapters/nv_sata/nv_sata.c	Thu Jan 16 19:58:19 2014
+++ new/usr/src/uts/common/io/sata/adapters/nv_sata/nv_sata.c	Thu Jan 16 19:58:19 2014
@@ -21,12 +21,13 @@
 
 /*
  * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright 2011 Nexenta Systems, Inc.  All rights reserved.
  */
 
 /*
  *
- * nv_sata is a combo SATA HBA driver for ck804/mcp5x (mcp5x = mcp55/mcp51)
- * based chipsets.
+ * nv_sata is a combo SATA HBA driver for CK804/MCP04 (ck804) and
+ * MCP55/MCP51/MCP61 (mcp5x) based chipsets.
  *
  * NCQ
  * ---
@@ -312,7 +313,7 @@
 
 static  struct modldrv modldrv = {
 	&mod_driverops,	/* driverops */
-	"Nvidia ck804/mcp51/mcp55 HBA",
+	"NVIDIA CK804/MCP04/MCP51/MCP55/MCP61 HBA",
 	&nv_dev_ops,	/* driver ops */
 };
 
@@ -599,11 +600,14 @@
 		attach_state |= ATTACH_PROGRESS_STATEP_ALLOC;
 
 		if (pci_config_setup(dip, &pci_conf_handle) == DDI_SUCCESS) {
+			nvc->nvc_devid = pci_config_get16(pci_conf_handle,
+			    PCI_CONF_DEVID);
 			nvc->nvc_revid = pci_config_get8(pci_conf_handle,
 			    PCI_CONF_REVID);
 			NVLOG(NVDBG_INIT, nvc, NULL,
-			    "inst %d: silicon revid is %x nv_debug_flags=%x",
-			    inst, nvc->nvc_revid, nv_debug_flags);
+			    "inst %d: devid is %x silicon revid is %x"
+			    " nv_debug_flags=%x", inst, nvc->nvc_devid,
+			    nvc->nvc_revid, nv_debug_flags);
 		} else {
 			break;
 		}
@@ -2494,7 +2498,7 @@
 
 
 /*
- * Initialize register handling specific to mcp51/mcp55
+ * Initialize register handling specific to mcp51/mcp55/mcp61
  */
 /* ARGSUSED */
 static void
@@ -2549,12 +2553,14 @@
 	 * Enable DMA to take advantage of that.
 	 *
 	 */
-	if (nvc->nvc_revid >= 0xa3) {
+	if ((nvc->nvc_devid > 0x37f) ||
+	    ((nvc->nvc_devid == 0x37f) && (nvc->nvc_revid >= 0xa3))) {
 		if (nv_sata_40bit_dma == B_TRUE) {
 			uint32_t reg32;
 			NVLOG(NVDBG_INIT, nvp->nvp_ctlp, nvp,
-			    "rev id is %X.  40-bit DMA addressing"
-			    " enabled", nvc->nvc_revid);
+			    "devid is %X revid is %X. 40-bit DMA"
+			    " addressing enabled", nvc->nvc_devid,
+			    nvc->nvc_revid);
 			nvc->dma_40bit = B_TRUE;
 
 			reg32 = pci_config_get32(pci_conf_handle,
@@ -2579,8 +2585,9 @@
 			    "40-bit DMA disabled by nv_sata_40bit_dma", NULL);
 		}
 	} else {
-		nv_cmn_err(CE_NOTE, nvp->nvp_ctlp, nvp, "rev id is %X and is "
-		    "not capable of 40-bit DMA addressing", nvc->nvc_revid);
+		nv_cmn_err(CE_NOTE, nvp->nvp_ctlp, nvp, "devid is %X revid is"
+		    " %X. Not capable of 40-bit DMA addressing",
+		    nvc->nvc_devid, nvc->nvc_revid);
 	}
 }
 
@@ -2642,7 +2649,7 @@
 {
 	struct sata_hba_tran stran;
 	nv_port_t *nvp;
-	int j, ck804;
+	int j;
 	uchar_t *cmd_addr, *ctl_addr, *bm_addr;
 	ddi_acc_handle_t bar5_hdl = nvc->nvc_bar_hdl[5];
 	uchar_t *bar5  = nvc->nvc_bar_addr[5];
@@ -2651,10 +2658,7 @@
 
 	NVLOG(NVDBG_INIT, nvc, NULL, "nv_init_ctl entered", NULL);
 
-	ck804 = B_TRUE;
-#ifdef SGPIO_SUPPORT
 	nvc->nvc_mcp5x_flag = B_FALSE;
-#endif
 
 	/*
 	 * Need to set bit 2 to 1 at config offset 0x50
@@ -2685,7 +2689,6 @@
 		    (uint8_t *)(bar5 + NV_BAR5_TRAN_LEN_CH_X));
 
 		if (reg8 != j) {
-			ck804 = B_FALSE;
 			nvc->nvc_mcp5x_flag = B_TRUE;
 			break;
 		}
@@ -2693,13 +2696,15 @@
 
 	nv_put8(bar5_hdl, (uint8_t *)(bar5 + NV_BAR5_TRAN_LEN_CH_X), reg8_save);
 
-	if (ck804 == B_TRUE) {
-		NVLOG(NVDBG_INIT, nvc, NULL, "controller is CK804", NULL);
+	if (nvc->nvc_mcp5x_flag == B_FALSE) {
+		NVLOG(NVDBG_INIT, nvc, NULL, "controller is CK804/MCP04",
+		    NULL);
 		nvc->nvc_interrupt = ck804_intr;
 		nvc->nvc_reg_init = ck804_reg_init;
 		nvc->nvc_set_intr = ck804_set_intr;
 	} else {
-		NVLOG(NVDBG_INIT, nvc, NULL, "controller is MCP51/MCP55", NULL);
+		NVLOG(NVDBG_INIT, nvc, NULL, "controller is MCP51/MCP55/MCP61",
+		    NULL);
 		nvc->nvc_interrupt = mcp5x_intr;
 		nvc->nvc_reg_init = mcp5x_reg_init;
 		nvc->nvc_set_intr = mcp5x_set_intr;
--- old/usr/src/uts/common/sys/sata/adapters/nv_sata/nv_sata.h	Thu Jan 16 19:58:20 2014
+++ new/usr/src/uts/common/sys/sata/adapters/nv_sata/nv_sata.h	Thu Jan 16 19:58:20 2014
@@ -103,11 +103,12 @@
 	 */
 	void		(*nvc_set_intr)(nv_port_t *nvp, int flag);
 	int		nvc_state;	/* state flags of ctrl see below */
+	uint16_t	nvc_devid;	/* PCI devid of device */
 	uint8_t		nvc_revid;	/* PCI revid of device */
 	boolean_t	dma_40bit;	/* 40bit DMA support */
+	boolean_t	nvc_mcp5x_flag;	/* is the controller MCP51/MCP55 */
 
 #ifdef SGPIO_SUPPORT
-	int		nvc_mcp5x_flag;	/* is the controller MCP51/MCP55 */
 	uint8_t		nvc_ctlr_num;	/* controller number within the part */
 	uint32_t	nvc_sgp_csr;	/* SGPIO CSR i/o address */
 	volatile nv_sgp_cb_t *nvc_sgp_cbp; /* SGPIO Control Block */
