From patchwork Tue Mar 14 11:14: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: 9623039 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 2CBDF60492 for ; Tue, 14 Mar 2017 11:15:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 221B82838E for ; Tue, 14 Mar 2017 11:15:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1569A2852E; Tue, 14 Mar 2017 11:15:51 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 97F5E2838E for ; Tue, 14 Mar 2017 11:15:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751152AbdCNLPb (ORCPT ); Tue, 14 Mar 2017 07:15:31 -0400 Received: from mail-wm0-f48.google.com ([74.125.82.48]:34831 "EHLO mail-wm0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750836AbdCNLOX (ORCPT ); Tue, 14 Mar 2017 07:14:23 -0400 Received: by mail-wm0-f48.google.com with SMTP id v186so61140389wmd.0 for ; Tue, 14 Mar 2017 04:14:22 -0700 (PDT) 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=Ow8T23zwx4Kyrz/vubBYZHH5vAFkI45/Y7yNJJMqdS4=; b=06NukEgMJbWmV9LUtiQMWg7ZQBvalmb6M7fVfwM0k1nRLAyRxbWxgWgl80nA+vmxkV Sarto2Brxj3QAZIl//su+cj+rUS59lrDmgDSqBC5PPRGK9tUv1cUt5cz8KCW7Wk/GeYP UcpyZVmjTllIJUyuA2BKI3HzA/TcVsN0b0JOy3zH78GI3+VdGVkcEbzK77J80Qg2bZer 8bbNFrhbL8Qi4mc1izjLXQSIMbQt1ib/Q4PbUHrSTgZ1eTeEF9v4OGNR44KsEQIasQEM RCqxuHIzO2DfhmalHXYv2Wfqr4TI0L29y00+swITG7Dz64VGLlSPWOR8qqt7o/kojCo6 KvCw== 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=Ow8T23zwx4Kyrz/vubBYZHH5vAFkI45/Y7yNJJMqdS4=; b=fM8UHUGak7IhgqyGD3DSISJ5/OiI5wY/IWBf8+p3Vll6eq7gLD1C9zGfy9CfoqdGIn ptEzx5rz3MnRYm9rELdYLoukorgms7gDexHPu4QlC+lWIyje7qhhV5qVRxMsi5qlOKto PFkFiIIvXk4+pwXKuOahT62rmMO53dMr1CP4nXYY9nU0Y6xqY1eesvQSFeAMwBSsLQ+T +liVOsNx0aICIEti1KjvkZJxvA2PjKRj++P/5bCyFJekO58McKHEiYJgwLHGZDefyJ3o aoNEYusWdJ9vlvgWxLv6zL7fLmIZQPeyYsaGu0EKptds2OcruxyZLfJBL4gQEOvEv3At BL8Q== X-Gm-Message-State: AFeK/H3W/RJcNYWZtF5dvtHlyByNpcIA/kh8aiABDNkpEswHVwCn7SvBN++SNBBnn5/He6mp X-Received: by 10.28.172.68 with SMTP id v65mr13574917wme.49.1489490061302; Tue, 14 Mar 2017 04:14:21 -0700 (PDT) Received: from localhost.localdomain ([90.63.244.31]) by smtp.gmail.com with ESMTPSA id j26sm28786670wrb.69.2017.03.14.04.14.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 14 Mar 2017 04:14:20 -0700 (PDT) From: Bartosz Golaszewski To: Rob Herring , Mark Rutland , Neil Armstrong , Michael Turquette , Kevin Hilman , Patrick Titiano , Tony Lindgren , Paul Walmsley , Sergei Shtylyov Cc: linux-ide@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-omap@vger.kernel.org, Bartosz Golaszewski Subject: [PATCH v2 1/4] ARM: OMAP2+: dm81xx: Add clkdm and hwmod for SATA Date: Tue, 14 Mar 2017 12:14:12 +0100 Message-Id: <1489490055-2318-2-git-send-email-bgolaszewski@baylibre.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1489490055-2318-1-git-send-email-bgolaszewski@baylibre.com> References: <1489490055-2318-1-git-send-email-bgolaszewski@baylibre.com> Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Kevin Hilman Add the SATA clockdomain (part of CM_DEFAULT) and a hwmod for the SATA block on dm81xx. Tested on DM8168 EVM. Signed-off-by: Kevin Hilman [Bartosz: removed an unused define] Signed-off-by: Bartosz Golaszewski --- arch/arm/mach-omap2/clockdomains81xx_data.c | 10 +++++++++ arch/arm/mach-omap2/cm81xx.h | 1 + arch/arm/mach-omap2/omap_hwmod_81xx_data.c | 34 +++++++++++++++++++++++++++++ 3 files changed, 45 insertions(+) diff --git a/arch/arm/mach-omap2/clockdomains81xx_data.c b/arch/arm/mach-omap2/clockdomains81xx_data.c index 3b5fb05..65fbd13 100644 --- a/arch/arm/mach-omap2/clockdomains81xx_data.c +++ b/arch/arm/mach-omap2/clockdomains81xx_data.c @@ -91,6 +91,14 @@ static struct clockdomain default_l3_slow_81xx_clkdm = { .flags = CLKDM_CAN_SWSUP, }; +static struct clockdomain default_sata_81xx_clkdm = { + .name = "default_clkdm", + .pwrdm = { .name = "default_pwrdm" }, + .cm_inst = TI81XX_CM_DEFAULT_MOD, + .clkdm_offs = TI816X_CM_DEFAULT_SATA_CLKDM, + .flags = CLKDM_CAN_SWSUP, +}; + /* 816x only */ static struct clockdomain alwon_mpu_816x_clkdm = { @@ -173,6 +181,7 @@ static struct clockdomain *clockdomains_ti814x[] __initdata = { &mmu_81xx_clkdm, &mmu_cfg_81xx_clkdm, &default_l3_slow_81xx_clkdm, + &default_sata_81xx_clkdm, NULL, }; @@ -200,6 +209,7 @@ static struct clockdomain *clockdomains_ti816x[] __initdata = { &default_ducati_816x_clkdm, &default_pci_816x_clkdm, &default_l3_slow_81xx_clkdm, + &default_sata_81xx_clkdm, NULL, }; diff --git a/arch/arm/mach-omap2/cm81xx.h b/arch/arm/mach-omap2/cm81xx.h index 3a0ccf0..5d73a10 100644 --- a/arch/arm/mach-omap2/cm81xx.h +++ b/arch/arm/mach-omap2/cm81xx.h @@ -57,5 +57,6 @@ #define TI816X_CM_DEFAULT_PCI_CLKDM 0x0010 #define TI816X_CM_DEFAULT_L3_SLOW_CLKDM 0x0014 #define TI816X_CM_DEFAULT_DUCATI_CLKDM 0x0018 +#define TI816X_CM_DEFAULT_SATA_CLKDM 0x0060 #endif diff --git a/arch/arm/mach-omap2/omap_hwmod_81xx_data.c b/arch/arm/mach-omap2/omap_hwmod_81xx_data.c index b82b77c..310afe4 100644 --- a/arch/arm/mach-omap2/omap_hwmod_81xx_data.c +++ b/arch/arm/mach-omap2/omap_hwmod_81xx_data.c @@ -106,6 +106,7 @@ */ #define DM81XX_CM_DEFAULT_OFFSET 0x500 #define DM81XX_CM_DEFAULT_USB_CLKCTRL (0x558 - DM81XX_CM_DEFAULT_OFFSET) +#define DM81XX_CM_DEFAULT_SATA_CLKCTRL (0x560 - DM81XX_CM_DEFAULT_OFFSET) /* L3 Interconnect entries clocked at 125, 250 and 500MHz */ static struct omap_hwmod dm81xx_alwon_l3_slow_hwmod = { @@ -973,6 +974,38 @@ static struct omap_hwmod_ocp_if dm816x_l4_hs__emac1 = { .user = OCP_USER_MPU, }; +static struct omap_hwmod_class_sysconfig dm81xx_sata_sysc = { + .sysc_offs = 0x1100, + .sysc_flags = SYSC_HAS_SIDLEMODE, + .idlemodes = SIDLE_FORCE, + .sysc_fields = &omap_hwmod_sysc_type3, +}; + +static struct omap_hwmod_class dm81xx_sata_hwmod_class = { + .name = "sata", + .sysc = &dm81xx_sata_sysc, +}; + +static struct omap_hwmod dm81xx_sata_hwmod = { + .name = "sata", + .clkdm_name = "default_sata_clkdm", + .flags = HWMOD_NO_IDLEST, + .prcm = { + .omap4 = { + .clkctrl_offs = DM81XX_CM_DEFAULT_SATA_CLKCTRL, + .modulemode = MODULEMODE_SWCTRL, + }, + }, + .class = &dm81xx_sata_hwmod_class, +}; + +static struct omap_hwmod_ocp_if dm81xx_l4_hs__sata = { + .master = &dm81xx_l4_hs_hwmod, + .slave = &dm81xx_sata_hwmod, + .clk = "sysclk5_ck", + .user = OCP_USER_MPU, +}; + static struct omap_hwmod_class_sysconfig dm81xx_mmc_sysc = { .rev_offs = 0x0, .sysc_offs = 0x110, @@ -1474,6 +1507,7 @@ static struct omap_hwmod_ocp_if *dm816x_hwmod_ocp_ifs[] __initdata = { &dm81xx_l4_hs__emac0, &dm81xx_emac0__mdio, &dm816x_l4_hs__emac1, + &dm81xx_l4_hs__sata, &dm81xx_alwon_l3_fast__tpcc, &dm81xx_alwon_l3_fast__tptc0, &dm81xx_alwon_l3_fast__tptc1,