Message ID | 20250412102109.101094-1-linux@fw-web.de (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | [v2] arm64: dts: mediatek: mt7988a-bpi-r4: allow hw variants of bpi-r4 | expand |
Il 12/04/25 12:21, Frank Wunderlich ha scritto: > From: Frank Wunderlich <frank-w@public-files.de> > > Sinovoip has released other variants of Bananapi-R4 board. > The known changes affecting only the LAN SFP+ slot which is replaced > by a 2.5G phy with optional PoE. > > Just move the common parts to a new dtsi and keep differences (only > i2c for lan-sfp) in dts. > > Signed-off-by: Frank Wunderlich <frank-w@public-files.de> > --- > v2: > - added basic dts for 2g5 variant > - moved i2c used for sfp-lan to board dts > --- > arch/arm64/boot/dts/mediatek/Makefile | 2 + > .../mediatek/mt7988a-bananapi-bpi-r4-2g5.dts | 5 + > .../dts/mediatek/mt7988a-bananapi-bpi-r4.dts | 404 +----------------- > .../dts/mediatek/mt7988a-bananapi-bpi-r4.dtsi | 403 +++++++++++++++++ > 4 files changed, 414 insertions(+), 400 deletions(-) > create mode 100644 arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-2g5.dts > create mode 100644 arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dtsi > > diff --git a/arch/arm64/boot/dts/mediatek/Makefile b/arch/arm64/boot/dts/mediatek/Makefile > index 58484e830063..a1ebc9aa4ba6 100644 > --- a/arch/arm64/boot/dts/mediatek/Makefile > +++ b/arch/arm64/boot/dts/mediatek/Makefile > @@ -22,6 +22,7 @@ dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986a-bananapi-bpi-r3-sd.dtbo > dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986a-rfb.dtb > dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986b-rfb.dtb > dtb-$(CONFIG_ARCH_MEDIATEK) += mt7988a-bananapi-bpi-r4.dtb > +dtb-$(CONFIG_ARCH_MEDIATEK) += mt7988a-bananapi-bpi-r4-2g5.dtb > dtb-$(CONFIG_ARCH_MEDIATEK) += mt7988a-bananapi-bpi-r4-emmc.dtbo > dtb-$(CONFIG_ARCH_MEDIATEK) += mt7988a-bananapi-bpi-r4-sd.dtbo > dtb-$(CONFIG_ARCH_MEDIATEK) += mt8167-pumpkin.dtb > @@ -107,4 +108,5 @@ dtb-$(CONFIG_ARCH_MEDIATEK) += mt8516-pumpkin.dtb > DTC_FLAGS_mt7986a-bananapi-bpi-r3 := -@ > DTC_FLAGS_mt7986a-bananapi-bpi-r3-mini := -@ > DTC_FLAGS_mt7988a-bananapi-bpi-r4 := -@ > +DTC_FLAGS_mt7988a-bananapi-bpi-r4-2g5 := -@ > DTC_FLAGS_mt8395-radxa-nio-12l := -@ > diff --git a/arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-2g5.dts b/arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-2g5.dts > new file mode 100644 > index 000000000000..76eca976b968 > --- /dev/null > +++ b/arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-2g5.dts > @@ -0,0 +1,5 @@ > +// SPDX-License-Identifier: GPL-2.0-only OR MIT > + > +/dts-v1/; > + > +#include "mt7988a-bananapi-bpi-r4.dtsi" This should at least have some different compatible, if not probably also a different model string - as it's a different device. compatible = "bananapi,bpi-r4-2g5", "bananapi,bpi-r4", "mediatek,mt7988a"; model = "Banana Pi BPI-R4 (2.5GbE)"; chassis-type = "embedded"; > diff --git a/arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dts b/arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dts > index 6623112c24c7..431bf066fffb 100644 > --- a/arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dts > +++ b/arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dts ..snip.. a/arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dtsi b/arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dtsi > new file mode 100644 > index 000000000000..1ab09ed2f151 > --- /dev/null > +++ b/arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dtsi > @@ -0,0 +1,403 @@ > +// SPDX-License-Identifier: GPL-2.0-only OR MIT > + > +/dts-v1/; > + > +#include <dt-bindings/gpio/gpio.h> > +#include <dt-bindings/regulator/richtek,rt5190a-regulator.h> > + > +#include "mt7988a.dtsi" > + > +/ { > + compatible = "bananapi,bpi-r4", "mediatek,mt7988a"; > + model = "Banana Pi BPI-R4"; > + chassis-type = "embedded"; Please keep compatible/model/chassis-type in dts files. Cheers, Angelo
Am 14. April 2025 11:27:23 MESZ schrieb AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>: >Il 12/04/25 12:21, Frank Wunderlich ha scritto: >> From: Frank Wunderlich <frank-w@public-files.de> >> snip >This should at least have some different compatible, if not probably also a >different model string - as it's a different device. > > compatible = "bananapi,bpi-r4-2g5", "bananapi,bpi-r4", "mediatek,mt7988a"; > model = "Banana Pi BPI-R4 (2.5GbE)"; > chassis-type = "embedded"; > >..snip.. > >a/arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dtsi b/arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dtsi >> new file mode 100644 >> index 000000000000..1ab09ed2f151 >> --- /dev/null >> +++ b/arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dtsi >> @@ -0,0 +1,403 @@ >> +// SPDX-License-Identifier: GPL-2.0-only OR MIT >> + >> +/dts-v1/; >> + >> +#include <dt-bindings/gpio/gpio.h> >> +#include <dt-bindings/regulator/richtek,rt5190a-regulator.h> >> + >> +#include "mt7988a.dtsi" >> + >> +/ { >> + compatible = "bananapi,bpi-r4", "mediatek,mt7988a"; >> + model = "Banana Pi BPI-R4"; >> + chassis-type = "embedded"; > >Please keep compatible/model/chassis-type in dts files. Ok, should i add specific compatible to existing board (like 2sfp)? Just thinking how binding should look like. Else is there an example for adding optional compatible without adding a complete block in binding? >Cheers, >Angelo regards Frank
Il 14/04/25 12:19, Frank Wunderlich ha scritto: > Am 14. April 2025 11:27:23 MESZ schrieb AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>: >> Il 12/04/25 12:21, Frank Wunderlich ha scritto: >>> From: Frank Wunderlich <frank-w@public-files.de> >>> > snip >> This should at least have some different compatible, if not probably also a >> different model string - as it's a different device. >> >> compatible = "bananapi,bpi-r4-2g5", "bananapi,bpi-r4", "mediatek,mt7988a"; >> model = "Banana Pi BPI-R4 (2.5GbE)"; >> chassis-type = "embedded"; >> >> ..snip.. >> >> a/arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dtsi b/arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dtsi >>> new file mode 100644 >>> index 000000000000..1ab09ed2f151 >>> --- /dev/null >>> +++ b/arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dtsi >>> @@ -0,0 +1,403 @@ >>> +// SPDX-License-Identifier: GPL-2.0-only OR MIT >>> + >>> +/dts-v1/; >>> + >>> +#include <dt-bindings/gpio/gpio.h> >>> +#include <dt-bindings/regulator/richtek,rt5190a-regulator.h> >>> + >>> +#include "mt7988a.dtsi" >>> + >>> +/ { >>> + compatible = "bananapi,bpi-r4", "mediatek,mt7988a"; >>> + model = "Banana Pi BPI-R4"; >>> + chassis-type = "embedded"; >> >> Please keep compatible/model/chassis-type in dts files. > > Ok, should i add specific compatible to existing board (like 2sfp)? Just thinking how binding should look like. > No, the existing board compatibles should not be touched. I would imagine the bootloader reading the compatibles of all DTs and: - On the 2G5 device, prefer a devicetree having that machine compatible; - 2G5: If no 2G5 specific DT exists, fall back to using bananapi,bpi-r4 - On the 2sfp device, use DT that has bananapi,bpi-r4 but not the 2g5 compat. So all of the DTs can be present, and the bootloader chooses the right one for whatever device it is running on. If it's not possible for the bootloader to do so... well, that still doesn't change anything: you need two different DTS with a difference in machine compatible because those are two different machines :-) > Else is there an example for adding optional compatible without adding a complete block in binding? I'm not sure if you can nest oneOf statements in bindings... but that anyway doesn't really solve anything, so just add a full block.... Just to be sure, though: krzk/Rob/Conor, am I right on this? Thanks!> >> Cheers, >> Angelo > > > regards Frank
On Mon, Apr 14, 2025 at 11:27:23AM +0200, AngeloGioacchino Del Regno wrote: > Il 12/04/25 12:21, Frank Wunderlich ha scritto: > > From: Frank Wunderlich <frank-w@public-files.de> > > > > Sinovoip has released other variants of Bananapi-R4 board. > > The known changes affecting only the LAN SFP+ slot which is replaced > > by a 2.5G phy with optional PoE. > > > > Just move the common parts to a new dtsi and keep differences (only > > i2c for lan-sfp) in dts. > > > > Signed-off-by: Frank Wunderlich <frank-w@public-files.de> > > --- > > v2: > > - added basic dts for 2g5 variant > > - moved i2c used for sfp-lan to board dts > > --- > > arch/arm64/boot/dts/mediatek/Makefile | 2 + > > .../mediatek/mt7988a-bananapi-bpi-r4-2g5.dts | 5 + > > .../dts/mediatek/mt7988a-bananapi-bpi-r4.dts | 404 +----------------- > > .../dts/mediatek/mt7988a-bananapi-bpi-r4.dtsi | 403 +++++++++++++++++ > > 4 files changed, 414 insertions(+), 400 deletions(-) > > create mode 100644 arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-2g5.dts > > create mode 100644 arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dtsi > > > > diff --git a/arch/arm64/boot/dts/mediatek/Makefile b/arch/arm64/boot/dts/mediatek/Makefile > > index 58484e830063..a1ebc9aa4ba6 100644 > > --- a/arch/arm64/boot/dts/mediatek/Makefile > > +++ b/arch/arm64/boot/dts/mediatek/Makefile > > @@ -22,6 +22,7 @@ dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986a-bananapi-bpi-r3-sd.dtbo > > dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986a-rfb.dtb > > dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986b-rfb.dtb > > dtb-$(CONFIG_ARCH_MEDIATEK) += mt7988a-bananapi-bpi-r4.dtb > > +dtb-$(CONFIG_ARCH_MEDIATEK) += mt7988a-bananapi-bpi-r4-2g5.dtb > > dtb-$(CONFIG_ARCH_MEDIATEK) += mt7988a-bananapi-bpi-r4-emmc.dtbo > > dtb-$(CONFIG_ARCH_MEDIATEK) += mt7988a-bananapi-bpi-r4-sd.dtbo > > dtb-$(CONFIG_ARCH_MEDIATEK) += mt8167-pumpkin.dtb > > @@ -107,4 +108,5 @@ dtb-$(CONFIG_ARCH_MEDIATEK) += mt8516-pumpkin.dtb > > DTC_FLAGS_mt7986a-bananapi-bpi-r3 := -@ > > DTC_FLAGS_mt7986a-bananapi-bpi-r3-mini := -@ > > DTC_FLAGS_mt7988a-bananapi-bpi-r4 := -@ > > +DTC_FLAGS_mt7988a-bananapi-bpi-r4-2g5 := -@ > > DTC_FLAGS_mt8395-radxa-nio-12l := -@ > > diff --git a/arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-2g5.dts b/arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-2g5.dts > > new file mode 100644 > > index 000000000000..76eca976b968 > > --- /dev/null > > +++ b/arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-2g5.dts > > @@ -0,0 +1,5 @@ > > +// SPDX-License-Identifier: GPL-2.0-only OR MIT > > + > > +/dts-v1/; > > + > > +#include "mt7988a-bananapi-bpi-r4.dtsi" > > This should at least have some different compatible, if not probably also a > different model string - as it's a different device. > > compatible = "bananapi,bpi-r4-2g5", "bananapi,bpi-r4", "mediatek,mt7988a"; Imho it doesn't make sense to declare compatibility with the "bananapi,bpi-r4" as the "bananapi,bpi-r4-2g5" is NOT compatible with the "bananapi,bpi-r4". It's a different board and using firmware meant for the "bananapi,bpi-r4-2g5" on the "bananapi,bpi-r4" (or vice versa) will result in a non-working Ethernet port.
Il 14/04/25 14:32, Daniel Golle ha scritto: > On Mon, Apr 14, 2025 at 11:27:23AM +0200, AngeloGioacchino Del Regno wrote: >> Il 12/04/25 12:21, Frank Wunderlich ha scritto: >>> From: Frank Wunderlich <frank-w@public-files.de> >>> >>> Sinovoip has released other variants of Bananapi-R4 board. >>> The known changes affecting only the LAN SFP+ slot which is replaced >>> by a 2.5G phy with optional PoE. >>> >>> Just move the common parts to a new dtsi and keep differences (only >>> i2c for lan-sfp) in dts. >>> >>> Signed-off-by: Frank Wunderlich <frank-w@public-files.de> >>> --- >>> v2: >>> - added basic dts for 2g5 variant >>> - moved i2c used for sfp-lan to board dts >>> --- >>> arch/arm64/boot/dts/mediatek/Makefile | 2 + >>> .../mediatek/mt7988a-bananapi-bpi-r4-2g5.dts | 5 + >>> .../dts/mediatek/mt7988a-bananapi-bpi-r4.dts | 404 +----------------- >>> .../dts/mediatek/mt7988a-bananapi-bpi-r4.dtsi | 403 +++++++++++++++++ >>> 4 files changed, 414 insertions(+), 400 deletions(-) >>> create mode 100644 arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-2g5.dts >>> create mode 100644 arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dtsi >>> >>> diff --git a/arch/arm64/boot/dts/mediatek/Makefile b/arch/arm64/boot/dts/mediatek/Makefile >>> index 58484e830063..a1ebc9aa4ba6 100644 >>> --- a/arch/arm64/boot/dts/mediatek/Makefile >>> +++ b/arch/arm64/boot/dts/mediatek/Makefile >>> @@ -22,6 +22,7 @@ dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986a-bananapi-bpi-r3-sd.dtbo >>> dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986a-rfb.dtb >>> dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986b-rfb.dtb >>> dtb-$(CONFIG_ARCH_MEDIATEK) += mt7988a-bananapi-bpi-r4.dtb >>> +dtb-$(CONFIG_ARCH_MEDIATEK) += mt7988a-bananapi-bpi-r4-2g5.dtb >>> dtb-$(CONFIG_ARCH_MEDIATEK) += mt7988a-bananapi-bpi-r4-emmc.dtbo >>> dtb-$(CONFIG_ARCH_MEDIATEK) += mt7988a-bananapi-bpi-r4-sd.dtbo >>> dtb-$(CONFIG_ARCH_MEDIATEK) += mt8167-pumpkin.dtb >>> @@ -107,4 +108,5 @@ dtb-$(CONFIG_ARCH_MEDIATEK) += mt8516-pumpkin.dtb >>> DTC_FLAGS_mt7986a-bananapi-bpi-r3 := -@ >>> DTC_FLAGS_mt7986a-bananapi-bpi-r3-mini := -@ >>> DTC_FLAGS_mt7988a-bananapi-bpi-r4 := -@ >>> +DTC_FLAGS_mt7988a-bananapi-bpi-r4-2g5 := -@ >>> DTC_FLAGS_mt8395-radxa-nio-12l := -@ >>> diff --git a/arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-2g5.dts b/arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-2g5.dts >>> new file mode 100644 >>> index 000000000000..76eca976b968 >>> --- /dev/null >>> +++ b/arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-2g5.dts >>> @@ -0,0 +1,5 @@ >>> +// SPDX-License-Identifier: GPL-2.0-only OR MIT >>> + >>> +/dts-v1/; >>> + >>> +#include "mt7988a-bananapi-bpi-r4.dtsi" >> >> This should at least have some different compatible, if not probably also a >> different model string - as it's a different device. >> >> compatible = "bananapi,bpi-r4-2g5", "bananapi,bpi-r4", "mediatek,mt7988a"; > > Imho it doesn't make sense to declare compatibility with the > "bananapi,bpi-r4" as the "bananapi,bpi-r4-2g5" is NOT compatible with the > "bananapi,bpi-r4". It's a different board and using firmware meant for the > "bananapi,bpi-r4-2g5" on the "bananapi,bpi-r4" (or vice versa) will result > in a non-working Ethernet port. > Is this device a BananaPi R4 variant, or is it a completely different device? If this is a completely different device, then it's not even a BananaPi R4, otherwise this is compatible with BananaPi R4, with a small variation :-) Cheers, Angelo
Am 15. April 2025 09:36:43 MESZ schrieb AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>: >Il 14/04/25 14:32, Daniel Golle ha scritto: >> On Mon, Apr 14, 2025 at 11:27:23AM +0200, AngeloGioacchino Del Regno wrote: >>> Il 12/04/25 12:21, Frank Wunderlich ha scritto: >>>> From: Frank Wunderlich <frank-w@public-files.de> >>>> >>>> Sinovoip has released other variants of Bananapi-R4 board. >>>> The known changes affecting only the LAN SFP+ slot which is replaced >>>> by a 2.5G phy with optional PoE. >>>> >>>> Just move the common parts to a new dtsi and keep differences (only >>>> i2c for lan-sfp) in dts. >>> This should at least have some different compatible, if not probably also a >>> different model string - as it's a different device. >>> >>> compatible = "bananapi,bpi-r4-2g5", "bananapi,bpi-r4", "mediatek,mt7988a"; >> >> Imho it doesn't make sense to declare compatibility with the >> "bananapi,bpi-r4" as the "bananapi,bpi-r4-2g5" is NOT compatible with the >> "bananapi,bpi-r4". It's a different board and using firmware meant for the >> "bananapi,bpi-r4-2g5" on the "bananapi,bpi-r4" (or vice versa) will result >> in a non-working Ethernet port. >> > >Is this device a BananaPi R4 variant, or is it a completely different device? The only difference is that sfp-lan is replaced by RJ45 socket with mt7988 internal phy. >If this is a completely different device, then it's not even a BananaPi R4, >otherwise this is compatible with BananaPi R4, with a small variation :-) Sinovoip now announces a R4Pro with some more changes (e.g. an external 2.5g switch),but we have no detailed shematic yet. It looks they also plan a R4lite which is based on different SoC (afair mt7987),but this is for sure different device (and so not using this bpi-r4.dtsi). But basicly all are named BPi-R4. I guess R4Pro will also get own dts as too much changed. >Cheers, >Angelo regards Frank
Il 15/04/25 10:07, Frank Wunderlich ha scritto: > Am 15. April 2025 09:36:43 MESZ schrieb AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>: >> Il 14/04/25 14:32, Daniel Golle ha scritto: >>> On Mon, Apr 14, 2025 at 11:27:23AM +0200, AngeloGioacchino Del Regno wrote: >>>> Il 12/04/25 12:21, Frank Wunderlich ha scritto: >>>>> From: Frank Wunderlich <frank-w@public-files.de> >>>>> >>>>> Sinovoip has released other variants of Bananapi-R4 board. >>>>> The known changes affecting only the LAN SFP+ slot which is replaced >>>>> by a 2.5G phy with optional PoE. >>>>> >>>>> Just move the common parts to a new dtsi and keep differences (only >>>>> i2c for lan-sfp) in dts. > >>>> This should at least have some different compatible, if not probably also a >>>> different model string - as it's a different device. >>>> >>>> compatible = "bananapi,bpi-r4-2g5", "bananapi,bpi-r4", "mediatek,mt7988a"; >>> >>> Imho it doesn't make sense to declare compatibility with the >>> "bananapi,bpi-r4" as the "bananapi,bpi-r4-2g5" is NOT compatible with the >>> "bananapi,bpi-r4". It's a different board and using firmware meant for the >>> "bananapi,bpi-r4-2g5" on the "bananapi,bpi-r4" (or vice versa) will result >>> in a non-working Ethernet port. >>> >> >> Is this device a BananaPi R4 variant, or is it a completely different device? > > The only difference is that sfp-lan is replaced by RJ45 socket with mt7988 internal phy. > Perfect, then: - The only difference is one routing - The base board is the same - Same hw project - The two machines are compatible with each other ...bar one difference ...then the compatibles shall be as I said before :-) >> If this is a completely different device, then it's not even a BananaPi R4, >> otherwise this is compatible with BananaPi R4, with a small variation :-) > > Sinovoip now announces a R4Pro with some more changes (e.g. an external 2.5g switch),but we have no detailed shematic yet. It looks they also plan a R4lite which is based on different SoC (afair mt7987),but this is for sure different device (and so not using this bpi-r4.dtsi). In that case, R4Lite shall not be compatible with R4, as the name may be the same, but in practice it's a different machine. > > But basicly all are named BPi-R4. I guess R4Pro will also get own dts as too much changed. If R4pro is a redesign of the R4 board, that would not be compatible, as it would not be the same base design; otherwise, I'm sure you have well understood how it works for the compatibles, anyway :D Cheers! > >> Cheers, >> Angelo > > > regards Frank
Am 15. April 2025 11:56:37 MESZ schrieb AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>: >Il 15/04/25 10:07, Frank Wunderlich ha scritto: >> Am 15. April 2025 09:36:43 MESZ schrieb AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>: >>> Il 14/04/25 14:32, Daniel Golle ha scritto: >>>> On Mon, Apr 14, 2025 at 11:27:23AM +0200, AngeloGioacchino Del Regno wrote: >>>>> Il 12/04/25 12:21, Frank Wunderlich ha scritto: >>>>>> From: Frank Wunderlich <frank-w@public-files.de> >>>>>> >>>>>> Sinovoip has released other variants of Bananapi-R4 board. >>>>>> The known changes affecting only the LAN SFP+ slot which is replaced >>>>>> by a 2.5G phy with optional PoE. >>>>>> >>>>>> Just move the common parts to a new dtsi and keep differences (only >>>>>> i2c for lan-sfp) in dts. >> >>>>> This should at least have some different compatible, if not probably also a >>>>> different model string - as it's a different device. >>>>> >>>>> compatible = "bananapi,bpi-r4-2g5", "bananapi,bpi-r4", "mediatek,mt7988a"; >>>> >>>> Imho it doesn't make sense to declare compatibility with the >>>> "bananapi,bpi-r4" as the "bananapi,bpi-r4-2g5" is NOT compatible with the >>>> "bananapi,bpi-r4". It's a different board and using firmware meant for the >>>> "bananapi,bpi-r4-2g5" on the "bananapi,bpi-r4" (or vice versa) will result >>>> in a non-working Ethernet port. >>>> >>> >>> Is this device a BananaPi R4 variant, or is it a completely different device? >> >> The only difference is that sfp-lan is replaced by RJ45 socket with mt7988 internal phy. >> > >Perfect, then: > - The only difference is one routing > - The base board is the same > - Same hw project > - The two machines are compatible with each other > ...bar one difference > >...then the compatibles shall be as I said before :-) > >>> If this is a completely different device, then it's not even a BananaPi R4, >>> otherwise this is compatible with BananaPi R4, with a small variation :-) >> >> Sinovoip now announces a R4Pro with some more changes (e.g. an external 2.5g switch),but we have no detailed shematic yet. It looks they also plan a R4lite which is based on different SoC (afair mt7987),but this is for sure different device (and so not using this bpi-r4.dtsi). > >In that case, R4Lite shall not be compatible with R4, as the name may be the >same, but in practice it's a different machine. > >> >> But basicly all are named BPi-R4. I guess R4Pro will also get own dts as too much changed. > >If R4pro is a redesign of the R4 board, that would not be compatible, as it >would not be the same base design; otherwise, I'm sure you have well understood >how it works for the compatibles, anyway :D Yes, should i use 3 const in the binding (as i do not expect another hw variant of current R4) or still enum for the first compatible? >Cheers! > >> >>> Cheers, >>> Angelo >> >> >> regards Frank > > regards Frank
diff --git a/arch/arm64/boot/dts/mediatek/Makefile b/arch/arm64/boot/dts/mediatek/Makefile index 58484e830063..a1ebc9aa4ba6 100644 --- a/arch/arm64/boot/dts/mediatek/Makefile +++ b/arch/arm64/boot/dts/mediatek/Makefile @@ -22,6 +22,7 @@ dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986a-bananapi-bpi-r3-sd.dtbo dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986a-rfb.dtb dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986b-rfb.dtb dtb-$(CONFIG_ARCH_MEDIATEK) += mt7988a-bananapi-bpi-r4.dtb +dtb-$(CONFIG_ARCH_MEDIATEK) += mt7988a-bananapi-bpi-r4-2g5.dtb dtb-$(CONFIG_ARCH_MEDIATEK) += mt7988a-bananapi-bpi-r4-emmc.dtbo dtb-$(CONFIG_ARCH_MEDIATEK) += mt7988a-bananapi-bpi-r4-sd.dtbo dtb-$(CONFIG_ARCH_MEDIATEK) += mt8167-pumpkin.dtb @@ -107,4 +108,5 @@ dtb-$(CONFIG_ARCH_MEDIATEK) += mt8516-pumpkin.dtb DTC_FLAGS_mt7986a-bananapi-bpi-r3 := -@ DTC_FLAGS_mt7986a-bananapi-bpi-r3-mini := -@ DTC_FLAGS_mt7988a-bananapi-bpi-r4 := -@ +DTC_FLAGS_mt7988a-bananapi-bpi-r4-2g5 := -@ DTC_FLAGS_mt8395-radxa-nio-12l := -@ diff --git a/arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-2g5.dts b/arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-2g5.dts new file mode 100644 index 000000000000..76eca976b968 --- /dev/null +++ b/arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-2g5.dts @@ -0,0 +1,5 @@ +// SPDX-License-Identifier: GPL-2.0-only OR MIT + +/dts-v1/; + +#include "mt7988a-bananapi-bpi-r4.dtsi" diff --git a/arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dts b/arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dts index 6623112c24c7..431bf066fffb 100644 --- a/arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dts +++ b/arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dts @@ -2,408 +2,12 @@ /dts-v1/; -#include <dt-bindings/gpio/gpio.h> -#include <dt-bindings/regulator/richtek,rt5190a-regulator.h> +#include "mt7988a-bananapi-bpi-r4.dtsi" -#include "mt7988a.dtsi" - -/ { - compatible = "bananapi,bpi-r4", "mediatek,mt7988a"; - model = "Banana Pi BPI-R4"; - chassis-type = "embedded"; - - chosen { - stdout-path = "serial0:115200n8"; - }; - - reg_1p8v: regulator-1p8v { - compatible = "regulator-fixed"; - regulator-name = "fixed-1.8V"; - regulator-min-microvolt = <1800000>; - regulator-max-microvolt = <1800000>; - regulator-boot-on; - regulator-always-on; - }; - - reg_3p3v: regulator-3p3v { - compatible = "regulator-fixed"; - regulator-name = "fixed-3.3V"; - regulator-min-microvolt = <3300000>; - regulator-max-microvolt = <3300000>; - regulator-boot-on; - regulator-always-on; - }; -}; - -&cpu0 { - proc-supply = <&rt5190_buck3>; -}; - -&cpu1 { - proc-supply = <&rt5190_buck3>; -}; - -&cpu2 { - proc-supply = <&rt5190_buck3>; -}; - -&cpu3 { - proc-supply = <&rt5190_buck3>; -}; - -&cpu_thermal { - trips { - cpu_trip_hot: hot { - temperature = <120000>; - hysteresis = <2000>; - type = "hot"; - }; - - cpu_trip_active_high: active-high { - temperature = <115000>; - hysteresis = <2000>; - type = "active"; - }; - - cpu_trip_active_med: active-med { - temperature = <85000>; - hysteresis = <2000>; - type = "active"; - }; - - cpu_trip_active_low: active-low { - temperature = <40000>; - hysteresis = <2000>; - type = "active"; - }; - }; -}; - -&i2c0 { - pinctrl-names = "default"; - pinctrl-0 = <&i2c0_pins>; - status = "okay"; - - rt5190a_64: rt5190a@64 { - compatible = "richtek,rt5190a"; - reg = <0x64>; - vin2-supply = <&rt5190_buck1>; - vin3-supply = <&rt5190_buck1>; - vin4-supply = <&rt5190_buck1>; - - regulators { - rt5190_buck1: buck1 { - regulator-name = "rt5190a-buck1"; - regulator-min-microvolt = <5090000>; - regulator-max-microvolt = <5090000>; - regulator-allowed-modes = - <RT5190A_OPMODE_AUTO>, <RT5190A_OPMODE_FPWM>; - regulator-boot-on; - regulator-always-on; - }; - buck2 { - regulator-name = "vcore"; - regulator-min-microvolt = <600000>; - regulator-max-microvolt = <1400000>; - regulator-boot-on; - regulator-always-on; - }; - rt5190_buck3: buck3 { - regulator-name = "vproc"; - regulator-min-microvolt = <600000>; - regulator-max-microvolt = <1400000>; - regulator-boot-on; - }; - buck4 { - regulator-name = "rt5190a-buck4"; - regulator-min-microvolt = <1800000>; - regulator-max-microvolt = <1800000>; - regulator-allowed-modes = - <RT5190A_OPMODE_AUTO>, <RT5190A_OPMODE_FPWM>; - regulator-boot-on; - regulator-always-on; - }; - ldo { - regulator-name = "rt5190a-ldo"; - regulator-min-microvolt = <1800000>; - regulator-max-microvolt = <1800000>; - regulator-boot-on; - regulator-always-on; - }; - }; - }; -}; - -&i2c2 { - pinctrl-names = "default"; - pinctrl-0 = <&i2c2_1_pins>; - status = "okay"; - - pca9545: i2c-mux@70 { - compatible = "nxp,pca9545"; - reg = <0x70>; - reset-gpios = <&pio 5 GPIO_ACTIVE_LOW>; +&pca9545 { + i2c_sfp2: i2c@2 { #address-cells = <1>; #size-cells = <0>; - - i2c@0 { - #address-cells = <1>; - #size-cells = <0>; - reg = <0>; - - pcf8563: rtc@51 { - compatible = "nxp,pcf8563"; - reg = <0x51>; - #clock-cells = <0>; - }; - - eeprom@57 { - compatible = "atmel,24c02"; - reg = <0x57>; - size = <256>; - }; - - }; - - i2c_sfp1: i2c@1 { - #address-cells = <1>; - #size-cells = <0>; - reg = <1>; - }; - - i2c_sfp2: i2c@2 { - #address-cells = <1>; - #size-cells = <0>; - reg = <2>; - }; + reg = <2>; }; }; - -/* mPCIe SIM2 */ -&pcie0 { - status = "okay"; -}; - -/* mPCIe SIM3 */ -&pcie1 { - status = "okay"; -}; - -/* M.2 key-B SIM1 */ -&pcie2 { - status = "okay"; -}; - -/* M.2 key-M SSD */ -&pcie3 { - status = "okay"; -}; - -&pio { - mdio0_pins: mdio0-pins { - mux { - function = "eth"; - groups = "mdc_mdio0"; - }; - - conf { - pins = "SMI_0_MDC", "SMI_0_MDIO"; - drive-strength = <8>; - }; - }; - - i2c0_pins: i2c0-g0-pins { - mux { - function = "i2c"; - groups = "i2c0_1"; - }; - }; - - i2c1_pins: i2c1-g0-pins { - mux { - function = "i2c"; - groups = "i2c1_0"; - }; - }; - - i2c1_sfp_pins: i2c1-sfp-g0-pins { - mux { - function = "i2c"; - groups = "i2c1_sfp"; - }; - }; - - i2c2_0_pins: i2c2-g0-pins { - mux { - function = "i2c"; - groups = "i2c2_0"; - }; - }; - - i2c2_1_pins: i2c2-g1-pins { - mux { - function = "i2c"; - groups = "i2c2_1"; - }; - }; - - gbe0_led0_pins: gbe0-led0-pins { - mux { - function = "led"; - groups = "gbe0_led0"; - }; - }; - - gbe1_led0_pins: gbe1-led0-pins { - mux { - function = "led"; - groups = "gbe1_led0"; - }; - }; - - gbe2_led0_pins: gbe2-led0-pins { - mux { - function = "led"; - groups = "gbe2_led0"; - }; - }; - - gbe3_led0_pins: gbe3-led0-pins { - mux { - function = "led"; - groups = "gbe3_led0"; - }; - }; - - gbe0_led1_pins: gbe0-led1-pins { - mux { - function = "led"; - groups = "gbe0_led1"; - }; - }; - - gbe1_led1_pins: gbe1-led1-pins { - mux { - function = "led"; - groups = "gbe1_led1"; - }; - }; - - gbe2_led1_pins: gbe2-led1-pins { - mux { - function = "led"; - groups = "gbe2_led1"; - }; - }; - - gbe3_led1_pins: gbe3-led1-pins { - mux { - function = "led"; - groups = "gbe3_led1"; - }; - }; - - i2p5gbe_led0_pins: 2p5gbe-led0-pins { - mux { - function = "led"; - groups = "2p5gbe_led0"; - }; - }; - - i2p5gbe_led1_pins: 2p5gbe-led1-pins { - mux { - function = "led"; - groups = "2p5gbe_led1"; - }; - }; - - mmc0_pins_emmc_45: mmc0-emmc-45-pins { - mux { - function = "flash"; - groups = "emmc_45"; - }; - }; - - mmc0_pins_emmc_51: mmc0-emmc-51-pins { - mux { - function = "flash"; - groups = "emmc_51"; - }; - }; - - mmc0_pins_sdcard: mmc0-sdcard-pins { - mux { - function = "flash"; - groups = "sdcard"; - }; - }; - - uart0_pins: uart0-pins { - mux { - function = "uart"; - groups = "uart0"; - }; - }; - - snfi_pins: snfi-pins { - mux { - function = "flash"; - groups = "snfi"; - }; - }; - - spi0_pins: spi0-pins { - mux { - function = "spi"; - groups = "spi0"; - }; - }; - - spi0_flash_pins: spi0-flash-pins { - mux { - function = "spi"; - groups = "spi0", "spi0_wp_hold"; - }; - }; - - spi1_pins: spi1-pins { - mux { - function = "spi"; - groups = "spi1"; - }; - }; - - spi2_pins: spi2-pins { - mux { - function = "spi"; - groups = "spi2"; - }; - }; - - spi2_flash_pins: spi2-flash-pins { - mux { - function = "spi"; - groups = "spi2", "spi2_wp_hold"; - }; - }; -}; - -&pwm { - status = "okay"; -}; - -&serial0 { - status = "okay"; -}; - -&ssusb1 { - status = "okay"; -}; - -&tphy { - status = "okay"; -}; - -&watchdog { - status = "okay"; -}; diff --git a/arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dtsi b/arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dtsi new file mode 100644 index 000000000000..1ab09ed2f151 --- /dev/null +++ b/arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dtsi @@ -0,0 +1,403 @@ +// SPDX-License-Identifier: GPL-2.0-only OR MIT + +/dts-v1/; + +#include <dt-bindings/gpio/gpio.h> +#include <dt-bindings/regulator/richtek,rt5190a-regulator.h> + +#include "mt7988a.dtsi" + +/ { + compatible = "bananapi,bpi-r4", "mediatek,mt7988a"; + model = "Banana Pi BPI-R4"; + chassis-type = "embedded"; + + chosen { + stdout-path = "serial0:115200n8"; + }; + + reg_1p8v: regulator-1p8v { + compatible = "regulator-fixed"; + regulator-name = "fixed-1.8V"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-boot-on; + regulator-always-on; + }; + + reg_3p3v: regulator-3p3v { + compatible = "regulator-fixed"; + regulator-name = "fixed-3.3V"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-boot-on; + regulator-always-on; + }; +}; + +&cpu0 { + proc-supply = <&rt5190_buck3>; +}; + +&cpu1 { + proc-supply = <&rt5190_buck3>; +}; + +&cpu2 { + proc-supply = <&rt5190_buck3>; +}; + +&cpu3 { + proc-supply = <&rt5190_buck3>; +}; + +&cpu_thermal { + trips { + cpu_trip_hot: hot { + temperature = <120000>; + hysteresis = <2000>; + type = "hot"; + }; + + cpu_trip_active_high: active-high { + temperature = <115000>; + hysteresis = <2000>; + type = "active"; + }; + + cpu_trip_active_med: active-med { + temperature = <85000>; + hysteresis = <2000>; + type = "active"; + }; + + cpu_trip_active_low: active-low { + temperature = <40000>; + hysteresis = <2000>; + type = "active"; + }; + }; +}; + +&i2c0 { + pinctrl-names = "default"; + pinctrl-0 = <&i2c0_pins>; + status = "okay"; + + rt5190a_64: rt5190a@64 { + compatible = "richtek,rt5190a"; + reg = <0x64>; + vin2-supply = <&rt5190_buck1>; + vin3-supply = <&rt5190_buck1>; + vin4-supply = <&rt5190_buck1>; + + regulators { + rt5190_buck1: buck1 { + regulator-name = "rt5190a-buck1"; + regulator-min-microvolt = <5090000>; + regulator-max-microvolt = <5090000>; + regulator-allowed-modes = + <RT5190A_OPMODE_AUTO>, <RT5190A_OPMODE_FPWM>; + regulator-boot-on; + regulator-always-on; + }; + buck2 { + regulator-name = "vcore"; + regulator-min-microvolt = <600000>; + regulator-max-microvolt = <1400000>; + regulator-boot-on; + regulator-always-on; + }; + rt5190_buck3: buck3 { + regulator-name = "vproc"; + regulator-min-microvolt = <600000>; + regulator-max-microvolt = <1400000>; + regulator-boot-on; + }; + buck4 { + regulator-name = "rt5190a-buck4"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-allowed-modes = + <RT5190A_OPMODE_AUTO>, <RT5190A_OPMODE_FPWM>; + regulator-boot-on; + regulator-always-on; + }; + ldo { + regulator-name = "rt5190a-ldo"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-boot-on; + regulator-always-on; + }; + }; + }; +}; + +&i2c2 { + pinctrl-names = "default"; + pinctrl-0 = <&i2c2_1_pins>; + status = "okay"; + + pca9545: i2c-mux@70 { + compatible = "nxp,pca9545"; + reg = <0x70>; + reset-gpios = <&pio 5 GPIO_ACTIVE_LOW>; + #address-cells = <1>; + #size-cells = <0>; + + i2c@0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + + pcf8563: rtc@51 { + compatible = "nxp,pcf8563"; + reg = <0x51>; + #clock-cells = <0>; + }; + + eeprom@57 { + compatible = "atmel,24c02"; + reg = <0x57>; + size = <256>; + }; + + }; + + i2c_sfp1: i2c@1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + }; + }; +}; + +/* mPCIe SIM2 */ +&pcie0 { + status = "okay"; +}; + +/* mPCIe SIM3 */ +&pcie1 { + status = "okay"; +}; + +/* M.2 key-B SIM1 */ +&pcie2 { + status = "okay"; +}; + +/* M.2 key-M SSD */ +&pcie3 { + status = "okay"; +}; + +&pio { + mdio0_pins: mdio0-pins { + mux { + function = "eth"; + groups = "mdc_mdio0"; + }; + + conf { + pins = "SMI_0_MDC", "SMI_0_MDIO"; + drive-strength = <8>; + }; + }; + + i2c0_pins: i2c0-g0-pins { + mux { + function = "i2c"; + groups = "i2c0_1"; + }; + }; + + i2c1_pins: i2c1-g0-pins { + mux { + function = "i2c"; + groups = "i2c1_0"; + }; + }; + + i2c1_sfp_pins: i2c1-sfp-g0-pins { + mux { + function = "i2c"; + groups = "i2c1_sfp"; + }; + }; + + i2c2_0_pins: i2c2-g0-pins { + mux { + function = "i2c"; + groups = "i2c2_0"; + }; + }; + + i2c2_1_pins: i2c2-g1-pins { + mux { + function = "i2c"; + groups = "i2c2_1"; + }; + }; + + gbe0_led0_pins: gbe0-led0-pins { + mux { + function = "led"; + groups = "gbe0_led0"; + }; + }; + + gbe1_led0_pins: gbe1-led0-pins { + mux { + function = "led"; + groups = "gbe1_led0"; + }; + }; + + gbe2_led0_pins: gbe2-led0-pins { + mux { + function = "led"; + groups = "gbe2_led0"; + }; + }; + + gbe3_led0_pins: gbe3-led0-pins { + mux { + function = "led"; + groups = "gbe3_led0"; + }; + }; + + gbe0_led1_pins: gbe0-led1-pins { + mux { + function = "led"; + groups = "gbe0_led1"; + }; + }; + + gbe1_led1_pins: gbe1-led1-pins { + mux { + function = "led"; + groups = "gbe1_led1"; + }; + }; + + gbe2_led1_pins: gbe2-led1-pins { + mux { + function = "led"; + groups = "gbe2_led1"; + }; + }; + + gbe3_led1_pins: gbe3-led1-pins { + mux { + function = "led"; + groups = "gbe3_led1"; + }; + }; + + i2p5gbe_led0_pins: 2p5gbe-led0-pins { + mux { + function = "led"; + groups = "2p5gbe_led0"; + }; + }; + + i2p5gbe_led1_pins: 2p5gbe-led1-pins { + mux { + function = "led"; + groups = "2p5gbe_led1"; + }; + }; + + mmc0_pins_emmc_45: mmc0-emmc-45-pins { + mux { + function = "flash"; + groups = "emmc_45"; + }; + }; + + mmc0_pins_emmc_51: mmc0-emmc-51-pins { + mux { + function = "flash"; + groups = "emmc_51"; + }; + }; + + mmc0_pins_sdcard: mmc0-sdcard-pins { + mux { + function = "flash"; + groups = "sdcard"; + }; + }; + + uart0_pins: uart0-pins { + mux { + function = "uart"; + groups = "uart0"; + }; + }; + + snfi_pins: snfi-pins { + mux { + function = "flash"; + groups = "snfi"; + }; + }; + + spi0_pins: spi0-pins { + mux { + function = "spi"; + groups = "spi0"; + }; + }; + + spi0_flash_pins: spi0-flash-pins { + mux { + function = "spi"; + groups = "spi0", "spi0_wp_hold"; + }; + }; + + spi1_pins: spi1-pins { + mux { + function = "spi"; + groups = "spi1"; + }; + }; + + spi2_pins: spi2-pins { + mux { + function = "spi"; + groups = "spi2"; + }; + }; + + spi2_flash_pins: spi2-flash-pins { + mux { + function = "spi"; + groups = "spi2", "spi2_wp_hold"; + }; + }; +}; + +&pwm { + status = "okay"; +}; + +&serial0 { + status = "okay"; +}; + +&ssusb1 { + status = "okay"; +}; + +&tphy { + status = "okay"; +}; + +&watchdog { + status = "okay"; +};