From: Matt Porter <mporter@ti.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 2/6] am33xx: Enable UART{1,2,4,5} pin-mux
Date: Thu, 27 Sep 2012 08:49:06 -0400 [thread overview]
Message-ID: <20120927124906.GE5641@beef> (raw)
In-Reply-To: <1348689859-21803-3-git-send-email-andrew@bradfordembedded.com>
On Wed, Sep 26, 2012 at 04:04:15PM -0400, Andrew Bradford wrote:
> If configured to use UART{1,2,4,5}, such as on the Beaglebone RS232
> cape, enable the proper pin-muxing as per the RS232 cape configuration.
>
> Signed-off-by: Andrew Bradford <andrew@bradfordembedded.com>
> ---
> arch/arm/cpu/armv7/am33xx/board.c | 14 +++++++++
> arch/arm/include/asm/arch-am33xx/sys_proto.h | 6 +++-
> board/ti/am335x/mux.c | 43 ++++++++++++++++++++++++++
> 3 files changed, 62 insertions(+), 1 deletion(-)
>
> diff --git a/arch/arm/cpu/armv7/am33xx/board.c b/arch/arm/cpu/armv7/am33xx/board.c
> index ecc2671..32d1da4 100644
> --- a/arch/arm/cpu/armv7/am33xx/board.c
> +++ b/arch/arm/cpu/armv7/am33xx/board.c
> @@ -152,7 +152,21 @@ void s_init(void)
> /* UART softreset */
> u32 regVal;
>
> +#ifdef CONFIG_SERIAL1
> enable_uart0_pin_mux();
> +#endif /* CONFIG_SERIAL1 */
> +#ifdef CONFIG_SERIAL2
> + enable_uart1_pin_mux();
> +#endif /* CONFIG_SERIAL2 */
> +#ifdef CONFIG_SERIAL3
> + enable_uart2_pin_mux();
> +#endif /* CONFIG_SERIAL3 */
Same thing here about UART3
> +#ifdef CONFIG_SERIAL5
> + enable_uart4_pin_mux();
> +#endif /* CONFIG_SERIAL5 */
> +#ifdef CONFIG_SERIAL6
> + enable_uart5_pin_mux();
> +#endif /* CONFIG_SERIAL6 */
>
> regVal = readl(&uart_base->uartsyscfg);
> regVal |= UART_RESET;
> diff --git a/arch/arm/include/asm/arch-am33xx/sys_proto.h b/arch/arm/include/asm/arch-am33xx/sys_proto.h
> index 819ea65..4852127 100644
> --- a/arch/arm/include/asm/arch-am33xx/sys_proto.h
> +++ b/arch/arm/include/asm/arch-am33xx/sys_proto.h
> @@ -53,11 +53,15 @@ void ddr_pll_config(unsigned int ddrpll_M);
>
> /*
> * We have three pin mux functions that must exist. We must be able to enable
> - * uart0, for initial output and i2c0 to read the main EEPROM. We then have a
> + * a uart for initial output and i2c0 to read the main EEPROM. We then have a
> * main pinmux function that can be overridden to enable all other pinmux that
> * is required on the board.
> */
> void enable_uart0_pin_mux(void);
> +void enable_uart1_pin_mux(void);
> +void enable_uart2_pin_mux(void);
> +void enable_uart4_pin_mux(void);
> +void enable_uart5_pin_mux(void);
> void enable_i2c0_pin_mux(void);
> void enable_board_pin_mux(struct am335x_baseboard_id *header);
> #endif
> diff --git a/board/ti/am335x/mux.c b/board/ti/am335x/mux.c
> index 80becd5..db47d0e 100644
> --- a/board/ti/am335x/mux.c
> +++ b/board/ti/am335x/mux.c
> @@ -259,6 +259,30 @@ static struct module_pin_mux uart0_pin_mux[] = {
> {-1},
> };
>
> +static struct module_pin_mux uart1_pin_mux[] = {
> + {OFFSET(uart1_rxd), (MODE(0) | PULLUP_EN | RXACTIVE)}, /* UART1_RXD */
> + {OFFSET(uart1_txd), (MODE(0) | PULLUDEN)}, /* UART1_TXD */
> + {-1},
> +};
> +
> +static struct module_pin_mux uart2_pin_mux[] = {
> + {OFFSET(spi0_sclk), (MODE(1) | PULLUP_EN | RXACTIVE)}, /* UART2_RXD */
> + {OFFSET(spi0_d0), (MODE(1) | PULLUDEN)}, /* UART2_TXD */
> + {-1},
> +};
> +
> +static struct module_pin_mux uart4_pin_mux[] = {
> + {OFFSET(gpmc_wait0), (MODE(6) | PULLUP_EN | RXACTIVE)}, /* UART4_RXD */
> + {OFFSET(gpmc_wpn), (MODE(6) | PULLUDEN)}, /* UART4_TXD */
> + {-1},
> +};
> +
> +static struct module_pin_mux uart5_pin_mux[] = {
> + {OFFSET(lcd_data9), (MODE(4) | PULLUP_EN | RXACTIVE)}, /* UART5_RXD */
> + {OFFSET(lcd_data8), (MODE(4) | PULLUDEN)}, /* UART5_TXD */
> + {-1},
> +};
> +
> static struct module_pin_mux mmc0_pin_mux[] = {
> {OFFSET(mmc0_dat3), (MODE(0) | RXACTIVE | PULLUP_EN)}, /* MMC0_DAT3 */
> {OFFSET(mmc0_dat2), (MODE(0) | RXACTIVE | PULLUP_EN)}, /* MMC0_DAT2 */
> @@ -381,6 +405,25 @@ void enable_uart0_pin_mux(void)
> configure_module_pin_mux(uart0_pin_mux);
> }
>
> +void enable_uart1_pin_mux(void)
> +{
> + configure_module_pin_mux(uart1_pin_mux);
> +}
> +
> +void enable_uart2_pin_mux(void)
> +{
> + configure_module_pin_mux(uart2_pin_mux);
> +}
> +
> +void enable_uart4_pin_mux(void)
> +{
> + configure_module_pin_mux(uart4_pin_mux);
> +}
> +
> +void enable_uart5_pin_mux(void)
> +{
> + configure_module_pin_mux(uart5_pin_mux);
> +}
>
> void enable_i2c0_pin_mux(void)
> {
> --
> 1.7.10
>
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
next prev parent reply other threads:[~2012-09-27 12:49 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-26 20:04 [U-Boot] [PATCH 0/6] am335x_evm: Enable UART{1,2,4,5} Andrew Bradford
2012-09-26 20:04 ` [U-Boot] [PATCH 1/6] am33xx: Enable UART{1,2,4,5} clocks Andrew Bradford
2012-09-27 12:48 ` Matt Porter
2012-09-27 16:13 ` Marek Vasut
2012-09-27 16:25 ` Tom Rini
2012-09-27 16:45 ` Marek Vasut
2012-09-27 17:07 ` Tom Rini
2012-09-27 17:11 ` Marek Vasut
2012-09-27 17:22 ` Tom Rini
2012-09-27 17:27 ` Marek Vasut
2012-09-27 17:53 ` Tom Rini
2012-10-20 0:25 ` Andrew Bradford
2012-10-20 17:48 ` Tom Rini
2012-10-20 18:57 ` Marek Vasut
2012-10-21 14:54 ` Tom Rini
2012-09-26 20:04 ` [U-Boot] [PATCH 2/6] am33xx: Enable UART{1,2,4,5} pin-mux Andrew Bradford
2012-09-27 12:49 ` Matt Porter [this message]
2012-09-26 20:04 ` [U-Boot] [PATCH 3/6] serial: Enable up to 6 eserial devices Andrew Bradford
2012-09-26 20:04 ` [U-Boot] [PATCH 4/6] console & omap-common/spl: Enable use of eserial Andrew Bradford
2012-09-27 16:34 ` Marek Vasut
[not found] ` <20121010091028.01de813d@brick>
2012-10-10 14:53 ` Marek Vasut
2012-10-10 16:00 ` Tom Rini
2012-09-26 20:04 ` [U-Boot] [PATCH 5/6] am33xx: Enable eserial device usage for ns16550 Andrew Bradford
2012-09-26 20:04 ` [U-Boot] [PATCH 6/6] am335x_evm: Enable use of UART{1,2,4,5} Andrew Bradford
2012-09-27 12:50 ` Matt Porter
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=20120927124906.GE5641@beef \
--to=mporter@ti.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