From owner-freebsd-current@FreeBSD.ORG Mon Jul 14 19:20:15 2003 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C83A737B401 for ; Mon, 14 Jul 2003 19:20:15 -0700 (PDT) Received: from axe-inc.co.jp (axegw.axe-inc.co.jp [61.199.217.66]) by mx1.FreeBSD.org (Postfix) with ESMTP id 79D2243F93 for ; Mon, 14 Jul 2003 19:20:14 -0700 (PDT) (envelope-from takawata@axe-inc.co.jp) Received: from axe-inc.co.jp ([192.47.224.47]) by axe-inc.co.jp (8.9.3+3.2W/3.7W) with ESMTP id LAA18903; Tue, 15 Jul 2003 11:20:00 +0900 (JST) Message-Id: <200307150220.LAA18903@axe-inc.co.jp> To: Nate Lawson In-reply-to: Your message of "Mon, 14 Jul 2003 17:36:02 MST." <20030714173017.F18544@root.org> Date: Tue, 15 Jul 2003 11:20:19 +0900 From: User Takawata cc: current@freebsd.org Subject: Re: newbus questions X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Jul 2003 02:20:16 -0000 In message <20030714173017.F18544@root.org>, Nate Lawson wrote: >I'm working on ECDT support for ACPI and ran into a couple newbus-related >questions. > >1. I'm using the identify entry as a way to get called early on in the >boot process. However, this does not happen before $PIR evaluation. How >should I hook in a routine for pre-$PIR execution? It may be called in if (ACPI_FAILURE(status = AcpiInstallAddressSpaceHandler(ACPI_ROOT_OBJECT, ACPI_ADR_SPACE_PCI_CONFIG, ACPI_DEFAULT_HANDLER, NULL, NULL))) { device_printf(dev, "could not initialise PciConfig handler: %s\n", AcpiF ormatException(status)); goto out; at acpi_attach(). >2. I need to call bus_alloc_resource() to get access to some io ports. >However, calling BUS_READ_IVAR in the identify routine gets a bad pointer >deref. So how do I get a handle to use for allocating the IO ports >(first arg of bus_alloc_resource)? If you want to use IDENTIFY method, you have to imprement 'bus_driver_added' method on parent driver to initialize ivars in device object. >3. It appears bus_alloc_resource() takes a range of values. If I know the >exact value to use, I request it via "value, value" instead of "0, ~0". >Is this correct? It is correct in that context. When parent driver enumlate device and set the resorce for device, That is used for allocate 'default' resource. >The framework for this code is in ec_identify() and ec_attach() in >sys/dev/acpica/acpi_ec.c. You may want to set up ACPI EC register space before ACPI name space is probed. So I think it is possible to call the initialization routine in acpi_attach() explicitly for the time being. The generalized way is that we have to imprement simple ACPI table parser other than DSDT that is used before ACPI-CA initialization.