Skip to content

Commit

Permalink
WIP on th_net: d3e1832c7d2d riscv: mm: update T-Head memory type defi…
Browse files Browse the repository at this point in the history
…nitions

WIP

The patch from Jisheng Zhang <jszhang@kernel.org>

Signed-off-by: Han Gao <gaohan@iscas.ac.cn>
  • Loading branch information
RevySR committed Sep 26, 2023
1 parent 8aa9e93 commit a547afa
Show file tree
Hide file tree
Showing 3 changed files with 112 additions and 0 deletions.
8 changes: 8 additions & 0 deletions arch/riscv/boot/dts/thead/th1520-lichee-module-4a.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,14 @@
clock-frequency = <100000000>;
};

&gmac_clk {
clock-frequency = <500000000>;
};

&gmac_axi_clk {
clock-frequency = <100000000>;
};

&dmac0 {
status = "okay";
};
Expand Down
25 changes: 25 additions & 0 deletions arch/riscv/boot/dts/thead/th1520-lichee-pi-4a.dts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
compatible = "sipeed,lichee-pi-4a", "sipeed,lichee-module-4a", "thead,th1520";

aliases {
ethernet0 = &gmac0;
ethernet1 = &gmac1;
gpio0 = &gpio0;
gpio1 = &gpio1;
gpio2 = &gpio2;
Expand All @@ -27,6 +29,29 @@
};
};

&mdio0 {
phy0: ethernet-phy@1 {
reg = <1>;
};
};

&gmac0 {
phy-handle = <&phy0>;
phy-mode = "rgmii-id";
status = "okay";
};

&mdio1 {
phy1: ethernet-phy@2 {
reg = <2>;
};
};

&gmac1 {
phy-handle = <&phy1>;
phy-mode = "rgmii-id";
};

&uart0 {
status = "okay";
};
79 changes: 79 additions & 0 deletions arch/riscv/boot/dts/thead/th1520.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,18 @@
#clock-cells = <0>;
};

gmac_axi_clk: gmac-axi-clock {
compatible = "fixed-clock";
clock-output-names = "gmac_axi_clk";
#clock-cells = <0>;
};

gmac_clk: gmac-clock {
compatible = "fixed-clock";
clock-output-names = "gmac_clk";
#clock-cells = <0>;
};

soc {
compatible = "simple-bus";
interrupt-parent = <&plic>;
Expand Down Expand Up @@ -180,6 +192,62 @@
<&cpu3_intc 3>, <&cpu3_intc 7>;
};

gmac0: ethernet@ffe7070000 {
compatible = "thead,th1520-dwmac", "snps,dwmac-3.70a";
reg = <0xff 0xe7070000 0x0 0x2000>;
interrupts = <66 IRQ_TYPE_LEVEL_HIGH>;
interrupt-names = "macirq";
clocks = <&gmac_clk>, <&gmac_axi_clk>;
clock-names = "stmmaceth", "pclk";
snps,pbl = <32>;
snps,fixed-burst;
snps,multicast-filter-bins = <64>;
snps,perfect-filter-entries = <32>;
snps,axi-config = <&gmac0_stmmac_axi_setup>;
thead,gmacapb = <&gmacapb_syscon0>;
status = "disabled";

mdio0: mdio {
compatible = "snps,dwmac-mdio";
#address-cells = <1>;
#size-cells = <0>;
};

gmac0_stmmac_axi_setup: stmmac-axi-config {
snps,wr_osr_lmt = <0xf>;
snps,rd_osr_lmt = <0xf>;
snps,blen = <0 0 64 32 0 0 0>;
};
};

gmac1: ethernet@ffe7060000 {
compatible = "thead,th1520-dwmac", "snps,dwmac-3.70a";
reg = <0xff 0xe7060000 0x0 0x2000>;
interrupts = <67 IRQ_TYPE_LEVEL_HIGH>;
interrupt-names = "macirq";
clocks = <&gmac_clk>, <&gmac_axi_clk>;
clock-names = "stmmaceth", "pclk";
snps,pbl = <32>;
snps,fixed-burst;
snps,multicast-filter-bins = <64>;
snps,perfect-filter-entries = <32>;
snps,axi-config = <&gmac1_stmmac_axi_setup>;
thead,gmacapb = <&gmacapb_syscon1>;
status = "disabled";

mdio1: mdio {
compatible = "snps,dwmac-mdio";
#address-cells = <1>;
#size-cells = <0>;
};

gmac1_stmmac_axi_setup: stmmac-axi-config {
snps,wr_osr_lmt = <0xf>;
snps,rd_osr_lmt = <0xf>;
snps,blen = <0 0 64 32 0 0 0>;
};
};

uart0: serial@ffe7014000 {
compatible = "snps,dw-apb-uart";
reg = <0xff 0xe7014000 0x0 0x100>;
Expand Down Expand Up @@ -246,6 +314,17 @@
};
};


gmacapb_syscon0: syscon@ffec003000 {
compatible = "thead,th1520-gmacapb-syscon", "syscon";
reg = <0xff 0xec003000 0x0 0x1000>;
};

gmacapb_syscon1: syscon@ffec004000 {
compatible = "thead,th1520-gmacapb-syscon", "syscon";
reg = <0xff 0xec004000 0x0 0x1000>;
};

gpio0: gpio@ffec005000 {
compatible = "snps,dw-apb-gpio";
reg = <0xff 0xec005000 0x0 0x1000>;
Expand Down

0 comments on commit a547afa

Please sign in to comment.