linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: linux@arm.linux.org.uk (Russell King - ARM Linux)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 3/7] ARM: mmp: set correct uart according to board
Date: Tue, 12 Apr 2011 22:01:47 +0100	[thread overview]
Message-ID: <20110412210147.GF7806@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <1302264944-2759-3-git-send-email-haojian.zhuang@marvell.com>

On Fri, Apr 08, 2011 at 08:15:40PM +0800, Haojian Zhuang wrote:
> UART3 is the default console in jasper, brownstone and avengers lite.
> 
> Change-Id: Iacfe665cc0e20a47d50e0b2ad8724097f28e7d2c

Please don't include Change-Ids in patch submissions.

> diff --git a/arch/arm/mach-mmp/include/mach/debug-macro.S b/arch/arm/mach-mmp/include/mach/debug-macro.S
> index 7e2ebd3..b353785 100644
> --- a/arch/arm/mach-mmp/include/mach/debug-macro.S
> +++ b/arch/arm/mach-mmp/include/mach/debug-macro.S
> @@ -14,8 +14,14 @@
>  		.macro	addruart, rp, rv
>  		ldr	\rp, =APB_PHYS_BASE		@ physical
>  		ldr	\rv, =APB_VIRT_BASE		@ virtual
> +#if defined(CONFIG_MACH_BROWNSTONE) || defined(CONFIG_MACH_MARVELL_JASPER) \
> +	|| defined(CONFIG_MACH_AVENGERS_LITE)
> +		orr	\rp, \rp, #0x00018000
> +		orr	\rv, \rv, #0x00018000
> +#else
>  		orr	\rp, \rp, #0x00017000
>  		orr	\rv, \rv, #0x00017000
> +#endif

It probably makes more sense to have this in the configuration scripts:

choice
	prompt "PXA debug uart"
	default DEBUG_PXA_UART0

config DEBUG_PXA_UART0
	bool "UART 0"

config DEBUG_PXA_UART1
	bool "UART 1"
	default y if MACH_BROWNSTONE || MACH_MARVELL_JASPER || MACH_AVENGERS_LITE

endchoice

and select the debug uart address using these symbols.  That'd avoid the
need to couple lots of platform specific stuff into the compiled files.

Alternatively, you could do more in the Kconfig like this:

config DEBUG_PXA_UART
	hex
	default 0x17000 if DEBUG_PXA_UART0
	default 0x18000 if DEBUG_PXA_UART1

and use CONFIG_DEBUG_PXA_UART in the assembly code, eliminating the
need to change sourcecode for additional uarts.  Or maybe combine the
two ideas.

  parent reply	other threads:[~2011-04-12 21:01 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <2011040801>
2011-04-08 12:15 ` [PATCH 1/7] ARM: pxa: add clk_set_rate() Haojian Zhuang
2011-04-08 12:15   ` [PATCH 2/7] ARM: pxa: always clear LPM bits for PXA168 MFPR Haojian Zhuang
2011-04-08 12:15     ` [PATCH 3/7] ARM: mmp: set correct uart according to board Haojian Zhuang
2011-04-08 12:15       ` [PATCH 4/7] ARM: mmp: update the reset implementation Haojian Zhuang
2011-04-08 12:15         ` [PATCH 5/7] ARM: pxa: align NR_BUILTIN_GPIO with GPIO interrupt number Haojian Zhuang
2011-04-08 12:15           ` [PATCH 6/7] ARM: mmp: align NR_BUILTIN_GPIO with gpio " Haojian Zhuang
2011-04-08 12:15             ` [PATCH 7/7] ARM: mmp: enable max7312 gpio expander in dkb Haojian Zhuang
2011-04-12 15:26           ` [PATCH 5/7] ARM: pxa: align NR_BUILTIN_GPIO with GPIO interrupt number Eric Miao
2011-04-12 21:01       ` Russell King - ARM Linux [this message]
2011-04-13  1:20         ` [PATCH 3/7] ARM: mmp: set correct uart according to board Eric Miao
2011-04-12 15:24     ` [PATCH 2/7] ARM: pxa: always clear LPM bits for PXA168 MFPR Eric Miao
2011-04-20 10:32   ` [PATCH 1/7] ARM: pxa: add clk_set_rate() Eric Miao

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=20110412210147.GF7806@n2100.arm.linux.org.uk \
    --to=linux@arm.linux.org.uk \
    --cc=linux-arm-kernel@lists.infradead.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 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).