From patchwork Wed Oct 1 11:02:14 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: dinguyen@opensource.altera.com X-Patchwork-Id: 5011211 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 1A61E9F327 for ; Wed, 1 Oct 2014 11:09:08 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 56BE420221 for ; Wed, 1 Oct 2014 11:09:07 +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 A52162026C for ; Wed, 1 Oct 2014 11:09:04 +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 1XZHju-00046w-JG; Wed, 01 Oct 2014 11:06:34 +0000 Received: from mail-by2on0054.outbound.protection.outlook.com ([207.46.100.54] helo=na01-by2-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XZHjr-00044N-IZ for linux-arm-kernel@lists.infradead.org; Wed, 01 Oct 2014 11:06:31 +0000 Received: from BY1PR0301MB1189.namprd03.prod.outlook.com (25.160.195.148) by BY1PR0301MB1253.namprd03.prod.outlook.com (25.161.203.25) with Microsoft SMTP Server (TLS) id 15.0.1039.15; Wed, 1 Oct 2014 11:06:08 +0000 Received: from linux-builds1.altera.com (64.129.157.38) by BY1PR0301MB1189.namprd03.prod.outlook.com (25.160.195.148) with Microsoft SMTP Server (TLS) id 15.0.1044.10; Wed, 1 Oct 2014 11:06:04 +0000 From: To: Subject: [PATCH] arm: socfpga: fix fetching cpu1start_addr for system with > 2GB of ram Date: Wed, 1 Oct 2014 06:02:14 -0500 Message-ID: <1412161334-12359-1-git-send-email-dinguyen@opensource.altera.com> X-Mailer: git-send-email 2.0.3 MIME-Version: 1.0 X-Originating-IP: [64.129.157.38] X-ClientProxiedBy: BY2PR06CA055.namprd06.prod.outlook.com (10.141.250.173) To BY1PR0301MB1189.namprd03.prod.outlook.com (25.160.195.148) X-Microsoft-Antispam: UriScan:;UriScan:; X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:;SRVR:BY1PR0301MB1189; X-Forefront-PRVS: 0351D213B3 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(189002)(199003)(69596002)(48376002)(10300001)(85306004)(89996001)(77156001)(110136001)(47776003)(20776003)(86152002)(21056001)(92566001)(50466002)(102836001)(31966008)(99396003)(101416001)(66066001)(76482002)(107046002)(97736003)(19580405001)(229853001)(85852003)(64706001)(19580395003)(120916001)(50226001)(4396001)(77096002)(86362001)(93916002)(106356001)(50986999)(81156004)(42186005)(33646002)(87976001)(87286001)(95666004)(2351001)(105586002)(80022003)(46102003)(104166001)(62966002)(88136002)(92726001)(53416004); DIR:OUT; SFP:1101; SCL:1; SRVR:BY1PR0301MB1189; H:linux-builds1.altera.com; FPR:; MLV:sfv; PTR:InfoNoRecords; MX:3; A:3; LANG:en; X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:;SRVR:BY1PR0301MB1253; X-OriginatorOrg: opensource.altera.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20141001_040631_614011_E5C41C5E X-CRM114-Status: GOOD ( 10.15 ) X-Spam-Score: -0.2 (/) Cc: Dinh Nguyen , dinh.linux@gmail.com, linux-arm-kernel@lists.infradead.org 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: , 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, RCVD_IN_DNSWL_NONE, 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 From: Dinh Nguyen When CPU1 is brought out of reset, it's MMU is not turned yet, so it will only be able to use physical addresses. For systems with 1GB or less, clearing 0x40000000 will work just fine. However for systems with 2GB or more, we need to clear at least 0x80000000. Essentially, the bic instruction is converting the cpu1start_addr from a virtual to a physical address. We should be using bic 0xf0000000 for all systems. Signed-off-by: Dinh Nguyen --- arch/arm/mach-socfpga/headsmp.S | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/arch/arm/mach-socfpga/headsmp.S b/arch/arm/mach-socfpga/headsmp.S index 95c115d..d686f99 100644 --- a/arch/arm/mach-socfpga/headsmp.S +++ b/arch/arm/mach-socfpga/headsmp.S @@ -16,9 +16,8 @@ ENTRY(secondary_trampoline) movw r2, #:lower16:cpu1start_addr movt r2, #:upper16:cpu1start_addr - /* The socfpga VT cannot handle a 0xC0000000 page offset when loading - the cpu1start_addr, we bit clear it. Tested on HW and VT. */ - bic r2, r2, #0x40000000 + /* convert cpu1start_addr to a physical address */ + bic r2, r2, #0xf0000000 ldr r0, [r2] ldr r1, [r0]