Received: by 2002:a05:6500:1b45:b0:1f5:f2ab:c469 with SMTP id cz5csp1280594lqb; Thu, 18 Apr 2024 05:45:22 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW8mwl98OuLov/q6Zqij/5f/8eDmhXyQWjm1+VGYP5c56/188EltwPT9q9AUYLmMl0h54cRvdAZtGfoseqtGV8LVQgG3BxQ3v1xPSCuDw== X-Google-Smtp-Source: AGHT+IG4ittlnGJiVq8wf2yPDqxI9q2LbwOJEb81ln/3OOTiavIeWEHgu+E85Tzs9PgNroqSPfAw X-Received: by 2002:a17:906:c812:b0:a52:a25:2077 with SMTP id cx18-20020a170906c81200b00a520a252077mr1732528ejb.14.1713444322549; Thu, 18 Apr 2024 05:45:22 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713444322; cv=pass; d=google.com; s=arc-20160816; b=Z8P7H/PyJ8iE7zUjn4GrUL8+3p4FW4uO0DoCMZAW2c5VB67ifcmp2epNBxk4h+q3Hr huJdNrhbrze2MxFTflKIHvL++6uo+jFhcX2rzMw16b6HyL3/AEcVtGm5B/joNuaznLDh +nZILXBSE8CyzFR30BZIT7siOdW+chVX87RwZvSwKS6Rs1TmCT3ludP2CNfh6o8SdRK6 LOPNSCAwIKEnxHxgZvLuvzA9Ynhl1zH5nlPzu6N1f6r10BZGN26JlT265KO+T7YRAu5O ir4NwA0gUiRnLpbH3s3KClWhl6asAsZqbbENRhAQw5HWo0qD00WSZvA2Sx5mo0w/JBx0 Wx6Q== 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=VqinG7vx90NXqlB3cCAWzb6LZzjfwkXKYqGSSxQF2QU=; fh=iVWCmjB83gF+4Hr7h/dImLDuPYAZGrecCJJuc9gH22s=; b=rBFsnMAe0QJTMgbF7Dex8Xm5ap+IlENPAJSN/ivUEExC471uw7Y3L4Z2+lcrgkZHUn l9v0nX7VUZ2r+sQOjKl60vvKYAu9qJzVwo5BcCF8ft/wJBP3IGLvvkXYLLlZXWCD17hA KnZ/QqZy9uuSIVUid1slJunf4YeLwF6vaBHf7ZyHMD81fnXHYJG/AfEQ2C9JzkYaP4iC Dr1LT+pJNoWvH7am8EdaExttnIyHmMwST1fp8vjN9CnrYevOJoyGLHVkY7kGuvC6mONs FVDYlon63nGqh8e1hCjwssFlSVm9/TjBZ2Zc8sqsqH47DuXa2gWi61apPqIckAyh+FSE iRYQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@rivosinc-com.20230601.gappssmtp.com header.s=20230601 header.b=SFqAV6eu; arc=pass (i=1 spf=pass spfdomain=rivosinc.com dkim=pass dkdomain=rivosinc-com.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-150082-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-150082-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id q23-20020a170906a09700b00a52485233b3si825911ejy.576.2024.04.18.05.45.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Apr 2024 05:45:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-150082-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@rivosinc-com.20230601.gappssmtp.com header.s=20230601 header.b=SFqAV6eu; arc=pass (i=1 spf=pass spfdomain=rivosinc.com dkim=pass dkdomain=rivosinc-com.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-150082-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-150082-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 DB5261F21CE7 for ; Thu, 18 Apr 2024 12:45:21 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6E635161B43; Thu, 18 Apr 2024 12:44:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=rivosinc-com.20230601.gappssmtp.com header.i=@rivosinc-com.20230601.gappssmtp.com header.b="SFqAV6eu" Received: from mail-lj1-f169.google.com (mail-lj1-f169.google.com [209.85.208.169]) (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 431A015FA94 for ; Thu, 18 Apr 2024 12:43:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.169 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713444243; cv=none; b=twMq4HmBSS2x1hFf4mmUPmtOwurLtlSKB4syGrbgLFntmcXjcv6/soIylJK7BtswgrzqY6BG8wXgqetazESenDDk2oRK+VZ0zi9lK4dIoLVL/kOnpwMTYFaI/7EPvOd5FlS56XjsJ68DlZGgNC3bOc0s+xFMx928Zu70mNlRgmc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713444243; c=relaxed/simple; bh=I+l+JkVVH9yyH4nAg3oBjtzyRDSG/5kxRFfJnm0mGaU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=XvcEMb46T/MlxRPBsm3Hw8LEIqFLRfjWcSm7nfonj+ILnDNt+rtGokpTYkfCfl8tgjURyDyBBHkyA8PGdmBodpBmvex2qL/pCtBQMAvGfLiHuWRhBnCz4Qz45PN9t3T4WqlIn8BzB66Sg1te6nmQOYgNH27+pazCdtMphH3HnVY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=rivosinc.com; spf=pass smtp.mailfrom=rivosinc.com; dkim=pass (2048-bit key) header.d=rivosinc-com.20230601.gappssmtp.com header.i=@rivosinc-com.20230601.gappssmtp.com header.b=SFqAV6eu; arc=none smtp.client-ip=209.85.208.169 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=rivosinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=rivosinc.com Received: by mail-lj1-f169.google.com with SMTP id 38308e7fff4ca-2d9f829d398so1957621fa.0 for ; Thu, 18 Apr 2024 05:43:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1713444237; x=1714049037; 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=VqinG7vx90NXqlB3cCAWzb6LZzjfwkXKYqGSSxQF2QU=; b=SFqAV6euphnHbeuqYe1KEqDKSPsC1135ph1AH0o0FVXjt1EJJYyQsmpjhEK7D4Xbvg RoNqIZarqw+FTLtg0itCZS0c2UyG0cYv86n5Mo8IR5Xmh06IHaVwiAe4gSUmBXC5fzJh d6el6IuvBHDCJ8H+U1Y3IE53r+v0twX4+taSZKUGgA0Fe9xbY9B/MEA/maF4Wve5p9FP HIiZJsHsfpHauOkLRpuM+3tL/gNiyihBtyOvdnFab0Q1ASLkF/t+Iv2UzY68BQA7Zvdm +MnG+SuM735QaV3PkNN+U7n8Gb86Ow2yIPKKDnrtCOSFNNByNDR6b2cu85Bden/X+DNC v92g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713444237; x=1714049037; 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=VqinG7vx90NXqlB3cCAWzb6LZzjfwkXKYqGSSxQF2QU=; b=AoDzcs6cOts1I9cJaV2hxKeeTNfHHyaUNi7znx0IKoMfNQiE/9Apr2YebyPewNs7Wq pMl2Ud2fieMIiPhEOsKv59qCXMqFEsUWiUzWs8+xegU2opHpjvOBuf4X2t+ngkVcNmxJ I0bSgz7gq4daeYANJHp9KpG0RFULwLzeiHCApJa0e5cDEXG5ize2xKH9FPX9RuuRYRq0 ONZUWNNcY9n1M1iCsm3o8er7AqCRFPkDvQvRhTnpkZSr2HxX63K0WWJG/Cg8N0Hnu2RU fgO5Ljc7vAc5y2ZvpRbn7ds73NNQqQI4v08zna+5VgqRzFaHtw1XZTJCdbNCULdxLZ9F 7zdg== X-Forwarded-Encrypted: i=1; AJvYcCWG2+Ut6k+9O09ew9IOC5YHWuI3uQe61DuZDC+MW/j8YGoSDOEm0Ph6CuvF22fvJwA/69jOoiF8yQ0oyW5vGXXVdPu8czbGXPyMl4h7 X-Gm-Message-State: AOJu0YyWQznSrD8fE31qrnryyySGHCKKJmkZ/SDPV5m4mtIAby4mr3MZ gLAOG3KxNA+n91xfMKJ32+8+KEBIpkEVOZEQ7K54QQ+Mg1pvFixLU11dwojgu+XSPnS4cLioZd0 qDd8= X-Received: by 2002:a2e:8387:0:b0:2d6:c59e:37c0 with SMTP id x7-20020a2e8387000000b002d6c59e37c0mr1507578ljg.2.1713444237161; Thu, 18 Apr 2024 05:43:57 -0700 (PDT) Received: from carbon-x1.. ([2a01:e0a:999:a3a0:7b64:4d1d:16d8:e38b]) by smtp.gmail.com with ESMTPSA id bi18-20020a05600c3d9200b00418d5b16fa2sm3373412wmb.30.2024.04.18.05.43.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Apr 2024 05:43:56 -0700 (PDT) From: =?UTF-8?q?Cl=C3=A9ment=20L=C3=A9ger?= To: Jonathan Corbet , Paul Walmsley , Palmer Dabbelt , Albert Ou , Conor Dooley , Rob Herring , Krzysztof Kozlowski , Anup Patel , Shuah Khan Cc: =?UTF-8?q?Cl=C3=A9ment=20L=C3=A9ger?= , Atish Patra , linux-doc@vger.kernel.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, kvm@vger.kernel.org, kvm-riscv@lists.infradead.org, linux-kselftest@vger.kernel.org Subject: [PATCH v2 03/12] dt-bindings: riscv: add Zc* extension rules implied by C extension Date: Thu, 18 Apr 2024 14:42:26 +0200 Message-ID: <20240418124300.1387978-4-cleger@rivosinc.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240418124300.1387978-1-cleger@rivosinc.com> References: <20240418124300.1387978-1-cleger@rivosinc.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit As stated by Zc* spec: "As C defines the same instructions as Zca, Zcf and Zcd, the rule is that: - C always implies Zca - C+F implies Zcf (RV32 only) - C+D implies Zcd" Add additionnal validation rules to enforce this in dts. Signed-off-by: Clément Léger --- .../devicetree/bindings/riscv/cpus.yaml | 8 +++-- .../devicetree/bindings/riscv/extensions.yaml | 34 +++++++++++++++++++ 2 files changed, 39 insertions(+), 3 deletions(-) diff --git a/Documentation/devicetree/bindings/riscv/cpus.yaml b/Documentation/devicetree/bindings/riscv/cpus.yaml index d87dd50f1a4b..c4e2c65437b1 100644 --- a/Documentation/devicetree/bindings/riscv/cpus.yaml +++ b/Documentation/devicetree/bindings/riscv/cpus.yaml @@ -168,7 +168,7 @@ examples: i-cache-size = <16384>; reg = <0>; riscv,isa-base = "rv64i"; - riscv,isa-extensions = "i", "m", "a", "c"; + riscv,isa-extensions = "i", "m", "a", "c", "zca"; cpu_intc0: interrupt-controller { #interrupt-cells = <1>; @@ -194,7 +194,8 @@ examples: reg = <1>; tlb-split; riscv,isa-base = "rv64i"; - riscv,isa-extensions = "i", "m", "a", "f", "d", "c"; + riscv,isa-extensions = "i", "m", "a", "f", "d", "c", "zca", + "zcd"; cpu_intc1: interrupt-controller { #interrupt-cells = <1>; @@ -215,7 +216,8 @@ examples: compatible = "riscv"; mmu-type = "riscv,sv48"; riscv,isa-base = "rv64i"; - riscv,isa-extensions = "i", "m", "a", "f", "d", "c"; + riscv,isa-extensions = "i", "m", "a", "f", "d", "c", "zca", + "zcd"; interrupt-controller { #interrupt-cells = <1>; diff --git a/Documentation/devicetree/bindings/riscv/extensions.yaml b/Documentation/devicetree/bindings/riscv/extensions.yaml index db7daf22b863..0172cbaa13ca 100644 --- a/Documentation/devicetree/bindings/riscv/extensions.yaml +++ b/Documentation/devicetree/bindings/riscv/extensions.yaml @@ -549,6 +549,23 @@ properties: const: zca - contains: const: f + # C extension implies Zca + - if: + contains: + const: c + then: + contains: + const: zca + # C extension implies Zcd if d + - if: + allOf: + - contains: + const: c + - contains: + const: d + then: + contains: + const: zcd allOf: # Zcf extension does not exists on rv64 @@ -566,6 +583,23 @@ allOf: not: contains: const: zcf + # C extension implies Zcf if f on rv32 only + - if: + properties: + riscv,isa-extensions: + allOf: + - contains: + const: c + - contains: + const: f + riscv,isa-base: + contains: + const: rv32i + then: + properties: + riscv,isa-extensions: + contains: + const: zcf additionalProperties: true ... -- 2.43.0