From nobody Tue Oct 7 01:55:51 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 70E262F2C70; Wed, 16 Jul 2025 11:25:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752665139; cv=none; b=Z5JQ7LPtIbTmmu9MbmRxHeJKJUYTkTxXKQioVM97TNH/lei25fdZU/M6mUZAFAohOwD4mn9qBKVsfGFfMbTEs82+GUV5+8mabDmtFGb2ooRr9rGaB8x/94ZB6K2pXrArmGjGHPFVYk/BmzgvYJcy3i8Zc/aDIexvaJFpiIYOdTQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752665139; c=relaxed/simple; bh=ANsNYVpqBxtVJsWkCTNCAC/n2kYbPgExmfS6YoFdW2A=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ZlUazx1S6rZhLjMlZdJ+JsqYlOMoKYIvonFNIevmHAbn0W5Hz4V/DMWyzytO1+p6oDv8DgI+zBVkocJiv3TlBSg19vo52zBnmDsJTeYYVUv/FljOTrLyeixbVcH9C7dQFdyha9r+RTd3VE4ArKqeZiyYD/RlcLbBMJEemdIwFU4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Q1xC2W68; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Q1xC2W68" Received: by smtp.kernel.org (Postfix) with ESMTPS id 20259C4CEFA; Wed, 16 Jul 2025 11:25:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1752665139; bh=ANsNYVpqBxtVJsWkCTNCAC/n2kYbPgExmfS6YoFdW2A=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=Q1xC2W685gHQ2LpJ3DrmgLU5YHh8pnRuBn1PPdLF0bFm7uBYz6AI270qAH1jJD669 lSTacbicET6lzu94LMPh4QAcf5VBnFj/B+tvSrNZgP7E/S1KHDHDLcbZPhd55cuLnC HdmZVxZCgf0A/HefGCYHiHaWKbQj4/fKRlphHg1j1Y5stsddE85Hjz7OBxB6yUPOMU mSfKqbiFMlgyI4DPeHaWXMCUjuynxc0wecr6OYCpFPOLaqExn4MpJFX9QZ2f1xZP80 qs4THQSpn9LEobvmPYKhqczp/a8JvvwvQO72+QuCNJJhVe0Kp69iqEs/LsPqUYbiLS DeiJapKs9r80w== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1646FC83F36; Wed, 16 Jul 2025 11:25:39 +0000 (UTC) From: Keguang Zhang via B4 Relay Date: Wed, 16 Jul 2025 19:25:13 +0800 Subject: [PATCH v3 4/9] MIPS: dts: loongson: Add Smartloong-1C board Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250716-loongson1-arch-v3-4-d160974d696b@gmail.com> References: <20250716-loongson1-arch-v3-0-d160974d696b@gmail.com> In-Reply-To: <20250716-loongson1-arch-v3-0-d160974d696b@gmail.com> To: Thomas Bogendoerfer , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Jiaxun Yang , Keguang Zhang Cc: linux-mips@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1752665136; l=6198; i=keguang.zhang@gmail.com; s=20231129; h=from:subject:message-id; bh=8k4NI0ImdMzubiiidq5o64B1uZ6t3883T78WhKntQoM=; b=9pz1M1MZPhg//wLZGLTgnuvISVqBE2o4ua8T8UsjvfFDXOfjTxD0kBAeu9EStCkKaCQiPaMgk qreAQArdxfCApjSBk7zTls+9m4yDKqgFeyuFFe2rRM+AXVAqzvBE+0d X-Developer-Key: i=keguang.zhang@gmail.com; a=ed25519; pk=FMKGj/JgKll/MgClpNZ3frIIogsh5e5r8CeW2mr+WLs= X-Endpoint-Received: by B4 Relay for keguang.zhang@gmail.com/20231129 with auth_id=102 X-Original-From: Keguang Zhang Reply-To: keguang.zhang@gmail.com From: Keguang Zhang Add a device tree for Smartloong-1C board, supporting CPU, clock, INTC, UART, Ethernet, GPIO, USB host, RTC, watchdog, DMA, and NAND. Signed-off-by: Keguang Zhang --- arch/mips/boot/dts/loongson/Makefile | 1 + arch/mips/boot/dts/loongson/loongson1c.dtsi | 141 ++++++++++++++++++++++= ++++ arch/mips/boot/dts/loongson/smartloong-1c.dts | 110 ++++++++++++++++++++ 3 files changed, 252 insertions(+) diff --git a/arch/mips/boot/dts/loongson/Makefile b/arch/mips/boot/dts/loon= gson/Makefile index 1130efa12768..de4570380c3e 100644 --- a/arch/mips/boot/dts/loongson/Makefile +++ b/arch/mips/boot/dts/loongson/Makefile @@ -8,3 +8,4 @@ dtb-$(CONFIG_MACH_LOONGSON64) +=3D loongson64v_4core_virtio= .dtb =20 dtb-$(CONFIG_MACH_LOONGSON32) +=3D ls1b-demo.dtb dtb-$(CONFIG_MACH_LOONGSON32) +=3D lsgz_1b_dev.dtb +dtb-$(CONFIG_MACH_LOONGSON32) +=3D smartloong-1c.dtb diff --git a/arch/mips/boot/dts/loongson/loongson1c.dtsi b/arch/mips/boot/d= ts/loongson/loongson1c.dtsi new file mode 100644 index 000000000000..5e80c6a657af --- /dev/null +++ b/arch/mips/boot/dts/loongson/loongson1c.dtsi @@ -0,0 +1,141 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (c) 2023-2025 Keguang Zhang + */ + +/dts-v1/; +#include "loongson1.dtsi" + +/ { + clkc: clock-controller@1fe78030 { + compatible =3D "loongson,ls1c-clk"; + reg =3D <0x1fe78030 0x8>; + clocks =3D <&xtal>; + #clock-cells =3D <1>; + }; +}; + +&soc { + syscon: syscon@420 { + compatible =3D "loongson,ls1c-syscon", "syscon"; + reg =3D <0x420 0x8>; + }; + + intc4: interrupt-controller@10a0 { + compatible =3D "loongson,ls1x-intc"; + reg =3D <0x10a0 0x18>; + interrupt-controller; + interrupt-parent =3D <&cpu_intc>; + interrupts =3D <6>; + #interrupt-cells =3D <2>; + }; + + gpio2: gpio@10c8 { + compatible =3D "loongson,ls1x-gpio"; + reg =3D <0x10c8 0x4>; + gpio-controller; + ngpios =3D <32>; + #gpio-cells =3D <2>; + }; + + gpio3: gpio@10cc { + compatible =3D "loongson,ls1x-gpio"; + reg =3D <0x10cc 0x4>; + gpio-controller; + ngpios =3D <32>; + #gpio-cells =3D <2>; + }; + + dma: dma-controller@1160 { + compatible =3D "loongson,ls1c-apbdma", "loongson,ls1b-apbdma"; + reg =3D <0x1160 0x4>; + interrupt-parent =3D <&intc0>; + interrupts =3D <13 IRQ_TYPE_EDGE_RISING>, + <14 IRQ_TYPE_EDGE_RISING>, + <15 IRQ_TYPE_EDGE_RISING>; + interrupt-names =3D "ch0", "ch1", "ch2"; + #dma-cells =3D <1>; + }; + + emac: ethernet@110000 { + compatible =3D "loongson,ls1c-emac", "snps,dwmac-3.50a"; + reg =3D <0x110000 0x10000>; + clocks =3D <&clkc LS1X_CLKID_AHB>; + clock-names =3D "stmmaceth"; + interrupt-parent =3D <&intc1>; + interrupts =3D <3 IRQ_TYPE_LEVEL_HIGH>; + interrupt-names =3D "macirq"; + loongson,ls1-syscon =3D <&syscon>; + snps,pbl =3D <1>; + status =3D "disabled"; + }; + + ehci: usb@120000 { + compatible =3D "generic-ehci"; + reg =3D <0x120000 0x100>; + interrupt-parent =3D <&intc1>; + interrupts =3D <0 IRQ_TYPE_LEVEL_HIGH>; + status =3D "disabled"; + }; + + ohci: usb@128000 { + compatible =3D "generic-ohci"; + reg =3D <0x128000 0x100>; + interrupt-parent =3D <&intc1>; + interrupts =3D <1 IRQ_TYPE_LEVEL_HIGH>; + status =3D "disabled"; + }; +}; + +&apb { + watchdog: watchdog@1c060 { + compatible =3D "loongson,ls1c-wdt"; + reg =3D <0x1c060 0xc>; + clocks =3D <&clkc LS1X_CLKID_APB>; + status =3D "disabled"; + }; + + rtc: rtc@24000 { + compatible =3D "loongson,ls1c-rtc"; + reg =3D <0x24000 0x78>; + status =3D "disabled"; + }; + + nand: nand-controller@38000 { + compatible =3D "loongson,ls1c-nand-controller"; + reg =3D <0x38000 0x24>, <0x38040 0x4>; + reg-names =3D "nand", "nand-dma"; + dmas =3D <&dma 0>; + dma-names =3D "rxtx"; + #address-cells =3D <1>; + #size-cells =3D <0>; + status =3D "disabled"; + + nand@0 { + reg =3D <0>; + label =3D "ls1x-nand"; + nand-use-soft-ecc-engine; + nand-ecc-algo =3D "hamming"; + }; + }; +}; + +&gpio0 { + ngpios =3D <32>; +}; + +&gpio1 { + ngpios =3D <32>; +}; + +&uart1 { + interrupts =3D <4 IRQ_TYPE_LEVEL_HIGH>; +}; + +&uart2 { + interrupts =3D <5 IRQ_TYPE_LEVEL_HIGH>; +}; + +&uart3 { + interrupts =3D <29 IRQ_TYPE_LEVEL_HIGH>; +}; 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..e6c6c2f00c42 --- /dev/null +++ b/arch/mips/boot/dts/loongson/smartloong-1c.dts @@ -0,0 +1,110 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (c) 2023-2025 Keguang Zhang + */ + +/dts-v1/; + +#include + +#include "loongson1c.dtsi" + +/ { + compatible =3D "loongmasses,smartloong-1c", "loongson,ls1c"; + model =3D "Smartloong-1C Board"; + + memory@0 { + device_type =3D "memory"; + reg =3D <0x0 0x4000000>; + }; + + aliases { + gpio0 =3D &gpio0; + gpio1 =3D &gpio1; + gpio2 =3D &gpio2; + gpio3 =3D &gpio3; + serial0 =3D &uart2; + }; + + chosen { + stdout-path =3D "serial0:115200n8"; + }; + + leds { + compatible =3D "gpio-leds"; + + led0 { + label =3D "led0"; + gpios =3D <&gpio1 20 GPIO_ACTIVE_LOW>; + linux,default-trigger =3D "heartbeat"; + }; + + led1 { + label =3D "led1"; + gpios =3D <&gpio1 21 GPIO_ACTIVE_LOW>; + linux,default-trigger =3D "nand-disk"; + }; + }; +}; + +&xtal { + clock-frequency =3D <24000000>; +}; + +&emac { + phy-handle =3D <&phy0>; + phy-mode =3D "rmii"; + status =3D "okay"; + + mdio { + compatible =3D "snps,dwmac-mdio"; + #address-cells =3D <1>; + #size-cells =3D <0>; + + phy0: ethernet-phy@13 { + reg =3D <0x13>; + }; + }; +}; + +&nand { + status =3D "okay"; + + nand@0 { + partitions { + compatible =3D "fixed-partitions"; + #address-cells =3D <1>; + #size-cells =3D <1>; + + partition@0 { + label =3D "kernel"; + reg =3D <0x0 0x1000000>; + }; + + partition@1000000 { + label =3D "rootfs"; + reg =3D <0x1000000 0x7000000>; + }; + }; + }; +}; + +&ehci { + status =3D "okay"; +}; + +&ohci { + status =3D "okay"; +}; + +&rtc { + status =3D "okay"; +}; + +&uart2 { + status =3D "okay"; +}; + +&watchdog { + status =3D "okay"; +}; --=20 2.43.0