From patchwork Tue Feb 21 10:50:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Marko X-Patchwork-Id: 13147626 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 4E241C6379F for ; Tue, 21 Feb 2023 10:52:04 +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:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=l38ZDRrGvEMP5B9Vc0PVy85mn1fpNeNjxrhYNKZy9Uc=; b=p9tpkqAZyE/UBR EjRjPLMk4Bo5cRGvApJ/mhM/R5y1EbfAOwzEWVmGFPaKvihoRiOaDSnR3oWQTcP6Wg8n6n18HBtUd 9V94wa/71JEaXUFK9p0pqJpM5JYH9YQOYBIB9sMUZ0Q9k5s81wvhXq40niZyA2Yp4L9PcBwSbHPDF LQha6ZDVGom/Vl+b1xavIiq/W/j4giGnNAtI/HuBz5IF0f73a6r29WEN2uUl0aAGHAIfV9FqNKky5 gtR3BOJrI6M1tjbx55qmJ7TOAv6uOpEtiRGnBOaNiMpRGUMLMymm2FrfwF9MyNVUpnjUMnoiBN2Do FyvTU0cwjsVW+Az5Qt9g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pUQEl-007Rux-0c; Tue, 21 Feb 2023 10:51:07 +0000 Received: from mail-ed1-x52a.google.com ([2a00:1450:4864:20::52a]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pUQER-007Roz-Pt for linux-arm-kernel@lists.infradead.org; Tue, 21 Feb 2023 10:50:50 +0000 Received: by mail-ed1-x52a.google.com with SMTP id b12so15329282edd.4 for ; Tue, 21 Feb 2023 02:50:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sartura.hr; s=sartura; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=0gk2DSmgvASQ5V9ePr4xMv7HQyGXDamFtmo/+7H0H7Q=; b=z6QrFp/Krt2zgU4roCx/tRFt9FnkDlEc8AOluIPbFpZzT/A/IB2zZiuh8MulzCnAgi Sd50gCC86ozaK7xkP1UFO3Wz0vOZxDo/RDTKjmmV52tUsiuXE6BasomSPjWwmNj6NVJc tPJajapj7D1Y3dPhQDI9SyPSgCLYvy01oSwgr4T3RlITMT2i76EEQMRwCruEsWzFPPDi afhbSbVjO7IzBMnWErmwWAgvcjkhLyPx4MMjD0MbUQ/e/8zv2tTKKQwQSfUH6xyr76Oz h+bnoIH5do3PEjNSm6vUX/Oce8OVjcG/Un0suI8PY2sFvSHfTVJ2aV81VECSNfBYMz8+ ze0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=0gk2DSmgvASQ5V9ePr4xMv7HQyGXDamFtmo/+7H0H7Q=; b=7xmmDQ096RqOSvvZVBp3QEYEhXjHTuvDfpBr7huJpN2GS2poVQm1LbgNKREVj4Sf61 DtvX7KShrJXZPNsqCp235cLL5eMomB4QpC5Bnb7MsLGjwTRltNvVfNMUUR4Y9OBtgHoD /LEjcwM49WfOmNuUJIiDp4hys/4LYVJx3ibZoS9Upz9lEUx5L26oZB4g8qj7U58lq8L3 7YZC9t+UFkzYYyEozruu5EDP83JYuKMQJXOXG+PZBmmburrkncSrVqyUtZW4InbExPLM PJQA/P+JvsVfpFgKHfuXSlZYxK2s2OySCkb6hWAYEp5ZiOMaVcD7CfC/YgTjz3xx2LhV RtCg== X-Gm-Message-State: AO0yUKURoJLP0pL5opxLUgYQc01v1EUY7aYRwAS4Z3kbWstwIzxByxPN bQ6iHkpx/9xKym1J5JRpdp7gXQ== X-Google-Smtp-Source: AK7set/x+xrpGP3FABf85L02cSovpPeNu1WquJ0oYlJzMGgDuyd4gj7BOgNrzBcofGxfp1/Yzv0rHw== X-Received: by 2002:a17:906:ad82:b0:8af:40b0:3dd1 with SMTP id la2-20020a170906ad8200b008af40b03dd1mr11760401ejb.27.1676976645348; Tue, 21 Feb 2023 02:50:45 -0800 (PST) Received: from fedora.. (dh207-97-58.xnet.hr. [88.207.97.58]) by smtp.googlemail.com with ESMTPSA id bk26-20020a170906b0da00b0089d5aaf85besm6955802ejb.219.2023.02.21.02.50.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Feb 2023 02:50:44 -0800 (PST) From: Robert Marko To: robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, lars.povlsen@microchip.com, Steen.Hegelund@microchip.com, daniel.machon@microchip.com, UNGLinuxDriver@microchip.com, arnd@arndb.de, alexandre.belloni@bootlin.com, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: luka.perkov@sartura.hr, Robert Marko Subject: [PATCH v2 3/3] arm64: dts: microchip: sparx5: add missing L1/L2 cache information Date: Tue, 21 Feb 2023 11:50:39 +0100 Message-Id: <20230221105039.316819-3-robert.marko@sartura.hr> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230221105039.316819-1-robert.marko@sartura.hr> References: <20230221105039.316819-1-robert.marko@sartura.hr> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230221_025047_861557_F31D8A46 X-CRM114-Status: GOOD ( 12.81 ) 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 Currently, when booting on SparX-5 you will get the following error: [ 0.050132] Early cacheinfo failed, ret = -22 This is due to L2 cache node missing cache-level property to indicate its level, so populate it to let the kernel know its L2 cache. However, that alone is enough to get rid of the error, but then the following warnings appear: [ 0.050162] cacheinfo: Unable to detect cache hierarchy for CPU 0 [ 0.093256] cacheinfo: Unable to detect cache hierarchy for CPU 1 So, lets completely populate both the L1 and L2 cache info based off the SoC datasheet[1] and ARM A53 technical reference manual[2]. Now "lscpu -C" provides: NAME ONE-SIZE ALL-SIZE WAYS TYPE LEVEL SETS PHY-LINE COHERENCY-SIZE L1d 32K 64K 4 Data 1 128 64 L1i 32K 64K 2 Instruction 1 256 64 L2 256K 256K 16 Unified 2 256 64 Tested on PCB134 (eMMC). [1] https://ww1.microchip.com/downloads/aemDocuments/documents/UNG/ProductDocuments/DataSheets/SparX-5_Family_L2L3_Enterprise_25G_Ethernet_Switches_Datasheet_00003823D.pdf [2] https://developer.arm.com/documentation/ddi0500/j/Level-1-Memory-System/About-the-L1-memory-system?lang=en Fixes: 6694aee00a4b ("arm64: dts: sparx5: Add basic cpu support") Signed-off-by: Robert Marko --- arch/arm64/boot/dts/microchip/sparx5.dtsi | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/arch/arm64/boot/dts/microchip/sparx5.dtsi b/arch/arm64/boot/dts/microchip/sparx5.dtsi index a4fabacf5c2f7..950ba78bf73f3 100644 --- a/arch/arm64/boot/dts/microchip/sparx5.dtsi +++ b/arch/arm64/boot/dts/microchip/sparx5.dtsi @@ -41,6 +41,12 @@ cpu0: cpu@0 { device_type = "cpu"; reg = <0x0>; enable-method = "psci"; + d-cache-size = <0x8000>; + d-cache-line-size = <64>; + d-cache-sets = <128>; // 32KiB(size)/64(line-size)=512ways/4-way set + i-cache-size = <0x8000>; + i-cache-line-size = <64>; + i-cache-sets = <256>; // 32KiB(size)/64(line-size)=512ways/2-way set next-level-cache = <&L2_0>; }; cpu1: cpu@1 { @@ -48,10 +54,21 @@ cpu1: cpu@1 { device_type = "cpu"; reg = <0x1>; enable-method = "psci"; + d-cache-size = <0x8000>; + d-cache-line-size = <64>; + d-cache-sets = <128>; // 32KiB(size)/64(line-size)=512ways/4-way set + i-cache-size = <0x8000>; + i-cache-line-size = <64>; + i-cache-sets = <256>; // 32KiB(size)/64(line-size)=512ways/2-way set next-level-cache = <&L2_0>; }; L2_0: l2-cache0 { compatible = "cache"; + cache-unified; + cache-size = <0x40000>; + cache-line-size = <64>; + cache-sets = <256>; // 256KB(size)/64(line-size)=4096ways/16-way set + cache-level = <2>; }; };