From josemi@freebsd.jazztel.es  Fri Sep 26 09:28:29 2008
Return-Path: <josemi@freebsd.jazztel.es>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 4CE0A106568C
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 26 Sep 2008 09:28:29 +0000 (UTC)
	(envelope-from josemi@freebsd.jazztel.es)
Received: from smtp02.jazztel.es (smtp02.jazztel.es [62.14.3.171])
	by mx1.freebsd.org (Postfix) with ESMTP id D771E8FC0C
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 26 Sep 2008 09:28:28 +0000 (UTC)
	(envelope-from josemi@freebsd.jazztel.es)
Received: from [87.217.187.81] (helo=[192.168.254.125])
	by smtp02.jazztel.es with esmtpa (Exim 4.60)
	(envelope-from <josemi@freebsd.jazztel.es>)
	id 1Kj93V-0001Vh-RZ
	for FreeBSD-gnats-submit@freebsd.org; Fri, 26 Sep 2008 10:52:05 +0200
Message-Id: <48DCA3B5.3090606@freebsd.jazztel.es>
Date: Fri, 26 Sep 2008 10:56:21 +0200
From: Jose M Rodriguez <josemi@freebsd.jazztel.es>
Reply-To: josemi@freebsd.jazztel.es
To: FreeBSD-gnats-submit@freebsd.org
Subject: nVidia MCP AHCI SATA Support

>Number:         127645
>Category:       kern
>Synopsis:       [ata] [patch] Add support for nVidia MCP67 AHCI SATA Chipset
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Fri Sep 26 09:30:03 UTC 2008
>Closed-Date:    Thu May 07 17:58:58 UTC 2009
>Last-Modified:  Thu May 07 17:58:58 UTC 2009
>Originator:     Jose M Rodriguez
>Release:        FreeBSD 7.0-RELEASE-p4 amd64
>Organization:
Redes JM
>Environment:
 System: FreeBSD orion.redesjm.local 7.0-RELEASE-p4 FreeBSD 
 7.0-RELEASE-p4 #0: Fri Sep 12 14:13:16 CEST 2008 
 root@orion.redesjm.local:/usr/obj/usr/src/sys/ORION amd64
>Description:
     At last on my nVidia nForce 630 Athlon boards, the SATA parts
     are AHCI based, the same that Latest ATI SB600.
 
     I try to make a patch against RELENG_7 as close as possible to
     how support for ATI SB600 was integrated.
 
     This works with my nForce 630a boards [Abit/Asrock] and may work
     with 630i and recent nVidia SATA parts.
 
     A great hint was that FreeBSD can be booted setting the SATA
     part to AHCI in BIOS.
>How-To-Repeat:
>Fix:
     Patch against up to date RELENG_7 attached
 
 
 --- mcp67.patch begins here ---
 Index: ata-pci.h
 ===================================================================
 RCS file: /alt/home/cvs/freebsd/src/sys/dev/ata/ata-pci.h,v
 retrieving revision 1.81.2.6
 diff -u -r1.81.2.6 ata-pci.h
 --- ata-pci.h    13 Sep 2008 07:36:16 -0000    1.81.2.6
 +++ ata-pci.h    25 Sep 2008 16:16:16 -0000
 @@ -241,6 +241,8 @@
  #define ATA_NFORCE_MCP61_S3     0x03f710de
  #define ATA_NFORCE_MCP65        0x044810de
  #define ATA_NFORCE_MCP67        0x056010de
 +#define ATA_NFORCE_MCP67_S1     0x055010de
 +#define ATA_NFORCE_MCP67_S2     0x055810de
  #define ATA_NFORCE_MCP73        0x056c10de
  #define ATA_NFORCE_MCP77        0x075910de
  
 @@ -448,6 +450,7 @@
  #define NVIDIA          0x0004
  #define NV4             0x0010
  #define NVQ             0x0020
 +#define NVAHCI          0x0040
  #define VIACLK          0x0100
  #define VIABUG          0x0200
  #define VIABAR          0x0400
 Index: ata-chipset.c
 ===================================================================
 RCS file: /alt/home/cvs/freebsd/src/sys/dev/ata/ata-chipset.c,v
 retrieving revision 1.202.2.13
 diff -u -r1.202.2.13 ata-chipset.c
 --- ata-chipset.c    13 Sep 2008 07:36:16 -0000    1.202.2.13
 +++ ata-chipset.c    25 Sep 2008 16:16:16 -0000
 @@ -3050,6 +3050,8 @@
       { ATA_NFORCE_MCP61_S3, 0, 0,         NV4|NVQ, ATA_SA300, "nForce 
 MCP61" },
       { ATA_NFORCE_MCP65,    0, AMDNVIDIA, NVIDIA,  ATA_UDMA6, "nForce 
 MCP65" },
       { ATA_NFORCE_MCP67,    0, AMDNVIDIA, NVIDIA,  ATA_UDMA6, "nForce 
 MCP67" },
 +     { ATA_NFORCE_MCP67_S1, 0, 0,         NVAHCI,  ATA_SA300, "nForce 
 MCP67" },
 +     { ATA_NFORCE_MCP67_S2, 0, 0,         NVAHCI,  ATA_SA300, "nForce 
 MCP67" },
       { ATA_NFORCE_MCP73,    0, AMDNVIDIA, NVIDIA,  ATA_UDMA6, "nForce 
 MCP73" },
       { ATA_NFORCE_MCP77,    0, AMDNVIDIA, NVIDIA,  ATA_UDMA6, "nForce 
 MCP77" },
       { 0, 0, 0, 0, 0, 0}} ;
 @@ -3071,6 +3073,9 @@
      return ENXIO;
  
      if (ctlr->chip->max_dma >= ATA_SA150) {
 +    /* do we have AHCI capability ? */
 +    if ((ctlr->chip->cfg2 == NVAHCI) && ata_ahci_chipinit(dev) != ENXIO)
 +        return 0;
      if (pci_read_config(dev, PCIR_BAR(5), 1) & 1)
          ctlr->r_type2 = SYS_RES_IOPORT;
      else
 --- mcp67.patch ends here ---
 
>Release-Note:
>Audit-Trail:
Class-Changed-From-To: sw-bug->change-request 
Class-Changed-By: linimon 
Class-Changed-When: Fri Sep 26 12:36:49 UTC 2008 
Class-Changed-Why:  
Rescue this PR from the 'pending' category. 


Responsible-Changed-From-To: gnats-admin->freebsd-bugs 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Fri Sep 26 12:36:49 UTC 2008 
Responsible-Changed-Why:  

http://www.freebsd.org/cgi/query-pr.cgi?pr=127645 
State-Changed-From-To: open->closed 
State-Changed-By: mav 
State-Changed-When: Thu May 7 17:51:14 UTC 2009 
State-Changed-Why:  
Alike patch was committed and merged into 7-STABLE before 7.2. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=127645 
>Unformatted:
