Received: by 2002:ab2:68c1:0:b0:1fd:9a81:d0e4 with SMTP id e1csp437604lqp; Sun, 9 Jun 2024 03:07:52 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWZhxhPZ8Q2aYI7CWHN0IcQ5fzO8jWQ0a/eO2LfE02UD8NE6WFnAZVX+tYiHnatQj4C6mbc8vGhfPkYIQ0ibGHW3QCi+iLr+MgVzrRCMQ== X-Google-Smtp-Source: AGHT+IGCzMf/bB/vHpjADp8/kmjNrv4kpJVrhkKlstyIT5yzGvz8TWCurQomEjJykcvqKtfBjAvS X-Received: by 2002:ac8:5e4f:0:b0:43d:f61e:3c95 with SMTP id d75a77b69052e-44041b99a4amr78902161cf.14.1717927672443; Sun, 09 Jun 2024 03:07:52 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717927672; cv=pass; d=google.com; s=arc-20160816; b=JAwy1lB1wICH4+O5OTmzmUc2FlszY56AV7gR2vixXesf5ScaeM6ssT0cBSy+Sn5dFM oGlSMtEEbbjRCOr5k+Kn6gh06HHroZMQoicti98P02qmiPxbOzT45UFR+0gYHR+eDVYA 5QuCkpCeOpXqyE1iTKF7oJGDKmaKBxrdOgfBonCGKpoPFVHghcL0qykO2E2K84AdjqFg sDQ0dXmgn4r4u3vaG21MzehzRk9o2BdooL4IJaDXkFuLdAPZDEJfmOWI+D6cg2vSO4AH tJILVEEbVJV+FnJu3b5EexdhGEHHMihsw3VN9kZ+Ub/r75LrLFERN+9B1urlVNZ3mwjO 5RHg== 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=nrGcPYJMJhishfsKRnQ7kYXDZI93Ds4JWA94AUqTVuU=; fh=tUCvxFZwBQwqXvQtwaprygcH+RsYSSlO4NCMoIruQik=; b=o0Sq1NcYekfjZVAnXXgxUpCfIgnW0TQ0hBFzc7gkNNnN6iXN88xRk4VoYbvxKuydl9 RhHH4crJr04sqTbNsA6xL2ANn85q+9V+Qolv0jemfG6KfLSVm9ahxsSrELPEvF7yuUGJ hEK1gUbsmeR/QV+OeSq6iU/FvVcNQrSK0W2gN1UNHuT1GBumUgvVXL15AELxbaqeKUC1 0r402kT2TF66EfffdUcPME5mcsB/lkfgWoPYBNdZHtDQIlQMxTkaOrAYOadQOITm0bGp f2TrBVi51zheARSQnSAQ4BPLwaRyvkYpA2N9bYgC9Tsxmre4eOcmRDjDVCSBquSvgUPk ZP6A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=IGfcpLlO; 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-207315-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-207315-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-44062f198e1si13757491cf.154.2024.06.09.03.07.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 09 Jun 2024 03:07:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-207315-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=IGfcpLlO; 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-207315-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-207315-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 1D05D1C2061A for ; Sun, 9 Jun 2024 10:07:52 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 090BB20DF4; Sun, 9 Jun 2024 10:07:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="IGfcpLlO" Received: from mail-il1-f182.google.com (mail-il1-f182.google.com [209.85.166.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 4E882208B8; Sun, 9 Jun 2024 10:07:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.182 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717927663; cv=none; b=OeilEZe/ZJK4CdY1hS1Ivj2Ck5R3UQ2UZA6CrhcZhz08R2lKHg4S21Qcjv2kvRpMlMji5BBR6FcoWiJ2T4hkgDufIe+z0BviR57CHuRkVss2DlxBA1SYTFlSYRcq7zlwJBtBuSMqKOiCTZiByaWoL6LDd2wOKaCVzCLHgI2LFkU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717927663; c=relaxed/simple; bh=EOys2I62KZ1akQipaN9xi0V4ioOFDVDNkKMRki62SFc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=gppB1FIwxFvdfAyrcUe9eRBdKRgEFkJmNLicYzSZ8CFuqM3nDGx/bQPbJaEGdStinCZYUyxIkPlRc+ct8eRCliHgztoY2M8zxQOYWJNRvNG9P1L1X2zjnoOzHpZvp7Nyha34QZwHrHmnWYQMGcEL4qbVJOCWo9n+6oBW8RNS1tY= 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=IGfcpLlO; arc=none smtp.client-ip=209.85.166.182 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-il1-f182.google.com with SMTP id e9e14a558f8ab-3737b47c0acso14404345ab.3; Sun, 09 Jun 2024 03:07:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1717927661; x=1718532461; 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=nrGcPYJMJhishfsKRnQ7kYXDZI93Ds4JWA94AUqTVuU=; b=IGfcpLlOYORqrWAGT4ae7AdMjRttf33ZGZZy2/zPr7GunCP5MSidJAxO7990GCAErB 6fNqfdMrDSDcZwVCfmFQFdWJvMX3YosNpP+aHb/ho9SHd22EnBFKEoKwiveaJbBW+MRC R98EfR2tXPTUuYxGJADWXlOFNfnOfEaT/C+oplRnauWKGvwfYPLY66EvWLIINZJIepGf JYbxU5MS2QbqBHnlVej4CIuxO2i3hDKnpvrP3GXzAfYKdfETrwbXHyJWtbVlWVX7jQvs W458k6x3XXb+uvfpZgptFAkPfJJp2yjgtx7RXAJP9+ZS3dNxXZ9f2/YlSFJwUetWRWmq GbiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717927661; x=1718532461; 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=nrGcPYJMJhishfsKRnQ7kYXDZI93Ds4JWA94AUqTVuU=; b=TphEFqlEJrXkGjQgFl9MHyqo2+kk8bhqrz8QvYvSScx20hMa2G1f02MBABMXQlKwa8 msQL2FCZQw/CgVY0Bb1GKtdWvSwYYoOgtDYeKj820KSQFufhZ6QZGdsIVsIwd6pnFtLs euXnkEMGhvck9odDLRG9Ipz4XNHR4P585YO5lS8HfnpYrNOJPjE4UenHVQNfshu0XXcL +t8pzCdEH/uGzlcoKIXI0lF5pXMoR8pViauYDPtqJYbY4++qwg/V8yk8+4+pG8iDEkG+ VK9pkjVzsysRwxVfTr51iteTORI47/c09khZtvkmRI1EcpzzASw+jlvDkiASpbtkebHr NDxQ== X-Forwarded-Encrypted: i=1; AJvYcCUEqHgd/sRUpvgT5QIVylVse2NwFR7OgHJaOW8yGddGcJYGBN7kcJZxvVQFPoxsDpRzU9iidJ8zpDQ9wgoYgyLvXuitaUbf62pIFPkmmXTNvABcNwYI8NPOOb7Dn5+OMyPSF/4Wd+4CLQ== X-Gm-Message-State: AOJu0Yz7fXeS/Plai5zUQyLYmnXGkYqYVEwfZkyeAcRqayIy6ChscWk0 kyjhw47SH0jX3ClkwnlGONKeWWTcaRUfCozaZ1sJt8rpG1Kop29K X-Received: by 2002:a05:6e02:1c8d:b0:374:593f:9158 with SMTP id e9e14a558f8ab-37580375a71mr70344885ab.20.1717927661378; Sun, 09 Jun 2024 03:07:41 -0700 (PDT) Received: from ga401ii.. ([2401:4900:1cc9:92b2:ce0f:ca96:5cb0:62e5]) by smtp.googlemail.com with ESMTPSA id d2e1a72fcca58-7041c78ac20sm2817534b3a.154.2024.06.09.03.07.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 09 Jun 2024 03:07:40 -0700 (PDT) From: Kanak Shilledar To: Cc: kanakshilledar111@protonmail.com, 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: [PATCH v4 1/2] dt-bindings: interrupt-controller: riscv,cpu-intc: convert to dtschema Date: Sun, 9 Jun 2024 15:37:07 +0530 Message-ID: <20240609100710.85055-2-kanakshilledar@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240609100710.85055-1-kanakshilledar@gmail.com> References: <20240609100710.85055-1-kanakshilledar@gmail.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 v4: - Change DCO email to @gmail.com 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..83256cc0bd5c --- /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.45.2