From owner-freebsd-bugs@FreeBSD.ORG Fri Feb 28 04:21:07 2014 Return-Path: Delivered-To: freebsd-bugs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A3B4EC0 for ; Fri, 28 Feb 2014 04:21:07 +0000 (UTC) Received: from ae-osaka.co.jp (mx.ae-osaka.co.jp [210.196.184.82]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6270E1B2C for ; Fri, 28 Feb 2014 04:21:01 +0000 (UTC) Received: from ae-osaka.co.jp (localhost.ae-osaka.co.jp [127.0.0.1]) by ae-osaka.co.jp (Postfix) with ESMTP id E8958125E95 for ; Fri, 28 Feb 2014 13:20:53 +0900 (JST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=airport.fm; h= message-id:date:from:mime-version:to:subject:references :in-reply-to:content-type; s=mail; bh=+Ya2Khqabhtl4o06f7qgPvp4ez g=; b=ekqE9WffJWkGImzGPvbFlcQ4ZnLGfdYl3R4U4Myt7TjrzdAeb7+O0L9dR8 aW6Y+4sPoYXw68QbKWDKJkUz+mnFsvi/RmgdIMxlPszp4LOryYCSbwBkRc0grzSI n/Q5BQsZQ6JsAy7sXOeRSUcVUB2TH5+g7s89BqXFVdcnQzR8Y= DomainKey-Signature: a=rsa-sha1; c=nofws; d=airport.fm; h=message-id :date:from:mime-version:to:subject:references:in-reply-to :content-type; q=dns; s=mail; b=cs6r4BlylmjKbdqiq+T6xVQhZTtqbTQG z8BpZkVhWFHanao8LS5xtXIfSTrqX0XK8hOgA+QEYYZxn/wkqU7ZHo2LyJfPF7Oz w5hqBBj3qvZLGtvEurrfhV0ztmQmls+ZBbCesvyxmL73Srgji1JauPtW0rU6rmT5 lX4XRitzsLo= Received: from [IPv6:2001:470:824b:a011:5128:35a6:5f18:2776] (unknown [IPv6:2001:470:824b:a011:5128:35a6:5f18:2776]) by ae-osaka.co.jp (Postfix) with ESMTPSA id 2300F125E90 for ; Fri, 28 Feb 2014 13:20:53 +0900 (JST) Message-ID: <53100EA5.7030009@airport.fm> Date: Fri, 28 Feb 2014 13:20:53 +0900 From: Takefu User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 MIME-Version: 1.0 To: freebsd-bugs@freebsd.org Subject: Re: kern/139743: [ichsmb] [patch] ichsmb driver doesn't detects SMB bus on Asus P4B533/P4PE motherboards References: <201302130630.r1D6UX5K078320@freefall.freebsd.org> <511B52BB.3010100@airport.fm> In-Reply-To: <511B52BB.3010100@airport.fm> X-Enigmail-Version: 1.6 OpenPGP: id=9C3E8F56 Content-Type: multipart/mixed; boundary="------------010607000607010206000900" X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Feb 2014 04:21:07 -0000 This is a multi-part message in MIME format. --------------010607000607010206000900 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit >From whom isn't there reaction in this PR? This is a patch corresponding to 10.0-RELEASE. --------------010607000607010206000900 Content-Type: text/plain; charset=Shift_JIS; name="sys_dev_pci_pci.c.diff_RELENG_10_0" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="sys_dev_pci_pci.c.diff_RELENG_10_0" --- sys/dev/pci/pci.c.orig 2014-02-24 12:40:07.000000000 +0900 +++ sys/dev/pci/pci.c 2014-02-24 12:48:55.000000000 +0900 @@ -112,6 +112,7 @@ uint16_t data); static void pci_enable_msix(device_t dev, u_int index, uint64_t address, uint32_t data); +static void pci_fix_asus_smbus(device_t dev); static void pci_mask_msix(device_t dev, u_int index); static void pci_unmask_msix(device_t dev, u_int index); static int pci_msi_blacklisted(void); @@ -196,54 +197,56 @@ #define PCI_QUIRK_ENABLE_MSI_VM 3 /* Older chipset in VM where MSI works */ #define PCI_QUIRK_UNMAP_REG 4 /* Ignore PCI map register */ #define PCI_QUIRK_DISABLE_MSIX 5 /* MSI-X doesn't work */ +#define PCI_QUIRK_FIXUP_ROUTINE 6 /* PCI needs a fix to continue */ int arg1; int arg2; + void (*fixup_func)(device_t dev); }; static const struct pci_quirk pci_quirks[] = { /* The Intel 82371AB and 82443MX have a map register at offset 0x90. */ - { 0x71138086, PCI_QUIRK_MAP_REG, 0x90, 0 }, - { 0x719b8086, PCI_QUIRK_MAP_REG, 0x90, 0 }, + { 0x71138086, PCI_QUIRK_MAP_REG, 0x90, 0, NULL }, + { 0x719b8086, PCI_QUIRK_MAP_REG, 0x90, 0, NULL }, /* As does the Serverworks OSB4 (the SMBus mapping register) */ - { 0x02001166, PCI_QUIRK_MAP_REG, 0x90, 0 }, + { 0x02001166, PCI_QUIRK_MAP_REG, 0x90, 0, NULL }, /* * MSI doesn't work with the ServerWorks CNB20-HE Host Bridge * or the CMIC-SL (AKA ServerWorks GC_LE). */ - { 0x00141166, PCI_QUIRK_DISABLE_MSI, 0, 0 }, - { 0x00171166, PCI_QUIRK_DISABLE_MSI, 0, 0 }, + { 0x00141166, PCI_QUIRK_DISABLE_MSI, 0, 0, NULL }, + { 0x00171166, PCI_QUIRK_DISABLE_MSI, 0, 0, NULL }, /* * MSI doesn't work on earlier Intel chipsets including * E7500, E7501, E7505, 845, 865, 875/E7210, and 855. */ - { 0x25408086, PCI_QUIRK_DISABLE_MSI, 0, 0 }, - { 0x254c8086, PCI_QUIRK_DISABLE_MSI, 0, 0 }, - { 0x25508086, PCI_QUIRK_DISABLE_MSI, 0, 0 }, - { 0x25608086, PCI_QUIRK_DISABLE_MSI, 0, 0 }, - { 0x25708086, PCI_QUIRK_DISABLE_MSI, 0, 0 }, - { 0x25788086, PCI_QUIRK_DISABLE_MSI, 0, 0 }, - { 0x35808086, PCI_QUIRK_DISABLE_MSI, 0, 0 }, + { 0x25408086, PCI_QUIRK_DISABLE_MSI, 0, 0, NULL }, + { 0x254c8086, PCI_QUIRK_DISABLE_MSI, 0, 0, NULL }, + { 0x25508086, PCI_QUIRK_DISABLE_MSI, 0, 0, NULL }, + { 0x25608086, PCI_QUIRK_DISABLE_MSI, 0, 0, NULL }, + { 0x25708086, PCI_QUIRK_DISABLE_MSI, 0, 0, NULL }, + { 0x25788086, PCI_QUIRK_DISABLE_MSI, 0, 0, NULL }, + { 0x35808086, PCI_QUIRK_DISABLE_MSI, 0, 0, NULL }, /* * MSI doesn't work with devices behind the AMD 8131 HT-PCIX * bridge. */ - { 0x74501022, PCI_QUIRK_DISABLE_MSI, 0, 0 }, + { 0x74501022, PCI_QUIRK_DISABLE_MSI, 0, 0, NULL }, /* * MSI-X allocation doesn't work properly for devices passed through * by VMware up to at least ESXi 5.1. */ - { 0x079015ad, PCI_QUIRK_DISABLE_MSIX, 0, 0 }, /* PCI/PCI-X */ - { 0x07a015ad, PCI_QUIRK_DISABLE_MSIX, 0, 0 }, /* PCIe */ + { 0x079015ad, PCI_QUIRK_DISABLE_MSIX, 0, 0, NULL }, /* PCI/PCI-X */ + { 0x07a015ad, PCI_QUIRK_DISABLE_MSIX, 0, 0, NULL }, /* PCIe */ /* * Some virtualization environments emulate an older chipset * but support MSI just fine. QEMU uses the Intel 82440. */ - { 0x12378086, PCI_QUIRK_ENABLE_MSI_VM, 0, 0 }, + { 0x12378086, PCI_QUIRK_ENABLE_MSI_VM, 0, 0, NULL }, /* * HPET MMIO base address may appear in Bar1 for AMD SB600 SMBus @@ -253,7 +256,11 @@ * For SB600 A21 and later, firmware must set the bit to hide it. * For SB700 and later, it is unused and hardcoded to zero. */ - { 0x43851002, PCI_QUIRK_UNMAP_REG, 0x14, 0 }, + { 0x43851002, PCI_QUIRK_UNMAP_REG, 0x14, 0, NULL }, + + /* The ASUS P4B-motherboards needs a hack to enable the Intel 801SMBus */ + { 0x24408086, PCI_QUIRK_FIXUP_ROUTINE, 0, 0, &pci_fix_asus_smbus }, + { 0x24C08086, PCI_QUIRK_FIXUP_ROUTINE, 0, 0, &pci_fix_asus_smbus }, { 0 } }; @@ -527,6 +534,27 @@ cfg->hdrtype = PCIM_HDRTYPE_BRIDGE; } +/* asus p4b/p4pe hack */ + +static void +pci_fix_asus_smbus(device_t dev) +{ + int pmccfg; + + /* read subsystem vendor-id */ + pmccfg = pci_read_config(dev, 0xF2, 2); + printf(" [-] pmccfg: %.4x\n",pmccfg); + if( pmccfg & 0x8 ){ + pmccfg &= ~0x8; + pci_write_config(dev, 0xF2, pmccfg, 2); + pmccfg = pci_read_config(dev, 0xF2, 2); + if( pmccfg & 0x8 ) + printf("Could not enable Intel 801SMBus!\n"); + else + printf("Enabled Intel 801SMBus\n"); + } +} + /* extract header type specific config data */ static void @@ -3206,6 +3234,12 @@ * Skip quirked resources. */ for (q = &pci_quirks[0]; q->devid != 0; q++) + if (q->devid == ((cfg->device << 16) | cfg->vendor) ){ + if( q->type == PCI_QUIRK_MAP_REG ) + pci_add_map(bus, dev, q->arg1, rl, force, 0); + else if( q->type == PCI_QUIRK_FIXUP_ROUTINE ) + q->fixup_func(dev); + } if (q->devid == devid && q->type == PCI_QUIRK_UNMAP_REG && q->arg1 == PCIR_BAR(i)) --------------010607000607010206000900--