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: 2643101 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) by patchwork2.kernel.org (Postfix) with ESMTP id B84D1DFB79 for ; Fri, 31 May 2013 12:13:15 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UiOBe-0002cN-2C; Fri, 31 May 2013 12:12:03 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UiOAe-0008J3-3X; Fri, 31 May 2013 12:11:00 +0000 Received: from mail-pb0-x230.google.com ([2607:f8b0:400e:c01::230]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UiOAa-0008Hk-S0 for linux-arm-kernel@lists.infradead.org; Fri, 31 May 2013 12:10:57 +0000 Received: by mail-pb0-f48.google.com with SMTP id md4so2091820pbc.21 for ; Fri, 31 May 2013 05:10:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=8FfSeQDR4pqTRO0rBIke60/SCiZO0gn/clssMgTbSIU=; b=GZZbD2QhKrhFaJ5XRjQx+NGXeTTEEpuL1rWEo6R7N0RzY6ID6JAT/pgmXhcAYVc5r4 3b6Lok4hMd1ViNh5jnWid1rcpp0TmCb7vuXk+5Oy4yyEuC9SWRug98DKa/k83gxnPTEB cTCZ6laP3DVudMqAJXXHC3Tzr0x+oP3Chxnkq3m3LzMnx3cQgzOmTBhkRb6t4j31RW66 ItJu9yZZhSuY+ssFXSGQuHYp9vXPfyWOkEPOe5BXPke505u2lklD725X8yEnexgySVHM /hrrh7eA7HT4tGKQ1yst9l+KDiqCFcosa3uOP8riit9c1iV9P1C0RJDJd9niImjir9ig adWg== 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 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: ALoCoQmO6E8766n6t8NqlT92YohmkWVPVF34d4HUKZXOH2ck62TxgKOoUYVB1U91Cq8kDz1+/iVm X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130531_081056_988853_81CDD5D6 X-CRM114-Status: GOOD ( 16.59 ) X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: olof@lixom.net, kgene.kim@samsung.com, arnd@arndb.de, patches@linaro.org 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: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org 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;