From patchwork Sun Jul 22 21:20:10 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Andreas_F=C3=A4rber?= X-Patchwork-Id: 142517 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp5356878ljj; Sun, 22 Jul 2018 14:20:41 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdZZZg0ZdM71v06K/Hb4uqySrAjI0mQCPu1p2w5caAohcSHSKZabztdDFBzXtZaUoqr/ECn X-Received: by 2002:a63:b504:: with SMTP id y4-v6mr9921857pge.247.1532294441779; Sun, 22 Jul 2018 14:20:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532294441; cv=none; d=google.com; s=arc-20160816; b=yG62AH6N91o26yFEvc8BcJsD/wLYa2JJogMA376hsVQ6oZnJEUJYKS7moWa2QK9nz6 QH+LQZoWyCAV7iKz0ZHFy6Tgk1EPnqE+2aJ3ka/E4NkjX40Fid84iBvzEWQPOzKl3b41 7e44tbterTsG/KV7bTocjpH9EBGnuFZlX0/RuMzx5IBw9HjUjKITMrAnuooWrpEv9sT9 ILCfJZ9QUzE7bXVUaxanOA5NvRpH+l3wQNll5Y1p+DD7ev3AZbHyF+VE/QkdGkhsf6th aJTDOAbDyrvkBAIMVeV30UtFEVn/VAKLkUNS6L52kz3K7Xf5w2X9g0YOcSHNEjkQjEs3 UHhw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=5OpyOkKUeeXfR4BVwdSRyBOd9RMKrnbouXvvMBlTbGE=; b=p4Jvxfc3BKybndiTsrraUNAKZmLglv/I+/lG2I2WKiwrCdCgE750ROso682X/lQSDI QEekyUpzXGppCQZ/48yrQIUh2ecKT/OytnpWFn2hP6XSOaNMm23Z2+ZrXrBjfXZ4dfVG OsHSMRpbqNpW440rZx88hTbtTdKEQI7xCZ2esYM2mCNZQmqbd9HkAqqZUHKHmtoj8HsW XbeUooicO658Kml6MuezigfbHmo3bcBOKmLVvCCyvfCgO0es1GaXW6rt6kQQV6LxmHsP r5AOJpSdae1ExjwnC8scsXY3O5BpHyqoPEuCuc+H1hVv13rboT2mTceJe+TFylQVq8x9 gEgA== ARC-Authentication-Results: i=1; mx.google.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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c10-v6si6624289pla.98.2018.07.22.14.20.41; Sun, 22 Jul 2018 14:20:41 -0700 (PDT) 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; 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 S2387905AbeGVWSd (ORCPT + 31 others); Sun, 22 Jul 2018 18:18:33 -0400 Received: from mx2.suse.de ([195.135.220.15]:38772 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2387732AbeGVWS0 (ORCPT ); Sun, 22 Jul 2018 18:18:26 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 8540BADC0; Sun, 22 Jul 2018 21:20:24 +0000 (UTC) From: =?utf-8?q?Andreas_F=C3=A4rber?= To: linux-mips@linux-mips.org Cc: Ralf Baechle , Paul Burton , James Hogan , linux-kernel@vger.kernel.org, Govindraj Raja , =?utf-8?q?Andreas_F=C3=A4?= =?utf-8?q?rber?= , Michael Turquette , Stephen Boyd , Rob Herring , Mark Rutland , linux-clk@vger.kernel.org, devicetree@vger.kernel.org Subject: [PATCH 15/15] clk: pistachio: Fix wrong SDHost card speed Date: Sun, 22 Jul 2018 23:20:10 +0200 Message-Id: <20180722212010.3979-16-afaerber@suse.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20180722212010.3979-1-afaerber@suse.de> References: <20180722212010.3979-1-afaerber@suse.de> MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Govindraj Raja The SDHost currently clocks the card 4x slower than it should do, because there is a fixed divide by 4 in the sdhost wrapper that is not present in the clock tree. To model this, add a fixed divide by 4 clock node in the SDHost clock path. This will ensure the right clock frequency is selected when the mmc driver tries to configure frequency on card insert. Signed-off-by: Govindraj Raja Signed-off-by: Andreas Färber --- drivers/clk/pistachio/clk-pistachio.c | 3 ++- include/dt-bindings/clock/pistachio-clk.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) -- 2.16.4 diff --git a/drivers/clk/pistachio/clk-pistachio.c b/drivers/clk/pistachio/clk-pistachio.c index c4ceb5eaf46c..1c968d9a6e17 100644 --- a/drivers/clk/pistachio/clk-pistachio.c +++ b/drivers/clk/pistachio/clk-pistachio.c @@ -44,7 +44,7 @@ static struct pistachio_gate pistachio_gates[] __initdata = { GATE(CLK_AUX_ADC_INTERNAL, "aux_adc_internal", "sys_internal_div", 0x104, 22), GATE(CLK_AUX_ADC, "aux_adc", "aux_adc_div", 0x104, 23), - GATE(CLK_SD_HOST, "sd_host", "sd_host_div", 0x104, 24), + GATE(CLK_SD_HOST, "sd_host", "sd_host_div4", 0x104, 24), GATE(CLK_BT, "bt", "bt_div", 0x104, 25), GATE(CLK_BT_DIV4, "bt_div4", "bt_div4_div", 0x104, 26), GATE(CLK_BT_DIV8, "bt_div8", "bt_div8_div", 0x104, 27), @@ -54,6 +54,7 @@ static struct pistachio_gate pistachio_gates[] __initdata = { static struct pistachio_fixed_factor pistachio_ffs[] __initdata = { FIXED_FACTOR(CLK_WIFI_DIV4, "wifi_div4", "wifi_pll", 4), FIXED_FACTOR(CLK_WIFI_DIV8, "wifi_div8", "wifi_pll", 8), + FIXED_FACTOR(CLK_SDHOST_DIV4, "sd_host_div4", "sd_host_div", 4), }; static struct pistachio_div pistachio_divs[] __initdata = { diff --git a/include/dt-bindings/clock/pistachio-clk.h b/include/dt-bindings/clock/pistachio-clk.h index 039f83facb68..77b92aed241d 100644 --- a/include/dt-bindings/clock/pistachio-clk.h +++ b/include/dt-bindings/clock/pistachio-clk.h @@ -21,6 +21,7 @@ /* Fixed-factor clocks */ #define CLK_WIFI_DIV4 16 #define CLK_WIFI_DIV8 17 +#define CLK_SDHOST_DIV4 18 /* Gate clocks */ #define CLK_MIPS 32