From patchwork Tue Apr 15 18:16:00 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Hesselbarth X-Patchwork-Id: 3994731 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 CA53E9F2BA for ; Tue, 15 Apr 2014 18:18:47 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EDC812017B for ; Tue, 15 Apr 2014 18:18:46 +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 1BFEF20268 for ; Tue, 15 Apr 2014 18:18:46 +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 1Wa7um-0000Hv-9z; Tue, 15 Apr 2014 18:17:00 +0000 Received: from mail-ee0-x231.google.com ([2a00:1450:4013:c00::231]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Wa7uO-0008Os-9m for linux-arm-kernel@lists.infradead.org; Tue, 15 Apr 2014 18:16:37 +0000 Received: by mail-ee0-f49.google.com with SMTP id c41so8026764eek.36 for ; Tue, 15 Apr 2014 11:16:13 -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=DhqoXQxUe1zbfGSwj+L+8kuEAnpyyJj/njgIV7Vb77Q=; b=ZMcO3A5xQFGqfw6SBoYDoo1An91p89+stjgAnlCFrV87YrGLJ0Zx/ZkPA/GZmrATMw eWuXN+ZimYNCb6veR3S/tHk5ZEy2OiUT94lqxv16uBGxjKEeYoLoYUYOdM7pZGVZhrzo WbgIz5pffSXiUTMsXnAzpwBh+n6UdqkDIHMiLs32x79JqG4iwpLwo3Lm7uJJ2rC+yRen ioT4CzA+Wq2228Eonc+DCXYeEBYP1Eh2oqCZVmwwdhOKrtXV3wJ0cDTRPgRt58aO6cSP w9SdOR3g6rIwqAhG2+mkRdKqjPyPnM5hg1rPszpQLvnIkzQDzHc3Nc81cs7XK8bjYWKC 8EQw== X-Received: by 10.15.22.201 with SMTP id f49mr4670046eeu.18.1397585772947; Tue, 15 Apr 2014 11:16:12 -0700 (PDT) Received: from topkick.lan (dslc-082-083-251-183.pools.arcor-ip.net. [82.83.251.183]) by mx.google.com with ESMTPSA id e42sm50949833eev.32.2014.04.15.11.16.10 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 15 Apr 2014 11:16:11 -0700 (PDT) From: Sebastian Hesselbarth To: Sebastian Hesselbarth Subject: [PATCH 2/5] ARM: pj4: enable iWMMXt only if CONFIG_IWMMXT is set Date: Tue, 15 Apr 2014 20:16:00 +0200 Message-Id: <1397585763-23482-3-git-send-email-sebastian.hesselbarth@gmail.com> In-Reply-To: <1397585763-23482-1-git-send-email-sebastian.hesselbarth@gmail.com> References: <20140414151236.75f8816d@skate> <1397585763-23482-1-git-send-email-sebastian.hesselbarth@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140415_111636_501183_63552A85 X-CRM114-Status: GOOD ( 14.72 ) X-Spam-Score: -0.1 (/) Cc: Thomas Petazzoni , Andrew Lunn , Kevin Hilman , Russell King , Jason Cooper , Arnd Bergmann , Chao Xie , linux-kernel@vger.kernel.org, Haojian Zhuang , Gregory Clement , Olof Johansson , Eric Miao , 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: , 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.4 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RP_MATCHES_RCVD, T_DKIM_INVALID, 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 This fixes PJ4 coprocessor init to only expose iWMMXt capabilities, if the corresponding kernel support for iWMMXt is enabled. Signed-off-by: Sebastian Hesselbarth --- Cc: Russell King Cc: Arnd Bergmann Cc: Olof Johansson Cc: Kevin Hilman Cc: Andrew Lunn Cc: Jason Cooper Cc: Gregory Clement Cc: Thomas Petazzoni Cc: Eric Miao Cc: Haojian Zhuang Cc: Chao Xie Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org --- arch/arm/kernel/pj4-cp0.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/arch/arm/kernel/pj4-cp0.c b/arch/arm/kernel/pj4-cp0.c index fc7208636284..12352cd30ab2 100644 --- a/arch/arm/kernel/pj4-cp0.c +++ b/arch/arm/kernel/pj4-cp0.c @@ -45,7 +45,7 @@ static int iwmmxt_do(struct notifier_block *self, unsigned long cmd, void *t) return NOTIFY_DONE; } -static struct notifier_block iwmmxt_notifier_block = { +static struct notifier_block __maybe_unused iwmmxt_notifier_block = { .notifier_call = iwmmxt_do, }; @@ -79,17 +79,21 @@ static void __init pj4_cp_access_write(u32 value) */ static int __init pj4_cp0_init(void) { - u32 cp_access; + u32 __maybe_unused cp_access; if (!cpu_is_pj4()) return 0; +#ifndef CONFIG_IWMMXT + pr_info("PJ4 iWMMXt coprocessor detected, but kernel support is missing.\n"); +#else cp_access = pj4_cp_access_read() & ~0xf; pj4_cp_access_write(cp_access); printk(KERN_INFO "PJ4 iWMMXt coprocessor enabled.\n"); elf_hwcap |= HWCAP_IWMMXT; thread_register_notifier(&iwmmxt_notifier_block); +#endif return 0; }