From patchwork Thu Jul 26 03:48:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Packham X-Patchwork-Id: 10545165 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 76EAC14E2 for ; Thu, 26 Jul 2018 03:49:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5D99D2AC9E for ; Thu, 26 Jul 2018 03:49:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 502972ACAB; Thu, 26 Jul 2018 03:49:58 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 5D08D2AC9E for ; Thu, 26 Jul 2018 03:49:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=+avlkPrTj8pY0uO4UeGQsYsaW/JDNpOM94Y9+T+J/Vo=; b=hwi Z525BMsIunHEJF07LkOq3TaJqR0rNJi9VY9/A8y+A/hvvUIheC7HKZdmn6xwhovIkB+s0fztGPtzs 6fVzJMsVNf7oiTxuMng4jPb8RLAZf4beN63Algf3lA3X+ka+8H9rzvip+cxqK+NF0EnYOxMEm2Ivj n5sF2jODmDigUfyI5nEw11w2TZvM8pmYfaTIbFksE8zZ8VdTy0voSS/z7c5n27k+/Tsp0AhIV7oIz fHaQINOeIB0RhpUV5wL5EegzkW4ODslCqNe8FvymbYN/jlB8QU23yebs4yHseJuTXBrdzU2ELc7qv y65Rdoir0ApJihznzfWLesW27xh4jbA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fiXHj-0002gW-2l; Thu, 26 Jul 2018 03:49:51 +0000 Received: from gate2.alliedtelesis.co.nz ([202.36.163.20]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fiXHf-0002fK-4S for linux-arm-kernel@lists.infradead.org; Thu, 26 Jul 2018 03:49:49 +0000 Received: from mmarshal3.atlnz.lc (mmarshal3.atlnz.lc [10.32.18.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by gate2.alliedtelesis.co.nz (Postfix) with ESMTPS id 6FB548365F; Thu, 26 Jul 2018 15:49:03 +1200 (NZST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alliedtelesis.co.nz; s=mail; t=1532576943; bh=98jP5YHVHAjqI3Oq91Op9KVY+xbxTdaiIWi2O+5j7QA=; h=From:To:Cc:Subject:Date; b=wPq+CKvg7x5mjoAe8PyLRRx2G3q/Z69IzR4MbnhkEjNLMW9P+SU6JT1vL03SeR4tc QbTQ0ysguSV8IZzcXX0OaQlVlwa/+mFo5uLUiTwC6kaibZwosu408D6TEtmNmpJ++d Gshu/yUldZICag3Wil1dtsu3K67JpXgtIGvvTWVA= Received: from smtp (Not Verified[10.32.16.33]) by mmarshal3.atlnz.lc with Trustwave SEG (v7, 5, 8, 10121) id ; Thu, 26 Jul 2018 15:49:03 +1200 Received: from chrisp-dl.ws.atlnz.lc (chrisp-dl.ws.atlnz.lc [10.33.22.30]) by smtp (Postfix) with ESMTP id 6481B13ED1C; Thu, 26 Jul 2018 15:49:04 +1200 (NZST) Received: by chrisp-dl.ws.atlnz.lc (Postfix, from userid 1030) id 04CEA1E262C; Thu, 26 Jul 2018 15:49:02 +1200 (NZST) From: Chris Packham To: jason@lakedaemon.net, andrew@lunn.ch, gregory.clement@bootlin.com, sebastian.hesselbarth@gmail.com, linux@armlinux.org.uk, ylefloch@online.net Subject: [PATCH v5] ARM: mvebu: use dt_fixup to provide fallback for enable-method Date: Thu, 26 Jul 2018 15:48:56 +1200 Message-Id: <20180726034856.20743-1-chris.packham@alliedtelesis.co.nz> X-Mailer: git-send-email 2.18.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180725_204947_411524_CAFF1463 X-CRM114-Status: UNSURE ( 9.73 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Chris Packham , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.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 Tested-by: Gregory CLEMENT Signed-off-by: Olof Johansson --- Pervious versions 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 Changes since v4: - drop "RFC" arch/arm/mach-mvebu/board-v7.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/arch/arm/mach-mvebu/board-v7.c b/arch/arm/mach-mvebu/board-v7.c index ccca95173e17..5bbde5e5258e 100644 --- a/arch/arm/mach-mvebu/board-v7.c +++ b/arch/arm/mach-mvebu/board-v7.c @@ -145,6 +145,11 @@ static void __init mvebu_dt_init(void) i2c_quirk(); } +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[] __initconst = { "marvell,armada-370-xp", NULL, @@ -153,17 +158,12 @@ static const char * const armada_370_xp_dt_compat[] __initconst = { DT_MACHINE_START(ARMADA_370_XP_DT, "Marvell Armada 370/XP (Device Tree)") .l2c_aux_val = 0, .l2c_aux_mask = ~0, -/* - * The following field (.smp) is still needed to ensure backward - * compatibility with old Device Trees that were not specifying the - * cpus enable-method property. - */ - .smp = smp_ops(armada_xp_smp_ops), .init_machine = mvebu_dt_init, .init_irq = mvebu_init_irq, .restart = mvebu_restart, .reserve = mvebu_memblock_reserve, .dt_compat = armada_370_xp_dt_compat, + .dt_fixup = armada_370_xp_dt_fixup, MACHINE_END static const char * const armada_375_dt_compat[] __initconst = {