Devicetree
 help / color / mirror / Atom feed
From: Conor Dooley <conor@kernel.org>
To: Jonas Jelonek <jelonek.jonas@gmail.com>
Cc: "Oleksij Rempel" <o.rempel@pengutronix.de>,
	"Kory Maincent" <kory.maincent@bootlin.com>,
	"Andrew Lunn" <andrew+netdev@lunn.ch>,
	"David S . Miller" <davem@davemloft.net>,
	"Eric Dumazet" <edumazet@google.com>,
	"Jakub Kicinski" <kuba@kernel.org>,
	"Paolo Abeni" <pabeni@redhat.com>,
	"Rob Herring" <robh@kernel.org>,
	"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
	"Conor Dooley" <conor+dt@kernel.org>,
	netdev@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	"Daniel Golle" <daniel@makrotopia.org>,
	"Bjørn Mork" <bjorn@mork.no>
Subject: Re: [PATCH net-next v5 1/4] dt-bindings: net: pse-pd: add bindings for Realtek/Broadcom PSE MCU
Date: Tue, 7 Jul 2026 18:25:33 +0100	[thread overview]
Message-ID: <20260707-dove-fretful-e3c8e237f1eb@spud> (raw)
In-Reply-To: <c19e563a-8931-4f31-b05a-ff8def4a5161@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 7547 bytes --]

On Mon, Jul 06, 2026 at 10:30:00PM +0200, Jonas Jelonek wrote:
> Hi Conor,
> 
> On 06.07.26 19:35, Conor Dooley wrote:
> > On Mon, Jul 06, 2026 at 11:24:21AM +0000, Jonas Jelonek wrote:
> >> [...]
> >> +
> >> +description: |
> >> +  Microcontroller (MCU) that fronts the PSE hardware on switches using
> >> +  Realtek (RTL8238B, RTL8239, RTL8239C) or Broadcom (BCM59111, BCM59121)
> >> +  PSE chips. The MCU exposes a small message-based protocol over either
> >> +  I2C/SMBus or UART; the actual PSE silicon is not accessed directly. The
> >> +  Realtek and Broadcom variants share this device tree contract but use
> >> +  different protocol opcodes, selected by the compatible.
> >> +
> >> +  The compatible identifies the PSE-MCU protocol dialect, not a specific
> >> +  part. The device here is the MCU: it presents a stable message protocol
> >> +  documented by Realtek, with the PSE silicon behind it - Broadcom on
> >> +  older boards, Realtek on newer - detected at runtime and not described
> >> +  here. The MCU's own silicon is general-purpose and varies across
> >> +  boards, so the 'realtek' vendor prefix names the protocol front-end
> >> +  (following the google,cros-ec pattern); the '-rtk'/'-brcm' suffix
> >> +  selects the Realtek or Broadcom dialect.
> >> +
> >> +  A single compatible per dialect covers both the I2C/SMBus and UART
> >> +  attachments: the wire protocol is identical across them and the
> >> +  transport is already expressed by the node's parent bus, so it is not
> >> +  encoded in the compatible. Transport-specific properties differ
> >> +  accordingly - the I2C attachment carries 'reg' (and, for Realtek,
> >> +  'realtek,i2c-protocol'), while the UART attachment carries the serial
> >> +  peripheral properties such as 'current-speed'.
> > I'm not really convinced by the arguments here.
> >
> > If the switch vendors are running different software on their MCUs to
> > the point that they behave differently, then yes it makes sense to have
> > different compatibles.
> >
> > The first thing I don't understand is why realtek is considered the
> > main vendor here? Is it their MCU that broadcom are re-using with some
> > protocol tweaks?
> 
> The protocol and firmware on the MCU, most likely the whole "solution",
> is from Realtek. The setup is always the same on most Realtek-based
> switches (saying most because a few counterexamples use completely
> different setups, not even Broadcom or Realtek PSE silicon). The host
> interface is always the same (except for I2C vs. SMBus vs. UART, which
> is likely just a config in the MCU firmware). Therefore "realtek," is the
> right prefix for all of these.
> 
> Broadcom is not really involved here except for their PSE silicon being
> used. Maybe Realtek modeled their MCU host protocol after the one that
> Broadcom PSE silicon uses as host interface, but this is rather guessing.
> 
> Maybe a historical view might help. Older RTL83xx-based switches with
> PoE shipped with this setup using Broadcom PSE silicon. From what I know,
> at this point Realtek didn't design their own PSE silicon. They used the
> Broadcom silicon, put a MCU as a manager in front of it with their firmware
> and a host protocol based on what Broadcom PSE itself uses. At some
> point Realtek started to design their own PSE silicon which then was
> used in newer switches instead of Broadcom PSE.

Right, in that case it does make sense to use a realtek prefix, since
the software and mcu solution is all theirs.

