From patchwork Wed Jul 29 13:47:31 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guillaume Tucker X-Patchwork-Id: 247248 Delivered-To: patch@linaro.org Received: by 2002:a50:110d:0:0:0:0:0 with SMTP id e13csp1125991eck; Wed, 29 Jul 2020 06:47:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzOfn3RAEPi2PEKUAh8Qy0AwkvmQkdf5Z7hagM+D1AdFjHuyQotwx82opXj8HhgXF0wESzG X-Received: by 2002:a17:906:fa15:: with SMTP id lo21mr29044750ejb.42.1596030472657; Wed, 29 Jul 2020 06:47:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596030472; cv=none; d=google.com; s=arc-20160816; b=PYin9ZToDfDGve/jZkgBoqzfrhIFB5ap4JmMYYRdWLcZgRhnfIaIh5910PcfNJ0fwd wS9fMd4lyzlTEk+HqJD2dZwVr8KHrZjq+PjpsQ9ktYFD7Z6tw3GFOJXusvsulxyuESzb deUDhU3ALYS5MkOpshqnb72FLCY2OkX7ln7rNOwNPtCojb9DNE2tffd6i09cOZu9h6mx r9CZhlSPow4Q31iafNckXNy6J/OVaehiikvaootVPjUC02JUG75yNEauDyO7l+nCejrE 9YeUtO7TXnWMATNReUwGiW2WfcPNOMtZP8KZ+vjRZ105HWtx5M+7FSMaGC5EbJV//+Rp dMtw== 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 :message-id:date:subject:cc:to:from; bh=nxH9vsjlbcgN3uUHXFQJDQE5efI/WRZeMpiPzGu3pS0=; b=v/YOI+Rx12Wn3VrckRPHlUC93WDNYuFcaBWYyrSDL2KDyQTzKHG5d2t4SB3sxLgwc+ DW2J17JAQVnXqNgvFLaFnw1Xdn7TqWQ3U2q7qnqsxzhuUzYNwH66DIoq3AwHokmYvXHS PyKAI1D5DqjOllH1ZXkW2n1xcYgTjQ65u5ieK2YgMG+Iz2dYpwM6rhngHV1sW7KE6jpN Bk535QO7ngnsTZ2tQm1HVwEnQkFvUIMvj/Ynwg0MYxz8TAq+ftrXGYJEB9ZYQd3uVoc2 Ce/soZgd+Mmljh4+lPq1Y7ojSoq6pxI8Rssod0e0OAUct+JT+wJ/+jPLN/5nB5tOGSzG Rqyw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-samsung-soc-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-samsung-soc-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 bz20si1236053ejc.90.2020.07.29.06.47.52; Wed, 29 Jul 2020 06:47:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-samsung-soc-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-samsung-soc-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-samsung-soc-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 S1726391AbgG2Nrw (ORCPT + 4 others); Wed, 29 Jul 2020 09:47:52 -0400 Received: from bhuna.collabora.co.uk ([46.235.227.227]:39634 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726336AbgG2Nrv (ORCPT ); Wed, 29 Jul 2020 09:47:51 -0400 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: gtucker) with ESMTPSA id 6F6B6283C05 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 1/3] ARM: exynos: clear L220_AUX_CTRL_NS_LOCKDOWN in default l2c_aux_val Date: Wed, 29 Jul 2020 14:47:31 +0100 Message-Id: <860eb8a1eed879e55daf960c96acdac514cbda93.1596028601.git.guillaume.tucker@collabora.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org The L220_AUX_CTRL_NS_LOCKDOWN flag is set during the L2C enable sequence. There is no need to set it in the default register value, this was done before support for it was implemented in the code. It is not set in the hardware initial value either. Clean this up by removing this flag from the default l2c_aux_val, and add it to the l2c_aux_mask to print an alert message if it was already set before the kernel initialisation. Signed-off-by: Guillaume Tucker --- arch/arm/mach-exynos/exynos.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.20.1 diff --git a/arch/arm/mach-exynos/exynos.c b/arch/arm/mach-exynos/exynos.c index 36c37444485a..a96f3353a0c1 100644 --- a/arch/arm/mach-exynos/exynos.c +++ b/arch/arm/mach-exynos/exynos.c @@ -193,8 +193,8 @@ static void __init exynos_dt_fixup(void) } DT_MACHINE_START(EXYNOS_DT, "Samsung Exynos (Flattened Device Tree)") - .l2c_aux_val = 0x3c400000, - .l2c_aux_mask = 0xc20fffff, + .l2c_aux_val = 0x38400000, + .l2c_aux_mask = 0xc60fffff, .smp = smp_ops(exynos_smp_ops), .map_io = exynos_init_io, .init_early = exynos_firmware_init, From patchwork Wed Jul 29 13:47:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guillaume Tucker X-Patchwork-Id: 247249 Delivered-To: patch@linaro.org Received: by 2002:a50:110d:0:0:0:0:0 with SMTP id e13csp1126039eck; Wed, 29 Jul 2020 06:47:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzT6OiM+YQhrYCKnTxuYCM66RmHQiHvOv6l+Ul5SxAdDC6Oitb2gQMiF9eOyg7J4I0rLRhJ X-Received: by 2002:a17:906:5812:: with SMTP id m18mr6573187ejq.66.1596030475003; Wed, 29 Jul 2020 06:47:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596030474; cv=none; d=google.com; s=arc-20160816; b=NAUx+S4jyus/8Evy4SkDAqf9KA/DZMOWOuolQmyl949bbt1oVeiSEMwUz4/0U/oa37 MdFGIXmwvZO+GBPynhYpRMeg7Z0Z+u3eiY2UBmhRAbRGbRosQ8ozpP+uyu7unHVsCNo3 VAOekKE2dSCdg/WoGQDwTnJOpJoiiXfmbh7OTCiv6pQDFb1TKyryRLxSI6r+71FlWL22 qn08XIJyNU68dgD+/blfbCsT5Z7X5+s3pI02QaSZJafaZf0jPabAVy8f/lp6ULW+iQvZ s9t1IDyRCjEjdfdrSTc+5nWXwPglA2iI86LeDuR/jL13mG3TltSq6OgPdOhl2OcxnrQD syIQ== 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=Laj86c05aINn4CNg0qrfvDrfscoXyXHFVuctUljhl5kIEHYPoopAW40p8EtxBWJ78H 1VP2T78j3jk8MHp5GJ6KXQs5P8NdpYI/HJ+xEv1zL0rfEZZJnWSPD3jNB7tF/BT9Wiy2 8qKrB/1Hqusx/65c5odFC9GQpMiFYAEyLLZAOAEtldT03OYaYMSzrob/2AmscbHX4oDH Yz1MQYt/CJiu91/2KF6Qt4ybSS1AGyvOXEBFrM+NFmrPGzP34Y+DdW5Ytsd6NMIJdUI2 T5o08SYyeAfhxHM0U2eBmcIrP3/H/nvg7hnBX41E3Tilxh/EIgIM4wsOJRH7QvS5BYGU egVg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-samsung-soc-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-samsung-soc-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 e19si1242001edv.165.2020.07.29.06.47.54; Wed, 29 Jul 2020 06:47:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-samsung-soc-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-samsung-soc-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-samsung-soc-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 S1726813AbgG2Nrx (ORCPT + 4 others); Wed, 29 Jul 2020 09:47:53 -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 Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@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(-) -- 2.20.1 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"); } From patchwork Wed Jul 29 13:47:33 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guillaume Tucker X-Patchwork-Id: 247250 Delivered-To: patch@linaro.org Received: by 2002:a50:110d:0:0:0:0:0 with SMTP id e13csp1126107eck; Wed, 29 Jul 2020 06:48:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwnusk6ke6cjvmf2fN7I5rPsjS4DrTs7UiedaJP3LP6/xwpZCpO8uFZ3FEdZZFOcQp4dZuc X-Received: by 2002:a17:907:36b:: with SMTP id rs11mr11723992ejb.544.1596030481466; Wed, 29 Jul 2020 06:48:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596030481; cv=none; d=google.com; s=arc-20160816; b=i48MpQGkwAHwqwLAc7M9CwEZlrGxKUUMge8WVPkZAMxRTZSrZcQMH4whgCcLMpWtsl prWRB45t79JhvQkgcianfc6BwwdeNCK34AwkNyHKf/JD5+t2/rkFsQo3joxRdWjpL8mX UvKNjcIpFTMFtmxkics8exuWzfBgON9tX+kHDjavfoVxrfldMEYLpoAbgyNTNPE9BVYw 1Zi8OfgJT3CVKszT9B/4pJaU8z/kCCB6dxQ3RuIzVy+wnIsJ20Ru/zOTPc6zIaOqut9/ GXG4zJ8pCDk/Kc3PhL0grXXyLpKXiArLPtP+37tYcgPgvjYYC8ba3mOVkD0v0ifIFdWD DL6g== 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=hK7aHHsRVnpreGgd/6D7m6LrXDqm5u/TckoxkMsrFvU=; b=EoYNHR5E5PavDefoukStUmxQhEgr4xhHNrVDsT2vYC/cuT1HPR7BrYT5wEKW1XqTYy OQAk2gi1qCUo7qeR72ENmRH4l61pDhPHsGe0c8r7hrIQqpkkUv5aQtwH0QwMpELV+GKa 7tjLsbsWLeV/akzZ42L/+k3VeGeqP1HDEXCQuzGSVU4LiWi0N+QAQMoYhcfCZrYxg/f5 Gknkt4ovGqAwwOlGpVY/lgONs9hGqMY9QLEiEM17SNXP/YqA7STbGI/B35f6Htsu18Sw p+4s8jvnI5bKYADLlfY1OM5N5HJs+AkfRl4yPNm7msmhMPgD2jaWtAtPi3VbB5moGc6K 1t6w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-samsung-soc-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-samsung-soc-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 h11si1419806edn.481.2020.07.29.06.48.01; Wed, 29 Jul 2020 06:48:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-samsung-soc-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-samsung-soc-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-samsung-soc-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 S1726519AbgG2Nr5 (ORCPT + 4 others); Wed, 29 Jul 2020 09:47:57 -0400 Received: from bhuna.collabora.co.uk ([46.235.227.227]:39654 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726054AbgG2Nrx (ORCPT ); Wed, 29 Jul 2020 09:47:53 -0400 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: gtucker) with ESMTPSA id 2111029818A 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 3/3] ARM: exynos: use DT prefetch attributes rather than l2c_aux_val Date: Wed, 29 Jul 2020 14:47:33 +0100 Message-Id: <5e41140ddb1afe42699715cca59c44fa2fa29e60.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 Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org Use the standard l2c2x0 device tree bindings to enable data and instruction prefetch on exynos4210 and exynos4412 and clear the respective bits in the default l2c_aux_val. No other Exynos platform relying on this default register value appears to be using the l2x0 cache. Signed-off-by: Guillaume Tucker --- arch/arm/boot/dts/exynos4210.dtsi | 2 ++ arch/arm/boot/dts/exynos4412.dtsi | 2 ++ arch/arm/mach-exynos/exynos.c | 4 ++-- 3 files changed, 6 insertions(+), 2 deletions(-) -- 2.20.1 diff --git a/arch/arm/boot/dts/exynos4210.dtsi b/arch/arm/boot/dts/exynos4210.dtsi index b4466232f0c1..7e0d253b26ef 100644 --- a/arch/arm/boot/dts/exynos4210.dtsi +++ b/arch/arm/boot/dts/exynos4210.dtsi @@ -102,6 +102,8 @@ reg = <0x10502000 0x1000>; cache-unified; cache-level = <2>; + prefetch-data = <1>; + prefetch-instr = <1>; arm,tag-latency = <2 2 1>; arm,data-latency = <2 2 1>; }; diff --git a/arch/arm/boot/dts/exynos4412.dtsi b/arch/arm/boot/dts/exynos4412.dtsi index 48868947373e..37efa247bf4d 100644 --- a/arch/arm/boot/dts/exynos4412.dtsi +++ b/arch/arm/boot/dts/exynos4412.dtsi @@ -218,6 +218,8 @@ reg = <0x10502000 0x1000>; cache-unified; cache-level = <2>; + prefetch-data = <1>; + prefetch-instr = <1>; arm,tag-latency = <2 2 1>; arm,data-latency = <3 2 1>; arm,double-linefill = <1>; diff --git a/arch/arm/mach-exynos/exynos.c b/arch/arm/mach-exynos/exynos.c index a96f3353a0c1..0e906cc3a48e 100644 --- a/arch/arm/mach-exynos/exynos.c +++ b/arch/arm/mach-exynos/exynos.c @@ -193,8 +193,8 @@ static void __init exynos_dt_fixup(void) } DT_MACHINE_START(EXYNOS_DT, "Samsung Exynos (Flattened Device Tree)") - .l2c_aux_val = 0x38400000, - .l2c_aux_mask = 0xc60fffff, + .l2c_aux_val = 0x08400000, + .l2c_aux_mask = 0xf60fffff, .smp = smp_ops(exynos_smp_ops), .map_io = exynos_init_io, .init_early = exynos_firmware_init,