Received: by 2002:ab2:784b:0:b0:1fd:adc2:8405 with SMTP id m11csp144100lqp; Sun, 9 Jun 2024 21:46:11 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUdqCfw20X6PL3+LF7BD2J4O2GczcnAUO6J9+TvVTJZq6vxFabXku+A4Fy2MOLpCgsHiAXDird9m+k/gvfHcakFo4cP24iGBM4JW8Eryw== X-Google-Smtp-Source: AGHT+IEMmc3f/sFWeh62+ULyzAUoHW1by3spoq5t+7Mj+QAvMSUbck0yIZFMahnwIeRHPoWj9+MA X-Received: by 2002:a05:6870:649f:b0:254:c20b:91fd with SMTP id 586e51a60fabf-254c20c4dd4mr2472681fac.23.1717994771480; Sun, 09 Jun 2024 21:46:11 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717994771; cv=pass; d=google.com; s=arc-20160816; b=UW0e+soBp1sAsgysPf3TQFbkkj1npe/cX75MAKkewWiPcbah3kqzki0MH2rTtxnght cWyBPflnmPbxtJFKnHsJsV+ye/geDz5J/foPIkx0X5b6uLbaATumYy0Vyfu2RKkgQ+iP BDXLAYMX6SBFct+XV0WgIODuI5z4Sy2984VTGgdmLJXWOrUJFJTwSHG34ns+sRMFytM/ mjFDe1LTPr9u5HyqblwhU9oHqUc30Z4ZjHHBuFpSq1eWCptGstm/rCu4H4fvnmNFnuQ+ GLdgsexd0t8TFGbTy5JPcww3rG0YcJxrzvbPxIJNKMVymCkCh8acpFvu4MQM9L3j2D/p z9og== 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=PnsoWpv70BH6qIUNn0TaawjhriEvRFbQJi7Pz4BWmlk=; fh=P6Q9VcHLgIieynVmzX50eVFfanBB+Bpm9x2p6TvIF/c=; b=HG9ttrk+O+CCpVpVuM76yY55+E7BV9PTEwY9LQcNskfSJRaJDEiVcx7hkTDCFb9Rof SIjuzznFvKwgC0SxzjgXz1IcRfEshJLf38MzWdKkTaev30Jzo5OpeKWjBn88nmy4p6Fi etMci9bCrABCm0/HKw0PjS58pDFSxKPUwLNtn69f6JdDyZlDkDf+je4z5zPl0jBb5bNo MStiQ4WEDacoV8VtK2/F1QGBQlXDa5T4Gb1vO2GzTlmWE2zNvYZp4Y0xWaQdiMPHL34B MmBkSfyMAX7e6ZEPBD69eYNZwpnF7Zwk23sPqGyySC4FtnjhUOzQPFVekwMExFpL4WwT eqiw==; 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=wxn5caCs; 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-207627-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-207627-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id d2e1a72fcca58-704172c09c3si2829039b3a.395.2024.06.09.21.46.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 09 Jun 2024 21:46:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-207627-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@rivosinc-com.20230601.gappssmtp.com header.s=20230601 header.b=wxn5caCs; 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-207627-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-207627-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 DBB20281D58 for ; Mon, 10 Jun 2024 04:46:09 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3804217C8B; Mon, 10 Jun 2024 04:45:42 +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="wxn5caCs" Received: from mail-pf1-f171.google.com (mail-pf1-f171.google.com [209.85.210.171]) (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 03E3E11723 for ; Mon, 10 Jun 2024 04:45:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.171 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717994741; cv=none; b=FWJIfLt3DDiCeCwJKGuuL9n4SMJjLufvXtRODXiX4cDx0tWe4jvwLHy3oeoLu2NKCa7YzxdKKD3bPPfCaJjhvLMqcRM/wT+nJoQDjl/vkBC3KVGmyEHYQas4p0mcx0fyhb1sfMUDriq94g0eb3sEN1kKCrQG4XI1+IvATVPWG20= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717994741; c=relaxed/simple; bh=kilTkVt6+s7AVwl0Le2KXls/6mRYwW97PnRFwTEsmd0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ZPVquxn8/sjSr8Gf2GoeM4UVn+vTHuL583ZWnrTLaj/DZchJalzKwyRNbeo2KrEcGS4TKQh0xF5x+Lz+Ct0tIRq7qH5ZonwMfRN6ZBKx8B0xwFNoJ9zrvou3iRu9dFj24H4y3bR6sRdZYxvykGB6ZAORs7wZ69kz8tWD4/SRz7k= 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=wxn5caCs; arc=none smtp.client-ip=209.85.210.171 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-pf1-f171.google.com with SMTP id d2e1a72fcca58-7042ee09f04so1079874b3a.0 for ; Sun, 09 Jun 2024 21:45:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1717994739; x=1718599539; 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=PnsoWpv70BH6qIUNn0TaawjhriEvRFbQJi7Pz4BWmlk=; b=wxn5caCsXC0vV09n0dBHjR4UfkxtlzU/kGayio/R1su7uFEk/HX3Iu3Qx26RI62lCf vXfs00y18NrU/M8wfXB6eOxjBq6suSglVwJRxxVFGRC1S63D+j4MFAMJrxVeHwFeIAl1 ElsNb2FBpV4tkfnaGdB0ivSwvJ3eXzAPgrl0klFK/B9HQbm5lkSOOtq37i8NSTH6vZcQ U5XTsbnkLkAJBZ7HZMV95APaVouicb0mhmkrKnwCwk9jJ2ktirW28m0q6ZNVv1HJJP9m LMNU7oXVLTeeQEeAN49GbE8zbatX69Idg8uCPnIYs0nYaiXskqRq6//fxMHhIQRPD0qV JgRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717994739; x=1718599539; 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=PnsoWpv70BH6qIUNn0TaawjhriEvRFbQJi7Pz4BWmlk=; b=brzVgLiXH5JNlGPXoYQL8GU6CbrifOIx7eJZIQuV8qD10KV6jx5T0P2Lt06ZPcKajE pk1P/5N6Jxl2DzTaYGeaHdStZPcJLGXdzBbu2ekkPFS4GS2kYXFtjWa4AggkV0o+HRPd 2VK56FKR3Gbda1vb1LyYIMMLYtxrHPY42CWISNAaTfJAfBuR2mXVYz5v47iqrson03Yl UNa/DX0O97YfoF/3TMV7dsQoPVsCpLol5IqmJgDT27sk/dqnhFn3McDI4BedEK0dnujj toHKskfEOcdqNVJuBoiBTx5VnypA3pk2TYngnMqzP7DnG52zq5IJUpMSwdoWbweRZWo5 Aihg== X-Forwarded-Encrypted: i=1; AJvYcCXgr7FOKNNv4q+ksS3xYvIlXM5ZRq98K/IBz+xSX4OI1LTQhNyu1gCscIUu7vpzaVcVQemSxdYRQvM3Jf3vaQwPryFhCTPINdrMttGc X-Gm-Message-State: AOJu0YxhdtRmvzo21WiUEaDDT3cc2ay2de8de5kEhqJCXvwQ40fI3Hgr yzboKFUC7saFeq2zICoXhqs5qDHw3rM7sKm1B+t/enGqJFLMeqcIaejMohqw9Fw= X-Received: by 2002:a05:6a20:3c88:b0:1b6:4151:6158 with SMTP id adf61e73a8af0-1b641516226mr4498267637.47.1717994739324; Sun, 09 Jun 2024 21:45:39 -0700 (PDT) Received: from charlie.ba.rivosinc.com ([64.71.180.162]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1f6bd76ce8asm73124095ad.77.2024.06.09.21.45.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 09 Jun 2024 21:45:38 -0700 (PDT) From: Charlie Jenkins Date: Sun, 09 Jun 2024 21:45:07 -0700 Subject: [PATCH 02/13] dt-bindings: thead: add a 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: <20240609-xtheadvector-v1-2-3fe591d7f109@rivosinc.com> References: <20240609-xtheadvector-v1-0-3fe591d7f109@rivosinc.com> In-Reply-To: <20240609-xtheadvector-v1-0-3fe591d7f109@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 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=1717994732; l=1303; i=charlie@rivosinc.com; s=20231120; h=from:subject:message-id; bh=kilTkVt6+s7AVwl0Le2KXls/6mRYwW97PnRFwTEsmd0=; b=4RRz7xmpcb7CA1ZMWQZlS9J8l2HdlB2OzfAfqDm1wbd8Q0dPdolWk/sqmZ90bsZ3IlYTtYYew po+8/cap559D5Bi2X+IDlt6JHWqySfqydxCXpaM/iRpkxwpTP5F3ksW 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/thead.yaml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Documentation/devicetree/bindings/riscv/thead.yaml b/Documentation/devicetree/bindings/riscv/thead.yaml index 301912dcd290..5e578df36ac5 100644 --- a/Documentation/devicetree/bindings/riscv/thead.yaml +++ b/Documentation/devicetree/bindings/riscv/thead.yaml @@ -28,6 +28,13 @@ properties: - const: sipeed,lichee-module-4a - const: thead,th1520 +thead,vlenb: + $ref: /schemas/types.yaml#/definitions/uint32 + description: + VLEN/8, the vector register length in bytes. This property is required in + systems where the vector register length is not identical on all harts, or + the vlenb CSR is not available. + additionalProperties: true ... -- 2.44.0