From owner-p4-projects@FreeBSD.ORG Mon Nov 9 19:41:31 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id B7B52106568B; Mon, 9 Nov 2009 19:41:31 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7AB561065676 for ; Mon, 9 Nov 2009 19:41:31 +0000 (UTC) (envelope-from mav@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 67BED8FC21 for ; Mon, 9 Nov 2009 19:41:31 +0000 (UTC) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id nA9JfVRV032663 for ; Mon, 9 Nov 2009 19:41:31 GMT (envelope-from mav@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id nA9JfVwn032661 for perforce@freebsd.org; Mon, 9 Nov 2009 19:41:31 GMT (envelope-from mav@freebsd.org) Date: Mon, 9 Nov 2009 19:41:31 GMT Message-Id: <200911091941.nA9JfVwn032661@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to mav@freebsd.org using -f From: Alexander Motin To: Perforce Change Reviews Precedence: bulk Cc: Subject: PERFORCE change 170410 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2009 19:41:31 -0000 http://p4web.freebsd.org/chv.cgi?CH=170410 Change 170410 by mav@mav_mavtest on 2009/11/09 19:40:38 Some BIOSes do not allow to choose SATA controller mode. Some users are not aware of SATA controller modes. Force AHCI for known chipsets. Affected files ... .. //depot/projects/scottl-camlock/src/sys/dev/ahci/ahci.c#75 edit Differences ... ==== //depot/projects/scottl-camlock/src/sys/dev/ahci/ahci.c#75 (text+ko) ==== @@ -96,23 +96,170 @@ MALLOC_DEFINE(M_AHCI, "AHCI driver", "AHCI driver data buffers"); -/* - * AHCI v1.x compliant SATA chipset support functions - */ +static struct { + uint32_t id; + const char *name; + int flags; +} ahci_ids[] = { + {0x43801002, "ATI IXP600", 0}, + {0x43901002, "ATI IXP700", 0}, + {0x43911002, "ATI IXP700", 0}, + {0x43921002, "ATI IXP700", 0}, + {0x43931002, "ATI IXP700", 0}, + {0x43941002, "ATI IXP800", 0}, + {0x43951002, "ATI IXP800", 0}, + {0x26518086, "Intel ICH6", 0}, + {0x26528086, "Intel ICH6", 0}, + {0x26538086, "Intel ICH6M", 0}, + {0x26808086, "Intel ESB2", 0}, + {0x26818086, "Intel ESB2", 0}, + {0x26828086, "Intel ESB2", 0}, + {0x26838086, "Intel ESB2", 0}, + {0x27c08086, "Intel ICH7", 0}, + {0x27c18086, "Intel ICH7", 0}, + {0x27c38086, "Intel ICH7", 0}, + {0x27c48086, "Intel ICH7M", 0}, + {0x27c58086, "Intel ICH7M", 0}, + {0x27c68086, "Intel ICH7M", 0}, + {0x27c68086, "Intel ICH7M", 0}, + {0x28208086, "Intel ICH8", 0}, + {0x28218086, "Intel ICH8", 0}, + {0x28228086, "Intel ICH8", 0}, + {0x28248086, "Intel ICH8", 0}, + {0x28258086, "Intel ICH8", 0}, + {0x28288086, "Intel ICH8M", 0}, + {0x28298086, "Intel ICH8M", 0}, + {0x282a8086, "Intel ICH8M", 0}, + {0x29208086, "Intel ICH9", 0}, + {0x29218086, "Intel ICH9", 0}, + {0x29228086, "Intel ICH9", 0}, + {0x29238086, "Intel ICH9", 0}, + {0x29248086, "Intel ICH9", 0}, + {0x29258086, "Intel ICH9", 0}, + {0x29268086, "Intel ICH9", 0}, + {0x29278086, "Intel ICH9", 0}, + {0x29298086, "Intel ICH9M", 0}, + {0x292a8086, "Intel ICH9M", 0}, + {0x292b8086, "Intel ICH9M", 0}, + {0x292c8086, "Intel ICH9M", 0}, + {0x292f8086, "Intel ICH9M", 0}, + {0x294d8086, "Intel ICH9", 0}, + {0x294e8086, "Intel ICH9M", 0}, + {0x3a008086, "Intel ICH10", 0}, + {0x3a028086, "Intel ICH10", 0}, + {0x3a058086, "Intel ICH10", 0}, + {0x3a068086, "Intel ICH10", 0}, + {0x3a208086, "Intel ICH10", 0}, + {0x3a228086, "Intel ICH10", 0}, + {0x3a258086, "Intel ICH10", 0}, + {0x3a268086, "Intel ICH10", 0}, + {0x3b228086, "Intel PCH", 0}, + {0x3b238086, "Intel PCH", 0}, + {0x3b248086, "Intel PCH", 0}, + {0x3b258086, "Intel PCH", 0}, + {0x3b298086, "Intel PCH", 0}, + {0x3b2b8086, "Intel PCH", 0}, + {0x3b2c8086, "Intel PCH", 0}, + {0x3b2f8086, "Intel PCH", 0}, + {0x044c10de, "NVIDIA MCP65", 0}, + {0x044d10de, "NVIDIA MCP65", 0}, + {0x044e10de, "NVIDIA MCP65", 0}, + {0x044f10de, "NVIDIA MCP65", 0}, + {0x045c10de, "NVIDIA MCP65", 0}, + {0x045d10de, "NVIDIA MCP65", 0}, + {0x045e10de, "NVIDIA MCP65", 0}, + {0x045f10de, "NVIDIA MCP65", 0}, + {0x055010de, "NVIDIA MCP67", 0}, + {0x055110de, "NVIDIA MCP67", 0}, + {0x055210de, "NVIDIA MCP67", 0}, + {0x055310de, "NVIDIA MCP67", 0}, + {0x055410de, "NVIDIA MCP67", 0}, + {0x055510de, "NVIDIA MCP67", 0}, + {0x055610de, "NVIDIA MCP67", 0}, + {0x055710de, "NVIDIA MCP67", 0}, + {0x055810de, "NVIDIA MCP67", 0}, + {0x055910de, "NVIDIA MCP67", 0}, + {0x055A10de, "NVIDIA MCP67", 0}, + {0x055B10de, "NVIDIA MCP67", 0}, + {0x058410de, "NVIDIA MCP67", 0}, + {0x07f010de, "NVIDIA MCP73", 0}, + {0x07f110de, "NVIDIA MCP73", 0}, + {0x07f210de, "NVIDIA MCP73", 0}, + {0x07f310de, "NVIDIA MCP73", 0}, + {0x07f410de, "NVIDIA MCP73", 0}, + {0x07f510de, "NVIDIA MCP73", 0}, + {0x07f610de, "NVIDIA MCP73", 0}, + {0x07f710de, "NVIDIA MCP73", 0}, + {0x07f810de, "NVIDIA MCP73", 0}, + {0x07f910de, "NVIDIA MCP73", 0}, + {0x07fa10de, "NVIDIA MCP73", 0}, + {0x07fb10de, "NVIDIA MCP73", 0}, + {0x0ad010de, "NVIDIA MCP77", 0}, + {0x0ad110de, "NVIDIA MCP77", 0}, + {0x0ad210de, "NVIDIA MCP77", 0}, + {0x0ad310de, "NVIDIA MCP77", 0}, + {0x0ad410de, "NVIDIA MCP77", 0}, + {0x0ad510de, "NVIDIA MCP77", 0}, + {0x0ad610de, "NVIDIA MCP77", 0}, + {0x0ad710de, "NVIDIA MCP77", 0}, + {0x0ad810de, "NVIDIA MCP77", 0}, + {0x0ad910de, "NVIDIA MCP77", 0}, + {0x0ada10de, "NVIDIA MCP77", 0}, + {0x0adb10de, "NVIDIA MCP77", 0}, + {0x0ab410de, "NVIDIA MCP79", 0}, + {0x0ab510de, "NVIDIA MCP79", 0}, + {0x0ab610de, "NVIDIA MCP79", 0}, + {0x0ab710de, "NVIDIA MCP79", 0}, + {0x0ab810de, "NVIDIA MCP79", 0}, + {0x0ab910de, "NVIDIA MCP79", 0}, + {0x0aba10de, "NVIDIA MCP79", 0}, + {0x0abb10de, "NVIDIA MCP79", 0}, + {0x0abc10de, "NVIDIA MCP79", 0}, + {0x0abd10de, "NVIDIA MCP79", 0}, + {0x0abe10de, "NVIDIA MCP79", 0}, + {0x0abf10de, "NVIDIA MCP79", 0}, + {0x0d8410de, "NVIDIA MCP89", 0}, + {0x0d8510de, "NVIDIA MCP89", 0}, + {0x0d8610de, "NVIDIA MCP89", 0}, + {0x0d8710de, "NVIDIA MCP89", 0}, + {0x0d8810de, "NVIDIA MCP89", 0}, + {0x0d8910de, "NVIDIA MCP89", 0}, + {0x0d8a10de, "NVIDIA MCP89", 0}, + {0x0d8b10de, "NVIDIA MCP89", 0}, + {0x0d8c10de, "NVIDIA MCP89", 0}, + {0x0d8d10de, "NVIDIA MCP89", 0}, + {0x0d8e10de, "NVIDIA MCP89", 0}, + {0x0d8f10de, "NVIDIA MCP89", 0}, + {0x33491106, "VIA VT8251", 0}, + {0x62871106, "VIA VT8251", 0}, + {0x11841039, "SiS 966", 0}, + {0x11851039, "SiS 968", 0}, + {0x01861039, "SiS 968", 0}, + {0, NULL, 0} +}; + static int ahci_probe(device_t dev) { + char buf[64]; + int i; + uint32_t devid = pci_get_devid(dev); - /* is this a possible AHCI candidate ? */ + /* Is this a known AHCI chip? */ + for (i = 0; ahci_ids[i].id != 0; i++) { + if (ahci_ids[i].id == devid) { + snprintf(buf, sizeof(buf), "%s AHCI SATA controller", + ahci_ids[i].name); + device_set_desc_copy(dev, buf); + return (BUS_PROBE_VENDOR); + } + } + /* Is this a possible AHCI candidate? */ if (pci_get_class(dev) != PCIC_STORAGE || - pci_get_subclass(dev) != PCIS_STORAGE_SATA) + pci_get_subclass(dev) != PCIS_STORAGE_SATA || + pci_get_progif(dev) != PCIP_STORAGE_SATA_AHCI_1_0) return (ENXIO); - - /* is this PCI device flagged as an AHCI compliant chip ? */ - if (pci_get_progif(dev) != PCIP_STORAGE_SATA_AHCI_1_0) - return (ENXIO); - - device_set_desc_copy(dev, "AHCI controller"); + device_set_desc_copy(dev, "AHCI SATA controller"); return (BUS_PROBE_VENDOR); }