From owner-freebsd-questions@FreeBSD.ORG Fri Sep 10 13:21:47 2010 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 120E1106566B for ; Fri, 10 Sep 2010 13:21:47 +0000 (UTC) (envelope-from freebsd-questions@pp.dyndns.biz) Received: from smtprelay-h31.telenor.se (smtprelay-h31.telenor.se [213.150.131.4]) by mx1.freebsd.org (Postfix) with ESMTP id 8FB918FC19 for ; Fri, 10 Sep 2010 13:21:46 +0000 (UTC) Received: from ipb1.telenor.se (ipb1.telenor.se [195.54.127.164]) by smtprelay-h31.telenor.se (Postfix) with ESMTP id 17A3AE8A45; Fri, 10 Sep 2010 15:21:44 +0200 (CEST) X-SENDER-IP: [85.226.59.55] X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ak8wAF7NiUxV4js3PGdsb2JhbACDGJ4oDAEBAQE1LatHkVKBIoMndASNHA X-IronPort-AV: E=Sophos;i="4.56,346,1280700000"; d="scan'208";a="129037859" Received: from c-373be255.107-1-64736c10.cust.bredbandsbolaget.se (HELO gatekeeper.pp.dyndns.biz) ([85.226.59.55]) by ipb1.telenor.se with ESMTP; 10 Sep 2010 15:21:44 +0200 Received: from [192.168.69.67] (phobos [192.168.69.67]) by gatekeeper.pp.dyndns.biz (8.14.4/8.14.4) with ESMTP id o8ADLgAd036919; Fri, 10 Sep 2010 15:21:42 +0200 (CEST) (envelope-from freebsd-questions@pp.dyndns.biz) Message-ID: <4C8A30E6.5090009@pp.dyndns.biz> Date: Fri, 10 Sep 2010 15:21:42 +0200 From: =?UTF-8?B?TW9yZ2FuIFdlc3N0csO2bQ==?= User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.7) Gecko/20100906 Lightning/1.0b2 Thunderbird/3.1.1 MIME-Version: 1.0 To: FreeBSD Questions References: <4C8825E7.5080000@pp.dyndns.biz> <4C88E666.2030208@pp.dyndns.biz> In-Reply-To: <4C88E666.2030208@pp.dyndns.biz> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: freebsd-hackers@freebsd.org Subject: Re: Any way to force AHCI mode on ICH8? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Sep 2010 13:21:47 -0000 On 2010-09-09 15:51, Morgan Wesström wrote: > On 2010-09-09 13:04, Ivan Voras wrote: >> On 09/09/10 02:10, Morgan Wesström wrote: >>> I run FreeBSD 8.1 on an old Asus P5B-VM motherboard with ICH8. Its AMI >>> BIOS lacks an option to enable AHCI mode. Intel's datasheet for the ICH8 >>> family specifies that this feature exists on the ICH8, and the option is >>> available in the BIOS for the identical (apart from form factor) P5B >>> motherboard. >>> >>> http://www.intel.com/Assets/PDF/datasheet/313056.pdf >>> >>> I've contacted Asus support for an updated BIOS but I don't have much >>> hope I will ever see one. Would it be possible to patch the FreeBSD >>> kernel to enable AHCI mode somehow during boot? >> >> You mean except adding: >> >> ahci_load="YES" >> >> to /boot/loader.conf ? > > Yes, I meant if there was a way to programmatically switch the ICH8 into > AHCI mode before loading ahci(4). The BIOS on this motherboard only > provides a "legacy" and an "enhanced" option for the SATA controller. > Neither option turns on AHCI mode so ata(4) attaches to the controller. > There's also a JMicron controller, providing an eSATA connector, on this > motherboard. It is AHCI compatible and ahci(4) attaches correctly to it. > It would've been nice to be able to use NCQ and hotplug on the other > SATA connectors too since the ICH8 has those features. > Cross-posting this to freebsd-hackers in case that is a more appropriate list. On page 486, in the Intel I/O Controller Hub 8 (ICH8) Datasheet, there's a description of the address map register that controls the SATA mode selection (SMS). http://www.intel.com/assets/pdf/datasheet/313056.pdf I quote note 7: "Software shall not manipulate SMS during runtime operation (i.e., the OS will not do this). The BIOS may choose to switch from one mode to another during POST." That note is probably there for a reason but what would life be without experimentation? :-) This is of course far beyond my level of expertise, but would it be possible to flip the necessary register bit very early on in the boot process to turn the SATA controller into AHCI mode? Has anyone done anything like this and what part of the kernel or boot loader would be most appropriate to patch? I have no problem applying a patch and recompiling what's needed if anyone could provide the necessary code. Regards Morgan