From patchwork Mon Apr 8 06:28:13 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 10888837 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id EEBB51390 for ; Mon, 8 Apr 2019 06:36:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D142C26E3C for ; Mon, 8 Apr 2019 06:36:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C523D2861C; Mon, 8 Apr 2019 06:36:18 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 56AD828619 for ; Mon, 8 Apr 2019 06:36:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=mk3dixj0DT8gOvAWjVO6U9iarrb0cX2f/zWPTfDeVLo=; b=uJlqzXSXjsotCQ C9GHB6c2pR3uRAxLi0nXAery6K5ABeuvMrdsoyaPUzOcy4Jn7Rt/vpLcIhnTZRz68fNTIjg7+u6Y9 wMM+3I+be3nO7U3KpAQccTiLPE6tAvg9vr+yhCbGs28RpWJ2jK/LnJQS/H8hF6bBwo93fHiQ/nc/7 3mARq7mCWPeuDzueSFaXLRIZ01J5ccMbOA7CYuUoNgT7jfPwbQLr/G6f7mHR7yhdsiLV8LAqK++Vq tQfuWXjvgQ4gryeJB+VhjsPCvuQcNBcNS2yEnHL/+IkSRY+/nm/N7dPuDO0r27Nsny24SoW0Bw02S Wy3zPEkEJdMYn8PMb7VQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hDNtB-00035D-6x; Mon, 08 Apr 2019 06:36:17 +0000 Received: from merlin.infradead.org ([2001:8b0:10b:1231::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hDNmJ-0004LJ-PS for linux-arm-kernel@bombadil.infradead.org; Mon, 08 Apr 2019 06:29:11 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=1G72mLPRKFM9G3uYAzHKLGQ+L2FE5nDzoDN/yrlcWqs=; b=0nL7rbR6Vzr1ft1Uid2CBkrrB6 YTMH1l3Icl30TluUuync2TWdS79hyNVfeBGitvx0EtqGpX0hF1+mywcSB81hgwLUEVAAblzcQsDUa bs8PliIVni2SnH25WDnlTig/2efsMFijLskRaHMzkjiTBYkBTewPTM038X4G4d4RGoJxdzM+UcIdk +4XmZ5CmE5ExzWGtqnvgqj1RuhXwCeCQCzDU2YnlyP0iLsSRK4luQioFKA2lwIZBH9oKjfQK+hMYY Dfu8nJ2pFCT2JmB2Uda4TKB5tMZ2wA0lNJUlA0hatReRI7VPggi8PXEASwh9VG01YxF6GygtSDDBg fReyFv8w==; Received: from mail-lj1-x243.google.com ([2a00:1450:4864:20::243]) by merlin.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hDNmF-0003tG-U7 for linux-arm-kernel@lists.infradead.org; Mon, 08 Apr 2019 06:29:09 +0000 Received: by mail-lj1-x243.google.com with SMTP id f23so10142080ljc.0 for ; Sun, 07 Apr 2019 23:29:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=1G72mLPRKFM9G3uYAzHKLGQ+L2FE5nDzoDN/yrlcWqs=; b=RsQMkOZZdT3zY6Mx/zlj1Lwm0TN+5zSQ7Y29lTEPAPBh0TuOt4cpxHKrCXM92hBm/c BmBRHEO0s4KQXvScW2EuJK6AN2JTSNso6k7s7cxKBe6cXhm9+Dq7e2uPjPqItbP5P7Kh G1mUGZLf+fzNH1XLGoGfi8gW5vg8+ppC8Yd107UTvI2OSSu5xNeiOD2BOPyjphcGc/Oq opg9YGe8xbozlhJDdL89mP1bvqxGJF1I25joQ9pyUUa8I/jnMsoTsGB5MjRkM+3bYZrv 7cBfh4NcP3oqsB6FsOtTXdXEakWdBWz7+t80kZ1iJQYgsXUR7Ea7xEMpWvUjCBAGMc70 s2og== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=1G72mLPRKFM9G3uYAzHKLGQ+L2FE5nDzoDN/yrlcWqs=; b=Frzt6bnBC3qHJk9+Il5cFNConfQ0U+TYNDKL5xn26w+pSGcrOVKkStETo8iPlAJJgw 1866fvr54BO0KNgWzyI1aoYhuXA7mpPIVawxl7PNbqxAIOath+vsjPaMzBdlxGAHo7oa ltoE6gHoqKPHKLxUMazKDrm4RoRnvKHyB2Ms3ux+9I3qOkZYuL0ASAcZQ3P5BhmRtSuZ wHt6oZoWP/NOxpA/3TM+/E+yYS+zDRymw5syCY8DYSOK5bimkNYr1bqPGneaUgmtSIhm kf9UMJLMwMfEFUZ4OztiTeA536cwzT8HzDfpoUDgrKb1csNXe2xvU+PWSaMwsknhIZXD Mb0Q== X-Gm-Message-State: APjAAAX5+LyZyGPVTzoafL1/xl6G4zrwRxurOXMS9CeP5nMpEM9/9iiN w7bth61xI6I5ZRynDf8TVQGwB4w04hM= X-Google-Smtp-Source: APXvYqwy8Bb77iaHG1RTMhATaRhiYMpPsZsGUZ5vpMols4pBZr40uJGRDdhFfW+VIrhdsBoFDpIoOQ== X-Received: by 2002:a05:651c:c3:: with SMTP id 3mr5398420ljr.8.1554704941568; Sun, 07 Apr 2019 23:29:01 -0700 (PDT) Received: from localhost.bredbandsbolaget (c-ae7b71d5.014-348-6c756e10.bbcust.telenor.se. [213.113.123.174]) by smtp.gmail.com with ESMTPSA id v11sm5884443lfb.68.2019.04.07.23.29.00 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 07 Apr 2019 23:29:00 -0700 (PDT) From: Linus Walleij To: linux-arm-kernel@lists.infradead.org, Imre Kaloz , Krzysztof Halasa Subject: [PATCH 13/31 v3] clocksource/drivers/ixp4xx: Add OF initialization support Date: Mon, 8 Apr 2019 08:28:13 +0200 Message-Id: <20190408062831.16422-14-linus.walleij@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190408062831.16422-1-linus.walleij@linaro.org> References: <20190408062831.16422-1-linus.walleij@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190408_022908_318469_ED8ABF44 X-CRM114-Status: GOOD ( 16.00 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Linus Walleij , Daniel Lezcano , Thomas Gleixner Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP This adds support for setting up the IXP4xx timer driver from device tree. Cc: Thomas Gleixner Acked-by: Daniel Lezcano Signed-off-by: Linus Walleij --- ChangeLog v1->v3: - Rebased on v5.1-rc1 - Requesting an ACK from the clocksource maintainers, see my reply to Daniel: https://marc.info/?l=linux-arm-kernel&m=155160578307914&w=2 --- drivers/clocksource/timer-ixp4xx.c | 35 ++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/drivers/clocksource/timer-ixp4xx.c b/drivers/clocksource/timer-ixp4xx.c index fa78f80792db..404445bc11ea 100644 --- a/drivers/clocksource/timer-ixp4xx.c +++ b/drivers/clocksource/timer-ixp4xx.c @@ -16,6 +16,8 @@ #include #include #include +#include +#include /* Goes away with OF conversion */ #include @@ -247,3 +249,36 @@ void __init ixp4xx_timer_setup(resource_size_t timerbase, ixp4xx_timer_register(base, timer_irq, timer_freq); } EXPORT_SYMBOL_GPL(ixp4xx_timer_setup); + +#ifdef CONFIG_OF +static __init int ixp4xx_of_timer_init(struct device_node *np) +{ + void __iomem *base; + int irq; + int ret; + + base = of_iomap(np, 0); + if (!base) { + pr_crit("IXP4xx: can't remap timer\n"); + return -ENODEV; + } + + irq = irq_of_parse_and_map(np, 0); + if (irq <= 0) { + pr_err("Can't parse IRQ\n"); + ret = -EINVAL; + goto out_unmap; + } + + /* TODO: get some fixed clocks into the device tree */ + ret = ixp4xx_timer_register(base, irq, 66666000); + if (ret) + goto out_unmap; + return 0; + +out_unmap: + iounmap(base); + return ret; +} +TIMER_OF_DECLARE(ixp4xx, "intel,ixp4xx-timer", ixp4xx_of_timer_init); +#endif