Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp26816imm; Tue, 3 Jul 2018 13:13:11 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdILFaYGQWvCPYBeT1C7Cq4T/9sTPZXTroBFZJ6oc+qTYx9rprsFbp1uEA+6/gORWxukig1 X-Received: by 2002:aa7:8148:: with SMTP id d8-v6mr31185885pfn.78.1530648791653; Tue, 03 Jul 2018 13:13:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530648791; cv=none; d=google.com; s=arc-20160816; b=NhW9fbWKX0zl6uGQcvpBnPLjNukv97APw4dnhwVoRmH9WJfqbcJ3r0btLdK4jeeNZN 5LN7d/EhAjgUwnr1QE8hbK3HJI3Ye11L2WSokPj3o/PfZ1FSLg2TM42N+YOMGBct6Fpq zWwhXa1vGBMAi24hEIIjWjcuSz2dppQ9IqN+bBQs4vTrFWj7/gUrPa8ds6dgk0v0BbnP 4T7P/SwrIXcivnt/bUagJMr9cKSqj84h9sRQZvtH4vAjXjz4LL8+oKVD+BYkikR6+4q5 oLGOk/PNfLwu0yK8zC+2JGtR/Cln9UI4p0LrYQiuaDNkIy4hkO+RSkYzsb3t/r86hW33 tAHA== 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=hUJ+nv2CU2CNAJE3+tm+gABWkwDjDbMl0OiwQfwWQN8=; b=VXRUjNMzNNIqOf63bt3o7XLQ5J9axcMzTQyS01lGEymD87KQKr7d1SonWs7T9oE+w9 KwBTPf7o5J0Sy11vZinGASea02spMeVbPgPtz9xLTy7Ak0MYDtf7CDJF9429a5bbIJC6 hGiYAhUitjPQIR+sLzGM9vr4v63w0UY/o8DGTxeSY5rqwUo1/ZKZTH7AMXN6nPxrx44A e4frGUEaoZe44BZ5ViAz7AKF74rwlc8OARgV1+PRRTNE6EgTgFFCOP4obqixudRKnX7k 2dMBsu7M/byEOK6+rrtxZVs2b5sVnjE6DjeadGh5jFZ96AgGNewlt35M6r9GxbC64lsK 1kBw== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f1-v6si1642619pge.610.2018.07.03.13.12.56; Tue, 03 Jul 2018 13:13:11 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752767AbeGCUK4 (ORCPT + 99 others); Tue, 3 Jul 2018 16:10:56 -0400 Received: from mail-yb0-f195.google.com ([209.85.213.195]:41206 "EHLO mail-yb0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752898AbeGCUKx (ORCPT ); Tue, 3 Jul 2018 16:10:53 -0400 Received: by mail-yb0-f195.google.com with SMTP id s8-v6so1215022ybe.8; Tue, 03 Jul 2018 13:10:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=hUJ+nv2CU2CNAJE3+tm+gABWkwDjDbMl0OiwQfwWQN8=; b=WOcxDWn0wEfKktWzFkZUzQvczu45gHAHTx9gkCfZrn1M1vPh2Cb5/fDVRDGiC+BmJY 2uSujeosVJQmdZbRl/v9ddf8NXEwFLAAwK4NXf0MQFHqY95aK1M5AgZ3gmAzJuXGm2B6 MEuX8OSUgo0GdDeJu4eHn5jmXiFxYO08O8cfDa+B4dkigKuReeogbqXDFBLo/0ZMWflV 6XXnpMgETrwLbQ/arcZoYR6vF1H9j+1J+o79Ro5hNwQhrG2ENWRig+6G/mbTe2E2C35x 8iekJT1Vg5+zvg17U0Ie2NDbWX+Ek5cUUt1lhiahHOK2lClaLw9hSCB3khkrH8Xu759Q nHRA== X-Gm-Message-State: APt69E0KANjISAQbJB8Bsuy2pTvN3W/29eraL4cfWAwSzVBv84t23H1D v93mozwaYxCIYcCouf3RCA== X-Received: by 2002:a25:7141:: with SMTP id m62-v6mr16787594ybc.422.1530648652604; Tue, 03 Jul 2018 13:10:52 -0700 (PDT) Received: from localhost (24-223-123-72.static.usa-companies.net. [24.223.123.72]) by smtp.gmail.com with ESMTPSA id l14-v6sm677642ywi.35.2018.07.03.13.10.50 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 03 Jul 2018 13:10:51 -0700 (PDT) Date: Tue, 3 Jul 2018 14:10:48 -0600 From: Rob Herring To: Palmer Dabbelt Cc: tglx@linutronix.de, jason@lakedaemon.net, marc.zyngier@arm.com, mark.rutland@arm.com, aou@eecs.berkeley.edu, shorne@gmail.com, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-riscv@lists.infradead.org, Palmer Dabbelt Subject: Re: [PATCH 2/3] dt-bindings: interrupt-controller: RISC-V local interrupt controller docs Message-ID: <20180703201048.GA20288@rob-hp-laptop> References: <20180622232006.12158-1-palmer@sifive.com> <20180622232006.12158-3-palmer@sifive.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180622232006.12158-3-palmer@sifive.com> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jun 22, 2018 at 04:20:05PM -0700, Palmer Dabbelt wrote: > From: Palmer Dabbelt > > This patch adds documentation on the RISC-V local interrupt controller, > which is a per-hart interrupt controller that manages all interrupts > entering a RISC-V hart. This interrupt controller is present on all > RISC-V systems. > > Signed-off-by: Palmer Dabbelt > --- > .../interrupt-controller/riscv,cpu-intc.txt | 41 ++++++++++++++++++++++ > 1 file changed, 41 insertions(+) > create mode 100644 Documentation/devicetree/bindings/interrupt-controller/riscv,cpu-intc.txt > > diff --git a/Documentation/devicetree/bindings/interrupt-controller/riscv,cpu-intc.txt b/Documentation/devicetree/bindings/interrupt-controller/riscv,cpu-intc.txt > new file mode 100644 > index 000000000000..61900e2e3868 > --- /dev/null > +++ b/Documentation/devicetree/bindings/interrupt-controller/riscv,cpu-intc.txt > @@ -0,0 +1,41 @@ > +RISC-V Hart-Level Interrupt Controller (HLIC) > +--------------------------------------------- > + > +RISC-V cores include Control Status Registers (CSRs) which are local to each > +hart and can be read or written by software. Some of these CSRs are used to > +control local interrupts connected to the core. Every interrupt is ultimately > +routed through a hart's HLIC before it interrupts that hart. > + > +The RISC-V supervisor ISA manual specifies three interrupt sources that are > +attached to every HLIC: software interrupts, the timer interrupt, and external > +interrupts. Software interrupts are used to send IPIs between cores. The > +timer interrupt comes from an architecturally mandated real-time timer that is > +controller via SBI calls and CSR reads. External interrupts connect all other > +device interrupts to the HLIC, which are routed via the platform-level > +interrupt controller (PLIC). > + > +All RISC-V systems that conform to the supervisor ISA specification are > +required to have a HLIC with these three interrupt sources present. Since the > +interrupt map is defined by the ISA it's not listed in the HLIC's device tree > +entry, though external interrupt controllers (like the PLIC, for example) will > +need to define how their interrupts map to the relevant HLICs. What are the PLIC to HLIC connections you need to support? 1-to-1 is easy. But I would imagine you'd want the PLIC irq to go to all the HLICs which can't really be described unless you list every CPU's HLIC in PLIC "interrupts" property. We avoid this problem on ARM because a single DT interrupt controller node represents even per cpu interrupts and interrupt cells are used to indicate which CPU interrupts are routed too. That's not perfect either, but seems to be good enough (though maybe Marc Z or Mark R have more thoughts on that). > + > +Required properties: > +- compatible : "riscv,cpu-intc" Kind of vague. There's only one implementation and one set of bugs? > +- #interrupt-cells : should be <1> > +- interrupt-controller : Identifies the node as an interrupt controller > + > +Furthermore, this interrupt-controller MUST be embedded inside the cpu > +definition of the hart whose CSRs control these local interrupts. > + > +An example device tree entry for a HLIC is show below. > + > + cpu1: cpu@1 { > + compatible = "riscv"; > + ... > + cpu1-intc: interrupt-controller { > + #interrupt-cells = <1>; > + compatible = "riscv,cpu-intc"; > + interrupt-controller; > + }; > + }; > -- > 2.16.4 >