From owner-freebsd-i386@FreeBSD.ORG Thu Aug 3 01:32:29 2006 Return-Path: X-Original-To: freebsd-i386@freebsd.org Delivered-To: freebsd-i386@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DAD2116A4DD; Thu, 3 Aug 2006 01:32:28 +0000 (UTC) (envelope-from nate@root.org) Received: from ylpvm15.prodigy.net (ylpvm15-ext.prodigy.net [207.115.57.46]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6CB1443D49; Thu, 3 Aug 2006 01:32:28 +0000 (GMT) (envelope-from nate@root.org) X-ORBL: [67.119.74.222] Received: from [10.0.0.53] (adsl-67-119-74-222.dsl.sntc01.pacbell.net [67.119.74.222]) by ylpvm15.prodigy.net (8.13.7 out spool5000 dk/8.13.7) with ESMTP id k731VPjV032642; Wed, 2 Aug 2006 21:31:26 -0400 Message-ID: <44D151DF.10000@root.org> Date: Wed, 02 Aug 2006 18:31:11 -0700 From: Nate Lawson User-Agent: Thunderbird 1.5.0.2 (X11/20060501) MIME-Version: 1.0 To: Bruce Evans References: <200607252036.k6PKanFd072593@www.freebsd.org> <20060731191302.S1172@epsplex.bde.org> <6EFF87DF-280C-402C-8C2A-10F3144CF41F@svcolo.com> <20060802205230.N90692@delplex.bde.org> <20060802234330.J1249@epsplex.bde.org> <20060802150656.GB47835@svcolo.com> <20060803024810.X1573@epsplex.bde.org> <83D35AA9-61D2-4977-AFEC-C498F4147FC2@svcolo.com> <20060803041522.F2135@epsplex.bde.org> <20060803055353.K635@epsplex.bde.org> In-Reply-To: <20060803055353.K635@epsplex.bde.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Jo Rhett , freebsd-gnats-submit@freebsd.org, freebsd-i386@freebsd.org Subject: Re: i386/100831: sio ignores BIOS information about serial ports - bounty offered X-BeenThere: freebsd-i386@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: I386-specific issues for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Aug 2006 01:32:29 -0000 Bruce Evans wrote: > On Thu, 3 Aug 2006, Bruce Evans wrote: >> I don't completely understand this either. I think there is a >> non-ACPI part >> of the BIOS that FreeBSD (or all OS's doesn't see). As I understand your >> configuration, you start with COM1 and COM2 at the usual places but don't >> want to use COM1 so you change the BIOS settings for COM2 to the usual >> ones >> for COM1 and maybe vice versa. This changes soft jumpers or whatever is >> needed for FreeBSD to see it. Then you use a BIOS option to swap the >> ports >> so that everything is supposed to see COM2 as COM1. The boot loader sees >> this but ACPI in FreeBSD doesn't. I think this changes is only made in >> some BIOS table that ACPI in FreeBSD doesn't know about. In my test, I >> only swapped the settings of COM1 and COM2 in the BIOS, since I couldn't >> find a BIOS option to swap the unit number assignments, so it was not >> completely incorrect for ACPI in FreeBSD to swap the settings. > > More details on my test: > - after swapping the settings of COM1 and COM2, both FreeBSD-ACPI and WinXP > see only the settings swapped. WinXP didn't report any changes to the > devices. I now think this is completely correct. Swapping like this > requires swapping in device.hints to keep the same assignment of > physical > devices to unit numbers. > - after swapping the settings and then disabling COM1, FreeBSD-ACPI moves > COM2 down to COM1 (sio0) and sio1 goes away, while WinXP doesn't change > unit numbers and COM1 goes away. I think the WinXP behaviour is correct > and FreeBSD-ACPI just allocates unit numbers starting at 0. > > Bruce Please see the thread titled "acpi on msi-9218 (-current) swaps sio0 and sio1" on the freebsd-acpi@ list. John Baldwin's approach is the one I like, where hints can be used to wire device unit numbers to a particular device with a bus-specific string. For instance, hint.fxp.0.location="0:4:0" would mean a bus/slot/function to PCI and be meaningless to other busses. Another example: hint.sio.0.location="COMA" would mean a Device node in ACPI named "COMA" would be wired to sio0 and meaningless to other devices. As marcel@ pointed out, for serial ports in particular, you want the resource of I/O port as the primary identifier. So the default hint would be something like hint.sio.0.location="io=0x3f8". Other than some minor logic to allocate device units in newbus, the only change would be to decide on location naming schemes for the relevant bus types. Something like "io=0x3f8" might always match resources via RIDs and be bus-independent. I haven't thought much about the best naming scheme but I like the general idea of attaching a named ID to a unit to wire it to a known device, where the name means something to only a particular bus. -- Nate