From patchwork Mon Sep 17 05:35:00 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shawn Guo X-Patchwork-Id: 184309 Return-Path: X-Original-To: incoming-imx@patchwork.ozlabs.org Delivered-To: patchwork-incoming-imx@bilbo.ozlabs.org Received: from merlin.infradead.org (unknown [IPv6:2001:4978:20e::2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 51B1B2C0081 for ; Mon, 17 Sep 2012 15:54:34 +1000 (EST) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TDUDP-0003cI-Oj; Mon, 17 Sep 2012 05:49:52 +0000 Received: from mail-pb0-f49.google.com ([209.85.160.49]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1TDU1H-0001e5-2A for linux-arm-kernel@lists.infradead.org; Mon, 17 Sep 2012 05:37:20 +0000 Received: by mail-pb0-f49.google.com with SMTP id rq8so9280584pbb.36 for ; Sun, 16 Sep 2012 22:37:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=J89l6R4vM6fHrUzfFdcoyjswSaX9USGvRtuX4fIKFjY=; b=Nu3uwvwkNWEQwDZl+jfLwJbI9/01U+nQdbTp9d3kQFQOq1sQwLkq28c9gtfsz8n2y1 569zwjrqhb4LzLCyDfE/J/3D/lmnFop7Rf7mEhgXL/5BNcJKpadtKiTWtUu+QngM5DI7 CYacCQ07iXIdQQTZG5LR4EpZtBuys8HJvramztUc2fnI3/Hgx8iTHkh1+RrGsdcfGf65 pbOdCRHNPqXEOXYSmWFQkjj/PIdnyrO4kRwF1dWNKQEbbG/s5kZBZAMnDZrrrKd6RDVZ 2I9O6DiTIbgWO6nXyaoh5ZpoiHL3cnREFSeE4SQOsNNGUOXq22KEpQhuXYYVlyYwXdEy OVdg== Received: by 10.68.234.7 with SMTP id ua7mr20703507pbc.91.1347860238718; Sun, 16 Sep 2012 22:37:18 -0700 (PDT) Received: from S2101-09.ap.freescale.net ([221.225.141.190]) by mx.google.com with ESMTPS id it6sm6386097pbc.14.2012.09.16.22.37.14 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 16 Sep 2012 22:37:17 -0700 (PDT) From: Shawn Guo To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 31/34] ARM: imx: move debug macros to include/debug Date: Mon, 17 Sep 2012 13:35:00 +0800 Message-Id: <1347860103-4141-32-git-send-email-shawn.guo@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1347860103-4141-1-git-send-email-shawn.guo@linaro.org> References: <1347860103-4141-1-git-send-email-shawn.guo@linaro.org> X-Gm-Message-State: ALoCoQn17TDZ7ulE/+RQ6uxx3g/5HWsZHp9kKG+s4i2FaJ0ZxJef2an1MLh7s4RlETsVRXeWgPGd 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 [209.85.160.49 listed in list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Fabio Estevam , Sascha Hauer , Shawn Guo , Arnd Bergmann , Rob Herring X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list 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+incoming-imx=patchwork.ozlabs.org@lists.infradead.org List-Id: linux-imx-kernel.lists.patchwork.ozlabs.org Move imx debug-macro.S over to common debug macro directory. It removes the inclusion to hardware.h by hard-coding the physical address of uart port and copying IMX_IO_P2V from hardware.h. Since we will need a common solution, which might use a fixed virtual address for uart port across platforms, we make a copy of IMX_IO_P2V here as a temporary solution to enable low-level debug for imx multi-platform build. Signed-off-by: Shawn Guo --- arch/arm/Kconfig.debug | 8 +++++ .../mach/debug-macro.S => include/debug/imx.S} | 33 +++++++++++++------- 2 files changed, 30 insertions(+), 11 deletions(-) rename arch/arm/{mach-imx/include/mach/debug-macro.S => include/debug/imx.S} (59%) diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug index 55f3c8a..ffd9b0c 100644 --- a/arch/arm/Kconfig.debug +++ b/arch/arm/Kconfig.debug @@ -412,6 +412,14 @@ endchoice config DEBUG_LL_INCLUDE string default "debug/icedcc.S" if DEBUG_ICEDCC + default "debug/imx.S" if DEBUG_IMX1_UART || \ + DEBUG_IMX25_UART || \ + DEBUG_IMX21_IMX27_UART || \ + DEBUG_IMX31_IMX35_UART || \ + DEBUG_IMX51_UART || \ + DEBUG_IMX50_IMX53_UART ||\ + DEBUG_IMX6Q_UART2 || \ + DEBUG_IMX6Q_UART4 default "debug/highbank.S" if DEBUG_HIGHBANK_UART default "debug/mvebu.S" if DEBUG_MVEBU_UART default "debug/picoxcell.S" if DEBUG_PICOXCELL_UART diff --git a/arch/arm/mach-imx/include/mach/debug-macro.S b/arch/arm/include/debug/imx.S similarity index 59% rename from arch/arm/mach-imx/include/mach/debug-macro.S rename to arch/arm/include/debug/imx.S index 761e45f..0b65d79 100644 --- a/arch/arm/mach-imx/include/mach/debug-macro.S +++ b/arch/arm/include/debug/imx.S @@ -10,27 +10,38 @@ * published by the Free Software Foundation. * */ -#include - #ifdef CONFIG_DEBUG_IMX1_UART -#define UART_PADDR MX1_UART1_BASE_ADDR +#define UART_PADDR 0x00206000 #elif defined (CONFIG_DEBUG_IMX25_UART) -#define UART_PADDR MX25_UART1_BASE_ADDR +#define UART_PADDR 0x43f90000 #elif defined (CONFIG_DEBUG_IMX21_IMX27_UART) -#define UART_PADDR MX2x_UART1_BASE_ADDR +#define UART_PADDR 0x1000a000 #elif defined (CONFIG_DEBUG_IMX31_IMX35_UART) -#define UART_PADDR MX3x_UART1_BASE_ADDR +#define UART_PADDR 0x43f90000 #elif defined (CONFIG_DEBUG_IMX51_UART) -#define UART_PADDR MX51_UART1_BASE_ADDR +#define UART_PADDR 0x73fbc000 #elif defined (CONFIG_DEBUG_IMX50_IMX53_UART) -#define UART_PADDR MX53_UART1_BASE_ADDR +#define UART_PADDR 0x53fbc000 #elif defined (CONFIG_DEBUG_IMX6Q_UART2) -#define UART_PADDR MX6Q_UART2_BASE_ADDR +#define UART_PADDR 0x021e8000 #elif defined (CONFIG_DEBUG_IMX6Q_UART4) -#define UART_PADDR MX6Q_UART4_BASE_ADDR +#define UART_PADDR 0x021f0000 #endif -#define UART_VADDR IMX_IO_ADDRESS(UART_PADDR) +/* + * FIXME: This is a copy of IMX_IO_P2V in hardware.h, and needs to + * stay sync with that. It's hard to maintain, and should be fixed + * globally for multi-platform build to use a fixed virtual address + * for low-level debug uart port across platforms. + */ +#define IMX_IO_P2V(x) ( \ + (((x) & 0x80000000) >> 7) | \ + (0xf4000000 + \ + (((x) & 0x50000000) >> 6) + \ + (((x) & 0x0b000000) >> 4) + \ + (((x) & 0x000fffff)))) + +#define UART_VADDR IMX_IO_P2V(UART_PADDR) .macro addruart, rp, rv, tmp ldr \rp, =UART_PADDR @ physical