Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp5603423ybp; Tue, 8 Oct 2019 05:41:04 -0700 (PDT) X-Google-Smtp-Source: APXvYqw1H9hq2Jzbr+LeKDPZEIh+YWqw4uSiB+ZqllclvD+mXqaIieZeTgNDuck27mKEmH4GQHlO X-Received: by 2002:aa7:d750:: with SMTP id a16mr33851319eds.27.1570538464127; Tue, 08 Oct 2019 05:41:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570538464; cv=none; d=google.com; s=arc-20160816; b=wp7kH70OUrZ8UfsNOkdDYRqbzLD9jXOi8ItapalF5d54n37lBokc9TbvW50yUgynA9 mgzIcXIMaa0gfsg1GiGx4gs6uGfeQYoiKw+yyNDovADUBYwYoIg3ttvcbY7mJUt3kLER tw7nshuAsuKod2BqDDdbJf+gYn8ub+YWWi0KqUB1/3sY/M6s4SJDL5DFqT3+nkloOOb0 BHgzm0Fz/OqgXW/VFw7egqmKIk9xS/JXs49s5v8ystsjIJf/g+TMmp3SBhKyBn3sAyNO OVwViMAZE0AgGZ3+bPu2w0CyRiuFsLjNzjIyVrsseOer/FTGzQC7XPUjHOkZAFBsOIpr ktGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=0jJTLY2axsts6GZT3PA6D788BPaMX3GUaWV0Vzd1RXM=; b=03g9MUbjX7W4ng+tptIEdpXl1TY+x2IcaKh4JdZGrdR8Y+4eFKzijio8OBC8ANYhMj qq8h/Kfzx4+BTpX/X3SqtgYvaeFZskcl56T1LO7rovhXankh0zIIuFBSqiqY8P/fkgBY r2GET1+jnOz1Uu3DSkGqP1NsWwzFwbV/GfgHSIYc00/4HOi7cXJxpYFo17hE3ywoYL5g 5oyxLcnYAoOYFeGImD/5s0w699JODW6VRbOpotthcbGQsSw7iyLLvXm0FqNG4OaN/Xsl UpQCWnttSjWKAIXjcUCeUPY57Yw8GiyXxaY/bwdnx2YyrygPH6MTzCxu3hrpkMWeVSnl WVPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@jms.id.au header.s=google header.b=fydorapL; 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 8si8951285ejc.104.2019.10.08.05.40.40; Tue, 08 Oct 2019 05:41:04 -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; dkim=pass header.i=@jms.id.au header.s=google header.b=fydorapL; 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 S1731045AbfJHMkC (ORCPT + 99 others); Tue, 8 Oct 2019 08:40:02 -0400 Received: from mail-qt1-f195.google.com ([209.85.160.195]:37535 "EHLO mail-qt1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730317AbfJHMkC (ORCPT ); Tue, 8 Oct 2019 08:40:02 -0400 Received: by mail-qt1-f195.google.com with SMTP id e15so10144476qtr.4; Tue, 08 Oct 2019 05:40:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jms.id.au; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=0jJTLY2axsts6GZT3PA6D788BPaMX3GUaWV0Vzd1RXM=; b=fydorapLglYueHDm9H8p4AT688wrHVmN/5BLYTckwzJV/hAERlr6H3K4qoiKBtFGyo Qqsz931IkrwgOJzNNIHLJ4B3AVscmOsqqQrfmBYgtSP2tKBChMznGpsmEugFmEbcT5KX SkpxY/1+OmNS7lpVyQHn1fjYhxCoKBBR8JLvo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=0jJTLY2axsts6GZT3PA6D788BPaMX3GUaWV0Vzd1RXM=; b=KPMBd+qnb284ewzbUtuHS8Dhf5l2uVNcA7//wAaXNETb2nxO+RpcBMvv/NqRapgrJf YUWJRB1zJ1IfH6/4xN9UVCLEUwbYIxyn/PJQk+4Cv26GUCBjFd5KKN50nGR7R/VnJZKp emgwTGAP7XNES/4O8jgiBxnOn5+GeLXkUee3YOn4gB8+sh/AdrCZ/AJHtpiafa0VAJuC HNPlsyETYXWS96SmzVVLagznaAocD43rUlA114J4R2B1bKW8ZH0oyVwjaIUlc4lfWMG5 vXe2Ca6fFHmON93YV4aqy4TgMhm3jQ4V4PKjorgFV9myvO0s/+AFm/L9E0wP30ZbinVs A+eQ== X-Gm-Message-State: APjAAAUxHebDwhPhcm2Uk+f5LAtjdGjhVko0B2pphs6qm5HGO2dos7XO cVgMQYddFkIVBXrqG+PdH6KtXoBeDb+U3QXPRTU= X-Received: by 2002:ac8:2e94:: with SMTP id h20mr36037220qta.234.1570538400593; Tue, 08 Oct 2019 05:40:00 -0700 (PDT) MIME-Version: 1.0 References: <20191008113553.13662-1-andrew@aj.id.au> <20191008113553.13662-3-andrew@aj.id.au> In-Reply-To: <20191008113553.13662-3-andrew@aj.id.au> From: Joel Stanley Date: Tue, 8 Oct 2019 12:39:49 +0000 Message-ID: Subject: Re: [PATCH 2/2] clk: ast2600: Add RMII RCLK gates for all four MACs To: Andrew Jeffery Cc: linux-clk@vger.kernel.org, Michael Turquette , Stephen Boyd , Rob Herring , Mark Rutland , Linux ARM , linux-aspeed , Linux Kernel Mailing List , devicetree Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 8 Oct 2019 at 11:35, Andrew Jeffery wrote: > > RCLK is a fixed 50MHz clock derived from HPLL/HCLK that is described by a > single gate for each MAC. > > Signed-off-by: Andrew Jeffery We could have mac12rclk and mac34rclk described in the device tree, as was mentioned in previous reviews of the aspeed driver, but I think we can defer that rework until we rework the rest of the driver. Importantly, that won't change the MAC bindings or the code that the drivers need to use. Reviewed-by: Joel Stanley > --- > drivers/clk/clk-ast2600.c | 47 ++++++++++++++++++++++++++++++++++++++- > 1 file changed, 46 insertions(+), 1 deletion(-) > > diff --git a/drivers/clk/clk-ast2600.c b/drivers/clk/clk-ast2600.c > index 1c1bb39bb04e..3d6fc781fee0 100644 > --- a/drivers/clk/clk-ast2600.c > +++ b/drivers/clk/clk-ast2600.c > @@ -15,7 +15,7 @@ > > #include "clk-aspeed.h" > > -#define ASPEED_G6_NUM_CLKS 67 > +#define ASPEED_G6_NUM_CLKS 71 > > #define ASPEED_G6_SILICON_REV 0x004 > > @@ -40,6 +40,9 @@ > > #define ASPEED_G6_STRAP1 0x500 > > +#define ASPEED_MAC12_CLK_DLY 0x340 > +#define ASPEED_MAC34_CLK_DLY 0x350 > + > /* Globally visible clocks */ > static DEFINE_SPINLOCK(aspeed_g6_clk_lock); > > @@ -485,6 +488,11 @@ static int aspeed_g6_clk_probe(struct platform_device *pdev) > return PTR_ERR(hw); > aspeed_g6_clk_data->hws[ASPEED_CLK_SDIO] = hw; > > + /* MAC1/2 RMII 50MHz RCLK */ > + hw = clk_hw_register_fixed_rate(dev, "mac12rclk", "hpll", 0, 50000000); > + if (IS_ERR(hw)) > + return PTR_ERR(hw); > + > /* MAC1/2 AHB bus clock divider */ > hw = clk_hw_register_divider_table(dev, "mac12", "hpll", 0, > scu_g6_base + ASPEED_G6_CLK_SELECTION1, 16, 3, 0, > @@ -494,6 +502,27 @@ static int aspeed_g6_clk_probe(struct platform_device *pdev) > return PTR_ERR(hw); > aspeed_g6_clk_data->hws[ASPEED_CLK_MAC12] = hw; > > + /* RMII1 50MHz (RCLK) output enable */ > + hw = clk_hw_register_gate(dev, "mac1rclk-gate", "mac12rclk", 0, > + scu_g6_base + ASPEED_MAC12_CLK_DLY, 29, 0, > + &aspeed_g6_clk_lock); > + if (IS_ERR(hw)) > + return PTR_ERR(hw); > + aspeed_g6_clk_data->hws[ASPEED_CLK_GATE_MAC1RCLK] = hw; > + > + /* RMII2 50MHz (RCLK) output enable */ > + hw = clk_hw_register_gate(dev, "mac2rclk-gate", "mac12rclk", 0, > + scu_g6_base + ASPEED_MAC12_CLK_DLY, 30, 0, > + &aspeed_g6_clk_lock); > + if (IS_ERR(hw)) > + return PTR_ERR(hw); > + aspeed_g6_clk_data->hws[ASPEED_CLK_GATE_MAC2RCLK] = hw; > + > + /* MAC1/2 RMII 50MHz RCLK */ > + hw = clk_hw_register_fixed_rate(dev, "mac34rclk", "hclk", 0, 50000000); > + if (IS_ERR(hw)) > + return PTR_ERR(hw); > + > /* MAC3/4 AHB bus clock divider */ > hw = clk_hw_register_divider_table(dev, "mac34", "hpll", 0, > scu_g6_base + 0x310, 24, 3, 0, > @@ -503,6 +532,22 @@ static int aspeed_g6_clk_probe(struct platform_device *pdev) > return PTR_ERR(hw); > aspeed_g6_clk_data->hws[ASPEED_CLK_MAC34] = hw; > > + /* RMII3 50MHz (RCLK) output enable */ > + hw = clk_hw_register_gate(dev, "mac3rclk-gate", "mac34rclk", 0, > + scu_g6_base + ASPEED_MAC34_CLK_DLY, 29, 0, > + &aspeed_g6_clk_lock); > + if (IS_ERR(hw)) > + return PTR_ERR(hw); > + aspeed_g6_clk_data->hws[ASPEED_CLK_GATE_MAC3RCLK] = hw; > + > + /* RMII4 50MHz (RCLK) output enable */ > + hw = clk_hw_register_gate(dev, "mac4rclk-gate", "mac34rclk", 0, > + scu_g6_base + ASPEED_MAC34_CLK_DLY, 30, 0, > + &aspeed_g6_clk_lock); > + if (IS_ERR(hw)) > + return PTR_ERR(hw); > + aspeed_g6_clk_data->hws[ASPEED_CLK_GATE_MAC4RCLK] = hw; > + > /* LPC Host (LHCLK) clock divider */ > hw = clk_hw_register_divider_table(dev, "lhclk", "hpll", 0, > scu_g6_base + ASPEED_G6_CLK_SELECTION1, 20, 3, 0, > -- > 2.20.1 >