From patchwork Wed Mar 13 03:18:35 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shawn Guo X-Patchwork-Id: 2260811 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 85981DF23A for ; Wed, 13 Mar 2013 03:22:25 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UFcDR-0003UJ-DG; Wed, 13 Mar 2013 03:18:57 +0000 Received: from co1ehsobe003.messaging.microsoft.com ([216.32.180.186] helo=co1outboundpool.messaging.microsoft.com) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UFcDN-0003U0-LL for linux-arm-kernel@lists.infradead.org; Wed, 13 Mar 2013 03:18:54 +0000 Received: from mail146-co1-R.bigfish.com (10.243.78.244) by CO1EHSOBE028.bigfish.com (10.243.66.91) with Microsoft SMTP Server id 14.1.225.23; Wed, 13 Mar 2013 03:18:51 +0000 Received: from mail146-co1 (localhost [127.0.0.1]) by mail146-co1-R.bigfish.com (Postfix) with ESMTP id 1B4DEC01CD; Wed, 13 Mar 2013 03:18:51 +0000 (UTC) X-Forefront-Antispam-Report: CIP:70.37.183.190; KIP:(null); UIP:(null); IPV:NLI; H:mail.freescale.net; RD:none; EFVD:NLI X-SpamScore: 0 X-BigFish: VS0(zzzz1f42h1ee6h1de0h1202h1e76h1d1ah1d2ahzz8275ch8275dh8275bhz2dh87h2a8h668h839hd24he5bhf0ah1288h12a5h12a9h12bdh12e5h137ah139eh13b6h1441h1504h1537h162dh1631h1758h1898h18e1h1946h19b5h1ad9h1b0ah1155h) X-FB-DOMAIN-IP-MATCH: fail Received: from mail146-co1 (localhost.localdomain [127.0.0.1]) by mail146-co1 (MessageSwitch) id 1363144690794350_3472; Wed, 13 Mar 2013 03:18:10 +0000 (UTC) Received: from CO1EHSMHS003.bigfish.com (unknown [10.243.78.251]) by mail146-co1.bigfish.com (Postfix) with ESMTP id B5C0D6005B; Wed, 13 Mar 2013 03:18:10 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by CO1EHSMHS003.bigfish.com (10.243.66.13) with Microsoft SMTP Server (TLS) id 14.1.225.23; Wed, 13 Mar 2013 03:18:10 +0000 Received: from tx30smr01.am.freescale.net (10.81.153.31) by 039-SN1MMR1-005.039d.mgd.msft.net (10.84.1.17) with Microsoft SMTP Server (TLS) id 14.2.328.11; Wed, 13 Mar 2013 03:18:09 +0000 Received: from S2101-09.ap.freescale.net ([10.192.185.219]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id r2D3I5h7013437; Tue, 12 Mar 2013 20:18:06 -0700 From: Shawn Guo To: Russell King Subject: [PATCH v5 2/2] ARM: uncompress debug support for multiplatform build Date: Wed, 13 Mar 2013 11:18:35 +0800 Message-ID: <1363144715-12002-1-git-send-email-shawn.guo@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1363001737-8745-3-git-send-email-shawn.guo@linaro.org> References: <1363001737-8745-3-git-send-email-shawn.guo@linaro.org> MIME-Version: 1.0 X-OriginatorOrg: sigmatel.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130312_231853_863319_6BD22F92 X-CRM114-Status: GOOD ( 13.55 ) 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 [216.32.180.186 listed in list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Tony Lindgren , Shawn Guo , arm@kernel.org, linux-arm-kernel@lists.infradead.org, Stephen Warren X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 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 Instead of giving zero support of uncompress debug for multiplatform build, the patch turns uncompress debug into one part of DEBUG_LL support. When DEBUG_LL is turned on for a particular platform, uncompress debug works too for that platform. OMAP and Tegra are exceptions here. OMAP low-level debug code places data in the .data section, and that is not allowed in decompressor. And Tegra code has reference to variable that's unavailable in decompressor but only in kernel. That's why Kconfig symbol DEBUG_UNCOMPRESS controlling multiplatform uncompress debug support is defined with !DEBUG_OMAP2PLUS_UART && !DEBUG_TEGRA_UART. It creates arch/arm/boot/compressed/debug.S with CONFIG_DEBUG_LL_INCLUDE included there, implements a generic putc() using those macros, which will be built when DEBUG_UNCOMPRESS is defined. Signed-off-by: Shawn Guo Acked-by: Olof Johansson Acked-by: Tony Lindgren Acked-by: Arnd Bergmann --- Changes since v4: - Mark DEBUG_TEGRA_UART as another exception, as the debug code refers to tegra_uart_config which is only accessible in kernel. arch/arm/Kconfig.debug | 6 ++++++ arch/arm/boot/compressed/Makefile | 3 +++ arch/arm/boot/compressed/debug.S | 12 ++++++++++++ arch/arm/include/debug/uncompress.h | 4 ++++ 4 files changed, 25 insertions(+) create mode 100644 arch/arm/boot/compressed/debug.S diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug index fc54a5b..7aa30e4 100644 --- a/arch/arm/Kconfig.debug +++ b/arch/arm/Kconfig.debug @@ -601,6 +601,12 @@ config DEBUG_LL_INCLUDE default "debug/zynq.S" if DEBUG_ZYNQ_UART0 || DEBUG_ZYNQ_UART1 default "mach/debug-macro.S" +config DEBUG_UNCOMPRESS + bool + default y if ARCH_MULTIPLATFORM && DEBUG_LL && \ + !DEBUG_OMAP2PLUS_UART && \ + !DEBUG_TEGRA_UART + config UNCOMPRESS_INCLUDE string default "debug/uncompress.h" if ARCH_MULTIPLATFORM diff --git a/arch/arm/boot/compressed/Makefile b/arch/arm/boot/compressed/Makefile index 5cad8a6..e3238bc 100644 --- a/arch/arm/boot/compressed/Makefile +++ b/arch/arm/boot/compressed/Makefile @@ -24,6 +24,9 @@ endif AFLAGS_head.o += -DTEXT_OFFSET=$(TEXT_OFFSET) HEAD = head.o OBJS += misc.o decompress.o +ifeq ($(CONFIG_DEBUG_UNCOMPRESS),y) +OBJS += debug.o +endif FONTC = $(srctree)/drivers/video/console/font_acorn_8x8.c # string library code (-Os is enforced to keep it much smaller) diff --git a/arch/arm/boot/compressed/debug.S b/arch/arm/boot/compressed/debug.S new file mode 100644 index 0000000..6e8382d --- /dev/null +++ b/arch/arm/boot/compressed/debug.S @@ -0,0 +1,12 @@ +#include +#include + +#include CONFIG_DEBUG_LL_INCLUDE + +ENTRY(putc) + addruart r1, r2, r3 + waituart r3, r1 + senduart r0, r1 + busyuart r3, r1 + mov pc, lr +ENDPROC(putc) diff --git a/arch/arm/include/debug/uncompress.h b/arch/arm/include/debug/uncompress.h index e19955d..0e2949b 100644 --- a/arch/arm/include/debug/uncompress.h +++ b/arch/arm/include/debug/uncompress.h @@ -1,3 +1,7 @@ +#ifdef CONFIG_DEBUG_UNCOMPRESS +extern void putc(int c); +#else static inline void putc(int c) {} +#endif static inline void flush(void) {} static inline void arch_decomp_setup(void) {}