From patchwork Thu Sep 20 06:45:43 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shawn Guo X-Patchwork-Id: 1482961 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 8A8FDDF2D2 for ; Thu, 20 Sep 2012 07:05:08 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TEamC-0003a2-Tt; Thu, 20 Sep 2012 07:02:22 +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 1TEaYF-0001vN-47 for linux-arm-kernel@lists.infradead.org; Thu, 20 Sep 2012 06:47:57 +0000 Received: by mail-pb0-f49.google.com with SMTP id rq8so4539723pbb.36 for ; Wed, 19 Sep 2012 23:47:54 -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=UApONboxe1LshAt93Y5Xob+JE8dGC5LfMXxu9ttXuCs=; b=E6phLnCk6zaxuLfAxus4FcPYFUMg/dYlpzhAb/y09z7pVLWn5v4TAJtbW7qHvPts0b QCxLMvWx/30Q01KxpTQAh6/YE9Y3xkNjxZ/OW1n+Kc1v4q8f5y8jIhm9bm6tSGCBBtJR yfcgTyNykIvXDr7PRvk7HkLIwXUMkhRUZCGSukNSVBidbb5/r+HZc8fhtecC/bTaS5h0 9ugba5L+xDXjJln5+XusTGVyfBuuu/Lf/PYuiKaRaLWqGXjk6kDZ9Iq47kjV9vaSWvXV hjS+c+oYXySVOrfyZGucvjhixeNJAxvsRGu8fZVxanwzk7b/TyjtDs5Xb0PmGdrLNlKi 89Qg== Received: by 10.66.79.36 with SMTP id g4mr2886837pax.67.1348123674842; Wed, 19 Sep 2012 23:47:54 -0700 (PDT) Received: from S2101-09.ap.freescale.net ([114.216.234.161]) by mx.google.com with ESMTPS id wn1sm3057024pbc.57.2012.09.19.23.47.51 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 19 Sep 2012 23:47:53 -0700 (PDT) From: Shawn Guo To: linux-arm-kernel@lists.infradead.org Subject: [PATCH v2 30/34] ARM: imx: move debug macros to include/debug Date: Thu, 20 Sep 2012 14:45:43 +0800 Message-Id: <1348123547-31082-31-git-send-email-shawn.guo@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1348123547-31082-1-git-send-email-shawn.guo@linaro.org> References: <1348123547-31082-1-git-send-email-shawn.guo@linaro.org> X-Gm-Message-State: ALoCoQmqokR02CBY+wCtHRu9xjZUsZUREsbXv5YXAojjUpKBBtvmWJ7Vtq9iPFH6j3fR94/zzwMh 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: Sascha Hauer , Shawn Guo , Arnd Bergmann , Javier Martin , Rob Herring 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 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 Acked-by: Sascha Hauer Acked-by: Arnd Bergmann --- 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 a7eb282..c813a05 100644 --- a/arch/arm/Kconfig.debug +++ b/arch/arm/Kconfig.debug @@ -398,6 +398,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