From patchwork Mon Mar 13 16:43: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: 9621521 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 DDCF660492 for ; Mon, 13 Mar 2017 16:44:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CE725284D8 for ; Mon, 13 Mar 2017 16:44:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C2667284ED; Mon, 13 Mar 2017 16:44:02 +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=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 64E74284D8 for ; Mon, 13 Mar 2017 16:44:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=KfGJyVT3EU/1A4z3ezjCgRedu8MVSHdBI9A3buRHaF4=; b=qjR088oEq7C8iyuXwAp+Qnyh5d Lxk47mfmv2htFBbxfjB4r592Bfghd6zeQ34u1irRD3KoXljywNMLAYG30iGGwZsc2p00ji8v6ZdDu tiuHq+DbonP5xXdTmXzEx2IupgxoHzcQVhXYSJXVwBNUOTdVpLdmSsUnEGtOEvZIffrQ00M1TH2SO AD/KMUd0DltkBmhULogklHpj5kwyc43NjWiKtRwy92t9oXPKkxzY16FXJmF2yXhsItcNEv5wbyDRQ YfxuB4ekgOiHSCc0Krtli6fxSVAEKjOAqe81uOY+Ger/9ti1tvMAAMeVcwBZfHQsLOX5kmeHUBix7 lcVozIIQ==; 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 1cnT4h-00056L-IO; Mon, 13 Mar 2017 16:43:59 +0000 Received: from mail-wr0-x22c.google.com ([2a00:1450:400c:c0c::22c]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cnT4b-00052S-Js for linux-arm-kernel@lists.infradead.org; Mon, 13 Mar 2017 16:43:56 +0000 Received: by mail-wr0-x22c.google.com with SMTP id u108so107411015wrb.3 for ; Mon, 13 Mar 2017 09:43:33 -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=Cmqg0SiHNyGVSd4tLDqHZCxDO4ZbHcrJbpQdgSpzmSw=; b=bfXQVn3K2YqfwCVki69XwbqEcfPfXRqnf76OlZaueA9SmQvH4buDyyxjlZUkY84SVa 9tFQWfD3k8TrByp5DnHBulEW/MaK504iyVxN/Jpf39v97c7I5uTa7kidwWLM+v8alqQX gRBYqZ2bgaNxRrKcuSHugwpGFI8KPEpYsPKn4NMAJP6tQ5rR88M/LZ29O2I+FYoI/SiG +9RjSeiqcD1UcQzdqFrcrWxONA5iJEb1LRcGHOHGqN+VEK5VmkIJbBLHbiJTFfa7nviT 4RYZ0Vd4Ldp6IZ2oB7kGskFS3rOtvAs2jvojE5Uy8D+AocP5sMRlijvXr/0uOC/bBe1e dwmg== 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=Cmqg0SiHNyGVSd4tLDqHZCxDO4ZbHcrJbpQdgSpzmSw=; b=oQoj9eWfNIJmpntKGxr11Ui7E1lqd/TQwWKMx/B6WerSk0PX9jlrVoTgMAN2rldxyf 8sAlileZKxp5UMoIfhNJZS/17/tR/FH1e/VkaOoj2fM2n6CbdaS2BTUKoB3Pj1Sz60wb h7nVoaf7qAqAEbkDo/0E9z7ra05v9y9fXgXxgFhIQK4JTqOAzhpVTWMhAtxbpb7nZ0DS p6Slvb4sA4xypH+Tu2q7Vz0AYpYtLCJWk7iiOP4y0yNty0d5VshX07bX0TFVGTca/tPa djRAdxXH7WMrhnfsqvg1OZvxHK3UPp3Q2pl3T+MFtIru3xqxbCPoxEG4VEv6ObgwErW7 uzAA== X-Gm-Message-State: AMke39m1PjlwEk6ooJ2TmqNPi6thMcVoW/+qUvnd/OklgInSPsDbf9dBCICHUCgidBkc2ayk X-Received: by 10.223.168.80 with SMTP id l74mr29413504wrc.184.1489423411630; Mon, 13 Mar 2017 09:43:31 -0700 (PDT) Received: from localhost.localdomain ([90.63.244.31]) by smtp.gmail.com with ESMTPSA id g45sm25594602wrd.11.2017.03.13.09.43.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 13 Mar 2017 09:43:31 -0700 (PDT) From: Bartosz Golaszewski To: Rob Herring , Mark Rutland , Neil Armstrong , Michael Turquette , Kevin Hilman , Patrick Titiano , Tony Lindgren , Paul Walmsley Subject: [PATCH 1/4] ARM: OMAP2+: dm81xx: Add clkdm and hwmod for SATA Date: Mon, 13 Mar 2017 17:43:16 +0100 Message-Id: <1489423399-3824-2-git-send-email-bgolaszewski@baylibre.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1489423399-3824-1-git-send-email-bgolaszewski@baylibre.com> References: <1489423399-3824-1-git-send-email-bgolaszewski@baylibre.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170313_094353_816287_6F139DBF X-CRM114-Status: GOOD ( 12.92 ) 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: devicetree@vger.kernel.org, Bartosz Golaszewski , linux-kernel@vger.kernel.org, linux-ide@vger.kernel.org, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.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 Signed-off-by: Bartosz Golaszewski --- arch/arm/mach-omap2/clockdomains81xx_data.c | 10 +++++++++ arch/arm/mach-omap2/cm81xx.h | 2 ++ arch/arm/mach-omap2/omap_hwmod_81xx_data.c | 34 +++++++++++++++++++++++++++++ 3 files changed, 46 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..44ca275 100644 --- a/arch/arm/mach-omap2/cm81xx.h +++ b/arch/arm/mach-omap2/cm81xx.h @@ -35,6 +35,7 @@ #define TI81XX_CM_MMU_CLKDM 0x000C #define TI81XX_CM_MMUCFG_CLKDM 0x0010 #define TI81XX_CM_ALWON_MPU_CLKDM 0x001C +#define TI81XX_CM_ALWON_SYSCLK5_CLKDM 0x0024 #define TI81XX_CM_ALWON_L3_FAST_CLKDM 0x0030 /* ACTIVE */ @@ -57,5 +58,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,