From patchwork Thu Oct 4 16:07:47 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Petazzoni X-Patchwork-Id: 1547011 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 400933FC1A for ; Thu, 4 Oct 2012 16:08:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757073Ab2JDQIG (ORCPT ); Thu, 4 Oct 2012 12:08:06 -0400 Received: from mail.free-electrons.com ([88.190.12.23]:43877 "EHLO mail.free-electrons.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757016Ab2JDQIF (ORCPT ); Thu, 4 Oct 2012 12:08:05 -0400 Received: by mail.free-electrons.com (Postfix, from userid 106) id 790BE16D; Thu, 4 Oct 2012 18:07:16 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.free-electrons.com X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 shortcircuit=no autolearn=ham version=3.3.1 Received: from skate (humanoidz.org [82.247.183.72]) by mail.free-electrons.com (Postfix) with ESMTPSA id 70A8BDE; Thu, 4 Oct 2012 18:07:04 +0200 (CEST) Date: Thu, 4 Oct 2012 18:07:47 +0200 From: Thomas Petazzoni To: Kevin Hilman Cc: Tony Lindgren , linux-omap@vger.kernel.org, Enric Balletbo i Serra , Gregory =?UTF-8?B?Q2zDqW1lbnQ=?= , Michael Opdenacker , Maxime Ripard Subject: Re: ttyO2 broken on IGEPv2 on 3.3, 3.4-rc5 or arm-soc/for-next, working on 3.2 Message-ID: <20121004180747.3b342904@skate> In-Reply-To: <878vh78q7b.fsf@ti.com> References: <20120504155255.140b4e3f@skate> <87397fewso.fsf@ti.com> <20120504175124.GI5613@atomide.com> <878vh78q7b.fsf@ti.com> Organization: Free Electrons X-Mailer: Claws Mail 3.8.0 (GTK+ 2.24.10; x86_64-pc-linux-gnu) Mime-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org Kevin, Reviving an old thread. On Fri, 04 May 2012 16:46:32 -0700, Kevin Hilman wrote: > >> Thomas Petazzoni writes: > >> > >> > I have an IGEPv2 revision 6 board, which uses the DM3730 OMAP3. > >> > With 3.2 omap2plus_defconfig, the system boots fine and have a > >> > working shell on ttyO2. On either 3.3, 3.4-rc5 or > >> > arm-soc/for-next from Arnd, the system boots all the way up to > >> > showing the shell prompt, but I can't type any character, as if > >> > UART RX was broken. > >> > >> On v3.4-rc, can you see if reverting > >> bce492c04ba8fc66a4ea0a52b181ba255daaaf54 has any effect? > >> > >> That patch had some unfortunate side effects, but I haven't seen > >> the problem you see, so I'm not sure if it's related. > > > > Reverting bce492c04ba8fc66a4ea0a52b181ba255daaaf54 is a broken > > solution like you mentioned. But if it helps, then the proper fix > > is to add muxing to board-*.c files for the uart pins and use > > omap_serial_init_port for each uart instead of omap_serial_init. > > That should fix the wake-up issues too. > > I agree on the final solution, but just wanted to see if the missing > mux (and thus disabled runtime PM) is what's causing the problem. FWIW, I tried the recently released 3.6 kernel on this platform (IGEPv2, OMAP3-based), and I still see the same problem. Upon Tony's suggestion, I tried to add some code in board-igep0020.c similar to the one in board-n8x0.c to do the appropriate UART2 muxing, but it doesn't seem to improve the situation. I did the following change (note that I tried with both .name = "uart2_rx_irrx.uart2_rx_irrx" and .name = "uart3_rx_irrx.uart3_rx_irrx"). On this board, the console is on ttyO2. This is with the plain omap2plus_defconfig, so CONFIG_OMAP_MUX is enabled. Any idea of things to try? This board has been broken since 3.2, so I'd like to get it fixed at some point :-) diff --git a/arch/arm/mach-omap2/board-igep0020.c b/arch/arm/mach-omap2/board-igep0020.c index 2821448..568f13e 100644 --- a/arch/arm/mach-omap2/board-igep0020.c +++ b/arch/arm/mach-omap2/board-igep0020.c @@ -558,6 +558,43 @@ static struct omap_board_mux board_mux[] __initdata = { OMAP3_MUX(MCSPI1_CS2, OMAP_MUX_MODE4 | OMAP_PIN_INPUT), { .reg_offset = OMAP_MUX_TERMINATOR }, }; + +static struct omap_device_pad serial2_pads[] __initdata = { + { + .name = "uart2_rx_irrx.uart2_rx_irrx", + .flags = OMAP_DEVICE_PAD_REMUX | OMAP_DEVICE_PAD_WAKEUP, + .enable = OMAP_MUX_MODE0, + .idle = OMAP_MUX_MODE3 /* Mux as GPIO for idle */ + }, +}; + +static inline void board_serial_init(void) +{ + struct omap_board_data bdata; + + bdata.flags = 0; + bdata.pads = NULL; + bdata.pads_cnt = 0; + + bdata.id = 0; + omap_serial_init_port(&bdata, NULL); + + bdata.id = 1; + omap_serial_init_port(&bdata, NULL); + + bdata.id = 2; + bdata.pads = serial2_pads; + bdata.pads_cnt = ARRAY_SIZE(serial2_pads); + omap_serial_init_port(&bdata, NULL); +} + +#else + +static inline void board_serial_init(void) +{ + omap_serial_init(); +} + #endif #if defined(CONFIG_LIBERTAS_SDIO) || defined(CONFIG_LIBERTAS_SDIO_MODULE) @@ -621,7 +658,7 @@ static void __init igep_init(void) /* Register I2C busses and drivers */ igep_i2c_init(); platform_add_devices(igep_devices, ARRAY_SIZE(igep_devices)); - omap_serial_init(); + board_serial_init(); omap_sdrc_init(m65kxxxxam_sdrc_params, m65kxxxxam_sdrc_params); usb_musb_init(NULL);