Received: by 2002:ab2:7855:0:b0:1f9:5764:f03e with SMTP id m21csp1094240lqp; Thu, 23 May 2024 08:49:19 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVlMnAJ0RaP6OUJyOzBGP7NqLVDYcWpPp85nMnNoKlihPIj5XOmQagAyWFNN54NmP5BthzYmZEprLrU6BhenLTISvdlzmufIbWrYPppLQ== X-Google-Smtp-Source: AGHT+IEKj09yvsJXPjBg+gRoGBBkcfo/oNaLlYE7vWhHKL8Dqer/iDg41N6InxN+0XzSQ/e8CUOl X-Received: by 2002:a05:6820:160d:b0:5b5:3852:75c4 with SMTP id 006d021491bc7-5b6a3a14b22mr5537547eaf.5.1716479358909; Thu, 23 May 2024 08:49:18 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716479358; cv=pass; d=google.com; s=arc-20160816; b=B9cranMNt1fOrP61hs6C9l9mpfX8vYqyQSg4+MbqkW9dRtvQEiJut+kUQjKcGjfV0Y oJO3KWMDswZECvNlQRud64BPqPvXadlr2OCOWqR/pLbRruh8OOeTMx4DPI3iXMRXXqZV XHEHYe9w6M5MkXg5sWAJt91wVxCw7FxGfRSgXn3yH2G8HRCFkBApMXKzxi35ixm2hgYf 5mLTNS+oWg7wTGHDMQFSbO1Pzuq0gS1Epoc5Ebicc4vTSpXq9zV6IPJYQiuVzFr6g9Lu Na3dKHEw5XqQi45KQvLE/2MR9/fQgruK1fcLA007LtmHd/Eal78grDunNMJJAw+PScqg tOsg== 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=7BhK75bXFq9QXiZkl3Cdcd/j/Js9FIe4nw/sI4pfEyc=; fh=Gzhn+PfBFwm0900Sx++y0DHSaO3UXKMvpWH9oJhOJlc=; b=AU2mvAhda/hl6VRZsVVkRdspvDIYbSW3ng+3tc+eEHKEnQ4vLY59/+ech02SGRngfD jMGqxpr76Twq6Y0AtqpZnFRQECZ/JnjgJ59Qo3kY7qwjJMt/NtM5TaGLEOMEucOhM+Uf rob0uZ37BLhftE4ONh8iZVTXCOvjdnzybkFXNfG100lJjn+UPe3LooG/rbmSGqIrvb1G cQB3NlaoMANrp7geO9LhQHYZ6o0HbJlwsOhFQARpwqBYTbljDNROwW6NmJaxqjR35TwU IZq1hQosDEEG74VuOeZ/tzcLgr568bvwX4Y1z5CRpM4VLSqfxJprkynCHaOuM3Vd/FAR 14Aw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=MPDzdWsC; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-187740-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-187740-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id d75a77b69052e-43df566ecccsi141516731cf.253.2024.05.23.08.49.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 May 2024 08:49:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-187740-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=MPDzdWsC; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-187740-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-187740-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 8E2AC1C21B43 for ; Thu, 23 May 2024 15:49:18 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C8E3B13ACC; Thu, 23 May 2024 15:48:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="MPDzdWsC" 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 025BF22F0F; Thu, 23 May 2024 15:48:47 +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=1716479329; cv=none; b=JUtQk5rQ+CWS9dk3rdzpnqlz5rGUR4GAKKHMrE9WpEQc4wE9YJ5jU59vv7N4OdTHYK9t80qov/R8jDhJz8Aa0LPyX4UasCwK4ATsLc0FX8tZCxCgvv6sD74yO/r3rwDRJaK7AYNF8IHmhJChuHiXUwo1pYxoGbzEewqWzi8KyN4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716479329; c=relaxed/simple; bh=9s4uLEz3Z2HAXjF2nw4rka7qpb0kF/nf6XzKyCpq25A=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=AFOLtEoY24/PdoTD1rzMipOltUCI/Nw4rgP0TRCs1f3Li+61hX6UoNY+IVMpYx0DdnGHQazdIjaMcFYwtnyVAednc/1btHQwiL7gHEHlghdFiht1IOVqit2k2nzuUs9hSrqc9Q2jP6Rg3qkRbxik5wdvFlum2dks17G5C2utBzA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=MPDzdWsC; arc=none smtp.client-ip=209.85.214.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pl1-f170.google.com with SMTP id d9443c01a7336-1f34b5f1964so4496315ad.2; Thu, 23 May 2024 08:48:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1716479327; x=1717084127; 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=7BhK75bXFq9QXiZkl3Cdcd/j/Js9FIe4nw/sI4pfEyc=; b=MPDzdWsCbqWuawBMGHpEk55qCN7ls4Ar+TPXbr0qN04oO1jLdRB+lP199CUpT3286m raIj3AcxFF7RVCJFnMOJfJcL5SPaDrxxkyAY+kAiMKf3Qy6SMsc21lKtEKufbDuaDLLq uslCVLCcZ3QEMd/vFaANf6zRJAzF/pcKGpXuZpoN505CpbkKE1hQK5im0qUdDCb2SyVH 2TjObEUJPOaiAGve0Hdd/0UIazHa1yKjR42lcNBGRHGk7yts0IyYlxcgsO2lukBxq2wK sVhgi5JFhkuZMt4tna8hKU6/1Cic/hh06I0T168YWpDhgTo90jQvhYsMlp3ElftsZDlx Qdhg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716479327; x=1717084127; 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=7BhK75bXFq9QXiZkl3Cdcd/j/Js9FIe4nw/sI4pfEyc=; b=OmGhduL+ig4c0cWCeo0dBOalChfXW7Acqsps2DxQEyxdXHNsuQqg2oWrzz0241quEP XYaJqBk0JnQr/zD61/ZLblRcOa9bo8Y+1Qnx0NPEjbxT4Mqy/I+AbsBO51kOSOCAhTRp arUK1X/TovbOGvB6g0ikxebpg9kdn5yWr+m8apD6o+R2YK2MZTjr3XT8SaolPQ2AN7OZ Fh74chPOEc9/JWuX0QkrJ61fWdHv0AMyX5T8HXxbiRFdKkYWiM0+0jyICCNrulL08lrP TdYse2npiEbuLOyt4NEy4aH4Cnr/4WBtDCZCq+dxhEF+bsSTPJ4mZoYyd+DnDt0ejtts fecQ== X-Forwarded-Encrypted: i=1; AJvYcCU5YSjVBgCbX3v6mG3nO0xj9yXbvmyqES6HEiBXinDZQVS8HtMvRJaJ6s6MJ/Rt9fBfMw0kUxYIdMu9I5KDEbE/VyMrVpA+/iENur1arX79/i6BlYW0ohcyFXksequs/h60YRNQuGHsvg== X-Gm-Message-State: AOJu0Yz5bn8HhMpdV8Kos9UrJOpWRqarRYBlzOoAHNb38vmcOGP43gDl FTq2+TVnAXYgedxjjuh3GUTKy7l8Q/ykQe63LAa5y0RhAGW35nyV X-Received: by 2002:a17:902:e5c5:b0:1e4:4ade:f504 with SMTP id d9443c01a7336-1f31c9e48d3mr57360905ad.46.1716479327137; Thu, 23 May 2024 08:48:47 -0700 (PDT) Received: from localhost.localdomain ([223.178.81.93]) by smtp.googlemail.com with ESMTPSA id d9443c01a7336-1f3361a6678sm18321085ad.178.2024.05.23.08.48.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 May 2024 08:48:46 -0700 (PDT) From: Kanak Shilledar X-Google-Original-From: Kanak Shilledar To: Cc: Kanak Shilledar , Thomas Gleixner , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Paul Walmsley , Palmer Dabbelt , Albert Ou , Samuel Holland , linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-riscv@lists.infradead.org, Conor Dooley Subject: [RESEND v3 1/2] dt-bindings: interrupt-controller: riscv,cpu-intc: convert to dtschema Date: Thu, 23 May 2024 21:17:48 +0530 Message-Id: <20240523154748.22670-2-kanakshilledar111@protonmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240523154748.22670-1-kanakshilledar111@protonmail.com> References: <20240523154748.22670-1-kanakshilledar111@protonmail.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 Convert the RISC-V Hart-Level Interrupt Controller (HLIC) to newer DT schema, Created DT schema based on the .txt file which had `compatible`, `#interrupt-cells` and `interrupt-controller` as required properties. Changes made with respect to original file: - Changed the example to just use interrupt-controller instead of using the whole cpu block - Changed the example compatible string. Reviewed-by: Conor Dooley Signed-off-by: Kanak Shilledar --- Changes in v3: - Remove reference to `interrupt-controller` in `riscv/cpus.yaml`. Changes in v2: - Update the maintainers list. - Add reference to `interrupt-controller` in `riscv/cpus.yaml`. - Update compatible property with the reference in `cpus.yaml`. - Include description for '#interrupt-cells' property. - Change '#interrupt-cells' property to have `const: 1` as per the text binding. - Fixed the warning thrown by `/renesas/r9a07g043f01-smarc.dtb`. --- .../interrupt-controller/riscv,cpu-intc.txt | 52 ------------- .../interrupt-controller/riscv,cpu-intc.yaml | 73 +++++++++++++++++++ 2 files changed, 73 insertions(+), 52 deletions(-) delete mode 100644 Documentation/devicetree/bindings/interrupt-controller/riscv,cpu-intc.txt create mode 100644 Documentation/devicetree/bindings/interrupt-controller/riscv,cpu-intc.yaml diff --git a/Documentation/devicetree/bindings/interrupt-controller/riscv,cpu-intc.txt b/Documentation/devicetree/bindings/interrupt-controller/riscv,cpu-intc.txt deleted file mode 100644 index 265b223cd978..000000000000 --- a/Documentation/devicetree/bindings/interrupt-controller/riscv,cpu-intc.txt +++ /dev/null @@ -1,52 +0,0 @@ -RISC-V Hart-Level Interrupt Controller (HLIC) ---------------------------------------------- - -RISC-V cores include Control Status Registers (CSRs) which are local to each -CPU core (HART in RISC-V terminology) 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 -controlled via Supervisor Binary Interface (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. This means -a PLIC interrupt property will typically list the HLICs for all present HARTs -in the system. - -Required properties: -- compatible : "riscv,cpu-intc" -- #interrupt-cells : should be <1>. The interrupt sources are defined by the - RISC-V supervisor ISA manual, with only the following three interrupts being - defined for supervisor mode: - - Source 1 is the supervisor software interrupt, which can be sent by an SBI - call and is reserved for use by software. - - Source 5 is the supervisor timer interrupt, which can be configured by - SBI calls and implements a one-shot timer. - - Source 9 is the supervisor external interrupt, which chains to all other - device interrupts. -- 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 = "sifive,fu540-c000-cpu-intc", "riscv,cpu-intc"; - interrupt-controller; - }; - }; diff --git a/Documentation/devicetree/bindings/interrupt-controller/riscv,cpu-intc.yaml b/Documentation/devicetree/bindings/interrupt-controller/riscv,cpu-intc.yaml new file mode 100644 index 000000000000..c9c79e0870ff --- /dev/null +++ b/Documentation/devicetree/bindings/interrupt-controller/riscv,cpu-intc.yaml @@ -0,0 +1,73 @@ +# SPDX-License-Identifier: GPL-2.0 OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/interrupt-controller/riscv,cpu-intc.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: RISC-V Hart-Level Interrupt Controller (HLIC) + +description: + RISC-V cores include Control Status Registers (CSRs) which are local to + each CPU core (HART in RISC-V terminology) 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 namely 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 controlled via Supervisor Binary Interface (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. + This means a PLIC interrupt property will typically list the HLICs for all + present HARTs in the system. + +maintainers: + - Palmer Dabbelt + - Paul Walmsley + +properties: + compatible: + oneOf: + - items: + - const: andestech,cpu-intc + - const: riscv,cpu-intc + - const: riscv,cpu-intc + + interrupt-controller: true + + '#interrupt-cells': + const: 1 + description: | + The interrupt sources are defined by the RISC-V supervisor ISA manual, + with only the following three interrupts being defined for + supervisor mode: + - Source 1 is the supervisor software interrupt, which can be sent by + an SBI call and is reserved for use by software. + - Source 5 is the supervisor timer interrupt, which can be configured + by SBI calls and implements a one-shot timer. + - Source 9 is the supervisor external interrupt, which chains to all + other device interrupts. + +required: + - compatible + - '#interrupt-cells' + - interrupt-controller + +additionalProperties: false + +examples: + - | + interrupt-controller { + #interrupt-cells = <1>; + compatible = "riscv,cpu-intc"; + interrupt-controller; + }; -- 2.34.1