Received: by 2002:a05:6358:700f:b0:131:369:b2a3 with SMTP id 15csp1168614rwo; Wed, 2 Aug 2023 09:39:57 -0700 (PDT) X-Google-Smtp-Source: APBJJlFxYQ3vd0tNjJ81Zqa+7FcBH0k4SW6DzK74/4J7Pz8QRrgAgIiz3inet1639Jbmedq72+nr X-Received: by 2002:a05:6a21:7885:b0:13d:1f99:42f6 with SMTP id bf5-20020a056a21788500b0013d1f9942f6mr15076435pzc.6.1690994397074; Wed, 02 Aug 2023 09:39:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690994397; cv=none; d=google.com; s=arc-20160816; b=BABPwm3fNOIwNTQZITJ7MMbKJVBrgbQHwKOWTFW4HqDZCRXIeQ5R/eUi+3NKGcvEXq UUlNgB/IOlLpIbKvkVyYk0RS0ozxNku++f5UOGJrIAU2iPlKZqrWOH3acurU4XfwSzVe 3HSuvX2YdF8bshmrL6Gms3SQfHtlJd+aUgN6OnRLVn6ltDKGD+eAeRjpBhbQEPiUUesX 0Hmd4pe7euq7AUhb/CqkguPYooslOL/IUYwglRfi9YY8GRExeFAiQufZ7Z7xJghkIu5K xhKZAi7SUvmibGT/FrwFyv3BM0LLw8Ff4otWRngq9cPhV3Xk6pCFSSf6F8Y7pm4pFvd9 A1Rw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=TYQsgV6mmNiNxm7fkk00HaM0IkP9BeYIjrigTOut9Eg=; fh=8m+Qugx0YCe3J0aL3Z7R+kaNUz9VtmAQoBZcDnpkg3Q=; b=bIRJHW12qxM675GpSi1thx49yB5Da/oK5x1fnE5KFRUmUI3zDUxFl23tjUQKfnt8hZ Usi1BeKJINTIMqvZZWwT7fy3VTgTrfj7BQq1WXf/JGrQ4N7c5Fbul/sPhT4QzpI/h/dx i82Em+qpQlnJ7mcbT3VoHrzbAnOgxxR7BCYhrxsuIYfonLxTHQlytBuejrcz2WIY3m2t UoKj597H9hL2NJe/+wdPXrup1oTnt7S7llfoA9Xi7XA21jgLGAgQcuzndPXVZjrI9qMu hOOJBo9jfMf1Tdng7bhtwsm+8DajRcYMuQTmva1BQTAkMOdQp4eMH4SP0V8Zki7zoqEj 91YA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=LbInAXu2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s11-20020a056a00194b00b006683174a49csi11123951pfk.198.2023.08.02.09.39.44; Wed, 02 Aug 2023 09:39:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=LbInAXu2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234680AbjHBPDO (ORCPT + 99 others); Wed, 2 Aug 2023 11:03:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54282 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234520AbjHBPC3 (ORCPT ); Wed, 2 Aug 2023 11:02:29 -0400 Received: from mail-pl1-x634.google.com (mail-pl1-x634.google.com [IPv6:2607:f8b0:4864:20::634]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DB27D19AD for ; Wed, 2 Aug 2023 08:01:49 -0700 (PDT) Received: by mail-pl1-x634.google.com with SMTP id d9443c01a7336-1b8b2886364so43577135ad.0 for ; Wed, 02 Aug 2023 08:01:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1690988501; x=1691593301; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=TYQsgV6mmNiNxm7fkk00HaM0IkP9BeYIjrigTOut9Eg=; b=LbInAXu2OGcRpPPGTS1XzCpCvAvEr3UtelNout8VjWjuCvzxJ3vscWkz84uGtF1r7j iot3bx9Gt+QrdKX6gOU/Ubu5h2m7tMDcp0jaY8c7Q96oXpp8Drl16Q6gV8qIpon2CNy0 dIl0ivvylnFiHkT4WVg0XcsFZ1gIUdlfHsDfMv3528eE2F/XrYWfuuuu1dpZhxjhLmAQ qf7ns9uYq9s1gvgy6aUE3O2DqqIETOQZpehlKJkZ0f2ISSytJYF+XxA5j+1XfhxWz0ku AQWaO/Xynpr9o6yDSlKzXoJ7I04x5hybEjblr6MmDcWWi6ns3h7iMmAe9Ye/2DUYeyvg ssCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690988501; x=1691593301; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=TYQsgV6mmNiNxm7fkk00HaM0IkP9BeYIjrigTOut9Eg=; b=jyIgnkGLfIk9BEjbWPc5rRT27uHiTUEJJp209g7fmN5hN63M9804DMDXK0Q5vbh+Ix 5lzCxg0s6ahwCwFcsmHYaTnLLpVxWP1RMnFzAFmZC98oqft7Jze3IksxdiHMOicfeLHM mxAzZON/MnvtZOUk90myX/keONDNpF4tJEkSfatwoebRcRds/cCfLKBp5YFHUb1zC1vz 4D7OZCF4qGLpEpjr/nG/GeZHks6OwjD6fuUAMtvLi7ODatyLmF8wOOGbH5xRx2Bb2xSD 4s4/4iPSxTIK053s2RwXg28nkz0drHsxm262iinrm/IZ+ycPiK6fVRXyEQi+1NuUXJnw vLXQ== X-Gm-Message-State: ABy/qLZ59XfWBLNk/IGQsZgVSl/aAOapGd7RRJv9o+pyM44PnbLcv2Pq QktRBwOXIjhA3v5D6PJ3et90jQ== X-Received: by 2002:a17:903:1cb:b0:1b8:9044:9ede with SMTP id e11-20020a17090301cb00b001b890449edemr17407191plh.62.1690988500731; Wed, 02 Aug 2023 08:01:40 -0700 (PDT) Received: from anup-ubuntu-vm.localdomain ([103.97.165.210]) by smtp.gmail.com with ESMTPSA id v11-20020a1709028d8b00b001bb99e188fcsm12503963plo.194.2023.08.02.08.01.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Aug 2023 08:01:40 -0700 (PDT) From: Anup Patel To: Palmer Dabbelt , Paul Walmsley , Thomas Gleixner , Marc Zyngier , Rob Herring , Krzysztof Kozlowski , Frank Rowand , Conor Dooley Cc: Atish Patra , Andrew Jones , Sunil V L , Saravana Kannan , Anup Patel , linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Anup Patel , Conor Dooley Subject: [PATCH v7 11/15] dt-bindings: interrupt-controller: Add RISC-V advanced PLIC Date: Wed, 2 Aug 2023 20:30:14 +0530 Message-Id: <20230802150018.327079-12-apatel@ventanamicro.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230802150018.327079-1-apatel@ventanamicro.com> References: <20230802150018.327079-1-apatel@ventanamicro.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org We add DT bindings document for RISC-V advanced platform level interrupt controller (APLIC) defined by the RISC-V advanced interrupt architecture (AIA) specification. Signed-off-by: Anup Patel Reviewed-by: Conor Dooley --- .../interrupt-controller/riscv,aplic.yaml | 172 ++++++++++++++++++ 1 file changed, 172 insertions(+) create mode 100644 Documentation/devicetree/bindings/interrupt-controller/riscv,aplic.yaml diff --git a/Documentation/devicetree/bindings/interrupt-controller/riscv,aplic.yaml b/Documentation/devicetree/bindings/interrupt-controller/riscv,aplic.yaml new file mode 100644 index 000000000000..190a6499c932 --- /dev/null +++ b/Documentation/devicetree/bindings/interrupt-controller/riscv,aplic.yaml @@ -0,0 +1,172 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/interrupt-controller/riscv,aplic.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: RISC-V Advanced Platform Level Interrupt Controller (APLIC) + +maintainers: + - Anup Patel + +description: + The RISC-V advanced interrupt architecture (AIA) defines an advanced + platform level interrupt controller (APLIC) for handling wired interrupts + in a RISC-V platform. The RISC-V AIA specification can be found at + https://github.com/riscv/riscv-aia. + + The RISC-V APLIC is implemented as hierarchical APLIC domains where all + interrupt sources connect to the root APLIC domain and a parent APLIC + domain can delegate interrupt sources to it's child APLIC domains. There + is one device tree node for each APLIC domain. + +allOf: + - $ref: /schemas/interrupt-controller.yaml# + +properties: + compatible: + items: + - enum: + - qemu,aplic + - const: riscv,aplic + + reg: + maxItems: 1 + + interrupt-controller: true + + "#interrupt-cells": + const: 2 + + interrupts-extended: + minItems: 1 + maxItems: 16384 + description: + Given APLIC domain directly injects external interrupts to a set of + RISC-V HARTS (or CPUs). Each node pointed to should be a riscv,cpu-intc + node, which has a CPU node (i.e. RISC-V HART) as parent. + + msi-parent: + description: + Given APLIC domain forwards wired interrupts as MSIs to a AIA incoming + message signaled interrupt controller (IMSIC). If both "msi-parent" and + "interrupts-extended" properties are present then it means the APLIC + domain supports both MSI mode and Direct mode in HW. In this case, the + APLIC driver has to choose between MSI mode or Direct mode. + + riscv,num-sources: + $ref: /schemas/types.yaml#/definitions/uint32 + minimum: 1 + maximum: 1023 + description: + Specifies the number of wired interrupt sources supported by this + APLIC domain. + + riscv,children: + $ref: /schemas/types.yaml#/definitions/phandle-array + minItems: 1 + maxItems: 1024 + items: + maxItems: 1 + description: + A list of child APLIC domains for the given APLIC domain. Each child + APLIC domain is assigned a child index in increasing order, with the + first child APLIC domain assigned child index 0. The APLIC domain child + index is used by firmware to delegate interrupts from the given APLIC + domain to a particular child APLIC domain. + + riscv,delegation: + $ref: /schemas/types.yaml#/definitions/phandle-array + minItems: 1 + maxItems: 1024 + items: + items: + - description: child APLIC domain phandle + - description: first interrupt number of the parent APLIC domain (inclusive) + - description: last interrupt number of the parent APLIC domain (inclusive) + description: + A interrupt delegation list where each entry is a triple consisting + of child APLIC domain phandle, first interrupt number of the parent + APLIC domain, and last interrupt number of the parent APLIC domain. + Firmware must configure interrupt delegation registers based on + interrupt delegation list. + +dependencies: + riscv,delegation: [ "riscv,children" ] + +required: + - compatible + - reg + - interrupt-controller + - "#interrupt-cells" + - riscv,num-sources + +anyOf: + - required: + - interrupts-extended + - required: + - msi-parent + +unevaluatedProperties: false + +examples: + - | + // Example 1 (APLIC domains directly injecting interrupt to HARTs): + + interrupt-controller@c000000 { + compatible = "qemu,aplic", "riscv,aplic"; + interrupts-extended = <&cpu1_intc 11>, + <&cpu2_intc 11>, + <&cpu3_intc 11>, + <&cpu4_intc 11>; + reg = <0xc000000 0x4080>; + interrupt-controller; + #interrupt-cells = <2>; + riscv,num-sources = <63>; + riscv,children = <&aplic1>, <&aplic2>; + riscv,delegation = <&aplic1 1 63>; + }; + + aplic1: interrupt-controller@d000000 { + compatible = "qemu,aplic", "riscv,aplic"; + interrupts-extended = <&cpu1_intc 9>, + <&cpu2_intc 9>; + reg = <0xd000000 0x4080>; + interrupt-controller; + #interrupt-cells = <2>; + riscv,num-sources = <63>; + }; + + aplic2: interrupt-controller@e000000 { + compatible = "qemu,aplic", "riscv,aplic"; + interrupts-extended = <&cpu3_intc 9>, + <&cpu4_intc 9>; + reg = <0xe000000 0x4080>; + interrupt-controller; + #interrupt-cells = <2>; + riscv,num-sources = <63>; + }; + + - | + // Example 2 (APLIC domains forwarding interrupts as MSIs): + + interrupt-controller@c000000 { + compatible = "qemu,aplic", "riscv,aplic"; + msi-parent = <&imsic_mlevel>; + reg = <0xc000000 0x4000>; + interrupt-controller; + #interrupt-cells = <2>; + riscv,num-sources = <63>; + riscv,children = <&aplic3>; + riscv,delegation = <&aplic3 1 63>; + }; + + aplic3: interrupt-controller@d000000 { + compatible = "qemu,aplic", "riscv,aplic"; + msi-parent = <&imsic_slevel>; + reg = <0xd000000 0x4000>; + interrupt-controller; + #interrupt-cells = <2>; + riscv,num-sources = <63>; + }; +... -- 2.34.1