From: "Arınç ÜNAL" <arinc.unal@arinc9.com>
To: frank-w@public-files.de, arinc9.unal@gmail.com,
Rob Herring <robh+dt@kernel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
Matthias Brugger <matthias.bgg@gmail.com>
Cc: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org,
erkin.bozoglu@xeront.com, Sean Wang <sean.wang@mediatek.com>,
DENG Qingfang <dqfext@gmail.com>
Subject: Re: [PATCH v2 4/5] arm: dts: mt7623: mux phy0 on Bananapi BPI-R2
Date: Fri, 3 Feb 2023 21:20:48 +0300 [thread overview]
Message-ID: <75d3758a-5502-03a4-b3a2-990f9339705b@arinc9.com> (raw)
In-Reply-To: <AC473057-266B-4403-9270-8007E0EC257C@public-files.de>
On 3.02.2023 18:36, Frank Wunderlich wrote:
> Am 1. Februar 2023 19:56:55 MEZ schrieb arinc9.unal@gmail.com:
>> From: Arınç ÜNAL <arinc.unal@arinc9.com>
>>
>> Mux the MT7530 switch's phy0 to gmac5 which is wired to the SoC's gmac1.
>> This achieves 2 Gbps total bandwidth to the CPU using the second RGMII.
>>
>> With this, the interface name to access phy0 changes from wan to eth1.
>>
>> Signed-off-by: Arınç ÜNAL <arinc.unal@arinc9.com>
>> ---
>> arch/arm/boot/dts/mt7623n-bananapi-bpi-r2.dts | 15 ++++++++++-----
>> 1 file changed, 10 insertions(+), 5 deletions(-)
>>
>> diff --git a/arch/arm/boot/dts/mt7623n-bananapi-bpi-r2.dts b/arch/arm/boot/dts/mt7623n-bananapi-bpi-r2.dts
>> index dc9b4f99eb8b..64700253fd35 100644
>> --- a/arch/arm/boot/dts/mt7623n-bananapi-bpi-r2.dts
>> +++ b/arch/arm/boot/dts/mt7623n-bananapi-bpi-r2.dts
>> @@ -182,6 +182,12 @@ fixed-link {
>> };
>> };
>>
>> +&gmac1 {
>> + status = "okay";
>> + phy-mode = "rgmii";
>> + phy-handle = <ðphy0>;
>> +};
>> +
>> ð {
>> status = "okay";
>>
>> @@ -189,6 +195,10 @@ mdio-bus {
>> #address-cells = <1>;
>> #size-cells = <0>;
>>
>> + ethphy0: ethernet-phy@0 {
>> + reg = <0>;
>> + };
>> +
>> switch@1f {
>> compatible = "mediatek,mt7530";
>> reg = <0x1f>;
>> @@ -200,11 +210,6 @@ ports {
>> #address-cells = <1>;
>> #size-cells = <0>;
>>
>> - port@0 {
>> - reg = <0>;
>> - label = "wan";
>> - };
>> -
>> port@1 {
>> reg = <1>;
>> label = "lan0";
>
> Hi
>
> I still see Problem with "renaming" the wan from users PoV. I got another way of using second gmac for wan some time ago using vlan-aware bridge (have not tested with recent kernel versions).
>
> Maybe this works for you too? If yes imho it will be a better way.
>
> https://github.com/frank-w/BPI-Router-Linux/commit/c92b648bac996b34dc75a4fff15d7fb429bfe74b
Frank, the comment section of that page is full of my comments testing
it out and chatting with you. I don't understand why you're wording it
like it's new to me.
>
> Have same for r64/mt7622 in my tree...
>
> It should use eth1 for wan-traffic too but is full userspace configuration without breaking userspace for users not wanting it.
If your argument is that connecting the wan port to the second mac
should stay off mainline and to be left to the individual to do so, to
not break the existing userspace configuration, this hack will need much
more complex changes to the userspace configuration compared to this patch.
On top of this, you still need to change the devicetree to enable gmac1.
And it will cause issues due to the nature of this method. Frames with
the same MAC address will appear on different interfaces which will
flood the kernel log, if eth1 were to be put in a bridge with other
interfaces.
To summarise:
This patch Your method
Changes to the devicetree Yes (-) Yes (-)
Changes to the userspace configuration Yes (-) Yes (-)
Changes required in userspace Simple (+) Complex (-)
Does it work properly? Yes (+) No (-)
Using this patch would be the proper way to connect the wan port to the
second mac.
I can also argue that I see no good reason to not want this, therefore
this should be the default way. The UTP port for the wan port is
seperated from the other 4 ports which already supports that this
should've been there when the DT of this device was added in the first
place.
If someone were to not want this, they could change the devicetree to
fit their own purpose.
I did this on GnuBee GB-PC1 and it was easily addressed on gnubee-tools,
a tool for building a firmware image for the said device.
https://github.com/neilbrown/gnubee-tools/commit/e1cdab9fd5f03ec4582176ab6eac9157df2a6f21
To conclude, in my opinion, gaining 2 Gbps total bandwidth to the CPU at
the expense of a tiny change in userspace configuration is absolutely
worth it. You clearly don't think that way and that's fine. It's up to
the maintainer, Matthias, to decide. Matthias can take the remaining
patches if they please.
Arınç
next prev parent reply other threads:[~2023-02-03 18:21 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-01 18:56 [PATCH v2 0/5] arm: dts: mt7623: relocate gmacs, mt7530 switch, and mux phy arinc9.unal
2023-02-01 18:56 ` [PATCH v2 1/5] arm: dts: mt7623: add gmacs to mt7623.dtsi arinc9.unal
2023-02-01 18:56 ` [PATCH v2 2/5] arm: dts: mt7623: add mt7530 switch to mt7623a.dtsi arinc9.unal
2023-02-01 18:56 ` [PATCH v2 3/5] arm: dts: mt7623: change mt7530 switch address arinc9.unal
2023-02-01 18:56 ` [PATCH v2 4/5] arm: dts: mt7623: mux phy0 on Bananapi BPI-R2 arinc9.unal
2023-02-03 15:36 ` Frank Wunderlich
2023-02-03 18:20 ` Arınç ÜNAL [this message]
2023-02-03 18:54 ` Frank Wunderlich
2023-02-04 10:27 ` Aw: " Frank Wunderlich
2023-02-04 11:43 ` Frank Wunderlich
2023-02-04 12:12 ` Arınç ÜNAL
2023-02-04 13:07 ` Aw: " Frank Wunderlich
2023-02-04 15:50 ` Arınç ÜNAL
2023-02-08 18:47 ` Arınç ÜNAL
2023-02-01 18:56 ` [PATCH v2 5/5] arm: dts: mt7623: enable flow control on port@6 arinc9.unal
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=75d3758a-5502-03a4-b3a2-990f9339705b@arinc9.com \
--to=arinc.unal@arinc9.com \
--cc=arinc9.unal@gmail.com \
--cc=devicetree@vger.kernel.org \
--cc=dqfext@gmail.com \
--cc=erkin.bozoglu@xeront.com \
--cc=frank-w@public-files.de \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=matthias.bgg@gmail.com \
--cc=robh+dt@kernel.org \
--cc=sean.wang@mediatek.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
all inboxes | Powered by JetHome®