All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Warren <swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
To: Thierry Reding
	<thierry.reding-RM9K5IK7kjKj5M59NBduVrNAH6kLmebB@public.gmane.org>
Cc: linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	Stephen Warren <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
Subject: Re: [PATCH 1/3] ARM: tegra: simplify DEBUG_LL UART selection options
Date: Tue, 02 Oct 2012 14:12:23 -0600	[thread overview]
Message-ID: <506B4AA7.60609@wwwdotorg.org> (raw)
In-Reply-To: <20121002200130.GA31363-RM9K5IK7kjIQXX3q8xo1gnVAuStQJXxyR5q1nwbD4aMs9pC9oP6+/A@public.gmane.org>

On 10/02/2012 02:01 PM, Thierry Reding wrote:
> On Tue, Oct 02, 2012 at 01:07:44PM -0600, Stephen Warren wrote: 
> [...]
>> choice -        prompt "Default low-level debug console UART" -
>> default TEGRA_DEBUG_UART_NONE +        prompt "Low-level debug
>> console UART" +        default TEGRA_DEBUG_UART_AUTO_ODMDATA
>> 
>> -config TEGRA_DEBUG_UART_NONE -        bool "None" +config
>> TEGRA_DEBUG_UART_AUTO_ODMDATA
> 
> The first item in a list of choices is automatically selected as
> the default, so technically the default is redundant here. I
> suppose it doesn't hurt to be explicit.
> 
>> diff --git a/arch/arm/mach-tegra/common.c
>> b/arch/arm/mach-tegra/common.c index 0b0a5f5..0913d1f 100644 ---
>> a/arch/arm/mach-tegra/common.c +++
>> b/arch/arm/mach-tegra/common.c @@ -44,14 +44,13 @@ * kernel is
>> loaded. The data is declared here rather than debug-macro.S so *
>> that multiple inclusions of debug-macro.S point at the same
>> data. */ -#define TEGRA_DEBUG_UART_OFFSET (TEGRA_DEBUG_UART_BASE
>> & 0xFFFF) u32 tegra_uart_config[3] = { /* Debug UART
>> initialization required */ 1, /* Debug UART physical address */ -
>> (u32)(IO_APB_PHYS + TEGRA_DEBUG_UART_OFFSET), +	0, /* Debug UART
>> virtual address */ -	(u32)(IO_APB_VIRT +
>> TEGRA_DEBUG_UART_OFFSET), +	0, };
> 
> I don't quite see how this is supposed to work now. Won't the
> debug.S code fail if these fields are set to 0?

If those fields remain set to 0, then there will be no DEBUG_LL output.

However, assuming use of a compressed zImage rather than an
uncompressed Image then at this stage in the series, uncompress.h
writes the UART selection and a cookie to Tegra's IRAM, and
debug-macro.S reads that selection, and re-initializes those fields to
whatever uncompress.h chose.

In patch 2 in the series, the coupling between uncompress.h and
debug-macro.S is entirely removed, and instead, debug-macro.S
initializes those values the first time a character is printed.

The values aren't hard-coded there since they are now (after patch 2)
always over-written. Even when a single static UART is selected, we
can't hard-code the address since debug-macro.S validates that the
clock and reset bits to the UART are correctly set before using it,
hence we might end up not using the UART anyway.

WARNING: multiple messages have this Message-ID (diff)
From: swarren@wwwdotorg.org (Stephen Warren)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/3] ARM: tegra: simplify DEBUG_LL UART selection options
Date: Tue, 02 Oct 2012 14:12:23 -0600	[thread overview]
Message-ID: <506B4AA7.60609@wwwdotorg.org> (raw)
In-Reply-To: <20121002200130.GA31363@avionic-0098.mockup.avionic-design.de>

