From patchwork Sun Dec 31 17:38:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 13507288 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 0FAC8C3DA6E for ; Sun, 31 Dec 2023 17:39:39 +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=2lWlRepK4HGCvEqVeX9UzcZGzOxTxvWgI8uefy+nPl4=; b=mmtUYK7+X+k9cx 9pBIh5Y7VOvTs/8XDeaxJSXyovaDw2GSQIfp+Mcj2Vhv33HRrgvwZQvfbCtcSaY9olUNMUosF1M67 kLXAPmds+F6JocawqWsuI5pqvTia+cd/Dwh9grYmIBy5FMelk4D9voyhmXdEJxguqUNMA0AUXvmyk jyBPcv2C5LXR6jjTloMzcWPLc9KBS1FWN3DBvbB0pLEjVM6iGMlzX+0RbAcgKoaZng/w5OhTLVl+S KTsM9P3zln0qO30k5gldNFIZDu383rxqkuRtD0yiXOjmea3f+MdAJ3UrdcXdwhwb+8NINd8aVT7qT OCoveA4IlseubM3K0r9w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rJzmF-004vfR-1M; Sun, 31 Dec 2023 17:39:07 +0000 Received: from mail-lf1-x134.google.com ([2a00:1450:4864:20::134]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rJzmC-004veQ-0Q for linux-arm-kernel@lists.infradead.org; Sun, 31 Dec 2023 17:39:05 +0000 Received: by mail-lf1-x134.google.com with SMTP id 2adb3069b0e04-50e8ca6c76dso2866138e87.3 for ; Sun, 31 Dec 2023 09:39:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704044341; x=1704649141; 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=5dsfoDrDqhFi2M0qRhXB0Rpx7fbnSThvVod9k+rsj1w=; b=RKYrqcb3Ao9JX/Xi4Yw96JlHvwkt3L6N9jl7/pS+QbpaGJiIrvo/KAt09TgV0ulJLB ulDRD81GSddZYTetp/+7DkkSf4VGWFEZ1UT1oBf8T4MVDaThrR7OQ58ZOEUzRm9EtSO/ eKQMbyZfmzO3k032DjNUeRGoPAsa5UmejN504ONlIXciJmvOtvkasUNtb0ja16jWyTIB VMLsFqtxFg6v7mpOgAgWelmMwiA490paquazyNwm16FBrvCT+jTbXYVA0np+ltWb02bU lD+zqJvjS/S51MSUinBJTYJnlFyyVzWA+yZpzi+m37TKGiZOjf+3o7XmKu/8J3fbrclG JvRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704044341; x=1704649141; 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=5dsfoDrDqhFi2M0qRhXB0Rpx7fbnSThvVod9k+rsj1w=; b=k+Q2l41AB7fnuGXOcZMSmd56RVvCns5vBTJgZqbgEfKGee23133XZUU8DdURznRH+i dHEro8+CNBqpd/aSWd4uUAyIUKm2AL4o2KItWMBs0orR8ly7HmRP6M9RqTBMm33wPShi EzGQqN/mYI31YJXFF1QLRhC9NjeQCInVniRq9G76r5w09ha0pz8IDQ9FmgXkZZbEZKyt xHov3ITqz1nN44SyhmiwPbBKXTW5F2lYIKH+o9FpwgFOSKLuCB8+JvL+xg+Hl82bJZl4 +Ckh5Qm4d1RyD8StsQBZj+cLo8qjd8GWTJZgVJM1DC1792MT3V6aXWLYkltp2DvZsle2 Eu1Q== X-Gm-Message-State: AOJu0YwR11AZPJPCXGsGgeWo+CsooVVqlsEDlw8zjM7W4nO6zq++JQbA PIjlgPmSqG7JCy/2GzMKTPRuxvdMX/E48a3xICh1mEgVO9krQg== X-Google-Smtp-Source: AGHT+IHdyuFseGAB/3R0LnFoRbrdJQuMSd8IMRz+obw9EM5eNufHv6X1VrfVpsujn/vrHdDi1MOobA== X-Received: by 2002:a05:6512:2089:b0:50e:7add:9864 with SMTP id t9-20020a056512208900b0050e7add9864mr4044786lfr.136.1704044341188; Sun, 31 Dec 2023 09:39:01 -0800 (PST) Received: from umbar.lan ([192.130.178.91]) by smtp.gmail.com with ESMTPSA id t27-20020ac243bb000000b0050e798243a7sm2233233lfl.177.2023.12.31.09.39.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 31 Dec 2023 09:39:00 -0800 (PST) From: Dmitry Baryshkov Date: Sun, 31 Dec 2023 19:38:57 +0200 Subject: [PATCH 1/2] ARM: add CLIDR accessor functions MIME-Version: 1.0 Message-Id: <20231231-armv7-cacheinfo-v1-1-9e8d440b59d9@linaro.org> References: <20231231-armv7-cacheinfo-v1-0-9e8d440b59d9@linaro.org> In-Reply-To: <20231231-armv7-cacheinfo-v1-0-9e8d440b59d9@linaro.org> To: Russell King Cc: linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, Dmitry Baryshkov X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=openpgp-sha256; l=1067; i=dmitry.baryshkov@linaro.org; h=from:subject:message-id; bh=t8WE1+fA8j81+AJkUCcorxLRWwscCfXSF46thI/6wwA=; b=owEBbQGS/pANAwAKAYs8ij4CKSjVAcsmYgBlkacz1VRVujh2jeGLFI2bFDRFeAL+Qf8WsbLin YZGe4LHn62JATMEAAEKAB0WIQRMcISVXLJjVvC4lX+LPIo+Aiko1QUCZZGnMwAKCRCLPIo+Aiko 1Z6MB/961yERcv+6Qiq7sBMKCeFlc760UR919fahlwsE28S78pSCge1cZZtBpnfeHKVr2NgjsnR NNDc5YCEQ+R32kFgyX1CiyzWjiFWzSoX9dLjLN1pa58XrDyjgLLNl9uSxbuBaC2OyDALkEKCFyC cPjmsKPq6gVL0MeoYKHJodo4UDqimRmx70ZeJ5mzD1BKpENPoLBh9hsRvO7hoWxP3ZLAtnOu5GH R56FHgeqadtv2tDnOuLJlhopblr4t4tYiw2Sn88jEC5aqvvtMVLi7cxHSnmhQaw3ll/aDtYkki2 VgSDXSX37wyj9i7fDi1uhxUSG7byDefhhjSAzqka2Z4uRFat 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-20231231_093904_167691_6B6C52D3 X-CRM114-Status: UNSURE ( 9.67 ) 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 Add functions to read the CLIDR, Cache Level ID Register. Signed-off-by: Dmitry Baryshkov --- 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 e8c30430be33..90203a6d7270 100644 --- a/arch/arm/include/asm/cachetype.h +++ b/arch/arm/include/asm/cachetype.h @@ -81,6 +81,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" @@ -94,6 +102,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