* [PATCH v2 01/14] dt-bindings: net: mediatek: add optional properties for the SoC ethernet core
[not found] <20220405195755.10817-1-nbd@nbd.name>
@ 2022-04-05 19:57 ` Felix Fietkau
2022-04-07 17:20 ` Rob Herring
2022-04-05 19:57 ` [PATCH v2 03/14] arm64: dts: mediatek: mt7622: add support for coherent DMA Felix Fietkau
` (3 subsequent siblings)
4 siblings, 1 reply; 21+ messages in thread
From: Felix Fietkau @ 2022-04-05 19:57 UTC (permalink / raw)
To: netdev, David S. Miller, Jakub Kicinski, Paolo Abeni, Rob Herring,
Krzysztof Kozlowski, Matthias Brugger
Cc: Lorenzo Bianconi, devicetree, linux-kernel, linux-arm-kernel,
linux-mediatek
From: Lorenzo Bianconi <lorenzo@kernel.org>
Introduce dma-coherent, cci-control and hifsys optional properties to
the mediatek ethernet controller bindings
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
Documentation/devicetree/bindings/net/mediatek-net.txt | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/Documentation/devicetree/bindings/net/mediatek-net.txt b/Documentation/devicetree/bindings/net/mediatek-net.txt
index 72d03e07cf7c..13cb12ee4ed6 100644
--- a/Documentation/devicetree/bindings/net/mediatek-net.txt
+++ b/Documentation/devicetree/bindings/net/mediatek-net.txt
@@ -41,6 +41,12 @@ Required properties:
- mediatek,pctl: phandle to the syscon node that handles the ports slew rate
and driver current: only for MT2701 and MT7623 SoC
+Optional properties:
+- dma-coherent: present if dma operations are coherent
+- mediatek,cci-control: phandle to the cache coherent interconnect node
+- mediatek,hifsys: phandle to the mediatek hifsys controller used to provide
+ various clocks and reset to the system.
+
* Ethernet MAC node
Required properties:
--
2.35.1
^ permalink raw reply related [flat|nested] 21+ messages in thread* Re: [PATCH v2 01/14] dt-bindings: net: mediatek: add optional properties for the SoC ethernet core
2022-04-05 19:57 ` [PATCH v2 01/14] dt-bindings: net: mediatek: add optional properties for the SoC ethernet core Felix Fietkau
@ 2022-04-07 17:20 ` Rob Herring
2022-04-08 9:34 ` Lorenzo Bianconi
0 siblings, 1 reply; 21+ messages in thread
From: Rob Herring @ 2022-04-07 17:20 UTC (permalink / raw)
To: Felix Fietkau
Cc: netdev, David S. Miller, Jakub Kicinski, Paolo Abeni,
Krzysztof Kozlowski, Matthias Brugger, Lorenzo Bianconi,
devicetree, linux-kernel, linux-arm-kernel, linux-mediatek
On Tue, Apr 05, 2022 at 09:57:42PM +0200, Felix Fietkau wrote:
> From: Lorenzo Bianconi <lorenzo@kernel.org>
>
> Introduce dma-coherent, cci-control and hifsys optional properties to
> the mediatek ethernet controller bindings
>
> Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
> Signed-off-by: Felix Fietkau <nbd@nbd.name>
> ---
> Documentation/devicetree/bindings/net/mediatek-net.txt | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/net/mediatek-net.txt b/Documentation/devicetree/bindings/net/mediatek-net.txt
> index 72d03e07cf7c..13cb12ee4ed6 100644
> --- a/Documentation/devicetree/bindings/net/mediatek-net.txt
> +++ b/Documentation/devicetree/bindings/net/mediatek-net.txt
> @@ -41,6 +41,12 @@ Required properties:
> - mediatek,pctl: phandle to the syscon node that handles the ports slew rate
> and driver current: only for MT2701 and MT7623 SoC
>
> +Optional properties:
> +- dma-coherent: present if dma operations are coherent
> +- mediatek,cci-control: phandle to the cache coherent interconnect node
There's a common property for this already. See CCI-400 binding.
> +- mediatek,hifsys: phandle to the mediatek hifsys controller used to provide
> + various clocks and reset to the system.
> +
This series is adding a handful of new properties. Please convert the
binding to DT schema first.
Rob
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH v2 01/14] dt-bindings: net: mediatek: add optional properties for the SoC ethernet core
2022-04-07 17:20 ` Rob Herring
@ 2022-04-08 9:34 ` Lorenzo Bianconi
0 siblings, 0 replies; 21+ messages in thread
From: Lorenzo Bianconi @ 2022-04-08 9:34 UTC (permalink / raw)
To: Rob Herring
Cc: Felix Fietkau, netdev, David S. Miller, Jakub Kicinski,
Paolo Abeni, Krzysztof Kozlowski, Matthias Brugger, devicetree,
linux-kernel, linux-arm-kernel, linux-mediatek
[-- Attachment #1: Type: text/plain, Size: 1553 bytes --]
> On Tue, Apr 05, 2022 at 09:57:42PM +0200, Felix Fietkau wrote:
> > From: Lorenzo Bianconi <lorenzo@kernel.org>
> >
> > Introduce dma-coherent, cci-control and hifsys optional properties to
> > the mediatek ethernet controller bindings
> >
> > Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
> > Signed-off-by: Felix Fietkau <nbd@nbd.name>
> > ---
> > Documentation/devicetree/bindings/net/mediatek-net.txt | 6 ++++++
> > 1 file changed, 6 insertions(+)
> >
> > diff --git a/Documentation/devicetree/bindings/net/mediatek-net.txt b/Documentation/devicetree/bindings/net/mediatek-net.txt
> > index 72d03e07cf7c..13cb12ee4ed6 100644
> > --- a/Documentation/devicetree/bindings/net/mediatek-net.txt
> > +++ b/Documentation/devicetree/bindings/net/mediatek-net.txt
> > @@ -41,6 +41,12 @@ Required properties:
> > - mediatek,pctl: phandle to the syscon node that handles the ports slew rate
> > and driver current: only for MT2701 and MT7623 SoC
> >
> > +Optional properties:
> > +- dma-coherent: present if dma operations are coherent
> > +- mediatek,cci-control: phandle to the cache coherent interconnect node
>
> There's a common property for this already. See CCI-400 binding.
>
> > +- mediatek,hifsys: phandle to the mediatek hifsys controller used to provide
> > + various clocks and reset to the system.
> > +
>
> This series is adding a handful of new properties. Please convert the
> binding to DT schema first.
ack, I will converti this file to yaml format.
Regards,
Lorenzo
>
> Rob
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 21+ messages in thread
* [PATCH v2 03/14] arm64: dts: mediatek: mt7622: add support for coherent DMA
[not found] <20220405195755.10817-1-nbd@nbd.name>
2022-04-05 19:57 ` [PATCH v2 01/14] dt-bindings: net: mediatek: add optional properties for the SoC ethernet core Felix Fietkau
@ 2022-04-05 19:57 ` Felix Fietkau
2022-04-05 19:57 ` [PATCH v2 04/14] dt-bindings: arm: mediatek: document WED binding for MT7622 Felix Fietkau
` (2 subsequent siblings)
4 siblings, 0 replies; 21+ messages in thread
From: Felix Fietkau @ 2022-04-05 19:57 UTC (permalink / raw)
To: netdev, Rob Herring, Krzysztof Kozlowski, Matthias Brugger
Cc: devicetree, linux-arm-kernel, linux-mediatek, linux-kernel
It improves performance by eliminating the need for a cache flush on rx and tx
Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
arch/arm64/boot/dts/mediatek/mt7622.dtsi | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/arch/arm64/boot/dts/mediatek/mt7622.dtsi b/arch/arm64/boot/dts/mediatek/mt7622.dtsi
index 6f8cb3ad1e84..a2257ec6d256 100644
--- a/arch/arm64/boot/dts/mediatek/mt7622.dtsi
+++ b/arch/arm64/boot/dts/mediatek/mt7622.dtsi
@@ -357,7 +357,7 @@ cci_control1: slave-if@4000 {
};
cci_control2: slave-if@5000 {
- compatible = "arm,cci-400-ctrl-if";
+ compatible = "arm,cci-400-ctrl-if", "syscon";
interface-type = "ace";
reg = <0x5000 0x1000>;
};
@@ -945,6 +945,8 @@ eth: ethernet@1b100000 {
power-domains = <&scpsys MT7622_POWER_DOMAIN_ETHSYS>;
mediatek,ethsys = <ðsys>;
mediatek,sgmiisys = <&sgmiisys>;
+ mediatek,cci-control = <&cci_control2>;
+ dma-coherent;
#address-cells = <1>;
#size-cells = <0>;
status = "disabled";
--
2.35.1
^ permalink raw reply related [flat|nested] 21+ messages in thread* [PATCH v2 04/14] dt-bindings: arm: mediatek: document WED binding for MT7622
[not found] <20220405195755.10817-1-nbd@nbd.name>
2022-04-05 19:57 ` [PATCH v2 01/14] dt-bindings: net: mediatek: add optional properties for the SoC ethernet core Felix Fietkau
2022-04-05 19:57 ` [PATCH v2 03/14] arm64: dts: mediatek: mt7622: add support for coherent DMA Felix Fietkau
@ 2022-04-05 19:57 ` Felix Fietkau
2022-04-06 8:09 ` Krzysztof Kozlowski
2022-04-05 19:57 ` [PATCH v2 05/14] dt-bindings: arm: mediatek: document the pcie mirror node on MT7622 Felix Fietkau
2022-04-05 19:57 ` [PATCH v2 08/14] arm64: dts: mediatek: mt7622: introduce nodes for Wireless Ethernet Dispatch Felix Fietkau
4 siblings, 1 reply; 21+ messages in thread
From: Felix Fietkau @ 2022-04-05 19:57 UTC (permalink / raw)
To: netdev, Rob Herring, Krzysztof Kozlowski, Matthias Brugger,
David S. Miller, Jakub Kicinski, Paolo Abeni, Lorenzo Bianconi
Cc: devicetree, linux-arm-kernel, linux-mediatek, linux-kernel
From: Lorenzo Bianconi <lorenzo@kernel.org>
Document the binding for the Wireless Ethernet Dispatch core on the MT7622
SoC, which is used for Ethernet->WLAN offloading
Add related info in mediatek-net bindings.
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
.../arm/mediatek/mediatek,mt7622-wed.yaml | 50 +++++++++++++++++++
.../devicetree/bindings/net/mediatek-net.txt | 2 +
2 files changed, 52 insertions(+)
create mode 100644 Documentation/devicetree/bindings/arm/mediatek/mediatek,mt7622-wed.yaml
diff --git a/Documentation/devicetree/bindings/arm/mediatek/mediatek,mt7622-wed.yaml b/Documentation/devicetree/bindings/arm/mediatek/mediatek,mt7622-wed.yaml
new file mode 100644
index 000000000000..787d6673f952
--- /dev/null
+++ b/Documentation/devicetree/bindings/arm/mediatek/mediatek,mt7622-wed.yaml
@@ -0,0 +1,50 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: "http://devicetree.org/schemas/arm/mediatek/mediatek,mt7622-wed.yaml#"
+$schema: "http://devicetree.org/meta-schemas/core.yaml#"
+
+title: MediaTek Wireless Ethernet Dispatch Controller for MT7622
+
+maintainers:
+ - Lorenzo Bianconi <lorenzo@kernel.org>
+ - Felix Fietkau <nbd@nbd.name>
+
+description:
+ The mediatek wireless ethernet dispatch controller can be configured to
+ intercept and handle access to the WLAN DMA queues and PCIe interrupts
+ and implement hardware flow offloading from ethernet to WLAN.
+
+properties:
+ compatible:
+ items:
+ - enum:
+ - mediatek,mt7622-wed
+ - const: syscon
+
+ reg:
+ maxItems: 1
+
+ interrupts:
+ maxItems: 1
+
+required:
+ - compatible
+ - reg
+ - interrupts
+
+additionalProperties: false
+
+examples:
+ - |
+ #include <dt-bindings/interrupt-controller/arm-gic.h>
+ #include <dt-bindings/interrupt-controller/irq.h>
+ soc {
+ #address-cells = <2>;
+ #size-cells = <2>;
+ wed0: wed@1020a000 {
+ compatible = "mediatek,mt7622-wed","syscon";
+ reg = <0 0x1020a000 0 0x1000>;
+ interrupts = <GIC_SPI 214 IRQ_TYPE_LEVEL_LOW>;
+ };
+ };
diff --git a/Documentation/devicetree/bindings/net/mediatek-net.txt b/Documentation/devicetree/bindings/net/mediatek-net.txt
index 13cb12ee4ed6..1c8dc44bbb52 100644
--- a/Documentation/devicetree/bindings/net/mediatek-net.txt
+++ b/Documentation/devicetree/bindings/net/mediatek-net.txt
@@ -46,6 +46,8 @@ Optional properties:
- mediatek,cci-control: phandle to the cache coherent interconnect node
- mediatek,hifsys: phandle to the mediatek hifsys controller used to provide
various clocks and reset to the system.
+- mediatek,wed: a list of phandles to wireless ethernet dispatch nodes for
+ MT7622 SoC.
* Ethernet MAC node
--
2.35.1
^ permalink raw reply related [flat|nested] 21+ messages in thread* Re: [PATCH v2 04/14] dt-bindings: arm: mediatek: document WED binding for MT7622
2022-04-05 19:57 ` [PATCH v2 04/14] dt-bindings: arm: mediatek: document WED binding for MT7622 Felix Fietkau
@ 2022-04-06 8:09 ` Krzysztof Kozlowski
2022-04-06 8:18 ` Felix Fietkau
0 siblings, 1 reply; 21+ messages in thread
From: Krzysztof Kozlowski @ 2022-04-06 8:09 UTC (permalink / raw)
To: Felix Fietkau, netdev, Rob Herring, Krzysztof Kozlowski,
Matthias Brugger, David S. Miller, Jakub Kicinski, Paolo Abeni,
Lorenzo Bianconi
Cc: devicetree, linux-arm-kernel, linux-mediatek, linux-kernel
On 05/04/2022 21:57, Felix Fietkau wrote:
> From: Lorenzo Bianconi <lorenzo@kernel.org>
>
> Document the binding for the Wireless Ethernet Dispatch core on the MT7622
> SoC, which is used for Ethernet->WLAN offloading
> Add related info in mediatek-net bindings.
>
> Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
> Signed-off-by: Felix Fietkau <nbd@nbd.name>
Thank you for your patch. There is something to discuss/improve.
> ---
> .../arm/mediatek/mediatek,mt7622-wed.yaml | 50 +++++++++++++++++++
> .../devicetree/bindings/net/mediatek-net.txt | 2 +
> 2 files changed, 52 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/arm/mediatek/mediatek,mt7622-wed.yaml
Don't store drivers in arm directory. See:
https://lore.kernel.org/linux-devicetree/YkJa1oLSEP8R4U6y@robh.at.kernel.org/
Isn't this a network offload engine? If yes, then probably it should be
in "net/".
>
> diff --git a/Documentation/devicetree/bindings/arm/mediatek/mediatek,mt7622-wed.yaml b/Documentation/devicetree/bindings/arm/mediatek/mediatek,mt7622-wed.yaml
> new file mode 100644
> index 000000000000..787d6673f952
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/arm/mediatek/mediatek,mt7622-wed.yaml
> @@ -0,0 +1,50 @@
> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: "http://devicetree.org/schemas/arm/mediatek/mediatek,mt7622-wed.yaml#"
> +$schema: "http://devicetree.org/meta-schemas/core.yaml#"
> +
> +title: MediaTek Wireless Ethernet Dispatch Controller for MT7622
> +
> +maintainers:
> + - Lorenzo Bianconi <lorenzo@kernel.org>
> + - Felix Fietkau <nbd@nbd.name>
> +
> +description:
> + The mediatek wireless ethernet dispatch controller can be configured to
> + intercept and handle access to the WLAN DMA queues and PCIe interrupts
> + and implement hardware flow offloading from ethernet to WLAN.
> +
> +properties:
> + compatible:
> + items:
> + - enum:
> + - mediatek,mt7622-wed
> + - const: syscon
> +
> + reg:
> + maxItems: 1
> +
> + interrupts:
> + maxItems: 1
> +
> +required:
> + - compatible
> + - reg
> + - interrupts
> +
> +additionalProperties: false
> +
> +examples:
> + - |
> + #include <dt-bindings/interrupt-controller/arm-gic.h>
> + #include <dt-bindings/interrupt-controller/irq.h>
> + soc {
> + #address-cells = <2>;
> + #size-cells = <2>;
> + wed0: wed@1020a000 {
Generic node name, "wed" is specific. Maybe "network-offload"? Or
"network-accelerator"? You probably know better what this device does,
so maybe come with some generic name?
The same in DTS patch.
The bindings themself look ok.
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 21+ messages in thread* Re: [PATCH v2 04/14] dt-bindings: arm: mediatek: document WED binding for MT7622
2022-04-06 8:09 ` Krzysztof Kozlowski
@ 2022-04-06 8:18 ` Felix Fietkau
2022-04-06 8:29 ` Arnd Bergmann
2022-04-07 15:50 ` Andrew Lunn
0 siblings, 2 replies; 21+ messages in thread
From: Felix Fietkau @ 2022-04-06 8:18 UTC (permalink / raw)
To: Krzysztof Kozlowski, netdev, Rob Herring, Krzysztof Kozlowski,
Matthias Brugger, David S. Miller, Jakub Kicinski, Paolo Abeni,
Lorenzo Bianconi
Cc: devicetree, linux-arm-kernel, linux-mediatek, linux-kernel
On 06.04.22 10:09, Krzysztof Kozlowski wrote:
> On 05/04/2022 21:57, Felix Fietkau wrote:
>> From: Lorenzo Bianconi <lorenzo@kernel.org>
>>
>> Document the binding for the Wireless Ethernet Dispatch core on the MT7622
>> SoC, which is used for Ethernet->WLAN offloading
>> Add related info in mediatek-net bindings.
>>
>> Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
>> Signed-off-by: Felix Fietkau <nbd@nbd.name>
>
> Thank you for your patch. There is something to discuss/improve.
>
>> ---
>> .../arm/mediatek/mediatek,mt7622-wed.yaml | 50 +++++++++++++++++++
>> .../devicetree/bindings/net/mediatek-net.txt | 2 +
>> 2 files changed, 52 insertions(+)
>> create mode 100644 Documentation/devicetree/bindings/arm/mediatek/mediatek,mt7622-wed.yaml
>
> Don't store drivers in arm directory. See:
> https://lore.kernel.org/linux-devicetree/YkJa1oLSEP8R4U6y@robh.at.kernel.org/
>
> Isn't this a network offload engine? If yes, then probably it should be
> in "net/".
It's not a network offload engine by itself. It's a SoC component that
connects to the offload engine and controls a MTK PCIe WLAN device,
intercepting interrupts and DMA rings in order to be able to inject
packets coming in from the offload engine.
Do you think it still belongs in net, or maybe in soc instead?
>> diff --git a/Documentation/devicetree/bindings/arm/mediatek/mediatek,mt7622-wed.yaml b/Documentation/devicetree/bindings/arm/mediatek/mediatek,mt7622-wed.yaml
>> new file mode 100644
>> index 000000000000..787d6673f952
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/arm/mediatek/mediatek,mt7622-wed.yaml
>> @@ -0,0 +1,50 @@
>> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
>> +%YAML 1.2
>> +---
>> +$id: "http://devicetree.org/schemas/arm/mediatek/mediatek,mt7622-wed.yaml#"
>> +$schema: "http://devicetree.org/meta-schemas/core.yaml#"
>> +
>> +title: MediaTek Wireless Ethernet Dispatch Controller for MT7622
>> +
>> +maintainers:
>> + - Lorenzo Bianconi <lorenzo@kernel.org>
>> + - Felix Fietkau <nbd@nbd.name>
>> +
>> +description:
>> + The mediatek wireless ethernet dispatch controller can be configured to
>> + intercept and handle access to the WLAN DMA queues and PCIe interrupts
>> + and implement hardware flow offloading from ethernet to WLAN.
>> +
>> +properties:
>> + compatible:
>> + items:
>> + - enum:
>> + - mediatek,mt7622-wed
>> + - const: syscon
>> +
>> + reg:
>> + maxItems: 1
>> +
>> + interrupts:
>> + maxItems: 1
>> +
>> +required:
>> + - compatible
>> + - reg
>> + - interrupts
>> +
>> +additionalProperties: false
>> +
>> +examples:
>> + - |
>> + #include <dt-bindings/interrupt-controller/arm-gic.h>
>> + #include <dt-bindings/interrupt-controller/irq.h>
>> + soc {
>> + #address-cells = <2>;
>> + #size-cells = <2>;
>> + wed0: wed@1020a000 {
>
> Generic node name, "wed" is specific. Maybe "network-offload"? Or
> "network-accelerator"? You probably know better what this device does,
> so maybe come with some generic name?
wed stands for "wireless ethernet dispatch". Both network-offload and
network-accelerator don't really fit. Would it make sense to spell it
out, or do you have any better naming ideas?
Thanks,
- Felix
^ permalink raw reply [flat|nested] 21+ messages in thread* Re: [PATCH v2 04/14] dt-bindings: arm: mediatek: document WED binding for MT7622
2022-04-06 8:18 ` Felix Fietkau
@ 2022-04-06 8:29 ` Arnd Bergmann
2022-04-06 8:32 ` Felix Fietkau
2022-04-07 15:50 ` Andrew Lunn
1 sibling, 1 reply; 21+ messages in thread
From: Arnd Bergmann @ 2022-04-06 8:29 UTC (permalink / raw)
To: Felix Fietkau
Cc: Krzysztof Kozlowski, Networking, Rob Herring, Krzysztof Kozlowski,
Matthias Brugger, David S. Miller, Jakub Kicinski, Paolo Abeni,
Lorenzo Bianconi, DTML, Linux ARM,
moderated list:ARM/Mediatek SoC..., Linux Kernel Mailing List
On Wed, Apr 6, 2022 at 10:18 AM Felix Fietkau <nbd@nbd.name> wrote:
> On 06.04.22 10:09, Krzysztof Kozlowski wrote:
> > On 05/04/2022 21:57, Felix Fietkau wrote:
> >> From: Lorenzo Bianconi <lorenzo@kernel.org>
> >>
> >> Document the binding for the Wireless Ethernet Dispatch core on the MT7622
> >> SoC, which is used for Ethernet->WLAN offloading
> >> Add related info in mediatek-net bindings.
> >>
> >> Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
> >> Signed-off-by: Felix Fietkau <nbd@nbd.name>
> >
> > Thank you for your patch. There is something to discuss/improve.
> >
> >> ---
> >> .../arm/mediatek/mediatek,mt7622-wed.yaml | 50 +++++++++++++++++++
> >> .../devicetree/bindings/net/mediatek-net.txt | 2 +
> >> 2 files changed, 52 insertions(+)
> >> create mode 100644 Documentation/devicetree/bindings/arm/mediatek/mediatek,mt7622-wed.yaml
> >
> > Don't store drivers in arm directory. See:
> > https://lore.kernel.org/linux-devicetree/YkJa1oLSEP8R4U6y@robh.at.kernel.org/
> >
> > Isn't this a network offload engine? If yes, then probably it should be
> > in "net/".
> It's not a network offload engine by itself. It's a SoC component that
> connects to the offload engine and controls a MTK PCIe WLAN device,
> intercepting interrupts and DMA rings in order to be able to inject
> packets coming in from the offload engine.
> Do you think it still belongs in net, or maybe in soc instead?
I think it belongs into drivers/net/. Presumably this has some kind of
user interface to configure which packets are forwarded? I would not
want to maintain that in a SoC driver as this clearly needs to communicate
with both of the normal network devices in some form.
Arnd
^ permalink raw reply [flat|nested] 21+ messages in thread* Re: [PATCH v2 04/14] dt-bindings: arm: mediatek: document WED binding for MT7622
2022-04-06 8:29 ` Arnd Bergmann
@ 2022-04-06 8:32 ` Felix Fietkau
2022-04-06 8:57 ` Krzysztof Kozlowski
0 siblings, 1 reply; 21+ messages in thread
From: Felix Fietkau @ 2022-04-06 8:32 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Krzysztof Kozlowski, Networking, Rob Herring, Krzysztof Kozlowski,
Matthias Brugger, David S. Miller, Jakub Kicinski, Paolo Abeni,
Lorenzo Bianconi, DTML, Linux ARM,
moderated list:ARM/Mediatek SoC..., Linux Kernel Mailing List
On 06.04.22 10:29, Arnd Bergmann wrote:
> On Wed, Apr 6, 2022 at 10:18 AM Felix Fietkau <nbd@nbd.name> wrote:
>> On 06.04.22 10:09, Krzysztof Kozlowski wrote:
>> > On 05/04/2022 21:57, Felix Fietkau wrote:
>> >> From: Lorenzo Bianconi <lorenzo@kernel.org>
>> >>
>> >> Document the binding for the Wireless Ethernet Dispatch core on the MT7622
>> >> SoC, which is used for Ethernet->WLAN offloading
>> >> Add related info in mediatek-net bindings.
>> >>
>> >> Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
>> >> Signed-off-by: Felix Fietkau <nbd@nbd.name>
>> >
>> > Thank you for your patch. There is something to discuss/improve.
>> >
>> >> ---
>> >> .../arm/mediatek/mediatek,mt7622-wed.yaml | 50 +++++++++++++++++++
>> >> .../devicetree/bindings/net/mediatek-net.txt | 2 +
>> >> 2 files changed, 52 insertions(+)
>> >> create mode 100644 Documentation/devicetree/bindings/arm/mediatek/mediatek,mt7622-wed.yaml
>> >
>> > Don't store drivers in arm directory. See:
>> > https://lore.kernel.org/linux-devicetree/YkJa1oLSEP8R4U6y@robh.at.kernel.org/
>> >
>> > Isn't this a network offload engine? If yes, then probably it should be
>> > in "net/".
>> It's not a network offload engine by itself. It's a SoC component that
>> connects to the offload engine and controls a MTK PCIe WLAN device,
>> intercepting interrupts and DMA rings in order to be able to inject
>> packets coming in from the offload engine.
>> Do you think it still belongs in net, or maybe in soc instead?
>
> I think it belongs into drivers/net/. Presumably this has some kind of
> user interface to configure which packets are forwarded? I would not
> want to maintain that in a SoC driver as this clearly needs to communicate
> with both of the normal network devices in some form.
The WLAN driver attaches to WED in order to deal with the intercepted
DMA rings, but other than that, WED itself has no user configuration.
Offload is controlled by the PPE code in the ethernet driver (which is
already upstream), and WED simply provides a destination port for PPE,
which allows packets to flow to the wireless device.
- Felix
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH v2 04/14] dt-bindings: arm: mediatek: document WED binding for MT7622
2022-04-06 8:32 ` Felix Fietkau
@ 2022-04-06 8:57 ` Krzysztof Kozlowski
2022-04-07 16:59 ` Felix Fietkau
0 siblings, 1 reply; 21+ messages in thread
From: Krzysztof Kozlowski @ 2022-04-06 8:57 UTC (permalink / raw)
To: Felix Fietkau, Arnd Bergmann
Cc: Networking, Rob Herring, Krzysztof Kozlowski, Matthias Brugger,
David S. Miller, Jakub Kicinski, Paolo Abeni, Lorenzo Bianconi,
DTML, Linux ARM, moderated list:ARM/Mediatek SoC...,
Linux Kernel Mailing List
On 06/04/2022 10:32, Felix Fietkau wrote:
> On 06.04.22 10:29, Arnd Bergmann wrote:
>> On Wed, Apr 6, 2022 at 10:18 AM Felix Fietkau <nbd@nbd.name>
>> wrote:
>>> On 06.04.22 10:09, Krzysztof Kozlowski wrote:
>>>> On 05/04/2022 21:57, Felix Fietkau wrote:
>>>>> From: Lorenzo Bianconi <lorenzo@kernel.org>
>>>>>
>>>>> Document the binding for the Wireless Ethernet Dispatch core
>>>>> on the MT7622 SoC, which is used for Ethernet->WLAN
>>>>> offloading Add related info in mediatek-net bindings.
>>>>>
>>>>> Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
>>>>> Signed-off-by: Felix Fietkau <nbd@nbd.name>
>>>>
>>>> Thank you for your patch. There is something to
>>>> discuss/improve.
>>>>
>>>>> --- .../arm/mediatek/mediatek,mt7622-wed.yaml | 50
>>>>> +++++++++++++++++++
>>>>> .../devicetree/bindings/net/mediatek-net.txt | 2 + 2 files
>>>>> changed, 52 insertions(+) create mode 100644
>>>>> Documentation/devicetree/bindings/arm/mediatek/mediatek,mt7622-wed.yaml
>>>>
>>>>
>>>>>
Don't store drivers in arm directory. See:
>>>> https://lore.kernel.org/linux-devicetree/YkJa1oLSEP8R4U6y@robh.at.kernel.org/
>>>>
>>>>
>>>>
Isn't this a network offload engine? If yes, then probably it should be
>>>> in "net/".
>>> It's not a network offload engine by itself. It's a SoC component
>>> that connects to the offload engine and controls a MTK PCIe WLAN
>>> device, intercepting interrupts and DMA rings in order to be able
>>> to inject packets coming in from the offload engine. Do you think
>>> it still belongs in net, or maybe in soc instead?
>>
>> I think it belongs into drivers/net/. Presumably this has some kind
>> of user interface to configure which packets are forwarded? I would
>> not want to maintain that in a SoC driver as this clearly needs to
>> communicate with both of the normal network devices in some form.
> The WLAN driver attaches to WED in order to deal with the intercepted
> DMA rings, but other than that, WED itself has no user
> configuration. Offload is controlled by the PPE code in the ethernet
> driver (which is already upstream), and WED simply provides a
> destination port for PPE, which allows packets to flow to the
> wireless device.
Thanks for clarification. I still wonder about the missing drivers as I
responded to your second bindings:
https://lore.kernel.org/all/20220405195755.10817-1-nbd@nbd.name/T/#m6d108c644f0c05cd12c05e56abe2ef75760c6cef
Both of these compatibles - WED and PCIe - are not actually used. Now
everything is done inside your Ethernet driver which pokes WED and
PCIe-mirror address space via regmap/syscon.
Separate bindings might have sense if WED/PCIe mirror were ever
converted to real drivers.
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH v2 04/14] dt-bindings: arm: mediatek: document WED binding for MT7622
2022-04-06 8:57 ` Krzysztof Kozlowski
@ 2022-04-07 16:59 ` Felix Fietkau
0 siblings, 0 replies; 21+ messages in thread
From: Felix Fietkau @ 2022-04-07 16:59 UTC (permalink / raw)
To: Krzysztof Kozlowski, Arnd Bergmann
Cc: Networking, Rob Herring, Krzysztof Kozlowski, Matthias Brugger,
David S. Miller, Jakub Kicinski, Paolo Abeni, Lorenzo Bianconi,
DTML, Linux ARM, moderated list:ARM/Mediatek SoC...,
Linux Kernel Mailing List
On 06.04.22 10:57, Krzysztof Kozlowski wrote:
> Thanks for clarification. I still wonder about the missing drivers as I
> responded to your second bindings:
> https://lore.kernel.org/all/20220405195755.10817-1-nbd@nbd.name/T/#m6d108c644f0c05cd12c05e56abe2ef75760c6cef
>
> Both of these compatibles - WED and PCIe - are not actually used. Now
> everything is done inside your Ethernet driver which pokes WED and
> PCIe-mirror address space via regmap/syscon.
>
> Separate bindings might have sense if WED/PCIe mirror were ever
> converted to real drivers.I think in terms of hardware description it makes more sense to have
separate nodes, even if the implementation uses them in one driver at
the moment.
- Felix
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH v2 04/14] dt-bindings: arm: mediatek: document WED binding for MT7622
2022-04-06 8:18 ` Felix Fietkau
2022-04-06 8:29 ` Arnd Bergmann
@ 2022-04-07 15:50 ` Andrew Lunn
2022-04-07 16:10 ` Felix Fietkau
1 sibling, 1 reply; 21+ messages in thread
From: Andrew Lunn @ 2022-04-07 15:50 UTC (permalink / raw)
To: Felix Fietkau
Cc: Krzysztof Kozlowski, netdev, Rob Herring, Krzysztof Kozlowski,
Matthias Brugger, David S. Miller, Jakub Kicinski, Paolo Abeni,
Lorenzo Bianconi, devicetree, linux-arm-kernel, linux-mediatek,
linux-kernel
> > Isn't this a network offload engine? If yes, then probably it should be
> > in "net/".
> It's not a network offload engine by itself. It's a SoC component that
> connects to the offload engine and controls a MTK PCIe WLAN device,
> intercepting interrupts and DMA rings in order to be able to inject packets
> coming in from the offload engine.
Hi Felix
Maybe turn the question around. Can it be used for something other
than networking? If not, then somewhere under net seems reasonable.
Andrew
^ permalink raw reply [flat|nested] 21+ messages in thread* Re: [PATCH v2 04/14] dt-bindings: arm: mediatek: document WED binding for MT7622
2022-04-07 15:50 ` Andrew Lunn
@ 2022-04-07 16:10 ` Felix Fietkau
0 siblings, 0 replies; 21+ messages in thread
From: Felix Fietkau @ 2022-04-07 16:10 UTC (permalink / raw)
To: Andrew Lunn
Cc: Krzysztof Kozlowski, netdev, Rob Herring, Krzysztof Kozlowski,
Matthias Brugger, David S. Miller, Jakub Kicinski, Paolo Abeni,
Lorenzo Bianconi, devicetree, linux-arm-kernel, linux-mediatek,
linux-kernel
On 07.04.22 17:50, Andrew Lunn wrote:
>> > Isn't this a network offload engine? If yes, then probably it should be
>> > in "net/".
>> It's not a network offload engine by itself. It's a SoC component that
>> connects to the offload engine and controls a MTK PCIe WLAN device,
>> intercepting interrupts and DMA rings in order to be able to inject packets
>> coming in from the offload engine.
>
> Hi Felix
>
> Maybe turn the question around. Can it be used for something other
> than networking? If not, then somewhere under net seems reasonable.
I'm fine with moving this to net.
- Felix
^ permalink raw reply [flat|nested] 21+ messages in thread
* [PATCH v2 05/14] dt-bindings: arm: mediatek: document the pcie mirror node on MT7622
[not found] <20220405195755.10817-1-nbd@nbd.name>
` (2 preceding siblings ...)
2022-04-05 19:57 ` [PATCH v2 04/14] dt-bindings: arm: mediatek: document WED binding for MT7622 Felix Fietkau
@ 2022-04-05 19:57 ` Felix Fietkau
2022-04-06 8:20 ` Krzysztof Kozlowski
2022-04-07 17:19 ` Rob Herring
2022-04-05 19:57 ` [PATCH v2 08/14] arm64: dts: mediatek: mt7622: introduce nodes for Wireless Ethernet Dispatch Felix Fietkau
4 siblings, 2 replies; 21+ messages in thread
From: Felix Fietkau @ 2022-04-05 19:57 UTC (permalink / raw)
To: netdev, Rob Herring, Krzysztof Kozlowski, Matthias Brugger,
David S. Miller, Jakub Kicinski, Paolo Abeni, Lorenzo Bianconi
Cc: devicetree, linux-arm-kernel, linux-mediatek, linux-kernel
From: Lorenzo Bianconi <lorenzo@kernel.org>
This patch adds the pcie mirror document bindings for MT7622 SoC.
The feature is used for intercepting PCIe MMIO access for the WED core
Add related info in mediatek-net bindings.
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
.../mediatek/mediatek,mt7622-pcie-mirror.yaml | 42 +++++++++++++++++++
.../devicetree/bindings/net/mediatek-net.txt | 2 +
2 files changed, 44 insertions(+)
create mode 100644 Documentation/devicetree/bindings/arm/mediatek/mediatek,mt7622-pcie-mirror.yaml
diff --git a/Documentation/devicetree/bindings/arm/mediatek/mediatek,mt7622-pcie-mirror.yaml b/Documentation/devicetree/bindings/arm/mediatek/mediatek,mt7622-pcie-mirror.yaml
new file mode 100644
index 000000000000..9fbeb626ab23
--- /dev/null
+++ b/Documentation/devicetree/bindings/arm/mediatek/mediatek,mt7622-pcie-mirror.yaml
@@ -0,0 +1,42 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: "http://devicetree.org/schemas/arm/mediatek/mediatek,mt7622-pcie-mirror.yaml#"
+$schema: "http://devicetree.org/meta-schemas/core.yaml#"
+
+title: MediaTek PCIE Mirror Controller for MT7622
+
+maintainers:
+ - Lorenzo Bianconi <lorenzo@kernel.org>
+ - Felix Fietkau <nbd@nbd.name>
+
+description:
+ The mediatek PCIE mirror provides a configuration interface for PCIE
+ controller on MT7622 soc.
+
+properties:
+ compatible:
+ items:
+ - enum:
+ - mediatek,mt7622-pcie-mirror
+ - const: syscon
+
+ reg:
+ maxItems: 1
+
+required:
+ - compatible
+ - reg
+
+additionalProperties: false
+
+examples:
+ - |
+ soc {
+ #address-cells = <2>;
+ #size-cells = <2>;
+ pcie_mirror: pcie-mirror@10000400 {
+ compatible = "mediatek,mt7622-pcie-mirror", "syscon";
+ reg = <0 0x10000400 0 0x10>;
+ };
+ };
diff --git a/Documentation/devicetree/bindings/net/mediatek-net.txt b/Documentation/devicetree/bindings/net/mediatek-net.txt
index 1c8dc44bbb52..f18d70189375 100644
--- a/Documentation/devicetree/bindings/net/mediatek-net.txt
+++ b/Documentation/devicetree/bindings/net/mediatek-net.txt
@@ -48,6 +48,8 @@ Optional properties:
various clocks and reset to the system.
- mediatek,wed: a list of phandles to wireless ethernet dispatch nodes for
MT7622 SoC.
+- mediatek,pcie-mirror: phandle to the mediatek pcie-mirror controller for
+ MT7622 SoC.
* Ethernet MAC node
--
2.35.1
^ permalink raw reply related [flat|nested] 21+ messages in thread* Re: [PATCH v2 05/14] dt-bindings: arm: mediatek: document the pcie mirror node on MT7622
2022-04-05 19:57 ` [PATCH v2 05/14] dt-bindings: arm: mediatek: document the pcie mirror node on MT7622 Felix Fietkau
@ 2022-04-06 8:20 ` Krzysztof Kozlowski
2022-04-06 11:01 ` Felix Fietkau
2022-04-07 17:19 ` Rob Herring
1 sibling, 1 reply; 21+ messages in thread
From: Krzysztof Kozlowski @ 2022-04-06 8:20 UTC (permalink / raw)
To: Felix Fietkau, netdev, Rob Herring, Krzysztof Kozlowski,
Matthias Brugger, David S. Miller, Jakub Kicinski, Paolo Abeni,
Lorenzo Bianconi
Cc: devicetree, linux-arm-kernel, linux-mediatek, linux-kernel
On 05/04/2022 21:57, Felix Fietkau wrote:
> From: Lorenzo Bianconi <lorenzo@kernel.org>
>
> This patch adds the pcie mirror document bindings for MT7622 SoC.
> The feature is used for intercepting PCIe MMIO access for the WED core
> Add related info in mediatek-net bindings.
>
> Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
> Signed-off-by: Felix Fietkau <nbd@nbd.name>
> ---
> .../mediatek/mediatek,mt7622-pcie-mirror.yaml | 42 +++++++++++++++++++
Eh, I wanted to ask to not put it inside arm/, but judging by your usage
- you did not create drivers for both of these (WED and PCIe mirror).
You only need them to expose address spaces via syscon.
This actually looks hacky. Either WED and PCIe mirror are part of
network driver, then add the address spaces via "reg". If they are not,
but instead they are separate blocks, why you don't have drivers for them?
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH v2 05/14] dt-bindings: arm: mediatek: document the pcie mirror node on MT7622
2022-04-06 8:20 ` Krzysztof Kozlowski
@ 2022-04-06 11:01 ` Felix Fietkau
2022-04-07 17:16 ` Rob Herring
0 siblings, 1 reply; 21+ messages in thread
From: Felix Fietkau @ 2022-04-06 11:01 UTC (permalink / raw)
To: Krzysztof Kozlowski, netdev, Rob Herring, Krzysztof Kozlowski,
Matthias Brugger, David S. Miller, Jakub Kicinski, Paolo Abeni,
Lorenzo Bianconi
Cc: devicetree, linux-arm-kernel, linux-mediatek, linux-kernel
On 06.04.22 10:20, Krzysztof Kozlowski wrote:
> On 05/04/2022 21:57, Felix Fietkau wrote:
>> From: Lorenzo Bianconi <lorenzo@kernel.org>
>>
>> This patch adds the pcie mirror document bindings for MT7622 SoC.
>> The feature is used for intercepting PCIe MMIO access for the WED core
>> Add related info in mediatek-net bindings.
>>
>> Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
>> Signed-off-by: Felix Fietkau <nbd@nbd.name>
>> ---
>> .../mediatek/mediatek,mt7622-pcie-mirror.yaml | 42 +++++++++++++++++++
>
> Eh, I wanted to ask to not put it inside arm/, but judging by your usage
> - you did not create drivers for both of these (WED and PCIe mirror).
>
> You only need them to expose address spaces via syscon.
>
> This actually looks hacky. Either WED and PCIe mirror are part of
> network driver, then add the address spaces via "reg". If they are not,
> but instead they are separate blocks, why you don't have drivers for them?
The code that uses the WED block is built into the Ethernet driver, but
not all SoCs that use this ethernet core have it. Also, there are two
WED blocks, and I'm not sure if future SoCs might have a different
number of them at some point.
The WED code also needs to access registers of the ethernet MAC.
One reason for having a separate device is this:
As long as WED is not in use, ethernet supports coherent DMA for
increased performance. When the first wireless device attaches to WED,
IO coherency gets disabled and the ethernet DMA rings are cleaned up and
allocated again, this time with the struct device of WED (which doesn't
have the dma-coherent property).
- Felix
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH v2 05/14] dt-bindings: arm: mediatek: document the pcie mirror node on MT7622
2022-04-06 11:01 ` Felix Fietkau
@ 2022-04-07 17:16 ` Rob Herring
2022-04-07 17:29 ` Felix Fietkau
0 siblings, 1 reply; 21+ messages in thread
From: Rob Herring @ 2022-04-07 17:16 UTC (permalink / raw)
To: Felix Fietkau
Cc: Krzysztof Kozlowski, netdev, Krzysztof Kozlowski,
Matthias Brugger, David S. Miller, Jakub Kicinski, Paolo Abeni,
Lorenzo Bianconi, devicetree, linux-arm-kernel, linux-mediatek,
linux-kernel
On Wed, Apr 06, 2022 at 01:01:06PM +0200, Felix Fietkau wrote:
>
> On 06.04.22 10:20, Krzysztof Kozlowski wrote:
> > On 05/04/2022 21:57, Felix Fietkau wrote:
> > > From: Lorenzo Bianconi <lorenzo@kernel.org>
> > >
> > > This patch adds the pcie mirror document bindings for MT7622 SoC.
> > > The feature is used for intercepting PCIe MMIO access for the WED core
> > > Add related info in mediatek-net bindings.
> > >
> > > Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
> > > Signed-off-by: Felix Fietkau <nbd@nbd.name>
> > > ---
> > > .../mediatek/mediatek,mt7622-pcie-mirror.yaml | 42 +++++++++++++++++++
> >
> > Eh, I wanted to ask to not put it inside arm/, but judging by your usage
> > - you did not create drivers for both of these (WED and PCIe mirror).
> >
> > You only need them to expose address spaces via syscon.
> >
> > This actually looks hacky. Either WED and PCIe mirror are part of
> > network driver, then add the address spaces via "reg". If they are not,
> > but instead they are separate blocks, why you don't have drivers for them?
> The code that uses the WED block is built into the Ethernet driver, but not
> all SoCs that use this ethernet core have it. Also, there are two WED
> blocks, and I'm not sure if future SoCs might have a different number of
> them at some point.
> The WED code also needs to access registers of the ethernet MAC.
> One reason for having a separate device is this:
> As long as WED is not in use, ethernet supports coherent DMA for increased
> performance. When the first wireless device attaches to WED, IO coherency
> gets disabled and the ethernet DMA rings are cleaned up and allocated again,
> this time with the struct device of WED (which doesn't have the dma-coherent
> property).
I'm pretty sure there are assumptions in the driver core that coherency
is not changing on the fly. In any case, if it is, using 'dma-coherent'
is not appropriate. You obviously have another method to determine
whether you are coherent or not.
Rob
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH v2 05/14] dt-bindings: arm: mediatek: document the pcie mirror node on MT7622
2022-04-07 17:16 ` Rob Herring
@ 2022-04-07 17:29 ` Felix Fietkau
0 siblings, 0 replies; 21+ messages in thread
From: Felix Fietkau @ 2022-04-07 17:29 UTC (permalink / raw)
To: Rob Herring
Cc: Krzysztof Kozlowski, netdev, Krzysztof Kozlowski,
Matthias Brugger, David S. Miller, Jakub Kicinski, Paolo Abeni,
Lorenzo Bianconi, devicetree, linux-arm-kernel, linux-mediatek,
linux-kernel
On 07.04.22 19:16, Rob Herring wrote:
> On Wed, Apr 06, 2022 at 01:01:06PM +0200, Felix Fietkau wrote:
>>
>> On 06.04.22 10:20, Krzysztof Kozlowski wrote:
>> > On 05/04/2022 21:57, Felix Fietkau wrote:
>> > > From: Lorenzo Bianconi <lorenzo@kernel.org>
>> > >
>> > > This patch adds the pcie mirror document bindings for MT7622 SoC.
>> > > The feature is used for intercepting PCIe MMIO access for the WED core
>> > > Add related info in mediatek-net bindings.
>> > >
>> > > Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
>> > > Signed-off-by: Felix Fietkau <nbd@nbd.name>
>> > > ---
>> > > .../mediatek/mediatek,mt7622-pcie-mirror.yaml | 42 +++++++++++++++++++
>> >
>> > Eh, I wanted to ask to not put it inside arm/, but judging by your usage
>> > - you did not create drivers for both of these (WED and PCIe mirror).
>> >
>> > You only need them to expose address spaces via syscon.
>> >
>> > This actually looks hacky. Either WED and PCIe mirror are part of
>> > network driver, then add the address spaces via "reg". If they are not,
>> > but instead they are separate blocks, why you don't have drivers for them?
>> The code that uses the WED block is built into the Ethernet driver, but not
>> all SoCs that use this ethernet core have it. Also, there are two WED
>> blocks, and I'm not sure if future SoCs might have a different number of
>> them at some point.
>> The WED code also needs to access registers of the ethernet MAC.
>> One reason for having a separate device is this:
>> As long as WED is not in use, ethernet supports coherent DMA for increased
>> performance. When the first wireless device attaches to WED, IO coherency
>> gets disabled and the ethernet DMA rings are cleaned up and allocated again,
>> this time with the struct device of WED (which doesn't have the dma-coherent
>> property).
>
> I'm pretty sure there are assumptions in the driver core that coherency
> is not changing on the fly. In any case, if it is, using 'dma-coherent'
> is not appropriate. You obviously have another method to determine
> whether you are coherent or not.
It's not really on the fly. Before changing coherency, all DMA memory is
freed, and the subsequent reallocation uses the struct device of the WED
core, which does not have the dma-coherent property.
- Felix
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH v2 05/14] dt-bindings: arm: mediatek: document the pcie mirror node on MT7622
2022-04-05 19:57 ` [PATCH v2 05/14] dt-bindings: arm: mediatek: document the pcie mirror node on MT7622 Felix Fietkau
2022-04-06 8:20 ` Krzysztof Kozlowski
@ 2022-04-07 17:19 ` Rob Herring
2022-04-08 9:03 ` Felix Fietkau
1 sibling, 1 reply; 21+ messages in thread
From: Rob Herring @ 2022-04-07 17:19 UTC (permalink / raw)
To: Felix Fietkau
Cc: netdev, Krzysztof Kozlowski, Matthias Brugger, David S. Miller,
Jakub Kicinski, Paolo Abeni, Lorenzo Bianconi, devicetree,
linux-arm-kernel, linux-mediatek, linux-kernel
On Tue, Apr 05, 2022 at 09:57:46PM +0200, Felix Fietkau wrote:
> From: Lorenzo Bianconi <lorenzo@kernel.org>
>
> This patch adds the pcie mirror document bindings for MT7622 SoC.
> The feature is used for intercepting PCIe MMIO access for the WED core
> Add related info in mediatek-net bindings.
>
> Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
> Signed-off-by: Felix Fietkau <nbd@nbd.name>
> ---
> .../mediatek/mediatek,mt7622-pcie-mirror.yaml | 42 +++++++++++++++++++
> .../devicetree/bindings/net/mediatek-net.txt | 2 +
> 2 files changed, 44 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/arm/mediatek/mediatek,mt7622-pcie-mirror.yaml
>
> diff --git a/Documentation/devicetree/bindings/arm/mediatek/mediatek,mt7622-pcie-mirror.yaml b/Documentation/devicetree/bindings/arm/mediatek/mediatek,mt7622-pcie-mirror.yaml
> new file mode 100644
> index 000000000000..9fbeb626ab23
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/arm/mediatek/mediatek,mt7622-pcie-mirror.yaml
> @@ -0,0 +1,42 @@
> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: "http://devicetree.org/schemas/arm/mediatek/mediatek,mt7622-pcie-mirror.yaml#"
> +$schema: "http://devicetree.org/meta-schemas/core.yaml#"
> +
> +title: MediaTek PCIE Mirror Controller for MT7622
> +
> +maintainers:
> + - Lorenzo Bianconi <lorenzo@kernel.org>
> + - Felix Fietkau <nbd@nbd.name>
> +
> +description:
> + The mediatek PCIE mirror provides a configuration interface for PCIE
> + controller on MT7622 soc.
> +
> +properties:
> + compatible:
> + items:
> + - enum:
> + - mediatek,mt7622-pcie-mirror
> + - const: syscon
This doesn't sound like a syscon to me. Are there multiple clients or
functions in this block? A 'syscon' property is not the only way to
create a regmap if that's what you need.
Rob
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH v2 05/14] dt-bindings: arm: mediatek: document the pcie mirror node on MT7622
2022-04-07 17:19 ` Rob Herring
@ 2022-04-08 9:03 ` Felix Fietkau
0 siblings, 0 replies; 21+ messages in thread
From: Felix Fietkau @ 2022-04-08 9:03 UTC (permalink / raw)
To: Rob Herring
Cc: netdev, Krzysztof Kozlowski, Matthias Brugger, David S. Miller,
Jakub Kicinski, Paolo Abeni, Lorenzo Bianconi, devicetree,
linux-arm-kernel, linux-mediatek, linux-kernel
On 07.04.22 19:19, Rob Herring wrote:
> On Tue, Apr 05, 2022 at 09:57:46PM +0200, Felix Fietkau wrote:
>> From: Lorenzo Bianconi <lorenzo@kernel.org>
>>
>> This patch adds the pcie mirror document bindings for MT7622 SoC.
>> The feature is used for intercepting PCIe MMIO access for the WED core
>> Add related info in mediatek-net bindings.
>>
>> Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
>> Signed-off-by: Felix Fietkau <nbd@nbd.name>
>> ---
>> .../mediatek/mediatek,mt7622-pcie-mirror.yaml | 42 +++++++++++++++++++
>> .../devicetree/bindings/net/mediatek-net.txt | 2 +
>> 2 files changed, 44 insertions(+)
>> create mode 100644 Documentation/devicetree/bindings/arm/mediatek/mediatek,mt7622-pcie-mirror.yaml
>>
>> diff --git a/Documentation/devicetree/bindings/arm/mediatek/mediatek,mt7622-pcie-mirror.yaml b/Documentation/devicetree/bindings/arm/mediatek/mediatek,mt7622-pcie-mirror.yaml
>> new file mode 100644
>> index 000000000000..9fbeb626ab23
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/arm/mediatek/mediatek,mt7622-pcie-mirror.yaml
>> @@ -0,0 +1,42 @@
>> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
>> +%YAML 1.2
>> +---
>> +$id: "http://devicetree.org/schemas/arm/mediatek/mediatek,mt7622-pcie-mirror.yaml#"
>> +$schema: "http://devicetree.org/meta-schemas/core.yaml#"
>> +
>> +title: MediaTek PCIE Mirror Controller for MT7622
>> +
>> +maintainers:
>> + - Lorenzo Bianconi <lorenzo@kernel.org>
>> + - Felix Fietkau <nbd@nbd.name>
>> +
>> +description:
>> + The mediatek PCIE mirror provides a configuration interface for PCIE
>> + controller on MT7622 soc.
>> +
>> +properties:
>> + compatible:
>> + items:
>> + - enum:
>> + - mediatek,mt7622-pcie-mirror
>> + - const: syscon
>
> This doesn't sound like a syscon to me. Are there multiple clients or
> functions in this block? A 'syscon' property is not the only way to
> create a regmap if that's what you need.
It's used only by the WED code in the ethernet driver, but there are
multiple WED instances and only a single pcie-mirror block containing
configuration for them.
- Felix
^ permalink raw reply [flat|nested] 21+ messages in thread
* [PATCH v2 08/14] arm64: dts: mediatek: mt7622: introduce nodes for Wireless Ethernet Dispatch
[not found] <20220405195755.10817-1-nbd@nbd.name>
` (3 preceding siblings ...)
2022-04-05 19:57 ` [PATCH v2 05/14] dt-bindings: arm: mediatek: document the pcie mirror node on MT7622 Felix Fietkau
@ 2022-04-05 19:57 ` Felix Fietkau
4 siblings, 0 replies; 21+ messages in thread
From: Felix Fietkau @ 2022-04-05 19:57 UTC (permalink / raw)
To: netdev, Rob Herring, Krzysztof Kozlowski, Matthias Brugger
Cc: devicetree, linux-arm-kernel, linux-mediatek, linux-kernel
Introduce wed0 and wed1 nodes in order to enable offloading forwarding
between ethernet and wireless devices on the mt7622 chipset.
Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
arch/arm64/boot/dts/mediatek/mt7622.dtsi | 28 ++++++++++++++++++++++++
1 file changed, 28 insertions(+)
diff --git a/arch/arm64/boot/dts/mediatek/mt7622.dtsi b/arch/arm64/boot/dts/mediatek/mt7622.dtsi
index a2257ec6d256..47d223e28f8d 100644
--- a/arch/arm64/boot/dts/mediatek/mt7622.dtsi
+++ b/arch/arm64/boot/dts/mediatek/mt7622.dtsi
@@ -901,6 +901,11 @@ sata_port: sata-phy@1a243000 {
};
};
+ hifsys: syscon@1af00000 {
+ compatible = "mediatek,mt7622-hifsys", "syscon";
+ reg = <0 0x1af00000 0 0x70>;
+ };
+
ethsys: syscon@1b000000 {
compatible = "mediatek,mt7622-ethsys",
"syscon";
@@ -919,6 +924,26 @@ hsdma: dma-controller@1b007000 {
#dma-cells = <1>;
};
+ pcie_mirror: pcie-mirror@10000400 {
+ compatible = "mediatek,mt7622-pcie-mirror",
+ "syscon";
+ reg = <0 0x10000400 0 0x10>;
+ };
+
+ wed0: wed@1020a000 {
+ compatible = "mediatek,mt7622-wed",
+ "syscon";
+ reg = <0 0x1020a000 0 0x1000>;
+ interrupts = <GIC_SPI 214 IRQ_TYPE_LEVEL_LOW>;
+ };
+
+ wed1: wed@1020b000 {
+ compatible = "mediatek,mt7622-wed",
+ "syscon";
+ reg = <0 0x1020b000 0 0x1000>;
+ interrupts = <GIC_SPI 215 IRQ_TYPE_LEVEL_LOW>;
+ };
+
eth: ethernet@1b100000 {
compatible = "mediatek,mt7622-eth",
"mediatek,mt2701-eth",
@@ -946,6 +971,9 @@ eth: ethernet@1b100000 {
mediatek,ethsys = <ðsys>;
mediatek,sgmiisys = <&sgmiisys>;
mediatek,cci-control = <&cci_control2>;
+ mediatek,wed = <&wed0>, <&wed1>;
+ mediatek,pcie-mirror = <&pcie_mirror>;
+ mediatek,hifsys = <&hifsys>;
dma-coherent;
#address-cells = <1>;
#size-cells = <0>;
--
2.35.1
^ permalink raw reply related [flat|nested] 21+ messages in thread