* [PATCH] ARM: EXYNOS: Consolidate multiple low-level UART port definitions
@ 2013-05-30 4:40 Tushar Behera
2013-05-30 21:11 ` Olof Johansson
2013-05-31 18:20 ` Kevin Hilman
0 siblings, 2 replies; 5+ messages in thread
From: Tushar Behera @ 2013-05-30 4:40 UTC (permalink / raw)
To: linux-arm-kernel
There are two definitions for low-level UART ports for Exynos platform.
CONFIG_S3C_LOWLEVEL_UART_PORT is used for printing "Uncompressing
Linux... done, booting the kernel." and CONFIG_S3C_UART for other
low-level messages.
The assumption for both the uart ports is that they are pre-configured
in the bootloader. Since they are essentially the same always, it
would be good to consolidate them to use only one macro, in this case
'DEBUG_S3C_UART' would be a better option.
'DEBUG_S3C_UART' is defined only if DEBUG_LL is enabled. We can safely
disable this option when DEBUG_LL is not defined and we can boot various
boards with different UART port settings. Only drawback of this
approach is that when DEBUG_LL is not defined, we would be missing the
print "Uncompressing Linux... done, booting the kernel."
Since CONFIG_S3C_LOWLEVEL_UART_PORT is still used by other Samsung
boards, the consolidation applies only for ARCH_EXYNOS.
Signed-off-by: Tushar Behera <tushar.behera@linaro.org>
---
arch/arm/mach-exynos/include/mach/uncompress.h | 11 ++++++++---
arch/arm/plat-samsung/include/plat/uncompress.h | 16 ++++++++++++++--
2 files changed, 22 insertions(+), 5 deletions(-)
diff --git a/arch/arm/mach-exynos/include/mach/uncompress.h b/arch/arm/mach-exynos/include/mach/uncompress.h
index 2979995..45b5c2a 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_DEBUG_S3C_UART);
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_DEBUG_S3C_UART);
+#else
+ uart_base = 0;
+#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..028c2a8 100644
--- a/arch/arm/plat-samsung/include/plat/uncompress.h
+++ b/arch/arm/plat-samsung/include/plat/uncompress.h
@@ -38,7 +38,11 @@ static void arch_detect_cpu(void);
#define FIFO_MAX (14)
#ifdef S3C_PA_UART
-#define uart_base S3C_PA_UART + (S3C_UART_OFFSET * CONFIG_S3C_LOWLEVEL_UART_PORT)
+#ifdef CONFIG_DEBUG_LL
+#define uart_base (S3C_PA_UART + (S3C_UART_OFFSET * CONFIG_DEBUG_S3C_UART))
+#else
+#define uart_base 0
+#endif
#endif
static __inline__ void
@@ -66,6 +70,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 +125,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;
--
1.7.9.5
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH] ARM: EXYNOS: Consolidate multiple low-level UART port definitions
2013-05-30 4:40 [PATCH] ARM: EXYNOS: Consolidate multiple low-level UART port definitions Tushar Behera
@ 2013-05-30 21:11 ` Olof Johansson
2013-05-31 2:58 ` Tushar Behera
2013-05-31 18:20 ` Kevin Hilman
1 sibling, 1 reply; 5+ messages in thread
From: Olof Johansson @ 2013-05-30 21:11 UTC (permalink / raw)
To: linux-arm-kernel
Hi,
On Wed, May 29, 2013 at 9:40 PM, Tushar Behera <tushar.behera@linaro.org> wrote:
> There are two definitions for low-level UART ports for Exynos platform.
> CONFIG_S3C_LOWLEVEL_UART_PORT is used for printing "Uncompressing
> Linux... done, booting the kernel." and CONFIG_S3C_UART for other
> low-level messages.
>
> The assumption for both the uart ports is that they are pre-configured
> in the bootloader. Since they are essentially the same always, it
> would be good to consolidate them to use only one macro, in this case
> 'DEBUG_S3C_UART' would be a better option.
>
> 'DEBUG_S3C_UART' is defined only if DEBUG_LL is enabled. We can safely
> disable this option when DEBUG_LL is not defined and we can boot various
> boards with different UART port settings. Only drawback of this
> approach is that when DEBUG_LL is not defined, we would be missing the
> print "Uncompressing Linux... done, booting the kernel."
>
> Since CONFIG_S3C_LOWLEVEL_UART_PORT is still used by other Samsung
> boards, the consolidation applies only for ARCH_EXYNOS.
>
> Signed-off-by: Tushar Behera <tushar.behera@linaro.org>
This looks reasonable, but you have to convert the other samsung
platforms too -- it's not ok to ignore them.
-Olof
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH] ARM: EXYNOS: Consolidate multiple low-level UART port definitions
2013-05-30 21:11 ` Olof Johansson
@ 2013-05-31 2:58 ` Tushar Behera
0 siblings, 0 replies; 5+ messages in thread
From: Tushar Behera @ 2013-05-31 2:58 UTC (permalink / raw)
To: linux-arm-kernel
On 05/31/2013 02:41 AM, Olof Johansson wrote:
> Hi,
>
> On Wed, May 29, 2013 at 9:40 PM, Tushar Behera <tushar.behera@linaro.org> wrote:
>> There are two definitions for low-level UART ports for Exynos platform.
>> CONFIG_S3C_LOWLEVEL_UART_PORT is used for printing "Uncompressing
>> Linux... done, booting the kernel." and CONFIG_S3C_UART for other
>> low-level messages.
>>
>> The assumption for both the uart ports is that they are pre-configured
>> in the bootloader. Since they are essentially the same always, it
>> would be good to consolidate them to use only one macro, in this case
>> 'DEBUG_S3C_UART' would be a better option.
>>
>> 'DEBUG_S3C_UART' is defined only if DEBUG_LL is enabled. We can safely
>> disable this option when DEBUG_LL is not defined and we can boot various
>> boards with different UART port settings. Only drawback of this
>> approach is that when DEBUG_LL is not defined, we would be missing the
>> print "Uncompressing Linux... done, booting the kernel."
>>
>> Since CONFIG_S3C_LOWLEVEL_UART_PORT is still used by other Samsung
>> boards, the consolidation applies only for ARCH_EXYNOS.
>>
>> Signed-off-by: Tushar Behera <tushar.behera@linaro.org>
>
> This looks reasonable, but you have to convert the other samsung
> platforms too -- it's not ok to ignore them.
>
Sure thing. I will update those platforms in a subsequent patchset.
>
> -Olof
>
--
Tushar Behera
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH] ARM: EXYNOS: Consolidate multiple low-level UART port definitions
2013-05-30 4:40 [PATCH] ARM: EXYNOS: Consolidate multiple low-level UART port definitions Tushar Behera
2013-05-30 21:11 ` Olof Johansson
@ 2013-05-31 18:20 ` Kevin Hilman
2013-06-04 9:43 ` Tushar Behera
1 sibling, 1 reply; 5+ messages in thread
From: Kevin Hilman @ 2013-05-31 18:20 UTC (permalink / raw)
To: linux-arm-kernel
Tushar Behera <tushar.behera@linaro.org> writes:
> There are two definitions for low-level UART ports for Exynos platform.
> CONFIG_S3C_LOWLEVEL_UART_PORT is used for printing "Uncompressing
> Linux... done, booting the kernel." and CONFIG_S3C_UART for other
> low-level messages.
>
> The assumption for both the uart ports is that they are pre-configured
> in the bootloader. Since they are essentially the same always, it
> would be good to consolidate them to use only one macro, in this case
> 'DEBUG_S3C_UART' would be a better option.
>
> 'DEBUG_S3C_UART' is defined only if DEBUG_LL is enabled. We can safely
> disable this option when DEBUG_LL is not defined and we can boot various
> boards with different UART port settings. Only drawback of this
> approach is that when DEBUG_LL is not defined, we would be missing the
> print "Uncompressing Linux... done, booting the kernel."
Perfectly acceptable to me (and already the case on OMAP.)
> Since CONFIG_S3C_LOWLEVEL_UART_PORT is still used by other Samsung
> boards, the consolidation applies only for ARCH_EXYNOS.
>
> Signed-off-by: Tushar Behera <tushar.behera@linaro.org>
Acked-by: Kevin Hilman <khilman@linaro.org>
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH] ARM: EXYNOS: Consolidate multiple low-level UART port definitions
2013-05-31 18:20 ` Kevin Hilman
@ 2013-06-04 9:43 ` Tushar Behera
0 siblings, 0 replies; 5+ messages in thread
From: Tushar Behera @ 2013-06-04 9:43 UTC (permalink / raw)
To: linux-arm-kernel
On 05/31/2013 11:50 PM, Kevin Hilman wrote:
> Tushar Behera <tushar.behera@linaro.org> writes:
>
>> There are two definitions for low-level UART ports for Exynos platform.
>> CONFIG_S3C_LOWLEVEL_UART_PORT is used for printing "Uncompressing
>> Linux... done, booting the kernel." and CONFIG_S3C_UART for other
>> low-level messages.
>>
>> The assumption for both the uart ports is that they are pre-configured
>> in the bootloader. Since they are essentially the same always, it
>> would be good to consolidate them to use only one macro, in this case
>> 'DEBUG_S3C_UART' would be a better option.
>>
>> 'DEBUG_S3C_UART' is defined only if DEBUG_LL is enabled. We can safely
>> disable this option when DEBUG_LL is not defined and we can boot various
>> boards with different UART port settings. Only drawback of this
>> approach is that when DEBUG_LL is not defined, we would be missing the
>> print "Uncompressing Linux... done, booting the kernel."
>
> Perfectly acceptable to me (and already the case on OMAP.)
>
>> Since CONFIG_S3C_LOWLEVEL_UART_PORT is still used by other Samsung
>> boards, the consolidation applies only for ARCH_EXYNOS.
>>
>> Signed-off-by: Tushar Behera <tushar.behera@linaro.org>
>
> Acked-by: Kevin Hilman <khilman@linaro.org>
>
Thanks Kevin.
I have an updated version of this patch updated for all of Samsung
platforms.[1]
[1] http://www.gossamer-threads.com/lists/linux/kernel/1723429
--
Tushar Behera
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2013-06-04 9:43 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-30 4:40 [PATCH] ARM: EXYNOS: Consolidate multiple low-level UART port definitions Tushar Behera
2013-05-30 21:11 ` Olof Johansson
2013-05-31 2:58 ` Tushar Behera
2013-05-31 18:20 ` Kevin Hilman
2013-06-04 9:43 ` Tushar Behera
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).