public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Kongyang Liu <seashell11234455@gmail.com>
To: u-boot@lists.denx.de
Cc: Leo <ycliang@andestech.com>, Rick Chen <rick@andestech.com>,
	Tom Rini <trini@konsulko.com>
Subject: [PATCH v2 2/3] riscv: dts: sophgo: Add ethernet node
Date: Sat, 20 Apr 2024 15:00:28 +0800	[thread overview]
Message-ID: <20240420070149.8917-3-seashell11234455@gmail.com> (raw)
In-Reply-To: <20240420070149.8917-1-seashell11234455@gmail.com>

Add ethernet node for cv1800b SoC

Signed-off-by: Kongyang Liu <seashell11234455@gmail.com>

---

Changes in v2:
- Change compatible
- Add clocks and interrupt properties.

 arch/riscv/dts/cv1800b-milkv-duo.dts |  7 ++++++-
 arch/riscv/dts/cv18xx.dtsi           | 23 +++++++++++++++++++++++
 2 files changed, 29 insertions(+), 1 deletion(-)

diff --git a/arch/riscv/dts/cv1800b-milkv-duo.dts b/arch/riscv/dts/cv1800b-milkv-duo.dts
index 94e64ddce8..c1e6611e33 100644
--- a/arch/riscv/dts/cv1800b-milkv-duo.dts
+++ b/arch/riscv/dts/cv1800b-milkv-duo.dts
@@ -29,6 +29,11 @@
 	};
 };
 
+&ethernet0 {
+	status = "okay";
+	phy-mode = "rmii";
+};
+
 &osc {
 	clock-frequency = <25000000>;
 };
@@ -39,7 +44,7 @@
 	no-1-8-v;
 	no-mmc;
 	no-sdio;
-};
+}
 
 &uart0 {
 	status = "okay";
diff --git a/arch/riscv/dts/cv18xx.dtsi b/arch/riscv/dts/cv18xx.dtsi
index ec99c4deeb..c95bac77be 100644
--- a/arch/riscv/dts/cv18xx.dtsi
+++ b/arch/riscv/dts/cv18xx.dtsi
@@ -50,6 +50,20 @@
 		clock-frequency = <375000000>;
 		clock-output-names = "sdhci_clk";
 		#clock-cells = <0>;
+	}
+
+	eth_csrclk: eth-csrclk {
+		compatible = "fixed-clock";
+		clock-frequency = <250000000>;
+		clock-output-names = "eth_csrclk";
+		#clock-cells = <0x0>;
+	};
+
+	eth_ptpclk: eth-ptpclk {
+		compatible = "fixed-clock";
+		clock-frequency = <50000000>;
+		clock-output-names = "eth_ptpclk";
+		#clock-cells = <0x0>;
 	};
 
 	soc {
@@ -138,6 +152,15 @@
 			};
 		};
 
+		ethernet0: ethernet@4070000 {
+			compatible = "sophgo,cv1800b-dwmac";
+			reg = <0x04070000 0x10000>;
+			interrupts = <31 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&eth_csrclk>, <&eth_ptpclk>;
+			clock-names = "stmmaceth", "ptp_ref";
+			status = "disabled";
+		};
+
 		uart0: serial@4140000 {
 			compatible = "snps,dw-apb-uart";
 			reg = <0x04140000 0x100>;
-- 
2.41.0


  parent reply	other threads:[~2024-04-20 10:12 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-20  7:00 [PATCH v2 0/3] board: sophgo: milkv_duo: Add ethernet support for Milk-V Duo board Kongyang Liu
2024-04-20  7:00 ` [PATCH v2 1/3] board: milkv_duo: Add init code for Milk-V Duo ethernet Kongyang Liu
2024-04-20  7:00 ` Kongyang Liu [this message]
2024-05-01 14:32   ` [PATCH v2 2/3] riscv: dts: sophgo: Add ethernet node Leo Liang
2024-04-20  7:00 ` [PATCH v2 3/3] configs: milkv_duo: Add ethernet configs Kongyang Liu

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=20240420070149.8917-3-seashell11234455@gmail.com \
    --to=seashell11234455@gmail.com \
    --cc=rick@andestech.com \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    --cc=ycliang@andestech.com \
    /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