Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp5223104rwb; Wed, 17 Aug 2022 13:25:56 -0700 (PDT) X-Google-Smtp-Source: AA6agR6ui5Ovy7Qf2wulfKwb+CRh97i1e8tR3n3SJ9iD5kkOC2+pMOKdS/Gg5XZ7Qh0FyvQYiDa7 X-Received: by 2002:a17:90b:38cc:b0:1f7:2835:d45e with SMTP id nn12-20020a17090b38cc00b001f72835d45emr5280908pjb.177.1660767956079; Wed, 17 Aug 2022 13:25:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660767956; cv=none; d=google.com; s=arc-20160816; b=jaysvQ06PmsxjEJIyZF0BpGux4tKlIzsSSX0yiomjjX3a2YIwhUsmD/yV7tX1YKPA3 meTZFyvDFORIlR6wgUQ4VKf1UOAKY0yqD/KRYuca0y6YQxh8mZGSnJAL0Taklofw9OeV 7jRxACapFapROEmtb0N03rjMFqHyuS9MOSUqgRwHtQU7KPhtl6/dUaz2uGgotZ2UEgZ9 64VfIxjGUUaeAGJupI50BcQVrHm4liO5DvIHiXj5KXI5EjQdO4ESKqtG63UCuznwTM1Y j79QXa/IT7rEVA3ADguaN9atzaW7s9xEvqPYIpCTv0NfwyBkDgq+IpTvUafGBwiCZIZb v+yg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=De0s+s/D2rq5b1W85sP7P0sadpD1tyl+4KZh5xfCdFc=; b=R0CYaeMHLIOjyTAYb8rxLlBqLUv3tZjQC/zwy4s6R8Qo+gPWWBKPCFiXmOl2hXo8z7 UlSNa7fJVo6RMQoThBr712u7PK80uBoBUGjb9B6pVSCvq7NzqylQZTWcRdZVnQKHgLZS 0+yqKVagUEPCG5dIFplphPx1jt5oJ8HJ5kblD3rbT2Nkn5ZGCscvt+tSV6YEfouCJYIE 9/Z9i30aKg/enQGl10jQ8Gg4lFiC+2XEg1iP696Vo9uYMoacnvfOaMAXkOCCI/4RW4Wc fFCRfyMPkMb1l/U5oJoIOdMc/MYaxCE/Uxq/UL5Sunngc8yI43ZYMIgd5TnM+vcuDT5p kU7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@conchuod.ie header.s=google header.b=VoUCelW9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=conchuod.ie Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id mu9-20020a17090b388900b001faa755faedsi2632760pjb.71.2022.08.17.13.25.12; Wed, 17 Aug 2022 13:25:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@conchuod.ie header.s=google header.b=VoUCelW9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=conchuod.ie Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241738AbiHQUM5 (ORCPT + 99 others); Wed, 17 Aug 2022 16:12:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34150 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241519AbiHQUMr (ORCPT ); Wed, 17 Aug 2022 16:12:47 -0400 Received: from mail-wm1-x330.google.com (mail-wm1-x330.google.com [IPv6:2a00:1450:4864:20::330]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DAE49A6C2C for ; Wed, 17 Aug 2022 13:12:45 -0700 (PDT) Received: by mail-wm1-x330.google.com with SMTP id c187-20020a1c35c4000000b003a30d88fe8eso1569346wma.2 for ; Wed, 17 Aug 2022 13:12:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=conchuod.ie; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=De0s+s/D2rq5b1W85sP7P0sadpD1tyl+4KZh5xfCdFc=; b=VoUCelW9ATsck56Z8Vshz+e5skJfqAaLWP0HlwFo7La/BTrmJH5e8zjyqLvEREwsny wivfEbQBCbsuAwXFwnaTCReVWo48k1o/9NHZ6uWUyyb1QcRZaacS8eYKfW160GvNgdRl tERNO6oWhTlIwX2AAbAEDn9M5mRMpl16CQcmPD1jWSFcupCT4CmqBFX72IKxsy5HNvI6 1ofx3JTRa4Gz5oJXqe8j7aHCHkdofi+lsc4O68CTHYD7rM2Dd+IYZB4Y1c4bvN760fwl mqGvxbSv/gH2QOynns+PpVsW5V8qUj2oLo3HbjL3PbdYC6gjSc78t0dyQeNKj8aE5M8n wMLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc; bh=De0s+s/D2rq5b1W85sP7P0sadpD1tyl+4KZh5xfCdFc=; b=hKa4vXMuq76OzDdwuGp0TB9c2OK/gnZSzpFaJH0lf6JGkAq8s8jHiYwgHuE2shvpnm alZJyqVsna8GmOyTfMOP1UGgsN8GFLeS+L2SUOPx8ntJw6HRyR5R96tdjbUyRrRFhbaa BjemcYs6o3TCHWOLXZNdbUzHlBqDeAOJT8+CEe1cTXlEevNRWB/miBJ5XN9ie7tfKKWu IsvtCpaiackQWB/mcBqldbP15Jfr73jjIKylI87nZeZe0JGti7SnUgF6N4TJo4ON0kAT g5grC9j5t0kC28MVjlTE0j6rKBWzDG6d1cf+Pg7Ru0pJJ3rDM61uSZPIPIDoH/zsQwpr 9SQA== X-Gm-Message-State: ACgBeo0H81763rpStZ/IpV+wdc9J60oZ1D4k1VPvSGY1rMyuqt6iL1UY ZBh4j8rEK98k8xQWP8c3golmSg== X-Received: by 2002:a05:600c:4f05:b0:3a5:ffec:b6b with SMTP id l5-20020a05600c4f0500b003a5ffec0b6bmr3007577wmq.199.1660767164394; Wed, 17 Aug 2022 13:12:44 -0700 (PDT) Received: from henark71.. ([109.76.58.63]) by smtp.gmail.com with ESMTPSA id i15-20020a05600c354f00b003a5dfd7e9eesm3029371wmq.44.2022.08.17.13.12.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Aug 2022 13:12:43 -0700 (PDT) From: Conor Dooley To: Thomas Gleixner , Marc Zyngier , Rob Herring , Krzysztof Kozlowski , Palmer Dabbelt , Paul Walmsley , Albert Ou Cc: Daniel Lezcano , Anup Patel , Conor Dooley , Guo Ren , Sagar Kadam , Jessica Clarke , Andrew Jones , linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-riscv@lists.infradead.org, qemu-riscv@nongnu.org, Rob Herring Subject: [PATCH v3 3/4] dt-bindings: riscv: add new riscv,isa strings for emulators Date: Wed, 17 Aug 2022 21:12:12 +0100 Message-Id: <20220817201212.990712-4-mail@conchuod.ie> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220817201212.990712-1-mail@conchuod.ie> References: <20220817201212.990712-1-mail@conchuod.ie> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Conor Dooley The QEMU virt and spike machines currently export a riscv,isa string of "rv64imafdcsuh", While the RISC-V foundation has been ratifying a bunch of extenstions etc, the kernel has remained relatively static with what hardware is supported - but the same is not true of QEMU. Using the virt machine and running dt-validate on the dumped dtb fails, partly due to the unexpected isa string. Rather than enumerate the many many possbilities, change the pattern to a regex, with the following assumptions: - the single letter order is fixed & we don't care about things that can't even do "ima" - the standard multi letter extensions are all in a "_z" format where the first letter of is a valid single letter extension - _s & _h are used for supervisor and hyper visor extensions. - after the first two chars, a standard multi letter extension name could be an english word (ifencei anyone?) so it's not worth restricting the charset - vendor ISA extensions begind with _x and have no charset restrictions - we don't care about an e extension from an OS pov - that attempting to validate the contents of the multiletter extensions with dt-validate beyond the formatting is a futile, massively verbose or unwieldy exercise at best. - ima are required The following limitations also apply: - multi letter extension ordering is not enforced. dt-schema does not appear to allow for named match groups, so the resulting regex would be even more of a headache. - ditto for the numbered extensions. Finally, add me as a maintainer of the binding so that when it breaks in the future, I can be held responsible! Reported-by: Rob Herring Link: https://lore.kernel.org/linux-riscv/20220803170552.GA2250266-robh@kernel.org/ Signed-off-by: Conor Dooley --- Palmer, feel free to drop the maintainer addition. I just mostly want to clean up my own mess on this when they decide to ratify more extensions & this comes back up again. --- Documentation/devicetree/bindings/riscv/cpus.yaml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Documentation/devicetree/bindings/riscv/cpus.yaml b/Documentation/devicetree/bindings/riscv/cpus.yaml index 873dd12f6e89..c0e0bc5dce04 100644 --- a/Documentation/devicetree/bindings/riscv/cpus.yaml +++ b/Documentation/devicetree/bindings/riscv/cpus.yaml @@ -9,6 +9,7 @@ title: RISC-V bindings for 'cpus' DT nodes maintainers: - Paul Walmsley - Palmer Dabbelt + - Conor Dooley description: | This document uses some terminology common to the RISC-V community @@ -79,9 +80,7 @@ properties: insensitive, letters in the riscv,isa string must be all lowercase to simplify parsing. $ref: "/schemas/types.yaml#/definitions/string" - enum: - - rv64imac - - rv64imafdc + pattern: ^rv(?:64|32)imaf?d?q?c?b?v?k?h?(?:(?:_[zsh][imafdqcbvksh]|_x)(?:[a-z])+)*$ # RISC-V requires 'timebase-frequency' in /cpus, so disallow it here timebase-frequency: false -- 2.37.1