Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp179542pxb; Fri, 9 Apr 2021 22:53:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxPmnPXsTfvNy8zd5WbGzLwQCUz2WBbs3HfbFARlsnFMejr1g6flluKKHzWxkRaFLOP/Vey X-Received: by 2002:a17:907:988c:: with SMTP id ja12mr1829845ejc.41.1618034025749; Fri, 09 Apr 2021 22:53:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618034025; cv=none; d=google.com; s=arc-20160816; b=rb0RMpHNINiwzSUGu36jTnXaeDw2mujXYsXK/jY9Ydn4JdyvTLhgP7Yb9maRw4l98Y mz8mS9w6BkikxXNvv9VntuSHSPGJwlQ1FlY4hXq9yf0HLvOv41SYCqRhJdZbWjMmsrO7 kU46rdunGBtJuGqEKtmSrzUcGcgRkjm6YWiw/2u0/4eOVPJwO+rIo9JYScAGb2AyMtwx s9puYF8kYO6YmJkOghIP/n3/O9xd8fph904ZSJfeodPcytqAFpXN7aQMhsoTzWpHk9d0 wME15Gf+JMK3t3D3wj1M6GlwmyhJbrIqYw66MMVatecZA9awfWkhkEpl6UvabXzW6dCO tWSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=1Y7ZqJ7aphYkfKg9dEOtdy4V6nKSW7Mz/xYiwcmDq+A=; b=gTOXmeD3M290S1w86otGuI6QyoAvVa47P9OcYLPk0F23l2B59aHrpbf7mOQi/kDnEf Ap3k2SONS79vDjWgJz/10HvXI0vTlrWJWmfJ1plPWlBKWDuPEWYkLBkrkPaosGfvMmxN KRqjx8FY6mMT57OHIE3zYbfOiK7QFzzsEaKJ2x5rBW8W303wLadmiritbIPQpx0fusj4 eqUX/1YArDaGO5k5NBErcIMTKSQmpGPwOrZD0Unvnwqkhe/ZBESZjZH1IogsmTu4FZF8 fbmvX2dl4jDGb8Tqnl1aPLnRe4vbyOlOXJtlpO/gHfbNSF+LTM+IlFKyu/964xz0WneR AJYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=KDzM6F+E; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bi21si3668548edb.439.2021.04.09.22.52.43; Fri, 09 Apr 2021 22:53:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=KDzM6F+E; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234272AbhDJFvV (ORCPT + 99 others); Sat, 10 Apr 2021 01:51:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58590 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234192AbhDJFvU (ORCPT ); Sat, 10 Apr 2021 01:51:20 -0400 Received: from mail-wr1-x42f.google.com (mail-wr1-x42f.google.com [IPv6:2a00:1450:4864:20::42f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 77A37C061763; Fri, 9 Apr 2021 22:51:05 -0700 (PDT) Received: by mail-wr1-x42f.google.com with SMTP id e12so7542125wro.11; Fri, 09 Apr 2021 22:51:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=1Y7ZqJ7aphYkfKg9dEOtdy4V6nKSW7Mz/xYiwcmDq+A=; b=KDzM6F+ERtosx7T8UKudF9vT0vdCC2pTwRePhQiRX/jQZMBN4hQK1KxYhmqXYRoVCB oY2HF6go00E4MqeJd1vzqxHdbdWxNfmroEuG1tzLQnWqUUuwAkryXchCqCHozJa77IWg v3zytzgKoqtII3GQjDskoSrx2wvykgufxmJ9LbV5fXVEmDLvvWJdHeyxxSUVZsd/7h+I b7znzcuccsCZg7BB0J0BUMHwdo8XndgFc7oKJplm0tTA0TxrDfHbAGeKriKXyA5+GJjJ 5tBgljsydlU7NDxQBjAUyCv23YFbAgZ1S0VZhJ04hH726fkUj5lMzfkv5LMUAqLUOKNR IVSw== 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:mime-version:content-transfer-encoding; bh=1Y7ZqJ7aphYkfKg9dEOtdy4V6nKSW7Mz/xYiwcmDq+A=; b=AIXKC3Tq2dqvZazcNLT5BFWCnJH6Nis7vtUbSQOxiZoIJamimts4GVsG71x04k8wTY I56yILMd3cvlldpjrqp9L4pF7EkQb+wuQaDNciJzBq82AJSdwGnqVcNr/A8FyrJ7dliF vV9ynDx4W5v0PPDfP+iQNH0mqUVFj7G3EwpStXk/hMrR9exEBqGd/nCHp9KyR4x9HYGZ lfv/c1IzBM/185c7DR7YPxeeBmNhhSEPRkjErU+v2imU1xNnnHqZ0rW2KC4a5Zptu3QE 5QFCv8aK0DRgwrY36lczn9eplPGk0s9MJCfEFqZnsLORWpArrepY44xyB/RqnpHZYbfe 0VKQ== X-Gm-Message-State: AOAM530hTZvlT8EvBrSE/kOmrH8h3JtmPfnHvQe/HFmgkQe1uLs4oSju WtXBJQKUqjITNSdETl72YLE= X-Received: by 2002:a5d:65ca:: with SMTP id e10mr20608832wrw.331.1618033864275; Fri, 09 Apr 2021 22:51:04 -0700 (PDT) Received: from localhost.localdomain (225.red-83-57-119.dynamicip.rima-tde.net. [83.57.119.225]) by smtp.gmail.com with ESMTPSA id o2sm6376518wmc.23.2021.04.09.22.51.03 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 09 Apr 2021 22:51:03 -0700 (PDT) From: Sergio Paracuellos To: sboyd@kernel.org Cc: robh+dt@kernel.org, john@phrozen.org, tsbogend@alpha.franken.de, gregkh@linuxfoundation.org, linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-mips@vger.kernel.org, devel@driverdev.osuosl.org, neil@brown.name, linux-kernel@vger.kernel.org Subject: [PATCH v13 2/4] staging: mt7621-dts: make use of new 'mt7621-clk' Date: Sat, 10 Apr 2021 07:50:57 +0200 Message-Id: <20210410055059.13518-3-sergio.paracuellos@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210410055059.13518-1-sergio.paracuellos@gmail.com> References: <20210410055059.13518-1-sergio.paracuellos@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Clocks for SoC mt7621 have been properly integrated so there is no need to declare fixed clocks at all in the device tree. Remove all of them, add new device tree nodes for mt7621-clk and update the rest of the nodes to use them. Acked-by: Greg Kroah-Hartman Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-dts/gbpc1.dts | 11 ---- drivers/staging/mt7621-dts/mt7621.dtsi | 74 ++++++++++++-------------- 2 files changed, 33 insertions(+), 52 deletions(-) diff --git a/drivers/staging/mt7621-dts/gbpc1.dts b/drivers/staging/mt7621-dts/gbpc1.dts index a7c0d3115d72..7716d0efe524 100644 --- a/drivers/staging/mt7621-dts/gbpc1.dts +++ b/drivers/staging/mt7621-dts/gbpc1.dts @@ -100,17 +100,6 @@ partition@50000 { }; }; -&sysclock { - compatible = "fixed-clock"; - /* This is normally 1/4 of cpuclock */ - clock-frequency = <225000000>; -}; - -&cpuclock { - compatible = "fixed-clock"; - clock-frequency = <900000000>; -}; - &pcie { pinctrl-names = "default"; pinctrl-0 = <&pcie_pins>; diff --git a/drivers/staging/mt7621-dts/mt7621.dtsi b/drivers/staging/mt7621-dts/mt7621.dtsi index 16fc94f65486..b68183e7e6ad 100644 --- a/drivers/staging/mt7621-dts/mt7621.dtsi +++ b/drivers/staging/mt7621-dts/mt7621.dtsi @@ -1,5 +1,6 @@ #include #include +#include / { #address-cells = <1>; @@ -27,27 +28,6 @@ aliases { serial0 = &uartlite; }; - cpuclock: cpuclock@0 { - #clock-cells = <0>; - compatible = "fixed-clock"; - - /* FIXME: there should be way to detect this */ - clock-frequency = <880000000>; - }; - - sysclock: sysclock@0 { - #clock-cells = <0>; - compatible = "fixed-clock"; - - /* This is normally 1/4 of cpuclock */ - clock-frequency = <220000000>; - }; - - mmc_clock: mmc_clock@0 { - #clock-cells = <0>; - compatible = "fixed-clock"; - clock-frequency = <48000000>; - }; mmc_fixed_3v3: fixedregulator@0 { compatible = "regulator-fixed"; @@ -76,8 +56,13 @@ palmbus: palmbus@1E000000 { #size-cells = <1>; sysc: sysc@0 { - compatible = "mtk,mt7621-sysc"; + compatible = "mtk,mt7621-sysc", "syscon"; reg = <0x0 0x100>; + #clock-cells = <1>; + ralink,memctl = <&memc>; + clock-output-names = "xtal", "cpu", "bus", + "50m", "125m", "150m", + "250m", "270m"; }; wdt: wdt@100 { @@ -101,8 +86,8 @@ i2c: i2c@900 { compatible = "mediatek,mt7621-i2c"; reg = <0x900 0x100>; - clocks = <&sysclock>; - + clocks = <&sysc MT7621_CLK_I2C>; + clock-names = "i2c"; resets = <&rstctrl 16>; reset-names = "i2c"; @@ -119,8 +104,8 @@ i2s: i2s@a00 { compatible = "mediatek,mt7621-i2s"; reg = <0xa00 0x100>; - clocks = <&sysclock>; - + clocks = <&sysc MT7621_CLK_I2S>; + clock-names = "i2s"; resets = <&rstctrl 17>; reset-names = "i2s"; @@ -138,7 +123,7 @@ i2s: i2s@a00 { }; memc: memc@5000 { - compatible = "mtk,mt7621-memc"; + compatible = "mtk,mt7621-memc", "syscon"; reg = <0x5000 0x1000>; }; @@ -156,8 +141,8 @@ uartlite: uartlite@c00 { compatible = "ns16550a"; reg = <0xc00 0x100>; - clocks = <&sysclock>; - clock-frequency = <50000000>; + clocks = <&sysc MT7621_CLK_UART1>; + clock-names = "uart1"; interrupt-parent = <&gic>; interrupts = ; @@ -173,7 +158,8 @@ spi0: spi@b00 { compatible = "ralink,mt7621-spi"; reg = <0xb00 0x100>; - clocks = <&sysclock>; + clocks = <&sysc MT7621_CLK_SPI>; + clock-names = "spi"; resets = <&rstctrl 18>; reset-names = "spi"; @@ -189,6 +175,8 @@ gdma: gdma@2800 { compatible = "ralink,rt3883-gdma"; reg = <0x2800 0x800>; + clocks = <&sysc MT7621_CLK_GDMA>; + clock-names = "gdma"; resets = <&rstctrl 14>; reset-names = "dma"; @@ -206,6 +194,8 @@ hsdma: hsdma@7000 { compatible = "mediatek,mt7621-hsdma"; reg = <0x7000 0x1000>; + clocks = <&sysc MT7621_CLK_HSDMA>; + clock-names = "hsdma"; resets = <&rstctrl 5>; reset-names = "hsdma"; @@ -311,11 +301,6 @@ rstctrl: rstctrl { #reset-cells = <1>; }; - clkctrl: clkctrl { - compatible = "ralink,rt2880-clock"; - #clock-cells = <1>; - }; - sdhci: sdhci@1E130000 { status = "disabled"; @@ -334,7 +319,8 @@ sdhci: sdhci@1E130000 { pinctrl-0 = <&sdhci_pins>; pinctrl-1 = <&sdhci_pins>; - clocks = <&mmc_clock &mmc_clock>; + clocks = <&sysc MT7621_CLK_SHXC>, + <&sysc MT7621_CLK_50M>; clock-names = "source", "hclk"; interrupt-parent = <&gic>; @@ -349,7 +335,7 @@ xhci: xhci@1E1C0000 { 0x1e1d0700 0x0100>; reg-names = "mac", "ippc"; - clocks = <&sysclock>; + clocks = <&sysc MT7621_CLK_XTAL>; clock-names = "sys_ck"; interrupt-parent = <&gic>; @@ -368,7 +354,7 @@ gic: interrupt-controller@1fbc0000 { timer { compatible = "mti,gic-timer"; interrupts = ; - clocks = <&cpuclock>; + clocks = <&sysc MT7621_CLK_CPU>; }; }; @@ -381,6 +367,9 @@ nand: nand@1e003000 { 0x1e003800 0x800>; #address-cells = <1>; #size-cells = <1>; + + clocks = <&sysc MT7621_CLK_NAND>; + clock-names = "nand"; }; ethsys: syscon@1e000000 { @@ -394,8 +383,9 @@ ethernet: ethernet@1e100000 { compatible = "mediatek,mt7621-eth"; reg = <0x1e100000 0x10000>; - clocks = <&sysclock>; - clock-names = "ethif"; + clocks = <&sysc MT7621_CLK_FE>, + <&sysc MT7621_CLK_ETH>; + clock-names = "fe", "ethif"; #address-cells = <1>; #size-cells = <0>; @@ -521,7 +511,9 @@ GIC_SHARED 24 IRQ_TYPE_LEVEL_HIGH resets = <&rstctrl 24 &rstctrl 25 &rstctrl 26>; reset-names = "pcie0", "pcie1", "pcie2"; - clocks = <&clkctrl 24 &clkctrl 25 &clkctrl 26>; + clocks = <&sysc MT7621_CLK_PCIE0>, + <&sysc MT7621_CLK_PCIE1>, + <&sysc MT7621_CLK_PCIE2>; clock-names = "pcie0", "pcie1", "pcie2"; phys = <&pcie0_phy 1>, <&pcie2_phy 0>; phy-names = "pcie-phy0", "pcie-phy2"; -- 2.25.1