From: dirk.behme@de.bosch.com (Dirk Behme)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ARM: imx6q: let users input debug uart port number
Date: Fri, 19 Oct 2012 10:01:40 +0200 [thread overview]
Message-ID: <508108E4.4030607@de.bosch.com> (raw)
In-Reply-To: <1349676394-25704-1-git-send-email-shawn.guo@linaro.org>
On 08.10.2012 08:06, Shawn Guo wrote:
> imx6q gets 5 uart ports in total. Different board design may choose
> different port as debug uart. For example, imx6q-sabresd uses UART1,
> imx6q-sabrelite uses UART2 and imx6q-arm2 uses UART4. Rather than
> bloating DEBUG_LL choice list with all these uart ports, the patch
> introduces DEBUG_IMX6Q_UART_PORT for users to input uart port number
> when DEBUG_IMX6Q_UART is selected inside DEBUG_LL choice.
>
> Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Sounds like a good idea :)
Thanks
Dirk
> ---
> arch/arm/Kconfig.debug | 26 +++++++++++++-------------
> arch/arm/include/debug/imx.S | 20 ++++++++++++++++----
> arch/arm/mach-imx/lluart.c | 28 ++++++++++++++++++----------
> arch/arm/mach-imx/mx6q.h | 4 ----
> 4 files changed, 47 insertions(+), 31 deletions(-)
>
> diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug
> index 5566520..5dc7109 100644
> --- a/arch/arm/Kconfig.debug
> +++ b/arch/arm/Kconfig.debug
> @@ -209,20 +209,12 @@ choice
> Say Y here if you want kernel low-level debugging support
> on i.MX50 or i.MX53.
>
> - config DEBUG_IMX6Q_UART2
> - bool "i.MX6Q Debug UART2"
> + config DEBUG_IMX6Q_UART
> + bool "i.MX6Q Debug UART"
> depends on SOC_IMX6Q
> help
> Say Y here if you want kernel low-level debugging support
> - on i.MX6Q UART2. This is correct for e.g. the SabreLite
> - board.
> -
> - config DEBUG_IMX6Q_UART4
> - bool "i.MX6Q Debug UART4"
> - depends on SOC_IMX6Q
> - help
> - Say Y here if you want kernel low-level debugging support
> - on i.MX6Q UART4.
> + on i.MX6Q.
>
> config DEBUG_MMP_UART2
> bool "Kernel low-level debugging message via MMP UART2"
> @@ -409,6 +401,15 @@ choice
>
> endchoice
>
> +config DEBUG_IMX6Q_UART_PORT
> + int "i.MX6Q Debug UART Port (1-5)" if DEBUG_IMX6Q_UART
> + range 1 5
> + default 1
> + depends on SOC_IMX6Q
> + help
> + Choose UART port on which kernel low-level debug messages
> + should be output.
> +
> config DEBUG_LL_INCLUDE
> string
> default "debug/icedcc.S" if DEBUG_ICEDCC
> @@ -418,8 +419,7 @@ config DEBUG_LL_INCLUDE
> DEBUG_IMX31_IMX35_UART || \
> DEBUG_IMX51_UART || \
> DEBUG_IMX50_IMX53_UART ||\
> - DEBUG_IMX6Q_UART2 || \
> - DEBUG_IMX6Q_UART4
> + DEBUG_IMX6Q_UART
> default "debug/highbank.S" if DEBUG_HIGHBANK_UART
> default "debug/mvebu.S" if DEBUG_MVEBU_UART
> default "debug/picoxcell.S" if DEBUG_PICOXCELL_UART
> diff --git a/arch/arm/include/debug/imx.S b/arch/arm/include/debug/imx.S
> index 0b65d79..0c4e17d 100644
> --- a/arch/arm/include/debug/imx.S
> +++ b/arch/arm/include/debug/imx.S
> @@ -10,6 +10,20 @@
> * published by the Free Software Foundation.
> *
> */
> +#define IMX6Q_UART1_BASE_ADDR 0x02020000
> +#define IMX6Q_UART2_BASE_ADDR 0x021e8000
> +#define IMX6Q_UART3_BASE_ADDR 0x021ec000
> +#define IMX6Q_UART4_BASE_ADDR 0x021f0000
> +#define IMX6Q_UART5_BASE_ADDR 0x021f4000
> +
> +/*
> + * IMX6Q_UART_BASE_ADDR is put in the middle to force the expansion
> + * of IMX6Q_UART##n##_BASE_ADDR.
> + */
> +#define IMX6Q_UART_BASE_ADDR(n) IMX6Q_UART##n##_BASE_ADDR
> +#define IMX6Q_UART_BASE(n) IMX6Q_UART_BASE_ADDR(n)
> +#define IMX6Q_DEBUG_UART_BASE IMX6Q_UART_BASE(CONFIG_DEBUG_IMX6Q_UART_PORT)
> +
> #ifdef CONFIG_DEBUG_IMX1_UART
> #define UART_PADDR 0x00206000
> #elif defined (CONFIG_DEBUG_IMX25_UART)
> @@ -22,10 +36,8 @@
> #define UART_PADDR 0x73fbc000
> #elif defined (CONFIG_DEBUG_IMX50_IMX53_UART)
> #define UART_PADDR 0x53fbc000
> -#elif defined (CONFIG_DEBUG_IMX6Q_UART2)
> -#define UART_PADDR 0x021e8000
> -#elif defined (CONFIG_DEBUG_IMX6Q_UART4)
> -#define UART_PADDR 0x021f0000
> +#elif defined (CONFIG_DEBUG_IMX6Q_UART)
> +#define UART_PADDR IMX6Q_DEBUG_UART_BASE
> #endif
>
> /*
> diff --git a/arch/arm/mach-imx/lluart.c b/arch/arm/mach-imx/lluart.c
> index 5f15103..2fdc9bf 100644
> --- a/arch/arm/mach-imx/lluart.c
> +++ b/arch/arm/mach-imx/lluart.c
> @@ -17,17 +17,25 @@
>
> #include "hardware.h"
>
> +#define IMX6Q_UART1_BASE_ADDR 0x02020000
> +#define IMX6Q_UART2_BASE_ADDR 0x021e8000
> +#define IMX6Q_UART3_BASE_ADDR 0x021ec000
> +#define IMX6Q_UART4_BASE_ADDR 0x021f0000
> +#define IMX6Q_UART5_BASE_ADDR 0x021f4000
> +
> +/*
> + * IMX6Q_UART_BASE_ADDR is put in the middle to force the expansion
> + * of IMX6Q_UART##n##_BASE_ADDR.
> + */
> +#define IMX6Q_UART_BASE_ADDR(n) IMX6Q_UART##n##_BASE_ADDR
> +#define IMX6Q_UART_BASE(n) IMX6Q_UART_BASE_ADDR(n)
> +#define IMX6Q_DEBUG_UART_BASE IMX6Q_UART_BASE(CONFIG_DEBUG_IMX6Q_UART_PORT)
> +
> static struct map_desc imx_lluart_desc = {
> -#ifdef CONFIG_DEBUG_IMX6Q_UART2
> - .virtual = MX6Q_IO_P2V(MX6Q_UART2_BASE_ADDR),
> - .pfn = __phys_to_pfn(MX6Q_UART2_BASE_ADDR),
> - .length = MX6Q_UART2_SIZE,
> - .type = MT_DEVICE,
> -#endif
> -#ifdef CONFIG_DEBUG_IMX6Q_UART4
> - .virtual = MX6Q_IO_P2V(MX6Q_UART4_BASE_ADDR),
> - .pfn = __phys_to_pfn(MX6Q_UART4_BASE_ADDR),
> - .length = MX6Q_UART4_SIZE,
> +#ifdef CONFIG_DEBUG_IMX6Q_UART
> + .virtual = IMX_IO_P2V(IMX6Q_DEBUG_UART_BASE),
> + .pfn = __phys_to_pfn(IMX6Q_DEBUG_UART_BASE),
> + .length = 0x4000,
> .type = MT_DEVICE,
> #endif
> };
> diff --git a/arch/arm/mach-imx/mx6q.h b/arch/arm/mach-imx/mx6q.h
> index f7e7dba..19d3f54 100644
> --- a/arch/arm/mach-imx/mx6q.h
> +++ b/arch/arm/mach-imx/mx6q.h
> @@ -27,9 +27,5 @@
> #define MX6Q_CCM_SIZE 0x4000
> #define MX6Q_ANATOP_BASE_ADDR 0x020c8000
> #define MX6Q_ANATOP_SIZE 0x1000
> -#define MX6Q_UART2_BASE_ADDR 0x021e8000
> -#define MX6Q_UART2_SIZE 0x4000
> -#define MX6Q_UART4_BASE_ADDR 0x021f0000
> -#define MX6Q_UART4_SIZE 0x4000
>
> #endif /* __MACH_MX6Q_H__ */
prev parent reply other threads:[~2012-10-19 8:01 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-08 6:06 [PATCH] ARM: imx6q: let users input debug uart port number Shawn Guo
2012-10-19 8:01 ` Dirk Behme [this message]
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=508108E4.4030607@de.bosch.com \
--to=dirk.behme@de.bosch.com \
--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 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.