> > If it is, then having the vendor as a suffix like wheel reinvention to
> > me, and if the MCU and/or protocol aren't something that broadcom
> > borrowed from realtek then having a realtek vendor prefix is strange
> > altogether. The mention of old boards being broadcom while the protocol
> > is documented by realtek is confusing me.
> >
> > Either way, encoding the vendor without using the vendor prefix seems
> > very odd me to.
> 
> I'm open for suggestions here. This has been the hardest issue in this
> whole series, to be honest. It basically boils down to differentiating
> these two protocol generations. I cannot say why Realtek did that on
> the transition to their own PSE silicon but vendors doing weird stuff
> shouldn't be surprising and this is the reality now.
> 
> Is something like "-gen1" and "-gen2" better, with a clear description
> somewhere in the bindings how that maps to actual device setups
> (gen1 = older/MCU fronts Broadcom PSE, gen2 = newer/MCU fronts
> Realtek PSE)? This would drop Broadcom and the confusion around it
> here. I admit, using a vendor suffix isn't great and still attributes
> Broadcom too much in this context here.
> 
> > Secondly, the compatibles you do provide seem too generic. Is it really
> > possible for a given board to use smbus AND i2c, or do specific boards
> > only ever use i2c OR smbus (or uart for that matter).
> > I find it more believable that a board would support i2c and uart than
> > supporting both i2c and smbus fwiw.
> 
> Only one at a time is used, but not combined in any way. All switches
> I've seen so far always have a single management MCU for PoE, not
> multiple. Thus, only a single variant is used. Which variant is used
> likely depends on the board vendor which then tells Realtek "I want your
> PoE solution, I can attach it via (I2C/SMBus/UART)". At least for UART vs.
> I2C/SMBus there are sometimes valid reasons to use UART over the other.
> 
> There is only a single switch (from Linksys) where the MCU expects raw
> I2C messages. SMBus transaction fail actually. But I don't see the reason
> why Linksys did it that way. The reason can't be that the MCU is attached
> on a bit-banged I2C because another switch uses SMBus transaction on
> a bit-banged I2C.

Reading this, it feels like you "should" have compatibles that uniquely
identify the protocol used. Looking at the devices below, it seems like it
would be possible to use compatibles based on the switches themselves, e.g.
zyxel,xs1930-pse etc. If there are other devices that use the same
protocol, they could fall back to the ones below.

It'd be good to have the net developers weigh in though, as to whether
using compatibles based on the switches is suitable.

> > Can you provide a link to the actual devices somewhere? It is
> > completely non-obvious to me what the binding actually represents.
> 
> I hope I get your request correctly. Find some links to devices and/or

Ye, this is what I was looking for, thanks.

Conor.

> to my commits wiring that up in actual DTS (WIP, hashes may change).
> 
> Zyxel XMG1915-10EP (UART with Realtek PSE silicon):
> https://svanheule.net/switches/xmg1915-10ep
> https://github.com/jonasjelonek/openwrt/commit/d173e64730a511e04b68271289be23ae4e98a02f
> 
> Zyxel XS1930-12HP (SMBus with Realtek PSE silicon):
> https://www.zyxel.com/de/de/products/switch/10-12-port-10g-multi-gigabit-lite-l3-smart-managed-switch-xs1930-series
> https://github.com/jonasjelonek/openwrt/commit/74339c9a002032fc204b6b1fe07af259d8f51787
> 
> Zyxel GS1900-10HPv1 (UART with Broadcom PSE silicon):
> https://svanheule.net/switches/gs1900-10hp
> 
> Linksys LGS328MPC (I2C raw, not SMBus, with Realtek PSE silicon):
> https://support.linksys.com/kb/article/5133-en/
> 
> (mostly Zyxel devices but that's just the main devices I work with)
> 
> > Cheers,
> > Conor.
> >
> >
> >> [...]
> >>
> 
> Best regards,
> Jonas

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

  reply	other threads:[~2026-07-07 17:25 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-06 11:24 [PATCH net-next v5 0/4] net: pse-pd: add Realtek/Broadcom PSE MCU support Jonas Jelonek
2026-07-06 11:24 ` [PATCH net-next v5 1/4] dt-bindings: net: pse-pd: add bindings for Realtek/Broadcom PSE MCU Jonas Jelonek
2026-07-06 17:35   ` Conor Dooley
2026-07-06 20:30     ` Jonas Jelonek
2026-07-07 17:25       ` Conor Dooley [this message]
2026-07-07 20:50         ` Jonas Jelonek
2026-07-08 16:56           ` Conor Dooley
2026-07-08 19:44             ` Jonas Jelonek
2026-07-06 11:24 ` [PATCH net-next v5 2/4] net: pse-pd: add Realtek/Broadcom PSE MCU core Jonas Jelonek
2026-07-06 17:12   ` Uwe Kleine-König
2026-07-07 12:00     ` Jonas Jelonek
2026-07-06 11:24 ` [PATCH net-next v5 3/4] net: pse-pd: realtek-pse-mcu: add I2C transport Jonas Jelonek
2026-07-07 11:24   ` sashiko-bot
2026-07-06 11:24 ` [PATCH net-next v5 4/4] net: pse-pd: realtek-pse-mcu: add UART transport Jonas Jelonek

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=20260707-dove-fretful-e3c8e237f1eb@spud \
    --to=conor@kernel.org \
    --cc=andrew+netdev@lunn.ch \
    --cc=bjorn@mork.no \
    --cc=conor+dt@kernel.org \
    --cc=daniel@makrotopia.org \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=edumazet@google.com \
    --cc=jelonek.jonas@gmail.com \
    --cc=kory.maincent@bootlin.com \
    --cc=krzk+dt@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=o.rempel@pengutronix.de \
    --cc=pabeni@redhat.com \
    --cc=robh@kernel.org \
    /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