mbox series

[RFT,0/5] realtek: support boards similar to DGS-1210-10

Message ID 20211005194024.31909-1-fercerpav@gmail.com
Headers show
Series realtek: support boards similar to DGS-1210-10 | expand

Message

Paul Fertser Oct. 5, 2021, 7:40 p.m. UTC
I only have D-Link DGS-1210-10P R1 for testing but other devices should be very
similar judging by the photos. Would be nice to share support for all the
features available rather than get just R1 fully working.

Paul Fertser (5):
  realtek: split DGS-1210-10P DTS
  realtek: add all LEDs, buttons and SFP signals to DGS-1210-10
  realtek: add non-PoE version of DGS-1210-10 F1
  realtek: support D-Link DGS-1210-10P H/W:R1
  realtek: support Trendnet TPE-082WS V1

 .../realtek/base-files/etc/board.d/02_network |  10 +
 .../rtl8380_d-link_dgs-1210-10-f1.dts         |   8 +
 .../rtl8380_d-link_dgs-1210-10-f1.dtsi        |  61 ++++++
 .../dts-5.10/rtl8380_d-link_dgs-1210-10.dtsi  | 173 ++++++++++++++++++
 .../rtl8380_d-link_dgs-1210-10p-f1.dts        |   8 +
 .../rtl8380_d-link_dgs-1210-10p-r1.dts        |  67 +++++++
 .../rtl8380_trendnet_tpe-082ws-v1.dts         |  67 +++++++
 .../dts-5.10/rtl8382_d-link_dgs-1210-10p.dts  | 155 ----------------
 target/linux/realtek/image/Makefile           |  35 +++-
 9 files changed, 427 insertions(+), 157 deletions(-)
 create mode 100644 target/linux/realtek/dts-5.10/rtl8380_d-link_dgs-1210-10-f1.dts
 create mode 100644 target/linux/realtek/dts-5.10/rtl8380_d-link_dgs-1210-10-f1.dtsi
 create mode 100644 target/linux/realtek/dts-5.10/rtl8380_d-link_dgs-1210-10.dtsi
 create mode 100644 target/linux/realtek/dts-5.10/rtl8380_d-link_dgs-1210-10p-f1.dts
 create mode 100644 target/linux/realtek/dts-5.10/rtl8380_d-link_dgs-1210-10p-r1.dts
 create mode 100644 target/linux/realtek/dts-5.10/rtl8380_trendnet_tpe-082ws-v1.dts
 delete mode 100644 target/linux/realtek/dts-5.10/rtl8382_d-link_dgs-1210-10p.dts

Comments

Sander Vanheule July 9, 2022, 7:39 a.m. UTC | #1
Hi Luiz, Markus,

On Tue, 2021-10-05 at 22:40 +0300, Paul Fertser wrote:
> I only have D-Link DGS-1210-10P R1 for testing but other devices should be
> very
> similar judging by the photos. Would be nice to share support for all the
> features available rather than get just R1 fully working.
> 
> Paul Fertser (5):
>   realtek: split DGS-1210-10P DTS
>   realtek: add all LEDs, buttons and SFP signals to DGS-1210-10
>   realtek: add non-PoE version of DGS-1210-10 F1
>   realtek: support D-Link DGS-1210-10P H/W:R1
>   realtek: support Trendnet TPE-082WS V1

Recently you two have provided some patches for the DGS-1210 switches, and you
apear to have a nice collection of different devices. I would like to draw your
attention to these (old) patches, with some improvments Paul suggested. Sadly
nobody showed up to test them at the time. I was wondering if these changes are
still relevant and if you could have a look at them.

The different patches can be found at, and downloaded from:
https://patchwork.ozlabs.org/project/openwrt/list/?series=265587&state=*

In case you weren't subscribed to the mailing list at the time and you would
like to reply to one of the patches, they can be downloaded from patchwork in
mbox format and imported into a mail client.

Best,
Sander
Luiz Angelo Daros de Luca July 17, 2022, 2:32 a.m. UTC | #2
> On Tue, 2021-10-05 at 22:40 +0300, Paul Fertser wrote:
> > I only have D-Link DGS-1210-10P R1 for testing but other devices should be
> > very
> > similar judging by the photos. Would be nice to share support for all the
> > features available rather than get just R1 fully working.
> >
> > Paul Fertser (5):
> >   realtek: split DGS-1210-10P DTS
> >   realtek: add all LEDs, buttons and SFP signals to DGS-1210-10
> >   realtek: add non-PoE version of DGS-1210-10 F1
> >   realtek: support D-Link DGS-1210-10P H/W:R1
> >   realtek: support Trendnet TPE-082WS V1
>
> Recently you two have provided some patches for the DGS-1210 switches, and you
> apear to have a nice collection of different devices. I would like to draw your
> attention to these (old) patches, with some improvments Paul suggested. Sadly
> nobody showed up to test them at the time. I was wondering if these changes are
> still relevant and if you could have a look at them.

I didn't have any DGS-1210 switches back then. Now I have hundreds.

It looks like an interesting submission, still relevant but it
requires a v2 rebasing and with the suggested changes.

It uses SOC := rtl8380 while all existing dgs-1210 F1 variants use
rtl8382 (except for the pending -52 variant). The commit didn't
mention why that happened.
I'm not sure which one is correct here. However, if it is really a
different SoC and with what we currently know, we could create a
generic rtl83xx_d-link_dgs-1210.dtsi as the -52 variant uses even a
more different SoC (rtl8393). They share a lot of stuff like flash
layout and gpios (and the vendor firmware even uses the same image). I
could do some generic and family review but I only have -28 and -52
variants.

