Received: by 2002:ab2:69cc:0:b0:1fd:c486:4f03 with SMTP id n12csp5697lqp; Mon, 10 Jun 2024 15:57:57 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUuBm3Yj+h+dND9mwtNheOZvkR0pbI19AHQA9S9enlxGEJKJuFA97mLEicyoF5jwFRZqyKSEZ/TReNrxhftN6spQq5PVljlVm+Pq0nllA== X-Google-Smtp-Source: AGHT+IHi/uxZdooQUREx78MsMHsi+BUhs22InF52KbY4rh0ob0MyQhb4O1JPUuUIXvbYNP6OwtT9 X-Received: by 2002:a05:6602:1515:b0:7eb:5e11:ed62 with SMTP id ca18e2360f4ac-7eb5e11f9f9mr1053186339f.3.1718060277667; Mon, 10 Jun 2024 15:57:57 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718060277; cv=pass; d=google.com; s=arc-20160816; b=VudHmNgF8satCvINvM/cPw/JyMNTazttnQGkcQuQkPxsao1Q5JgRnm6Ezx/5G+HPyw Ftg5pEmd/giKBY/ov59ngsz5HgAs6G8Dw0OAm94Gj/jFaCUvBC57u+df8FizTnbXXaUC YG+vkVvrsjRrNyjHgGR1mMmv2flHyWmD8TMRM5Bzv4453rHRNE8KfvVQUTofkkU9y8q1 04G2oANw22szlJ9V3DsTkoG1xhQ9zuhHZVaRonLJsSG3rPOHJ7b8e7W4fQyrM1Zq6kE+ 0OrM5XftD3hXaUIJuWZ6rMkj6nV1xi1WIH/KjwCA76iCQX3EQbo62anXOtk5H7/DNTkR ddDQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=I0+4Y1+kZj7kzyDByjbiS4FxJ2LwioSPa5gPvRUttq4=; fh=BU2SmgUbXnYEerUIGKucESRuwpgv8/4kG0ookgv67Mg=; b=z+CHJREE0458+JBz8wAANc+ck6hrDZmeXb3etxQHnwnYCy5AvYEDjeqUIQplfbBFFZ t6v5Wy0OF+bX0vWLn9cbdimveB2ZyeKvgmoF1xKUqWtLu9x4XOvjerCiX8GrMV4umIAN di7J1gBf572UrQLMcPmagBH075zvPmftrvqJ5uWHAvS3Xg84g5puBuzYq8Bqi5hldLU1 nZzyVbM6nS4tD9HNyH9KU/cIPcxb/VQcVuInGpaYggoivugpPOSnaQIsrQOn1XCJAJul W4zOQd+zQQrULCZ3s/2raQWL08t2Ass6nePtA0QVI4Fak+9LjEUv5NYkfkpdV/D10b3Z f0WA==; 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=XouSOeRT; 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-209023-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-209023-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id 41be03b00d2f7-6eaf7d0ec92si3588787a12.703.2024.06.10.15.57.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Jun 2024 15:57:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-209023-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@rivosinc-com.20230601.gappssmtp.com header.s=20230601 header.b=XouSOeRT; 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-209023-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-209023-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 6B0F5283FF6 for ; Mon, 10 Jun 2024 22:57:39 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5950F152175; Mon, 10 Jun 2024 22:56:54 +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="XouSOeRT" Received: from mail-pl1-f180.google.com (mail-pl1-f180.google.com [209.85.214.180]) (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 A9BD015216E for ; Mon, 10 Jun 2024 22:56:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.180 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718060213; cv=none; b=rd2fDLKLpmRBMbm8ODfZmXSx7MzdKYmaRGST/HlzeFukPkoheQhW6LvXcNKERO7geM1Fg2S3XmW6OLAIsXH5H17HKHMWYcA0G2Zdz++Qr07Mu9fckeRTs+9oaFXffb7/PGq/U8uGjj9bhruXKovv3wuc5le6z/CyXu/KWu4zryI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718060213; c=relaxed/simple; bh=FmiYt7nDWXyQO4kxiIrIwAfbDlksD7XmLdehRC0fezg=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=IhLirdyjLxt2rqqRVFURpticgs/ma5af158bFYQbFWvimZJzbCtmQuMkzetVh3xl9alNGpdeAzcPkj1gXY/VZW/FxanjGe6cu8fXRopIV5n/kgpN6LNiXhPd7pHlx46ZbetaIA9GNum2igZwJuDjMgTSTbFuqIvRFckp2mENmaE= 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=XouSOeRT; arc=none smtp.client-ip=209.85.214.180 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-pl1-f180.google.com with SMTP id d9443c01a7336-1f480624d0fso3219785ad.1 for ; Mon, 10 Jun 2024 15:56:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1718060210; x=1718665010; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=I0+4Y1+kZj7kzyDByjbiS4FxJ2LwioSPa5gPvRUttq4=; b=XouSOeRTB62Y+M/C3QAB/+UP6XbiI2M0s6wdzp5uQey/FvbcC5WMSCvnwmkoM6MAoM BsLaLEDW2Y8p8Igx/oPmycoAfzio6fcT/OZp7RZrXOWvfhlwkbzCuslZESqmJd9HeiEO zJaUFLDyf1/xIIBg5CHBPycCI7f6VJW8RO4VDDYvcByYG7H9tERhMDQ5fpS6+/fVpZLJ 3REWSIPhboHQWsVP5O5osto0/mpwEmQQKjOWBGvYsR7s9KPt4ZgmkuD92FuGtpQH1tck bjj98h2kg3jhM7L7aWVXLuF9k+VSDQTRDe7Qsz9Da1BNuO5MTMrgrkHbZDcb/x5cCRVn b5sw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718060210; x=1718665010; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=I0+4Y1+kZj7kzyDByjbiS4FxJ2LwioSPa5gPvRUttq4=; b=hztcVAhkiEVw1BLm9KU54vmh2AYEroFxMq2JmuXtVkfCFX5TWJcVDZnIdlAsv0Ic1q Vb9KjwPFsSZNUlHl9Kgnw12U7jeGkHxu3hTnCcd/vNaK3qFweYS7G22UzMsrmwbEoRFR oM/Ih0m3pbVndRugIQ2Py2FboDtA2mxEOGLRKel05O0iIDUy0fItI41aPcXvMPxF8Yqh gtX3PuWVP2Wbb4Me6RzKvS+fH9JGOTw58RSSJNy5Ar5DRIOzOpGEKtV1XZhjsc9/AOpl HZiIS+gNxPmcx2Ec++HITtHLHGedWjYJ+NmYVHFSBZQD11wMJor7mv+BO0+kBf8iBPJK 31FA== X-Forwarded-Encrypted: i=1; AJvYcCWisGbiU1yJpa8hNWDmEd9hnrZrNDRi4cmeHuXH7R/TFeR5XJxK0mgUSkGDCMHt1IvT8vg+kfbL8PEebkPMHq48kwpjD524SHpjrj7V X-Gm-Message-State: AOJu0YzULm2f/X46IQu89iFDiNzrh2pfd2P0We79LrNElLWnEQk6qfef lGV34bfP3SHvgxI59FODjRGG/UqjQhl9oicEnrfgsL/HONE5+sIrDgKOe8PikC0= X-Received: by 2002:a17:902:c40e:b0:1f2:f090:b2c1 with SMTP id d9443c01a7336-1f6d02c05c3mr118292465ad.14.1718060210095; Mon, 10 Jun 2024 15:56:50 -0700 (PDT) Received: from charlie.ba.rivosinc.com ([64.71.180.162]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1f71b597072sm18355865ad.99.2024.06.10.15.56.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Jun 2024 15:56:49 -0700 (PDT) From: Charlie Jenkins Date: Mon, 10 Jun 2024 15:56:39 -0700 Subject: [PATCH v2 02/13] dt-bindings: cpus: add a thead vlen register length property 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: 7bit Message-Id: <20240610-xtheadvector-v2-2-97a48613ad64@rivosinc.com> References: <20240610-xtheadvector-v2-0-97a48613ad64@rivosinc.com> In-Reply-To: <20240610-xtheadvector-v2-0-97a48613ad64@rivosinc.com> To: Conor Dooley , Rob Herring , Krzysztof Kozlowski , Paul Walmsley , Palmer Dabbelt , Albert Ou , Jisheng Zhang , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Jonathan Corbet , Shuah Khan , Guo Ren , Evan Green , Andy Chiu , Jessica Clarke Cc: linux-riscv@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-sunxi@lists.linux.dev, linux-doc@vger.kernel.org, linux-kselftest@vger.kernel.org, Charlie Jenkins X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1718060203; l=1855; i=charlie@rivosinc.com; s=20231120; h=from:subject:message-id; bh=FmiYt7nDWXyQO4kxiIrIwAfbDlksD7XmLdehRC0fezg=; b=j6worq4qjVrGWSrMLs8ZptH5pEOv7EhqwLLriJxX4IvyZ6q4PNQkoLqbTB+1gPxHp/ucFxW7p LqxKtRcAfNJBzenwMB/6ovUljV8lB8Tsp26Tv9p3U5IVmx1duDVW6tB X-Developer-Key: i=charlie@rivosinc.com; a=ed25519; pk=t4RSWpMV1q5lf/NWIeR9z58bcje60/dbtxxmoSfBEcs= Add a property analogous to the vlenb CSR so that software can detect the vector length of each CPU prior to it being brought online. Currently software has to assume that the vector length read from the boot CPU applies to all possible CPUs. On T-Head CPUs implementing pre-ratification vector, reading the th.vlenb CSR may produce an illegal instruction trap, so this property is required on such systems. Signed-off-by: Charlie Jenkins --- Documentation/devicetree/bindings/riscv/cpus.yaml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/Documentation/devicetree/bindings/riscv/cpus.yaml b/Documentation/devicetree/bindings/riscv/cpus.yaml index d87dd50f1a4b..a6bbbf658977 100644 --- a/Documentation/devicetree/bindings/riscv/cpus.yaml +++ b/Documentation/devicetree/bindings/riscv/cpus.yaml @@ -26,6 +26,18 @@ description: | allOf: - $ref: /schemas/cpu.yaml# - $ref: extensions.yaml + - if: + not: + properties: + compatible: + contains: + enum: + - thead,c906 + - thead,c910 + - thead,c920 + then: + properties: + thead,vlenb: false properties: compatible: @@ -94,6 +106,13 @@ properties: description: The blocksize in bytes for the Zicboz cache operations. + thead,vlenb: + $ref: /schemas/types.yaml#/definitions/uint32 + description: + VLEN/8, the vector register length in bytes. This property is required on + thead systems where the vector register length is not identical on all harts, or + the vlenb CSR is not available. + # RISC-V has multiple properties for cache op block sizes as the sizes # differ between individual CBO extensions cache-op-block-size: false -- 2.44.0