From: Tony Lindgren <tony@atomide.com>
To: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl>
Cc: "linux-omap@vger.kernel.org" <linux-omap@vger.kernel.org>,
e3-hacking@earth.li
Subject: Re: [PATCH] OMAP1: fix redundant UARTs pin muxing that can break other hardware support
Date: Thu, 22 Oct 2009 11:43:00 -0700 [thread overview]
Message-ID: <20091022184259.GR16230@atomide.com> (raw)
In-Reply-To: <200910211827.54733.jkrzyszt@tis.icnet.pl>
* Janusz Krzysztofik <jkrzyszt@tis.icnet.pl> [091021 10:11]:
> Wednesday 21 October 2009 02:51:35 Tony Lindgren napisał(a):
> >
> > Let's just remove the omap_cfg_reg() calls from mach-omap1/serial.c, and
> > add them to the board-*.c files like you suggest above. We should be able
> > to find which ports to mux by looking at the enabled_uarts mask in the
> > commit mentioned above.
>
> Here you are (board-*.c changes limited to those OMAP1510 based).
> Created against linux-2.6.32-rc5.
> Tested on Amsdtrad Delta only.
Thanks, I'll add it to the omap-fixes series for this -rc cycle with
a description on how things broke.
BTW, you might want to also take a look at adding support for powering
down the uarts with an idle timer for mach-omap1/serial.c the same
way as mach-omap2/serial.c does.
Otherwise the enabled serial ports keep the system from hitting
retention during idle.
Regards,
Tony
> Signed-off-by: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl>
>
> ---
> diff -upr linux-2.6.32-rc5.orig/arch/arm/mach-omap1/board-ams-delta.c linux-2.6.32-rc5.fixed/arch/arm/mach-omap1/board-ams-delta.c
> --- linux-2.6.32-rc5.orig/arch/arm/mach-omap1/board-ams-delta.c 2009-10-16 02:41:50.000000000 +0200
> +++ linux-2.6.32-rc5.fixed/arch/arm/mach-omap1/board-ams-delta.c 2009-10-21 17:41:29.000000000 +0200
> @@ -219,6 +219,10 @@ static struct platform_device *ams_delta
>
> static void __init ams_delta_init(void)
> {
> + /* setup mux pins for uarts, removed from serial.c */
> + omap_cfg_reg(UART1_TX);
> + omap_cfg_reg(UART1_RTS);
> +
> iotable_init(ams_delta_io_desc, ARRAY_SIZE(ams_delta_io_desc));
>
> omap_board_config = ams_delta_config;
> diff -upr linux-2.6.32-rc5.orig/arch/arm/mach-omap1/board-generic.c linux-2.6.32-rc5.fixed/arch/arm/mach-omap1/board-generic.c
> --- linux-2.6.32-rc5.orig/arch/arm/mach-omap1/board-generic.c 2009-10-16 02:41:50.000000000 +0200
> +++ linux-2.6.32-rc5.fixed/arch/arm/mach-omap1/board-generic.c 2009-10-21 18:15:37.000000000 +0200
> @@ -64,6 +64,14 @@ static void __init omap_generic_init(voi
> {
> #ifdef CONFIG_ARCH_OMAP15XX
> if (cpu_is_omap15xx()) {
> + /* setup mux pins for uarts, removed from serial.c */
> + omap_cfg_reg(UART1_TX);
> + omap_cfg_reg(UART1_RTS);
> + omap_cfg_reg(UART2_TX);
> + omap_cfg_reg(UART2_RTS);
> + omap_cfg_reg(UART3_TX);
> + omap_cfg_reg(UART3_RX);
> +
> omap_usb_init(&generic1510_usb_config);
> }
> #endif
> diff -upr linux-2.6.32-rc5.orig/arch/arm/mach-omap1/board-innovator.c linux-2.6.32-rc5.fixed/arch/arm/mach-omap1/board-innovator.c
> --- linux-2.6.32-rc5.orig/arch/arm/mach-omap1/board-innovator.c 2009-10-16 02:41:50.000000000 +0200
> +++ linux-2.6.32-rc5.fixed/arch/arm/mach-omap1/board-innovator.c 2009-10-21 18:16:59.000000000 +0200
> @@ -376,6 +376,24 @@ static void __init innovator_init(void)
> {
> #ifdef CONFIG_ARCH_OMAP15XX
> if (cpu_is_omap1510()) {
> + /* setup mux pins for uarts, removed from serial.c */
> + omap_cfg_reg(UART1_TX);
> + omap_cfg_reg(UART1_RTS);
> + omap_cfg_reg(UART2_TX);
> + omap_cfg_reg(UART2_RTS);
> + omap_cfg_reg(UART3_TX);
> + omap_cfg_reg(UART3_RX);
> +
> + reg = fpga_read(OMAP1510_FPGA_POWER);
> + reg |= OMAP1510_FPGA_PCR_COM1_EN;
> + fpga_write(reg, OMAP1510_FPGA_POWER);
> + udelay(10);
> +
> + reg = fpga_read(OMAP1510_FPGA_POWER);
> + reg |= OMAP1510_FPGA_PCR_COM2_EN;
> + fpga_write(reg, OMAP1510_FPGA_POWER);
> + udelay(10);
> +
> platform_add_devices(innovator1510_devices, ARRAY_SIZE(innovator1510_devices));
> spi_register_board_info(innovator1510_boardinfo,
> ARRAY_SIZE(innovator1510_boardinfo));
> diff -upr linux-2.6.32-rc5.orig/arch/arm/mach-omap1/board-palmte.c linux-2.6.32-rc5.fixed/arch/arm/mach-omap1/board-palmte.c
> --- linux-2.6.32-rc5.orig/arch/arm/mach-omap1/board-palmte.c 2009-10-16 02:41:50.000000000 +0200
> +++ linux-2.6.32-rc5.fixed/arch/arm/mach-omap1/board-palmte.c 2009-10-21 17:38:59.000000000 +0200
> @@ -342,6 +342,14 @@ static void __init palmte_misc_gpio_setu
>
> static void __init omap_palmte_init(void)
> {
> + /* setup mux pins for uarts, removed from serial.c */
> + omap_cfg_reg(UART1_TX);
> + omap_cfg_reg(UART1_RTS);
> + omap_cfg_reg(UART2_TX);
> + omap_cfg_reg(UART2_RTS);
> + omap_cfg_reg(UART3_TX);
> + omap_cfg_reg(UART3_RX);
> +
> omap_board_config = palmte_config;
> omap_board_config_size = ARRAY_SIZE(palmte_config);
>
> diff -upr linux-2.6.32-rc5.orig/arch/arm/mach-omap1/board-palmtt.c linux-2.6.32-rc5.fixed/arch/arm/mach-omap1/board-palmtt.c
> --- linux-2.6.32-rc5.orig/arch/arm/mach-omap1/board-palmtt.c 2009-10-16 02:41:50.000000000 +0200
> +++ linux-2.6.32-rc5.fixed/arch/arm/mach-omap1/board-palmtt.c 2009-10-21 17:39:19.000000000 +0200
> @@ -289,6 +289,14 @@ static void __init omap_mpu_wdt_mode(int
>
> static void __init omap_palmtt_init(void)
> {
> + /* setup mux pins for uarts, removed from serial.c */
> + omap_cfg_reg(UART1_TX);
> + omap_cfg_reg(UART1_RTS);
> + omap_cfg_reg(UART2_TX);
> + omap_cfg_reg(UART2_RTS);
> + omap_cfg_reg(UART3_TX);
> + omap_cfg_reg(UART3_RX);
> +
> omap_mpu_wdt_mode(0);
>
> omap_board_config = palmtt_config;
> diff -upr linux-2.6.32-rc5.orig/arch/arm/mach-omap1/board-palmz71.c linux-2.6.32-rc5.fixed/arch/arm/mach-omap1/board-palmz71.c
> --- linux-2.6.32-rc5.orig/arch/arm/mach-omap1/board-palmz71.c 2009-10-16 02:41:50.000000000 +0200
> +++ linux-2.6.32-rc5.fixed/arch/arm/mach-omap1/board-palmz71.c 2009-10-21 17:39:34.000000000 +0200
> @@ -307,6 +307,14 @@ palmz71_gpio_setup(int early)
> static void __init
> omap_palmz71_init(void)
> {
> + /* setup mux pins for uarts, removed from serial.c */
> + omap_cfg_reg(UART1_TX);
> + omap_cfg_reg(UART1_RTS);
> + omap_cfg_reg(UART2_TX);
> + omap_cfg_reg(UART2_RTS);
> + omap_cfg_reg(UART3_TX);
> + omap_cfg_reg(UART3_RX);
> +
> palmz71_gpio_setup(1);
> omap_mpu_wdt_mode(0);
>
> diff -upr linux-2.6.32-rc5.orig/arch/arm/mach-omap1/board-sx1.c linux-2.6.32-rc5.fixed/arch/arm/mach-omap1/board-sx1.c
> --- linux-2.6.32-rc5.orig/arch/arm/mach-omap1/board-sx1.c 2009-10-16 02:41:50.000000000 +0200
> +++ linux-2.6.32-rc5.fixed/arch/arm/mach-omap1/board-sx1.c 2009-10-21 17:40:20.000000000 +0200
> @@ -377,6 +377,14 @@ static struct omap_board_config_kernel s
>
> static void __init omap_sx1_init(void)
> {
> + /* setup mux pins for uarts, removed from serial.c */
> + omap_cfg_reg(UART1_TX);
> + omap_cfg_reg(UART1_RTS);
> + omap_cfg_reg(UART2_TX);
> + omap_cfg_reg(UART2_RTS);
> + omap_cfg_reg(UART3_TX);
> + omap_cfg_reg(UART3_RX);
> +
> platform_add_devices(sx1_devices, ARRAY_SIZE(sx1_devices));
>
> omap_board_config = sx1_config;
> diff -upr linux-2.6.32-rc5.orig/arch/arm/mach-omap1/board-voiceblue.c linux-2.6.32-rc5.fixed/arch/arm/mach-omap1/board-voiceblue.c
> --- linux-2.6.32-rc5.orig/arch/arm/mach-omap1/board-voiceblue.c 2009-10-16 02:41:50.000000000 +0200
> +++ linux-2.6.32-rc5.fixed/arch/arm/mach-omap1/board-voiceblue.c 2009-10-21 17:40:57.000000000 +0200
> @@ -152,6 +152,14 @@ static void __init voiceblue_init_irq(vo
>
> static void __init voiceblue_init(void)
> {
> + /* setup mux pins for uarts, removed from serial.c */
> + omap_cfg_reg(UART1_TX);
> + omap_cfg_reg(UART1_RTS);
> + omap_cfg_reg(UART2_TX);
> + omap_cfg_reg(UART2_RTS);
> + omap_cfg_reg(UART3_TX);
> + omap_cfg_reg(UART3_RX);
> +
> /* Watchdog */
> gpio_request(0, "Watchdog");
> /* smc91x reset */
> diff -upr linux-2.6.32-rc5.orig/arch/arm/mach-omap1/serial.c linux-2.6.32-rc5.fixed/arch/arm/mach-omap1/serial.c
> --- linux-2.6.32-rc5.orig/arch/arm/mach-omap1/serial.c 2009-10-16 02:41:50.000000000 +0200
> +++ linux-2.6.32-rc5.fixed/arch/arm/mach-omap1/serial.c 2009-10-21 17:53:49.000000000 +0200
> @@ -143,16 +143,6 @@ void __init omap_serial_init(void)
> if (cpu_is_omap15xx())
> clk_set_rate(uart1_ck, 12000000);
> }
> - if (cpu_is_omap15xx()) {
> - omap_cfg_reg(UART1_TX);
> - omap_cfg_reg(UART1_RTS);
> - if (machine_is_omap_innovator()) {
> - reg = fpga_read(OMAP1510_FPGA_POWER);
> - reg |= OMAP1510_FPGA_PCR_COM1_EN;
> - fpga_write(reg, OMAP1510_FPGA_POWER);
> - udelay(10);
> - }
> - }
> break;
> case 1:
> uart2_ck = clk_get(NULL, "uart2_ck");
> @@ -165,16 +155,6 @@ void __init omap_serial_init(void)
> else
> clk_set_rate(uart2_ck, 48000000);
> }
> - if (cpu_is_omap15xx()) {
> - omap_cfg_reg(UART2_TX);
> - omap_cfg_reg(UART2_RTS);
> - if (machine_is_omap_innovator()) {
> - reg = fpga_read(OMAP1510_FPGA_POWER);
> - reg |= OMAP1510_FPGA_PCR_COM2_EN;
> - fpga_write(reg, OMAP1510_FPGA_POWER);
> - udelay(10);
> - }
> - }
> break;
> case 2:
> uart3_ck = clk_get(NULL, "uart3_ck");
> @@ -185,10 +165,6 @@ void __init omap_serial_init(void)
> if (cpu_is_omap15xx())
> clk_set_rate(uart3_ck, 12000000);
> }
> - if (cpu_is_omap15xx()) {
> - omap_cfg_reg(UART3_TX);
> - omap_cfg_reg(UART3_RX);
> - }
> break;
> }
> omap_serial_reset(&serial_platform_data[i]);
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
prev parent reply other threads:[~2009-10-22 18:43 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-21 0:39 [PATCH] Fix broken NAND on Amstrad Delta Janusz Krzysztofik
2009-10-21 0:51 ` Tony Lindgren
2009-10-21 10:53 ` Janusz Krzysztofik
2009-10-21 15:54 ` Tony Lindgren
2009-10-21 16:27 ` [PATCH] OMAP1: fix redundant UARTs pin muxing that can break other hardware support Janusz Krzysztofik
2009-10-22 18:43 ` Tony Lindgren [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=20091022184259.GR16230@atomide.com \
--to=tony@atomide.com \
--cc=e3-hacking@earth.li \
--cc=jkrzyszt@tis.icnet.pl \
--cc=linux-omap@vger.kernel.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.