From patchwork Mon Nov 24 05:28:10 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhuoyu Zhang X-Patchwork-Id: 413549 Return-Path: X-Original-To: incoming-imx@patchwork.ozlabs.org Delivered-To: patchwork-incoming-imx@bilbo.ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2001:1868:205::9]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4A20F14012B for ; Mon, 24 Nov 2014 16:32:51 +1100 (AEDT) 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 1XsmDv-0001k8-3c; Mon, 24 Nov 2014 05:30:07 +0000 Received: from mail-bl2on0113.outbound.protection.outlook.com ([65.55.169.113] helo=na01-bl2-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XsmDi-0001M1-RS for linux-arm-kernel@lists.infradead.org; Mon, 24 Nov 2014 05:29:56 +0000 Received: from BY2PR03CA047.namprd03.prod.outlook.com (10.141.249.20) by DM2PR03MB398.namprd03.prod.outlook.com (10.141.84.140) with Microsoft SMTP Server (TLS) id 15.1.26.15; Mon, 24 Nov 2014 05:29:32 +0000 Received: from BN1AFFO11FD024.protection.gbl (2a01:111:f400:7c10::164) by BY2PR03CA047.outlook.office365.com (2a01:111:e400:2c5d::20) with Microsoft SMTP Server (TLS) id 15.1.26.15 via Frontend Transport; Mon, 24 Nov 2014 05:29:31 +0000 Received: from tx30smr01.am.freescale.net (192.88.168.50) by BN1AFFO11FD024.mail.protection.outlook.com (10.58.52.84) with Microsoft SMTP Server (TLS) id 15.1.6.13 via Frontend Transport; Mon, 24 Nov 2014 05:29:31 +0000 Received: from titan.ap.freescale.net ([10.192.208.233]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id sAO5TNdE026676; Sun, 23 Nov 2014 22:29:27 -0700 From: Zhuoyu Zhang To: , , Subject: [PATCH v2 2/2] arm: ls1: provide a workaround for core soft reset Date: Mon, 24 Nov 2014 13:28:10 +0800 Message-ID: <1416806890-26920-2-git-send-email-Zhuoyu.Zhang@freescale.com> X-Mailer: git-send-email 2.1.0.27.g96db324 In-Reply-To: <1416806890-26920-1-git-send-email-Zhuoyu.Zhang@freescale.com> References: <1416806890-26920-1-git-send-email-Zhuoyu.Zhang@freescale.com> X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:192.88.168.50; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(189002)(199003)(99396003)(106466001)(36756003)(88136002)(89996001)(87936001)(87286001)(64706001)(120916001)(105606002)(107046002)(62966003)(4396001)(50466002)(50226001)(77156002)(95666004)(46102003)(229853001)(50986999)(76176999)(104016003)(102836001)(6806004)(21056001)(104166001)(68736004)(44976005)(47776003)(20776003)(19580405001)(19580395003)(97736003)(31966008)(2201001)(92566001)(92726001)(93916002)(84676001)(86362001); DIR:OUT; SFP:1102; SCL:1; SRVR:DM2PR03MB398; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; MLV:sfv; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; MIME-Version: 1.0 X-Microsoft-Antispam: UriScan:; X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:;SRVR:DM2PR03MB398; X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:;SRVR:DM2PR03MB398; X-Forefront-PRVS: 040513D301 Received-SPF: Fail (protection.outlook.com: domain of freescale.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=Zhuoyu.Zhang@freescale.com; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:;SRVR:DM2PR03MB398; X-OriginatorOrg: freescale.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20141123_212955_091989_B7514BA0 X-CRM114-Status: UNSURE ( 8.86 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.0 (/) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [65.55.169.113 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [65.55.169.113 listed in wl.mailspike.net] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record Cc: Zhuoyu.Zhang@freescale.com, leoli@freescale.com, linuxppc-release@linux.freescale.net, Jason.Jin@freescale.com, chenhui.zhao@freescale.com X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org List-Id: linux-imx-kernel.lists.patchwork.ozlabs.org From: Zhang Zhuoyu Due to a hardware erratum, after core soft reset, core state machine registers need to force release manually. Signed-off-by: Zhang Zhuoyu --- arch/arm/mach-imx/platsmp.c | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/arch/arm/mach-imx/platsmp.c b/arch/arm/mach-imx/platsmp.c index 7735ebb..73c2289 100644 --- a/arch/arm/mach-imx/platsmp.c +++ b/arch/arm/mach-imx/platsmp.c @@ -41,6 +41,7 @@ u32 g_diag_reg; static void __iomem *scu_base; static void __iomem *dcfg_base; static void __iomem *scfg_base; +static void __iomem *dcsr_rcpm2_base; static u32 secondary_pre_boot_entry; static struct map_desc scu_io_desc __initdata = { @@ -150,8 +151,25 @@ static int ls1021a_secondary_iomap(void) goto scfg_err; } + np = of_find_compatible_node(NULL, NULL, "fsl,ls1021a-dcsr-rcpm"); + if (!np) { + pr_err("%s: failed to find dcsr node.\n", __func__); + ret = -EINVAL; + goto dcsr_err; + } + + dcsr_rcpm2_base = of_iomap(np, 1); + of_node_put(np); + if (!dcsr_rcpm2_base) { + pr_err("%s: failed to map dcsr.\n", __func__); + ret = -ENOMEM; + goto dcsr_err; + } + return 0; +dcsr_err: + iounmap(scfg_base); scfg_err: iounmap(dcfg_base); dcfg_err: @@ -176,7 +194,7 @@ static int ls1021a_reset_secondary(unsigned int cpu) { u32 tmp; - if (!scfg_base || !dcfg_base) + if (!scfg_base || !dcfg_base || !dcsr_rcpm2_base) return -ENOMEM; writel_relaxed(secondary_pre_boot_entry, @@ -190,6 +208,15 @@ static int ls1021a_reset_secondary(unsigned int cpu) iowrite32be(0x80000000, scfg_base + SCFG_CORESRENCR); iowrite32be(0x80000000, scfg_base + SCFG_CORE0_SFT_RST + STRIDE_4B * cpu); + mdelay(10); + + /* LS1021a errata. after reset, core state machine registers + * need to force release manually. + */ + iowrite32be(0x00000080, dcsr_rcpm2_base + DCSR_RCPM2_DEBUG1); + iowrite32be(0x00000080, dcsr_rcpm2_base + DCSR_RCPM2_DEBUG2); + iowrite32be(0, dcsr_rcpm2_base + DCSR_RCPM2_DEBUG1); + iowrite32be(0, dcsr_rcpm2_base + DCSR_RCPM2_DEBUG2); /* Release secondary core */ iowrite32be(1 << cpu, dcfg_base + DCFG_CCSR_BRR);