From patchwork Tue Sep 25 22:46:50 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Warren X-Patchwork-Id: 1506701 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id 4B67A40079 for ; Tue, 25 Sep 2012 22:49:18 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TGduD-0005Da-F5; Tue, 25 Sep 2012 22:47:05 +0000 Received: from avon.wwwdotorg.org ([2001:470:1f0f:bd7::2]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1TGdu7-0005Cw-Q9 for linux-arm-kernel@lists.infradead.org; Tue, 25 Sep 2012 22:47:01 +0000 Received: from severn.wwwdotorg.org (unknown [192.168.65.5]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by avon.wwwdotorg.org (Postfix) with ESMTPS id BFCE562E1; Tue, 25 Sep 2012 16:47:49 -0600 (MDT) Received: from localhost.localdomain (localhost [127.0.0.1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by severn.wwwdotorg.org (Postfix) with ESMTPSA id A546CE4780; Tue, 25 Sep 2012 16:46:57 -0600 (MDT) From: Stephen Warren To: Arnd Bergmann , Olof Johansson , Russell King , Rob Herring Subject: [RFC PATCH 1/3] ARM: move ICEDCC uncompress.h to common location Date: Tue, 25 Sep 2012 16:46:50 -0600 Message-Id: <1348613212-21897-2-git-send-email-swarren@wwwdotorg.org> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <1348613212-21897-1-git-send-email-swarren@wwwdotorg.org> References: <1348613212-21897-1-git-send-email-swarren@wwwdotorg.org> X-NVConfidentiality: public X-Virus-Scanned: clamav-milter 0.96.5 at avon.wwwdotorg.org X-Virus-Status: Clean X-Spam-Note: CRM114 invocation failed X-Spam-Score: -2.7 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record -0.8 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: linux-tegra@vger.kernel.org, Russell King , Stephen Warren , Rob Herring , linux-arm-kernel@lists.infradead.org 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 From: Stephen Warren Create a common location for uncompress.h, and select the included debug macro file using config option. This does the same for uncompress.h as a recent patch for debug-macro.S, which was based on a suggestion by Russell King and implemented by Rob Herring. Cc: Rob Herring Cc: Russell King Signed-off-by: Stephen Warren --- arch/arm/Kconfig.debug | 10 ++++ arch/arm/boot/compressed/misc.c | 64 +--------------------------- arch/arm/include/debug/icedcc-uncompress.h | 61 ++++++++++++++++++++++++++ arch/arm/include/debug/none-uncompress.h | 3 + 4 files changed, 75 insertions(+), 63 deletions(-) create mode 100644 arch/arm/include/debug/icedcc-uncompress.h create mode 100644 arch/arm/include/debug/none-uncompress.h diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug index b0f3857..0daec3d 100644 --- a/arch/arm/Kconfig.debug +++ b/arch/arm/Kconfig.debug @@ -420,6 +420,16 @@ config DEBUG_LL_INCLUDE DEBUG_VEXPRESS_UART0_CA9 || DEBUG_VEXPRESS_UART0_RS1 default "mach/debug-macro.S" +config UNCOMPRESS_INCLUDE + string + default "debug/icedcc-uncompress.h" if DEBUG_ICEDCC + default "debug/none-uncompress.h" if ARCH_MULTIPLATFORM || \ + DEBUG_HIGHBANK_UART || DEBUG_MVEBU_UART || \ + DEBUG_PICOXCELL_UART || DEBUG_SOCFPGA_UART || \ + DEBUG_VEXPRESS_UART0_DETECT || DEBUG_VEXPRESS_UART0_CA9 || \ + DEBUG_VEXPRESS_UART0_RS1 + default "mach/uncompress.h" + config EARLY_PRINTK bool "Early printk" depends on DEBUG_LL diff --git a/arch/arm/boot/compressed/misc.c b/arch/arm/boot/compressed/misc.c index df89983..afbdb3f 100644 --- a/arch/arm/boot/compressed/misc.c +++ b/arch/arm/boot/compressed/misc.c @@ -25,69 +25,7 @@ unsigned int __machine_arch_type; static void putstr(const char *ptr); extern void error(char *x); -#ifdef CONFIG_ARCH_MULTIPLATFORM -static inline void putc(int c) {} -static inline void flush(void) {} -static inline void arch_decomp_setup(void) {} -#else -#include -#endif - -#ifdef CONFIG_DEBUG_ICEDCC - -#if defined(CONFIG_CPU_V6) || defined(CONFIG_CPU_V6K) || defined(CONFIG_CPU_V7) - -static void icedcc_putc(int ch) -{ - int status, i = 0x4000000; - - do { - if (--i < 0) - return; - - asm volatile ("mrc p14, 0, %0, c0, c1, 0" : "=r" (status)); - } while (status & (1 << 29)); - - asm("mcr p14, 0, %0, c0, c5, 0" : : "r" (ch)); -} - - -#elif defined(CONFIG_CPU_XSCALE) - -static void icedcc_putc(int ch) -{ - int status, i = 0x4000000; - - do { - if (--i < 0) - return; - - asm volatile ("mrc p14, 0, %0, c14, c0, 0" : "=r" (status)); - } while (status & (1 << 28)); - - asm("mcr p14, 0, %0, c8, c0, 0" : : "r" (ch)); -} - -#else - -static void icedcc_putc(int ch) -{ - int status, i = 0x4000000; - - do { - if (--i < 0) - return; - - asm volatile ("mrc p14, 0, %0, c0, c0, 0" : "=r" (status)); - } while (status & 2); - - asm("mcr p14, 0, %0, c1, c0, 0" : : "r" (ch)); -} - -#endif - -#define putc(ch) icedcc_putc(ch) -#endif +#include CONFIG_UNCOMPRESS_INCLUDE static void putstr(const char *ptr) { diff --git a/arch/arm/include/debug/icedcc-uncompress.h b/arch/arm/include/debug/icedcc-uncompress.h new file mode 100644 index 0000000..b505241 --- /dev/null +++ b/arch/arm/include/debug/icedcc-uncompress.h @@ -0,0 +1,61 @@ +/* + * Decompressor debug output routines for ICEDCC + * + * Extracted from misc.c, which is by: + * Modified for ARM Linux by Russell King + * Nicolas Pitre + */ + +#if defined(CONFIG_CPU_V6) || defined(CONFIG_CPU_V6K) || defined(CONFIG_CPU_V7) + +static void putc(int ch) +{ + int status, i = 0x4000000; + + do { + if (--i < 0) + return; + + asm volatile ("mrc p14, 0, %0, c0, c1, 0" : "=r" (status)); + } while (status & (1 << 29)); + + asm("mcr p14, 0, %0, c0, c5, 0" : : "r" (ch)); +} + + +#elif defined(CONFIG_CPU_XSCALE) + +static void putc(int ch) +{ + int status, i = 0x4000000; + + do { + if (--i < 0) + return; + + asm volatile ("mrc p14, 0, %0, c14, c0, 0" : "=r" (status)); + } while (status & (1 << 28)); + + asm("mcr p14, 0, %0, c8, c0, 0" : : "r" (ch)); +} + +#else + +static void putc(int ch) +{ + int status, i = 0x4000000; + + do { + if (--i < 0) + return; + + asm volatile ("mrc p14, 0, %0, c0, c0, 0" : "=r" (status)); + } while (status & 2); + + asm("mcr p14, 0, %0, c1, c0, 0" : : "r" (ch)); +} + +#endif + +static inline void flush(void) {} +static inline void arch_decomp_setup(void) {} diff --git a/arch/arm/include/debug/none-uncompress.h b/arch/arm/include/debug/none-uncompress.h new file mode 100644 index 0000000..e19955d --- /dev/null +++ b/arch/arm/include/debug/none-uncompress.h @@ -0,0 +1,3 @@ +static inline void putc(int c) {} +static inline void flush(void) {} +static inline void arch_decomp_setup(void) {}