Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 55 additions & 14 deletions Documentation/devicetree/bindings/net/eswin,eic7700-eth.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ select:
contains:
enum:
- eswin,eic7700-qos-eth
- eswin,eic7700-qos-eth-clk-inversion
required:
- compatible

Expand All @@ -29,7 +30,9 @@ allOf:
properties:
compatible:
items:
- const: eswin,eic7700-qos-eth
- enum:
- eswin,eic7700-qos-eth
- eswin,eic7700-qos-eth-clk-inversion
- const: snps,dwmac-5.20

reg:
Expand Down Expand Up @@ -63,16 +66,29 @@ properties:
- const: stmmaceth

rx-internal-delay-ps:
enum: [0, 200, 600, 1200, 1600, 1800, 2000, 2200, 2400]
minimum: 0
maximum: 2540
multipleOf: 20

tx-internal-delay-ps:
enum: [0, 200, 600, 1200, 1600, 1800, 2000, 2200, 2400]
minimum: 0
maximum: 2540
multipleOf: 20

eswin,hsp-sp-csr:
description:
HSP CSR is to control and get status of different high-speed peripherals
(such as Ethernet, USB, SATA, etc.) via register, which can tune
board-level's parameters of PHY, etc.

Additional background information about the High-Speed Subsystem
and the HSP CSR block is available in Chapter 10 ("High-Speed Interface")
of the EIC7700X SoC Technical Reference Manual, Part 4
(EIC7700X_SoC_Technical_Reference_Manual_Part4.pdf). The manual is
publicly available at
https://github.com/eswincomputing/EIC7700X-SoC-Technical-Reference-Manual/releases

This reference is provided for background information only.
$ref: /schemas/types.yaml#/definitions/phandle-array
items:
- items:
Expand All @@ -82,6 +98,8 @@ properties:
- description: Offset of AXI clock controller Low-Power request
register
- description: Offset of register controlling TX/RX clock delay
- description: Offset of register controlling TXD delay
- description: Offset of register controlling RXD delay

required:
- compatible
Expand All @@ -93,8 +111,6 @@ required:
- phy-mode
- resets
- reset-names
- rx-internal-delay-ps
- tx-internal-delay-ps
- eswin,hsp-sp-csr

unevaluatedProperties: false
Expand All @@ -104,24 +120,49 @@ examples:
ethernet@50400000 {
compatible = "eswin,eic7700-qos-eth", "snps,dwmac-5.20";
reg = <0x50400000 0x10000>;
interrupt-parent = <&plic>;
interrupts = <61>;
interrupt-names = "macirq";
clocks = <&d0_clock 186>, <&d0_clock 171>, <&d0_clock 40>,
<&d0_clock 193>;
clock-names = "axi", "cfg", "stmmaceth", "tx";
resets = <&reset 95>;
reset-names = "stmmaceth";
eswin,hsp-sp-csr = <&hsp_sp_csr 0x100 0x108 0x118 0x114 0x11c>;
phy-handle = <&gmac0_phy0>;
phy-mode = "rgmii-id";
snps,aal;
snps,fixed-burst;
snps,tso;
snps,axi-config = <&stmmac_axi_setup_gmac0>;

stmmac_axi_setup_gmac0: stmmac-axi-config {
snps,blen = <0 0 0 0 16 8 4>;
snps,rd_osr_lmt = <2>;
snps,wr_osr_lmt = <2>;
};
};

