Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp181373imm; Thu, 26 Jul 2018 01:24:34 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdOP+dDucgdS11QvOv+NIq3ZcWfeSsacZUBJHsg7E8gnvYq16KeQvFLOmf6hCaEYYLaL6dQ X-Received: by 2002:a62:c00c:: with SMTP id x12-v6mr1117755pff.216.1532593474540; Thu, 26 Jul 2018 01:24:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532593474; cv=none; d=google.com; s=arc-20160816; b=S3u3aHVMloWKvZMcT/fqSIS3N0fbzV4mXg55AvgrbHZ29GHuwgEhY1l2ArAvmsoWOB v7Y9rn05Pguwob34ZVt1oUT+Ib2v1ZWWIcf4QnJCNyuzBTbZbIpPEHS2e8fOtynOcfzA HFBtQkUzRUiHZyblxOLphusDU4c04tyrCOkmQCcLF6QSfxnZmYla0Z9UNASADYPvGj1B nRcK9c9qvtk/3h/ra4dKc34+3C/RyqQkGpZpR/n7pSWRyTd18o3yV6u56OtL96gI6ZU8 HSoT9+zQBnaCXCgh+b4DKbKliJAYeamizo4B8k0p16HqPkQ3rUBQm6t/I5OHuyC2/pii nlqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=OQehJRMrHLHjDMkdqQNcNzqVtE/lzArTogeoN5RXmwA=; b=EVE8wZ3o6IBc2v+y9BUHYt5fRxDSN/l6MroLn3mQOiSm6JZp3nVSQT7ERq4YSJxqNv hVs7qR6bDlqYvGfRAFf2FLnUyxHrtrQwL9GsnlYO6s2QsTAV1Qqf31rfQi8Iy7lD8EJ0 ZRcqZD0KRTiE9WB9mA8VTWLEvSHXr4Anw0lbJn1NmYwzEFUOodi8Zc+5vjYelVqPN/z/ BGzp6sYIfT49wk4cR+M7npwEhT/egNzhXcHNzLjR+pisy9GOyTK9Ta/6LShwxc96Gjx9 XUrWdEotW+640iHrTWSCHMG0Cc3d7+zOASl7C/yBs1qWb3YadI8maBIbW0od16iKBP43 km5A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 68-v6si774628pga.113.2018.07.26.01.24.20; Thu, 26 Jul 2018 01:24:34 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729176AbeGZJjI (ORCPT + 99 others); Thu, 26 Jul 2018 05:39:08 -0400 Received: from verein.lst.de ([213.95.11.211]:35298 "EHLO newverein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729111AbeGZJjI (ORCPT ); Thu, 26 Jul 2018 05:39:08 -0400 Received: by newverein.lst.de (Postfix, from userid 2407) id CF36E68D64; Thu, 26 Jul 2018 10:27:06 +0200 (CEST) Date: Thu, 26 Jul 2018 10:27:06 +0200 From: Christoph Hellwig To: Anup Patel Cc: Christoph Hellwig , Marc Zyngier , Thomas Gleixner , palmer@sifive.com, jason@lakedaemon.net, Rob Herring , Mark Rutland , devicetree@vger.kernel.org, aou@eecs.berkeley.edu, "linux-kernel@vger.kernel.org List" , linux-riscv@lists.infradead.org, shorne@gmail.com, Palmer Dabbelt Subject: Re: [PATCH 3/6] irqchip: RISC-V Local Interrupt Controller Driver Message-ID: <20180726082706.GA22868@lst.de> References: <20180725093649.32332-1-hch@lst.de> <20180725093649.32332-4-hch@lst.de> <20180725112457.GA24502@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 26, 2018 at 09:08:00AM +0530, Anup Patel wrote: > Actually, RISCV HLIC and PLIC are very similar to RPi2 and RPi3 SOCs. > > On RPi2 and RPi3, we have per-CPU BCM2836 local intc and the global > interrupts are managed using BCM2835 intc. You should certainly have > a look a this drivers because these very simple compared to GICv2 and > GICv3 drivers. Yes, using that model makes writing the per-cpu irq controller driver trivial. But retrofitting it into the device tree, where the existing bootloader (bbl) assumes the old DT layout is a giant pain in the neck. At the same time I'm still not conveninced RISC-V really needs a full irqchip driver for the per-cpu interrupt 'controller' really is nothing but 1 and a half architectural control registers: - the scause register that contains the reason for an exception (any exception including syscalls and page faults) for the entry into supervisor mode. This includes a bit to indicate interrupts, and then logical interrupt reason, out of which only three are interesting for supervisor mode (timer, software, external) - the sie register that allows to to enable/disable each of the above causes individually So after burning out on DT hacking (never mind retrofitting that into actual shipping SOCs vs just qemu) I'm going to try a version that doesn't add an irqchip for this but just handles it hardcoded in RISC-V do_IRQ. I'll still keep the irqchip for the PLIC, which while specificed in the RISC-V spec isn't architectural but an actual periphal.