Received: by 2002:ab2:788f:0:b0:1ee:8f2e:70ae with SMTP id b15csp594646lqi; Thu, 7 Mar 2024 06:28:41 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWpI9/1nMC7f514DeZqrMzSF5rpUNryrvsU29Z6v454igx9w85C1RIZyvQ/38jBfnjfKPrJ1+5RKGrX0saM71CgAduyXDcKVOOBApxWhA== X-Google-Smtp-Source: AGHT+IGuMh40FNt1+NC79dg+6Lqoy8wxgu39UMmfwlcuHHQlc2ZJTw2vSwPUG+cOlRZfpQd0Lrps X-Received: by 2002:a05:6830:607:b0:6e4:fa5a:d832 with SMTP id w7-20020a056830060700b006e4fa5ad832mr7915224oti.13.1709821720859; Thu, 07 Mar 2024 06:28:40 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709821720; cv=pass; d=google.com; s=arc-20160816; b=yENPJMMzV3vOP3JQulW75WOWkYTnaZMz182vVdfcbHSTtNIhUKdDicgpnYB924Mvyz D7wCkLRGnhtiTaLk0UqSMNThQzIXd+UfoDdDxpr+vweNYCIRrvR4zFhb8YOYVsAAhE3m 8ueuTJsiMr8HFHtlDazMrybafgJw7qiVOiES27O65CwGtTMXdIq//S4r6I2/h5W0YxPc +lx3mMeQP/AcmPhKxkmlAIC+zwOgdLxbviQqRdlKXm/ttj7UcMmOJvzArRMxntEOZKTs BHDvJeUpskH7QlOL75rOfm0rEJN3AESGpJF6WqY5v1a0ZGyLjfslFotynSoItAAbWeL5 Ip1A== 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=qx33aNFcCwPjjt7pBdhISz9xS7mJuQYd+i2Q+FG9tns=; b=iJZLcbvQWHsqxNitp3Qp+03Mqt+YToRs7Gw/S2BVuc3POeqgr1XLKpL6GPHyXYVpqI MyTXYsYX2VeDXfWwHYdKZG5TTiN9P+6/H10u4PijwTdU94/g3EaCMQImELxNUWp0J5QV luR8sGaM2MTyUv+YcxM+3Un6OdKOGPCfThE4q8dyQ5ZBAOJhKXoXJqZFaLZOVRXO8Toz TJy620qPHjKCU2ifWTGBSyULLwhRzM0EB1hWh5Lk38n8czrkcF/qe9rqYFFIN9kTjue8 ievoKvad68qmNdnkU5jSnCdEpifCARjFLRB8edunx6uq+8Zojq6SDcaH61Ju3kE36aQt 1goA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=HDFuKBq+; arc=pass (i=1 spf=pass spfdomain=ventanamicro.com dkim=pass dkdomain=ventanamicro.com); spf=pass (google.com: domain of linux-kernel+bounces-95687-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-95687-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id 6-20020a631846000000b005dcb4f1acc6si14140195pgy.176.2024.03.07.06.28.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Mar 2024 06:28:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-95687-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=HDFuKBq+; arc=pass (i=1 spf=pass spfdomain=ventanamicro.com dkim=pass dkdomain=ventanamicro.com); spf=pass (google.com: domain of linux-kernel+bounces-95687-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-95687-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id CBD91B2781E for ; Thu, 7 Mar 2024 14:06:27 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 03F0212FF89; Thu, 7 Mar 2024 14:03:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ventanamicro.com header.i=@ventanamicro.com header.b="HDFuKBq+" Received: from mail-pl1-f170.google.com (mail-pl1-f170.google.com [209.85.214.170]) (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 18E1E12FF74 for ; Thu, 7 Mar 2024 14:03:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.170 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709820233; cv=none; b=eKNK7a31xVmcgBOkg+VCLue1n2qHT2rJGKt+RmBWu5EBsyU5VYFaRnUZ9QM4DG0SdQn0zs886dGbgTpyrTrnqkcH2Zu33Q9oJpTrUWm9AmDFypYl+z9vOVzRXW/mXgllZU4isWCDD92c+5Zh8XH/ZtCDs8dChuopza1AByV4zVc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709820233; c=relaxed/simple; bh=UEqf02ho8KoC5uUf94NdYj/8svBvRgvzCWxf0JoVQU0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=mih5HUldsUuUgCZkqPEXKrZvj0I6HAqvsrLwBH6zI+pwmPYKG3HoyL3UPUY+px3uRf7RwjHX+qrmZZzZLkBs+dOzLqa7IsQU3qYnzjrLr5NmtzbulE1O9ireadMpaAy1dare6FIX3J44fVUszpA0FnPgoj7hZ6QF2PNpfvXCrWc= 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=HDFuKBq+; arc=none smtp.client-ip=209.85.214.170 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-pl1-f170.google.com with SMTP id d9443c01a7336-1dcc7f4717fso8467575ad.0 for ; Thu, 07 Mar 2024 06:03:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1709820229; x=1710425029; 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=HDFuKBq+imwf4yG7G5aQQ0UvEEuWn3P0v6wXPEG7ZJTMlFw5tkHi5V00kc3LmppKZe 5q0y3JzxROeKHjtTaEMM4fXmutKDu+0huwxkFx93//bC08DShneiddKf4FUh/RAp34cd ggKQVfSacdtfNNF1OQkcoamkrkT71iK7gdm6gGaTUB/02y7fH6WZuRihmhUrlQ/0eidZ H8Ove4ehpI7fG38g75O+OSF5XCcl1Kgbj1rp9wtGsxKowzBoIIj1rSGBSsy13jp9YByP F4JaNeFSuqJDlkvroJ5+AbzYXmWVlh44vhLkg8VpBLmEEUQL/gNu8GdirnII+wcxDuLB ESVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709820229; x=1710425029; 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=oHzk3Q9Qvec4trTi32F67xlgAyN+DBbYMsCFz2XoM+tRtrSskvLp05frXEPD7hA2Nt 7Z2JMT1p0VY8mv7sRRNB3pXWwYCbrv7gZa4gGdKdHFoiMJx8hcNrxXj1sL8Powp+KxcM cIn+5VgTEoyi/xnhiGFWS1L7N4tVdH96XXTVLrzF5SxPTfC6CoGsv0SQYEeZfO3YOBaR NKxBlrEp8VgpQh7NFL5FMk7E362upKb88d7JQs6DbHUSgk8wH3odkbRoDusCYL4sNZqT M94W9yOztNEMlIqcHDoP4zF2otCbHrWaSgm0tPaOV8qJs0RsUWE2nrWY653n8SG/mJJZ 5TXg== X-Forwarded-Encrypted: i=1; AJvYcCWF4QEqAFRd7fbsSG9nsRHOLqJ8MKl+ejgHbwXuPRI9tpQRMtPnrfpTUOkbWpLdXTpS4QGomS6W7yW+eZEIJ48YFm5bdmCBQMiy1+V8 X-Gm-Message-State: AOJu0Yw2uEMpeF595fdcISUM/Gus1WwZe/S9EaJivZ4iR6JBW6ZRg4vs JgxSi6Q+cKqp3AYOb49gdb6R6OizyFvqpQ79LI5vY8h8jioZoJDw4Hbn75ykaV4= X-Received: by 2002:a17:903:1245:b0:1dc:abeb:22fe with SMTP id u5-20020a170903124500b001dcabeb22femr9617182plh.65.1709820229184; Thu, 07 Mar 2024 06:03:49 -0800 (PST) Received: from anup-ubuntu-vm.localdomain ([171.76.84.79]) by smtp.gmail.com with ESMTPSA id w1-20020a1709026f0100b001dd6174c651sm386228plk.149.2024.03.07.06.03.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Mar 2024 06:03:48 -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 v16 5/9] dt-bindings: interrupt-controller: Add RISC-V advanced PLIC Date: Thu, 7 Mar 2024 19:33:03 +0530 Message-Id: <20240307140307.646078-6-apatel@ventanamicro.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240307140307.646078-1-apatel@ventanamicro.com> References: <20240307140307.646078-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