ethernet@50410000 {
compatible = "eswin,eic7700-qos-eth-clk-inversion", "snps,dwmac-5.20";
reg = <0x50410000 0x10000>;
interrupt-parent = <&plic>;
interrupts = <61>;
interrupts = <70>;
interrupt-names = "macirq";
phy-mode = "rgmii-id";
phy-handle = <&phy0>;
resets = <&reset 95>;
clocks = <&d0_clock 186>, <&d0_clock 171>, <&d0_clock 40>,
<&d0_clock 194>;
clock-names = "axi", "cfg", "stmmaceth", "tx";
resets = <&reset 94>;
reset-names = "stmmaceth";
rx-internal-delay-ps = <200>;
tx-internal-delay-ps = <200>;
eswin,hsp-sp-csr = <&hsp_sp_csr 0x100 0x108 0x118>;
snps,axi-config = <&stmmac_axi_setup>;
eswin,hsp-sp-csr = <&hsp_sp_csr 0x200 0x208 0x218 0x214 0x21c>;
phy-handle = <&gmac1_phy0>;
phy-mode = "rgmii-id";
snps,aal;
snps,fixed-burst;
snps,tso;
stmmac_axi_setup: stmmac-axi-config {
snps,axi-config = <&stmmac_axi_setup_gmac1>;

stmmac_axi_setup_gmac1: stmmac-axi-config {
snps,blen = <0 0 0 0 16 8 4>;
snps,rd_osr_lmt = <2>;
snps,wr_osr_lmt = <2>;
Expand Down
42 changes: 42 additions & 0 deletions arch/riscv/boot/dts/eswin/eic7700-hifive-premier-p550.dts
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,55 @@

aliases {
serial0 = &uart0;
ethernet0 = &gmac0;
ethernet1 = &gmac1;
};

chosen {
stdout-path = "serial0:115200n8";
};
};

&gmac0 {
phy-handle = <&gmac0_phy0>;
phy-mode = "rgmii-id";
pinctrl-names = "default";
pinctrl-0 = <&gpio106_pins>;
rx-internal-delay-ps = <20>;
tx-internal-delay-ps = <100>;
status = "okay";

mdio {
gmac0_phy0: ethernet-phy@0 {
compatible = "ethernet-phy-id001c.c916";
reg = <0>;
reset-gpios = <&gpioD 10 GPIO_ACTIVE_LOW>;
reset-assert-us = <10000>;
reset-deassert-us = <80000>;
};
};
};

&gmac1 {
phy-handle = <&gmac1_phy0>;
phy-mode = "rgmii-rxid";
pinctrl-names = "default";
pinctrl-0 = <&gpio111_pins>;
rx-internal-delay-ps = <200>;
tx-internal-delay-ps = <200>;
status = "okay";

mdio {
gmac1_phy0: ethernet-phy@0 {
compatible = "ethernet-phy-id001c.c916";
reg = <0>;
reset-gpios = <&gpioD 15 GPIO_ACTIVE_LOW>;
reset-assert-us = <10000>;
reset-deassert-us = <80000>;
};
};
};

&uart0 {
status = "okay";
};
Expand Down
66 changes: 66 additions & 0 deletions arch/riscv/boot/dts/eswin/eic7700.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@

/dts-v1/;

#include <dt-bindings/gpio/gpio.h>

/ {
#address-cells = <2>;
#size-cells = <2>;
Expand Down Expand Up @@ -295,6 +297,70 @@
status = "disabled";
};

gmac0: ethernet@50400000 {
compatible = "eswin,eic7700-qos-eth", "snps,dwmac-5.20";
reg = <0x0 0x50400000 0x0 0x10000>;
interrupts = <61>;
interrupt-names = "macirq";
clocks = <&clk 186>,
<&clk 171>,
<&clk 40>,
<&clk 193>;
clock-names = "axi", "cfg", "stmmaceth", "tx";
resets = <&reset 95>;
reset-names = "stmmaceth";
eswin,hsp-sp-csr = <&hsp_sp_csr 0x100 0x108 0x118 0x114 0x11c>;
snps,aal;
snps,fixed-burst;
snps,tso;
snps,axi-config = <&stmmac_axi_setup_gmac0>;
status = "disabled";

stmmac_axi_setup_gmac0: stmmac-axi-config {
snps,blen = <0 0 0 0 16 8 4>;
snps,rd_osr_lmt = <2>;
snps,wr_osr_lmt = <2>;
};

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

gmac1: ethernet@50410000 {
compatible = "eswin,eic7700-qos-eth-clk-inversion", "snps,dwmac-5.20";
reg = <0x0 0x50410000 0x0 0x10000>;
interrupts = <70>;
interrupt-names = "macirq";
clocks = <&clk 186>,
<&clk 171>,
<&clk 40>,
<&clk 194>;
clock-names = "axi", "cfg", "stmmaceth", "tx";
resets = <&reset 94>;
reset-names = "stmmaceth";
eswin,hsp-sp-csr = <&hsp_sp_csr 0x200 0x208 0x218 0x214 0x21c>;
snps,aal;
snps,fixed-burst;
snps,tso;
snps,axi-config = <&stmmac_axi_setup_gmac1>;
status = "disabled";

stmmac_axi_setup_gmac1: stmmac-axi-config {
snps,blen = <0 0 0 0 16 8 4>;
snps,rd_osr_lmt = <2>;
snps,wr_osr_lmt = <2>;
};

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

gpio@51600000 {
compatible = "snps,dw-apb-gpio";
reg = <0x0 0x51600000 0x0 0x80>;
Expand Down
Loading
Loading