From patchwork Mon Mar 18 08:30:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 160475 Delivered-To: patch@linaro.org Received: by 2002:a02:5cc1:0:0:0:0:0 with SMTP id w62csp2386342jad; Mon, 18 Mar 2019 01:31:03 -0700 (PDT) X-Google-Smtp-Source: APXvYqwq3aP2boz/roDWisOiBYp5ZBH4NjLWF7+zdEwEQfAUPclrJsqi2acMKni6PScdqkpbIiDn X-Received: by 2002:a65:64d5:: with SMTP id t21mr16344442pgv.266.1552897863045; Mon, 18 Mar 2019 01:31:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552897863; cv=none; d=google.com; s=arc-20160816; b=JR3zFlpplbWb88lNwu7Yakv4tcHIf0f0jP9tVNeBdfYk4L0UDjrUja22szn3wY/ZFy nk4K8ykMRjzuh2J45btX3nPIxK8fH7h0mmSdYU8piH4t/3aA+QK2UNIxHquTwzacR7VR SsWrxa2CvZC22Za2ILep1/fioAdoIdOof4H16zkknUv+07JKeT3e4CZhngKyX/8BqoW4 qVvJXVUjW+htSRQiOQzvrsYdtUE2YMoBLVs4nYNX9Ir3zAGe/x48U5n0AJWWOkdgFny5 WrPHfsKRVLd6bkblDwSGzoKOk835rlHH1XQSuNcqRp1UH61E3vfYAf1J+nMlHYJ6VZzn H1rA== 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:dkim-signature; bh=X5m0hJEnSzHV3JBzvKAISd1sVxUUoh0np4rjbjBc0TM=; b=SM+2trxTuSvhjXpmm7ZceMdV+IJQrfEkVhmTabVl2hcXZP67OlRCRgPwMTQjViMbP7 0ESYovSBXMazu0a9f+PFFT5wGuXrey8+Jm2dsRXpTRyItpy8PbETNiPPxVV/QRclEtSN hvbtNKMrBn9nfkZsck7JuHuoSb6mhOuCOnU27Vtiz6xbDcYIwz6WgjthrNV0ePduFGyv I3jM/zdvVforB06/C95OuJGrMYucPQ3UsOOarLEg73H6iHU6tF74Kmvtv+sbGLcdPyaD qh6LtPwu6wa2f6QfvYmZBZoM9k3U1cHN9X5em6DKwQghId2xoeDUfWvdGsAHrj+ZTmYJ AnPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="VdBM/R8W"; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c24si8381097pgg.534.2019.03.18.01.31.02; Mon, 18 Mar 2019 01:31:03 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="VdBM/R8W"; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726335AbfCRIbC (ORCPT + 7 others); Mon, 18 Mar 2019 04:31:02 -0400 Received: from mail-lf1-f68.google.com ([209.85.167.68]:45277 "EHLO mail-lf1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726291AbfCRIbC (ORCPT ); Mon, 18 Mar 2019 04:31:02 -0400 Received: by mail-lf1-f68.google.com with SMTP id f16so10959650lfk.12 for ; Mon, 18 Mar 2019 01:31:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=X5m0hJEnSzHV3JBzvKAISd1sVxUUoh0np4rjbjBc0TM=; b=VdBM/R8WDiRsA4d1GRGmYMjrfHW3V0LdkX2UuRsK+lt2xx0Etng1ACH5w9oHZ4OXkF JEyK4ay/Q9GddCf0XsYm5JjPFpwzPK6/yKLj/0zXd16RKSv6VJ6waq48Sp39kXWmXWVX nsMYd/IiTMtKtW5iDL3EnfJAUBsqCYEK8GiCO1czeYfTEhfK8nzB83s5u6oJtT1+Wb76 A3fSFNqyk6MUXMpSWJ9SCrwfmJqd9q9DWKMtOjdSj0H0p57Swm4wzlCwSw9FFScd2ZSO IQOsKQASAk083vLkBXdsGYIoWYAaWCL276jYbjm5OQWkQL2EY6W8v0y52f27XY1xRc3H i2fQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=X5m0hJEnSzHV3JBzvKAISd1sVxUUoh0np4rjbjBc0TM=; b=nM1yM7jnaKRmEO2mCJ4AaLhi9zG4KdRJO+yKXdSN/Jyiz6A3jt/7GjO7HxTvXivfam ZzR+UAvQizldQ73yZD3XbMVjMqkVoScZt4HuBilPup2qgVnHZmmQaPUgqrbJlyyfXGO3 9+8hezS1F5xaU5zvy0dSXv9pskyesvDZqwUIpIR4ZVKAHeNwmLkdp1Z2X39TYg6lC8wF erZco1NVscS1MhkxasRGAS9HE119pkAADOlMPole3FtFwgEro5SyHQz9i4KwM6QLjbUa gRKGMct1cwp/8vHSOYTSFpXrEEgDto52MSWouQG2ll9DZux1wcDsI8NoV008ynqbLxom loGQ== X-Gm-Message-State: APjAAAXD8CrQQwhQAV8P2v3mdFxW81MNcKJ+XXlKVOezJlJLwDz4HVEb 4DruaF37btxHQKRFvBh2I92AnQ== X-Received: by 2002:a19:4f44:: with SMTP id a4mr9000819lfk.72.1552897860372; Mon, 18 Mar 2019 01:31:00 -0700 (PDT) Received: from linux.local (c-ae7b71d5.014-348-6c756e10.bbcust.telenor.se. [213.113.123.174]) by smtp.gmail.com with ESMTPSA id d5sm1879071lfi.95.2019.03.18.01.30.59 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 18 Mar 2019 01:30:59 -0700 (PDT) From: Linus Walleij To: linux-arm-kernel@lists.infradead.org Cc: Linus Walleij , devicetree@vger.kernel.org, Russell King Subject: [PATCH] ARM: l2x0: add L210 write allocate override flag Date: Mon, 18 Mar 2019 09:30:53 +0100 Message-Id: <20190318083053.24197-1-linus.walleij@linaro.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org This adds support for setting the flag bit "write allocate override" to the L210 variant. The "write allocate override" bit is used on the Nomadik STn8815 and is necessary to properly make use of the L210 cache on that machine without sporadic crashes. After this the platform can boot and run without any out-of-tree patches. Cc: devicetree@vger.kernel.org Cc: Russell King Signed-off-by: Linus Walleij --- Documentation/devicetree/bindings/arm/l2c2x0.yaml | 5 +++++ arch/arm/mm/cache-l2x0.c | 8 ++++++++ 2 files changed, 13 insertions(+) -- 2.20.1 diff --git a/Documentation/devicetree/bindings/arm/l2c2x0.yaml b/Documentation/devicetree/bindings/arm/l2c2x0.yaml index bfc5c185561c..4cffcda3e2b7 100644 --- a/Documentation/devicetree/bindings/arm/l2c2x0.yaml +++ b/Documentation/devicetree/bindings/arm/l2c2x0.yaml @@ -168,6 +168,11 @@ properties: be specified to indicate that such transforms are precluded. type: boolean + arm,write-allocate-override: + description: On L210 only, normally the L210 will use HPROT attributes, + setting this bit overrides that behaviour and cause the cache to make all + write-through and write-back accesses into read-write-allocate accesses. + arm,parity-enable: description: enable parity checking on the L2 cache (L220 or PL310). type: boolean diff --git a/arch/arm/mm/cache-l2x0.c b/arch/arm/mm/cache-l2x0.c index 808efbb89b88..5cbdb9c18884 100644 --- a/arch/arm/mm/cache-l2x0.c +++ b/arch/arm/mm/cache-l2x0.c @@ -1078,6 +1078,14 @@ static void __init l2x0_of_parse(const struct device_node *np, val |= L2C_AUX_CTRL_SHARED_OVERRIDE; } + /* L210-specific aux control flag */ + if (of_device_is_compatible(np, "arm,l210-cache")) { + if (of_property_read_bool(np, "arm,write-allocate-override")) { + mask &= ~L210_AUX_CTRL_WA_OVERRIDE; + val |= L210_AUX_CTRL_WA_OVERRIDE; + } + } + ret = l2x0_cache_size_of_parse(np, aux_val, aux_mask, &assoc, SZ_256K); if (ret) return;