From patchwork Tue Jan 17 12:26:03 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 91611 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp463047qgi; Tue, 17 Jan 2017 04:27:02 -0800 (PST) X-Received: by 10.99.163.109 with SMTP id v45mr23888628pgn.39.1484656022460; Tue, 17 Jan 2017 04:27:02 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f8si24809716pln.60.2017.01.17.04.27.02; Tue, 17 Jan 2017 04:27:02 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751253AbdAQM0p (ORCPT + 25 others); Tue, 17 Jan 2017 07:26:45 -0500 Received: from mail-wm0-f50.google.com ([74.125.82.50]:37892 "EHLO mail-wm0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751203AbdAQM0m (ORCPT ); Tue, 17 Jan 2017 07:26:42 -0500 Received: by mail-wm0-f50.google.com with SMTP id r144so219852791wme.1 for ; Tue, 17 Jan 2017 04:26:42 -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=Zva9RI733OBesD1v0YIFoB9qRounbMXDauJXHEeeszo=; b=jG8MRh6AxqIbqbsDCp1O+EjQ2IJzuuOUnRq5Wo6tF0fM67OWYNKFKx2uIEawbzdYy3 qqWnVRPVZeIOLXN2C/z+nTp4jrJBEmEjldB8+V/excTJTe5jfVGTLBCnscvDOyNGh58S 0e1Y7poC+u+qMEAQrdOeRJxA1UbnAmA+8qSnKVhMGHs4rNydChgIjooscgPBigqCvQTp 96Nbietl1ONSPCYsnRcHHMr/x4a8m8P00V5eucr9Lrtf6y1zNhqXD8PNuc4OTI+QWuQ3 jDa3FCc/KqUYMp8qbqbm+FI19iuAEOTPaNn8rtQGTpaYI9CkpyoP7wsgMR/jjPNi2E3W CSdQ== 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=Zva9RI733OBesD1v0YIFoB9qRounbMXDauJXHEeeszo=; b=G3jsPrdoI1SNJvZI240Yz6lumGxFzOOlngP9v3ALuCwTW4Q4rNvxAKRcFkBe4UNMsp ARBHs7YHh/I4t5D6XkkfTv0bhygICrsIOi/nDEV22xS6Vf1Jtt+5DOB6XRv2LBOXaT03 5St9nUSKEpbRFzu2uJY5ljIWobeeeTk4LYht6O1D+xdTqTZvO+zZZ5iMzYVVS/6nO080 b0oUV8yUYUz9i/FZLZQe82EXwBXG8XUdcDHHBLaD0l7LpLOzHuGDkykDgYstdShmmthJ rvUgnCsK1vfPQsK1s0j5GPm+GqwAjYDKt5bvokCnbRTxConZeFQbhcZcKFjg5MSpjcqa qs9w== X-Gm-Message-State: AIkVDXIduxA3vEUFZ/Odoy74c/+kFslfSLCsYuAbCMxT7OAhMDwTdZ1WAyfpBjT3IVvEoCGL X-Received: by 10.28.99.66 with SMTP id x63mr15487578wmb.4.1484656001274; Tue, 17 Jan 2017 04:26:41 -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.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 17 Jan 2017 04:26:40 -0800 (PST) From: Bartosz Golaszewski To: Kevin Hilman , Sekhar Nori , Patrick Titiano , Michael Turquette , Tejun Heo , Rob Herring , Mark Rutland , Russell King , David Lechner Cc: linux-ide@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Bartosz Golaszewski Subject: [PATCH v2 01/14] devicetree: bindings: add bindings for ahci-da850 Date: Tue, 17 Jan 2017 13:26:03 +0100 Message-Id: <1484655976-25382-2-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> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add DT bindings for the TI DA850 AHCI SATA controller. Signed-off-by: Bartosz Golaszewski --- Documentation/devicetree/bindings/ata/ahci-da850.txt | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 Documentation/devicetree/bindings/ata/ahci-da850.txt -- 2.9.3 diff --git a/Documentation/devicetree/bindings/ata/ahci-da850.txt b/Documentation/devicetree/bindings/ata/ahci-da850.txt new file mode 100644 index 0000000..e7111b4 --- /dev/null +++ b/Documentation/devicetree/bindings/ata/ahci-da850.txt @@ -0,0 +1,18 @@ +Device tree binding for the TI DA850 AHCI SATA Controller +--------------------------------------------------------- + +Required properties: + - compatible: must be "ti,da850-ahci" + - reg: physical base addresses and sizes of the controller's register areas + - interrupts: interrupt specifier (refer to the interrupt binding) + +Optional properties: + - clocks: clock specifier (refer to the common clock binding) + +Example: + + sata: ahci@218000 { + compatible = "ti,da850-ahci"; + reg = <0x218000 0x2000>, <0x22c018 0x4>; + interrupts = <67>; + }; From patchwork Tue Jan 17 12:26:04 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 91612 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp463051qgi; Tue, 17 Jan 2017 04:27:02 -0800 (PST) X-Received: by 10.98.25.21 with SMTP id 21mr21772138pfz.46.1484656022881; Tue, 17 Jan 2017 04:27:02 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f8si24809716pln.60.2017.01.17.04.27.02; Tue, 17 Jan 2017 04:27:02 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751288AbdAQM0t (ORCPT + 25 others); Tue, 17 Jan 2017 07:26:49 -0500 Received: from mail-wm0-f43.google.com ([74.125.82.43]:37932 "EHLO mail-wm0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751240AbdAQM0p (ORCPT ); Tue, 17 Jan 2017 07:26:45 -0500 Received: by mail-wm0-f43.google.com with SMTP id r144so219854656wme.1 for ; Tue, 17 Jan 2017 04:26:45 -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=SuLhxCo93043rn2eTnXL5rUa/MT6PfsUvS81uBerQyc=; b=iLYPGOQ0UBKy0UNsbM7XVlycCYcMR9HBYqIt9cGRnnO9V6fyl0+J96aSPydnYgbLLK ncNvhXxiMEQ88yfM9EcZV5kyBbP8lTAZlMiaQPqHvU6ZVcn0zVtKXm1CSI1uMapCDk94 Czgr2ZngtwZMQAwNsbSXPACx5qiyBJhFLcU9ZrLF/NaFYhiDB/rVU96XVd5SDpwrZ4Qi Ok8zxEr5V0iviQgDbbE51K43+WZftGaocr3lGtqgpFPwv4wzsYKrgJccfOQtV0aR2h+t KkpTThEdwef9SgTr/OZPQlEzYDxasresjqryg2JsRf61vdYQfDl49mniJBhiAoyNHkhm Kdpw== 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=SuLhxCo93043rn2eTnXL5rUa/MT6PfsUvS81uBerQyc=; b=K8LiXr/TckceqYC2qYYsrpXLjhqKy38498eQcgnOO8dIYfuh+/audVpkoY9JBJTTWL Tmxj3+wcgOuG7dWcDet/Psyd8K+v0Sh3xCzhL9OF/FVU6Cd9t2+jWXSTYMOhPElzyS0M 90jiNhSfo8JbdCvr+o/2MfQp2Ss8JOVUyeCmFZe8j9U1XpDdqvTgPoF31FdfUhl3xLKk cY6TTajrjaUPER4Ngi/pChHhGOsZYTS46EBtNdHmrOX0jIJmfatVYQGTqwQ9q+tbg9t7 GV8INRVMfhHlmo58XKZtznH4br/oQ+IR9hhs/QxuZ6f7va2Ty7rODOG0l6ci9U9cdvE2 4GWA== X-Gm-Message-State: AIkVDXLPvYsP7rnW9ymqagCJaiEq5JbyhDbXC3751HzEAiQFBmVyeMRB7WYwgTMn6oByzcDp X-Received: by 10.223.151.205 with SMTP id t13mr27517321wrb.9.1484656004324; Tue, 17 Jan 2017 04:26:44 -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.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 17 Jan 2017 04:26:43 -0800 (PST) From: Bartosz Golaszewski To: Kevin Hilman , Sekhar Nori , Patrick Titiano , Michael Turquette , Tejun Heo , Rob Herring , Mark Rutland , Russell King , David Lechner Cc: linux-ide@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Bartosz Golaszewski Subject: [PATCH v2 02/14] ARM: davinci_all_defconfig: enable SATA modules Date: Tue, 17 Jan 2017 13:26:04 +0100 Message-Id: <1484655976-25382-3-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> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add the da850-ahci driver to davinci defconfig. Signed-off-by: Bartosz Golaszewski --- arch/arm/configs/davinci_all_defconfig | 2 ++ 1 file changed, 2 insertions(+) -- 2.9.3 diff --git a/arch/arm/configs/davinci_all_defconfig b/arch/arm/configs/davinci_all_defconfig index 8806754..a1b9c58 100644 --- a/arch/arm/configs/davinci_all_defconfig +++ b/arch/arm/configs/davinci_all_defconfig @@ -78,6 +78,8 @@ CONFIG_IDE=m CONFIG_BLK_DEV_PALMCHIP_BK3710=m CONFIG_SCSI=m CONFIG_BLK_DEV_SD=m +CONFIG_ATA=m +CONFIG_AHCI_DA850=m CONFIG_NETDEVICES=y CONFIG_NETCONSOLE=y CONFIG_TUN=m From patchwork Tue Jan 17 12:26:05 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 91613 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp463055qgi; Tue, 17 Jan 2017 04:27:03 -0800 (PST) X-Received: by 10.84.232.141 with SMTP id i13mr54963993plk.119.1484656023345; Tue, 17 Jan 2017 04:27:03 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f8si24809716pln.60.2017.01.17.04.27.02; Tue, 17 Jan 2017 04:27:03 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751325AbdAQM0z (ORCPT + 25 others); Tue, 17 Jan 2017 07:26:55 -0500 Received: from mail-wm0-f43.google.com ([74.125.82.43]:33531 "EHLO mail-wm0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751240AbdAQM0w (ORCPT ); Tue, 17 Jan 2017 07:26:52 -0500 Received: by mail-wm0-f43.google.com with SMTP id d140so20521214wmd.0 for ; Tue, 17 Jan 2017 04:26:52 -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=pEMVlKeHnZyLbrskLNP5Hg/U2D2r0K/Mtr19y5+6CCg=; b=QsYqh7f1VlZKmBWWB6xgbc1rzIHvxXMZtrYIpRW7lMWFLZ+uozxYdmElQaopvtoiQA E9kCpa00xCFg/aF5n2vWU7V+0b+WhgnntPFwlI4PAKCbYrYiuW0camJaOC7un+YQdNuC MbnBekyJppS49pPoM7C72Fsia/JOCIt/s3/yPewdu5n3Xtuh3Eemvzs6XMhbPam+E51x CPvfh4swiiuI8OGNE6bQyklO8GYhBey28U9PaMXJJb8l9ycjFDyH6DPI5v7NenFiyKyS OVMBlSH35SgZy88U1985/7ADCJpOSAQxag7CwmES0hnXDl937RJqnoy3ubsZQXimkyTv uXow== 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=pEMVlKeHnZyLbrskLNP5Hg/U2D2r0K/Mtr19y5+6CCg=; b=Irdsg0eX8Dxuqsuw65vJkSg1gzj1HWdF6re0U3F6JCyG2kZE8vtw1ZuMdKVMwjj2Dt UHZZod0oBBf4+fXPSJQXFwbYOBDYeu11NuL3peukMukz3bxxcJk4ti3K7j8bTdxXk8Ba q9DGV+wPyRYl6MVPQu8v2UOTWSj5fPWRfzCvCR6yOCCjrpaTWKD3AvnO1JxtrllfVy19 OcRXK7v8jJP7p/Y4/RP91GxiyQldiYUl6t4LREgsx0zc0qUuHaV88WmGYPulheKvqmUf NdnAcCVbAKUi+sgQVFC89mOP+H1ekBmT9uP634Q/vtq6RZgsvLFKGrNEbXtd/6UPCON5 UF/w== X-Gm-Message-State: AIkVDXKvQKBTrOA8OeBPtJisMjSN+3KapddggH3zlagk+Lu1klOPNLMQdqy6Fmi/YgtYBqjo X-Received: by 10.223.150.238 with SMTP id u101mr22880878wrb.175.1484656006338; Tue, 17 Jan 2017 04:26:46 -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.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 17 Jan 2017 04:26:45 -0800 (PST) From: Bartosz Golaszewski To: Kevin Hilman , Sekhar Nori , Patrick Titiano , Michael Turquette , Tejun Heo , Rob Herring , Mark Rutland , Russell King , David Lechner Cc: linux-ide@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Bartosz Golaszewski Subject: [PATCH v2 03/14] ARM: davinci: add a clock lookup entry for the SATA clock Date: Tue, 17 Jan 2017 13:26:05 +0100 Message-Id: <1484655976-25382-4-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> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This entry is needed for the ahci driver to get a functional clock. Signed-off-by: Bartosz Golaszewski --- arch/arm/mach-davinci/da8xx-dt.c | 1 + 1 file changed, 1 insertion(+) -- 2.9.3 diff --git a/arch/arm/mach-davinci/da8xx-dt.c b/arch/arm/mach-davinci/da8xx-dt.c index 9ee44da..b83e5d1 100644 --- a/arch/arm/mach-davinci/da8xx-dt.c +++ b/arch/arm/mach-davinci/da8xx-dt.c @@ -42,6 +42,7 @@ static struct of_dev_auxdata da850_auxdata_lookup[] __initdata = { OF_DEV_AUXDATA("ti,da830-ohci", 0x01e25000, "ohci-da8xx", NULL), OF_DEV_AUXDATA("ti,da830-musb", 0x01e00000, "musb-da8xx", NULL), OF_DEV_AUXDATA("ti,da830-usb-phy", 0x01c1417c, "da8xx-usb-phy", NULL), + OF_DEV_AUXDATA("ti,da850-ahci", 0x01e18000, "ahci_da850", NULL), {} }; From patchwork Tue Jan 17 12:26:06 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 91621 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp463450qgi; Tue, 17 Jan 2017 04:28:03 -0800 (PST) X-Received: by 10.98.50.66 with SMTP id y63mr18085486pfy.21.1484656083255; Tue, 17 Jan 2017 04:28:03 -0800 (PST) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id t6si24794442pfi.59.2017.01.17.04.28.03 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 17 Jan 2017 04:28:03 -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 1cTSrp-00067z-Bs; Tue, 17 Jan 2017 12:28:01 +0000 Received: from mail-wm0-x230.google.com ([2a00:1450:400c:c09::230]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cTSr0-0004ku-2t for linux-arm-kernel@lists.infradead.org; Tue, 17 Jan 2017 12:27:12 +0000 Received: by mail-wm0-x230.google.com with SMTP id r126so198492890wmr.0 for ; Tue, 17 Jan 2017 04:26:49 -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=2uXacrTm6OBv58SIwPSO2r0dryGzYopWmhL+gV67mNU=; b=oylN8vAcGKMJAv0adocRy38a4d+XUhfvBk3rcq7u8UTsC21mEFllKNKVSmd06nliH6 3mGKVYDTCx4A3SGdQNh9QmVPkfwbm5srixgPMIa/9qMzq4yMikq21eIka7huvdogO+IL kmQ6v3k0CjShTwYWeczdLFCXLJFUFalXJOW/4kzZhPWjVIbWn4vaQI5ftV9kpM8/2+Ie Xoj0IqbC7KLlF0tiWiSvx3lykdK8NsTK5YpV5r9lhLghQOyPHYeUC4uUimUGbY9oH81D lcBQkxeKYhey5+qXD9JYQvQsv4rxsUoQ1O3odK6ojn0McFp0kvl/UaMcpuPdOZXc/Ii9 d3RA== 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=2uXacrTm6OBv58SIwPSO2r0dryGzYopWmhL+gV67mNU=; b=e0ph5pWcQDOZMav2GjHwjXD4QD4gCw7fKyMUh/oGnS9Q/T4Q2Y5ntgH7SSbd0olaLO 32v9hvl4UqPYjf4Elsda8qva/kSglQB2rD4u5n0nZ0XIL0/tDA+/8RY5uByUafI8c4uF EZvqlOe2LXFm01QXIIOwQOLvHZDOLA1GnTyVq5Mq4RvGHoDeICzkc5F8ZqhnBsJBFZn1 ff3OOKHTxLxlWdlMK3s0o9FJzqsooTcNnHdzI9Zo6GT7XsPV30umuSIof4TRzZvF759F xlK6LpAtmiufWXaQMGDlo+VQJmNTryIGcfNcnpZShos20IIVFsiASy6Q13KnOhedx4je 6haA== X-Gm-Message-State: AIkVDXInpa4PG88DZ9fBPVT05G/h2cwd2bUxCUCEwfLzFvXRk+7eBGG9Sd9RsTdWMwiO/wIk X-Received: by 10.223.151.205 with SMTP id t13mr27517560wrb.9.1484656008272; Tue, 17 Jan 2017 04:26:48 -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.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 17 Jan 2017 04:26:47 -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 04/14] sata: ahci-da850: get the sata clock using a connector id Date: Tue, 17 Jan 2017 13:26:06 +0100 Message-Id: <1484655976-25382-5-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_042710_361434_E3146F8A X-CRM114-Status: GOOD ( 14.29 ) 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:230 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 In preparation for using two clocks in the driver (the sysclk2-based clock and the external REFCLK), check if we got a functional clock after calling ahci_platform_get_resources(). If not, retry calling get_clk() with con_id specified. Signed-off-by: Bartosz Golaszewski --- drivers/ata/ahci_da850.c | 16 ++++++++++++++++ 1 file changed, 16 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/drivers/ata/ahci_da850.c b/drivers/ata/ahci_da850.c index 267a3d3..18f57c2 100644 --- a/drivers/ata/ahci_da850.c +++ b/drivers/ata/ahci_da850.c @@ -71,12 +71,28 @@ static int ahci_da850_probe(struct platform_device *pdev) struct ahci_host_priv *hpriv; struct resource *res; void __iomem *pwrdn_reg; + struct clk *clk; int rc; hpriv = ahci_platform_get_resources(pdev); if (IS_ERR(hpriv)) return PTR_ERR(hpriv); + /* + * Internally ahci_platform_get_resources() calls clk_get(dev, NULL) + * when trying to obtain the first clock. This SATA controller uses + * two clocks for which we specify two connector ids. If we don't + * have a clock at this point - call clk_get() again with + * con_id = "sata". + */ + if (!hpriv->clks[0]) { + clk = clk_get(dev, "sata"); + if (IS_ERR(clk)) + return PTR_ERR(clk); + + hpriv->clks[0] = clk; + } + rc = ahci_platform_enable_resources(hpriv); if (rc) return rc; From patchwork Tue Jan 17 12:26:07 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 91615 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp463059qgi; Tue, 17 Jan 2017 04:27:04 -0800 (PST) X-Received: by 10.84.216.70 with SMTP id f6mr58515792plj.10.1484656024084; Tue, 17 Jan 2017 04:27:04 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f8si24809716pln.60.2017.01.17.04.27.03; Tue, 17 Jan 2017 04:27:04 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751355AbdAQM1A (ORCPT + 25 others); Tue, 17 Jan 2017 07:27:00 -0500 Received: from mail-wm0-f54.google.com ([74.125.82.54]:35027 "EHLO mail-wm0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751329AbdAQM05 (ORCPT ); Tue, 17 Jan 2017 07:26:57 -0500 Received: by mail-wm0-f54.google.com with SMTP id r126so198493979wmr.0 for ; Tue, 17 Jan 2017 04:26:51 -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=paQv72vTMoKxGCDuRaTP7cbg7jCUt+1vLXzFf7FAkD4=; b=al8utxruNSMGqwnz6zYCX6Mt8jbryDsE+uGLmuP0blDJRHD8SO3p0TigjWcjk4JXxf xKCiZH6SKtYn1R+EruH9jBJTmx8Zve4T7IyLsirG47wunjyaw3zEMS/yW6sMA3C7OMWs yMoY6mdbmsHmB+UraWFj3Y9fU2Y3jl3HuEmMLrixT/Tvt7XvNA2v1gWdosFIwjhm7LL7 1NvwXh9w4Sv0sQ0t+MJRvL/lLCc884YODbRmFn3PYP3BvxI/Df+Noz9sXsXLpYsYnUiK DpMcm93oIbey7IYoGEsvdb+iXZcClGMVKyNwY+k47yrO7fL1prWWJmrSqdT3EJ0QWTZi 4Zrw== 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=paQv72vTMoKxGCDuRaTP7cbg7jCUt+1vLXzFf7FAkD4=; b=tgHjx2hnDj9yp5apniGgfhk9IdI+kzhsHr1JJNF9wWtutK3JC1KfcJIrDe9PDOdTi9 4xZIyZNeeGZsgC0pUXKoX1xOpH10nEIp5IzN76zdSciO7RIILn05wX1xnb7jJSsXJGvT w7ct1Wr81FRlZI3j2DkMjsevDMI4uIZ26H0vGWyyvIOMHqLFqcCwxUq7BsALHdMF4qH/ JH3LUMfUG22uy8reuTo9nNKSUue1y+dNxOSLMv94Dl1aEWrn9AWpQ8Jdv1EhJmiZRQ5i oLW/E6spcsBrleOKMkE38pyi0OTHecrQ/Gs479K8nYm8cgMKPbGYu6R2/4Ye3v1ZXnzD KYdg== X-Gm-Message-State: AIkVDXKLr+b4Smcbi5/LcsDB6aNhXiCEFqFKPh1eHu2MZeoOdldIcfPiBsgnRs410p5BYt+t X-Received: by 10.28.170.213 with SMTP id t204mr15123116wme.29.1484656010545; Tue, 17 Jan 2017 04:26:50 -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.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 17 Jan 2017 04:26:50 -0800 (PST) From: Bartosz Golaszewski To: Kevin Hilman , Sekhar Nori , Patrick Titiano , Michael Turquette , Tejun Heo , Rob Herring , Mark Rutland , Russell King , David Lechner Cc: linux-ide@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Bartosz Golaszewski Subject: [PATCH v2 05/14] ARM: davinci: da850: add con_id for the SATA clock Date: Tue, 17 Jan 2017 13:26:07 +0100 Message-Id: <1484655976-25382-6-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> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The ahci-da850 SATA driver is now capable of retrieving clocks by con_id. Add the connector id for the sysclk2-derived SATA clock. Signed-off-by: Bartosz Golaszewski --- arch/arm/mach-davinci/da850.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.9.3 diff --git a/arch/arm/mach-davinci/da850.c b/arch/arm/mach-davinci/da850.c index 1d873d1..dbf1daa 100644 --- a/arch/arm/mach-davinci/da850.c +++ b/arch/arm/mach-davinci/da850.c @@ -571,7 +571,7 @@ static struct clk_lookup da850_clks[] = { CLK("spi_davinci.0", NULL, &spi0_clk), CLK("spi_davinci.1", NULL, &spi1_clk), CLK("vpif", NULL, &vpif_clk), - CLK("ahci_da850", NULL, &sata_clk), + CLK("ahci_da850", "sata", &sata_clk), CLK("davinci-rproc.0", NULL, &dsp_clk), CLK(NULL, NULL, &ehrpwm_clk), CLK("ehrpwm.0", "fck", &ehrpwm0_clk), 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); From patchwork Tue Jan 17 12:26:09 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 91614 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp463056qgi; Tue, 17 Jan 2017 04:27:03 -0800 (PST) X-Received: by 10.98.21.131 with SMTP id 125mr43269020pfv.110.1484656023637; Tue, 17 Jan 2017 04:27:03 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f8si24809716pln.60.2017.01.17.04.27.03; Tue, 17 Jan 2017 04:27:03 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; 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 devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751333AbdAQM06 (ORCPT + 7 others); Tue, 17 Jan 2017 07:26:58 -0500 Received: from mail-wm0-f41.google.com ([74.125.82.41]:37568 "EHLO mail-wm0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751327AbdAQM04 (ORCPT ); Tue, 17 Jan 2017 07:26:56 -0500 Received: by mail-wm0-f41.google.com with SMTP id c206so220271783wme.0 for ; Tue, 17 Jan 2017 04:26:56 -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=QGoY4TvSbzQVkszVNVfcWrdN5/+ZxapKh6Y3PHWN8cc=; b=bV5pm6QRHWNFcixZxgOUpz4sP2P6kN72xgHBPXuadCH/byB4BTbUeC+dZlxDFGAAhE PkhxWvKMArRzlspBkBQeDX17yRBRDGidH0iB8FtSfXI+nXBqvq5eWCY1K+XAoCdJT8dg TR8ZPbPmLU7uQdgrXepbZajN6DAbvyRNLQZ/zKtQbbM58P2/etxy74mt3r6jgYGpIDSp 4mgSXOhpFL6GPyeTlKK+3FFxMmCH2YG2mS26ae02l1wYuGMrnmj7oRN4J7sAZUZPigmx ycnb2s8tPpAOaiBgNOb2ARrPBB5OXeObei09ntgeODZ/CUAwlBLd3G4fcD6HMRSY/PTN WPpg== 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=QGoY4TvSbzQVkszVNVfcWrdN5/+ZxapKh6Y3PHWN8cc=; b=brSP6ct2oRRWlI+PgC/z66wGQ2R/A63BVadjCuMSemGoqA6bFfQfGCR+xAkBpRHYUr lGGU+rKC3LXQzqRQaHmUCgGONJWN+fk9tgxKpi3tVFF3Tpy9VfrUIkf3FFztU4OpwBtV ZfJSg1ExHLU/wQk3m8RmqtoLhcp4paPFtDRC8yVFCj+qIA+goa5im9AzIcwR6vwMgHu9 4M5oOfH010r+llQZIyie4BN4H42qFsMuQkfNUUbAYRbN3KHD4C+Js/i8ei8AG7KDU8XY EcHA+9RH2rmU9dSiCX8ImNAN1r+k49DCyc+Rk8Yu9ZDt0KdAqyMGEtLKMO1e3ICumQx9 iNAw== X-Gm-Message-State: AIkVDXI8PLlqIiOvulpNscp6KX6tk8TB+J3dyIcmVemZTO+CK1QtRL+3CABSqCaNfKcHGRws X-Received: by 10.28.210.65 with SMTP id j62mr15649327wmg.9.1484656015096; Tue, 17 Jan 2017 04:26:55 -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.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 17 Jan 2017 04:26:54 -0800 (PST) From: Bartosz Golaszewski To: Kevin Hilman , Sekhar Nori , Patrick Titiano , Michael Turquette , Tejun Heo , Rob Herring , Mark Rutland , Russell King , David Lechner Cc: linux-ide@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Bartosz Golaszewski Subject: [PATCH v2 07/14] sata: ahci-da850: add device tree match table Date: Tue, 17 Jan 2017 13:26:09 +0100 Message-Id: <1484655976-25382-8-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> Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org We're using device tree for da850-lcdk. Add the match table to allow to probe the driver. Signed-off-by: Bartosz Golaszewski --- drivers/ata/ahci_da850.c | 7 +++++++ 1 file changed, 7 insertions(+) -- 2.9.3 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/ata/ahci_da850.c b/drivers/ata/ahci_da850.c index 18f57c2..c071701 100644 --- a/drivers/ata/ahci_da850.c +++ b/drivers/ata/ahci_da850.c @@ -121,11 +121,18 @@ static int ahci_da850_probe(struct platform_device *pdev) static SIMPLE_DEV_PM_OPS(ahci_da850_pm_ops, ahci_platform_suspend, ahci_platform_resume); +static const struct of_device_id ahci_da850_of_match[] = { + { .compatible = "ti,da850-ahci", }, + { }, +}; +MODULE_DEVICE_TABLE(of, ahci_da850_of_match); + static struct platform_driver ahci_da850_driver = { .probe = ahci_da850_probe, .remove = ata_platform_remove_one, .driver = { .name = DRV_NAME, + .of_match_table = ahci_da850_of_match, .pm = &ahci_da850_pm_ops, }, }; From patchwork Tue Jan 17 12:26:10 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 91623 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp463621qgi; Tue, 17 Jan 2017 04:28:26 -0800 (PST) X-Received: by 10.84.128.34 with SMTP id 31mr44392661pla.17.1484656106623; Tue, 17 Jan 2017 04:28:26 -0800 (PST) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id g2si24830016plj.83.2017.01.17.04.28.26 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 17 Jan 2017 04:28:26 -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-0006fx-Qj; Tue, 17 Jan 2017 12:28:24 +0000 Received: from mail-wm0-x22c.google.com ([2a00:1450:400c:c09::22c]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cTSr9-0004lo-3T for linux-arm-kernel@lists.infradead.org; Tue, 17 Jan 2017 12:27:21 +0000 Received: by mail-wm0-x22c.google.com with SMTP id c206so220273071wme.0 for ; Tue, 17 Jan 2017 04:26:58 -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=1p8arA0SVMZDuSqLqDWUpElqZc8KdA/kfZqPkscxd/Y=; b=cTnWK0moj5YQFrH6vFBd6CD70eysr6EwE51CBKHNZczh5aKBGDj0sf16oBnd9W6L3N b5rsMy+zfcFuTwQHizW7k9weJMxiaoFuoMXrX2fokYHdP0/2zfYTjXL7C84fHOSHs9xk QNeTJkDjeByGUnnGceG4LE9pg84D+KQ1htmoiTQuYEVWBEL4fRwTFrw88XrXIrrzDQOI kMnp6Luj+5fpcE8izxRVsu4dK7EyW6ko1uFGAenzTM4HKX6t36GH0jMGC9hFzDKzogVv GzKDLLHsRC7Uht8/oVm7a1YwtcWBe8jepdVQlP4Wg090Ts3XPDmziArApj7xinymo795 XLmQ== 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=1p8arA0SVMZDuSqLqDWUpElqZc8KdA/kfZqPkscxd/Y=; b=XxORFp044/tkR7J1N33O0DxyOveqHuPEbyUnpz/jLafao6zZg4V9LGknI1t+n6Lk/R S5duGvH2O2pzw4ylhu5O82SlX/e31je8pt23ekKO03A/I2qJm7HgOH/12gVtSFhrFt6U QjSuhzu38Ax45vcpxovuysdwhETL/G9WyZHemdGQykhp5ZhnRIONEUWICNl8zuO8mVa3 pwr8uNoHL+6ee4kCmuYXbrlHu5yPNd0K73fKlL+/B/TSjPnNxCWHZa4d4CdUn8eINxZj zIYikAppHTYaki0B4DCud7+FcYm/5Kdmahn4tFuGWe6B4pWj4UFsgLAkyWN2YCwawvlg iLjw== X-Gm-Message-State: AIkVDXJlwt5nQBVYXEAozXGBJycofDtxuhvAyYVi6HZf95JRz4yoEAyi6JpYiuPMzO4vrDL+ X-Received: by 10.28.5.70 with SMTP id 67mr15675885wmf.32.1484656017295; Tue, 17 Jan 2017 04:26:57 -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.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 17 Jan 2017 04:26:56 -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 08/14] sata: ahci-da850: implement a workaround for the softreset quirk Date: Tue, 17 Jan 2017 13:26:10 +0100 Message-Id: <1484655976-25382-9-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_042719_453148_9928EAC7 X-CRM114-Status: GOOD ( 17.11 ) 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:22c 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 There's an issue with the da850 SATA controller: if port multiplier support is compiled in, but we're connecting the drive directly to the SATA port on the board, the drive can't be detected. To make SATA work on the da850-lcdk board: first try to softreset with pmp - if the operation fails with -EBUSY, retry without pmp. Signed-off-by: Bartosz Golaszewski --- drivers/ata/ahci_da850.c | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) -- 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/drivers/ata/ahci_da850.c b/drivers/ata/ahci_da850.c index c071701..e0dc089 100644 --- a/drivers/ata/ahci_da850.c +++ b/drivers/ata/ahci_da850.c @@ -54,11 +54,42 @@ static void da850_sata_init(struct device *dev, void __iomem *pwrdn_reg, writel(val, ahci_base + SATA_P0PHYCR_REG); } +static int ahci_da850_softreset(struct ata_link *link, + unsigned int *class, unsigned long deadline) +{ + int pmp, ret; + + pmp = sata_srst_pmp(link); + + /* + * There's an issue with the SATA controller on da850 SoCs: if we + * enable Port Multiplier support, but the drive is connected directly + * to the board, it can't be detected. As a workaround: if PMP is + * enabled, we first call ahci_do_softreset() and pass it the result of + * sata_srst_pmp(). If this call fails, we retry with pmp = 0. + */ + ret = ahci_do_softreset(link, class, pmp, deadline, ahci_check_ready); + if (pmp && ret == -EBUSY) + return ahci_do_softreset(link, class, 0, + deadline, ahci_check_ready); + + return ret; +} + +static struct ata_port_operations ahci_da850_port_ops = { + .inherits = &ahci_platform_ops, + .softreset = ahci_da850_softreset, + /* + * No need to override .pmp_softreset - it's only used for actual + * PMP-enabled ports. + */ +}; + static const struct ata_port_info ahci_da850_port_info = { .flags = AHCI_FLAG_COMMON, .pio_mask = ATA_PIO4, .udma_mask = ATA_UDMA6, - .port_ops = &ahci_platform_ops, + .port_ops = &ahci_da850_port_ops, }; static struct scsi_host_template ahci_platform_sht = { From patchwork Tue Jan 17 12:26:11 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 91617 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp463153qgi; Tue, 17 Jan 2017 04:27:15 -0800 (PST) X-Received: by 10.84.232.10 with SMTP id h10mr58412387plk.121.1484656035381; Tue, 17 Jan 2017 04:27:15 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u17si17161760pgn.210.2017.01.17.04.27.15; Tue, 17 Jan 2017 04:27:15 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; 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 devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751387AbdAQM1H (ORCPT + 7 others); Tue, 17 Jan 2017 07:27:07 -0500 Received: from mail-wm0-f41.google.com ([74.125.82.41]:35944 "EHLO mail-wm0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751374AbdAQM1G (ORCPT ); Tue, 17 Jan 2017 07:27:06 -0500 Received: by mail-wm0-f41.google.com with SMTP id c85so197772841wmi.1 for ; Tue, 17 Jan 2017 04:27:00 -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=M2Mt1IUY+9KqnX3iZFJkMS6FZ88o8pZIMUf0LimNJkU=; b=WHBXg4L7RXW3hM6Psw2L0JgDj4AiyyowZVUgIMR+O1X/zFl8kYu5UVAEQIuyBEqjxo uFTtSnIEUypKifg0yXEQhrOhqk44TZk3YYCRDOLNQGA28FnYqjNqhnhObJDZ5hWlrc+d MkeYtvbLOXlz1EvSF9QlaOXs+CW2S+877xJuDBsNlZ6WZCN41vJR9RTng0yeSGpEYGqG n7cqDzO4vhwbL1XpnD/Ymw4vGJUeVR4UAc6i2ypcZ0+2gdrqkKTvo8Qedd7LBjOUQiAh TFWTDMPO3Zi+/ZFK1JN6Fp0oWX6FKz2CijXz96wFGMXMIx8+Yub28lv36xi8NRbI5x8k 1tbA== 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=M2Mt1IUY+9KqnX3iZFJkMS6FZ88o8pZIMUf0LimNJkU=; b=pfa+y2I7hQJtgdGCCz7pbSot8Pp2DzJL1zgT3ABW6JfieeCx005+Njwiy1rvMUfKrz 4s+QqkObRLME0aoPwrxWhnouTmT21Q/UU2eqsdAgSRn7NeMrAzbHmHIMQ9nSvgRlcpmF fWZMQZyNEpz0S3lzPo9kmwlfEtQ7QVxrNDUSLAjv6tqUdx1kCN5W305yz7lEyqeCrPol IdYmqGSOjkxy4/WokhPyzDUk7GMAyf4FcWCM2HXQ2/LZAfAe12og1QO57Ijzd1bbnXwD MjQ7y5jyX3ctaUYE8Upqz4ME+/3oGyxhY+iL3YTtPh75q+5FUQVERPr3RdBgdlYoHrYZ VAdQ== X-Gm-Message-State: AIkVDXLWnQuUiUiwG3kLv1gGmOEosY3EGWcL6bEtGBuYQTLBHkBpHxSL46I9UVU+UkWyKgEW X-Received: by 10.223.152.175 with SMTP id w44mr13752893wrb.151.1484656019347; Tue, 17 Jan 2017 04:26:59 -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.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 17 Jan 2017 04:26:58 -0800 (PST) From: Bartosz Golaszewski To: Kevin Hilman , Sekhar Nori , Patrick Titiano , Michael Turquette , Tejun Heo , Rob Herring , Mark Rutland , Russell King , David Lechner Cc: linux-ide@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Bartosz Golaszewski Subject: [PATCH v2 09/14] sata: ahci: export ahci_do_hardreset() locally Date: Tue, 17 Jan 2017 13:26:11 +0100 Message-Id: <1484655976-25382-10-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> Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org We need a way to retrieve the information about the online state of the link in the ahci-da850 driver. Create a new function: ahci_do_hardreset() which is called from ahci_hardreset() for backwards compatibility, but has an additional argument: 'online' - which can be used to check if the link is online after this function returns. The new routine will be used in the ahci-da850 driver to avoid code duplication when implementing a workaround for tha da850 SATA controller quirk/instability. Signed-off-by: Bartosz Golaszewski --- drivers/ata/ahci.h | 3 +++ drivers/ata/libahci.c | 18 +++++++++++++----- 2 files changed, 16 insertions(+), 5 deletions(-) -- 2.9.3 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/ata/ahci.h b/drivers/ata/ahci.h index 0cc08f8..5db6ab2 100644 --- a/drivers/ata/ahci.h +++ b/drivers/ata/ahci.h @@ -398,6 +398,9 @@ int ahci_do_softreset(struct ata_link *link, unsigned int *class, int pmp, unsigned long deadline, int (*check_ready)(struct ata_link *link)); +int ahci_do_hardreset(struct ata_link *link, unsigned int *class, + unsigned long deadline, bool *online); + unsigned int ahci_qc_issue(struct ata_queued_cmd *qc); int ahci_stop_engine(struct ata_port *ap); void ahci_start_fis_rx(struct ata_port *ap); diff --git a/drivers/ata/libahci.c b/drivers/ata/libahci.c index ee7db31..3159f9e 100644 --- a/drivers/ata/libahci.c +++ b/drivers/ata/libahci.c @@ -1519,8 +1519,8 @@ static int ahci_pmp_retry_softreset(struct ata_link *link, unsigned int *class, return rc; } -static int ahci_hardreset(struct ata_link *link, unsigned int *class, - unsigned long deadline) +int ahci_do_hardreset(struct ata_link *link, unsigned int *class, + unsigned long deadline, bool *online) { const unsigned long *timing = sata_ehc_deb_timing(&link->eh_context); struct ata_port *ap = link->ap; @@ -1528,7 +1528,6 @@ static int ahci_hardreset(struct ata_link *link, unsigned int *class, struct ahci_host_priv *hpriv = ap->host->private_data; u8 *d2h_fis = pp->rx_fis + RX_FIS_D2H_REG; struct ata_taskfile tf; - bool online; int rc; DPRINTK("ENTER\n"); @@ -1540,17 +1539,26 @@ static int ahci_hardreset(struct ata_link *link, unsigned int *class, tf.command = ATA_BUSY; ata_tf_to_fis(&tf, 0, 0, d2h_fis); - rc = sata_link_hardreset(link, timing, deadline, &online, + rc = sata_link_hardreset(link, timing, deadline, online, ahci_check_ready); hpriv->start_engine(ap); - if (online) + if (*online) *class = ahci_dev_classify(ap); DPRINTK("EXIT, rc=%d, class=%u\n", rc, *class); return rc; } +EXPORT_SYMBOL_GPL(ahci_do_hardreset); + +static int ahci_hardreset(struct ata_link *link, unsigned int *class, + unsigned long deadline) +{ + bool online; + + return ahci_do_hardreset(link, class, deadline, &online); +} static void ahci_postreset(struct ata_link *link, unsigned int *class) { From patchwork Tue Jan 17 12:26:12 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 91616 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp463149qgi; Tue, 17 Jan 2017 04:27:15 -0800 (PST) X-Received: by 10.98.105.68 with SMTP id e65mr43374449pfc.10.1484656035080; Tue, 17 Jan 2017 04:27:15 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u17si17161760pgn.210.2017.01.17.04.27.14; Tue, 17 Jan 2017 04:27:15 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751382AbdAQM1F (ORCPT + 25 others); Tue, 17 Jan 2017 07:27:05 -0500 Received: from mail-wm0-f49.google.com ([74.125.82.49]:35970 "EHLO mail-wm0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751331AbdAQM1D (ORCPT ); Tue, 17 Jan 2017 07:27:03 -0500 Received: by mail-wm0-f49.google.com with SMTP id c85so197774064wmi.1 for ; Tue, 17 Jan 2017 04:27:02 -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=TTyDYu6UCQO3+jdcohC+6HgB8+wsgHHQR+iJ3dAGSwI=; b=ih0rg9vvM7SLO15YJKFDXHvOgmG+UCVPZwssFF69GANB5cy15EYNHBq5BlhiOKl0Sz Imc2xunsbnM0B5bsZUvKE3N+bu1YBCAQ10jfVgKKPBkrts0A20vHLtHcOxj8F0M5/00p rZTqk8h1gyKy/gcpm1GqHUlDuS2i2qSCzq0QTysqDGYvjIQRlKgzE03Og8tObT9qX9mW 2HGJ4KSTvrCxBewDxBK7qesAQCJ6vMcZnGqlesla3kqC+FMzeH6jKOPfkNm0tw+SL4RV BJFlDfqh3bppkhTolbHw/ls4pqNBuIMuV1uNOSkeJyGb0dgLIr+6mS5IclqJ2BxxK+p3 6mRA== 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=TTyDYu6UCQO3+jdcohC+6HgB8+wsgHHQR+iJ3dAGSwI=; b=rRLQsUmO6CBxGm7jABvYWEBL1ct0/jDZUwyEYrn0QhBijFGrhUEBPewyx8ehXvJ3aC 8hiyKmBtrMWac1FHNtS4D5LP7nBmJt7fzGe+yEsA74uvRCS7a0cURbVEPKmhI3GBhtHK udZV2NfPEwp7lsjPHQxlnE2JKn3893A6qPLDdSdU/DxSl+khCNUTtMRS5Zb55Nrylqob YN3mj9mUCayK4XtWAk9zAXYJg80zs7BcleoPSYQY4CzS7TyopZUl4DWM4E3DaOQaisOR p95mUBfA2yUlZ+pw8wrdqBhaVmdkLq1pCmq5krpYL44ZXKpXKFerWsy6zV75Zp6AG2m3 k3FA== X-Gm-Message-State: AIkVDXLzq+m69Xp3WATXRIV7kgdRoh0Ls0o2fuqKjQg5vQ3oVCyfZg57yGpxeMxjudxa1E4s X-Received: by 10.28.21.206 with SMTP id 197mr15253002wmv.128.1484656021529; Tue, 17 Jan 2017 04:27:01 -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.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 17 Jan 2017 04:27:00 -0800 (PST) From: Bartosz Golaszewski To: Kevin Hilman , Sekhar Nori , Patrick Titiano , Michael Turquette , Tejun Heo , Rob Herring , Mark Rutland , Russell King , David Lechner Cc: linux-ide@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Bartosz Golaszewski Subject: [PATCH v2 10/14] sata: ahci-da850: add a workaround for controller instability Date: Tue, 17 Jan 2017 13:26:12 +0100 Message-Id: <1484655976-25382-11-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> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org We have a use case with the da850 SATA controller where at PLL0 frequency of 456MHz (needed to properly service the LCD controller) the chip becomes unstable and the hardreset operation is ignored the first time 50% of times. The sata core driver already retries to resume the link because some controllers ignore writes to the SControl register, but just retrying the resume operation doesn't work - we need to issue he phy/wake reset again to make it work. Reimplement ahci_hardreset() in the driver and poke the controller a couple times before really giving up. Signed-off-by: Bartosz Golaszewski --- drivers/ata/ahci_da850.c | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) -- 2.9.3 diff --git a/drivers/ata/ahci_da850.c b/drivers/ata/ahci_da850.c index e0dc089..a7a7161 100644 --- a/drivers/ata/ahci_da850.c +++ b/drivers/ata/ahci_da850.c @@ -16,7 +16,8 @@ #include #include "ahci.h" -#define DRV_NAME "ahci_da850" +#define DRV_NAME "ahci_da850" +#define HARDRESET_RETRIES 5 /* SATA PHY Control Register offset from AHCI base */ #define SATA_P0PHYCR_REG 0x178 @@ -76,6 +77,29 @@ static int ahci_da850_softreset(struct ata_link *link, return ret; } +static int ahci_da850_hardreset(struct ata_link *link, + unsigned int *class, unsigned long deadline) +{ + int ret, retry = HARDRESET_RETRIES; + bool online; + + /* + * In order to correctly service the LCD controller of the da850 SoC, + * we increased the PLL0 frequency to 456MHz from the default 300MHz. + * + * This made the SATA controller unstable and the hardreset operation + * does not always succeed the first time. Before really giving up to + * bring up the link, retry the reset a couple times. + */ + do { + ret = ahci_do_hardreset(link, class, deadline, &online); + if (online) + return ret; + } while (retry--); + + return ret; +} + static struct ata_port_operations ahci_da850_port_ops = { .inherits = &ahci_platform_ops, .softreset = ahci_da850_softreset, @@ -83,6 +107,8 @@ static struct ata_port_operations ahci_da850_port_ops = { * No need to override .pmp_softreset - it's only used for actual * PMP-enabled ports. */ + .hardreset = ahci_da850_hardreset, + .pmp_hardreset = ahci_da850_hardreset, }; static const struct ata_port_info ahci_da850_port_info = { From patchwork Tue Jan 17 12:26:13 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 91619 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp463163qgi; Tue, 17 Jan 2017 04:27:16 -0800 (PST) X-Received: by 10.84.231.193 with SMTP id g1mr58374134pln.12.1484656036360; Tue, 17 Jan 2017 04:27:16 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u17si17161760pgn.210.2017.01.17.04.27.16; Tue, 17 Jan 2017 04:27:16 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751432AbdAQM1N (ORCPT + 25 others); Tue, 17 Jan 2017 07:27:13 -0500 Received: from mail-wm0-f49.google.com ([74.125.82.49]:38199 "EHLO mail-wm0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751385AbdAQM1K (ORCPT ); Tue, 17 Jan 2017 07:27:10 -0500 Received: by mail-wm0-f49.google.com with SMTP id r144so219867012wme.1 for ; Tue, 17 Jan 2017 04:27:04 -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=cu2TYqCA/4ezEbeOr602MpwWgRgld8WC3/zy2MypAMs=; b=eWgHDYz7bLQ8vwERtlhrak8ul0vA7chl2LoXXvDZSlXg859IoNH4+nGK8xGUspNdiq FKnKwaFtF+6CF3vitTnVtwcGYDy1WiiMw5fvE/ZH/M0arewRB/nO7ege+VhbLN4AR/pI mcQVnyajkmJth1CTxZBp9FNERTZisBIvpxawC1mDtPQucHOjrn86mkZljWkcjnEZ2WXx h1qzk+7gjQ53eFMHF7lPmTcq+zV3n4VBbzcCS0i8fiMX7Vqh/qzIlfd3dlT2tx8mMGFY IAbxD0hH+0sV9z8jVDHEM+vNOYVDevB66fKJ3ijtEgKUDwnJsC97xpjiPoo+NUnksISz s5Kw== 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=cu2TYqCA/4ezEbeOr602MpwWgRgld8WC3/zy2MypAMs=; b=KayFLcLdVVIH0IGTU3/zlNoGg5b9mZtoWHkjxXTFDgg+R2g67pkSHrXGAogRh6St+j QtxYApgq4HTDdS7MR4WwefkeqhAJknX8nQikkW46/H52gR+IDI9pFtr94eP977qk2s5q qGVhirhfirMuAmCA/44dwWwyX1jIHX2zXRkRuaiHAN/KuU/EyVcHUzTu9LOufdr0dTTE LMiw6o9IBfp7acQB3TfB/pAFGmA9nUp7Ul7lXF6RP+xGx/PkmtlBbBdfa8uWaM9/fUAH z1Vfpu/3MHLp4otmKHTObqKezB3TbgCMNAxz7TBGY3Adz15IIfu+PV5ai93nEyp9R2tg 0fww== X-Gm-Message-State: AIkVDXIt33e7W3GcEhmmwaU04/nC3sa/YP8WJe+w4BSnl75hbDKghlNSHShwGM7vYLRMbREo X-Received: by 10.28.214.144 with SMTP id n138mr13085773wmg.136.1484656023525; Tue, 17 Jan 2017 04:27:03 -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.27.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 17 Jan 2017 04:27:02 -0800 (PST) From: Bartosz Golaszewski To: Kevin Hilman , Sekhar Nori , Patrick Titiano , Michael Turquette , Tejun Heo , Rob Herring , Mark Rutland , Russell King , David Lechner Cc: linux-ide@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Bartosz Golaszewski Subject: [PATCH v2 11/14] sata: ahci-da850: un-hardcode the MPY bits Date: Tue, 17 Jan 2017 13:26:13 +0100 Message-Id: <1484655976-25382-12-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> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In order to make the MPY bits configurable, try to obtain the refclk and calculate the required multiplier from its rate. If we fail to get the clock, fall back to the default value which keeps backwards compatibility. Signed-off-by: Bartosz Golaszewski --- drivers/ata/ahci_da850.c | 88 +++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 76 insertions(+), 12 deletions(-) -- 2.9.3 diff --git a/drivers/ata/ahci_da850.c b/drivers/ata/ahci_da850.c index a7a7161..f48b7d0 100644 --- a/drivers/ata/ahci_da850.c +++ b/drivers/ata/ahci_da850.c @@ -14,6 +14,7 @@ #include #include #include +#include #include "ahci.h" #define DRV_NAME "ahci_da850" @@ -30,16 +31,14 @@ #define SATA_PHY_ENPLL(x) ((x) << 31) /* - * The multiplier needed for 1.5GHz PLL output. - * - * NOTE: This is currently hardcoded to be suitable for 100MHz crystal - * frequency (which is used by DA850 EVM board) and may need to be changed - * if you would like to use this driver on some other board. + * This is the default multiplier value used if the refclk could not be + * obtained. It corresponds with a crystal rate of 100MHz for 1.5GHz PLL + * output. */ -#define DA850_SATA_CLK_MULTIPLIER 7 +#define DA850_SATA_MPY_DEFAULT 0x8 static void da850_sata_init(struct device *dev, void __iomem *pwrdn_reg, - void __iomem *ahci_base) + void __iomem *ahci_base, u32 mpy) { unsigned int val; @@ -48,13 +47,56 @@ static void da850_sata_init(struct device *dev, void __iomem *pwrdn_reg, val &= ~BIT(0); writel(val, pwrdn_reg); - val = SATA_PHY_MPY(DA850_SATA_CLK_MULTIPLIER + 1) | SATA_PHY_LOS(1) | - SATA_PHY_RXCDR(4) | SATA_PHY_RXEQ(1) | SATA_PHY_TXSWING(3) | - SATA_PHY_ENPLL(1); + val = SATA_PHY_MPY(mpy) | SATA_PHY_LOS(1) | SATA_PHY_RXCDR(4) | + SATA_PHY_RXEQ(1) | SATA_PHY_TXSWING(3) | SATA_PHY_ENPLL(1); writel(val, ahci_base + SATA_P0PHYCR_REG); } +static u32 ahci_da850_calculate_mpy(unsigned long refclk_rate) +{ + u64 pll_output = 1500000000; + u32 needed; + + /* + * We need to determine the value of the multiplier (MPY) bits. + * + * In order to include the 12.5 multiplier we need to first multiply + * the desired rate of 1.5GHz by 10 before division. + */ + pll_output *= 10; + needed = __div64_32(&pll_output, refclk_rate); + + /* + * What we have now is (multiplier * 10). + * + * Let's determine the actual register value we need to write. + */ + + switch (needed) { + case 50: + return 0x1; + case 60: + return 0x2; + case 80: + return 0x4; + case 100: + return 0x5; + case 120: + return 0x6; + case 125: + return 0x7; + case 150: + return 0x8; + case 200: + return 0x9; + case 250: + return 0xa; + default: + return DA850_SATA_MPY_DEFAULT; + } +} + static int ahci_da850_softreset(struct ata_link *link, unsigned int *class, unsigned long deadline) { @@ -126,9 +168,10 @@ static int ahci_da850_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; struct ahci_host_priv *hpriv; - struct resource *res; void __iomem *pwrdn_reg; + struct resource *res; struct clk *clk; + u32 mpy; int rc; hpriv = ahci_platform_get_resources(pdev); @@ -150,6 +193,27 @@ static int ahci_da850_probe(struct platform_device *pdev) hpriv->clks[0] = clk; } + /* + * The second clock used by ahci-da850 is the external REFCLK. If we + * didn't get it from ahci_platform_get_resources(), let's try to + * specify the con_id in clk_get(). If we still don't get a clock, + * we'll use the default value that works for the da850-evm board. + */ + if (!hpriv->clks[1]) { + clk = clk_get(dev, "refclk"); + if (IS_ERR(clk)) + hpriv->clks[1] = NULL; + else + hpriv->clks[1] = clk; + } + + if (!hpriv->clks[1]) { + dev_info(dev, "unable to obtain the reference clock - using default multiplier"); + mpy = DA850_SATA_MPY_DEFAULT; + } else { + mpy = ahci_da850_calculate_mpy(clk_get_rate(hpriv->clks[1])); + } + rc = ahci_platform_enable_resources(hpriv); if (rc) return rc; @@ -162,7 +226,7 @@ static int ahci_da850_probe(struct platform_device *pdev) if (!pwrdn_reg) goto disable_resources; - da850_sata_init(dev, pwrdn_reg, hpriv->mmio); + da850_sata_init(dev, pwrdn_reg, hpriv->mmio, mpy); rc = ahci_platform_init_host(pdev, hpriv, &ahci_da850_port_info, &ahci_platform_sht); From patchwork Tue Jan 17 12:26:14 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 91618 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp463159qgi; Tue, 17 Jan 2017 04:27:16 -0800 (PST) X-Received: by 10.84.218.205 with SMTP id g13mr57217586plm.78.1484656035991; Tue, 17 Jan 2017 04:27:15 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u17si17161760pgn.210.2017.01.17.04.27.15; Tue, 17 Jan 2017 04:27:15 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751415AbdAQM1M (ORCPT + 25 others); Tue, 17 Jan 2017 07:27:12 -0500 Received: from mail-wm0-f53.google.com ([74.125.82.53]:35213 "EHLO mail-wm0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751383AbdAQM1H (ORCPT ); Tue, 17 Jan 2017 07:27:07 -0500 Received: by mail-wm0-f53.google.com with SMTP id r126so198502552wmr.0 for ; Tue, 17 Jan 2017 04:27:06 -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=OgzeQXQkzcTDETZrz8Gr7reuknqRuQfQziRB6QAX/Vc=; b=WNX+Eko4mFm1/+ct9eyx8tgyloCbtOm0+lhc1yPRVA8je+iLmwpNHx3mWMp6z5udBw aR4lty3F72C/Z1elJvbF34dOkfqTnEaD05J0hc960fvUqf7rX7J7CdHoLjBjQ7+6ev2j PGAPsm0F99MCBoXcaQWtG0SbucSwnUrYdvcy5PMcXFGm3sFmOFn5W0VBauGHaSUTK3CT W7WHxE9/R6VJ6sWTfQZ7h9UcHm/ilrdQya/EXgvGORqj9b8BfwVLpUNifNVWlJzZFyqK PF9dls8Rjx9c924s9SzHKodukCNAn36oeE/n/ChpmCdKhaHhNpuAebN+gyqqS/vFFa9f vmPw== 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=OgzeQXQkzcTDETZrz8Gr7reuknqRuQfQziRB6QAX/Vc=; b=LKZVleX5L2VA3pkDm+YOPnqVfLXAlSyosOMKcKLCvcsvMhW5qb5cKAL3KwJmy9ROYp OgXwg0wWMnjHmjcaExtAuVAWjk/ok8zFFnonoRF6gmXFIDZCRKD2DCf+WlB1GdwcZYnV JghmlDviM8uQx00i5cr7HTcjP/rNxafrfD+kYFznMYrjDJMWKbfD73wsmpAVmAyhQ6fj //lT30Q+HdPEmloowDMGkGmk2wWlqoqIbFMIeLgENuW8QqP6VXcGvSLjECiXUzxqViUA +N9kohx8GM2enh1z31g2JN6UkEOrMGBVOh6p9LfHwKqUHqy/Z+PAx1YMYfly48lp8Ohi SS2A== X-Gm-Message-State: AIkVDXLSOPCRh+7kg1wM1GBCaaYcR5bObThk2DN8GOnCG+si0phrVOf1oDrsNzekOf1pBihS X-Received: by 10.28.221.7 with SMTP id u7mr15374405wmg.33.1484656026022; Tue, 17 Jan 2017 04:27:06 -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.27.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 17 Jan 2017 04:27:05 -0800 (PST) From: Bartosz Golaszewski To: Kevin Hilman , Sekhar Nori , Patrick Titiano , Michael Turquette , Tejun Heo , Rob Herring , Mark Rutland , Russell King , David Lechner Cc: linux-ide@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Bartosz Golaszewski Subject: [PATCH v2 12/14] ARM: dts: da850: add pinmux settings for the SATA controller Date: Tue, 17 Jan 2017 13:26:14 +0100 Message-Id: <1484655976-25382-13-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> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add pinmux sub-nodes for all muxed SATA pins. Signed-off-by: Bartosz Golaszewski --- arch/arm/boot/dts/da850.dtsi | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) -- 2.9.3 diff --git a/arch/arm/boot/dts/da850.dtsi b/arch/arm/boot/dts/da850.dtsi index 104155d..1f6a47d 100644 --- a/arch/arm/boot/dts/da850.dtsi +++ b/arch/arm/boot/dts/da850.dtsi @@ -78,6 +78,30 @@ 0x10 0x00220000 0x00ff0000 >; }; + sata_cp_det_pin: pinmux_sata_cp_det_pin { + pinctrl-single,bits = < + /* SATA_CP_DET */ + 0x0c 0x00000000 0xf0000000 + >; + }; + sata_mp_switch_pin: pinmux_sata_mp_switch_pin { + pinctrl-single,bits = < + /* SATA_MP_SWITCH */ + 0x0c 0x00000000 0x0f000000 + >; + }; + sata_cp_pod_pin: pinmux_sata_cp_pod_pin { + pinctrl-single,bits = < + /* SATA_CP_POD */ + 0x10 0x40000000 0xf0000000 + >; + }; + sata_led_pin: pinmux_sata_led_pin { + pinctrl-single,bits = < + /* SATA_LED */ + 0x10 0x04000000 0x0f000000 + >; + }; i2c0_pins: pinmux_i2c0_pins { pinctrl-single,bits = < /* I2C0_SDA,I2C0_SCL */ From patchwork Tue Jan 17 12:26:15 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 91622 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp463524qgi; Tue, 17 Jan 2017 04:28:13 -0800 (PST) X-Received: by 10.84.173.168 with SMTP id p37mr54360003plb.30.1484656093728; Tue, 17 Jan 2017 04:28:13 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a17si24766162pgi.189.2017.01.17.04.28.13; Tue, 17 Jan 2017 04:28:13 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751480AbdAQM2G (ORCPT + 25 others); Tue, 17 Jan 2017 07:28:06 -0500 Received: from mail-wm0-f42.google.com ([74.125.82.42]:38263 "EHLO mail-wm0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751384AbdAQM1J (ORCPT ); Tue, 17 Jan 2017 07:27:09 -0500 Received: by mail-wm0-f42.google.com with SMTP id r144so219869798wme.1 for ; Tue, 17 Jan 2017 04:27:09 -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=O3FJpE/52J2Iw04n9VIXp8nQFBrkx5bkEv20HKA6LFc=; b=Ujau2g6h1xrfn3cbl+GV5bl9ocMSNGGL1HkiCMubxtaIlc1pCuBj3s0AwUlyDawNDE HvoEIibOKXt+xzaXNPTVH1RkAm4vABlTexVj+Wj9SuIYvBoHEQxQmfIRbhEyNWB9LzlH x3a/3UYb4YbXz8sUJMOoqju8m+vzULaKcZQXq3pdZqz6CqCgyBiRiWtGQRtfdr5E1+5V L2B8eP3SVAZMuDeGLnwcbgJdnohhnB7PA1XzIan6f4BYrnmDWrGscvLLr8M0SMxQYdcW Hjf/YaAKKIosw3LVwnjKtQe/yEsXATJT4avl2mxzN2n3TC0EaIBYOgw7/9iPMwpXYrx6 i03A== 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=O3FJpE/52J2Iw04n9VIXp8nQFBrkx5bkEv20HKA6LFc=; b=ucS+Yo/B/DvayOO9d6LFsbaBHjC/weZhzygo6WFzJi8dfVtkhOJFC673tgzoTfIS7H A9JFsMuUIc2synmWyNi3q7lXzvHg5D50A4/cch0T+lhC9MRdN1lAQg58+oef2vb0eMkn KFWmxHlpvvvzp5+SYK9ExSTrvP47M0aj8eGSDecuy1Z+tkEaCyRkUgTdLiv84EJ3k/Oo ONMRH2MaihMRhZztnWv055Tb5YneUttvT7DUG4lpzyZQIyTrqWSFc6Szfx6lX1AcqPjY +lgC67UUonCGo1QSF9INbWO4PCSh0NxX0pcnGKiqLm9G1TA1nQWK3G/X3UzMDzDhoDHS dT9A== X-Gm-Message-State: AIkVDXLfXC76UvfiXHst+gQAl//ekjR8hK7c7wvYRisB4GookXqcelOt/GPXJq4dgHFpFxUU X-Received: by 10.223.162.211 with SMTP id t19mr10056930wra.57.1484656028022; Tue, 17 Jan 2017 04:27:08 -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.27.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 17 Jan 2017 04:27:07 -0800 (PST) From: Bartosz Golaszewski To: Kevin Hilman , Sekhar Nori , Patrick Titiano , Michael Turquette , Tejun Heo , Rob Herring , Mark Rutland , Russell King , David Lechner Cc: linux-ide@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Bartosz Golaszewski Subject: [PATCH v2 13/14] ARM: dts: da850: add the SATA node Date: Tue, 17 Jan 2017 13:26:15 +0100 Message-Id: <1484655976-25382-14-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> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add the SATA node to the da850 device tree. Signed-off-by: Bartosz Golaszewski --- arch/arm/boot/dts/da850.dtsi | 6 ++++++ 1 file changed, 6 insertions(+) -- 2.9.3 diff --git a/arch/arm/boot/dts/da850.dtsi b/arch/arm/boot/dts/da850.dtsi index 1f6a47d..7c32bf7 100644 --- a/arch/arm/boot/dts/da850.dtsi +++ b/arch/arm/boot/dts/da850.dtsi @@ -427,6 +427,12 @@ phy-names = "usb-phy"; status = "disabled"; }; + sata: ahci@218000 { + compatible = "ti,da850-ahci"; + reg = <0x218000 0x2000>, <0x22c018 0x4>; + interrupts = <67>; + status = "disabled"; + }; mdio: mdio@224000 { compatible = "ti,davinci_mdio"; #address-cells = <1>; From patchwork Tue Jan 17 12:26:16 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 91620 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp463235qgi; Tue, 17 Jan 2017 04:27:26 -0800 (PST) X-Received: by 10.98.194.153 with SMTP id w25mr11442430pfk.181.1484656045908; Tue, 17 Jan 2017 04:27:25 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z14si24758419pgo.221.2017.01.17.04.27.25; Tue, 17 Jan 2017 04:27:25 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751452AbdAQM1X (ORCPT + 25 others); Tue, 17 Jan 2017 07:27:23 -0500 Received: from mail-wm0-f41.google.com ([74.125.82.41]:38288 "EHLO mail-wm0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750967AbdAQM1V (ORCPT ); Tue, 17 Jan 2017 07:27:21 -0500 Received: by mail-wm0-f41.google.com with SMTP id r144so219870907wme.1 for ; Tue, 17 Jan 2017 04:27:10 -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=HRSdRCLELx34Gjg+IiYt85uh9DtOOrt9CNFmH9jwWuo=; b=X1rtzj3h40cm0wB93evS+Tps8jskAdu7gkCoX1akgdL8d1Zfg8S4BTyIQ8XpQUQAq7 WanIOxgwkXffVYpi6scQPYJL/XxbaqXZraneaYJ/Uinp5ntbpWSnCw5UKVcm9ZqClznf YP2mqVds1dV6sFnwP8izXzb7kX67sROab6iUkacIgKikGM17b1jZfoXT1DwJDtQGKD/Z gz4HG2WnoOE30rpLrBvbsbR7cMr8tIk431ODAVH1RPFoq18s6GnVz2KY0MBp4WbM7gjV 43uCz0lIMJKkVFJGBdhdg2/cMs3POP2rlOH5BSQ6QYlhvyEhxPI/15XpaAAWl3e9Ixf8 5ODA== 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=HRSdRCLELx34Gjg+IiYt85uh9DtOOrt9CNFmH9jwWuo=; b=DgklntDpiklg77TpL2dHbDYqyYXUtyyH1NfnV4X3dZ3rwvpK4zQaKzGvYEvVbLEhhL brFXYbgazQkvc3rjxpLeNZZzFE4q0U1e9bmsWoua5LTGdK13yLxkjMpNCSAtDbMJ+7YQ 7yzlgKoc2FYhgdpfSLvwNRQBYozoA6JX3K7WiDPlZcoseGKac92P/O1Wx5i+mV6e8CD2 +lee/ebR8UCvzF5Q/X+TkL35NXzbWs3w7t2SMhSepysB7BfvVLn+8OIkfXvVwWM7LHqg ObZmEUI4MeIOm/Rl1lMJTgcsAZTKVs7T/pc25nOTHqdvdj1xiYKsVUasbIRjWaCYirCa djkw== X-Gm-Message-State: AIkVDXKJLuBkX4xl9FnXep0OirOfiY6R3dUPUdYDzx0MSSzpbfAa+5ZPVwtqZM4BiSCVvWDZ X-Received: by 10.223.133.152 with SMTP id 24mr26844024wrt.29.1484656029868; Tue, 17 Jan 2017 04:27:09 -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.27.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 17 Jan 2017 04:27:09 -0800 (PST) From: Bartosz Golaszewski To: Kevin Hilman , Sekhar Nori , Patrick Titiano , Michael Turquette , Tejun Heo , Rob Herring , Mark Rutland , Russell King , David Lechner Cc: linux-ide@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Bartosz Golaszewski Subject: [PATCH v2 14/14] ARM: dts: da850-lcdk: enable the SATA node Date: Tue, 17 Jan 2017 13:26:16 +0100 Message-Id: <1484655976-25382-15-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> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Enable the SATA node for da850-lcdk. We omit the pinctrl property on purpose - the muxed SATA pins are not hooked up to anything SATA-related on the lcdk. The REFCLKN/P rate on the board is 100MHz, so we need a multiplier of 15 for 1.5GHz PLL rate. Signed-off-by: Bartosz Golaszewski --- arch/arm/boot/dts/da850-lcdk.dts | 4 ++++ 1 file changed, 4 insertions(+) -- 2.9.3 diff --git a/arch/arm/boot/dts/da850-lcdk.dts b/arch/arm/boot/dts/da850-lcdk.dts index afcb482..fbeee3c 100644 --- a/arch/arm/boot/dts/da850-lcdk.dts +++ b/arch/arm/boot/dts/da850-lcdk.dts @@ -105,6 +105,10 @@ status = "okay"; }; +&sata { + status = "okay"; +}; + &mdio { pinctrl-names = "default"; pinctrl-0 = <&mdio_pins>;