Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp169260imu; Wed, 12 Dec 2018 14:19:23 -0800 (PST) X-Google-Smtp-Source: AFSGD/VWE71i4eM2fkdSw3lOGE1638g/QKyRVkhXtYEULQq/HSKxoYIy2kF8mdqUQEiOTX76N1iA X-Received: by 2002:a17:902:4503:: with SMTP id m3mr21786654pld.23.1544653163138; Wed, 12 Dec 2018 14:19:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544653163; cv=none; d=google.com; s=arc-20160816; b=tjUzsbxhHdm1megPtjXq2ILhqBFHk/8BSJyIrAJ5veiBXj6At4G8Vkim0x+o97qglB edN0H7xcYmjxH6tJuqMfsmKxORlH94kpujpsA5B9SgwviuogfB2GzwIXCzvPK3HjDX7o eARPXcvjY24HSKPvrMbMiV7U+NKDE51bZnxN7A3tN6aO0UNd/Ebtw6GNRQJtxQ3Uf+SI AI12djyqSlGCiFqUGGUJBS0cXZf1AtEexfWyctfFaqTztfhnb/1krCb59WDoAP7Fq1Qq 6qCXKxQUutK6gzBDQaJFAXLJlR6POj678hGjzOBIILsRytdpg+77oIRsMWLX3YQA/j0k xQmA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:dkim-signature:references:in-reply-to :message-id:date:subject:cc:to:from; bh=ZGkOchP9pptgaJ/lRY2h84JCaEX9cbXr5brHeC4vbsc=; b=B1nYwI2txbNwpjIN+kRNzX1mzoYsPPgNZHh+JL3gpBMOpMt+dETj8NYKPKf7hLU0/A fmODCIWcGiuD1q2x+/mTZqmMKIId+WIbBb661imYWiVCJUqCGL72+EHhCkqyXYMR2H3u vKcWVrmZK0qA7pnjDWso5DTiK9G6EI/1tPzBymr1oDQT9q7gBwRJz3IJjuzqQE1gi1HJ DmL6ZtpA8sHEPDYXxvx4R/vN5XqBFdn+lZHcaoWXR+AMgpT1blvj/md1Ajw+bmy92BVG zlKLVqRf8qxO+Uji2ou4YN8IWolUf4KklWA8StcLc4Y3pfrJ8jeuj5MLeD6zNGTOmhcj 52pA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@crapouillou.net header.s=mail header.b=N2NiJNM8; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=crapouillou.net Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c136si12795pfc.141.2018.12.12.14.19.08; Wed, 12 Dec 2018 14:19:23 -0800 (PST) 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=@crapouillou.net header.s=mail header.b=N2NiJNM8; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=crapouillou.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728499AbeLLWRt (ORCPT + 99 others); Wed, 12 Dec 2018 17:17:49 -0500 Received: from outils.crapouillou.net ([89.234.176.41]:40710 "EHLO crapouillou.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728649AbeLLWQ6 (ORCPT ); Wed, 12 Dec 2018 17:16:58 -0500 From: Paul Cercueil To: Thierry Reding , Rob Herring , Mark Rutland , Daniel Lezcano , Thomas Gleixner , Ralf Baechle , Paul Burton , James Hogan , Jonathan Corbet Cc: Mathieu Malaterre , Ezequiel Garcia , PrasannaKumar Muralidharan , linux-pwm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-watchdog@vger.kernel.org, linux-mips@vger.kernel.org, linux-doc@vger.kernel.org, linux-clk@vger.kernel.org, od@zcrc.me, Paul Cercueil Subject: [PATCH v8 18/26] MIPS: jz4740: Add DTS nodes for the TCU drivers Date: Wed, 12 Dec 2018 23:09:13 +0100 Message-Id: <20181212220922.18759-19-paul@crapouillou.net> In-Reply-To: <20181212220922.18759-1-paul@crapouillou.net> References: <20181212220922.18759-1-paul@crapouillou.net> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crapouillou.net; s=mail; t=1544652606; bh=ZGkOchP9pptgaJ/lRY2h84JCaEX9cbXr5brHeC4vbsc=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; b=N2NiJNM8hN8YeuhO/YQdmQozVvI2C7ve9VoZYWBEyFnTr8x3/UIxwTvHpSgaDKSn46xsmPHf/k6bi/yKtMXdu06OW2h3Wo8XNb7yz4T8MVQPCplpC+9udcjfHC3Zm4IzY3QP6i7dCkWH2ct8EBIR0CAY27XdgRyONWZpLUZ4O4U= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add DTS nodes for the JZ4780, JZ4770 and JZ4740 devicetree files. Signed-off-by: Paul Cercueil --- Notes: v5: New patch v6: Fix register lengths in watchdog/pwm nodes v7: No change v8: - Fix wrong start address for PWM node - Add system timer and clocksource sub-nodes arch/mips/boot/dts/ingenic/jz4740.dtsi | 69 ++++++++++++++++++++++++-- arch/mips/boot/dts/ingenic/jz4770.dtsi | 81 +++++++++++++++++++++++++++++++ arch/mips/boot/dts/ingenic/jz4780.dtsi | 88 ++++++++++++++++++++++++++++++---- 3 files changed, 225 insertions(+), 13 deletions(-) diff --git a/arch/mips/boot/dts/ingenic/jz4740.dtsi b/arch/mips/boot/dts/ingenic/jz4740.dtsi index 6fb16fd24035..d625e8acb695 100644 --- a/arch/mips/boot/dts/ingenic/jz4740.dtsi +++ b/arch/mips/boot/dts/ingenic/jz4740.dtsi @@ -1,5 +1,6 @@ // SPDX-License-Identifier: GPL-2.0 #include +#include / { #address-cells = <1>; @@ -45,12 +46,70 @@ #clock-cells = <1>; }; - watchdog: watchdog@10002000 { - compatible = "ingenic,jz4740-watchdog"; - reg = <0x10002000 0x10>; + tcu: timer@10002000 { + compatible = "ingenic,jz4740-tcu"; + reg = <0x10002000 0x1000>; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0x0 0x10002000 0x1000>; - clocks = <&cgu JZ4740_CLK_RTC>; - clock-names = "rtc"; + #clock-cells = <1>; + + clocks = <&cgu JZ4740_CLK_RTC + &cgu JZ4740_CLK_EXT + &cgu JZ4740_CLK_PCLK + &cgu JZ4740_CLK_TCU>; + clock-names = "rtc", "ext", "pclk", "tcu"; + + interrupt-controller; + #interrupt-cells = <1>; + + interrupt-parent = <&intc>; + interrupts = <23 22 21>; + + watchdog: watchdog@0 { + compatible = "ingenic,jz4740-watchdog"; + reg = <0x0 0xc>; + + clocks = <&tcu TCU_CLK_WDT>; + clock-names = "wdt"; + }; + + timer: timer@40 { + compatible = "ingenic,jz4740-tcu-timer"; + reg = <0x40 0x10>; + + clocks = <&tcu TCU_CLK_TIMER0>; + clock-names = "timer"; + + interrupts = <0>; + }; + + clocksource: timer@50 { + compatible = "ingenic,jz4740-tcu-clocksource"; + reg = <0x50 0x10>; + + clocks = <&tcu TCU_CLK_TIMER1>; + clock-names = "timer"; + }; + + pwm: pwm@60 { + compatible = "ingenic,jz4740-pwm"; + reg = <0x60 0x60>; + + #pwm-cells = <3>; + + clocks = <&tcu TCU_CLK_TIMER0 + &tcu TCU_CLK_TIMER1 + &tcu TCU_CLK_TIMER2 + &tcu TCU_CLK_TIMER3 + &tcu TCU_CLK_TIMER4 + &tcu TCU_CLK_TIMER5 + &tcu TCU_CLK_TIMER6 + &tcu TCU_CLK_TIMER7>; + clock-names = "timer0", "timer1", "timer2", "timer3", + "timer4", "timer5", "timer6", "timer7"; + }; }; rtc_dev: rtc@10003000 { diff --git a/arch/mips/boot/dts/ingenic/jz4770.dtsi b/arch/mips/boot/dts/ingenic/jz4770.dtsi index 49ede6c14ff3..6008975a307f 100644 --- a/arch/mips/boot/dts/ingenic/jz4770.dtsi +++ b/arch/mips/boot/dts/ingenic/jz4770.dtsi @@ -1,6 +1,7 @@ // SPDX-License-Identifier: GPL-2.0 #include +#include / { #address-cells = <1>; @@ -46,6 +47,86 @@ #clock-cells = <1>; }; + tcu: timer@10002000 { + compatible = "ingenic,jz4770-tcu"; + reg = <0x10002000 0x1000>; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0x0 0x10002000 0x1000>; + + #clock-cells = <1>; + + clocks = <&cgu JZ4770_CLK_RTC + &cgu JZ4770_CLK_EXT + &cgu JZ4770_CLK_PCLK + &cgu JZ4770_CLK_EXT>; + clock-names = "rtc", "ext", "pclk", "tcu"; + + interrupt-controller; + #interrupt-cells = <1>; + + interrupt-parent = <&intc>; + interrupts = <27 26 25>; + + watchdog: watchdog@0 { + compatible = "ingenic,jz4740-watchdog"; + reg = <0x0 0xc>; + + clocks = <&tcu TCU_CLK_WDT>; + clock-names = "wdt"; + }; + + timer: timer@40 { + compatible = "ingenic,jz4740-tcu-timer"; + reg = <0x40 0x10>; + + clocks = <&tcu TCU_CLK_TIMER0>; + clock-names = "timer"; + + interrupts = <0>; + }; + + clocksource: timer@50 { + compatible = "ingenic,jz4740-tcu-clocksource"; + reg = <0x50 0x10>; + + clocks = <&tcu TCU_CLK_TIMER1>; + clock-names = "timer"; + + /* Disable by default, since the OST is more precise */ + status = "disabled"; + }; + + + pwm: pwm@60 { + compatible = "ingenic,jz4740-pwm"; + reg = <0x60 0x60>; + + #pwm-cells = <3>; + + clocks = <&tcu TCU_CLK_TIMER0 + &tcu TCU_CLK_TIMER1 + &tcu TCU_CLK_TIMER2 + &tcu TCU_CLK_TIMER3 + &tcu TCU_CLK_TIMER4 + &tcu TCU_CLK_TIMER5 + &tcu TCU_CLK_TIMER6 + &tcu TCU_CLK_TIMER7>; + clock-names = "timer0", "timer1", "timer2", "timer3", + "timer4", "timer5", "timer6", "timer7"; + }; + + ost: timer@e0 { + compatible = "ingenic,jz4770-ost"; + reg = <0xe0 0x20>; + + clocks = <&tcu TCU_CLK_OST>; + clock-names = "ost"; + + interrupts = <15>; + }; + }; + pinctrl: pin-controller@10010000 { compatible = "ingenic,jz4770-pinctrl"; reg = <0x10010000 0x600>; diff --git a/arch/mips/boot/dts/ingenic/jz4780.dtsi b/arch/mips/boot/dts/ingenic/jz4780.dtsi index b03cdec56de9..b8eb8a385651 100644 --- a/arch/mips/boot/dts/ingenic/jz4780.dtsi +++ b/arch/mips/boot/dts/ingenic/jz4780.dtsi @@ -1,5 +1,6 @@ // SPDX-License-Identifier: GPL-2.0 #include +#include #include / { @@ -46,6 +47,85 @@ #clock-cells = <1>; }; + tcu: timer@10002000 { + compatible = "ingenic,jz4770-tcu"; + reg = <0x10002000 0x1000>; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0x0 0x10002000 0x1000>; + + #clock-cells = <1>; + + clocks = <&cgu JZ4780_CLK_RTCLK + &cgu JZ4780_CLK_EXCLK + &cgu JZ4780_CLK_PCLK + &cgu JZ4780_CLK_EXCLK>; + clock-names = "rtc", "ext", "pclk", "tcu"; + + interrupt-controller; + #interrupt-cells = <1>; + + interrupt-parent = <&intc>; + interrupts = <27 26 25>; + + watchdog: watchdog@0 { + compatible = "ingenic,jz4780-watchdog"; + reg = <0x0 0xc>; + + clocks = <&tcu TCU_CLK_WDT>; + clock-names = "wdt"; + }; + + timer: timer@40 { + compatible = "ingenic,jz4740-tcu-timer"; + reg = <0x40 0x10>; + + clocks = <&tcu TCU_CLK_TIMER0>; + clock-names = "timer"; + + interrupts = <0>; + }; + + clocksource: timer@50 { + compatible = "ingenic,jz4740-tcu-clocksource"; + reg = <0x50 0x10>; + + clocks = <&tcu TCU_CLK_TIMER1>; + clock-names = "timer"; + + /* Disable by default, since the OST is more precise */ + status = "disabled"; + }; + + pwm: pwm@60 { + compatible = "ingenic,jz4740-pwm"; + reg = <0x60 0x60>; + + #pwm-cells = <3>; + + clocks = <&tcu TCU_CLK_TIMER0 + &tcu TCU_CLK_TIMER1 + &tcu TCU_CLK_TIMER2 + &tcu TCU_CLK_TIMER3 + &tcu TCU_CLK_TIMER4 + &tcu TCU_CLK_TIMER5 + &tcu TCU_CLK_TIMER6 + &tcu TCU_CLK_TIMER7>; + clock-names = "timer0", "timer1", "timer2", "timer3", + "timer4", "timer5", "timer6", "timer7"; + }; + + ost: timer@e0 { + compatible = "ingenic,jz4770-ost"; + reg = <0xe0 0x20>; + + clocks = <&tcu TCU_CLK_OST>; + clock-names = "ost"; + + interrupts = <15>; + }; + }; + rtc_dev: rtc@10003000 { compatible = "ingenic,jz4780-rtc"; reg = <0x10003000 0x4c>; @@ -239,14 +319,6 @@ status = "disabled"; }; - watchdog: watchdog@10002000 { - compatible = "ingenic,jz4780-watchdog"; - reg = <0x10002000 0x10>; - - clocks = <&cgu JZ4780_CLK_RTCLK>; - clock-names = "rtc"; - }; - nemc: nemc@13410000 { compatible = "ingenic,jz4780-nemc"; reg = <0x13410000 0x10000>; -- 2.11.0