From patchwork Fri Apr 12 04:11:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Charlie Jenkins X-Patchwork-Id: 13626870 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 149FEC05023 for ; Fri, 12 Apr 2024 05:18:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=oC2AxVTTCBJUlgsLCNaK3y6mBFuA6KceymbGy3AeKHI=; b=uo0ZLqnjUyQXLS oGltuGB0+VZf1lPTSvDmlHTXZYEQ6raJtj4t0EWUMDTmPFiV6KjX1UJpqSlIjNOnPVxPvUb5QjWFz jGT4zxtC0X02b7mIHZd9rCLuP/VDRpVFr84Ss8EQOyc/3SHAQ4Fy7BifsPWHkeF0TlBmEnTdiSjSP +BQy4sthgMBrMDw4l7Ethyc1Fnw5i8CGK/0zTHE3n7aWpXcx0hPNHOUJz/Slpag1r4BoDJ5DWCRsr BoVX46DRBZLNmCWgNbgKhXprsSVoiafln65Ul9ytr3VMB4wrKYRQBwkhwPSQFRc4925TuD5MzI9l0 1TfDeW6NiHk6cnsOM1Cg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rv9JC-0000000FNDZ-3OGW; Fri, 12 Apr 2024 05:18:42 +0000 Received: from mail-ot1-x335.google.com ([2607:f8b0:4864:20::335]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rv8Gb-0000000FAKj-1dN8 for linux-arm-kernel@lists.infradead.org; Fri, 12 Apr 2024 04:12:04 +0000 Received: by mail-ot1-x335.google.com with SMTP id 46e09a7af769-6eb5887f225so380048a34.2 for ; Thu, 11 Apr 2024 21:11:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1712895111; x=1713499911; darn=lists.infradead.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=H/cX7KqBpjbvwnfweF/+d0sA0CANzzmggwTxwJIRs2g=; b=azezolF+TSADVbMabRhdDLYBKIW4EG4sLKVfq5fbTB8bb2ldqkYrT9riH9pkpH64qe bx4v3E+0uq7AF3+R0WOa/ttvOyfBOaVwDx8yAtGDEFtAVnuc34DoNxg2LFcNE9nCrCR7 r7Ok/rps7quyVT1tCJjV2lOMh0ThgMe0tD4rDS33/nHnbw4Ppk85qyrNnPDakxhMyps7 FQvFvtZclAcSrhOjQW5fjfoiP4sS7p5WmM0T5k81KYceowlvGMz17jy1rZNU4KHZimeg aj9CtsDiNPO5InHXsrkDzFWlR5a0zjsPXNf2BTHTZ5unZjNb/LgGAWX2KpK++zygj7TP 7OHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712895111; x=1713499911; 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=H/cX7KqBpjbvwnfweF/+d0sA0CANzzmggwTxwJIRs2g=; b=MSvN/SditnmFvPsvlmevD/IV+/KXeWc43Z0lC9z90jX4yEaeb+q+vxB7tPAhDjG4W5 XBX4HtO0HvSBqsRW6uY6mF4CubaHI8Z0lbIs43cpAcMrcLXEONod0+uFfZmLF6s6VqLn kUqRlQ63KJ+3RyWdH6AbnpXHoaOHB+HZkPA9Cl1JDSDkdJrAl1f91GlWYy43qk9Ks9Sj +dXscE8pbD08iunSe6b9VDd+cAqmaO7oWUPAjnAwbwnQTBPTXo2B4BbKM4VExvmgkqmM Z7nk5cD/82Xz5Z9XGc71vBT366rleVmeZWIWDcxE1iPvg8jUaIMD6urE1t33i3qQz0H1 VZRA== X-Forwarded-Encrypted: i=1; AJvYcCXNDjgjupzqa3vD436D0Wb9X+1nJr4y8fuJZrqCIbn0eWPQJDHO69vmaKeDJmr0P7JorJiBRNdL6CO6a172i/ZrA4cV2QkpayXF77NjYUqIcqlF+e4= X-Gm-Message-State: AOJu0YxyJMDySINF4Ol7+M7yFEZ56fL9Sn3vIhxlsLraFQ3vsiB3TOTz YzPfF+3aHJx6zj46mACqAb+sNEXTjsSqykE0kcQYIU4VYAhsfWtf6DrolMOaZF4= X-Google-Smtp-Source: AGHT+IG7xfdr9GM09kld+gpoTRj53E+tx3TX3WdgGh40cliYEBj/2eByASG+/EjGzkDhX2ZzYVRIWg== X-Received: by 2002:a54:4781:0:b0:3c4:e208:b784 with SMTP id o1-20020a544781000000b003c4e208b784mr1726036oic.27.1712895111330; Thu, 11 Apr 2024 21:11:51 -0700 (PDT) Received: from charlie.ba.rivosinc.com ([64.71.180.162]) by smtp.gmail.com with ESMTPSA id ka13-20020a056a00938d00b006e57247f4e5sm1949712pfb.8.2024.04.11.21.11.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Apr 2024 21:11:50 -0700 (PDT) From: Charlie Jenkins Date: Thu, 11 Apr 2024 21:11:16 -0700 Subject: [PATCH 10/19] RISC-V: define the elements of the VCSR vector CSR MIME-Version: 1.0 Message-Id: <20240411-dev-charlie-support_thead_vector_6_9-v1-10-4af9815ec746@rivosinc.com> References: <20240411-dev-charlie-support_thead_vector_6_9-v1-0-4af9815ec746@rivosinc.com> In-Reply-To: <20240411-dev-charlie-support_thead_vector_6_9-v1-0-4af9815ec746@rivosinc.com> To: Conor Dooley , Rob Herring , Krzysztof Kozlowski , Paul Walmsley , Palmer Dabbelt , Albert Ou , Guo Ren , Conor Dooley , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Conor Dooley , Evan Green , =?utf-8?b?Q2zDqW1lbnQgTMOpZ2Vy?= , Jonathan Corbet , Shuah Khan Cc: linux-riscv@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Palmer Dabbelt , linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-doc@vger.kernel.org, linux-kselftest@vger.kernel.org, Charlie Jenkins , Heiko Stuebner , Heiko Stuebner X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1712895091; l=899; i=charlie@rivosinc.com; s=20231120; h=from:subject:message-id; bh=TuSThplyvDtTVWqwUFhV/gX6CqguLjbnzElxxGAX5lI=; b=IoxQnX7xJtd3/O6TEZTN81ZKioZw5d0r4tz8jwxoksLzmt6rX3y60kHb1haJbdArKfd+lqIbO ic08kmN1+92DSy5wQJq3UBtk09zK5SOAjN41rNduYXhvK29guCQEHVa X-Developer-Key: i=charlie@rivosinc.com; a=ed25519; pk=t4RSWpMV1q5lf/NWIeR9z58bcje60/dbtxxmoSfBEcs= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240411_211158_099279_17B3AA70 X-CRM114-Status: UNSURE ( 9.77 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Heiko Stuebner The VCSR CSR contains two elements VXRM[2:1] and VXSAT[0]. Define constants for those to access the elements in a readable way. Acked-by: Guo Ren Reviewed-by: Conor Dooley Signed-off-by: Heiko Stuebner --- arch/riscv/include/asm/csr.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/arch/riscv/include/asm/csr.h b/arch/riscv/include/asm/csr.h index 2468c55933cd..13bc99c995d1 100644 --- a/arch/riscv/include/asm/csr.h +++ b/arch/riscv/include/asm/csr.h @@ -215,6 +215,11 @@ #define SMSTATEEN0_SSTATEEN0_SHIFT 63 #define SMSTATEEN0_SSTATEEN0 (_ULL(1) << SMSTATEEN0_SSTATEEN0_SHIFT) +/* VCSR flags */ +#define VCSR_VXRM_MASK 3 +#define VCSR_VXRM_SHIFT 1 +#define VCSR_VXSAT_MASK 1 + /* symbolic CSR names: */ #define CSR_CYCLE 0xc00 #define CSR_TIME 0xc01