From patchwork Thu May 15 00:33:01 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Bresticker X-Patchwork-Id: 4178811 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id C269F9F271 for ; Thu, 15 May 2014 00:36:29 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EDF5320306 for ; Thu, 15 May 2014 00:36:28 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D3E98202EB for ; Thu, 15 May 2014 00:36:27 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Wkjch-0005IX-43; Thu, 15 May 2014 00:34:11 +0000 Received: from merlin.infradead.org ([2001:4978:20e::2]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WkjcM-0005EL-VG for linux-arm-kernel@bombadil.infradead.org; Thu, 15 May 2014 00:33:51 +0000 Received: from mail-oa0-f74.google.com ([209.85.219.74]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WkjcE-0002Fh-8B for linux-arm-kernel@lists.infradead.org; Thu, 15 May 2014 00:33:49 +0000 Received: by mail-oa0-f74.google.com with SMTP id m1so88330oag.5 for ; Wed, 14 May 2014 17:33:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=AS+WI7GlQp4uYezUj/T3dec0dP8HMD48TVB4ziWeKC8=; b=m3tDBI0cYY93yQPWh4yJagGyXYnxCVFsaIB9ICNtG0t+NCe/X2p12KYVgSsqlhscpa 805dswNdPj5xQ5rfwnLJRR4o2XGS/EE1ulzLQLXEZ9oxJgwe2lVzi6AXCjNVv1ptAQeW 2oP4VaFIaYOjWm6RnontxgYucSeQPG0HABNyDHs/1ardpYbhj8brFNXpkl2l4wZ2yhhX nfFWRHla0asrSTuLOv5Rw73axwku6SOkccxMzIU2U+jqW1UrT3CoPQ2r1LouX5FyMzXG eCEmau3oW5wAPgHu99uQaULyfdQAjevrIadrr2/fgvUizeHUu1wmUaKMbb1O3V+eq1JZ nQQA== X-Gm-Message-State: ALoCoQlvi9JKxC3CajPC0s6ABMJYm08y6vUjaPExWal2vwZhEiN0G5tE/6l/6Px8z/8P5jwNjWwU X-Received: by 10.182.128.166 with SMTP id np6mr3531022obb.16.1400113995492; Wed, 14 May 2014 17:33:15 -0700 (PDT) Received: from corp2gmr1-2.hot.corp.google.com (corp2gmr1-2.hot.corp.google.com [172.24.189.93]) by gmr-mx.google.com with ESMTPS id n68si93209yhj.5.2014.05.14.17.33.15 for (version=TLSv1.1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 14 May 2014 17:33:15 -0700 (PDT) Received: from abrestic.mtv.corp.google.com (abrestic.mtv.corp.google.com [172.22.72.111]) by corp2gmr1-2.hot.corp.google.com (Postfix) with ESMTP id 478735A41E5; Wed, 14 May 2014 17:33:15 -0700 (PDT) Received: by abrestic.mtv.corp.google.com (Postfix, from userid 137652) id 0BC082206A7; Wed, 14 May 2014 17:33:15 -0700 (PDT) From: Andrew Bresticker To: linux-tegra@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-usb@vger.kernel.org Subject: [RFC PATCH 05/10] ARM: tegra: Export function to read USB calibration data Date: Wed, 14 May 2014 17:33:01 -0700 Message-Id: <1400113986-339-6-git-send-email-abrestic@chromium.org> X-Mailer: git-send-email 1.9.1.423.g4596e3a In-Reply-To: <1400113986-339-1-git-send-email-abrestic@chromium.org> References: <1400113986-339-1-git-send-email-abrestic@chromium.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140514_203342_393793_32037C2E X-CRM114-Status: GOOD ( 12.56 ) X-Spam-Score: -3.3 (---) Cc: Mark Rutland , Prashant Gaikwad , Russell King , Mathias Nyman , Pawel Moll , Stephen Warren , Andrew Bresticker , Greg Kroah-Hartman , Peter De Schrijver , Ian Campbell , Kishon Vijay Abraham I , Rob Herring , Thierry Reding , Randy Dunlap , Kumar Gala , Grant Likely , Mike Turquette X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Board-specific USB configuration data is stored in FUSE_SKU_CALIB_0. Export a function to read it so the PHY can be properly configured. Signed-off-by: Andrew Bresticker --- arch/arm/mach-tegra/fuse.c | 13 +++++++++++++ include/linux/tegra-soc.h | 1 + 2 files changed, 14 insertions(+) diff --git a/arch/arm/mach-tegra/fuse.c b/arch/arm/mach-tegra/fuse.c index c9ac23b..e457ef7 100644 --- a/arch/arm/mach-tegra/fuse.c +++ b/arch/arm/mach-tegra/fuse.c @@ -34,6 +34,7 @@ #define FUSE_UID_HIGH 0x10c /* Tegra30 and later */ +#define FUSE_USB_CALIB 0x1f0 #define FUSE_VENDOR_CODE 0x200 #define FUSE_FAB_CODE 0x204 #define FUSE_LOT_CODE_0 0x208 @@ -154,6 +155,18 @@ u32 tegra_read_chipid(void) return readl_relaxed(IO_ADDRESS(TEGRA_APB_MISC_BASE) + 0x804); } +u32 tegra_read_usb_calibration_data(void) +{ + u32 reg; + + tegra_fuse_enable_clk(); + reg = tegra_fuse_readl(FUSE_USB_CALIB); + tegra_fuse_disable_clk(); + + return reg; +} +EXPORT_SYMBOL(tegra_read_usb_calibration_data); + static void __init tegra20_fuse_init_randomness(void) { u32 randomness[2]; diff --git a/include/linux/tegra-soc.h b/include/linux/tegra-soc.h index 95f611d..492dc95 100644 --- a/include/linux/tegra-soc.h +++ b/include/linux/tegra-soc.h @@ -18,5 +18,6 @@ #define __LINUX_TEGRA_SOC_H_ u32 tegra_read_chipid(void); +u32 tegra_read_usb_calibration_data(void); #endif /* __LINUX_TEGRA_SOC_H_ */