arm64: dts: imx8mp-evk: configure multiple queues on eqos
PATCH v2 1/1 arm64: dts: imx8mp-evk: configure multiple queues on eqos
Eqos ethernet support five queues on hardware, enable these queues and configure the priority of each queue. Uses Strict Priority as scheduling algorithms to ensure that the TSN function works.
The priority of each queue is a bitmask value that maps VLAN tag priority to the queue. Since the hardware only supports five queues, this patch maps priority 0-4 to queues one by one, and priority 5-7 to queue 4.
The total fifo size of 5 queues is 8192 bytes, if enable 5 queues with store-and-forward mode, it's not enough for large packets, which would trigger fifo overflow frequently. This patch set DMA to thresh mode to enable all 5 queues.
--- arch/arm64/boot/dts/freescale/imx8mp-evk.dts | 57 ++++++++++++++++++++ 1 file changed, 57 insertions(+)
arch/arm64/boot/dts/freescale/imx8mp-evk.dts +57 -0
@@ -86,6 +86,9 @@ pinctrl-0 = <&pinctrl_eqos>; phy-mode = "rgmii-id"; phy-handle = <ðphy0>; + snps,force_thresh_dma_mode; + snps,mtl-tx-config = <&mtl_tx_setup>; + snps,mtl-rx-config = <&mtl_rx_setup>; status = "okay"; mdio {
@@ -99,6 +102,60 @@ eee-broken-1000t; }; }; + + mtl_tx_setup: tx-queues-config { + snps,tx-queues-to-use = <5>; + snps,tx-sched-sp; + queue0 { + snps,dcb-algorithm; + snps,priority = <0x1>; + }; + queue1 { + snps,dcb-algorithm; + snps,priority = <0x2>; + }; + queue2 { + snps,dcb-algorithm; + snps,priority = <0x4>; + }; + queue3 { + snps,dcb-algorithm; + snps,priority = <0x8>; + }; + queue4 { + snps,dcb-algorithm; + snps,priority = <0xf0>; + }; + }; + mtl_rx_setup: rx-queues-config { + snps,rx-queues-to-use = <5>; + snps,rx-sched-sp; + queue0 { + snps,dcb-algorithm; + snps,priority = <0x1>; + snps,map-to-dma-channel = <0>; + }; + queue1 { + snps,dcb-algorithm; + snps,priority = <0x2>; + snps,map-to-dma-channel = <1>; + }; + queue2 { + snps,dcb-algorithm; + snps,priority = <0x4>; + snps,map-to-dma-channel = <2>; + }; + queue3 { + snps,dcb-algorithm; + snps,priority = <0x8>; + snps,map-to-dma-channel = <3>; + }; + queue4 { + snps,dcb-algorithm; + snps,priority = <0xf0>; + snps,map-to-dma-channel = <4>; + }; + }; }; &fec {
Signature · 1 line
2.17.1
Quoted 21 lines
-----Original Message-----
From: Xiaoliang Yang <[email protected]>
Sent: 2021年12月13日 12:46
To: [email protected]; [email protected]; [email protected]; [email protected]
Cc: [email protected]; [email protected]; dl-linux-imx <[email protected]>; [email protected]; [email protected]; Joakim Zhang <[email protected]>; Xiaoliang Yang <[email protected]>
Subject: [PATCH v2] arm64: dts: imx8mp-evk: configure multiple queues on eqosEqos ethernet support five queues on hardware, enable these queues and configure the priority of each queue. Uses Strict Priority as scheduling algorithms to ensure that the TSN function works.
The priority of each queue is a bitmask value that maps VLAN tag priority to the queue. Since the hardware only supports five queues, this patch maps priority 0-4 to queues one by one, and priority 5-7 to queue 4.
Quoted 7 lines
The total fifo size of 5 queues is 8192 bytes, if enable 5 queues with store-and-forward mode, it's not enough for large packets, which would trigger fifo overflow frequently. This patch set DMA to thresh mode to enable all 5 queues.
Signed-off-by Xiaoliang Yang <[email protected]>---
Best Regards,
Joakim Zhang
Quoted 82 lines
arch/arm64/boot/dts/freescale/imx8mp-evk.dts | 57 ++++++++++++++++++++ 1 file changed, 57 insertions(+)arch/arm64/boot/dts/freescale/imx8mp-evk.dts +57
-1@@ -86,6 +86,9 @@ pinctrl-0 = <&pinctrl_eqos>; phy-mode = "rgmii-id"; phy-handle = <ðphy0>; + snps,force_thresh_dma_mode; + snps,mtl-tx-config = <&mtl_tx_setup>; + snps,mtl-rx-config = <&mtl_rx_setup>; status = "okay"; mdio {@@ -99,6 +102,60 @@ eee-broken-1000t; }; }; + + mtl_tx_setup: tx-queues-config { + snps,tx-queues-to-use = <5>; + snps,tx-sched-sp; + queue0 { + snps,dcb-algorithm; + snps,priority = <0x1>; + }; + queue1 { + snps,dcb-algorithm; + snps,priority = <0x2>; + }; + queue2 { + snps,dcb-algorithm; + snps,priority = <0x4>; + }; + queue3 { + snps,dcb-algorithm; + snps,priority = <0x8>; + }; + queue4 { + snps,dcb-algorithm; + snps,priority = <0xf0>; + }; + }; + mtl_rx_setup: rx-queues-config { + snps,rx-queues-to-use = <5>; + snps,rx-sched-sp; + queue0 { + snps,dcb-algorithm; + snps,priority = <0x1>; + snps,map-to-dma-channel = <0>; + }; + queue1 { + snps,dcb-algorithm; + snps,priority = <0x2>; + snps,map-to-dma-channel = <1>; + }; + queue2 { + snps,dcb-algorithm; + snps,priority = <0x4>; + snps,map-to-dma-channel = <2>; + }; + queue3 { + snps,dcb-algorithm; + snps,priority = <0x8>; + snps,map-to-dma-channel = <3>; + }; + queue4 { + snps,dcb-algorithm; + snps,priority = <0xf0>; + snps,map-to-dma-channel = <4>; + }; + }; }; &fec { --2.17.1
Quoted 34 lines · Xiaoliang Yang
Eqos ethernet support five queues on hardware, enable these queues and configure the priority of each queue. Uses Strict Priority as scheduling algorithms to ensure that the TSN function works.
The priority of each queue is a bitmask value that maps VLAN tag priority to the queue. Since the hardware only supports five queues, this patch maps priority 0-4 to queues one by one, and priority 5-7 to queue 4.
The total fifo size of 5 queues is 8192 bytes, if enable 5 queues with store-and-forward mode, it's not enough for large packets, which would trigger fifo overflow frequently. This patch set DMA to thresh mode to enable all 5 queues.
Signed-off-by Xiaoliang Yang <[email protected]>--- arch/arm64/boot/dts/freescale/imx8mp-evk.dts | 57 ++++++++++++++++++++ 1 file changed, 57 insertions(+)arch/arm64/boot/dts/freescale/imx8mp-evk.dts +3
-0@@ -86,6 +86,9 @@ pinctrl-0 = <&pinctrl_eqos>; phy-mode = "rgmii-id"; phy-handle = <ðphy0>; + snps,force_thresh_dma_mode; + snps,mtl-tx-config = <&mtl_tx_setup>; + snps,mtl-rx-config = <&mtl_rx_setup>; status = "okay"; mdio {
arch/arm64/boot/dts/freescale/imx8mp-evk.dts line 108
Quoted 7 lines
arch/arm64/boot/dts/freescale/imx8mp-evk.dts +4
-0@@ -99,6 +102,60 @@ eee-broken-1000t; }; }; + + mtl_tx_setup: tx-queues-config { + snps,tx-queues-to-use = <5>; + snps,tx-sched-sp;
Please have a newline between properties and child node ...
arch/arm64/boot/dts/freescale/imx8mp-evk.dts line 112
Quoted 4 lines
arch/arm64/boot/dts/freescale/imx8mp-evk.dts +4
-0+ queue0 { + snps,dcb-algorithm; + snps,priority = <0x1>; + };
... and also between nodes.
Quoted 7 lines
arch/arm64/boot/dts/freescale/imx8mp-evk.dts +7
-0+ queue1 { + snps,dcb-algorithm; + snps,priority = <0x2>; + }; + queue2 { + snps,dcb-algorithm; + snps,priority = <0x4>;
arch/arm64/boot/dts/freescale/imx8mp-evk.dts line 129
Quoted 10 lines
arch/arm64/boot/dts/freescale/imx8mp-evk.dts +10
-0+ }; + queue3 { + snps,dcb-algorithm; + snps,priority = <0x8>; + }; + queue4 { + snps,dcb-algorithm; + snps,priority = <0xf0>; + }; + };
Ditto
Shawn
Quoted 35 lines
arch/arm64/boot/dts/freescale/imx8mp-evk.dts +29
-0+ mtl_rx_setup: rx-queues-config { + snps,rx-queues-to-use = <5>; + snps,rx-sched-sp; + queue0 { + snps,dcb-algorithm; + snps,priority = <0x1>; + snps,map-to-dma-channel = <0>; + }; + queue1 { + snps,dcb-algorithm; + snps,priority = <0x2>; + snps,map-to-dma-channel = <1>; + }; + queue2 { + snps,dcb-algorithm; + snps,priority = <0x4>; + snps,map-to-dma-channel = <2>; + }; + queue3 { + snps,dcb-algorithm; + snps,priority = <0x8>; + snps,map-to-dma-channel = <3>; + }; + queue4 { + snps,dcb-algorithm; + snps,priority = <0xf0>; + snps,map-to-dma-channel = <4>; + }; + }; }; &fec {Signature · 1 line
2.17.1