Received: by 2002:a05:7412:798b:b0:fc:a2b0:25d7 with SMTP id fb11csp230991rdb; Thu, 22 Feb 2024 01:44:38 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXtrkhMrl7OKcvsWgz6kmvXncTqwW5wt2ILrfe2/vYMhJPScMfNmVxOGdzDAMvSgmzfD5vKAc/8+RIJJWrJ6OyovLb63t4JgftQCvfRog== X-Google-Smtp-Source: AGHT+IGmx25RT2vtVQJDWPJENqKq6h7I9mIu8YgTq0uEjB6m1tb2MTSvVqBxV0eSxWuldC8Hwldg X-Received: by 2002:a17:906:fc05:b0:a3e:c245:9a6d with SMTP id ov5-20020a170906fc0500b00a3ec2459a6dmr8083789ejb.46.1708595078175; Thu, 22 Feb 2024 01:44:38 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708595078; cv=pass; d=google.com; s=arc-20160816; b=G3EUahKHc1eYbJzK/pnhFrXZa4XnEv9IMyKatT8HiCb1AW8JSsXnPpgAkJFFFTQ+kF q6hkZcJFF6/q5wJCHU5W164yaaV7GFfypQvBULCmF/uZNYqWBrWvLKcp6XHf86emAxVu NEV4NchxFcP1V81+4rpVujXuVIad0i+tdVpin6sUXAfUM6Fv9cqCZYsbwppsyWvtnI9h FTsapXA7E2xpiU89MT9HNuHNntDWTdbvusQc9009CBQyRD2A8SE7g6dK0ysxgS94qCIk pU4LOGbSjfv53RRWyZdlgHfuV8+b6+XFS/+34iKp9JRuh8+bqKKPJFzmaNNvg27wym+I i2Tg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=zlSSXeqmMrWeTCyKtywicMr25YT1KxbVoTbJX7XSN9g=; fh=mazto16OcS5dnj6fQlTgz3PsDqFRSSjBen4393NdukI=; b=T0zxvdhDQUjCRQhttgf4Kovq+p6QsYq94FsNXxm4tdSgWdK6aa6RDYfydgrP68cBsn GQh6kcnHRMQ4nwl/fEdUSKSIw5e+TC52E+vhX9ehygJywDhXa77KMMw04y/d5S/4CJwf 4ivOLpAXsabAWzUgMWYC6Gpj2BRCYQLch+P77Gp4AzEJOHbCsM4FA9A0sPux3WyQJ0Ih EdfCSey0ozvzuNDvv8rq8V8U6tcmxUjI5nNoo1IGu8s3vdC78ORHDHxr9gGreab9cQcr /y4RLPEbrMhH+Q1L0F3rDUlGd0Js407QtWQ4flJ+VQvvtCON+9FP5Q5BOo+6PE+6MrWN 3OBg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=QF6asOKp; arc=pass (i=1 spf=pass spfdomain=ventanamicro.com dkim=pass dkdomain=ventanamicro.com); spf=pass (google.com: domain of linux-kernel+bounces-76255-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-76255-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id br12-20020a170906d14c00b00a3e627012c6si4033994ejb.828.2024.02.22.01.44.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 01:44:38 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-76255-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=QF6asOKp; arc=pass (i=1 spf=pass spfdomain=ventanamicro.com dkim=pass dkdomain=ventanamicro.com); spf=pass (google.com: domain of linux-kernel+bounces-76255-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-76255-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id BCA7B1F2192A for ; Thu, 22 Feb 2024 09:44:37 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1C0B13EA77; Thu, 22 Feb 2024 09:42:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ventanamicro.com header.i=@ventanamicro.com header.b="QF6asOKp" Received: from mail-oi1-f176.google.com (mail-oi1-f176.google.com [209.85.167.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5F7FF3C486 for ; Thu, 22 Feb 2024 09:42:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.176 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708594932; cv=none; b=KhWpZkOc0nEKYdpYlgulwKBtn2QLivBTlAsDJnZlpnOs+n6D0BaJs5cTSKKys65ABQgTrh2oM/qFfilmKGem711iftdokXAlC/qHD7OSIYqMKvZ3XasiWskQODRuCfBqkwLUxNdXC4ReUfdci1ThJnZmQJHyja2ilGeQomzI/oc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708594932; c=relaxed/simple; bh=UEqf02ho8KoC5uUf94NdYj/8svBvRgvzCWxf0JoVQU0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=PfQ6oQJuPTNACmGT9qh4hWS6mq64m4xnWRs9Px4tVQl2qlTybgaSaQd2aX0D0SwhToVF8OSJiB+BX0GEyxrlDGIrEEtpDyQgV67DJhZjt96OXzu3gZKaxMCkm2enQ7cqQn9HEF+LqZqXqT4/pFKB7v/Mqezppp6gR8S5uPnRKsU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ventanamicro.com; spf=pass smtp.mailfrom=ventanamicro.com; dkim=pass (2048-bit key) header.d=ventanamicro.com header.i=@ventanamicro.com header.b=QF6asOKp; arc=none smtp.client-ip=209.85.167.176 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ventanamicro.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ventanamicro.com Received: by mail-oi1-f176.google.com with SMTP id 5614622812f47-3bba0ac2e88so404442b6e.0 for ; Thu, 22 Feb 2024 01:42:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1708594929; x=1709199729; darn=vger.kernel.org; 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=zlSSXeqmMrWeTCyKtywicMr25YT1KxbVoTbJX7XSN9g=; b=QF6asOKp9eyFKTtwvfKq740bVQbJ9ZdNizaAC3Eq2pj6naJNTqLbQ4xMollUSI+3iV UR9l+lJcR18pU7yaWNYU4qu4qoeK1IsF6n7MzDZrnJVW3WGJuc8lOSpjRgc9nQq6A5GG eQlzoFoQa8HzzOx0L42vOKIocjLCWP7t/URQDWdzBc05ewa8LsYJiGEWpHs4YOaPEmye DchdDgUhj+w+klOffLeiZwHzOqTLvjvTklCKaU8W3Sg8KvMGVkh668a7n5RXFuyih5jH EyxYGsoZxa9K/rwMvXGa6aGbrjkvorhb//6XinRWbwqn5OEOc2+Um9VyOqRoXAlTIu6X aTcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708594929; x=1709199729; 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=zlSSXeqmMrWeTCyKtywicMr25YT1KxbVoTbJX7XSN9g=; b=BmdnUk/Z0UhhqLbQdYLKbJ8JLcpVqOjrY/Yet8Z8ZgPbgSYluK97m1mZqW4TlvoxhK jx+2jMs1wq2yyTkn8zGhfuutupM0J38Y4JB72EdnBEtPnhnwEyni5T3BhYL3drkV/WC5 hGiR/zsNt4Cb3ytEw1LIaDWlqpCzIWCny9ZQ4J9povZJf4/ZK9UuiSKlRS05AY4Qgj7R ZCfOXKhjERzcIrNzlTED+2UMa6LHEzV7m1r7djNnXOpkdTAKMEsgPsLuw2rfxmUqudDv x26ndRHpHhte1P512ilayKwX5P/Ru1mJcOoPDJWWTsQbHiOHwFVM1rCE6lmuLSiZmy57 2P7g== X-Forwarded-Encrypted: i=1; AJvYcCUDhvNj7uzPKli3YLT0QQj832AXI9NDBTvpsB5ulZGCOKElUS7ltKHH8q6i5xk3N3ffJvDZLGuG5Nm/ER/oXMglJr5t16yQ3I6MUgLF X-Gm-Message-State: AOJu0YyjfWRvWamIkP68s2dIMNJSIPoQnzwaUkKmIZ64L2A9X/pqVbrp 7Pjeyn0fhtC1gpRlEtSSAe17mY92OG+I0fR5auTcBJ5W7viKxBRWWZDqsS971/Y= X-Received: by 2002:a05:6808:118c:b0:3c1:57a2:21ef with SMTP id j12-20020a056808118c00b003c157a221efmr973715oil.23.1708594929180; Thu, 22 Feb 2024 01:42:09 -0800 (PST) Received: from anup-ubuntu-vm.localdomain ([103.97.165.210]) by smtp.gmail.com with ESMTPSA id n15-20020a05680803af00b003c17c2b8d09sm130699oie.31.2024.02.22.01.42.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 01:42:08 -0800 (PST) From: Anup Patel To: Palmer Dabbelt , Paul Walmsley , Thomas Gleixner , Rob Herring , Krzysztof Kozlowski , Frank Rowand , Conor Dooley Cc: Marc Zyngier , =?UTF-8?q?Bj=C3=B6rn=20T=C3=B6pel?= , Atish Patra , Andrew Jones , Sunil V L , Saravana Kannan , Anup Patel , linux-riscv@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Anup Patel , Conor Dooley Subject: [PATCH v14 14/18] dt-bindings: interrupt-controller: Add RISC-V advanced PLIC Date: Thu, 22 Feb 2024 15:10:02 +0530 Message-Id: <20240222094006.1030709-15-apatel@ventanamicro.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240222094006.1030709-1-apatel@ventanamicro.com> References: <20240222094006.1030709-1-apatel@ventanamicro.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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