From mboxrd@z Thu Jan 1 00:00:00 1970 From: Linus Walleij 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> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=m.gmane.org@lists.infradead.org To: linux-arm-kernel@lists.infradead.org Cc: devicetree@vger.kernel.org, Linus Walleij , Russell King List-Id: 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(+) 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; -- 2.20.1 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 39ECEC43381 for ; Mon, 18 Mar 2019 08:31:17 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 4143F2082F for ; Mon, 18 Mar 2019 08:31:16 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="MTnPdPC1"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="VdBM/R8W" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4143F2082F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=rP8+VpTqbqwz/6zIBDfF8nk9FEqWTNiDkw2leTe7VpM=; b=MTnPdPC1hxxGl4 Aywi7Fk4tdLlKZKMRdYmW8M9urWMx73WjvU6yQ09AS1Q3Uu8mHmShk9vYynVmnX85Xr7V2PV4svwn KP77q4iHMwpFH7snPzx7hp7LWt3qS4nrcOGivJkFNXUQ8TEPJaRRkNMDeIIVnNbxSNWAwpdXuJfFC T4fUc9eGzXLVp0NKmecWExxR+7J45VhOQWSqjEg6VO0gUPO2t9YjBPMSMEqbAdx2w4IQNZ+Vq9yfm ilYevOWUmH9cKIHaP9+cnzAXZDoinUOG//Ys0IVYmlI1T6lj5DfvwBtZbPMrbRVysi2lNXdDiEol/ OPmwkojSj/hiijBHvN+w==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1h5nfm-0001QM-Nn; Mon, 18 Mar 2019 08:31:06 +0000 Received: from mail-lf1-x141.google.com ([2a00:1450:4864:20::141]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h5nfj-0001PZ-0F for linux-arm-kernel@lists.infradead.org; Mon, 18 Mar 2019 08:31:05 +0000 Received: by mail-lf1-x141.google.com with SMTP id d18so11064445lfn.3 for ; Mon, 18 Mar 2019 01:31:02 -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=uMSV4vwYXJBxPZisDE4bBu10bMJoDi/s5Rf2jxNQ69C9LM44RtS4LdUVDypT/kO6x7 +8Tg+XIvH04yw1IxiSe5emVOdhOclDXiW+5SEIEDsd4NSPfilKZlVNHBszWjT0Rct0MO HCmLRFt7MLkZgxYbqTX+1EIuk31QGM9X+ek650IQTmPeqnS7WLYqhD910j44nZBGP0mQ rhcaOxmdPkidjS3+sUN33dQkltw3+7uol60hzCiBgdKhSWKzOsci3OLD+F4cw544uXuE RNbV5vV+LWPemipKA+vMVNz1Oae6fpP6z/9ZEn2YHwLZf7QZdNKaBBMOdEuCedxbygrm Igew== X-Gm-Message-State: APjAAAUxrvNH3ZJA4HVtD/s1yqzUy8ZbVLduYqsoRx8I7X8nph17JI+K UsLo0aqOcg5j7WhXjW8iMneiqfg2HIU= X-Google-Smtp-Source: APXvYqw2EDXcHDA3KFAwlGvEBw3J0uXeEUpHPtT0aVBPA/eIuq/BFkwAyAZr8yIx8gxlmnyu7uml0A== 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 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190318_013103_064793_9B92C12B X-CRM114-Status: GOOD ( 12.37 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, Linus Walleij , Russell King Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.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(+) 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; -- 2.20.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel