From patchwork Wed Mar 14 13:05:03 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 7287 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 7EFB123DEE for ; Wed, 14 Mar 2012 13:05:24 +0000 (UTC) Received: from mail-ey0-f180.google.com (mail-ey0-f180.google.com [209.85.215.180]) by fiordland.canonical.com (Postfix) with ESMTP id 75150A18743 for ; Wed, 14 Mar 2012 13:05:24 +0000 (UTC) Received: by eaal12 with SMTP id l12so952990eaa.11 for ; Wed, 14 Mar 2012 06:05:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=XsPlSq1gH8rWpOxRWk4rho22z97geIhH7oCemoncHoI=; b=SOX7lWIa2pqDF6XSW2T3fCIqwNnrocxJkx1konjWuxRBRmSdb7f+TJRWrecUAUQ6KW j2PgTZf5ae6utP2pM8xFvKAn3C6JGRgyCzJV0kCp/g4ZO991ohPkPUVcfo14lRQHghxB gR/vW8q9NRVy83zG8Dl0UwGMlLx72RsIAzZfACe+sOAvVhonjSYayuT5ACkX33A4rwV/ mFwEZFYmkJwb5HJXi8qeX1Ue/FLNuy//E1WY0RYHtwQ9N4Vl5djW6drDpaubIbEFBjH4 mOnjKyUbVuO+5O9AVD9kF2NLL3UMrfitrItab9i3Oi3eQrHt7bVQFqQSSRfKyw/1V58D SG7g== Received: by 10.50.159.135 with SMTP id xc7mr4452379igb.50.1331730323757; Wed, 14 Mar 2012 06:05:23 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.231.53.18 with SMTP id k18csp9546ibg; Wed, 14 Mar 2012 06:05:23 -0700 (PDT) Received: by 10.216.137.226 with SMTP id y76mr1436886wei.96.1331730322659; Wed, 14 Mar 2012 06:05:22 -0700 (PDT) Received: from mail-we0-f178.google.com (mail-we0-f178.google.com [74.125.82.178]) by mx.google.com with ESMTPS id z2si23944671wiw.30.2012.03.14.06.05.22 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 14 Mar 2012 06:05:22 -0700 (PDT) Received-SPF: neutral (google.com: 74.125.82.178 is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) client-ip=74.125.82.178; Authentication-Results: mx.google.com; spf=neutral (google.com: 74.125.82.178 is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) smtp.mail=lee.jones@linaro.org Received: by mail-we0-f178.google.com with SMTP id a13so2184021wer.37 for ; Wed, 14 Mar 2012 06:05:22 -0700 (PDT) Received: by 10.180.76.74 with SMTP id i10mr17014565wiw.2.1331730322218; Wed, 14 Mar 2012 06:05:22 -0700 (PDT) Received: from localhost.localdomain (cpc1-aztw13-0-0-cust473.18-1.cable.virginmedia.com. [77.102.241.218]) by mx.google.com with ESMTPS id fi4sm11477024wib.4.2012.03.14.06.05.20 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 14 Mar 2012 06:05:21 -0700 (PDT) From: Lee Jones To: linux-arm-kernel@lists.infradead.org Cc: linus.walleij@linaro.org, arnd@arndb.de, niklas.hernaeus@stericsson.com, Lee Jones Subject: [PATCH 07/10] ARM: ux500: Provide local timer support for Device Tree Date: Wed, 14 Mar 2012 13:05:03 +0000 Message-Id: <1331730306-11461-8-git-send-email-lee.jones@linaro.org> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1331730306-11461-1-git-send-email-lee.jones@linaro.org> References: <1331730306-11461-1-git-send-email-lee.jones@linaro.org> X-Gm-Message-State: ALoCoQnVgVRsAe6rp2fJWfo4AkQMzhc6HhS7yu94XqL3458cek1Z70MEqVqe6MgyrLVX7XHoS2l0 This enables local timer (AKA: private timer) support for all u8500 based hardware using DT. Signed-off-by: Lee Jones --- arch/arm/boot/dts/db8500.dtsi | 6 ++++++ arch/arm/mach-ux500/localtimer.c | 18 +++++++++++++++++- 2 files changed, 23 insertions(+), 1 deletions(-) diff --git a/arch/arm/boot/dts/db8500.dtsi b/arch/arm/boot/dts/db8500.dtsi index cce5df8..35d0146 100644 --- a/arch/arm/boot/dts/db8500.dtsi +++ b/arch/arm/boot/dts/db8500.dtsi @@ -34,6 +34,12 @@ interrupts = <7>; }; + timer@a0410600 { + compatible = "arm,smp-twd"; + reg = <0xa0410600 0x20>; + interrupts = <1 13 0x304>; + }; + rtc@80154000 { compatible = "stericsson,db8500-rtc"; reg = <0x80154000 0x1000>; diff --git a/arch/arm/mach-ux500/localtimer.c b/arch/arm/mach-ux500/localtimer.c index 5ba1133..295e580 100644 --- a/arch/arm/mach-ux500/localtimer.c +++ b/arch/arm/mach-ux500/localtimer.c @@ -14,6 +14,10 @@ #include #include +#include +#include +#include + #include #include #include @@ -23,7 +27,19 @@ */ int __cpuinit local_timer_setup(struct clock_event_device *evt) { - evt->irq = IRQ_LOCALTIMER; + struct device_node *np; + + np = of_find_compatible_node(NULL, NULL, "arm,smp-twd"); + if (np) { + if (!twd_base) { + twd_base = of_iomap(np, 0); + WARN_ON(!twd_base); + } + evt->irq = irq_of_parse_and_map(np, 0); + } + else + evt->irq = IRQ_LOCALTIMER; + twd_timer_setup(evt); return 0; }