From patchwork Tue Sep 29 20:44:05 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Balbi X-Patchwork-Id: 54257 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f197.google.com (mail-wi0-f197.google.com [209.85.212.197]) by patches.linaro.org (Postfix) with ESMTPS id DDA9B22B1E for ; Tue, 29 Sep 2015 20:47:03 +0000 (UTC) Received: by wicuu12 with SMTP id uu12sf11809909wic.2 for ; Tue, 29 Sep 2015 13:47:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-type:sender:precedence :list-id:x-original-sender:x-original-authentication-results :mailing-list:list-post:list-help:list-archive:list-unsubscribe; bh=FUCZM1Ta/D+f8NAffNeytJzNtmgRhtDsDi0NZiELpXc=; b=MhtFiwr3VvMymNMHED0sim25+90U5PEtYs9x2U8jxngXmjHqn/vJjqFku6OcJNRC2Z 34CGpPUUCG0/UMvk4RTfSA/wxlflihClQn6cvj8dEOwudG605g1HDS7gZNCEq8qXI4i7 VNLa3P/k1L5KSS/dUITWmMG90H8Q/kJCF2XloGtWrqLRvTLU55SIOj0+AyuCXX42tIya a3A7xGLI2sHkus2cvoRWdu1uzDTomTU2zl4OKEiMqEA6sBKdsboT/hfXRY2hOM7aLKbG w8HbJNmjZRjtunGuh1uDAux/DMrQlJ7GDOAuFPJsL1IAYq6gfE2l9z4NJBGP5jrODJge YpAA== X-Gm-Message-State: ALoCoQktCWr+WoVxWhXFQkZr2rKAt/t+kfdi0pofQPO2UCUM+0maXe5S70TuaXU5xN0rzf6P9+i+ X-Received: by 10.152.20.195 with SMTP id p3mr3125lae.5.1443559623147; Tue, 29 Sep 2015 13:47:03 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.25.16.92 with SMTP id f89ls2521lfi.25.gmail; Tue, 29 Sep 2015 13:47:02 -0700 (PDT) X-Received: by 10.152.21.41 with SMTP id s9mr9912lae.86.1443559622866; Tue, 29 Sep 2015 13:47:02 -0700 (PDT) Received: from mail-la0-f44.google.com (mail-la0-f44.google.com. [209.85.215.44]) by mx.google.com with ESMTPS id rj9si11788516lbb.26.2015.09.29.13.47.02 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 29 Sep 2015 13:47:02 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.44 as permitted sender) client-ip=209.85.215.44; Received: by labzv5 with SMTP id zv5so23413790lab.1 for ; Tue, 29 Sep 2015 13:47:02 -0700 (PDT) X-Received: by 10.112.129.202 with SMTP id ny10mr6989lbb.112.1443559622740; Tue, 29 Sep 2015 13:47:02 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.59.35 with SMTP id w3csp2361816lbq; Tue, 29 Sep 2015 13:47:01 -0700 (PDT) X-Received: by 10.66.228.97 with SMTP id sh1mr35178463pac.91.1443559621717; Tue, 29 Sep 2015 13:47:01 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id fj3si39986991pad.189.2015.09.29.13.47.01; Tue, 29 Sep 2015 13:47:01 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754834AbbI2UrA (ORCPT + 5 others); Tue, 29 Sep 2015 16:47:00 -0400 Received: from devils.ext.ti.com ([198.47.26.153]:54312 "EHLO devils.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752540AbbI2Uoq (ORCPT ); Tue, 29 Sep 2015 16:44:46 -0400 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id t8TKiIp8028368; Tue, 29 Sep 2015 15:44:18 -0500 Received: from DFLE73.ent.ti.com (dfle73.ent.ti.com [128.247.5.110]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id t8TKiIPU020571; Tue, 29 Sep 2015 15:44:18 -0500 Received: from dflp32.itg.ti.com (10.64.6.15) by DFLE73.ent.ti.com (128.247.5.110) with Microsoft SMTP Server id 14.3.224.2; Tue, 29 Sep 2015 15:44:19 -0500 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp32.itg.ti.com (8.14.3/8.13.8) with ESMTP id t8TKiHR6011995; Tue, 29 Sep 2015 15:44:18 -0500 From: Felipe Balbi To: Tony Lindgren CC: Linux OMAP Mailing List , Linux ARM Kernel Mailing List , Linux Kernel Mailing List , , , Felipe Balbi Subject: [RFC/PATCH 10/11] arm: omap2: timer: limit hwmod usage to non-DT boots Date: Tue, 29 Sep 2015 15:44:05 -0500 Message-ID: <1443559446-26969-11-git-send-email-balbi@ti.com> X-Mailer: git-send-email 2.5.3 In-Reply-To: <1443559446-26969-1-git-send-email-balbi@ti.com> References: <1443559446-26969-1-git-send-email-balbi@ti.com> MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: balbi@ti.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.44 as permitted sender) smtp.mailfrom=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , now that we have a working 32k clocksource driver, we can limit HWMOD usage to non-DT boots and rely on clocksource_of_init() every time we boot with DT. Signed-off-by: Felipe Balbi --- arch/arm/mach-omap2/timer.c | 30 +++++++++++------------------- 1 file changed, 11 insertions(+), 19 deletions(-) diff --git a/arch/arm/mach-omap2/timer.c b/arch/arm/mach-omap2/timer.c index 8b3ac8d5d38b..24c5a63c9c6e 100644 --- a/arch/arm/mach-omap2/timer.c +++ b/arch/arm/mach-omap2/timer.c @@ -398,7 +398,6 @@ static int __init __maybe_unused omap2_sync32k_clocksource_init(void) int ret; struct device_node *np = NULL; struct omap_hwmod *oh; - void __iomem *vbase; const char *oh_name = "counter_32k"; /* @@ -424,18 +423,6 @@ static int __init __maybe_unused omap2_sync32k_clocksource_init(void) omap_hwmod_setup_one(oh_name); - if (np) { - vbase = of_iomap(np, 0); - of_node_put(np); - } else { - vbase = omap_hwmod_get_mpu_rt_va(oh); - } - - if (!vbase) { - pr_warn("%s: failed to get counter_32k resource\n", __func__); - return -ENXIO; - } - ret = omap_hwmod_enable(oh); if (ret) { pr_warn("%s: failed to enable counter_32k module (%d)\n", @@ -443,13 +430,18 @@ static int __init __maybe_unused omap2_sync32k_clocksource_init(void) return ret; } - ret = omap_init_clocksource_32k(vbase); - if (ret) { - pr_warn("%s: failed to initialize counter_32k as a clocksource (%d)\n", - __func__, ret); - omap_hwmod_idle(oh); - } + if (!of_have_populated_dt()) { + void __iomem *vbase; + vbase = omap_hwmod_get_mpu_rt_va(oh); + + ret = omap_init_clocksource_32k(vbase); + if (ret) { + pr_warn("%s: failed to initialize counter_32k as a clocksource (%d)\n", + __func__, ret); + omap_hwmod_idle(oh); + } + } return ret; }