From patchwork Wed Jun 26 19:46:08 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 2788061 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.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 8B585C0AB1 for ; Wed, 26 Jun 2013 19:46:41 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 97A5D20426 for ; Wed, 26 Jun 2013 19:46:40 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 98BEC20423 for ; Wed, 26 Jun 2013 19:46:39 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Urvfn-0004pM-QI; Wed, 26 Jun 2013 19:46:36 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Urvfk-0005cg-Uc; Wed, 26 Jun 2013 19:46:32 +0000 Received: from mail-oa0-x22f.google.com ([2607:f8b0:4003:c02::22f]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Urvfi-0005bt-A6 for linux-arm-kernel@lists.infradead.org; Wed, 26 Jun 2013 19:46:31 +0000 Received: by mail-oa0-f47.google.com with SMTP id m1so15215476oag.6 for ; Wed, 26 Jun 2013 12:46:08 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:x-gm-message-state; bh=zuY4/wZa2reFRfcsq01gmLAcYBjdnpDqKs7LbcXGHjg=; b=VdWUvU6BQkEjP35Lk5c2cO4ZhFdnks+4EJhAjZhvIfvxG/SJwwTXbDnTJWpTwuB4JO 12q2p77phgaAKZ0/GpsVVeVLlQ6ek1nmn0/0CU/FnFu5AfItCQUbgGhHBhxsS8bJBGFg VnqkfmmLwSznlrt4KQWoLZ1CZzqfGGakbljWblTt4pSmunTISQS+2eRoLSGiaQMXn9BS gbbtfyvA5cCb9gjgXpov/0ZaP8z8TRpO+ejiA61JnaWPMzQfAjnDCaVC4+ufxOtLMWa3 RBKJNZmUMXXrV3tbYEPPoujpefbPF9m2KZkCEQYXjnAiOoUt7FTaJJJkDyMBTvOUiHqs 2l8A== MIME-Version: 1.0 X-Received: by 10.60.173.169 with SMTP id bl9mr1279545oec.51.1372275968679; Wed, 26 Jun 2013 12:46:08 -0700 (PDT) Received: by 10.182.26.83 with HTTP; Wed, 26 Jun 2013 12:46:08 -0700 (PDT) In-Reply-To: <1372210231-22900-1-git-send-email-olof@lixom.net> References: <1372210231-22900-1-git-send-email-olof@lixom.net> Date: Wed, 26 Jun 2013 21:46:08 +0200 Message-ID: Subject: Re: [PATCH] ARM: ux500: check platform in ux500_l2x0_init From: Linus Walleij To: Olof Johansson X-Gm-Message-State: ALoCoQlNdWVeb+JHCRdJluoqCV648eQDpbcl7Z4U8qY6W+GY6JMk28sroPF3ZydROrgd1WcW05Ni X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130626_154630_505219_A81313B7 X-CRM114-Status: GOOD ( 19.84 ) X-Spam-Score: -1.9 (-) Cc: "linux-kernel@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-5.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 Wed, Jun 26, 2013 at 3:30 AM, Olof Johansson wrote: > Add compatible checks for ux500. This should probably be moved to generic > DT-based probing whenever DT is populated instead, but until then at > least don't panic all non-ux500 multiplatform machines. > > Signed-off-by: Olof Johansson > + /* Ick. I wish there was a single compatible value to compare for, > + * but there isn't. > + */ > + if (!of_machine_is_compatible("st-ericsson,u8500") && > + !of_machine_is_compatible("st-ericsson,u8540") && > + !of_machine_is_compatible("st-ericsson,u9500") && > + !of_machine_is_compatible("st-ericsson,u8540")) > + return -ENODEV; This is checking u8540 twice and does not account for snowball. With new platforms coming we cannot just line up all possible compat strings like this, we need to rely on the cpu_is* macro to be reporting something sane, and I think it does. What about just doing this: From da838c71fb32d63d7e28c14697702ff48088a09b Mon Sep 17 00:00:00 2001 From: Linus Walleij Date: Wed, 26 Jun 2013 21:44:57 +0200 Subject: [PATCH] ARM: ux500: bail out on alien cpus This makes the l2x0 initialization fail gracefully on non-ux500 systems. Signed-off-by: Linus Walleij --- arch/arm/mach-ux500/cache-l2x0.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- 1.8.1.4 Yours, Linus Walleij diff --git a/arch/arm/mach-ux500/cache-l2x0.c b/arch/arm/mach-ux500/cache-l2x0.c index f58615b..82ccf1d 100644 --- a/arch/arm/mach-ux500/cache-l2x0.c +++ b/arch/arm/mach-ux500/cache-l2x0.c @@ -42,7 +42,8 @@ static int __init ux500_l2x0_init(void) if (cpu_is_u8500_family() || cpu_is_ux540_family()) l2x0_base = __io_address(U8500_L2CC_BASE); else - ux500_unknown_soc(); + /* Non-Ux500 platform */ + return -ENODEV; /* Unlock before init */ ux500_l2x0_unlock();