> The different patches can be found at, and downloaded from:
> https://patchwork.ozlabs.org/project/openwrt/list/?series=265587&state=*
>
> In case you weren't subscribed to the mailing list at the time and you would
> like to reply to one of the patches, they can be downloaded from patchwork in
> mbox format and imported into a mail client.
>
> Best,
> Sander


Regards,

Luiz
Paul Fertser July 17, 2022, 9:55 a.m. UTC | #3
On Sat, Jul 16, 2022 at 11:32:52PM -0300, Luiz Angelo Daros de Luca wrote:
> It uses SOC := rtl8380 while all existing dgs-1210 F1 variants use
> rtl8382 (except for the pending -52 variant). The commit didn't
> mention why that happened.

It's just cosmetic AFAICT but the datasheet clearly states that the
SoC used for <=18 ports switches is called RTL8380.

> I'm not sure which one is correct here. However, if it is really a
> different SoC and with what we currently know, we could create a
> generic rtl83xx_d-link_dgs-1210.dtsi as the -52 variant uses even a
> more different SoC (rtl8393). They share a lot of stuff like flash
> layout and gpios (and the vendor firmware even uses the same image). I
> could do some generic and family review but I only have -28 and -52
> variants.

I only have access to non-PoE dgs-1210-10 R1 board.

You say they share GPIO layout, does it mean you currently can't fully
handle SFP ports on your hardware but my patches make it work?
Birger Koblitz July 17, 2022, 10:38 a.m. UTC | #4
Hi,

On 7/17/22 11:55, Paul Fertser wrote:
> On Sat, Jul 16, 2022 at 11:32:52PM -0300, Luiz Angelo Daros de Luca wrote:
>> It uses SOC := rtl8380 while all existing dgs-1210 F1 variants use
>> rtl8382 (except for the pending -52 variant). The commit didn't
>> mention why that happened.
> 
> It's just cosmetic AFAICT but the datasheet clearly states that the
> SoC used for <=18 ports switches is called RTL8380.
during OpenWRT boot, the SoC is identified by reading out a 
configuration register. It will say something like
[    0.000000] Linux version 5.10.127 (birger@MintDesktop) 
(mips-openwrt-linux-musl-gcc (OpenWrt GCC 11.3.0 r18457+1542-4b587f2561) 
11.3.0, GNU ld (GNU Binutils) 2.37) #0 SMP Tue Jul 12 19:01:38 2022
[    0.000000] RTL838X model is 8380XXXX (4 first hex digits give model ID)
[    0.000000] SoC Type: RTL8380
That should always be correct, unless there is something we are missing.

Cheers,
   Birger
Luiz Angelo Daros de Luca July 18, 2022, 3:01 a.m. UTC | #5
Em dom., 17 de jul. de 2022 06:55, Paul Fertser <fercerpav@gmail.com> escreveu:
>
> On Sat, Jul 16, 2022 at 11:32:52PM -0300, Luiz Angelo Daros de Luca wrote:
> > It uses SOC := rtl8380 while all existing dgs-1210 F1 variants use
> > rtl8382 (except for the pending -52 variant). The commit didn't
> > mention why that happened.
>
> It's just cosmetic AFAICT but the datasheet clearly states that the
> SoC used for <=18 ports switches is called RTL8380.

It seems we have multiple SoCs for DGS-1210:

1) RTL8380 for -10
2) RTL8382 for -28
3) RTL8393 for -52

It is not the best approach to include a shared config and redefine a
property. The dgs-1210 definition should go in Makefile (we also have
an rtl8393) with only common properties and SoC should be defined by
each device. I was preparing something like that for -52 here:

https://github.com/openwrt/openwrt/pull/10227/commits/8e5b473bc1f7f1a8ad796e8b8cc7587fedbad9f5

>
> > I'm not sure which one is correct here. However, if it is really a
> > different SoC and with what we currently know, we could create a
> > generic rtl83xx_d-link_dgs-1210.dtsi as the -52 variant uses even a
> > more different SoC (rtl8393). They share a lot of stuff like flash
> > layout and gpios (and the vendor firmware even uses the same image). I
> > could do some generic and family review but I only have -28 and -52
> > variants.
>
> I only have access to non-PoE dgs-1210-10 R1 board.
>
> You say they share GPIO layout, does it mean you currently can't fully
> handle SFP ports on your hardware but my patches make it work?

I believe the same setup might work for any dgs-1210 F series. It
makes sense as d-link uses a common firmware for Fx-Series. However, I
didn't test SFP patches in my -28 because I lost all my 1g modules a
couple years ago and 10g modules don't work. Anyway, the -52 variant
does seem to share the same GPIOs, even using a different SoC. Besides
reboot, reset button and led, I could only test the pin that detects
the module presence. All of them match those same pins used by other
variantes. I would expect that the remaining SFP pins are also at the
same positions. I only tried SFP patches to fix (it didn't) the combo
ports initialization in the -52 model, although they might touch
another part of the driver not used by that device (as it uses
different SoC).


>
>
> --
> Be free, use free (http://www.gnu.org/philosophy/free-sw.html) software!
> mailto:fercerpav@gmail.com