From owner-freebsd-arch@FreeBSD.ORG Tue Jul 8 22:54:45 2014 Return-Path: Delivered-To: arch@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3EB1EDA7; Tue, 8 Jul 2014 22:54:45 +0000 (UTC) Received: from gw.catspoiler.org (gw.catspoiler.org [75.1.14.242]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 207EE2EF7; Tue, 8 Jul 2014 22:54:44 +0000 (UTC) Received: from FreeBSD.org (mousie.catspoiler.org [192.168.101.2]) by gw.catspoiler.org (8.13.3/8.13.3) with ESMTP id s68MsaPS028312; Tue, 8 Jul 2014 15:54:40 -0700 (PDT) (envelope-from truckman@FreeBSD.org) Message-Id: <201407082254.s68MsaPS028312@gw.catspoiler.org> Date: Tue, 8 Jul 2014 15:54:36 -0700 (PDT) From: Don Lewis Subject: Re: [patch] axe RF_TIMESHARE? To: adrian@FreeBSD.org In-Reply-To: MIME-Version: 1.0 Content-Type: TEXT/plain; charset=us-ascii Cc: arch@FreeBSD.org X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jul 2014 22:54:45 -0000 On 6 Jul, Adrian Chadd wrote: > On 6 July 2014 17:47, Don Lewis wrote: >> On 6 Jul, Adrian Chadd wrote: >>> Hi, >>> >>> What's it supposed to be used for? >> >> My understanding it that it is supposed to be used to allow two more >> devices to claim the same resource, such as an I/O port range, but only >> one device can be active at a time. > > Interesting. I wonder what kinds of things would want to do this. Not much of anything that I can think of, which is probably why this feature was never used. The closest thing that I can think of is ISA, as Garrett mentioned. The thing that came to mind for me when I started looking at this is ISA attached COM ports. COM1 and COM3 both want to use IRQ 4, and COM2 and COM4 both want to use IRQ 3. The problem is that ISA IRQs can't be shared between slots, so it might be nice if RF_TIMESHARE could be used to share IRQ 3 between a modem card configured as COM4 and the COM2 serial port and then let the user pick the device to enable through software. Unfortunately this won't work because 16550-compatible UARTs don't have a way of disabling their IRQ pin drivers, so this has to be done with jumpers ... > There's a few interesting things like implementing the spibus using > this instead of the current way of calling a bus lock method before > doing any bus IO. The RF_TIMESHARE feature isn't a good fit for this because the resource being managed would be the address space on the SPI bus. If you had two slave devices that had the same starting SPI address, then you could use RF_TIMESHARE, but only if the address blocks occupied by both devices were also the same size (if not the resource manager considers the devices non-shareable), and there was some external way of enabling only one of the devices to listen to the SPI bus at a time.