From patchwork Wed Dec 10 02:39:44 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Packham X-Patchwork-Id: 5466641 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 899CEBEEA8 for ; Wed, 10 Dec 2014 02:43:10 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A9F9420121 for ; Wed, 10 Dec 2014 02:43:09 +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 C06FC2010C for ; Wed, 10 Dec 2014 02:43:08 +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 1XyXCy-00021n-Tt; Wed, 10 Dec 2014 02:40:56 +0000 Received: from gate2.alliedtelesis.co.nz ([202.36.163.20]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XyXCl-0001wI-P2 for linux-arm-kernel@lists.infradead.org; Wed, 10 Dec 2014 02:40:44 +0000 Received: from mmarshal3.atlnz.lc (mmarshal3.atlnz.lc [10.32.18.43]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by gate2.alliedtelesis.co.nz (Postfix) with ESMTPS id 7AD7C844D1; Wed, 10 Dec 2014 15:40:14 +1300 (NZDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alliedtelesis.co.nz; s=mail; t=1418179214; bh=wmpBHc90MVC0+Uj4GtJWkxzmoFKJOPkDthCOz7OPGMw=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=tCQ5NfQduJbZByt/weA14s7l1dugfeLVDkqW+tKYQKOv3k5lmX+hDYmkZLM/hhMMB hMOvZMPvvLJzjg1j6rMOLQ+XVphVIZtcg/ppQR0+ejVa5jYYs4/RyXvRhGZ4Mns4e9 jOjdFN2+99EsIZbNDFXp/cw08LDAHXpWdDVhpXbk= Received: from alliedtelesyn.co.nz (Not Verified[10.32.16.32]) by mmarshal3.atlnz.lc with MailMarshal (v7, 1, 0, 4874) id ; Wed, 10 Dec 2014 15:40:14 +1300 Received: from MAIL/SpoolDir by alliedtelesyn.co.nz (Mercury 1.48); 10 Dec 14 15:40:50 +1300 Received: from SpoolDir by MAIL (Mercury 1.48); 10 Dec 14 15:40:39 +1300 Received: from chrisp-dl.ws.atlnz.lc (10.33.22.30) by alliedtelesyn.co.nz (Mercury 1.48) with ESMTP; 10 Dec 14 15:40:38 +1300 Received: by chrisp-dl.ws.atlnz.lc (Postfix, from userid 1030) id C41B080B43; Wed, 10 Dec 2014 15:40:02 +1300 (NZDT) From: Chris Packham To: linux-arm-kernel@lists.infradead.org Subject: [RFC/PATCH 1/4] ARM: mvebu: use dt_fixup to provide fallback for enable-method Date: Wed, 10 Dec 2014 15:39:44 +1300 Message-Id: <1418179187-18486-2-git-send-email-chris.packham@alliedtelesis.co.nz> X-Mailer: git-send-email 2.2.0.rc0 In-Reply-To: <1418179187-18486-1-git-send-email-chris.packham@alliedtelesis.co.nz> References: <1418179187-18486-1-git-send-email-chris.packham@alliedtelesis.co.nz> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20141209_184044_305228_8DAFE4CC X-CRM114-Status: GOOD ( 11.20 ) X-Spam-Score: -0.1 (/) Cc: Andrew Lunn , Jason Cooper , Boris Brezillon , Chris Packham , Ezequiel Garcia , Gregory Clement , Maxime Ripard , Sebastian Hesselbarth 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=-2.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_LOW, 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 We need to maintain backwards compatibility with device trees that don't define an enable method. At the same time we want the device tree to be able to specify an enable-method and have it stick. Previously by having smp assigned in the DT_MACHINE definition this would be picked up by setup_arch() and override whatever arm_dt_init_cpu_maps() had configured. Now we move the initial assignment of default smp_ops to a dt_fixup and let arm_dt_init_cpu_maps() override that if the device tree defines an enable-method. Signed-off-by: Chris Packham --- This didn't get much attention last time and is unchanged from v4. I'm pretty happy with this incarnation. It doesn't touch core code. It provides a fallback for old device trees and it achieves my original goal of allowing the device tree to configure the smp_ops via the enable-method property. v1: http://lists.infradead.org/pipermail/linux-arm-kernel/2014-November/300182.html v2: http://lists.infradead.org/pipermail/linux-arm-kernel/2014-November/300480.html v3: http://lists.infradead.org/pipermail/linux-arm-kernel/2014-November/302945.html v4: http://lists.infradead.org/pipermail/linux-arm-kernel/2014-November/303899.html arch/arm/mach-mvebu/board-v7.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/arch/arm/mach-mvebu/board-v7.c b/arch/arm/mach-mvebu/board-v7.c index d0d39f1..ce23c6a 100644 --- a/arch/arm/mach-mvebu/board-v7.c +++ b/arch/arm/mach-mvebu/board-v7.c @@ -198,6 +198,11 @@ static void __init mvebu_dt_init(void) of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); } +static void __init armada_370_xp_dt_fixup(void) +{ + smp_set_ops(smp_ops(armada_xp_smp_ops)); +} + static const char * const armada_370_xp_dt_compat[] = { "marvell,armada-370-xp", NULL, @@ -206,11 +211,11 @@ static const char * const armada_370_xp_dt_compat[] = { DT_MACHINE_START(ARMADA_370_XP_DT, "Marvell Armada 370/XP (Device Tree)") .l2c_aux_val = 0, .l2c_aux_mask = ~0, - .smp = smp_ops(armada_xp_smp_ops), .init_machine = mvebu_dt_init, .init_irq = mvebu_init_irq, .restart = mvebu_restart, .dt_compat = armada_370_xp_dt_compat, + .dt_fixup = armada_370_xp_dt_fixup, MACHINE_END static const char * const armada_375_dt_compat[] = {