From patchwork Wed Feb 12 09:33:55 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tushar Behera X-Patchwork-Id: 3635731 Return-Path: X-Original-To: patchwork-linux-samsung-soc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 4A1DCBF13A for ; Wed, 12 Feb 2014 09:34:00 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4A16E20115 for ; Wed, 12 Feb 2014 09:33:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5F5D320158 for ; Wed, 12 Feb 2014 09:33:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751609AbaBLJd5 (ORCPT ); Wed, 12 Feb 2014 04:33:57 -0500 Received: from mail-oa0-f54.google.com ([209.85.219.54]:57695 "EHLO mail-oa0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751999AbaBLJd4 (ORCPT ); Wed, 12 Feb 2014 04:33:56 -0500 Received: by mail-oa0-f54.google.com with SMTP id i4so10767157oah.27 for ; Wed, 12 Feb 2014 01:33:56 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=g389kzr2t2xG17Gfkvnb1j7iArWtCJY8HmB5L4pRBPs=; b=BGAt9wDjRBK843Ysh0PtQcLf4T4+KAa9gQxo6zGxC5O8giA1P4oCopiZyHVykVShRH 5xbfcRSzEy8d+h30oxVlJ7KwB2q2WUbYw6iMww11UdcG0c6RYOBmg5rM1pzUSA9QVLh5 VOMP78wqHHtui/hPzVNCPX12PKnTKeBWYd/I68FFGz9PXjx3PUFtlTWDAS2vTZChkZkw k6Ahk83WxJr1ueb7SOGc9FzM/IebwXIKxZ329ap2QSfzDO4+n6yC8QH8r6muvW4ERbzV KyAFj+Mv/vz/UIBq4vyhOlp9ZkS6RoiczQbRJIjn95AFErrWWZ8lRjaL59gVI9lgSJqr heAQ== X-Gm-Message-State: ALoCoQnkgCJgi2n1aTVKRrsLMvCGDcXND4iJWRjofZrYlqxu3Fp5uStYI2ZnVE+FohggbKYUyIVL MIME-Version: 1.0 X-Received: by 10.60.16.168 with SMTP id h8mr36572922oed.32.1392197636005; Wed, 12 Feb 2014 01:33:56 -0800 (PST) Received: by 10.60.70.38 with HTTP; Wed, 12 Feb 2014 01:33:55 -0800 (PST) In-Reply-To: <52E252FD.7030908@samsung.com> References: <1389084826-19827-1-git-send-email-tushar.behera@linaro.org> <52E15C27.3020104@samsung.com> <52E252FD.7030908@samsung.com> Date: Wed, 12 Feb 2014 15:03:55 +0530 Message-ID: Subject: Re: [PATCH] ARM: dts: Add l2x0 device node for Exynos4-based boards From: Tushar Behera To: Tomasz Figa Cc: linux-samsung-soc , Kgene Kim , Arnd Bergmann , Tomasz Figa Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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 On 24 January 2014 17:18, Tomasz Figa wrote: > > > On 24.01.2014 05:44, Tushar Behera wrote: >> >> On 23 January 2014 23:45, Tomasz Figa wrote: >>> >>> Hi, >>> >>> >>> On 07.01.2014 09:53, Tushar Behera wrote: >>>> >>>> >>>> For Exynos4 platform, L2 cache initialization is done only if >>>> a device node for l2x0 device exists. >>>> >>>> L2 cache initialization path is different when a board boots with >>>> secure firmware. Since there are many Exynos4 based SoCs that boot >>>> in secure mode, enabling this only for boards that don't boot with >>>> secure firmware. >>>> >>>> Signed-off-by: Tushar Behera >>>> --- >>>> >>>> Tested on Exynos4210-Origen board. >>>> >>>> arch/arm/boot/dts/exynos4.dtsi | 8 ++++++++ >>>> arch/arm/boot/dts/exynos4210-origen.dts | 4 ++++ >>>> arch/arm/boot/dts/exynos4210-smdkv310.dts | 4 ++++ >>>> arch/arm/boot/dts/exynos4210-trats.dts | 4 ++++ >>>> arch/arm/boot/dts/exynos4210-universal_c210.dts | 4 ++++ >>>> arch/arm/boot/dts/exynos4412-odroidx.dts | 4 ++++ >>>> arch/arm/boot/dts/exynos4412-smdk4412.dts | 4 ++++ >>>> arch/arm/boot/dts/exynos4412-tiny4412.dts | 4 ++++ >>>> 8 files changed, 36 insertions(+) >>> >>> >>> >>> Looks good. Unfortunately this is still going to break secure firmware >>> enabled boards, because l2x0_of_init() does not check if the node is >>> enabled. >>> >> >> Is the following check in l2x0_of_init() not enough? >> >> 1002 |-------np = of_find_matching_node(NULL, l2x0_ids); >> 1003 |-------if (!np) >> 1004 |-------|-------return -ENODEV; > > > It only looks for a matching node without checking its status property. > Hmm ... so in that case, will this work? diff --git a/arch/arm/mm/cache-l2x0.c b/arch/arm/mm/cache-l2x0.c index 7abde2ce..ebcab01 100644 --- a/arch/arm/mm/cache-l2x0.c +++ b/arch/arm/mm/cache-l2x0.c @@ -973,11 +973,17 @@ int __init l2x0_of_init(u32 aux_val, u32 aux_mask) struct device_node *np; const struct l2x0_of_data *data; struct resource res; + const char *status; np = of_find_matching_node(NULL, l2x0_ids); if (!np) return -ENODEV; + status = of_get_property(np, "status", NULL); + if (status) + if (strcmp(status, "okay")) + return -ENODEV; + if (of_address_to_resource(np, 0, &res)) return -ENODEV;