From patchwork Tue Mar 3 18:55:41 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Fainelli X-Patchwork-Id: 5925601 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 62818BF440 for ; Tue, 3 Mar 2015 18:58:34 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 857E32041A for ; Tue, 3 Mar 2015 18:58:33 +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 A51E320437 for ; Tue, 3 Mar 2015 18:58:32 +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 1YSrzh-0003lK-1w; Tue, 03 Mar 2015 18:56:37 +0000 Received: from mail-pd0-x232.google.com ([2607:f8b0:400e:c02::232]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YSrzc-0003Yh-7V for linux-arm-kernel@lists.infradead.org; Tue, 03 Mar 2015 18:56:32 +0000 Received: by pdbfl12 with SMTP id fl12so19387015pdb.5 for ; Tue, 03 Mar 2015 10:56:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=jWqDei5i7BXL1gjxWrrkEz6zuF1B0VzGD20fM+eTpGY=; b=aiaoPibHGgVyP8TtLsbFWyTFdhWSiW9rsFm6sLOmBfTVA8pw2xgLPANQ2YjXTdYcb7 zNVNnZR1Ey5DOMe0hOP+V1rCa5KiR5plZF7EF4b4kXDhS/7vjtk2FK1DUntlPpc/g3T8 fo+Gl9UXdcajfJAe7mwYRahdlqT6rZKbMHieUjlW29UX3jAaX3y1lf1GVhu7fazpmEIx P/96jvKBDf9IkTuOumj4yyyLUOiQjbhxXS9K8IlFHqE+5vpkzmpoRDpqPnpgVDjPcPtX QL0n+HDm6MoytF2vB+vaAu9OH6YXf8C2wDoq7etW+hzMI/PhpPPuPw5+x6WWfwXJGP6V 92Ig== X-Received: by 10.68.208.9 with SMTP id ma9mr175624pbc.111.1425408969706; Tue, 03 Mar 2015 10:56:09 -0800 (PST) Received: from fainelli-desktop.broadcom.com (5520-maca-inet1-outside.broadcom.com. [216.31.211.11]) by mx.google.com with ESMTPSA id dm6sm1669711pdb.63.2015.03.03.10.56.08 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 03 Mar 2015 10:56:08 -0800 (PST) From: Florian Fainelli To: linux-arm-kernel@lists.infradead.org Subject: [PATCH] ARM: l2c: enforce use of cache-level property Date: Tue, 3 Mar 2015 10:55:41 -0800 Message-Id: <1425408941-9897-1-git-send-email-f.fainelli@gmail.com> X-Mailer: git-send-email 2.1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150303_105632_336259_CC291840 X-CRM114-Status: UNSURE ( 9.01 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.8 (/) Cc: linus.walleij@linaro.org, Florian Fainelli , linux@arm.linux.org.uk, arnd@arndb.de 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=-4.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, T_RP_MATCHES_RCVD, 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 --- Russell, Linus, You may have seen that patch earlier, it was part of my attempt to parse the 'cache-size' and 'cache-sets' properties, and ultimately Linus' series went it, and this patch was lost ast see. Thanks! 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 c6c7696b8db9..8b933dc43e24 100644 --- a/arch/arm/mm/cache-l2x0.c +++ b/arch/arm/mm/cache-l2x0.c @@ -1648,6 +1648,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) @@ -1680,6 +1681,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"); + /* Read back current (default) hardware configuration */ if (data->save) data->save(l2x0_base);