From owner-freebsd-mips@FreeBSD.ORG Tue Jan 6 03:26:46 2015 Return-Path: Delivered-To: freebsd-mips@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1554A64F for ; Tue, 6 Jan 2015 03:26:46 +0000 (UTC) Received: from mail-ig0-f169.google.com (mail-ig0-f169.google.com [209.85.213.169]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CBBE82292 for ; Tue, 6 Jan 2015 03:26:45 +0000 (UTC) Received: by mail-ig0-f169.google.com with SMTP id z20so4236102igj.4 for ; Mon, 05 Jan 2015 19:26:45 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:subject:mime-version:content-type:from :in-reply-to:date:cc:message-id:references:to; bh=kQ5a0muy5IOh9dHYTsugoeVL/AmB5bUEFdWwj2mYKH4=; b=YtmNdu747P4LEE53+/LlxNycBt/Y8YZdtQnL1pyYU7+A4Zi0QY9ysyNcxFDwqke0BE fubx8OwH03YG+SUwIu/MsfFplRTGf4D0U4fhsZiOtId+/Y/dAkaqCMo8MO7vfkuNDJg3 szSe8iBKtIcPF6Vl+gL9J77mZBKMRLWQjCgeRx+rc9IzUr+kl0/JWVS++5dkychFV8UP UTnu07ZWp+nQzN0vjoD8Wz+jPeaDdl3WcmnGD6qQ1JLAIMDdWwnWKvA8ncNn9dwcDmwz rdEttEnxmqU1FQj67TGkrBExlgq504jDRgLnTF6ajG6yXilQFjh5ZVog8iIZsBX0cFJo Nziw== X-Gm-Message-State: ALoCoQmnrm5oCTcNUJb3rwbLEMGW0+50xImYcaQDTmQbUA2rGUx4nnbVZrPuCIZkIjEbWuCchmRp X-Received: by 10.50.138.107 with SMTP id qp11mr14051096igb.46.1420514802151; Mon, 05 Jan 2015 19:26:42 -0800 (PST) Received: from netflix-mac-wired.bsdimp.com ([50.253.99.174]) by mx.google.com with ESMTPSA id o72sm27502939ioo.14.2015.01.05.19.26.41 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 05 Jan 2015 19:26:41 -0800 (PST) Sender: Warner Losh Subject: Re: interrupt muxes, bus memory space and other fun amusing things Mime-Version: 1.0 (Mac OS X Mail 8.1 \(1993\)) Content-Type: multipart/signed; boundary="Apple-Mail=_5A80BF58-FCAC-4A55-8550-F708A28358CB"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail 2.5b3 From: Warner Losh In-Reply-To: <1420514079.14601.7.camel@freebsd.org> Date: Mon, 5 Jan 2015 20:26:39 -0700 Message-Id: <3AB1B833-6D17-44C4-B588-8CEAB0CA4A42@bsdimp.com> References: <5F7CBB50-6C91-49C9-BF69-301496DDE792@bsdimp.com> <9F6D585C-7590-4D25-879B-A76D8A959E01@bsdimp.com> <1420514079.14601.7.camel@freebsd.org> To: Ian Lepore X-Mailer: Apple Mail (2.1993) Cc: Warner Losh , "freebsd-mips@freebsd.org" , John Baldwin X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Jan 2015 03:26:46 -0000 --Apple-Mail=_5A80BF58-FCAC-4A55-8550-F708A28358CB Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Jan 5, 2015, at 8:14 PM, Ian Lepore wrote: >=20 > On Mon, 2015-01-05 at 20:10 -0700, Warner Losh wrote: >>> On Jan 5, 2015, at 1:31 PM, Adrian Chadd wrote: >>>=20 >>> On 5 January 2015 at 08:41, Warner Losh wrote: >>>>=20 >>>>> So if I were Linux, I'd just implement a mux that pretends to = trigger >>>>> interrupts in a much bigger IRQ space. Ie, they map IP0..IP7 to >>>>> irq0..7, then they pick another IRQ range for the AHB interrupts, = and >>>>> another IRQ range for the IP2/IP3 interrupt mux. They have a >>>>> hard-coded mux that takes care of triggering the software IRQ = based on >>>>> the hardware interrupt and mux register contents. >>>>>=20 >>>>> So, how should I approach this? >>>>=20 >>>> Same way. You=E2=80=99d create an interrupt device that registers = an interrupt >>>> for the mux, then farms it out based on the contents of the = registers. >>>> The MIPS interrupt handler might need some work (arm did) to >>>> allow this to happen, but it isn=E2=80=99t super difficult (though = IIRc it is tedious). >>>=20 >>> Ok. So I can do that, but then devices hang off of which bus? = nexus0? >>> Or this mux? >>>=20 >>> Can I create a mux bus to hang things off of that just pass all the >>> memory region requests up to the parent bus (nexus in this case) ? >>=20 >> The hard part is mapping an interrupt provided by a mux to a resource >> number. However, we already do this for the =E2=80=98hard wired=E2=80=99= interrupts >> that are muxed through APIC or PIC controllers on x86. I fail to see = how >> this is any different, apart (perhaps) from the need to do things = dynamically >> in some way. >>=20 >> Warner >>=20 >=20 > It sounds like mips is ready for intrng. Which would then give us = ppc, > arm, and mips all with a conceptually-similar intrng-like layer for > handling non-hierarchical interrupt sources and controllers and = mapping > between rman and hardware ideas of interrupt number. Hmmm. This = would > be the time to argue for a nice shiny new MI intrng implementation... > except that we can't quite drive even the arm-only version to > completion. Maybe now=E2=80=99s the time? Warner --Apple-Mail=_5A80BF58-FCAC-4A55-8550-F708A28358CB Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJUq1XwAAoJEGwc0Sh9sBEAPfYQALK8VaS+NpppE60yn50gkxEm rU+w+i4yMg+R7yhTZhytNMuIL0BA0w9BakGmmD9K0A3JXbF7aHBt+w/LwWwVOAfH 025rZppZK2lveboFQ3t2xngsdwFC6KmsSY6tFsA1SR66HFeO29Bh2fisxtNmqdZP uvyZ1/J7nPGphr+3PPx8e/lA+qfijeP2hfe6axYsiuYKH6sb0qB0A/wcM/isznDa L5hdmKVYdryk0TSbgEbHpz4IhaWx+zdHdj9ULi7G8bZhq3qF/raNrrm32bSS5y8j Uroq8BlAVOKGUxOQqHdlwsnj2wZpJrTStWbt7eYrUOi7okv6VTc5ye9oGo37T9WS 9nh27DsOPfNzJHMA3sDjTUEM7tI84awpG/4oSAlveQTQI26xE2ziqXOWhF4kzJOc IKEv+22ikjsxMIlbCLu5ECfYpsFqq2KMhEIikAUcAUfV7tMl1/cOjAL37yXyC9JU ABlFUYJ6lYbQQDKnnT/icsXeTOLioyV3ZixdqTE12bJY25IMeftLlWENqyTTFCDa 5bH1qkNgPbzRrosBm3Y6GO4w5YEVIskbASXFCASGVGFzU+Iz43fFQtQC2e3iQWdr rvX2xzMIUvQQwEmKucJHsyCcxgQRX0whsSegDNJ7vjNYiq3UBLhPLs78+EKVOaBI BoBQwUTWN80zcnJUz9g6 =tWdH -----END PGP SIGNATURE----- --Apple-Mail=_5A80BF58-FCAC-4A55-8550-F708A28358CB--