From patchwork Mon Oct 14 13:55:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 13835120 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 97FDAD16275 for ; Mon, 14 Oct 2024 14:23:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type: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=WOBAB4fCN+OYdhF4Gj278BY1JY5UgUE5qLDzZmKiBEQ=; b=fmd1wJkcMoftuAputr27Uu6OjS Onx0KBZ16PM4WaoPQs79a/w2zu06YrZj3YjdU3txGVto06ulIXXahKcswWUnDw4Z5Cryik0YO8wV6 jelIMi8DPOHvdVegp7i/47+OkdCQuBydxixc5znQe/H9If6oVkv+J0zJdDprbQhgqv6Q/hc0UphMx d2Y33c38pmum4FA7vWjcg9e/eAN/vpsI0xDolzNOaP5L9qW0q4TxlzDJ6jFNgAJpBu/+19CXLBulO QnaZ6zfDPNBs0+EI2TtmT1aM+FFXLGwYMMgtOkWz8VJe7fI8GIBlFoSGofPIrBMfMBz9GbrpP1QaP N6flf4qw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t0Lyc-00000005SHQ-1fWG; Mon, 14 Oct 2024 14:23:14 +0000 Received: from mail-lj1-x235.google.com ([2a00:1450:4864:20::235]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t0LXk-00000005NCX-21zb for linux-arm-kernel@lists.infradead.org; Mon, 14 Oct 2024 13:55:29 +0000 Received: by mail-lj1-x235.google.com with SMTP id 38308e7fff4ca-2fb3110b964so32611781fa.1 for ; Mon, 14 Oct 2024 06:55:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1728914126; x=1729518926; 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=WOBAB4fCN+OYdhF4Gj278BY1JY5UgUE5qLDzZmKiBEQ=; b=qSbif9wtQzCXAxyk02nto+aXamenf6GsCjJsnFTHhg4t1iXpo+L7Q2igQtjXIVR1ve t6z9Op4Ls9/87Ne+Rk14GYOLQsExLsAClnytXlaEZmJgpUtG7fAc1uB30hROFZ84Riq5 UwF8UW4Dwe36e6bNFoUe3Tl4YlW7jb+Su8HKh42DnGFV4y+H48eBvY9r4M07w7VqjDHK t4Cupb1JkjDX57EcRQHbZVrzOHPo8ANf2jSH8du41F2SdJa5IpbqNAhYuv7D1tgfXVHB NzPa0+aj7B9cSA2+XEh4r+dfS05/BO3LXL/dkB38DV4DkYIru8+b15hLcfbKd64ebXw0 xdUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728914126; x=1729518926; 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=WOBAB4fCN+OYdhF4Gj278BY1JY5UgUE5qLDzZmKiBEQ=; b=NfpRUJ+vBqbk4l/KxlkwfY35EKMAWycJkc+I7gdn73CYGmZAKJLP9ggGiEQyIJ5LhN kk2A9ensnh9pY6fmstqtZfkhwV2ESHyJV9VCxduRSTh/pZy0GzdEVnT4kze/7hvx3vJs 6gbxuSkneRdJGKjjBPuM7xEwR7opnO7KdyAq4SUkDwyEWjn6VNOxp5J3hFYwT/8V7zsU MfrArPOETQJq+3HmWGm0jVcbc+xbTpwL71qo0ymWipIB4sgcV+KHARlQdztWfJAcdO76 Iy09vp2zfi7jfN2B/nk/1AczI9bAhd0gAcucxhh1QZ4PDSh7WN3ukByyWImUZipT9ObU NhAg== X-Gm-Message-State: AOJu0YzAxVaW9lNZoVoNHhORj4y1wprdgifee95BZKtQx2c1nc62M0k3 s187W6qSKULqTTZR4V8DiO8vI6721zIgYrKSh/FzLJMsrSqMU5OGRlSjtOIOGSKpTDb4lE+uH3H M X-Google-Smtp-Source: AGHT+IHXfxymwMuBTLIPhj1IILaLlqCN68Kc44a6pGyIrVl/vNinMfPWVaScDLDhzz6b1w5Xu/CMGQ== X-Received: by 2002:a05:651c:1509:b0:2fa:bd30:1928 with SMTP id 38308e7fff4ca-2fb3f2d1b11mr26316081fa.32.1728914126119; Mon, 14 Oct 2024 06:55:26 -0700 (PDT) Received: from umbar.lan ([192.130.178.90]) by smtp.gmail.com with ESMTPSA id 38308e7fff4ca-2fb438c06f7sm8039641fa.55.2024.10.14.06.55.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Oct 2024 06:55:25 -0700 (PDT) From: Dmitry Baryshkov Date: Mon, 14 Oct 2024 16:55:20 +0300 Subject: [PATCH v2 1/2] ARM: add CLIDR accessor functions MIME-Version: 1.0 Message-Id: <20241014-armv7-cacheinfo-v2-1-38ab76d2b7fa@linaro.org> References: <20241014-armv7-cacheinfo-v2-0-38ab76d2b7fa@linaro.org> In-Reply-To: <20241014-armv7-cacheinfo-v2-0-38ab76d2b7fa@linaro.org> To: Sudeep Holla , Ard Biesheuvel , Russell King Cc: linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Bjorn Andersson , Konrad Dybcio , Arnd Bergmann X-Mailer: b4 0.14.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1067; i=dmitry.baryshkov@linaro.org; h=from:subject:message-id; bh=OB3yO9FQv0J593fU52zHVnW8M9sIKaaudWV4PCqWeY8=; b=owEBbQGS/pANAwAKAYs8ij4CKSjVAcsmYgBnDSLKtlJv5vCrtJr/cNbUxbxVvYF7NDouakMt/ W1CwyiX+LOJATMEAAEKAB0WIQRMcISVXLJjVvC4lX+LPIo+Aiko1QUCZw0iygAKCRCLPIo+Aiko 1eKFB/wLj20pVDg44I5tdPc6vbCK41LLd742EI7OeUQjip1Myn2p+pnpfgShdMzFHwpnhcVz+fa Y9D5UQ/73fOaI8EMt/CO//nyZbPZlu9N40Zto9dDrzK+0X726hn/F3prsFNMv006TFfUUzKYSzU 7G7WVg9nkw7wJ9druObfFR8Ph/b5ouw6tq6gXI4w25YtvTtKs+SoMxlYODeBQzKY3yN9T/DiEaX rPj5MwtIYfX/H1HWKuGJ6YyJMq4TSNGBmW9OIOQJnYogypC1bmE8+mgOFi8cFX2ys+jFvJybFtj drlm+eQF1wGx1JzNAnDxx6gtSNqrx/CUJIU4EW/pQZYEIABX X-Developer-Key: i=dmitry.baryshkov@linaro.org; a=openpgp; fpr=8F88381DD5C873E4AE487DA5199BF1243632046A X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241014_065528_560956_D0512C06 X-CRM114-Status: GOOD ( 10.50 ) 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 Add functions to read the CLIDR, Cache Level ID Register. Signed-off-by: Dmitry Baryshkov Reviewed-by: Linus Walleij --- arch/arm/include/asm/cachetype.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/arch/arm/include/asm/cachetype.h b/arch/arm/include/asm/cachetype.h index b9dbe1d4c8fe..b01c59076b84 100644 --- a/arch/arm/include/asm/cachetype.h +++ b/arch/arm/include/asm/cachetype.h @@ -83,6 +83,14 @@ static inline unsigned int read_ccsidr(void) asm volatile("mrc p15, 1, %0, c0, c0, 0" : "=r" (val)); return val; } + +static inline unsigned int read_clidr(void) +{ + unsigned int val; + + asm volatile("mrc p15, 1, %0, c0, c0, 1" : "=r" (val)); + return val; +} #else /* CONFIG_CPU_V7M */ #include #include "asm/v7m.h" @@ -96,6 +104,11 @@ static inline unsigned int read_ccsidr(void) { return readl(BASEADDR_V7M_SCB + V7M_SCB_CCSIDR); } + +static inline unsigned int read_clidr(void) +{ + return readl(BASEADDR_V7M_SCB + V7M_SCB_CLIDR); +} #endif #endif