From patchwork Wed Jan 18 04:03:22 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lokesh Vutla X-Patchwork-Id: 9522747 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 9011B601B7 for ; Wed, 18 Jan 2017 06:05:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 81CBC28562 for ; Wed, 18 Jan 2017 06:05:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 76ABF28581; Wed, 18 Jan 2017 06:05:29 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ED5D628562 for ; Wed, 18 Jan 2017 06:05:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751688AbdARGF1 (ORCPT ); Wed, 18 Jan 2017 01:05:27 -0500 Received: from fllnx209.ext.ti.com ([198.47.19.16]:15930 "EHLO fllnx209.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751651AbdARGF0 (ORCPT ); Wed, 18 Jan 2017 01:05:26 -0500 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by fllnx209.ext.ti.com (8.15.1/8.15.1) with ESMTP id v0I45310002724; Tue, 17 Jan 2017 22:05:03 -0600 Received: from DFLE73.ent.ti.com (dfle73.ent.ti.com [128.247.5.110]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id v0I44wTk021940; Tue, 17 Jan 2017 22:04:58 -0600 Received: from dlep33.itg.ti.com (157.170.170.75) by DFLE73.ent.ti.com (128.247.5.110) with Microsoft SMTP Server id 14.3.294.0; Tue, 17 Jan 2017 22:04:57 -0600 Received: from a0131933.india.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep33.itg.ti.com (8.14.3/8.13.8) with ESMTP id v0I44pcJ024764; Tue, 17 Jan 2017 22:04:55 -0600 From: Lokesh Vutla To: Tony Lindgren , Linux OMAP Mailing List CC: Device Tree Mailing List , Rob Herring , Mark Rutland , Tero Kristo , Sekhar Nori , Nishanth Menon , Vignesh R , Lokesh Vutla Subject: [PATCH v2 1/5] ARM: OMAP2+: omap_hwmod: Add support for earlycon Date: Wed, 18 Jan 2017 09:33:22 +0530 Message-ID: <20170118040326.29259-2-lokeshvutla@ti.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170118040326.29259-1-lokeshvutla@ti.com> References: <20170118040326.29259-1-lokeshvutla@ti.com> MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Hwmod core tries to reset and idles each IP that is registered with hwmod. In case of earlycon, that specific uart IP cannot be reset or keep it in idle state else earlycon hangs once hwmod resets that uart IP. So add support to not reset uart that is being used as earlycon only if CONFIG_SERIAL_EARLYCON is enabled. Signed-off-by: Lokesh Vutla --- arch/arm/mach-omap2/omap_hwmod.c | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c index e8b988714a09..0da4f2ea76c4 100644 --- a/arch/arm/mach-omap2/omap_hwmod.c +++ b/arch/arm/mach-omap2/omap_hwmod.c @@ -3249,6 +3249,36 @@ int __init omap_hwmod_setup_one(const char *oh_name) } /** + * omap_hwmod_setup_earlycon_flags - set up flags for early console + * + * Enable DEBUG_OMAPUART_FLAGS for uart hwmod that is being used as + * early concole so that hwmod core doesn't reset and keep it in idle + * that specific uart. + */ +#ifdef CONFIG_SERIAL_EARLYCON +static void __init omap_hwmod_setup_earlycon_flags(void) +{ + struct device_node *np; + struct omap_hwmod *oh; + const char *uart; + + np = of_find_node_by_path("/chosen"); + if (np) { + uart = of_get_property(np, "stdout-path", NULL); + if (uart) { + np = of_find_node_by_path(uart); + if (np) { + uart = of_get_property(np, "ti,hwmods", NULL); + oh = omap_hwmod_lookup(uart); + if (oh) + oh->flags |= DEBUG_OMAPUART_FLAGS; + } + } + } +} +#endif + +/** * omap_hwmod_setup_all - set up all registered IP blocks * * Initialize and set up all IP blocks registered with the hwmod code. @@ -3261,6 +3291,9 @@ static int __init omap_hwmod_setup_all(void) _ensure_mpu_hwmod_is_setup(NULL); omap_hwmod_for_each(_init, NULL); +#ifdef CONFIG_SERIAL_EARLYCON + omap_hwmod_setup_earlycon_flags(); +#endif omap_hwmod_for_each(_setup, NULL); return 0;