From: Keguang Zhang <keguang.zhang@gmail.com>
To: linux-mips@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org
Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
Rob Herring <robh+dt@kernel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
Conor Dooley <conor+dt@kernel.org>,
Keguang Zhang <keguang.zhang@gmail.com>
Subject: [PATCH 03/17] MIPS: dts: Add basic DT support for Loongson-1 boards
Date: Sat, 29 Jul 2023 21:43:04 +0800 [thread overview]
Message-ID: <20230729134318.1694467-4-keguang.zhang@gmail.com> (raw)
In-Reply-To: <20230729134318.1694467-1-keguang.zhang@gmail.com>
Add initial devicetree for Loongson-1 boards, including
LSGZ_1B_DEV and SMARTLOONG_1C board.
These basic DTs contain CPU, clock and core INTC.
Signed-off-by: Keguang Zhang <keguang.zhang@gmail.com>
---
arch/mips/boot/dts/Makefile | 1 +
arch/mips/boot/dts/loongson/Makefile | 3 +
arch/mips/boot/dts/loongson/loongson1.dtsi | 22 ++++++
arch/mips/boot/dts/loongson/loongson1b.dtsi | 75 +++++++++++++++++++
arch/mips/boot/dts/loongson/loongson1c.dtsi | 29 +++++++
arch/mips/boot/dts/loongson/lsgz_1b_dev.dts | 25 +++++++
arch/mips/boot/dts/loongson/smartloong_1c.dts | 25 +++++++
7 files changed, 180 insertions(+)
create mode 100644 arch/mips/boot/dts/loongson/loongson1.dtsi
create mode 100644 arch/mips/boot/dts/loongson/loongson1b.dtsi
create mode 100644 arch/mips/boot/dts/loongson/loongson1c.dtsi
create mode 100644 arch/mips/boot/dts/loongson/lsgz_1b_dev.dts
create mode 100644 arch/mips/boot/dts/loongson/smartloong_1c.dts
diff --git a/arch/mips/boot/dts/Makefile b/arch/mips/boot/dts/Makefile
index 928f38a79dff..2e040b1ba97b 100644
--- a/arch/mips/boot/dts/Makefile
+++ b/arch/mips/boot/dts/Makefile
@@ -6,6 +6,7 @@ subdir-$(CONFIG_FIT_IMAGE_FDT_BOSTON) += img
subdir-$(CONFIG_MACH_INGENIC) += ingenic
subdir-$(CONFIG_LANTIQ) += lantiq
subdir-$(CONFIG_MACH_LOONGSON64) += loongson
+subdir-$(CONFIG_MACH_LOONGSON32) += loongson
subdir-$(CONFIG_SOC_VCOREIII) += mscc
subdir-$(CONFIG_MIPS_MALTA) += mti
subdir-$(CONFIG_LEGACY_BOARD_SEAD3) += mti
diff --git a/arch/mips/boot/dts/loongson/Makefile b/arch/mips/boot/dts/loongson/Makefile
index 5c6433e441ee..9d95f1351d5f 100644
--- a/arch/mips/boot/dts/loongson/Makefile
+++ b/arch/mips/boot/dts/loongson/Makefile
@@ -6,4 +6,7 @@ dtb-$(CONFIG_MACH_LOONGSON64) += loongson64c_8core_rs780e.dtb
dtb-$(CONFIG_MACH_LOONGSON64) += loongson64g_4core_ls7a.dtb
dtb-$(CONFIG_MACH_LOONGSON64) += loongson64v_4core_virtio.dtb
+dtb-$(CONFIG_LOONGSON1B_LSGZ_DEV) += lsgz_1b_dev.dtb
+dtb-$(CONFIG_LOONGSON1C_SMARTLOONG) += smartloong_1c.dtb
+
obj-$(CONFIG_BUILTIN_DTB) += $(addsuffix .o, $(dtb-y))
diff --git a/arch/mips/boot/dts/loongson/loongson1.dtsi b/arch/mips/boot/dts/loongson/loongson1.dtsi
new file mode 100644
index 000000000000..a2b5c828bbbd
--- /dev/null
+++ b/arch/mips/boot/dts/loongson/loongson1.dtsi
@@ -0,0 +1,22 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (c) 2023 Keguang Zhang <keguang.zhang@gmail.com>
+ */
+
+/dts-v1/;
+
+#include <dt-bindings/clock/loongson,ls1x-clk.h>
+#include <dt-bindings/interrupt-controller/irq.h>
+
+/ {
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ cpu_intc: interrupt-controller {
+ compatible = "mti,cpu-interrupt-controller";
+ #address-cells = <0>;
+
+ interrupt-controller;
+ #interrupt-cells = <1>;
+ };
+};
diff --git a/arch/mips/boot/dts/loongson/loongson1b.dtsi b/arch/mips/boot/dts/loongson/loongson1b.dtsi
new file mode 100644
index 000000000000..784ae9b6572d
--- /dev/null
+++ b/arch/mips/boot/dts/loongson/loongson1b.dtsi
@@ -0,0 +1,75 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (c) 2023 Keguang Zhang <keguang.zhang@gmail.com>
+ */
+
+/dts-v1/;
+#include "loongson1.dtsi"
+
+/ {
+ cpus {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ cpu@0 {
+ device_type = "cpu";
+ reg = <0>;
+ #clock-cells = <1>;
+ clocks = <&clkc LS1X_CLKID_CPU>;
+ operating-points-v2 = <&cpu_opp_table>;
+ };
+ };
+
+ cpu_opp_table: opp-table {
+ compatible = "operating-points-v2";
+ opp-shared;
+
+ opp-44000000 {
+ opp-hz = /bits/ 64 <44000000>;
+ };
+ opp-47142000 {
+ opp-hz = /bits/ 64 <47142000>;
+ };
+ opp-50769000 {
+ opp-hz = /bits/ 64 <50769000>;
+ };
+ opp-55000000 {
+ opp-hz = /bits/ 64 <55000000>;
+ };
+ opp-60000000 {
+ opp-hz = /bits/ 64 <60000000>;
+ };
+ opp-66000000 {
+ opp-hz = /bits/ 64 <66000000>;
+ };
+ opp-73333000 {
+ opp-hz = /bits/ 64 <73333000>;
+ };
+ opp-82500000 {
+ opp-hz = /bits/ 64 <82500000>;
+ };
+ opp-94285000 {
+ opp-hz = /bits/ 64 <94285000>;
+ };
+ opp-110000000 {
+ opp-hz = /bits/ 64 <110000000>;
+ };
+ opp-132000000 {
+ opp-hz = /bits/ 64 <132000000>;
+ };
+ opp-165000000 {
+ opp-hz = /bits/ 64 <165000000>;
+ };
+ opp-220000000 {
+ opp-hz = /bits/ 64 <220000000>;
+ };
+ };
+
+ clkc: clock-controller@1fe78030 {
+ compatible = "loongson,ls1b-clk";
+ reg = <0x1fe78030 0x8>;
+
+ clocks = <&xtal>;
+ #clock-cells = <1>;
+ };
+};
diff --git a/arch/mips/boot/dts/loongson/loongson1c.dtsi b/arch/mips/boot/dts/loongson/loongson1c.dtsi
new file mode 100644
index 000000000000..d552e1668984
--- /dev/null
+++ b/arch/mips/boot/dts/loongson/loongson1c.dtsi
@@ -0,0 +1,29 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (c) 2023 Keguang Zhang <keguang.zhang@gmail.com>
+ */
+
+/dts-v1/;
+#include "loongson1.dtsi"
+
+/ {
+ cpus {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ cpu@0 {
+ device_type = "cpu";
+ reg = <0>;
+ #clock-cells = <1>;
+ clocks = <&clkc LS1X_CLKID_CPU>;
+ };
+ };
+
+ clkc: clock-controller@1fe78030 {
+ compatible = "loongson,ls1c-clk";
+ reg = <0x1fe78030 0x8>;
+
+ clocks = <&xtal>;
+ #clock-cells = <1>;
+ };
+};
diff --git a/arch/mips/boot/dts/loongson/lsgz_1b_dev.dts b/arch/mips/boot/dts/loongson/lsgz_1b_dev.dts
new file mode 100644
index 000000000000..d12c723b0a2b
--- /dev/null
+++ b/arch/mips/boot/dts/loongson/lsgz_1b_dev.dts
@@ -0,0 +1,25 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (c) 2023 Keguang Zhang <keguang.zhang@gmail.com>
+ */
+
+/dts-v1/;
+
+#include "loongson1b.dtsi"
+
+/ {
+ compatible = "loongson,lsgz-1b-dev", "loongson,ls1b";
+ model = "LSGZ_1B_DEV Board";
+
+ memory@0 {
+ device_type = "memory";
+ reg = <0x0 0x4000000>;
+ };
+
+ xtal: xtal {
+ compatible = "fixed-clock";
+ clock-frequency = <33000000>;
+ clock-output-names = "xtal";
+ #clock-cells = <0>;
+ };
+};
diff --git a/arch/mips/boot/dts/loongson/smartloong_1c.dts b/arch/mips/boot/dts/loongson/smartloong_1c.dts
new file mode 100644
index 000000000000..64e869acfd86
--- /dev/null
+++ b/arch/mips/boot/dts/loongson/smartloong_1c.dts
@@ -0,0 +1,25 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (c) 2023 Keguang Zhang <keguang.zhang@gmail.com>
+ */
+
+/dts-v1/;
+
+#include "loongson1c.dtsi"
+
+/ {
+ compatible = "loongmasses,smartloong-1c", "loongson,ls1c";
+ model = "Smartloong_1C Board";
+
+ memory@0 {
+ device_type = "memory";
+ reg = <0x0 0x2000000>;
+ };
+
+ xtal: xtal {
+ compatible = "fixed-clock";
+ clock-frequency = <24000000>;
+ clock-output-names = "xtal";
+ #clock-cells = <0>;
+ };
+};
--
2.39.2
next prev parent reply other threads:[~2023-07-29 13:43 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-29 13:43 [PATCH 00/17] MIPS: loongson32: Convert all platform devices to DT Keguang Zhang
2023-07-29 13:43 ` [PATCH 01/17] MIPS: loongson32: Get the system type from DT Keguang Zhang
2023-07-29 13:43 ` [PATCH 02/17] MIPS: Modify the Loongson1 PRID_REV Keguang Zhang
2023-08-01 13:52 ` Philippe Mathieu-Daudé
2023-07-29 13:43 ` Keguang Zhang [this message]
2023-07-30 17:11 ` [PATCH 03/17] MIPS: dts: Add basic DT support for Loongson-1 boards Du Huanpeng
2023-07-31 3:06 ` Keguang Zhang
2023-07-29 13:43 ` [PATCH 04/17] MIPS: loongson32: Modify Loongson-1B/1C related Kconfig options Keguang Zhang
2023-07-29 13:43 ` [PATCH 05/17] MIPS: loongson32: Adapt the common code to support DT Keguang Zhang
2023-07-29 13:43 ` [PATCH 06/17] MIPS: loongson32: Convert platform IRQ driver to DT Keguang Zhang
2023-07-30 8:24 ` Krzysztof Kozlowski
2023-07-31 2:52 ` Keguang Zhang
2023-07-29 13:43 ` [PATCH 07/17] MIPS: loongson32: Convert UART platform device " Keguang Zhang
2023-07-30 8:26 ` Krzysztof Kozlowski
2023-07-31 3:04 ` Keguang Zhang
2023-07-31 3:32 ` Keguang Zhang
2023-07-31 6:56 ` Krzysztof Kozlowski
2023-07-29 13:43 ` [PATCH 08/17] MIPS: loongson32: Convert Ethernet " Keguang Zhang
2023-08-01 18:21 ` Serge Semin
2023-08-02 3:10 ` Keguang Zhang
2023-08-02 9:44 ` Serge Semin
2023-08-02 11:19 ` Keguang Zhang
2023-08-02 12:42 ` Serge Semin
2023-08-02 10:31 ` Du Huanpeng
2023-08-02 11:30 ` Keguang Zhang
2023-07-29 13:43 ` [PATCH 09/17] MIPS: loongson32: Convert GPIO " Keguang Zhang
2023-07-29 13:43 ` [PATCH 10/17] MIPS: loongson32: Convert GPIO LED " Keguang Zhang
2023-07-29 13:43 ` [PATCH 11/17] MIPS: loongson32: Convert USB host " Keguang Zhang
2023-07-29 13:43 ` [PATCH 12/17] MIPS: loongson32: Convert RTC " Keguang Zhang
2023-07-29 13:43 ` [PATCH 13/17] MIPS: loongson32: Convert watchdog " Keguang Zhang
2023-07-29 13:43 ` [PATCH 14/17] mips: dts: loongson1b: Add PWM timer clocksource Keguang Zhang
2023-07-30 8:27 ` Krzysztof Kozlowski
2023-07-29 13:43 ` [PATCH 15/17] MIPS: loongson32: Remove all the obsolete code of platform device Keguang Zhang
2023-07-29 13:43 ` [PATCH 16/17] MIPS: configs: Update and rename loongson1b_defconfig Keguang Zhang
2023-07-29 13:43 ` [PATCH 17/17] MIPS: configs: Update and rename loongson1c_defconfig Keguang Zhang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230729134318.1694467-4-keguang.zhang@gmail.com \
--to=keguang.zhang@gmail.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@vger.kernel.org \
--cc=robh+dt@kernel.org \
--cc=tsbogend@alpha.franken.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).