From owner-freebsd-hackers@FreeBSD.ORG Tue Aug 25 17:49:34 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 27D18106568B; Tue, 25 Aug 2009 17:49:34 +0000 (UTC) (envelope-from avg@freebsd.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 3B6DF8FC1A; Tue, 25 Aug 2009 17:49:32 +0000 (UTC) Received: from odyssey.starpoint.kiev.ua (alpha-e.starpoint.kiev.ua [212.40.38.101]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id UAA08587; Tue, 25 Aug 2009 20:49:31 +0300 (EEST) (envelope-from avg@freebsd.org) Message-ID: <4A94242B.7090806@freebsd.org> Date: Tue, 25 Aug 2009 20:49:31 +0300 From: Andriy Gapon User-Agent: Thunderbird 2.0.0.22 (X11/20090724) MIME-Version: 1.0 To: freebsd-acpi@freebsd.org, freebsd-hackers@freebsd.org References: <4A9412ED.6080309@freebsd.org> In-Reply-To: <4A9412ED.6080309@freebsd.org> X-Enigmail-Version: 0.95.7 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: Subject: AMD SB700 SMBus controller driver X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Aug 2009 17:49:34 -0000 According to SB700 specifications its SMBus controller is very similar to one in PIIX4. The differences that I see so far: 1. Interrupt Line/Interrupt Pin PCI configuration registers (0x3c, 0x3d) do not specify interrupt number that the controller could use: > This register specifies which interrupt pin the device issue > This module does not generate interrupt but contains the > actual interrupt controller. This register is hardcoded to 0. 2. I2CbusConfig register (0xd2) uses bit #1 to indicate whether SMI or regular interrupt is used in interrupt mode; PIIX4 uses bit 3. I couldn't get our intpm driver to work with this hardware by simply adding PCI id and tweaking 0xd2 bits meaning. I could get it to work by forcing polling mode. It appears that Linux driver for this HW always uses polling mode, and OpenBSD and NetBSD drivers would use it with this HW too. I am still trying to get interrupt mode to work. I set 0xd2 to enable regular interrupt generation (it is set to SMI after boot). SB700 specifications say at one place that SMB interrupt is connected to INTIN20 pin of IO-APIC in APIC mode. I tried setting up IRQ20 in the driver but no interrupts are generated. And there are no stray interrupts either. So I am not sure - either this HW doesn't generate normal interrupts at all, or they to a different pin, or additional setup is required, or I am doing something wrong. Anyway, I plan to produce an updated version of intpm driver with possibility of forced or auto-detected polling mode and support for PCI id of SB700 SMBus controller and its peculiarities. -- Andriy Gapon