From patchwork Tue Nov 20 14:33:48 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 13007 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 C888D23FC2 for ; Tue, 20 Nov 2012 14:34:12 +0000 (UTC) Received: from mail-ia0-f180.google.com (mail-ia0-f180.google.com [209.85.210.180]) by fiordland.canonical.com (Postfix) with ESMTP id 67FC2A191A8 for ; Tue, 20 Nov 2012 14:34:12 +0000 (UTC) Received: by mail-ia0-f180.google.com with SMTP id t4so1740455iag.11 for ; Tue, 20 Nov 2012 06:34:11 -0800 (PST) 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=B0uW4vSYCe7jLwXhNnvpXHK6BlmVECrmZnWc1m4hHDU=; b=j66QaHLUbmyDWgsVigWCgL64Vc/LjpDwyDgGTs19VcUcRTDcIob4sieij+WAbooXUt Fjj+ZqqxFLO9UMAf1mdJveynvTsYyvSFUxskyVeK8mfW6I/MTha+neElGCBIS9WjQhif DFrbDKVDmVYzhXbddif+ndd4ElNFVzDCconKUUYwgTACtHe/Zq4EIE0OksBm/RBv3uIq sNlI8l3VvvORMcMJokG930IbvW/oh/2qlLwl3LqhSdhuQao6YJ4MLCth2tzKZpTrOJvV Mp/kNkGOfMZZqA5cxdUUo/Ts0EPKaBswXIiiqCtijIIaJq6Apyw1NYMbBr4riQYUz/oG kL+Q== Received: by 10.50.42.168 with SMTP id p8mr10117344igl.57.1353422051680; Tue, 20 Nov 2012 06:34:11 -0800 (PST) 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.50.67.148 with SMTP id n20csp326824igt; Tue, 20 Nov 2012 06:34:11 -0800 (PST) Received: by 10.180.87.39 with SMTP id u7mr14827995wiz.6.1353422050526; Tue, 20 Nov 2012 06:34:10 -0800 (PST) Received: from mail-wg0-f41.google.com (mail-wg0-f41.google.com [74.125.82.41]) by mx.google.com with ESMTPS id x5si7126626wex.150.2012.11.20.06.34.09 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 20 Nov 2012 06:34:10 -0800 (PST) Received-SPF: neutral (google.com: 74.125.82.41 is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) client-ip=74.125.82.41; Authentication-Results: mx.google.com; spf=neutral (google.com: 74.125.82.41 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-wg0-f41.google.com with SMTP id ds1so1501019wgb.4 for ; Tue, 20 Nov 2012 06:34:09 -0800 (PST) Received: by 10.216.207.139 with SMTP id n11mr3434169weo.211.1353422049709; Tue, 20 Nov 2012 06:34:09 -0800 (PST) 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 bn7sm20254052wib.8.2012.11.20.06.34.07 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 20 Nov 2012 06:34:08 -0800 (PST) From: Lee Jones To: u-boot@lists.denx.de Cc: Lee Jones Subject: [PATCH 2/8] u8500: Add utimer support Date: Tue, 20 Nov 2012 14:33:48 +0000 Message-Id: <1353422034-28107-3-git-send-email-lee.jones@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1353422034-28107-1-git-send-email-lee.jones@linaro.org> References: <1353422034-28107-1-git-send-email-lee.jones@linaro.org> X-Gm-Message-State: ALoCoQl3I59X8ZXe4QD1QqtBMhTS13AUV+BeqcXg+H+dXkYT1CALvOVXe2aLQJjnp3c42etE3hTD Provide support for microsecond level timer support. Signed-off-by: Lee Jones --- arch/arm/cpu/armv7/u8500/timer.c | 5 +++++ include/common.h | 1 + 2 files changed, 6 insertions(+) diff --git a/arch/arm/cpu/armv7/u8500/timer.c b/arch/arm/cpu/armv7/u8500/timer.c index 40326d8..d9a6a2d 100644 --- a/arch/arm/cpu/armv7/u8500/timer.c +++ b/arch/arm/cpu/armv7/u8500/timer.c @@ -129,6 +129,11 @@ ulong get_timer(ulong base) return get_timer_masked() - base; } +u64 get_timer_us(void) +{ + return COUNT_TO_USEC(READ_TIMER()); +} + /* * Emulation of Power architecture long long timebase. * diff --git a/include/common.h b/include/common.h index 5e3c5ee..5d24add 100644 --- a/include/common.h +++ b/include/common.h @@ -690,6 +690,7 @@ void irq_install_handler(int, interrupt_handler_t *, void *); void irq_free_handler (int); void reset_timer (void); ulong get_timer (ulong base); +ulong get_timer_us (void); void enable_interrupts (void); int disable_interrupts (void);