From fujimoto@yebisu.j.dendai.ac.jp  Tue Aug 20 04:40:14 2002
Return-Path: <fujimoto@yebisu.j.dendai.ac.jp>
Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 1B26E37B400
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 20 Aug 2002 04:40:14 -0700 (PDT)
Received: from yebisu.j.dendai.ac.jp (yebisu.j.dendai.ac.jp [133.14.49.224])
	by mx1.FreeBSD.org (Postfix) with ESMTP id B3E3743E42
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 20 Aug 2002 04:40:13 -0700 (PDT)
	(envelope-from fujimoto@yebisu.j.dendai.ac.jp)
Received: by yebisu.j.dendai.ac.jp (Postfix, from userid 1001)
	id 65FC64083F; Tue, 20 Aug 2002 20:40:12 +0900 (JST)
Message-Id: <20020820114012.65FC64083F@yebisu.j.dendai.ac.jp>
Date: Tue, 20 Aug 2002 20:40:12 +0900 (JST)
From: FUJIMOTO Kou <fujimoto@yebisu.j.dendai.ac.jp>
Reply-To: FUJIMOTO Kou <fujimoto@yebisu.j.dendai.ac.jp>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: patch to detect/function AMD768 SMBus
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         41812
>Category:       kern
>Synopsis:       patch to detect/function AMD768 SMBus
>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:   Tue Aug 20 04:50:01 PDT 2002
>Closed-Date:    Mon Sep 01 07:59:49 PDT 2003
>Last-Modified:  Mon Sep 01 07:59:49 PDT 2003
>Originator:     FUJIMOTO Kou
>Release:        FreeBSD 4.6-STABLE i386
>Organization:
Tokyo Denki University
>Environment:
System: FreeBSD yebisu.j.dendai.ac.jp 4.6-STABLE FreeBSD 4.6-STABLE #26: Tue Aug 13 00:25:35 JST 2002 root@yebisu.j.dendai.ac.jp:/usr/src/sys/compile/XPSMP i386

>Description:
The attached patch for sys/pci/amdpm.c enables kernel to recognize 
AMD766/768 SMBus interface. AMD766/768 SMBus seems to be compatible with 
that of AMD756, and so the patch just adds PCI device IDs and modifies 
one conditional. 

>How-To-Repeat:
It works fine with ASUS A7M266-D (AMD768 chipset) and ports/sysutils/xmbmon, 
though I never examined with AMD766 or other applications. 

>Fix:
--- amdpm.c.orig	Wed Oct 10 21:10:26 2001
+++ amdpm.c	Mon Mar 11 14:27:58 2002
@@ -66,6 +66,8 @@
 
 #define AMDPM_VENDORID_AMD 0x1022
 #define AMDPM_DEVICEID_AMD756PM 0x740b
+#define AMDPM_DEVICEID_AMD766PM 0x7413
+#define AMDPM_DEVICEID_AMD768PM 0x7443
 
 /* PCI Configuration space registers */
 #define AMDPCI_PMBASE 0x58
@@ -155,10 +157,14 @@
 amdpm_probe(device_t dev)
 {
 	u_long base;
-	
+	u_int16_t did;
+
+	did = pci_get_device(dev);
 	if ((pci_get_vendor(dev) == AMDPM_VENDORID_AMD) &&
-	    (pci_get_device(dev) == AMDPM_DEVICEID_AMD756PM)) {
-	      device_set_desc(dev, "AMD 756 Power Management Controller");
+	    ((did == AMDPM_DEVICEID_AMD756PM) ||
+	     (did == AMDPM_DEVICEID_AMD766PM) ||
+	     (did == AMDPM_DEVICEID_AMD768PM))) {
+	      device_set_desc(dev, "AMD 756/766/768 Power Management Controller");
 	      
 	      /* 
 	       * We have to do this, since the BIOS won't give us the
@@ -215,8 +221,8 @@
 	if (!amdsmb_sc->smbus)
 		return (EINVAL);
 
-	device_set_desc(dev, "AMD 756 SMBus interface");
-	device_printf(dev, "AMD 756 SMBus interface\n");
+	device_set_desc(dev, "AMD 756/766/768 SMBus interface");
+	device_printf(dev, "AMD 756/766/768 SMBus interface\n");
 
 	return (0);
 }
>Release-Note:
>Audit-Trail:

From: FUJIMOTO Kou <fujimoto@j.dendai.ac.jp>
To: freebsd-gnats-submit@FreeBSD.org, fujimoto@j.dendai.ac.jp
Cc:  
Subject: Re: kern/41812: patch to detect/function AMD768 SMBus
Date: Tue, 20 Aug 2002 20:56:48 +0900

 Oops, originator's address was wrong... the following is correct.
 fujimoto@j.dendai.ac.jp
 
State-Changed-From-To: open->closed 
State-Changed-By: dfr 
State-Changed-When: Mon Sep 1 07:58:51 PDT 2003 
State-Changed-Why:  
Patch applied to current - revision 1.9 of amdpm.c 

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