From patchwork Tue Jan 17 12:26:08 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 91624 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp463782qgi; Tue, 17 Jan 2017 04:28:52 -0800 (PST) X-Received: by 10.99.127.71 with SMTP id p7mr45902208pgn.125.1484656132804; Tue, 17 Jan 2017 04:28:52 -0800 (PST) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id x21si24774017pgh.142.2017.01.17.04.28.52 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 17 Jan 2017 04:28:52 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) client-ip=2001:1868:205::9; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@baylibre-com.20150623.gappssmtp.com; spf=pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) smtp.mailfrom=linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cTSsc-0007NS-4O; Tue, 17 Jan 2017 12:28:50 +0000 Received: from mail-wm0-x235.google.com ([2a00:1450:400c:c09::235]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cTSr2-0004ky-Nk for linux-arm-kernel@lists.infradead.org; Tue, 17 Jan 2017 12:27:15 +0000 Received: by mail-wm0-x235.google.com with SMTP id r144so219860295wme.1 for ; Tue, 17 Jan 2017 04:26:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=8V7Z9cJr5n1/82/YU4RI1/TYB3nNTqn1Migb9Uk8kBE=; b=OS0G7ZYZJOgXc4UBHMw/svJPPPsnlUjscSZXgmkuAJwmo28rPCqgkr+jMl3ycOzPTx aRqQpWjfhCrNDFbKhlgNTJnQVy8HdD0/RTJ5YJqgWtFrfu/v/lvXuKeIrUNxZFIEWwmT 2h+KuXyTj0stdkaNC6eq5lPMt1wXIiKpZ1S5TorX24uZsfcOQ1Rhc3aaq/j9jS2Pc3L/ OhrIsBgOmbtIGGcBP8rOb/YHVvZ9mwCLUac+Dd+yp2ClXzQBBwYasJSXiuuR3C+vfV/z O/2Lnu1vZEhdduH6wSStXWkB1Vs/zuFom9s5/UcOku2zPc8CRPDJGS7gBsnUfhQ7MDWZ gexA== 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; bh=8V7Z9cJr5n1/82/YU4RI1/TYB3nNTqn1Migb9Uk8kBE=; b=mWVu1v5BATAwKhmgaNd7MuTDEVFFMIRUaHooxYVwEnxcJNPQ9/WgdBnh3HhRqXjEcc DGBaxDM4zACZh0TSBpV/ZPKEpZ48qEBZhDE8wX+BZVFSi3c/g1CvABd4koudnZV5Jtgo 7P93u1neUybjrQleNRh41PMLbSmsuqyHR58dxw/v2lLDCRj04VbQE87+H9Hn5sl+EwgV Vky2TZcScWMCTmCDFj/s5pFnHYgCL2JBAS9oeEhKOMohNxFCeJBJZjnR68tJYm2rrXIl /yP2b7K7YNNhhNQggP5Sngh92kwb03Qcg1hr8z2TRSydAl1of7kNfi5aLb7UIl6K4Mul YLfw== X-Gm-Message-State: AIkVDXKXP6EmbrHX0c65sABNWGMLjwNziAwBS+8eTd8QE09i8TOhJcxRg3ch5QghKiNwcOEK X-Received: by 10.223.136.85 with SMTP id e21mr13425800wre.28.1484656013018; Tue, 17 Jan 2017 04:26:53 -0800 (PST) Received: from bgdev-debian.lan (jua06-1-82-242-157-225.fbx.proxad.net. [82.242.157.225]) by smtp.gmail.com with ESMTPSA id o143sm5466112wmd.3.2017.01.17.04.26.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 17 Jan 2017 04:26:52 -0800 (PST) From: Bartosz Golaszewski To: Kevin Hilman , Sekhar Nori , Patrick Titiano , Michael Turquette , Tejun Heo , Rob Herring , Mark Rutland , Russell King , David Lechner Subject: [PATCH v2 06/14] ARM: davinci: da850: model the SATA refclk Date: Tue, 17 Jan 2017 13:26:08 +0100 Message-Id: <1484655976-25382-7-git-send-email-bgolaszewski@baylibre.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1484655976-25382-1-git-send-email-bgolaszewski@baylibre.com> References: <1484655976-25382-1-git-send-email-bgolaszewski@baylibre.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170117_042712_972523_4FAFC925 X-CRM114-Status: GOOD ( 14.78 ) X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [2a00:1450:400c:c09:0:0:0:235 listed in] [list.dnswl.org] 0.7 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 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: linux-ide@vger.kernel.org, Bartosz Golaszewski , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org Register a dummy clock modelling the external SATA oscillator for da850 DT mode. For non-DT boot we don't register the clock - instead we rely on the default MPY value defined in the da850 ahci driver (as is done currently). Signed-off-by: Bartosz Golaszewski --- arch/arm/mach-davinci/da8xx-dt.c | 8 ++++++++ arch/arm/mach-davinci/devices-da8xx.c | 23 +++++++++++++++++++++++ arch/arm/mach-davinci/include/mach/da8xx.h | 1 + 3 files changed, 32 insertions(+) -- 2.9.3 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel diff --git a/arch/arm/mach-davinci/da8xx-dt.c b/arch/arm/mach-davinci/da8xx-dt.c index b83e5d1..13137cb 100644 --- a/arch/arm/mach-davinci/da8xx-dt.c +++ b/arch/arm/mach-davinci/da8xx-dt.c @@ -61,6 +61,14 @@ static void __init da850_init_machine(void) pr_warn("%s: registering USB 1.1 PHY clock failed: %d", __func__, ret); + if (of_machine_is_compatible("ti,da850-evm") || + of_machine_is_compatible("ti,da850-lcdk")) { + ret = da850_register_sata_refclk(100000000); + if (ret) + pr_warn("%s: registering SATA_REFCLK clock failed: %d", + __func__, ret); + } + of_platform_default_populate(NULL, da850_auxdata_lookup, NULL); davinci_pm_init(); } diff --git a/arch/arm/mach-davinci/devices-da8xx.c b/arch/arm/mach-davinci/devices-da8xx.c index c2457b3..2bb5b69 100644 --- a/arch/arm/mach-davinci/devices-da8xx.c +++ b/arch/arm/mach-davinci/devices-da8xx.c @@ -24,6 +24,7 @@ #include #include #include +#include #include "cpuidle.h" #include "sram.h" @@ -1023,6 +1024,28 @@ int __init da8xx_register_spi_bus(int instance, unsigned num_chipselect) } #ifdef CONFIG_ARCH_DAVINCI_DA850 +static struct clk sata_refclk = { + .name = "sata_refclk", + .set_rate = davinci_simple_set_rate, +}; + +static struct clk_lookup sata_refclk_lookup = + CLK("ahci_da850", "refclk", &sata_refclk); + +int __init da850_register_sata_refclk(int rate) +{ + int ret; + + sata_refclk.rate = rate; + ret = clk_register(&sata_refclk); + if (ret) + return ret; + + clkdev_add(&sata_refclk_lookup); + + return 0; +} + static struct resource da850_sata_resources[] = { { .start = DA850_SATA_BASE, diff --git a/arch/arm/mach-davinci/include/mach/da8xx.h b/arch/arm/mach-davinci/include/mach/da8xx.h index 85ff218..7e46422 100644 --- a/arch/arm/mach-davinci/include/mach/da8xx.h +++ b/arch/arm/mach-davinci/include/mach/da8xx.h @@ -95,6 +95,7 @@ int da8xx_register_usb11(struct da8xx_ohci_root_hub *pdata); int da8xx_register_usb_refclkin(int rate); int da8xx_register_usb20_phy_clk(bool use_usb_refclkin); int da8xx_register_usb11_phy_clk(bool use_usb_refclkin); +int da850_register_sata_refclk(int rate); int da8xx_register_emac(void); int da8xx_register_uio_pruss(void); int da8xx_register_lcdc(struct da8xx_lcdc_platform_data *pdata);