public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Marek Vasut <marek.vasut@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] EXYNOS: SMDK5250: Support all 4 UARTs
Date: Sat, 11 Feb 2012 08:08:33 +0100	[thread overview]
Message-ID: <201202110808.33732.marek.vasut@gmail.com> (raw)
In-Reply-To: <1328911938-6878-1-git-send-email-dianders@chromium.org>

> This properly configures the mux to enable the right UART depending on
> the setting of CONFIG_SERIALX.
> 
> This also fixes things so that we don't configure balls XUCTSN_1 and
> XURTSN_1 as UART1 configuration (RTS/CTS), since they aren't
> connected.
> 
> Signed-off-by: Doug Anderson <dianders@chromium.org>
> ---
>  board/samsung/smdk5250/smdk5250.c |   49
> +++++++++++++++++++++++++++++++++++- 1 files changed, 47 insertions(+), 2
> deletions(-)
> 
> diff --git a/board/samsung/smdk5250/smdk5250.c
> b/board/samsung/smdk5250/smdk5250.c index 928c08f..61b8634 100644
> --- a/board/samsung/smdk5250/smdk5250.c
> +++ b/board/samsung/smdk5250/smdk5250.c
> @@ -224,11 +224,56 @@ static void board_uart_init(void)
>  		(struct exynos5_gpio_part1 *) samsung_get_base_gpio_part1();
>  	int i;
> 
> -	/* UART1 GPIOs (part1) : GPA0CON[7:4] 0x2222 */
> -	for (i = 4; i < 8; i++) {
> +#if defined(CONFIG_SERIAL0)
> +	/*
> +	 * UART0 GPIOs : GPA0CON[3:0] 0x2222
> +	 * Must set CFG17 switches to select UART0 to use.
> +	 */
> +	for (i = 0; i <= 3; i++) {
>  		s5p_gpio_set_pull(&gpio1->a0, i, GPIO_PULL_NONE);
>  		s5p_gpio_cfg_pin(&gpio1->a0, i, GPIO_FUNC(0x2));
>  	}
> +#elif defined(CONFIG_SERIAL1)
> +	/*
> +	 * UART1 GPIOs : GPA0CON[5:4] 0x22
> +	 * Must set CFG17 switches to select UART1 to use.
> +	 *
> +	 * This only sets RXD/TXD, as RTS/CTS need a resister soldered down
> +	 * in order to use them (so that those pins can be used for I2C).
> +	 */
> +	for (i = 4; i <= 5; i++) {
> +		s5p_gpio_set_pull(&gpio1->a0, i, GPIO_PULL_NONE);
> +		s5p_gpio_cfg_pin(&gpio1->a0, i, GPIO_FUNC(0x2));
> +	}
> +#elif defined(CONFIG_SERIAL2)
> +	/*
> +	 * UART2 GPIOs : GPA1CON[1:0] 0x22
> +	 * Must set CFG17 switches to select UART2 to use.
> +	 *
> +	 * This only sets RXD/TXD, as RTS/CTS need a resister soldered down
> +	 * in order to use them (so that those pins can be used for I2C).
> +	 */
> +	for (i = 0; i <= 1; i++) {
> +		s5p_gpio_set_pull(&gpio1->a1, i, GPIO_PULL_NONE);
> +		s5p_gpio_cfg_pin(&gpio1->a1, i, GPIO_FUNC(0x2));
> +	}
> +#elif defined(CONFIG_SERIAL3)
> +	/*
> +	 * UART3 GPIOs : GPA1CON[5:4] 0x22
> +	 * Must set CFG16 switches to select UART3 to use.
> +	 */
> +	for (i = 4; i <= 5; i++) {
> +		s5p_gpio_set_pull(&gpio1->a1, i, GPIO_PULL_NONE);
> +		s5p_gpio_cfg_pin(&gpio1->a1, i, GPIO_FUNC(0x2));
> +	}
> +#elif defined(CONFIG_SERIAL4)
> +	/*
> +	 * There's no mux for UART4--it's internal only
> +	 */
> +#error "Can't set console to serial 4--it's not exposed"
> +#else
> +#error "Unknown serial config"
> +#endif
>  }
> 
>  #ifdef CONFIG_BOARD_EARLY_INIT_F

Uhm ... CONFIG_SERIAL_MULTI? Also, you can configure the mux just like that, 
without all this macro crap, can't you? Why not do it like that?

M

  reply	other threads:[~2012-02-11  7:08 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-10 22:12 [U-Boot] [PATCH] EXYNOS: SMDK5250: Support all 4 UARTs Doug Anderson
2012-02-11  7:08 ` Marek Vasut [this message]
2012-02-14  7:00   ` Mike Frysinger
2012-02-15 18:47     ` Doug Anderson
2012-02-13 17:38 ` [U-Boot] [PATCH v2] " Doug Anderson
2012-02-20  7:06   ` Chander Kashyap
2012-03-05  5:33     ` Minkyu Kang

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=201202110808.33732.marek.vasut@gmail.com \
    --to=marek.vasut@gmail.com \
    --cc=u-boot@lists.denx.de \
    /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