From e3e04b3858ba1905d7824285798427e4842f909f Mon Sep 17 00:00:00 2001
From: z3deverp <z3@vmsv-debian.(none)>
Date: Wed, 18 Jun 2008 11:37:06 +0900
Subject: [PATCH] pxa:Select output port for zImage progress message

---
 arch/arm/mach-pxa/Kconfig             |   35 +++++++++++++++++++++++++++++++++
 include/asm-arm/arch-pxa/uncompress.h |   30 ++++++++++++++++++++++++++++
 2 files changed, 65 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-pxa/Kconfig b/arch/arm/mach-pxa/Kconfig
index 656d496..ac01c3a 100644
--- a/arch/arm/mach-pxa/Kconfig
+++ b/arch/arm/mach-pxa/Kconfig
@@ -180,4 +180,39 @@ config PXA_SSP
 	tristate
 	help
 	  Enable support for PXA2xx SSP ports
+
+choice
+	prompt "zImage progress message"
+	default ZIMAGE_MSG_FFUART
+	help
+	  Select port to output progress message at decompress kernel.
+
+config ZIMAGE_MSG_FFUART
+	bool "Output to FFUART"
+	help
+	  Support for FFUART to output progress message at decompress kernel.
+
+config ZIMAGE_MSG_BTUART
+	bool "Output to BTUART"
+	help
+	  Support for BTUART to output progress message at decompress kernel.
+
+config ZIMAGE_MSG_STUART
+	bool "Output to STUART"
+	help
+	  Support for STUART to output progress message at decompress kernel.
+
+config ZIMAGE_MSG_HWUART
+	bool "Output to HWUART"
+	help
+	  Support for HWUART to output progress message at decompress kernel.
+
+config ZIMAGE_MSG_NONE
+	bool "Silence, no output"
+	help
+	  Silence progress at decompress kernel.
+	  Choice this, if system has no terminals at startup.
+
+endchoice
+
 endif
diff --git a/include/asm-arm/arch-pxa/uncompress.h b/include/asm-arm/arch-pxa/uncompress.h
index 178aa2e..e9c31f7 100644
--- a/include/asm-arm/arch-pxa/uncompress.h
+++ b/include/asm-arm/arch-pxa/uncompress.h
@@ -14,9 +14,37 @@
 #define STUART		((volatile unsigned long *)0x40700000)
 #define HWUART		((volatile unsigned long *)0x41600000)
 
+
+#ifdef CONFIG_ZIMAGE_MSG_FFUART
 #define UART		FFUART
+#endif
+#ifdef CONFIG_ZIMAGE_MSG_BTUART
+#define UART		BTUART
+#endif
+#ifdef CONFIG_ZIMAGE_MSG_STUART
+#define UART		STUART
+#endif
+#ifdef CONFIG_ZIMAGE_MSG_HWUART
+#define UART		HWUART
+#endif
+#ifdef CONFIG_ZIMAGE_MSG_NONE
+#define UART		/* not use */
+#endif
+
+#ifndef UART
+#define UART		FFUART	/* compatible with older */
+#endif
+
 
+#ifdef CONFIG_ZIMAGE_MSG_NONE
 
+/* Silence progress at decompress kernel */
+#define	putc(c)		/* no operation, ignore parameter 'c' */
+#define	flush()		/* no operation */
+
+#else	/* !CONFIG_ZIMAGE_MSG_NONE */
+
+/* Output progress message to terminal at decompress kernel */
 static inline void putc(char c)
 {
 	while (!(UART[5] & 0x20))
@@ -31,6 +59,8 @@ static inline void flush(void)
 {
 }
 
+#endif	/* CONFIG_ZIMAGE_MSG_NONE */
+
 /*
  * nothing to do
  */
-- 
1.4.4.4

