From patchwork Wed Aug 13 23:29:29 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Fainelli X-Patchwork-Id: 4721171 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id E02749F375 for ; Wed, 13 Aug 2014 23:33:17 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 12FB5201CD for ; Wed, 13 Aug 2014 23:33:17 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5D5FA201DC for ; Wed, 13 Aug 2014 23:33:16 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1XHi0b-0000DF-Qy; Wed, 13 Aug 2014 23:31:09 +0000 Received: from mail-pa0-x233.google.com ([2607:f8b0:400e:c03::233]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XHi0V-00008u-Cm for linux-arm-kernel@lists.infradead.org; Wed, 13 Aug 2014 23:31:03 +0000 Received: by mail-pa0-f51.google.com with SMTP id ey11so529314pad.10 for ; Wed, 13 Aug 2014 16:30:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=iOn2s4MZo9/f4/Nog00gPmPy7kkoJlskLyIzrPurnXE=; b=e1SUHvpwUKlnvfLlzUiEXPC/tBjWaSAfFushDZYD7nL4n+y1D9Y8HtSdChKXlFse+d T6Jv0gm8DD9aFdCdP+KPK5jh0QEhDPBIOxJPEwjzXvyfdh5+Ulo6zJs4hNgZMxeSVtLr Irp+tk18ksO59hleOadoNbPPcTj7jkuSUVHJA4jYA21ENbbXfh3flaE+jv+VfZf673FK yOStkynX8I6wSR8SvX7e5DNO50MhjhlqDgrwud/F1COt5y4XlPrd2gXqkfE/JAzCCHh1 iei+ye24uG2FyCxfylPMvgKkeStyiUK0B/qtPiqeAg0fS9bDGjfpT6oQFpBRIc8a5dLG zDxw== X-Received: by 10.68.131.134 with SMTP id om6mr868978pbb.41.1407972642659; Wed, 13 Aug 2014 16:30:42 -0700 (PDT) Received: from fainelli-desktop.broadcom.com (5520-maca-inet1-outside.broadcom.com. [216.31.211.11]) by mx.google.com with ESMTPSA id ln10sm3232392pbc.96.2014.08.13.16.30.40 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 13 Aug 2014 16:30:40 -0700 (PDT) From: Florian Fainelli To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 1/3] ARM: l2c: enforce use of cache-level property Date: Wed, 13 Aug 2014 16:29:29 -0700 Message-Id: <1407972571-8986-2-git-send-email-f.fainelli@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1407972571-8986-1-git-send-email-f.fainelli@gmail.com> References: <1407972571-8986-1-git-send-email-f.fainelli@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140813_163103_455581_680AB275 X-CRM114-Status: GOOD ( 11.32 ) X-Spam-Score: -0.8 (/) Cc: thomas.petazzoni@free-electrons.com, devicetree@vger.kernel.org, Florian Fainelli , linux@arm.linux.org.uk, arnd@arndb.de, pawel.moll@arm.com, mark.rutland@arm.com X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Make sure that we can read the "cache-level" property from the L2 cache controller node, and ensure its value is 2. Signed-off-by: Florian Fainelli --- arch/arm/mm/cache-l2x0.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/arch/arm/mm/cache-l2x0.c b/arch/arm/mm/cache-l2x0.c index 5f2c988a06ac..80488e78ce32 100644 --- a/arch/arm/mm/cache-l2x0.c +++ b/arch/arm/mm/cache-l2x0.c @@ -1498,6 +1498,7 @@ int __init l2x0_of_init(u32 aux_val, u32 aux_mask) struct device_node *np; struct resource res; u32 cache_id, old_aux; + u32 cache_level = 2; np = of_find_matching_node(NULL, l2x0_ids); if (!np) @@ -1530,6 +1531,12 @@ int __init l2x0_of_init(u32 aux_val, u32 aux_mask) if (!of_property_read_bool(np, "cache-unified")) pr_err("L2C: device tree omits to specify unified cache\n"); + if (of_property_read_u32(np, "cache-level", &cache_level)) + pr_err("L2C: device tree omits to specify cache-level\n"); + + if (cache_level != 2) + pr_err("L2C: device tree specifies invalid cache level\n"); + /* L2 configuration can only be changed if the cache is disabled */ if (!(readl_relaxed(l2x0_base + L2X0_CTRL) & L2X0_CTRL_EN)) if (data->of_parse)