Received: by 2002:ab2:788f:0:b0:1ee:8f2e:70ae with SMTP id b15csp577026lqi; Thu, 7 Mar 2024 06:04:58 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXkqQarh+5OnoF1OvFRMy4RZJPKtrjcad5M5ZrbaAeMhFTRoPf9fsM2UsanHS3nAEiGj857EeKhZNHOTDyhgbQ6IiFqISQo/4D+L0sKjg== X-Google-Smtp-Source: AGHT+IFEUJrMBsZVyMG1lSnIX1lTe8rFwO4OOJI1OU2DCTTqK+kVor1YUErgZc6+tN6gbxMgJSim X-Received: by 2002:a05:6402:222a:b0:564:71:ccf0 with SMTP id cr10-20020a056402222a00b005640071ccf0mr12857045edb.2.1709820298059; Thu, 07 Mar 2024 06:04:58 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709820298; cv=pass; d=google.com; s=arc-20160816; b=pUONL7+vyiW4yRt/YSD+Mc0DGckeexvF1YAuqjgkuGpdT7vj7nh9MMUGrsuUWesq+f SSyGE158iQeHfj92jtSKJ6Dv+qudbQQsw46R4oiROI981fIMRtapri7vVl7jpWR3z+fm LeZxg+JXRVNYkJRqkzlFC5lK3JtUznU1WhvwW6T8NJjaVct2LO84lYCrMSp7ICOb46ZS IZQISxsPEcGvNFzNkQtDeUnai9wFBaEFiZsCzJY8ujP0/rB9ZnnzUM+O7QsBGLy4+CX1 31hUi4le5zLRnRpxOIDddLrLcHSaMoMszcmNKehoyEKjC2OY7AHZlEstA8THMiEs3qsm kgYg== 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=e2jsLyFwepKDrwIr/uWJV0RdUuyknGyf55lcJyFTRiQ=; fh=1yO4zj86BkYmsfk5Yt5199/Brr4Lle8E09amwv/xRcM=; b=vMTR7UY+NSHN8XgUsWZciFLtEbVV7g6WAH0R4mwRE+PYbiNh+WLvFybzq8xXNIDlPu hnq9z753UmMz8aehAiCMM/F2Tl4w9MDLVoTfhdtjBWjb6H7KF8P5MrfEffxw70YfruCQ 1V+xBW25dSJTR7vnLey7cyson2mQcDUImCG/DNnAIZ6V8O3m+dO80/OBN+Y/MNa90fMS gH5qqYTV5/58um1/ml424kAw2+QhIzoLRaanri7qM51ferrkAqrTE2lroMDP5cmwHGGp fdp0neohnc5lE5PUSlXjNxqEh/5YrJQl6N3xx5XoDoF5T/QUsgLehuXam0vsZxyjdOM9 Da+Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=g9hHKuL0; arc=pass (i=1 spf=pass spfdomain=ventanamicro.com dkim=pass dkdomain=ventanamicro.com); spf=pass (google.com: domain of linux-kernel+bounces-95682-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-95682-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id er14-20020a056402448e00b005681c4857e9si245146edb.441.2024.03.07.06.04.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Mar 2024 06:04:58 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-95682-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=g9hHKuL0; arc=pass (i=1 spf=pass spfdomain=ventanamicro.com dkim=pass dkdomain=ventanamicro.com); spf=pass (google.com: domain of linux-kernel+bounces-95682-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-95682-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 9F9511F25933 for ; Thu, 7 Mar 2024 14:04:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8755412F58A; Thu, 7 Mar 2024 14:03:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ventanamicro.com header.i=@ventanamicro.com header.b="g9hHKuL0" Received: from mail-pl1-f182.google.com (mail-pl1-f182.google.com [209.85.214.182]) (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 D42D212D775 for ; Thu, 7 Mar 2024 14:03:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.182 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709820208; cv=none; b=om1U/n1Wkeujacyh+9Uzae8NsBl3eYAMqtXXBupmHKj7NK3ByFcls4B/6pUlYEsVybuvGF/1JpOV4j4jHWO/K7WdljBO3nbCeEr2yF+U+YvDFVBwmfRR9MYoebatSGrAy4uNMDVqf04tEs3Iea/vHESiz9v6bJdoSS3gm299Oy4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709820208; c=relaxed/simple; bh=6ldkn/NLN5Vok7/3YlbAjD/lx6DIcA8TyTnQ2yT4OV4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=NBdEFc0boVajjNjyBdH/l8enlPRRkwTeZ/BczJtUdvioCuHCreAnh2dlZDLH1nYo+547EaTNcFEDUCLCscr3T9BQTXcUouag6OMi9xALpOznAGyFL5Tf3ckVPRbSdn3AVTVP2ydt+POatLH/cKQoCVOhn1kr7vsRU93905/I0Ac= 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=g9hHKuL0; arc=none smtp.client-ip=209.85.214.182 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-f182.google.com with SMTP id d9443c01a7336-1dbae7b8ff2so7717695ad.3 for ; Thu, 07 Mar 2024 06:03:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1709820206; x=1710425006; 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=e2jsLyFwepKDrwIr/uWJV0RdUuyknGyf55lcJyFTRiQ=; b=g9hHKuL0QoZUwFVh1V6jsNRycyZYWCgvWFLof2hNZD346NVcWuAArQ0ORFxzz/FWvn ipPL2OoPEayvGCJmoiGigSp88HexSbr3JBUgfcLnm8Bm4HKVoZ9fnW88wmPwrFeGysLR I/nOei7tARKNStF3dE4eOlTgTlWZSQcAQMKZdgSOi4Dv5YBsyy5/9PEGn89oJP+jiJ25 ISGDG9M2b/HkjOmmy0S+jby3gTED/wpH0AWJ/YAlMLDgMV8XRtwZsk6aG1/ijEsKnUfG PI/Gbsz50sBOMRF77vdLl4KuJvCe2uQXTNeL0ixkUorEgDe+msMSOW9gGlZJgCUN0bxR W2zQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709820206; x=1710425006; 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=e2jsLyFwepKDrwIr/uWJV0RdUuyknGyf55lcJyFTRiQ=; b=MjSfrM24/b2KlXDJUqhGz9JDbH/qRflYX8z3DI1JDkyMz+7HCHJXJ/iHb0hHv7MjR/ k4oeW4Q6l0TP48BtIuCLiyXwfBnW4qTC54gG2H9HHRbXJVxOjlGjguKMJrYygGTuKHHx AvbhRhHrILaC1R29nwS2gHt/p/e0IaQLNcSw8cMFpPlb3RGgxQfBfVXgRajQxeQhgSQD seJvd0YgDv9IoTfHYuPdu9Wnvu+//LE1hRdNbcuPJw5U9JF1sXfBpD1IES/IgDf4FSCP Cbba3EwQxU4wXjc8qXN7mv+ew7mr2IYzPWJFKwtDBxun68d7xDEv01typSttN0WZiA9C 4XqQ== X-Forwarded-Encrypted: i=1; AJvYcCU5afDQdRFjnHUt0dhqRMIOcVte/acPCbqKraPrqn+zTxqvyiULzD0AF8cMjtYjERZm6M5wXYiQccc0yX29BK2PXz205sPHDHhBwrc8 X-Gm-Message-State: AOJu0YzUhGNZBCuQPUbYl5AXOkKMPbP0XXsznnqOMsLDAkc+wl7HfMBl 7wSK/jYXNXqIL1RUbANDz0I/pVzthCQn8obLv+8fDwrpON+8U+yacNNTSB6WzQY= X-Received: by 2002:a17:902:ea0f:b0:1dc:6775:a350 with SMTP id s15-20020a170902ea0f00b001dc6775a350mr9485886plg.58.1709820205954; Thu, 07 Mar 2024 06:03:25 -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.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Mar 2024 06:03:25 -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 , Krzysztof Kozlowski Subject: [PATCH v16 1/9] dt-bindings: interrupt-controller: Add RISC-V incoming MSI controller Date: Thu, 7 Mar 2024 19:32:59 +0530 Message-Id: <20240307140307.646078-2-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 the RISC-V incoming MSI controller (IMSIC) defined by the RISC-V advanced interrupt architecture (AIA) specification. Signed-off-by: Anup Patel Reviewed-by: Conor Dooley Acked-by: Krzysztof Kozlowski --- .../interrupt-controller/riscv,imsics.yaml | 172 ++++++++++++++++++ 1 file changed, 172 insertions(+) create mode 100644 Documentation/devicetree/bindings/interrupt-controller/riscv,imsics.yaml diff --git a/Documentation/devicetree/bindings/interrupt-controller/riscv,imsics.yaml b/Documentation/devicetree/bindings/interrupt-controller/riscv,imsics.yaml new file mode 100644 index 000000000000..84976f17a4a1 --- /dev/null +++ b/Documentation/devicetree/bindings/interrupt-controller/riscv,imsics.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,imsics.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: RISC-V Incoming MSI Controller (IMSIC) + +maintainers: + - Anup Patel + +description: | + The RISC-V advanced interrupt architecture (AIA) defines a per-CPU incoming + MSI controller (IMSIC) for handling MSIs in a RISC-V platform. The RISC-V + AIA specification can be found at https://github.com/riscv/riscv-aia. + + The IMSIC is a per-CPU (or per-HART) device with separate interrupt file + for each privilege level (machine or supervisor). The configuration of + a IMSIC interrupt file is done using AIA CSRs and it also has a 4KB MMIO + space to receive MSIs from devices. Each IMSIC interrupt file supports a + fixed number of interrupt identities (to distinguish MSIs from devices) + which is same for given privilege level across CPUs (or HARTs). + + The device tree of a RISC-V platform will have one IMSIC device tree node + for each privilege level (machine or supervisor) which collectively describe + IMSIC interrupt files at that privilege level across CPUs (or HARTs). + + The arrangement of IMSIC interrupt files in MMIO space of a RISC-V platform + follows a particular scheme defined by the RISC-V AIA specification. A IMSIC + group is a set of IMSIC interrupt files co-located in MMIO space and we can + have multiple IMSIC groups (i.e. clusters, sockets, chiplets, etc) in a + RISC-V platform. The MSI target address of a IMSIC interrupt file at given + privilege level (machine or supervisor) encodes group index, HART index, + and guest index (shown below). + + XLEN-1 > (HART Index MSB) 12 0 + | | | | + ------------------------------------------------------------- + |xxxxxx|Group Index|xxxxxxxxxxx|HART Index|Guest Index| 0 | + ------------------------------------------------------------- + +allOf: + - $ref: /schemas/interrupt-controller.yaml# + - $ref: /schemas/interrupt-controller/msi-controller.yaml# + +properties: + compatible: + items: + - enum: + - qemu,imsics + - const: riscv,imsics + + reg: + minItems: 1 + maxItems: 16384 + description: + Base address of each IMSIC group. + + interrupt-controller: true + + "#interrupt-cells": + const: 0 + + msi-controller: true + + "#msi-cells": + const: 0 + + interrupts-extended: + minItems: 1 + maxItems: 16384 + description: + This property represents the set of CPUs (or HARTs) for which given + device tree node describes the IMSIC interrupt files. Each node pointed + to should be a riscv,cpu-intc node, which has a CPU node (i.e. RISC-V + HART) as parent. + + riscv,num-ids: + $ref: /schemas/types.yaml#/definitions/uint32 + minimum: 63 + maximum: 2047 + description: + Number of interrupt identities supported by IMSIC interrupt file. + + riscv,num-guest-ids: + $ref: /schemas/types.yaml#/definitions/uint32 + minimum: 63 + maximum: 2047 + description: + Number of interrupt identities are supported by IMSIC guest interrupt + file. When not specified it is assumed to be same as specified by the + riscv,num-ids property. + + riscv,guest-index-bits: + minimum: 0 + maximum: 7 + default: 0 + description: + Number of guest index bits in the MSI target address. + + riscv,hart-index-bits: + minimum: 0 + maximum: 15 + description: + Number of HART index bits in the MSI target address. When not + specified it is calculated based on the interrupts-extended property. + + riscv,group-index-bits: + minimum: 0 + maximum: 7 + default: 0 + description: + Number of group index bits in the MSI target address. + + riscv,group-index-shift: + $ref: /schemas/types.yaml#/definitions/uint32 + minimum: 0 + maximum: 55 + default: 24 + description: + The least significant bit position of the group index bits in the + MSI target address. + +required: + - compatible + - reg + - interrupt-controller + - msi-controller + - "#msi-cells" + - interrupts-extended + - riscv,num-ids + +unevaluatedProperties: false + +examples: + - | + // Example 1 (Machine-level IMSIC files with just one group): + + interrupt-controller@24000000 { + compatible = "qemu,imsics", "riscv,imsics"; + interrupts-extended = <&cpu1_intc 11>, + <&cpu2_intc 11>, + <&cpu3_intc 11>, + <&cpu4_intc 11>; + reg = <0x28000000 0x4000>; + interrupt-controller; + #interrupt-cells = <0>; + msi-controller; + #msi-cells = <0>; + riscv,num-ids = <127>; + }; + + - | + // Example 2 (Supervisor-level IMSIC files with two groups): + + interrupt-controller@28000000 { + compatible = "qemu,imsics", "riscv,imsics"; + interrupts-extended = <&cpu1_intc 9>, + <&cpu2_intc 9>, + <&cpu3_intc 9>, + <&cpu4_intc 9>; + reg = <0x28000000 0x2000>, /* Group0 IMSICs */ + <0x29000000 0x2000>; /* Group1 IMSICs */ + interrupt-controller; + #interrupt-cells = <0>; + msi-controller; + #msi-cells = <0>; + riscv,num-ids = <127>; + riscv,group-index-bits = <1>; + riscv,group-index-shift = <24>; + }; +... -- 2.34.1