Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp3747916pxb; Tue, 7 Sep 2021 06:49:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxVmPsJQ9LufHvxgd6gJ4daN1ppOPX1qoMvjkGhBR2hFUtSq3cram2nix/ep89dfaJEZ+VV X-Received: by 2002:a92:c80d:: with SMTP id v13mr12578076iln.198.1631022594458; Tue, 07 Sep 2021 06:49:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631022594; cv=none; d=google.com; s=arc-20160816; b=oH3Nz4QnBMojsWflRO1b9+yfyWfQU3sTRIzGMyiRS8Erg5X+LuVUJcMBaXOhIl2wNc Xj3PsjbJ4wMbE10OkFZCvY8A71vSj8RMSoEfsb29/YmYRogpwIbIWe3/FHF8NAptdu9P xn0w7H5HsGkRZ/E9+TzZPSyKfqwENh8gLnpcQ1ayNJfJSNreEQl/hpJdnoqVbL4iwBkB gFHidvjobuYqhW17rx4gjZSqs24zd3rgW/qHXb6UUjey0RsF8+vPhinweTWPOJzT5M1+ dinsxwoY9gkvQ4MtwmjMqZkr+0TjuYr/iwvclaT+vza/r2Aa215EXRrgi0kbwxxQzJC4 TYAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=oRc/qMgw+QqLqHuuu8aCQTiUA3xX6zfDO10kbJB1r2c=; b=POsobiZZBmHXt0UUSJORx/mu2TSCEAYI3AwxeLtM8LTJ48mITBOjb13EmGlSwjyaHV OLJbasprf/+p8Go8/XBrNoIMw0F3RJV0hMH9iBa/eollO5SZYP8x7qCOCpSPZ2ceFaa+ PuiLqbAx8EwrpNNzrd6NFKiF8bL1WJVEhmBDC5tv7nyvKMGISK0P0Otb+/k1qwZsvn2n 8nwuJ+KnlcpNCUR+fEQZOAAlzRxQdJ1618FtdJ2jighBWDcpv67WVeDnBnTbijC8DNR4 DS1J/7UGF83c+2zm0RBq6juq/2W5mXvuS53/ZLGitgkRuML0gwXHhF4xAIXSU9F4/Pzi 07Mw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=kjFgQpGg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q186si10672806ioq.108.2021.09.07.06.49.43; Tue, 07 Sep 2021 06:49:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=kjFgQpGg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344797AbhIGNtd (ORCPT + 99 others); Tue, 7 Sep 2021 09:49:33 -0400 Received: from mail.kernel.org ([198.145.29.99]:45552 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234990AbhIGNtY (ORCPT ); Tue, 7 Sep 2021 09:49:24 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 28DA161107; Tue, 7 Sep 2021 13:48:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1631022498; bh=ArpxA6KfyIfvsZ8d82ObTY6A8wEvx7a+tmGvpZbu1u4=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=kjFgQpGggoy8m98tICr9x1g/hjx8Ox1hcrlhLrM57ioC/90iFja0mnBM3BeeeXra7 JphW+wIgU5CgTBCD7TCnN2d829H8+hK/9F04EvWUG7EcgiBWoqEX0x/1Cp4BxXbO00 g1m9dO0al8adpXdoAQvlQtk2A/X+AWihwQ96o6nGRto6rP0BtE5+5BZv9lBD1b28v3 04A3PskMinulB06flbwsREV2MJDtiWNWN9ZAkcLRSCruam2qU+0eUq9wbxclMYk0OP Kwq4TUZaSuQfrMGbUJ3lXBVPDJM8hJndeyPZaB2avbVoEpLx3QWOSIgkcb0aGchnUH 7v+Tt6cPGmMTQ== Received: by mail-ej1-f41.google.com with SMTP id x11so19893301ejv.0; Tue, 07 Sep 2021 06:48:18 -0700 (PDT) X-Gm-Message-State: AOAM531bb2gU7iE8TaGvmexPLocomyScWc2Wo7H5Mlh374VteA4wlxgw gGPS7YjojeAHtffEuuRa2OHpk3yqjmzR6MbFrQ== X-Received: by 2002:a17:906:9a4e:: with SMTP id aj14mr18654434ejc.84.1631022496627; Tue, 07 Sep 2021 06:48:16 -0700 (PDT) MIME-Version: 1.0 References: <20210830041729.237252-1-anup.patel@wdc.com> <20210830041729.237252-6-anup.patel@wdc.com> In-Reply-To: From: Rob Herring Date: Tue, 7 Sep 2021 08:48:04 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [RFC PATCH v3 05/11] dt-bindings: interrupt-controller: Add ACLINT MSWI and SSWI bindings To: Anup Patel Cc: Anup Patel , Palmer Dabbelt , Palmer Dabbelt , Paul Walmsley , Thomas Gleixner , Marc Zyngier , Daniel Lezcano , Atish Patra , Alistair Francis , linux-riscv , "linux-kernel@vger.kernel.org List" , DTML , Bin Meng Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 3, 2021 at 5:40 AM Anup Patel wrote: > > On Thu, Sep 2, 2021 at 6:04 AM Rob Herring wrote: > > > > On Wed, Sep 1, 2021 at 6:56 AM Anup Patel wrote: > > > > > > On Wed, Sep 1, 2021 at 6:54 AM Rob Herring wrote: > > > > > > > > On Mon, Aug 30, 2021 at 09:47:23AM +0530, Anup Patel wrote: > > > > > We add DT bindings documentation for the ACLINT MSWI and SSWI > > > > > devices found on RISC-V SOCs. > > > > > > > > > > Signed-off-by: Anup Patel > > > > > Reviewed-by: Bin Meng > > > > > --- > > > > > .../riscv,aclint-swi.yaml | 95 +++++++++++++++++++ > > > > > 1 file changed, 95 insertions(+) > > > > > create mode 100644 Documentation/devicetree/bindings/interrupt-controller/riscv,aclint-swi.yaml > > > > > > > > > > diff --git a/Documentation/devicetree/bindings/interrupt-controller/riscv,aclint-swi.yaml b/Documentation/devicetree/bindings/interrupt-controller/riscv,aclint-swi.yaml > > > > > new file mode 100644 > > > > > index 000000000000..68563259ae24 > > > > > --- /dev/null > > > > > +++ b/Documentation/devicetree/bindings/interrupt-controller/riscv,aclint-swi.yaml > > > > > @@ -0,0 +1,95 @@ > > > > > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) > > > > > +%YAML 1.2 > > > > > +--- > > > > > +$id: http://devicetree.org/schemas/interrupt-controller/riscv,aclint-swi.yaml# > > > > > +$schema: http://devicetree.org/meta-schemas/core.yaml# > > > > > + > > > > > +title: RISC-V ACLINT Software Interrupt Devices > > > > > + > > > > > +maintainers: > > > > > + - Anup Patel > > > > > + > > > > > +description: > > > > > + RISC-V SOCs include an implementation of the M-level software interrupt > > > > > + (MSWI) device and the S-level software interrupt (SSWI) device defined > > > > > + in the RISC-V Advanced Core Local Interruptor (ACLINT) specification. > > > > > + > > > > > + The ACLINT MSWI and SSWI devices are documented in the RISC-V ACLINT > > > > > + specification located at > > > > > + https://github.com/riscv/riscv-aclint/blob/main/riscv-aclint.adoc. > > > > > + > > > > > + The ACLINT MSWI and SSWI devices directly connect to the M-level and > > > > > + S-level software interrupt lines of various HARTs (or CPUs) respectively > > > > > + so the RISC-V per-HART (or per-CPU) local interrupt controller is the > > > > > + parent interrupt controller for the ACLINT MSWI and SSWI devices. > > > > > + > > > > > +allOf: > > > > > + - $ref: /schemas/interrupt-controller.yaml# > > > > > + > > > > > +properties: > > > > > + compatible: > > > > > + oneOf: > > > > > + - items: > > > > > + - enum: > > > > > + - riscv,aclint-mswi > > > > > + > > > > > + - items: > > > > > + - enum: > > > > > + - riscv,aclint-sswi > > > > > > > > All this can be just: > > > > > > > > enum: > > > > - riscv,aclint-mswi > > > > - riscv,aclint-sswi > > > > > > > > However... > > > > > > > > > + > > > > > + description: > > > > > + For ACLINT MSWI devices, it should be "riscv,aclint-mswi" OR > > > > > + ",-aclint-mswi". > > > > > + For ACLINT SSWI devices, it should be "riscv,aclint-sswi" OR > > > > > + ",-aclint-sswi". > > > > > > > > s/OR/AND/ > > > > > > > > There must be a compatible for the implementation. Unless RiscV > > > > implementations of specs are complete describing all clocks, power > > > > domains, resets, etc. and are quirk free. > > > > > > > > But don't write free form constraints... > > > > > > It is possible that quite a few implementations (QEMU, FPGAs, and > > > other simulators) will not require implementation specific compatible > > > strings. Should we still mandate implementation specific compatible > > > strings in DTS for such cases? > > > > No, but the schema says you only have those cases. Are there not any > > actual implementations? > > All existing RISC-V boards have SiFive CLINT and ACLINT is backward > compatible with SiFive CLINT so we do have actual implementations. So there's a SiFive compatible you can add here? > None of the existing RISC-V boards have special clocks, power domain, > resets etc for these devices. > > > > > Minimally make ",-aclint-mswi" into a schema pattern for > > the first entry and perhaps a note to replace with actual strings when > > there are some. It's ultimately up to the RiscV maintainers to require > > SoC specific compatibles here. Allowing a generic one alone makes that > > harder because the schema can't enforce it. > > Can we have a common compatible string for QEMU, FPGAs, etc ? > > For example, > compatible = "riscv,generic-aclint-mswi", "riscv,aclint-mswi"; This is not any better than just allowing "riscv,aclint-mswi" by itself as someone could just use the above strings on their new implementation to avoid warnings. You could just not worry about the QEMU and FPGA cases. FPGAs are probably not upstream and if they are, don't they need specific compatibles tied to versions of FPGA images? QEMU generating its own DT doesn't run schema validation though that could change. I'm looking at enabling schema validation at runtime for purposes of firmware testing and with that QEMU generated DT may be something we test. Rob