[PATCH 00/13] Switch realtek target to upstream platform

Birger Koblitz mail at birger-koblitz.de
Wed Dec 8 23:19:05 PST 2021


Hi Sander and Hiroshi,

great work! A very big step to clean up this platform. Because this changes
the fundamentals of the target I have some suggestions and questions.

There are actually 4 RTL platforms which we now know how to support and you
are taking care of the first 3 in your patch to make use of the generic MIPS
platform:
 - RTL8380: 4Kec, single core
 - RTL8390: 34Kc, VSMP, MIPS timer works
 - RTL9300: 34Kc, VSMP, MIPS timer broken, but RTL9300 timer with SMP support
 - RTL9310: InterAptiv, SMP, GIC timer

I would suggest to use sub-targets for these platforms with optimized
compiler settings and SMP/single processor selected correctly for each,
see https://github.com/BrainSlayer/pie/commits/pie-5.10-rtl9313

You already set up SMP build support in the config, but don't activate it.
However with 2 small patches to the IRQ controller
https://github.com/BrainSlayer/pie/commit/61860e04b89fa4c76a0e41af3e5d3480dabdf63c#diff-8b9c10bdba2282c6926cb9f7207ac869b011e248a6171f8132e79e1807c9f12a
and the Ethernet driver
https://github.com/BrainSlayer/pie/commit/cdbc6598a1e69f74aa5fbaac9c896595a06d21f4#diff-2adae55db41693c452fcc10fb3925ff8c5a38760243f0b77bbd54acc75170d0a
SMP can be enabled on the RTL8390 and the 9310 platform.

I am a bit worried of using the generic MIPS platform for the RTL9300.
The SoC has a broken R4K Clock Event Interrupt and requires the RTL9300
timer to work plus SMP support for the IRQ controller. There are only
2 examples in Linux which have such a combination of dedicated Timer
for SMP support and IRQ controller, the Sibyte SB1250 and the BCM1480 platforms.
Both do not use the generic MIPS platform since they require lots of
specific SMP code. I would like to understand how this would be supported
with the generic MIPS platform, because I don't want to go there and
then back again.

Cheers,
  Birger


On 08.12.21 22:42, Sander Vanheule wrote:
> To reduce the maintenance burden of the realtek target in OpenWrt, Hiroshi and
> I have worked on these patches to switch to the upstream platform. Some
> downstream code is maintained, primarily for compatibility with the current
> downstream-only networking drivers. There should be no functional changes for
> users, although there will be some bootlog differences.
> 
> We hope these patches will make it easier for developers to write upstream-
> compatible code on OpenWrt. Vice versa, it should also be easier with these
> changes to backport drivers and patches that were upstreamed.
> 
> Sander Vanheule (13):
>   realtek: add missing gpio0 pinctrl properties
>   realtek: add sys-led disable pinctrl for rtl930x
>   realtek: remove hardcoded sys-led configurations
>   realtek: use fixed-clock as CPU clock
>   realtek: include io.h in mach-rtl83xx.h
>   realtek: update mach-rtl83xx.h includes
>   realtek: backport upstream platform
>   realtek: add board file for MACH_REALTEK_RTL
>   realtek: update driver platform dependencies
>   realtek: switch target to upstream platform
>   realtek: drop downstream platform
>   realtek: modernise devicetree console setup
>   realtek: use correct compatible for rtl930x SoCs
> 
>  target/linux/realtek/config-5.10              |  36 +++-
>  .../dts-5.10/rtl8380_netgear_gigabit.dtsi     |   3 +
>  .../dts-5.10/rtl8382_d-link_dgs-1210.dtsi     |   3 +
>  .../dts-5.10/rtl8382_inaba_aml2-17gp.dts      |   3 +
>  target/linux/realtek/dts-5.10/rtl838x.dtsi    |  16 +-
>  target/linux/realtek/dts-5.10/rtl930x.dtsi    |  26 ++-
>  .../arch/mips/generic/board-realtek.c         | 145 ++++++++++++++
>  .../mips/include/asm/mach-rtl838x/ioremap.h   |  29 ---
>  .../include/asm/mach-rtl838x/mach-rtl83xx.h   |   1 +
>  .../files-5.10/arch/mips/rtl838x/Makefile     |   5 -
>  .../files-5.10/arch/mips/rtl838x/Platform     |   5 -
>  .../files-5.10/arch/mips/rtl838x/prom.c       | 183 ------------------
>  .../files-5.10/arch/mips/rtl838x/setup.c      | 116 -----------
>  .../drivers/clocksource/timer-rtl9300.c       |   2 +-
>  .../drivers/net/dsa/rtl83xx/Kconfig           |   2 +-
>  target/linux/realtek/image/Makefile           |   4 +-
>  ...-add-realtek-rtl838x-rtl839x-support.patch |  45 +++++
>  .../300-mips-add-rtl838x-platform.patch       |  39 ----
>  .../301-gpio-add-rtl8231-driver.patch         |   2 +-
>  ...e-dependencies-for-gpio-realtek-otto.patch |  13 --
>  ...pdate-dependency-for-spi-realtek-rtl.patch |  11 --
>  ...pdate-dependency-for-irq-realtek-rtl.patch |   8 -
>  .../306-gpio-add-legacy-rtl838x-driver.patch  |   2 +-
>  ...date-dependency-for-realtek-otto-wdt.patch |  15 --
>  ...-in-board-realtek-for-generic-kernel.patch |   9 +
>  ...net-add-support-for-rtl838x-ethernet.patch |   2 +-
>  .../patches-5.10/705-add-rtl-phy.patch        |   2 +-
>  27 files changed, 285 insertions(+), 442 deletions(-)
>  create mode 100644 target/linux/realtek/files-5.10/arch/mips/generic/board-realtek.c
>  delete mode 100644 target/linux/realtek/files-5.10/arch/mips/include/asm/mach-rtl838x/ioremap.h
>  delete mode 100644 target/linux/realtek/files-5.10/arch/mips/rtl838x/Makefile
>  delete mode 100644 target/linux/realtek/files-5.10/arch/mips/rtl838x/Platform
>  delete mode 100644 target/linux/realtek/files-5.10/arch/mips/rtl838x/prom.c
>  delete mode 100644 target/linux/realtek/files-5.10/arch/mips/rtl838x/setup.c
>  create mode 100644 target/linux/realtek/patches-5.10/009-5.12-MIPS-add-realtek-rtl838x-rtl839x-support.patch
>  delete mode 100644 target/linux/realtek/patches-5.10/300-mips-add-rtl838x-platform.patch
>  delete mode 100644 target/linux/realtek/patches-5.10/303-gpio-update-dependencies-for-gpio-realtek-otto.patch
>  delete mode 100644 target/linux/realtek/patches-5.10/304-spi-update-dependency-for-spi-realtek-rtl.patch
>  delete mode 100644 target/linux/realtek/patches-5.10/305-irqchip-update-dependency-for-irq-realtek-rtl.patch
>  delete mode 100644 target/linux/realtek/patches-5.10/307-wdt-update-dependency-for-realtek-otto-wdt.patch
>  create mode 100644 target/linux/realtek/patches-5.10/309-mips-built-in-board-realtek-for-generic-kernel.patch
> 



More information about the openwrt-devel mailing list