Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp1136495ybg; Wed, 29 Jul 2020 06:48:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz2pk7xpopOU4ySo0/wH6nrAMTTWI2gJe1C1udSPUSKhTr0Hq4T24AFT+K/5E6VfnLkjkdS X-Received: by 2002:a17:906:a284:: with SMTP id i4mr7288998ejz.490.1596030503140; Wed, 29 Jul 2020 06:48:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596030503; cv=none; d=google.com; s=arc-20160816; b=xVWREIjrU7kbPxVUFVuf7N2T1IyeuHEpflujvRup9XBBs0Tm5Fz3IFi/tJq0dU/qt4 k+VMmol1+QDVeHXfAt2Ac0wln4aJKgROfIcAzCsCm9yFfyor/IrYSQ+Dv8XTGC7hK7QO LaG6BszYzKlxJXykUlFYmz6ThkVntlsmMXaZ/oeTdK3/P+dld3N+9N8GWGYqD/kjZJ+X ZQeFgQja+WBIYDLvMZRCiGnfnukOsbv4zSRL2nqua3P3UGm+HIMNTbHfbfQAgHQZaA4r fjmr6gvCCGHAjS2QZQ80ZZcnsBvmYVPJ6G6qpGC8rf90bZXcrV0h/j3NpYOEp0I4Eljr A1qA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=ndSo0UzCfCde4A2SjLjEseiYtNQq+J4eSVI1kJzsPf4=; b=KfLecmxl20b2WY3L8gPULhEKwVZDdj2txolAAKKcblsSrHrS+B4Y2S1xiBJ2ICt/0i vxC+vxh5eyt6C0CKv8bL1WVmEGxklGlPxVZqh01YrKDuCxjrBA69dX8YvjL5sjROP1y/ kh9GZYDQTwlMMas/IY2YAYsLI9b0u4iyX95lp0om878UXK6WpMB9exVbbNek04sK87x7 8SpW1Hko71FjPbUWGEVx1Yz4c9Kj5UKYzFxNByLW4A85yJFXj/KtX67R6EPccfEyHXTV KcMAZaXp1JFq53sGIrdRcduf8IVme0IoX4dCiNsi/1t6M/O5X5vh8laafRgiTsM4rtDJ UGSA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dk14si1178430ejb.640.2020.07.29.06.47.59; Wed, 29 Jul 2020 06:48:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726826AbgG2Nry (ORCPT + 99 others); Wed, 29 Jul 2020 09:47:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53194 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726336AbgG2Nrw (ORCPT ); Wed, 29 Jul 2020 09:47:52 -0400 Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e3e3]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 94D9CC061794; Wed, 29 Jul 2020 06:47:52 -0700 (PDT) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: gtucker) with ESMTPSA id BF029298182 From: Guillaume Tucker To: Russell King , Kukjin Kim , Krzysztof Kozlowski , Rob Herring Cc: kernel@collabora.com, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/3] ARM: l2c: update prefetch bits in L2X0_AUX_CTRL using DT value Date: Wed, 29 Jul 2020 14:47:32 +0100 Message-Id: <79a628daef56c2d542e379f550de21da4fe3c901.1596028601.git.guillaume.tucker@collabora.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <860eb8a1eed879e55daf960c96acdac514cbda93.1596028601.git.guillaume.tucker@collabora.com> References: <860eb8a1eed879e55daf960c96acdac514cbda93.1596028601.git.guillaume.tucker@collabora.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The L310_PREFETCH_CTRL register bits 28 and 29 to enable data and instruction prefetch respectively can also be accessed via the L2X0_AUX_CTRL register. They appear to be actually wired together in hardware between the registers. Changing them in the prefetch register only will get undone when restoring the aux control register later on. For this reason, set these bits in both registers during initialisation according to the DT attributes. Fixes: ec3bd0e68a67 ("ARM: 8391/1: l2c: add options to overwrite prefetching behavior") Signed-off-by: Guillaume Tucker --- arch/arm/mm/cache-l2x0.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/arch/arm/mm/cache-l2x0.c b/arch/arm/mm/cache-l2x0.c index 12c26eb88afb..43d91bfd2360 100644 --- a/arch/arm/mm/cache-l2x0.c +++ b/arch/arm/mm/cache-l2x0.c @@ -1249,20 +1249,28 @@ static void __init l2c310_of_parse(const struct device_node *np, ret = of_property_read_u32(np, "prefetch-data", &val); if (ret == 0) { - if (val) + if (val) { prefetch |= L310_PREFETCH_CTRL_DATA_PREFETCH; - else + *aux_val |= L310_PREFETCH_CTRL_DATA_PREFETCH; + } else { prefetch &= ~L310_PREFETCH_CTRL_DATA_PREFETCH; + *aux_val &= ~L310_PREFETCH_CTRL_DATA_PREFETCH; + } + *aux_mask &= ~L310_PREFETCH_CTRL_DATA_PREFETCH; } else if (ret != -EINVAL) { pr_err("L2C-310 OF prefetch-data property value is missing\n"); } ret = of_property_read_u32(np, "prefetch-instr", &val); if (ret == 0) { - if (val) + if (val) { prefetch |= L310_PREFETCH_CTRL_INSTR_PREFETCH; - else + *aux_val |= L310_PREFETCH_CTRL_INSTR_PREFETCH; + } else { prefetch &= ~L310_PREFETCH_CTRL_INSTR_PREFETCH; + *aux_val &= ~L310_PREFETCH_CTRL_INSTR_PREFETCH; + } + *aux_mask &= ~L310_PREFETCH_CTRL_INSTR_PREFETCH; } else if (ret != -EINVAL) { pr_err("L2C-310 OF prefetch-instr property value is missing\n"); } -- 2.20.1