diff mbox

[v2,1/3] ARM: EXYNOS: uncompress - print debug messages if DEBUG_LL is defined

Message ID 1370319552-17694-2-git-send-email-tushar.behera@linaro.org
State Accepted
Commit 437d8ac510b90610da814ae25a7b79aaf3b4910f
Headers show

Commit Message

Tushar Behera June 4, 2013, 4:19 a.m. UTC
Printing low-level debug messages make an assumption that the specified
UART port has been preconfigured by the bootloader. Incorrectly
specified UART port results in system getting stalled while printing the
message "Uncompressing Linux... done, booting the kernel"
This UART port number is specified through S3C_LOWLEVEL_UART_PORT. Since
the UART port might different for different board, it is not possible to
specify it correctly for every board that use a common defconfig file.

Calling this print subroutine only when DEBUG_LL fixes the problem. By
disabling DEBUG_LL in default config file, we would be able to boot
multiple boards with different default UART ports.

With this current approach, we miss the print "Uncompressing Linux...
done, booting the kernel." when DEBUG_LL is not defined.

Signed-off-by: Tushar Behera <tushar.behera@linaro.org>
---
Change for v2:
* Instead of checking value of uart_base, now check if DEBUG_LL
is enabled. This removes the ifdef's from mach/uncompress.h


 arch/arm/plat-samsung/include/plat/uncompress.h |   10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

Comments

Tushar Behera June 6, 2013, 9:07 a.m. UTC | #1
On 06/04/2013 09:49 AM, Tushar Behera wrote:
> Printing low-level debug messages make an assumption that the specified
> UART port has been preconfigured by the bootloader. Incorrectly
> specified UART port results in system getting stalled while printing the
> message "Uncompressing Linux... done, booting the kernel"
> This UART port number is specified through S3C_LOWLEVEL_UART_PORT. Since
> the UART port might different for different board, it is not possible to
> specify it correctly for every board that use a common defconfig file.
> 
> Calling this print subroutine only when DEBUG_LL fixes the problem. By
> disabling DEBUG_LL in default config file, we would be able to boot
> multiple boards with different default UART ports.
> 
> With this current approach, we miss the print "Uncompressing Linux...
> done, booting the kernel." when DEBUG_LL is not defined.
> 
> Signed-off-by: Tushar Behera <tushar.behera@linaro.org>
> ---
> Change for v2:
> * Instead of checking value of uart_base, now check if DEBUG_LL
> is enabled. This removes the ifdef's from mach/uncompress.h
> 
> 
>  arch/arm/plat-samsung/include/plat/uncompress.h |   10 +++++++++-
>  1 file changed, 9 insertions(+), 1 deletion(-)
> 

If there are no concerns, would it be possible to queue this patch [1/3]
for 3.10?

The other two patches can wait for 3.11.
Olof Johansson June 8, 2013, 1:09 a.m. UTC | #2
On Thu, Jun 06, 2013 at 02:37:01PM +0530, Tushar Behera wrote:
> On 06/04/2013 09:49 AM, Tushar Behera wrote:
> > Printing low-level debug messages make an assumption that the specified
> > UART port has been preconfigured by the bootloader. Incorrectly
> > specified UART port results in system getting stalled while printing the
> > message "Uncompressing Linux... done, booting the kernel"
> > This UART port number is specified through S3C_LOWLEVEL_UART_PORT. Since
> > the UART port might different for different board, it is not possible to
> > specify it correctly for every board that use a common defconfig file.
> > 
> > Calling this print subroutine only when DEBUG_LL fixes the problem. By
> > disabling DEBUG_LL in default config file, we would be able to boot
> > multiple boards with different default UART ports.
> > 
> > With this current approach, we miss the print "Uncompressing Linux...
> > done, booting the kernel." when DEBUG_LL is not defined.
> > 
> > Signed-off-by: Tushar Behera <tushar.behera@linaro.org>
> > ---
> > Change for v2:
> > * Instead of checking value of uart_base, now check if DEBUG_LL
> > is enabled. This removes the ifdef's from mach/uncompress.h
> > 
> > 
> >  arch/arm/plat-samsung/include/plat/uncompress.h |   10 +++++++++-
> >  1 file changed, 9 insertions(+), 1 deletion(-)
> > 
> 
> If there are no concerns, would it be possible to queue this patch [1/3]
> for 3.10?
> 
> The other two patches can wait for 3.11.

Sure, I've applied it to fixes for 3.10.


-Olof
diff mbox

Patch

diff --git a/arch/arm/plat-samsung/include/plat/uncompress.h b/arch/arm/plat-samsung/include/plat/uncompress.h
index 438b248..02b66d7 100644
--- a/arch/arm/plat-samsung/include/plat/uncompress.h
+++ b/arch/arm/plat-samsung/include/plat/uncompress.h
@@ -66,6 +66,9 @@  uart_rd(unsigned int reg)
 
 static void putc(int ch)
 {
+	if (!config_enabled(CONFIG_DEBUG_LL))
+		return;
+
 	if (uart_rd(S3C2410_UFCON) & S3C2410_UFCON_FIFOMODE) {
 		int level;
 
@@ -118,7 +121,12 @@  static void arch_decomp_error(const char *x)
 #ifdef CONFIG_S3C_BOOT_UART_FORCE_FIFO
 static inline void arch_enable_uart_fifo(void)
 {
-	u32 fifocon = uart_rd(S3C2410_UFCON);
+	u32 fifocon;
+
+	if (!config_enabled(CONFIG_DEBUG_LL))
+		return;
+
+	fifocon = uart_rd(S3C2410_UFCON);
 
 	if (!(fifocon & S3C2410_UFCON_FIFOMODE)) {
 		fifocon |= S3C2410_UFCON_RESETBOTH;