From patchwork Fri May 31 11:49:02 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tushar Behera X-Patchwork-Id: 17359 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yh0-f69.google.com (mail-yh0-f69.google.com [209.85.213.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 86C6925DFA for ; Fri, 31 May 2013 12:03:14 +0000 (UTC) Received: by mail-yh0-f69.google.com with SMTP id z20sf1784184yhz.8 for ; Fri, 31 May 2013 05:03:14 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-beenthere:x-forwarded-to:x-forwarded-for :delivered-to:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references:x-gm-message-state:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-google-group-id:list-post:list-help:list-archive:list-unsubscribe; bh=8FfSeQDR4pqTRO0rBIke60/SCiZO0gn/clssMgTbSIU=; b=fFeD9VT8oAMqouEtZWenRzLVN5z/2Kjwf3g/A8gzVNcxVPoxxVoqM9yqH2Pjj73qMf mG4acvDH+PG+35ldyhPbLMaXBnd8JGRt91mZXcN9gfA/rUf+pMe78iTPAS46+qF0WQEs cQO2qyYz3bnB3fm8bpeNngMacqAujrjz7y+LJHSfp07tUylhR4QYi8HC7DQkbK4vNI40 WJUPnnwv4S1tdBY6YzTLK91BRXfBqwEGOO25J2aARjWQzyMthgD42KNS5bx9BsRdxis0 uV97KEiY9Cf+W/KvjXerL/FI8X4YkNkviqSwtyJpxC0vErTmZ26mhmH1CdKGAgvivPh1 q2YA== X-Received: by 10.52.92.197 with SMTP id co5mr3617011vdb.3.1370001794301; Fri, 31 May 2013 05:03:14 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.12.143 with SMTP id y15ls874753qeb.82.gmail; Fri, 31 May 2013 05:03:14 -0700 (PDT) X-Received: by 10.52.18.137 with SMTP id w9mr8384583vdd.50.1370001794106; Fri, 31 May 2013 05:03:14 -0700 (PDT) Received: from mail-vb0-x230.google.com (mail-vb0-x230.google.com [2607:f8b0:400c:c02::230]) by mx.google.com with ESMTPS id l10si28199240vet.1.2013.05.31.05.03.14 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 31 May 2013 05:03:14 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400c:c02::230 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=2607:f8b0:400c:c02::230; Received: by mail-vb0-f48.google.com with SMTP id w8so963496vbf.35 for ; Fri, 31 May 2013 05:03:14 -0700 (PDT) X-Received: by 10.52.69.200 with SMTP id g8mr8384077vdu.4.1370001793981; Fri, 31 May 2013 05:03:13 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.229.199 with SMTP id jj7csp47129vcb; Fri, 31 May 2013 05:03:13 -0700 (PDT) X-Received: by 10.68.193.138 with SMTP id ho10mr12567291pbc.163.1370001793040; Fri, 31 May 2013 05:03:13 -0700 (PDT) Received: from mail-pb0-x22b.google.com (mail-pb0-x22b.google.com [2607:f8b0:400e:c01::22b]) by mx.google.com with ESMTPS id yu7si32940061pac.44.2013.05.31.05.03.12 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 31 May 2013 05:03:13 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400e:c01::22b is neither permitted nor denied by best guess record for domain of tushar.behera@linaro.org) client-ip=2607:f8b0:400e:c01::22b; Received: by mail-pb0-f43.google.com with SMTP id ma3so2102305pbc.2 for ; Fri, 31 May 2013 05:03:12 -0700 (PDT) X-Received: by 10.66.20.66 with SMTP id l2mr12956455pae.205.1370001792647; Fri, 31 May 2013 05:03:12 -0700 (PDT) Received: from linaro.sisodomain.com ([115.113.119.130]) by mx.google.com with ESMTPSA id ag4sm46445160pbc.20.2013.05.31.05.03.08 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 31 May 2013 05:03:12 -0700 (PDT) From: Tushar Behera To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org Cc: arnd@arndb.de, kgene.kim@samsung.com, olof@lixom.net, patches@linaro.org Subject: [PATCH 1/3] ARM: EXYNOS: uncompress - print debug messages if DEBUG_LL is defined Date: Fri, 31 May 2013 17:19:02 +0530 Message-Id: <1370000944-19786-2-git-send-email-tushar.behera@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1370000944-19786-1-git-send-email-tushar.behera@linaro.org> References: <1370000944-19786-1-git-send-email-tushar.behera@linaro.org> X-Gm-Message-State: ALoCoQnF1+g02mzvoiWEHDFR23rcaCfk077wRb9/ftvStK3Or4aYXaDMrCDpoxYhu/SvPmwMxhfM X-Original-Sender: tushar.behera@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:400c:c02::230 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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 --- arch/arm/mach-exynos/include/mach/uncompress.h | 11 ++++++++--- arch/arm/plat-samsung/include/plat/uncompress.h | 10 +++++++++- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/arch/arm/mach-exynos/include/mach/uncompress.h b/arch/arm/mach-exynos/include/mach/uncompress.h index 2979995..730f69f 100644 --- a/arch/arm/mach-exynos/include/mach/uncompress.h +++ b/arch/arm/mach-exynos/include/mach/uncompress.h @@ -37,11 +37,16 @@ static void arch_detect_cpu(void) chip_id >>= 20; chip_id &= 0xf; +#ifdef CONFIG_DEBUG_LL if (chip_id == 0x5) - uart_base = (volatile u8 *)EXYNOS5_PA_UART + (S3C_UART_OFFSET * CONFIG_S3C_LOWLEVEL_UART_PORT); + uart_base = (volatile u8 *)EXYNOS5_PA_UART + + (S3C_UART_OFFSET * CONFIG_S3C_LOWLEVEL_UART_PORT); else - uart_base = (volatile u8 *)EXYNOS4_PA_UART + (S3C_UART_OFFSET * CONFIG_S3C_LOWLEVEL_UART_PORT); - + uart_base = (volatile u8 *)EXYNOS4_PA_UART + + (S3C_UART_OFFSET * CONFIG_S3C_LOWLEVEL_UART_PORT); +#else + uart_base = NULL; +#endif /* * For preventing FIFO overrun or infinite loop of UART console, * fifo_max should be the minimum fifo size of all of the UART channels diff --git a/arch/arm/plat-samsung/include/plat/uncompress.h b/arch/arm/plat-samsung/include/plat/uncompress.h index 438b248..350032b 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 (!uart_base) + 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 (!uart_base) + return; + + fifocon = uart_rd(S3C2410_UFCON); if (!(fifocon & S3C2410_UFCON_FIFOMODE)) { fifocon |= S3C2410_UFCON_RESETBOTH;