Repository navigation
Conversation
|
Please explain in the commit message, why this commit is required? what does it correct/fix? Please add more info on the device into the commit (specs, how to flash the device etc.): You need to adjust your local git config in order for the CI to pass "Test Formalities". Though this only affects the older commit 2ddf19e instructions in-case you need them: If your git config is wrong: Alternatively run this as global instead of local, if you want to change the config for everything and not just your local fork of openwrt. (this repo) git config --list shows every config entry (you can limit it further with parameters like --local or --global |
This device needs tx/rx be swapped to make the 8x RTL8261N phys work. see: d5b8207#diff-8e20253e585ff25e2c12c86ebaee6d99c4802091609d3dd81ec4b7789a4637f6R452-R482 |
5e86315 to
4bd5ee0
Compare
Added some specs. I'm yet to make a guide on how to exploit tftp update in TP-LINK BOOTUTIL. Official updates and signed and encrypted. |
4bd5ee0 to
7c61fd0
Compare
|
poarlity > polarity (commit title) edit: and the 2nd the device commit still has a few copy&paste issues from the example, I linked (it says xikestore at the beginning for example) what is "after unlocking"? (regarding UART speeds) |
Is this something that affects all |
This is subject to the individual board design. Though I'm not an expert on this, afaik it deals with signal integrity/quality. In Realtek SDK this can also be configured in the hardware profile. So it's good to have that configurable for us too. |
All other rtl930x switch uses the faster 115200 baud |
| }; | ||
|
|
||
| ðernet0 { | ||
| nvmem-cells = <&factory_macaddr>; |
There was a problem hiding this comment.
| nvmem-cells = <&factory_macaddr>; | |
| nvmem-cells = <&factory_macaddr 0>; |
And you are missing the same for the switch ports (just with the correct offsets instead of 0)
There was a problem hiding this comment.
it only has one mac, just like on other tp-link switches. they aren't missing.
There was a problem hiding this comment.
looking at other tp-link switches, they are done like this. are you sure this is not correct this way?
There was a problem hiding this comment.
The default in OpenWrt seems to be that every switch port gets its own MAC address, and this is usually calculated (increment by 1) from the MAC that is assigned to the switch on the label, in U-Boot env or some different vendor data partition. So far, this is done with the 02_network script in board files but we may slowly move to assign it via the DT.
I'm not arguing on that. But in this concrete case, you define the following in the DT.
nvmem-layout {
compatible = "fixed-layout";
#address-cells = <1>;
#size-cells = <1>;
factory_macaddr: macaddr@fdff4 {
reg = <0xfdff4 0x6>;
};
};
And since you have #address-cells = <1> and #size-cells = <1>, you need to define it like @ecsv suggested.
There was a problem hiding this comment.
i see. I got it from here: https://github.com/openwrt/openwrt/blob/main/target/linux/realtek/dts/rtl8393_tplink_sg2452p-v4.dts#L258
should we fix it here too?
I think this was already committed directly to the driver. |
That's on the other side of the bus. Here we swap on the cpu side, not the phy. |
a576bd4 to
f1f3f3f
Compare
| pinctrl-0 = <&pinmux_disable_sys_led>; | ||
| pinctrl-1 = <&pinmux_enable_usb_led>; | ||
|
|
||
| led_master_green: led-master-green { |
There was a problem hiding this comment.
led_master_green is still defined as label but not used anywhere.
5ad173c to
1e26d5a
Compare
6efa35a to
4754c97
Compare
Adds swap_tx_polarity / swap_rx_polarity to the rtl930x serdes dt. Signed-off-by: Balázs Triszka <[email protected]>
TP-Link TL-ST5008 is a 8 ports Multi-Gig switch, based on RTL9303. Specifications: - SoC : Realtek RTL9303 - RAM : DDR3 512 MiB - Flash : SPI-NOR 32 MiB (XMC XM25QH256B) - Ethernet : 8x 1/2.5/10 Gbps (8x Realtek RTL8261N RJ45) - LEDs/Keys (GPIO) : green for 10Gbps on left/green-amber for 1/2.5Gbps on the right - UART : "Console" port on the front panel - type : USB - connector : USB-C - settings : 38400 8N1 / 115200 8N1 after installing the patched uboot - Power : 100-240 V (IEC C13) To run openwrt you need to install a patched uboot. Luckily there's a bug in the uboot tftp update implementation that can be exploited to do just that. Will be documented on the wiki. Signed-off-by: Balázs Triszka <[email protected]>
|
Before I approve, I'd like to see the mentioned wiki documentation for installation and patching U-boot. I'm rather in favor of having instructions in the commit message so they can't get lost but if it's too much, it probably better fits into the wiki. |
I created the pages on wiki, but didn't do the how-to yet. |
the pr: #20392 |
|
@jonasjelonek Should I add code that builds a version that directly flashes both the bootloader and system when loaded in bootutil? |
|
I'm not in the position to decide this but I can give my opinion: Afaik it's rather disregarded having to run something which auto-magically does a lot of things, especially reflashing the bootloader. I haven't seen a guide yet if you published it somewhere but I guess most of the steps can be done manually? Then I'd rather have a clear, small-step HowTo where I actually can see what I'm doing to my device. And most importantly, I can stop at every step and add additional steps, e.g. dumping the bootloader before it's flashed. |
I didn't write any guides yet, as even the pr that needs to be merged in first isn't in yet.
IMO. there's no need for dumping here. Let me explain: To install the patched uboot you have to select firmware update in BOOTUTIL, so it makes since to update it all in one go. At least it does for me. However this update is a funky one. It doesn't pass the signature checks, it gains code execution due to a bug and flashes itself. Also it only work on that 1.0.1 firmware. |
|
Personally, I prefer having a small guide telling me:
In a wiki you can offer more things for people preferring other ways. But this is all optional and therefore to be put in the wiki. For the device support here, it's a no-go to include any code in a binary/image that auto-magically flashes bootloader, firmware and possibly more things within one run. At least in my opinion and I've seen similar opinions in several discussions. For example, Banana Pi R3/R4 and FritzBox 7530 involve some bootloader flashing too. And they provide detailed guides to go through this so that almost nothing can accidentally go wrong. |
|
@balika011 I've lost track of the SerDes swapping stuff here with the RTL8261 driver... In #20648, I submitted my version of this, done in the new PCS driver and also for RTL931X. You may drop the commit from your PR then. |
|
The @jonasjelonek PR has been merged: |
|
@balika011 this needs to be rebased on main for the the current RTL8261N support in the main branch. |
openwrt-ai
left a comment
There was a problem hiding this comment.
Commit checks
28596116"realtek: rtl930x: add tx/rx polarity swap support" — the change itself matches the subject, but the commit is obsolete against currentmain: it adds a parallel polarity-swap implementation in the old DSA driver underfiles-6.12/, whilemain(now on kernel 6.18,files-6.18/) already gained this in the PCS driver via #20648. The directory it touches no longer exists onmain. Recommend dropping this commit — see the inline comment for details.7645a9a0"realtek: rtl930x: add TP-Link TL-ST5008" — diff matches the subject, but the commit message is missing the Flash-instructions and MAC-address-layout sections expected for new device support (inline comment onrtl930x.mk).
The PR also currently does not merge cleanly (mergeable_state: dirty) and is based on a main snapshot from January; a rebase onto current main is needed, after which the DTS polarity properties should switch to tx-polarity/rx-polarity and the driver commit can be dropped.
Generated by Claude Code
| } | ||
|
|
||
| if (pcs_node) { | ||
| priv->ports[pn].swap_rx_polarity = of_property_read_bool(pcs_node, "realtek,pnswap-rx"); |
There was a problem hiding this comment.
This entire commit (realtek: rtl930x: add tx/rx polarity swap support) appears to be obsolete against current main and should likely be dropped:
- SerDes tx/rx polarity swap was already implemented upstream in the new PCS driver via #20648 (merged) — see
pcs-rtl-otto.cpolarity handling. The maintainer explicitly asked for this commit to be dropped (PR comment 3488222469). - This commit modifies
target/linux/realtek/files-6.12/..., but the realtek target has moved to kernel 6.18 —files-6.12/no longer exists onmain(it is nowfiles-6.18/). Asecsvnoted in the most recent PR comment, the PR needs a rebase onto currentmain.
After rebasing, the polarity swap is configured purely via DTS (tx-polarity/rx-polarity, see the comment on the .dts file), so no driver change is needed in this PR.
Generated by Claude Code
| &serdes2 { | ||
| realtek,pnswap-tx; |
There was a problem hiding this comment.
The realtek,pnswap-tx / realtek,pnswap-rx boolean properties used on &serdes2..&serdes9 only work together with this PR's files-6.12 driver change. Current main (kernel 6.18, PCS driver from #20648) instead expects value-based tx-polarity / rx-polarity properties using the PHY_POL_INVERT / PHY_POL_NORMAL constants — see e.g. rtl9313_zyxel_xs1930-12f.dts and rtl9311_linksys_lgs352c.dts.
After rebasing onto main, the per-port realtek,pnswap-tx; becomes tx-polarity = <PHY_POL_INVERT>; and realtek,pnswap-rx; becomes rx-polarity = <PHY_POL_INVERT>;, which removes the need for the separate driver commit.
Generated by Claude Code
| endef | ||
| TARGET_DEVICES += tplink_tl-st1008f-v2 | ||
|
|
||
| define Device/tplink_tl-st5008 |
There was a problem hiding this comment.
The new-device commit message for tplink_tl-st5008 is missing two of the sections OpenWrt expects for new device support:
- Flash instructions — the message only says "you need to install a patched uboot ... Will be documented on the wiki." A reviewer (and a user) cannot flash the device from the commit message. It needs at least one fully-described install path with verbatim steps: which image to use, how to get into the flashable state (BOOTUTIL menu entry, TFTP server IP, etc.), and reverting to stock. This is also what
jonasjelonekasked for in PR comments 3389370700 / 3453433535. - MAC address layout — there is no section describing where the MAC comes from. The DTS reads it from
factory_macaddr(theparapartition at offset0xfdff4); state this explicitly, one line per interface, usingxx:xx:xxfor the unit-specific bytes.
The hardware-specification section is present and well-formed.
Generated by Claude Code
openwrt-ai
left a comment
There was a problem hiding this comment.
Commit checks
2ddf19e"realtek: rtl930x: add tx/rx polarity swap support" — this commit is obsolete against currentmain. It modifiestarget/linux/realtek/files-6.12/..., but the realtek target has moved to kernel 6.18 (files-6.18/), and SerDes pn-swap support already landed via PR #20648 in the rewritten PCS driver (pcs-rtl-otto.c), which consumes the standard upstreamtx-polarity/rx-polarityDT properties. The maintainer explicitly asked for this commit to be dropped. The PR needs a rebase ontomain, after which the driver commit can be removed and the&serdesNDTS overrides reworked to the upstream polarity bindings.
See inline comments for details on the affected files. Note: realtek: rtl930x: add TP-Link TL-ST5008 is also missing the Flash instructions and MAC address layout sections required for new device support — see the inline comment on rtl930x.mk.
Generated by Claude Code
| return -ENODEV; | ||
| } | ||
| } | ||
|
|
There was a problem hiding this comment.
This added blank line contains trailing whitespace (two tab characters), which will be flagged by checkpatch and the "Test Formalities" CI step. Make it an empty line.
Generated by Claude Code
| if (pcs_node) { | ||
| priv->ports[pn].swap_rx_polarity = of_property_read_bool(pcs_node, "realtek,pnswap-rx"); | ||
| priv->ports[pn].swap_tx_polarity = of_property_read_bool(pcs_node, "realtek,pnswap-tx"); | ||
| } else { | ||
| priv->ports[pn].swap_rx_polarity = false; | ||
| priv->ports[pn].swap_tx_polarity = false; | ||
| } | ||
|
|
There was a problem hiding this comment.
This whole commit modifies target/linux/realtek/files-6.12/..., but main has moved the realtek target to kernel 6.18 — the driver tree is now target/linux/realtek/files-6.18/ and files-6.12 no longer exists. Additionally, SerDes pn-swap support has already landed on main (PR #20648) in the rewritten PCS driver pcs-rtl-otto.c, via rtpcs_sds_config_polarity() which reads the standard upstream tx-polarity/rx-polarity DT properties (phy_get_manual_tx_polarity/phy_get_manual_rx_polarity), not custom realtek,pnswap-* properties.
As @jonasjelonek noted in a PR comment and @ecsv in another, this commit should be dropped and the PR rebased onto current main. The &serdesN { realtek,pnswap-tx; } blocks in the new DTS need to be reworked to the upstream tx-polarity/rx-polarity bindings the merged PCS driver consumes.
Generated by Claude Code
| &serdes2 { | ||
| realtek,pnswap-tx; | ||
| }; | ||
|
|
||
| &serdes3 { | ||
| realtek,pnswap-rx; | ||
| }; | ||
|
|
||
| &serdes4 { | ||
| realtek,pnswap-tx; | ||
| }; | ||
|
|
||
| &serdes5 { | ||
| realtek,pnswap-rx; | ||
| }; | ||
|
|
||
| &serdes6 { | ||
| realtek,pnswap-tx; | ||
| }; | ||
|
|
||
| &serdes7 { | ||
| realtek,pnswap-rx; | ||
| }; | ||
|
|
||
| &serdes8 { | ||
| realtek,pnswap-tx; | ||
| }; | ||
|
|
||
| &serdes9 { | ||
| realtek,pnswap-rx; | ||
| }; |
There was a problem hiding this comment.
The custom realtek,pnswap-tx / realtek,pnswap-rx properties are introduced by commit 1 of this PR, which is now obsolete (see the comment on common.c). The merged PCS driver on main reads polarity from the standard upstream tx-polarity/rx-polarity properties via rtpcs_sds_config_polarity(). After rebasing onto main, these &serdesN overrides need to be converted to that binding.
Generated by Claude Code
|
@ecsv: The @balika011 mailbox is full :/ |
To run openwrt you need to install a patched uboot.
Luckily there's a bug in the uboot tftp update implementation that can be exploited to do just that.
Will be documented on the wiki.
Depends: #20450