====== Current status ====== ===== Kernel support ===== The platform is available upstream as a `MIPS_GENERIC` based MIPS architecture. This allows leveraging existing MIPS, DT,... kernel frameworks. Only some basic CPU peripherals are supported. ==== OpenWrt ==== In OpenWrt, the platform is still a custom MIPS architecture. More features are supported, but most code needs to be cleaned up or reworked before it can be submitted upstream. Discussion at [[https://forum.openwrt.org/t/support-for-rtl838x-based-managed-switches/57875/]]. Bugs can be reported on the [[https://github.com/openwrt/openwrt/issues | OpenWrt GitHub]] ==== Merged upstream ==== === REALTEK_RTL / Realtek Otto === * base system: merged for 5.12-rc1 * [[https://lore.kernel.org/all/?q=rtl-intc|IRQ]] driver: merged for 5.12-rc1 * IRQ fixes in 5.17-rc2, 5.16.5, 5.15.19: [[https://lore.kernel.org/all/4b4936606480265db47df152f00bc2ed46340599.1641739718.git.sander@svanheule.net/ | map control data to virq]], [[https://lore.kernel.org/all/177b920aa8d8610615692d0e657e509f363c85ca.1641739718.git.sander@svanheule.net/ | fix off-by-one in routing]] * IRQ handling improvement in 5.17-rc2, 5.16.7, 5.15.24: [[https://lore.kernel.org/all/5082ad3cb8b4eedf55075561b93eff6570299fe1.1641739718.git.sander@svanheule.net/ | clear all pending interrupts]] * SPI driver: merged for 5.12-rc1 * [[https://lore.kernel.org/linux-gpio/?q=otto|built-in GPIO]] driver: merged for 5.13 [[https://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux.git/log/?h=f0f7d662e8514169c90d3d84cd6df773b2983088|start of series]] * [[https://lore.kernel.org/all/20211028085243.34360-1-sander@svanheule.net/|IRQ fix]] in 5.16. Backported to [[https://lore.kernel.org/all/163726325011777@kroah.com/|5.15.3]], 5.14 * RTL930x and RTL931x [[https://lore.kernel.org/all/cover.1649533972.git.sander@svanheule.net/|merged]] for 5.19, starting at [[https://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux.git/commit?id=06a6a774f6b8ed94aefcf60caa56fe92d3a18e17|06a6a774f6b8]] * I/O fixes [[https://lore.kernel.org/linux-gpio/20220807192114.44890-1-sander@svanheule.net/|merged]] for 6.0 and 5.19.8 * [[https://lore.kernel.org/linux-watchdog/?q=otto|Watchdog]], doubles as restart driver: merged for 5.17, [[https://lore.kernel.org/all/cover.1637252610.git.sander@svanheule.net/T/|v4]], [[https://lore.kernel.org/all/84d873d7dd375cd2392f89fa6bd9e0fe5dda4e1c.1656356377.git.sander@svanheule.net/|RTL9310 support]] merged for 6.0 === Generic upstream changes === * cpumask bug exposed by the GPIO driver: [[https://lore.kernel.org/all/cover.1659077534.git.sander@svanheule.net/|part 1]] [[https://lore.kernel.org/all/cover.1661234636.git.sander@svanheule.net/|part 2]] ==== Under review ==== * Crypto driver: [[https://lore.kernel.org/linux-crypto/20221013184026.63826-1-markus.stockhausen@gmx.de/|v1]], [[https://lore.kernel.org/linux-crypto/20221206192037.608808-1-markus.stockhausen@gmx.de/|v2]], [[https://lore.kernel.org/linux-crypto/20221231162525.416709-1-markus.stockhausen@gmx.de/|v3]] * RTL8231 GPIO driver (stalled): [[https://lore.kernel.org/linux-gpio/cover.1617914861.git.sander@svanheule.net/T/|RFC]], [[https://lore.kernel.org/linux-gpio/cover.1620735871.git.sander@svanheule.net/|MFD v1, v2, v3, v4]], [[https://lore.kernel.org/lkml/cover.1623532208.git.sander@svanheule.net/|MFD v5]] [[https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap.git/commit/?id=1f89d2fe16072a74b34bdb895160910091427891|MDIO regmap interface]] merged for 5.14 ==== Work-in-progress ==== * SOC/chipid driver (svanheule) * sys-led driver (svanheule) * port led driver (svanheule) ==== Help needed ==== * Reset driver * Reset bits for various subsystems in the SoCs are available, in different places per series. Instead of drivers toggling these common registers, Linux reset subsystem driver would make sense. * [[network_driver_refactor | Network driver rework ]] * Should probably be implemented as an MFD, with the MFD core driver unlocking the protected registers. * Need MDIO, DSA, phy driver etc. * Probably best to port bit by bit from OpenWrt to staging, to get extra exposure. After things mature enough, drivers can be moved to the relevant subsystems. Note, that a lot of merged drivers need some love and some refactoring, both upstream and in the openwrt repositories ... ==== Kernel development setup ==== * Get buildroot from [[https://buildroot.org]] * Clone a kernel git repo from [[git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git]] * Get {{wiki:devconfig.tgz}}, and move the config files there to `.config` in the two directories above. In the Linux ''.config'' file, change `CONFIG_INITRAMFS_SOURCE` to the appropriate path for your buildroot. Drop the `build` script in your Linux directory. * Do a ''make'' in your buildroot directory, and ''./build'' in your Linux directory. It drops the resulting image in ''/tftp/img'', adjust as needed. ==== Helpful links ==== * [[https://svanheule.net/realtek/ | Sander's switch core register browser]] * Some datasheets are [[https://github.com/libc0607/Realtek_switch_hacking/tree/files | here]] ===== OpenWrt ===== === RTL838x: complete === RX/TX by the Ethernet driver works, including QoS and prioritization queues, all L2 functionality is implemented, all PHYs are supported, complete support for SFP cages and LEDs available === RTL839x: mostly complete === RX/TX by the Ethernet driver works, including QoS and prioritization queues, all L2 functionality is implemented. Support for the 10Gig SFP+ modules of the 8396 is not available, LEDs only work when configured by u-boot. Some PHYs not supported (e.g.RTL8214QF is not supported, but GPL-dump is available). === RTL930x: mostly complete === RX/TX by the Ethernet driver works, all L2 functionality is implemented. QoS and Rate control is missing, there is no support for the SFP+ cages. PHY support: RTL8218D works and RTL8266 2.5-gig PHY. The Aquantia multi-gig phys are unsupported (upcoming Zyxel XGS1250-10), but GPL code available. GPIOs and LEDs are supported. === RTL931x: initial support only === The Zyxel XS 1930 boots, but GIC irq is not working, only internal timer IRQs, TX/RX code ported but not tested, some L2 code ported, Aquantia PHYs are unsupported, but GPL code available