From patchwork Mon Jun 9 20:22:35 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Griffin X-Patchwork-Id: 31592 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pb0-f70.google.com (mail-pb0-f70.google.com [209.85.160.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id D00DE203AB for ; Mon, 9 Jun 2014 20:23:10 +0000 (UTC) Received: by mail-pb0-f70.google.com with SMTP id rq2sf10011472pbb.9 for ; Mon, 09 Jun 2014 13:23:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=YSt5Eb+MbJv6xh6E/2ajTyiieCIQVaGI15dPwN0UObs=; b=B3MaSi433ztfBgCHOR5DFLUpuAZk4Vcl5WAolj0n9L4Te85XIQx0T7BN+/G8+E5iuJ TNzOr7feXQ+x5yOlrGCXJwdnk/jvEDwtCRhMKn0fQwU7FGej3w8reNxwTAVtjgwRXuo3 X3d1CMAzdTt5LSZeAVmio7egkuwOeZ8cML8s1yB0V/6dcF/taqJ6BD9Ii3TiSdW2Cv1c fsQBS5G1PavCscHjAoPene088jiKJrl9DOn+Mvagni/IQ9KbFS4yOgn+lIw9mRfwhxdd aL4gTnGwjC6U2YZaS3jvNr2knYEQ9tRHqvNB/M9Fo//QntHwg6Fo0sbWr4ME3SnBej8q s3Wg== X-Gm-Message-State: ALoCoQmHW7Z4MlKwmISYsg9U5MTFKHN18X/GR9HJSF6zYSGr+o6iaXTSwZe0bMeb4CeO6akUNEqF X-Received: by 10.66.122.137 with SMTP id ls9mr348582pab.17.1402345390154; Mon, 09 Jun 2014 13:23:10 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.26.51 with SMTP id 48ls1842242qgu.23.gmail; Mon, 09 Jun 2014 13:23:10 -0700 (PDT) X-Received: by 10.221.7.71 with SMTP id on7mr27866079vcb.18.1402345389949; Mon, 09 Jun 2014 13:23:09 -0700 (PDT) Received: from mail-vc0-f173.google.com (mail-vc0-f173.google.com [209.85.220.173]) by mx.google.com with ESMTPS id o5si871428vez.30.2014.06.09.13.23.09 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 09 Jun 2014 13:23:09 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.173 as permitted sender) client-ip=209.85.220.173; Received: by mail-vc0-f173.google.com with SMTP id lf12so836432vcb.4 for ; Mon, 09 Jun 2014 13:23:09 -0700 (PDT) X-Received: by 10.221.59.194 with SMTP id wp2mr3076136vcb.59.1402345389810; Mon, 09 Jun 2014 13:23:09 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.221.54.6 with SMTP id vs6csp172410vcb; Mon, 9 Jun 2014 13:23:09 -0700 (PDT) X-Received: by 10.66.188.5 with SMTP id fw5mr556427pac.63.1402345389060; Mon, 09 Jun 2014 13:23:09 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ta6si359054pab.54.2014.06.09.13.23.06; Mon, 09 Jun 2014 13:23:06 -0700 (PDT) Received-SPF: none (google.com: linux-kernel-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932180AbaFIUW4 (ORCPT + 27 others); Mon, 9 Jun 2014 16:22:56 -0400 Received: from mail-wg0-f41.google.com ([74.125.82.41]:46072 "EHLO mail-wg0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753970AbaFIUWx (ORCPT ); Mon, 9 Jun 2014 16:22:53 -0400 Received: by mail-wg0-f41.google.com with SMTP id a1so2818153wgh.0 for ; Mon, 09 Jun 2014 13:22:51 -0700 (PDT) X-Received: by 10.194.80.161 with SMTP id s1mr35190701wjx.47.1402345371684; Mon, 09 Jun 2014 13:22:51 -0700 (PDT) Received: from localhost.localdomain (cpc14-aztw22-2-0-cust189.18-1.cable.virginm.net. [82.45.1.190]) by mx.google.com with ESMTPSA id ba9sm16545605wib.24.2014.06.09.13.22.50 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 09 Jun 2014 13:22:51 -0700 (PDT) From: Peter Griffin To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, maxime.coquelin@st.com, patrice.chotard@st.com, srinivas.kandagatla@gmail.com Cc: peter.griffin@linaro.org, lee.jones@linaro.org, gabriel.fernandez@st.com, daniel.thompson@linaro.org Subject: [PATCH] ARM: STi: DT: Properly define sti-ethclk & stmmaceth for stih415/6 Date: Mon, 9 Jun 2014 21:22:35 +0100 Message-Id: <1402345355-5682-1-git-send-email-peter.griffin@linaro.org> X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: peter.griffin@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.173 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , This patch fixes two problems: - 1) The device tree isn't currently providing sti-ethclk which is required by the dwmac glue code to correctly configure the ethernet PHY clock speed. This means depending on what the bootloader/jtag has configured this clock to, and what switch/hub the board is plugged into you most likely will NOT successfully negotiate a ethernet link. 2) The stmmaceth clock was associated with the wrong clock. It was referencing the PHY clock rather than the interconnect clock which clocks the IP. This patch also brings us closer to not having to boot the upstream kernel with the clk_ignore_unused parameter. Signed-off-by: Peter Griffin Acked-by: Srinivas Kandagatla --- arch/arm/boot/dts/stih415.dtsi | 8 ++++---- arch/arm/boot/dts/stih416.dtsi | 8 ++++---- include/dt-bindings/clock/stih415-clks.h | 1 + include/dt-bindings/clock/stih416-clks.h | 1 + 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/arch/arm/boot/dts/stih415.dtsi b/arch/arm/boot/dts/stih415.dtsi index c81dce4..768bf27 100644 --- a/arch/arm/boot/dts/stih415.dtsi +++ b/arch/arm/boot/dts/stih415.dtsi @@ -169,8 +169,8 @@ pinctrl-names = "default"; pinctrl-0 = <&pinctrl_mii0>; - clock-names = "stmmaceth"; - clocks = <&clk_s_a1_ls CLK_GMAC0_PHY>; + clock-names = "stmmaceth", "sti-ethclk"; + clocks = <&clk_s_a1_ls CLK_ICN_IF_2>, <&clk_s_a1_ls CLK_GMAC0_PHY>; }; ethernet1: dwmac@fef08000 { @@ -189,11 +189,11 @@ st,syscon = <&syscfg_sbc>; resets = <&softreset STIH415_ETH1_SOFTRESET>; - reset-names = "stmmaceth"; + reset-names = "stmmaceth", "sti-ethclk"; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_mii1>; clock-names = "stmmaceth"; - clocks = <&clk_s_a0_ls CLK_ETH1_PHY>; + clocks = <&clk_s_a0_ls CLK_ICN_REG>, <&clk_s_a0_ls CLK_ETH1_PHY>; }; rc: rc@fe518000 { diff --git a/arch/arm/boot/dts/stih416.dtsi b/arch/arm/boot/dts/stih416.dtsi index 6473287..98c43cc 100644 --- a/arch/arm/boot/dts/stih416.dtsi +++ b/arch/arm/boot/dts/stih416.dtsi @@ -175,8 +175,8 @@ reset-names = "stmmaceth"; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_mii0>; - clock-names = "stmmaceth"; - clocks = <&clk_s_a1_ls CLK_GMAC0_PHY>; + clock-names = "stmmaceth", "sti-ethclk"; + clocks = <&clk_s_a1_ls CLK_ICN_IF_2>, <&clk_s_a1_ls CLK_GMAC0_PHY>; }; ethernet1: dwmac@fef08000 { @@ -197,8 +197,8 @@ reset-names = "stmmaceth"; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_mii1>; - clock-names = "stmmaceth"; - clocks = <&clk_s_a0_ls CLK_ETH1_PHY>; + clock-names = "stmmaceth", "sti-ethclk"; + clocks = <&clk_s_a0_ls CLK_ICN_REG>, <&clk_s_a0_ls CLK_ETH1_PHY>; }; rc: rc@fe518000 { diff --git a/include/dt-bindings/clock/stih415-clks.h b/include/dt-bindings/clock/stih415-clks.h index 0d2c739..d80caa6 100644 --- a/include/dt-bindings/clock/stih415-clks.h +++ b/include/dt-bindings/clock/stih415-clks.h @@ -10,6 +10,7 @@ #define CLK_ETH1_PHY 4 /* CLOCKGEN A1 */ +#define CLK_ICN_IF_2 0 #define CLK_GMAC0_PHY 3 #endif diff --git a/include/dt-bindings/clock/stih416-clks.h b/include/dt-bindings/clock/stih416-clks.h index 552c779..f9bdbd1 100644 --- a/include/dt-bindings/clock/stih416-clks.h +++ b/include/dt-bindings/clock/stih416-clks.h @@ -10,6 +10,7 @@ #define CLK_ETH1_PHY 4 /* CLOCKGEN A1 */ +#define CLK_ICN_IF_2 0 #define CLK_GMAC0_PHY 3 #endif