From owner-freebsd-arch@FreeBSD.ORG Fri Mar 7 20:50:08 2008 Return-Path: Delivered-To: arch@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9261A1065675 for ; Fri, 7 Mar 2008 20:50:08 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from speedfactory.net (mail.speedfactory.net [66.23.216.219]) by mx1.freebsd.org (Postfix) with ESMTP id 1B0A68FC16 for ; Fri, 7 Mar 2008 20:50:07 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from server.baldwin.cx (unverified [66.23.211.162]) by speedfactory.net (SurgeMail 3.8s) with ESMTP id 234663694-1834499 for ; Fri, 07 Mar 2008 15:51:27 -0500 Received: from localhost.corp.yahoo.com (john@localhost [127.0.0.1]) (authenticated bits=0) by server.baldwin.cx (8.14.2/8.14.2) with ESMTP id m27KnsaE051834 for ; Fri, 7 Mar 2008 15:49:55 -0500 (EST) (envelope-from jhb@FreeBSD.org) From: John Baldwin To: arch@FreeBSD.org Date: Fri, 7 Mar 2008 15:49:46 -0500 User-Agent: KMail/1.9.7 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200803071549.46730.jhb@FreeBSD.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [127.0.0.1]); Fri, 07 Mar 2008 15:49:55 -0500 (EST) X-Virus-Scanned: ClamAV 0.91.2/6166/Fri Mar 7 11:36:07 2008 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=4.2 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: Subject: Change the x86 nexus to support different drivers for different platforms X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Mar 2008 20:50:08 -0000 Right now the two x86 platforms (i386 and amd64) support two different platforms (ACPI vs. legacy) via some rather hackish code (legacy checks for an acpi0 device in its probe routine, etc.). This makes it harder for 3rd parties to add support for proprietary platforms (such as for some embedded x86 appliances that run FreeBSD). This patch attempts to address this by allowing different platforms to provide their own nexus driver. The platform will do its probe in the nexus probe routine and then add suitable platform devices under its nexus device. One side effect of this change is that on x86 any devices that attach to directly to the nexus must be platform independent (this is already true) if they use identify routines. So the changes involved are to make the default nexus driver return BUS_PROBE_GENERIC and for it to explicitly add a legacy0 device in its attach routine (legacy no longer uses a normal identify routine). The ACPI platform now uses a custom nexus driver (which inherits from the default) in acpi_machdep.c which checks for ACPI in its probe routine and explicitly adds acpi0 in its attach routine. The ACPI bus driver no longer uses a standard acpi_identify routine, but instead exports a public 'acpi_identify()' function which serves as a probe routine for the MD nexus drivers to use. It might be nice, btw to possibly make other x86 platforms (such as xbox perhaps?) use their own nexus driver, but that can happen as a followup change later. Patch is at http://www.FreeBSD.org/~jhb/patches/acpi_nexus_cvs.patch -- John Baldwin