From patchwork Tue Sep 2 12:02:31 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 36460 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-oi0-f69.google.com (mail-oi0-f69.google.com [209.85.218.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 84EFC2032B for ; Tue, 2 Sep 2014 12:03:10 +0000 (UTC) Received: by mail-oi0-f69.google.com with SMTP id i138sf34866794oig.0 for ; Tue, 02 Sep 2014 05:03:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=ibVNvvl4DIKkF6wyzn3lbDqWFNmlAOqR5GNJW7FuQwk=; b=X4USAJ6apTGP02cT6vrpVHp/BJjIcJto6qsYPRWSXGN1zGNdbQwFciwHnrQV901lGq bYxYVo+r9xoYVHe+XQDKzeLGurBiJ/lQ58OOcFDc3vboehY/DZHQ0XHGbpWJrXF1+53n uR0YpZHbavAAr21SM7Aa6k6H6cYnZL3aqtO/2qWE6GDoihhww0KecJ9hS9ODI2CrQgxQ 6tyQa8BXo4MfTUxWzeLt4xbJUXALqm6X1L0Z7cFHM/bsbYb/ElX/9+1u+n5H8OW/Kb3l /QknDzGwZB1h4sHKmLYYozzS7gnyzdffsc4sjzcF135KddHeqXJdUDU/G4BuIv1Z4jtP j0bw== X-Gm-Message-State: ALoCoQnT6PX3ZaT4ykV+uhzk2TKpzKfkc4y39sgVhhJ8ihorkC3aEMSM6e+Pc1y9IV4nL6yjrQqk X-Received: by 10.182.28.102 with SMTP id a6mr417544obh.44.1409659390170; Tue, 02 Sep 2014 05:03:10 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.46.100 with SMTP id j91ls2317822qga.44.gmail; Tue, 02 Sep 2014 05:03:10 -0700 (PDT) X-Received: by 10.220.167.9 with SMTP id o9mr29980349vcy.8.1409659390083; Tue, 02 Sep 2014 05:03:10 -0700 (PDT) Received: from mail-vc0-f173.google.com (mail-vc0-f173.google.com [209.85.220.173]) by mx.google.com with ESMTPS id ev4si2160315vdb.15.2014.09.02.05.03.10 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 02 Sep 2014 05:03:10 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.173 as permitted sender) client-ip=209.85.220.173; Received: by mail-vc0-f173.google.com with SMTP id im17so6827723vcb.32 for ; Tue, 02 Sep 2014 05:03:10 -0700 (PDT) X-Received: by 10.52.160.10 with SMTP id xg10mr24799901vdb.1.1409659389973; Tue, 02 Sep 2014 05:03:09 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.221.45.67 with SMTP id uj3csp515880vcb; Tue, 2 Sep 2014 05:03:09 -0700 (PDT) X-Received: by 10.70.137.98 with SMTP id qh2mr47480013pdb.61.1409659389001; Tue, 02 Sep 2014 05:03:09 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id vx5si5760484pab.55.2014.09.02.05.03.08 for ; Tue, 02 Sep 2014 05:03:08 -0700 (PDT) Received-SPF: none (google.com: linux-leds-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753282AbaIBMDI (ORCPT ); Tue, 2 Sep 2014 08:03:08 -0400 Received: from mail-wg0-f45.google.com ([74.125.82.45]:61933 "EHLO mail-wg0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752964AbaIBMDG (ORCPT ); Tue, 2 Sep 2014 08:03:06 -0400 Received: by mail-wg0-f45.google.com with SMTP id k14so6668249wgh.4 for ; Tue, 02 Sep 2014 05:03:05 -0700 (PDT) X-Received: by 10.194.89.67 with SMTP id bm3mr15037720wjb.80.1409659385332; Tue, 02 Sep 2014 05:03:05 -0700 (PDT) Received: from localhost.localdomain ([85.235.11.236]) by mx.google.com with ESMTPSA id hm5sm9125196wjb.2.2014.09.02.05.03.03 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 02 Sep 2014 05:03:04 -0700 (PDT) From: Linus Walleij To: linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-leds@vger.kernel.org, linux-pm@vger.kernel.org Cc: Arnd Bergmann , Pawel Moll , Mark Rutland , Marc Zyngier , Will Deacon , Rob Herring , Linus Walleij Subject: [PATCH 5/8] ARM: l2x0: move DT parsing for cache props Date: Tue, 2 Sep 2014 14:02:31 +0200 Message-Id: <1409659354-23553-6-git-send-email-linus.walleij@linaro.org> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1409659354-23553-1-git-send-email-linus.walleij@linaro.org> References: <1409659354-23553-1-git-send-email-linus.walleij@linaro.org> Sender: linux-leds-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-leds@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: linus.walleij@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.173 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , The current diagnostic prints in the l2x0 driver will print warnings like this if the AUX register i modified by the mask and set words passed to the l2x0_init() function: L2C: platform modifies aux control register: 0x02020fff -> 0x02730fff L2C: DT/platform modifies aux control register: 0x02020fff -> 0x02730fff L2C-220 cache controller enabled, 8 ways, 128 kB L2C-220: CACHE_ID 0x41000486, AUX_CTRL 0x06730fff However this is not printed properly if the DT modifies the AUX register, even if the debug print says so. As the call to ->of_parse for the cache variant is placed after this print. Move the ->of_parse call above the print so we get proper diagnostics. Signed-off-by: Linus Walleij --- arch/arm/mm/cache-l2x0.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/arch/arm/mm/cache-l2x0.c b/arch/arm/mm/cache-l2x0.c index 5f2c988a06ac..363c27bee3f6 100644 --- a/arch/arm/mm/cache-l2x0.c +++ b/arch/arm/mm/cache-l2x0.c @@ -1518,6 +1518,11 @@ int __init l2x0_of_init(u32 aux_val, u32 aux_mask) of_property_read_bool(np, "arm,io-coherent")) data = &of_l2c310_coherent_data; + /* 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) + data->of_parse(np, &aux_val, &aux_mask); + old_aux = readl_relaxed(l2x0_base + L2X0_AUX_CTRL); if (old_aux != ((old_aux & aux_mask) | aux_val)) { pr_warn("L2C: platform modifies aux control register: 0x%08x -> 0x%08x\n", @@ -1530,11 +1535,6 @@ 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"); - /* 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) - data->of_parse(np, &aux_val, &aux_mask); - if (cache_id_part_number_from_dt) cache_id = cache_id_part_number_from_dt; else