From patchwork Sun Oct 12 18:14:00 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Agner X-Patchwork-Id: 5071251 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 D23929F295 for ; Sun, 12 Oct 2014 18:18:20 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D8CC42020F for ; Sun, 12 Oct 2014 18:18:19 +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 0E2EB201EC for ; Sun, 12 Oct 2014 18:18:19 +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 1XdNgJ-00032L-2h; Sun, 12 Oct 2014 18:15:47 +0000 Received: from mail.kmu-office.ch ([178.209.48.102]) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1XdNfZ-0001a9-Cw for linux-arm-kernel@lists.infradead.org; Sun, 12 Oct 2014 18:15:02 +0000 Received: from localhost (localhost [127.0.0.1]) by mail.kmu-office.ch (Postfix) with ESMTP id 48D71A496C for ; Sun, 12 Oct 2014 20:12:25 +0200 (CEST) X-Virus-Scanned: by amavisd-new at kmu-office.ch X-Amavis-Alert: BAD HEADER, Duplicate header field: "In-Reply-To" Received: from mail.kmu-office.ch ([127.0.0.1]) by localhost (mail.kmu-office.ch [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id NrTLgPvVa8OM for ; Sun, 12 Oct 2014 20:12:25 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by mail.kmu-office.ch (Postfix) with ESMTP id E4100A49A1 for ; Sun, 12 Oct 2014 20:12:19 +0200 (CEST) Received: from trochilidae.localdomain (80-254-69-12.dynamic.monzoon.net [80.254.69.12]) (Authenticated sender: stefan@agner.ch) by mail.kmu-office.ch (Postfix) with ESMTPSA id 36150A496D; Sun, 12 Oct 2014 20:12:19 +0200 (CEST) From: Stefan Agner To: shawn.guo@linaro.org, kernel@pengutronix.de, u.kleine-koenig@pengutronix.de Subject: [RFC 6/7] ARM: vf610m4: HACK: get dtb pointer from SRC_GPR3 Date: Sun, 12 Oct 2014 20:14:00 +0200 Message-Id: <2bdc44912522eb02db2e4612738fe9f0545b36d9.1413136383.git.stefan@agner.ch> X-Mailer: git-send-email 2.1.2 In-Reply-To: References: In-Reply-To: References: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20141012_111501_626131_9106520B X-CRM114-Status: UNSURE ( 8.86 ) X-CRM114-Notice: Please train this message. X-Spam-Score: 0.0 (/) Cc: devicetree@vger.kernel.org, linux@arm.linux.org.uk, arnd@arndb.de, Stefan Agner , marcel@ziswiler.com, olof@lixom.net, 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: , 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=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, 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 Get DTB pointer (located in r2) from SRC_GPR3 (argument register for secondary core) Signed-off-by: Stefan Agner --- This is clearly a hack but it works around the need of a boot loader on the Cortex-M4. I guess there is no way neither its acceptable to do this on machine level..? But then, this can also be done with a minimal boot loader loaded just in front of the kernel by the m4boot utility. arch/arm/kernel/head-nommu.S | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/arch/arm/kernel/head-nommu.S b/arch/arm/kernel/head-nommu.S index cc176b6..0468683 100644 --- a/arch/arm/kernel/head-nommu.S +++ b/arch/arm/kernel/head-nommu.S @@ -37,6 +37,10 @@ * */ +#define SRC_BASE 0x4006e000 +#define SRC_GPR2 0x28 +#define SRC_GPR3 0x2c + __HEAD #ifdef CONFIG_CPU_THUMBONLY @@ -57,6 +61,10 @@ ENTRY(stext) #if defined(CONFIG_CPU_CP15) mrc p15, 0, r9, c0, c0 @ get processor id #elif defined(CONFIG_CPU_V7M) + + ldr r0, =SRC_BASE + ldr r1, =0xffffffff @ Machine ID + ldr r2, [r0, #SRC_GPR3 ] @ DT pointer from argument register ldr r9, =BASEADDR_V7M_SCB ldr r9, [r9, V7M_SCB_CPUID] #else