On 10/02/2012 02:01 PM, Thierry Reding wrote:
> On Tue, Oct 02, 2012 at 01:07:44PM -0600, Stephen Warren wrote: 
> [...]
>> choice -        prompt "Default low-level debug console UART" -
>> default TEGRA_DEBUG_UART_NONE +        prompt "Low-level debug
>> console UART" +        default TEGRA_DEBUG_UART_AUTO_ODMDATA
>> 
>> -config TEGRA_DEBUG_UART_NONE -        bool "None" +config
>> TEGRA_DEBUG_UART_AUTO_ODMDATA
> 
> The first item in a list of choices is automatically selected as
> the default, so technically the default is redundant here. I
> suppose it doesn't hurt to be explicit.
> 
>> diff --git a/arch/arm/mach-tegra/common.c
>> b/arch/arm/mach-tegra/common.c index 0b0a5f5..0913d1f 100644 ---
>> a/arch/arm/mach-tegra/common.c +++
>> b/arch/arm/mach-tegra/common.c @@ -44,14 +44,13 @@ * kernel is
>> loaded. The data is declared here rather than debug-macro.S so *
>> that multiple inclusions of debug-macro.S point at the same
>> data. */ -#define TEGRA_DEBUG_UART_OFFSET (TEGRA_DEBUG_UART_BASE
>> & 0xFFFF) u32 tegra_uart_config[3] = { /* Debug UART
>> initialization required */ 1, /* Debug UART physical address */ -
>> (u32)(IO_APB_PHYS + TEGRA_DEBUG_UART_OFFSET), +	0, /* Debug UART
>> virtual address */ -	(u32)(IO_APB_VIRT +
>> TEGRA_DEBUG_UART_OFFSET), +	0, };
> 
> I don't quite see how this is supposed to work now. Won't the
> debug.S code fail if these fields are set to 0?

If those fields remain set to 0, then there will be no DEBUG_LL output.

However, assuming use of a compressed zImage rather than an
uncompressed Image then at this stage in the series, uncompress.h
writes the UART selection and a cookie to Tegra's IRAM, and
debug-macro.S reads that selection, and re-initializes those fields to
whatever uncompress.h chose.

In patch 2 in the series, the coupling between uncompress.h and
debug-macro.S is entirely removed, and instead, debug-macro.S
initializes those values the first time a character is printed.

The values aren't hard-coded there since they are now (after patch 2)
always over-written. Even when a single static UART is selected, we
can't hard-code the address since debug-macro.S validates that the
clock and reset bits to the UART are correctly set before using it,
hence we might end up not using the UART anyway.

  parent reply	other threads:[~2012-10-02 20:12 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-02 19:07 [PATCH 1/3] ARM: tegra: simplify DEBUG_LL UART selection options Stephen Warren
2012-10-02 19:07 ` Stephen Warren
     [not found] ` <1349204866-21810-1-git-send-email-swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2012-10-02 19:07   ` [PATCH 2/3] ARM: tegra: make debug-macro.S work standalone Stephen Warren
2012-10-02 19:07     ` Stephen Warren
2012-10-02 19:07   ` [PATCH 3/3] ARM: tegra: move debug-macro.S to include/debug Stephen Warren
2012-10-02 19:07     ` Stephen Warren
2012-10-02 20:01   ` [PATCH 1/3] ARM: tegra: simplify DEBUG_LL UART selection options Thierry Reding
2012-10-02 20:01     ` Thierry Reding
     [not found]     ` <20121002200130.GA31363-RM9K5IK7kjIQXX3q8xo1gnVAuStQJXxyR5q1nwbD4aMs9pC9oP6+/A@public.gmane.org>
2012-10-02 20:12       ` Stephen Warren [this message]
2012-10-02 20:12         ` Stephen Warren

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=506B4AA7.60609@wwwdotorg.org \
    --to=swarren-3lzwwm7+weoh9zmkesr00q@public.gmane.org \
    --cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org \
    --cc=thierry.reding-RM9K5IK7kjKj5M59NBduVrNAH6kLmebB@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.