From patchwork Wed Feb 12 22:43:33 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Sverdlin X-Patchwork-Id: 13972561 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7AAE0C02198 for ; Wed, 12 Feb 2025 22:44:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=02jWElLgWXG78vXvtERpz3FsZmob7H93LAQM3qvrGMQ=; b=uXMwkoijNROlX2 wxxBUk8PBbnPryZkfFq/RBtUOBxF6RinzML0tlTuGppDt/ASx24DDFyB4U4I0HnZxLIMs26YTibB6 CxHjolAdJRj6Q11JiZWJ4zEHthxFLlbEa9ynDteGsqPAdo/WzxtsAM95nZpGnedzYyCMDBOhqMGNl EesvdTYCN4UOpqNuMrTQ2lBEkkSRw7szJiRLeBXOYzh1wKXKIbI2pYSZjov3H/O7mjVhM0/8L+fKr OPYCUETMNYt/tDGfO3QCkomF49KF69XcL2Ph6ecRDge7t+WgP912bSmdoVk+gXuOrXy9C+e9TKRzY tSHXYptioUQIq1bCZLFQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tiLSa-000000094fA-1hqS; Wed, 12 Feb 2025 22:44:00 +0000 Received: from mail-ed1-x531.google.com ([2a00:1450:4864:20::531]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tiLSX-000000094dZ-2f5b; Wed, 12 Feb 2025 22:43:58 +0000 Received: by mail-ed1-x531.google.com with SMTP id 4fb4d7f45d1cf-5debbced002so443208a12.1; Wed, 12 Feb 2025 14:43:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1739400236; x=1740005036; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=WE/cgoI3XjiUZu3YMqrUwPFzZJu1ed8g0cHOG/w2zWM=; b=XpPUu90o8pNu/CCRcssrW7z7wrl0L+bKKDIeOclR6JTwqi3dZWXLz+Fv8I0iCXBmbu XTWfSh8YCFXnc1UzPOUV8Jy0cNsWQcv03XgRKZWnXDpf9jg/ki/PI+x7Bhg5OQggOLzB SMc2KOTtSg93yx3+9BDWaYGyYx9WwEhp+ICNlbFZGKmC73ImTgoue4DP822ZOkegWk5O x7eWup7iQxugzJKqLngVvDXnVhABGLhh+D2/W57E+xLdHdVpJIRnmexvc46/Pug+FjuI c8SP2e19MFdQ86ZHPUU5kmZp9ZoS+qrpVhhzm2/cwLPfMRK9wYosBv1A1ID0ipKy7NGs Ib2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739400236; x=1740005036; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=WE/cgoI3XjiUZu3YMqrUwPFzZJu1ed8g0cHOG/w2zWM=; b=wxiOuoXUtLbFNjjZN+lCaLQRtPT9J6OKeSSimRaskpU+RjUTqDLuH4M7H+E4jW6JS3 COzzob1Umg8HBzAdSma2eWIs/bylsRMP6YLD9awW1w0nCqk1jXdCTvbYvaRBSAGqVaex yKQnhp5nnxUbcjXWzOyXN7rRvV4F3XwW1m9YUOopnHclZHhqqEPtwgCamjW9MbcFgiuQ RFjkH5aiTxyVUoVWtvBtnYLaQmihwzt391mRn5rw8NE84BhilODR0Bkz6zvXiJpcExeA uxg+T31DTMnYYEqzTSQ9xAZjeZFJGqvN3Y7uYvgPciMxe7nthA27YGz58936hkWjn++8 l9Ig== X-Forwarded-Encrypted: i=1; AJvYcCU30eqA5BOarrELC3f6EslDKXwTyrwYEBJww9wR13tL8g4U0jiQWS1vQ4eZEs8qnyK2TDxGw/qB8nOYsYo=@lists.infradead.org, AJvYcCUb5EkW2l3lWtKhZqhTYgprStKoE5yo1letV1/Gshs24ff2w0Q94nWVJXmJgKiw3V6S8dBcXoLzDsst84DjEyU6@lists.infradead.org X-Gm-Message-State: AOJu0YwwZNt1MaFjHxKVunU6TOYhE7qjE1O2Bj9sFpjo4tyjQ4owd3pY 1A9//QlIfTbMBb8G7oPwSwaNC6tfN3V8B3qSQ/KOFfiuVIHxp+4j X-Gm-Gg: ASbGncsWBcM5mp1mJmbPxD7juiXOMGtucpNpNIiGa/QYmo8j4zDmklw8lSW4tuRmbIA pbUIvUqrfVsMOFS7drjqZEDKbNIikddTeIYoc5veHFUtEZZpKoten+PPBLPrvLsm/4Fr49RUGic e0kMAQCxgrautZpHfheqdtjhaYUgDtmy72rOT0B91IzGzAz940t1BxIocndb5p7BxDMv/WQNRnL XCpLQWsiGeyJotGC1GMq3obnRpuYQIiJBMFJs46RRh6KABTZRqalzkVCqccQjlMNqIoXA+GY+3W HwAbRBL8i5B8t2/HrjDY5KeeucKU X-Google-Smtp-Source: AGHT+IFN9XF8EZ92QMiKmnbLf4/Rat6pk17BU7M2pgykUu0O+QYh9n1KLF+iT79Azz1pMcRQF5D5Rg== X-Received: by 2002:a05:6402:26d2:b0:5d9:a5b:d84c with SMTP id 4fb4d7f45d1cf-5decba35568mr532900a12.3.1739400235594; Wed, 12 Feb 2025 14:43:55 -0800 (PST) Received: from giga-mm.. ([2a02:1210:861b:6f00:82ee:73ff:feb8:99e3]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5dece1b4e02sm119914a12.3.2025.02.12.14.43.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Feb 2025 14:43:55 -0800 (PST) From: Alexander Sverdlin To: soc@lists.linux.dev Cc: Alexander Sverdlin , Chen Wang , Inochi Amaoto , linux-riscv@lists.infradead.org, devicetree@vger.kernel.org, Haylen Chu , linux-arm-kernel@lists.infradead.org, Paul Walmsley , Palmer Dabbelt , Albert Ou , Arnd Bergmann , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Jisheng Zhang , Chao Wei Subject: [PATCH v3 1/7] riscv: dts: sophgo: cv18xx: Move RiscV-specific part into SoCs' .dtsi files Date: Wed, 12 Feb 2025 23:43:33 +0100 Message-ID: <20250212224347.1767819-2-alexander.sverdlin@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250212224347.1767819-1-alexander.sverdlin@gmail.com> References: <20250212224347.1767819-1-alexander.sverdlin@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250212_144357_676633_4C97D52A X-CRM114-Status: GOOD ( 18.91 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org Make the peripheral device tree re-usable on ARM64 platform by moving CPU core and interrupt controllers' parts into new cv18xx-cpu.dtsi and cv18xx-intc.dtsi. Add SOC_PERIPHERAL_IRQ() macro which explicitly maps peripheral nubering into "plic" interrupt-controller numbering. On RiscV side this patch has been dtc-compile-tested only. IRQ numbers substitution with SOC_PERIPHERAL_IRQ() has been scripted in vim. Signed-off-by: Alexander Sverdlin --- Changelog: v3: - &cpus node has been moved into cv18xx-cpu.dtsi, &plic and &clint nodes were moved into cv18xx-intc.dtsi to reduce code duplication; v2: - instead of carving out peripherals' part, carve out ARCH-specifics (CPU core, interrupt controllers) and spread them among 3 SoC .dtsi files which included cv18xx.dtsi; - define a label for the "soc" node and use it in the newly introduced DTs; arch/riscv/boot/dts/sophgo/cv1800b.dtsi | 28 ++++--- arch/riscv/boot/dts/sophgo/cv1812h.dtsi | 28 ++++--- arch/riscv/boot/dts/sophgo/cv181x.dtsi | 2 +- arch/riscv/boot/dts/sophgo/cv18xx-cpu.dtsi | 36 ++++++++ arch/riscv/boot/dts/sophgo/cv18xx-intc.dtsi | 23 ++++++ arch/riscv/boot/dts/sophgo/cv18xx.dtsi | 91 ++++++--------------- arch/riscv/boot/dts/sophgo/sg2002.dtsi | 34 ++++---- 7 files changed, 137 insertions(+), 105 deletions(-) create mode 100644 arch/riscv/boot/dts/sophgo/cv18xx-cpu.dtsi create mode 100644 arch/riscv/boot/dts/sophgo/cv18xx-intc.dtsi diff --git a/arch/riscv/boot/dts/sophgo/cv1800b.dtsi b/arch/riscv/boot/dts/sophgo/cv1800b.dtsi index aa1f5df100f0..9fb7dd2dab18 100644 --- a/arch/riscv/boot/dts/sophgo/cv1800b.dtsi +++ b/arch/riscv/boot/dts/sophgo/cv1800b.dtsi @@ -3,8 +3,12 @@ * Copyright (C) 2023 Jisheng Zhang */ +#define SOC_PERIPHERAL_IRQ(nr) ((nr) + 16) + #include +#include "cv18xx-cpu.dtsi" #include "cv18xx.dtsi" +#include "cv18xx-intc.dtsi" / { compatible = "sophgo,cv1800b"; @@ -13,17 +17,23 @@ memory@80000000 { device_type = "memory"; reg = <0x80000000 0x4000000>; }; +}; + +&soc { + dma-noncoherent; - soc { - pinctrl: pinctrl@3001000 { - compatible = "sophgo,cv1800b-pinctrl"; - reg = <0x03001000 0x1000>, - <0x05027000 0x1000>; - reg-names = "sys", "rtc"; - }; + pinctrl: pinctrl@3001000 { + compatible = "sophgo,cv1800b-pinctrl"; + reg = <0x03001000 0x1000>, + <0x05027000 0x1000>; + reg-names = "sys", "rtc"; }; }; +&clk { + compatible = "sophgo,cv1800-clk"; +}; + &plic { compatible = "sophgo,cv1800b-plic", "thead,c900-plic"; }; @@ -31,7 +41,3 @@ &plic { &clint { compatible = "sophgo,cv1800b-clint", "thead,c900-clint"; }; - -&clk { - compatible = "sophgo,cv1800-clk"; -}; diff --git a/arch/riscv/boot/dts/sophgo/cv1812h.dtsi b/arch/riscv/boot/dts/sophgo/cv1812h.dtsi index 8a1b95c5116b..f23c4dd6687d 100644 --- a/arch/riscv/boot/dts/sophgo/cv1812h.dtsi +++ b/arch/riscv/boot/dts/sophgo/cv1812h.dtsi @@ -3,10 +3,14 @@ * Copyright (C) 2023 Inochi Amaoto */ +#define SOC_PERIPHERAL_IRQ(nr) ((nr) + 16) + #include #include +#include "cv18xx-cpu.dtsi" #include "cv18xx.dtsi" #include "cv181x.dtsi" +#include "cv18xx-intc.dtsi" / { compatible = "sophgo,cv1812h"; @@ -15,17 +19,23 @@ memory@80000000 { device_type = "memory"; reg = <0x80000000 0x10000000>; }; +}; + +&soc { + dma-noncoherent; - soc { - pinctrl: pinctrl@3001000 { - compatible = "sophgo,cv1812h-pinctrl"; - reg = <0x03001000 0x1000>, - <0x05027000 0x1000>; - reg-names = "sys", "rtc"; - }; + pinctrl: pinctrl@3001000 { + compatible = "sophgo,cv1812h-pinctrl"; + reg = <0x03001000 0x1000>, + <0x05027000 0x1000>; + reg-names = "sys", "rtc"; }; }; +&clk { + compatible = "sophgo,cv1810-clk"; +}; + &plic { compatible = "sophgo,cv1812h-plic", "thead,c900-plic"; }; @@ -33,7 +43,3 @@ &plic { &clint { compatible = "sophgo,cv1812h-clint", "thead,c900-clint"; }; - -&clk { - compatible = "sophgo,cv1810-clk"; -}; diff --git a/arch/riscv/boot/dts/sophgo/cv181x.dtsi b/arch/riscv/boot/dts/sophgo/cv181x.dtsi index 5fd14dd1b14f..bbdb30653e9a 100644 --- a/arch/riscv/boot/dts/sophgo/cv181x.dtsi +++ b/arch/riscv/boot/dts/sophgo/cv181x.dtsi @@ -11,7 +11,7 @@ soc { emmc: mmc@4300000 { compatible = "sophgo,cv1800b-dwcmshc"; reg = <0x4300000 0x1000>; - interrupts = <34 IRQ_TYPE_LEVEL_HIGH>; + interrupts = ; clocks = <&clk CLK_AXI4_EMMC>, <&clk CLK_EMMC>; clock-names = "core", "bus"; diff --git a/arch/riscv/boot/dts/sophgo/cv18xx-cpu.dtsi b/arch/riscv/boot/dts/sophgo/cv18xx-cpu.dtsi new file mode 100644 index 000000000000..93fd9e47a195 --- /dev/null +++ b/arch/riscv/boot/dts/sophgo/cv18xx-cpu.dtsi @@ -0,0 +1,36 @@ +// SPDX-License-Identifier: (GPL-2.0 OR MIT) +/* + * Copyright (C) 2023 Jisheng Zhang + * Copyright (C) 2023 Inochi Amaoto + */ + +/ { + cpus: cpus { + #address-cells = <1>; + #size-cells = <0>; + timebase-frequency = <25000000>; + + cpu0: cpu@0 { + compatible = "thead,c906", "riscv"; + device_type = "cpu"; + reg = <0>; + d-cache-block-size = <64>; + d-cache-sets = <512>; + d-cache-size = <65536>; + i-cache-block-size = <64>; + i-cache-sets = <128>; + i-cache-size = <32768>; + mmu-type = "riscv,sv39"; + riscv,isa = "rv64imafdc"; + riscv,isa-base = "rv64i"; + riscv,isa-extensions = "i", "m", "a", "f", "d", "c", "zicntr", "zicsr", + "zifencei", "zihpm"; + + cpu0_intc: interrupt-controller { + compatible = "riscv,cpu-intc"; + interrupt-controller; + #interrupt-cells = <1>; + }; + }; + }; +}; diff --git a/arch/riscv/boot/dts/sophgo/cv18xx-intc.dtsi b/arch/riscv/boot/dts/sophgo/cv18xx-intc.dtsi new file mode 100644 index 000000000000..90817993a326 --- /dev/null +++ b/arch/riscv/boot/dts/sophgo/cv18xx-intc.dtsi @@ -0,0 +1,23 @@ +// SPDX-License-Identifier: (GPL-2.0 OR MIT) +/* + * Copyright (C) 2023 Jisheng Zhang + * Copyright (C) 2023 Inochi Amaoto + */ + +&soc { + interrupt-parent = <&plic>; + + plic: interrupt-controller@70000000 { + reg = <0x70000000 0x4000000>; + interrupts-extended = <&cpu0_intc 11>, <&cpu0_intc 9>; + interrupt-controller; + #address-cells = <0>; + #interrupt-cells = <2>; + riscv,ndev = <101>; + }; + + clint: timer@74000000 { + reg = <0x74000000 0x10000>; + interrupts-extended = <&cpu0_intc 3>, <&cpu0_intc 7>; + }; +}; diff --git a/arch/riscv/boot/dts/sophgo/cv18xx.dtsi b/arch/riscv/boot/dts/sophgo/cv18xx.dtsi index c18822ec849f..62c1464a0490 100644 --- a/arch/riscv/boot/dts/sophgo/cv18xx.dtsi +++ b/arch/riscv/boot/dts/sophgo/cv18xx.dtsi @@ -12,47 +12,16 @@ / { #address-cells = <1>; #size-cells = <1>; - cpus: cpus { - #address-cells = <1>; - #size-cells = <0>; - timebase-frequency = <25000000>; - - cpu0: cpu@0 { - compatible = "thead,c906", "riscv"; - device_type = "cpu"; - reg = <0>; - d-cache-block-size = <64>; - d-cache-sets = <512>; - d-cache-size = <65536>; - i-cache-block-size = <64>; - i-cache-sets = <128>; - i-cache-size = <32768>; - mmu-type = "riscv,sv39"; - riscv,isa = "rv64imafdc"; - riscv,isa-base = "rv64i"; - riscv,isa-extensions = "i", "m", "a", "f", "d", "c", "zicntr", "zicsr", - "zifencei", "zihpm"; - - cpu0_intc: interrupt-controller { - compatible = "riscv,cpu-intc"; - interrupt-controller; - #interrupt-cells = <1>; - }; - }; - }; - osc: oscillator { compatible = "fixed-clock"; clock-output-names = "osc_25m"; #clock-cells = <0>; }; - soc { + soc: soc { compatible = "simple-bus"; - interrupt-parent = <&plic>; #address-cells = <1>; #size-cells = <1>; - dma-noncoherent; ranges; clk: clock-controller@3002000 { @@ -75,7 +44,7 @@ porta: gpio-controller@0 { reg = <0>; interrupt-controller; #interrupt-cells = <2>; - interrupts = <60 IRQ_TYPE_LEVEL_HIGH>; + interrupts = ; }; }; @@ -93,7 +62,7 @@ portb: gpio-controller@0 { reg = <0>; interrupt-controller; #interrupt-cells = <2>; - interrupts = <61 IRQ_TYPE_LEVEL_HIGH>; + interrupts = ; }; }; @@ -111,7 +80,7 @@ portc: gpio-controller@0 { reg = <0>; interrupt-controller; #interrupt-cells = <2>; - interrupts = <62 IRQ_TYPE_LEVEL_HIGH>; + interrupts = ; }; }; @@ -129,7 +98,7 @@ portd: gpio-controller@0 { reg = <0>; interrupt-controller; #interrupt-cells = <2>; - interrupts = <63 IRQ_TYPE_LEVEL_HIGH>; + interrupts = ; }; }; @@ -137,7 +106,7 @@ saradc: adc@30f0000 { compatible = "sophgo,cv1800b-saradc"; reg = <0x030f0000 0x1000>; clocks = <&clk CLK_SARADC>; - interrupts = <100 IRQ_TYPE_LEVEL_HIGH>; + interrupts = ; #address-cells = <1>; #size-cells = <0>; status = "disabled"; @@ -162,7 +131,7 @@ i2c0: i2c@4000000 { #size-cells = <0>; clocks = <&clk CLK_I2C>, <&clk CLK_APB_I2C0>; clock-names = "ref", "pclk"; - interrupts = <49 IRQ_TYPE_LEVEL_HIGH>; + interrupts = ; status = "disabled"; }; @@ -173,7 +142,7 @@ i2c1: i2c@4010000 { #size-cells = <0>; clocks = <&clk CLK_I2C>, <&clk CLK_APB_I2C1>; clock-names = "ref", "pclk"; - interrupts = <50 IRQ_TYPE_LEVEL_HIGH>; + interrupts = ; status = "disabled"; }; @@ -184,7 +153,7 @@ i2c2: i2c@4020000 { #size-cells = <0>; clocks = <&clk CLK_I2C>, <&clk CLK_APB_I2C2>; clock-names = "ref", "pclk"; - interrupts = <51 IRQ_TYPE_LEVEL_HIGH>; + interrupts = ; status = "disabled"; }; @@ -195,7 +164,7 @@ i2c3: i2c@4030000 { #size-cells = <0>; clocks = <&clk CLK_I2C>, <&clk CLK_APB_I2C3>; clock-names = "ref", "pclk"; - interrupts = <52 IRQ_TYPE_LEVEL_HIGH>; + interrupts = ; status = "disabled"; }; @@ -206,14 +175,14 @@ i2c4: i2c@4040000 { #size-cells = <0>; clocks = <&clk CLK_I2C>, <&clk CLK_APB_I2C4>; clock-names = "ref", "pclk"; - interrupts = <53 IRQ_TYPE_LEVEL_HIGH>; + interrupts = ; status = "disabled"; }; uart0: serial@4140000 { compatible = "snps,dw-apb-uart"; reg = <0x04140000 0x100>; - interrupts = <44 IRQ_TYPE_LEVEL_HIGH>; + interrupts = ; clocks = <&clk CLK_UART0>, <&clk CLK_APB_UART0>; clock-names = "baudclk", "apb_pclk"; reg-shift = <2>; @@ -224,7 +193,7 @@ uart0: serial@4140000 { uart1: serial@4150000 { compatible = "snps,dw-apb-uart"; reg = <0x04150000 0x100>; - interrupts = <45 IRQ_TYPE_LEVEL_HIGH>; + interrupts = ; clocks = <&clk CLK_UART1>, <&clk CLK_APB_UART1>; clock-names = "baudclk", "apb_pclk"; reg-shift = <2>; @@ -235,7 +204,7 @@ uart1: serial@4150000 { uart2: serial@4160000 { compatible = "snps,dw-apb-uart"; reg = <0x04160000 0x100>; - interrupts = <46 IRQ_TYPE_LEVEL_HIGH>; + interrupts = ; clocks = <&clk CLK_UART2>, <&clk CLK_APB_UART2>; clock-names = "baudclk", "apb_pclk"; reg-shift = <2>; @@ -246,7 +215,7 @@ uart2: serial@4160000 { uart3: serial@4170000 { compatible = "snps,dw-apb-uart"; reg = <0x04170000 0x100>; - interrupts = <47 IRQ_TYPE_LEVEL_HIGH>; + interrupts = ; clocks = <&clk CLK_UART3>, <&clk CLK_APB_UART3>; clock-names = "baudclk", "apb_pclk"; reg-shift = <2>; @@ -261,7 +230,7 @@ spi0: spi@4180000 { #size-cells = <0>; clocks = <&clk CLK_SPI>, <&clk CLK_APB_SPI0>; clock-names = "ssi_clk", "pclk"; - interrupts = <54 IRQ_TYPE_LEVEL_HIGH>; + interrupts = ; status = "disabled"; }; @@ -272,7 +241,7 @@ spi1: spi@4190000 { #size-cells = <0>; clocks = <&clk CLK_SPI>, <&clk CLK_APB_SPI1>; clock-names = "ssi_clk", "pclk"; - interrupts = <55 IRQ_TYPE_LEVEL_HIGH>; + interrupts = ; status = "disabled"; }; @@ -283,7 +252,7 @@ spi2: spi@41a0000 { #size-cells = <0>; clocks = <&clk CLK_SPI>, <&clk CLK_APB_SPI2>; clock-names = "ssi_clk", "pclk"; - interrupts = <56 IRQ_TYPE_LEVEL_HIGH>; + interrupts = ; status = "disabled"; }; @@ -294,14 +263,14 @@ spi3: spi@41b0000 { #size-cells = <0>; clocks = <&clk CLK_SPI>, <&clk CLK_APB_SPI3>; clock-names = "ssi_clk", "pclk"; - interrupts = <57 IRQ_TYPE_LEVEL_HIGH>; + interrupts = ; status = "disabled"; }; uart4: serial@41c0000 { compatible = "snps,dw-apb-uart"; reg = <0x041c0000 0x100>; - interrupts = <48 IRQ_TYPE_LEVEL_HIGH>; + interrupts = ; clocks = <&clk CLK_UART4>, <&clk CLK_APB_UART4>; clock-names = "baudclk", "apb_pclk"; reg-shift = <2>; @@ -312,7 +281,7 @@ uart4: serial@41c0000 { sdhci0: mmc@4310000 { compatible = "sophgo,cv1800b-dwcmshc"; reg = <0x4310000 0x1000>; - interrupts = <36 IRQ_TYPE_LEVEL_HIGH>; + interrupts = ; clocks = <&clk CLK_AXI4_SD0>, <&clk CLK_SD0>; clock-names = "core", "bus"; @@ -322,7 +291,7 @@ sdhci0: mmc@4310000 { sdhci1: mmc@4320000 { compatible = "sophgo,cv1800b-dwcmshc"; reg = <0x4320000 0x1000>; - interrupts = <38 IRQ_TYPE_LEVEL_HIGH>; + interrupts = ; clocks = <&clk CLK_AXI4_SD1>, <&clk CLK_SD1>; clock-names = "core", "bus"; @@ -332,7 +301,7 @@ sdhci1: mmc@4320000 { dmac: dma-controller@4330000 { compatible = "snps,axi-dma-1.01a"; reg = <0x04330000 0x1000>; - interrupts = <29 IRQ_TYPE_LEVEL_HIGH>; + interrupts = ; clocks = <&clk CLK_SDMA_AXI>, <&clk CLK_SDMA_AXI>; clock-names = "core-clk", "cfgr-clk"; #dma-cells = <1>; @@ -344,19 +313,5 @@ dmac: dma-controller@4330000 { snps,data-width = <4>; status = "disabled"; }; - - plic: interrupt-controller@70000000 { - reg = <0x70000000 0x4000000>; - interrupts-extended = <&cpu0_intc 11>, <&cpu0_intc 9>; - interrupt-controller; - #address-cells = <0>; - #interrupt-cells = <2>; - riscv,ndev = <101>; - }; - - clint: timer@74000000 { - reg = <0x74000000 0x10000>; - interrupts-extended = <&cpu0_intc 3>, <&cpu0_intc 7>; - }; }; }; diff --git a/arch/riscv/boot/dts/sophgo/sg2002.dtsi b/arch/riscv/boot/dts/sophgo/sg2002.dtsi index 7f79de33163c..b3a4b99a3ecb 100644 --- a/arch/riscv/boot/dts/sophgo/sg2002.dtsi +++ b/arch/riscv/boot/dts/sophgo/sg2002.dtsi @@ -3,10 +3,14 @@ * Copyright (C) 2024 Thomas Bonnefille */ +#define SOC_PERIPHERAL_IRQ(nr) ((nr) + 16) + #include #include +#include "cv18xx-cpu.dtsi" #include "cv18xx.dtsi" #include "cv181x.dtsi" +#include "cv18xx-intc.dtsi" / { compatible = "sophgo,sg2002"; @@ -15,23 +19,17 @@ memory@80000000 { device_type = "memory"; reg = <0x80000000 0x10000000>; }; - - soc { - pinctrl: pinctrl@3001000 { - compatible = "sophgo,sg2002-pinctrl"; - reg = <0x03001000 0x1000>, - <0x05027000 0x1000>; - reg-names = "sys", "rtc"; - }; - }; }; -&plic { - compatible = "sophgo,sg2002-plic", "thead,c900-plic"; -}; +&soc { + dma-noncoherent; -&clint { - compatible = "sophgo,sg2002-clint", "thead,c900-clint"; + pinctrl: pinctrl@3001000 { + compatible = "sophgo,sg2002-pinctrl"; + reg = <0x03001000 0x1000>, + <0x05027000 0x1000>; + reg-names = "sys", "rtc"; + }; }; &clk { @@ -41,3 +39,11 @@ &clk { &sdhci0 { compatible = "sophgo,sg2002-dwcmshc"; }; + +&plic { + compatible = "sophgo,sg2002-plic", "thead,c900-plic"; +}; + +&clint { + compatible = "sophgo,sg2002-clint", "thead,c900-clint"; +};