From patchwork Wed May 6 07:19:26 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yingjoe Chen X-Patchwork-Id: 6346931 Return-Path: X-Original-To: patchwork-linux-mediatek@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id EC44BBEEE1 for ; Wed, 6 May 2015 07:20:36 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 04CFF20268 for ; Wed, 6 May 2015 07:20:36 +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 198B720259 for ; Wed, 6 May 2015 07:20:35 +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 1YptdC-0004OU-4r; Wed, 06 May 2015 07:20:34 +0000 Received: from [210.61.82.184] (helo=mailgw02.mediatek.com) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Yptcv-00034r-HW; Wed, 06 May 2015 07:20:21 +0000 X-Listener-Flag: 11101 Received: from mtkhts09.mediatek.inc [(172.21.101.70)] by mailgw02.mediatek.com (envelope-from ) (mhqrelay.mediatek.com ESMTP with TLS) with ESMTP id 1661557864; Wed, 06 May 2015 15:19:30 +0800 Received: from [172.21.77.4] (172.21.77.4) by mtkhts09.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 14.3.181.6; Wed, 6 May 2015 15:19:27 +0800 Message-ID: <1430896766.15346.13.camel@mtksdaap41> Subject: Re: [PATCH 0/7] Add SMP bringup support for mt65xx socs From: Yingjoe Chen To: Matthias Brugger Date: Wed, 6 May 2015 15:19:26 +0800 In-Reply-To: References: <1430466210-22963-1-git-send-email-yingjoe.chen@mediatek.com> X-Mailer: Evolution 3.2.3-0ubuntu6 MIME-Version: 1.0 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150506_002019_730326_E313E301 X-CRM114-Status: GOOD ( 17.33 ) X-Spam-Score: 1.3 (+) Cc: Mark Rutland , "devicetree@vger.kernel.org" , Lorenzo Pieralisi , Russell King , Arnd Bergmann , Pawel Moll , Ian Campbell , Catalin Marinas , Daniel Lezcano , "linux-kernel@vger.kernel.org" , Marc Carino , Rob Herring , linux-mediatek@lists.infradead.org, Sascha Hauer , Olof Johansson , Thomas Gleixner , srv_heupstream , "linux-arm-kernel@lists.infradead.org" , Jason Cooper X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_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 Hi Matthias, On Mon, 2015-05-04 at 09:48 +0200, Matthias Brugger wrote: > Hi Yingjoe, > > 2015-05-01 9:43 GMT+02:00 Yingjoe Chen : > > This series add SMP brinup support for mediatek SoCs. This is based > > on v4.1-rc1. > > > > There are 2 similar but different SMP bringup up methods on Mediatek > > mt65xx and mt81xx. On MT8135 & MT8127, system boots with a trustzone > > firmware. Others, like MT6589, doesn't have trustzone, and run kernel > > directly in secure world. > > > > Patch 1~3 fix issues in mtk_timer(GPT) and enable arch timer support. > > Patch 4,5 add support for cpu enable-method "mediatek,mt65xx-smp" and > > "mediatek,mt81xx-tz-smp", which support Mediatek SMP bringup for non-TZ > > and TZ platform. > > Patch 6,7 finally enable SMP bringup for mt8135 and mt8127. > > > > Matthias Brugger (1): > > arm: mediatek: enable gpt6 on boot up to make arch timer working > > > > Yingjoe Chen (6): > > clocksource: mediatek: Don't run event_handler if it is NULL > > clocksource: mediatek: Use GPT as sched clock source > > devicetree: bindings: add new SMP enable method Mediatek SoC > > ARM: mediatek: add smp bringup code > > ARM: dts: mt8135: enable basic SMP bringup for mt8135 > > ARM: dts: mt8127: enable basic SMP bringup for mt8127 > > > > I tried on the mt8135 eval board but it fails to bring up the CPU. > > When booting: > [ 1.048588] CPU1: failed to come online > [ 2.049914] CPU2: failed to come online > [ 3.051245] CPU3: failed to come online Thanks for testing, and the config file you provided. It seems you are running THUMB2 kernel, unfortunately mt8135 trustzone firmware doesn't support jump to THUMB2 code directly. I can workaround this with the following patch. I'll include it in my next round. Joe.C -----8<---------------- { if (!mtk_smp_base) diff --git a/arch/arm/mach-mediatek/platsmp.c b/arch/arm/mach-mediatek/platsmp.c index e266b3d..5dea55a 100644 --- a/arch/arm/mach-mediatek/platsmp.c +++ b/arch/arm/mach-mediatek/platsmp.c @@ -57,6 +57,18 @@ static const struct of_device_id mtk_smp_boot_infos[] __initconst = { static void __iomem *mtk_smp_base; static const struct mtk_smp_boot_info *mtk_smp_info; +#ifdef CONFIG_THUMB2_KERNEL +__asm__( + ".arm\n" + "mtk_secondary_startup_fixup:\n" + " b secondary_startup\n" + ".thumb\n" +); + +void mtk_secondary_startup_fixup(void); +#define secondary_startup mtk_secondary_startup_fixup +#endif + static int mtk_boot_secondary(unsigned int cpu, struct task_struct *idle)