From patchwork Tue Sep 18 14:17:55 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pawel Moll X-Patchwork-Id: 1473251 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork2.kernel.org (Postfix) with ESMTP id CA06DDF24C for ; Tue, 18 Sep 2012 14:25:15 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TDyg3-000700-83; Tue, 18 Sep 2012 14:21:27 +0000 Received: from service87.mimecast.com ([91.220.42.44]) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TDycr-0005cL-3G for linux-arm-kernel@lists.infradead.org; Tue, 18 Sep 2012 14:18:27 +0000 Received: from cam-owa1.Emea.Arm.com (fw-tnat.cambridge.arm.com [217.140.96.21]) by service87.mimecast.com; Tue, 18 Sep 2012 15:18:05 +0100 Received: from hornet.cambridge.arm.com ([10.1.255.212]) by cam-owa1.Emea.Arm.com with Microsoft SMTPSVC(6.0.3790.0); Tue, 18 Sep 2012 15:18:03 +0100 From: Pawel Moll To: linux-arm-kernel@lists.infradead.org Subject: [PATCH v2 13/13] ARM: vexpress: Make the DEBUG_LL UART detection more specific Date: Tue, 18 Sep 2012 15:17:55 +0100 Message-Id: <1347977875-16855-14-git-send-email-pawel.moll@arm.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1347977875-16855-1-git-send-email-pawel.moll@arm.com> References: <1347977875-16855-1-git-send-email-pawel.moll@arm.com> X-OriginalArrivalTime: 18 Sep 2012 14:18:03.0706 (UTC) FILETIME=[6A7A59A0:01CD95A8] X-MC-Unique: 112091815180509701 X-Spam-Note: CRM114 invocation failed X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [91.220.42.44 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: arm@kernel.org, Pawel Moll X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Base the UART detection heuristic on architecturally defined MIDR register instead of implementation dependent CBAR. The only tile using the original memory map is V2P-CA9 with Cortex A9 r0p1, which MIDR contains 0x410fc091 value. Signed-off-by: Pawel Moll --- arch/arm/mach-vexpress/include/mach/debug-macro.S | 10 ++++++---- arch/arm/mach-vexpress/include/mach/uncompress.h | 12 +++++------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/arch/arm/mach-vexpress/include/mach/debug-macro.S b/arch/arm/mach-vexpress/include/mach/debug-macro.S index 9f509f5..0c6abbf 100644 --- a/arch/arm/mach-vexpress/include/mach/debug-macro.S +++ b/arch/arm/mach-vexpress/include/mach/debug-macro.S @@ -23,12 +23,14 @@ .macro addruart,rp,rv,tmp @ Make an educated guess regarding the memory map: - @ - the original A9 core tile, which has MPCore peripherals - @ located at 0x1e000000, should use UART at 0x10009000 + @ - the original A9 core tile (based on ARM Cortex-A9 r0p1) + @ should use UART at 0x10009000 @ - all other (RS1 complaint) tiles use UART mapped @ at 0x1c090000 - mrc p15, 4, \tmp, c15, c0, 0 - cmp \tmp, #0x1e000000 + mrc p15, 0, \rp, c0, c0, 0 + movw \rv, #0xc091 + movt \rv, #0x410f + cmp \rp, \rv @ Original memory map moveq \rp, #DEBUG_LL_UART_OFFSET diff --git a/arch/arm/mach-vexpress/include/mach/uncompress.h b/arch/arm/mach-vexpress/include/mach/uncompress.h index 1e472eb..8b8a2ef 100644 --- a/arch/arm/mach-vexpress/include/mach/uncompress.h +++ b/arch/arm/mach-vexpress/include/mach/uncompress.h @@ -17,6 +17,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include + #define AMBA_UART_DR(base) (*(volatile unsigned char *)((base) + 0x00)) #define AMBA_UART_LCRH(base) (*(volatile unsigned char *)((base) + 0x2c)) #define AMBA_UART_CR(base) (*(volatile unsigned char *)((base) + 0x30)) @@ -28,18 +30,14 @@ static unsigned long get_uart_base(void) { #if defined(CONFIG_DEBUG_VEXPRESS_UART0_DETECT) - unsigned long mpcore_periph; - /* * Make an educated guess regarding the memory map: - * - the original A9 core tile, which has MPCore peripherals - * located at 0x1e000000, should use UART at 0x10009000 + * - the original A9 core tile (based on ARM Cortex-A9 r0p1) + * should use UART at 0x10009000 * - all other (RS1 complaint) tiles use UART mapped * at 0x1c090000 */ - asm("mrc p15, 4, %0, c15, c0, 0" : "=r" (mpcore_periph)); - - if (mpcore_periph == 0x1e000000) + if (read_cpuid_id() == 0x410fc091) return UART_BASE; else return UART_BASE_RS1;