aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/realtek
Commit message (Collapse)AuthorAgeFilesLines
* realtek: add support for Netgear GS108T v3Michael Mohr2021-02-122-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Netgear GS108T v3 is an 8 port gigabit switch with PoE-PD support on port 1. The two prior versions were built using eCos and are not currently compatible with OpenWRT. The GS108T v3 is quite similar to both the GS110TPP v1 and GS110TP v3, all of which use the same firmware image from Netgear. For this reason, the device tree is identical aside from the model and compatible values. All of the above feature a dual firmware layout, referred to as Image0 and Image1 in the Netgear firmware. Hardware specification ---------------------- * RTL8380M SoC, 1 MIPS 4KEc core @ 500MHz * 128MB DDR3-1600 DRAM (Winbond W631GG8MB-12) * 32MB 3v NOR SPI Flash (Macronix MX25L25635F or Winbond W25Q256JVFIQ) * RTL8231 GPIO extender to control the LEDs and the reset button * 8 x 10/100/1000BASE-T ports, internal PHY (RTL8218B) * UART (115200 8N1) via unpopulated standard 0.1" pin header marked J1 * Power is supplied via a 12V 1A barrel connector or 802.3af UART pinout ----------- J1 | [o]ooo ^ ||`------ GND | |`------- RX [TX out of the serial adapter] | `-------- TX [RX into the serial adapter] `---------- Vcc (3V3) [the square pin] The through holes are filled with PB-free solder which melts at 375C. They can also be drilled using a 0.9mm bit. Build configuration ------------------- * Target System: Realtek MIPS * Target Profile: Netgear GS108T v3 * Target Images -> ramdisk -> Compression: lzma * Disable other target images Boot initramfs image from U-Boot -------------------------------- 1. Press the Escape key at the `Hit Esc key to stop autoboot` prompt 2. Init network with `rtk network on` command 3. Load image with `tftpboot 0x8f000000 openwrt-realtek-generic-netgear_gs108t-v3-initramfs-kernel.bin` command 4. Boot the image with `bootm` command The switch defaults to IP 192.168.1.1 and tries to fetch the image via TFTP from 192.168.1.111. Updating the installed firmware ------------------------------- The OpenWRT ramdisk image can be flashed directly from the Netgear UI. The Image0 slot should be used in order to enable sysupgrade. As with similar switches, changing the active boot partition can be accomplished in U-Boot as follows: 1. Press the Escape key at the `Hit Esc key to stop autoboot` prompt 2. Run `setsys bootpartition {0|1}` to select the boot partition 3. Run `savesys` followed by `boota` to proceed with the boot process Signed-off-by: Michael Mohr <akihana@gmail.com>
* realtek: refactor the Netgear GS110TPP v1 device treeMichael Mohr2021-02-122-225/+139
| | | | | | | | | | | | | | | | | | | Move most of the GS110TPP v1 device tree into a dtsi so that it can be shared with the GS108T v3. Additionally: * Use macros to simplify the ethernet and switch definitions * Zero-pad the offsets and sizes in the partition map to 8 digits each The spi-max-frequency value has been changed from 10MHz to 50MHz based on an analysis of the relevant datasheets. The current driver doesn't use this property, as the clock speed is fixed. However, it's required for this type of DT node, so that's why it's present here. The firmware partition has been split in half, since this is how the stock firmware uses it. This can be used to easily revert to a stock firmware if one is written to the second image area. Signed-off-by: Michael Mohr <akihana@gmail.com>
* realtek: add and use netgear_nge for the GS110PP v1Michael Mohr2021-02-121-6/+12
| | | | | | | | The netgear_nge device will be shared between the GS108T v3 (to be added in a later commit) and the GS110PP v1. It also enables LZMA compression for the ramdisk image. Signed-off-by: Michael Mohr <akihana@gmail.com>
* target: use SPDX license identifiers on MakefilesAdrian Schmutzler2021-02-103-9/+5
| | | | | | Use SPDX license tags to allow machines to check licenses. Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
* kernel: bump 5.4 to 5.4.93John Audia2021-01-292-4/+4
| | | | | | | | | | | | | | | | | All modification made by update_kernel.sh in a fresh clone without existing toolchains. Build system: x86_64 Build-tested: ipq806x/R7800, bcm27xx/bcm2711 Run-tested: ipq806x/R7800 Compile-tested [*]: ath79/{tiny,generic}, ipq40xx, octeon, ramips/mt7621, realtek, x86/64 Run-tested [*]: ath79/generic, ipq40xx, octeon, ramips/mt7621 No dmesg regressions, everything functional Signed-off-by: John Audia <graysky@archlinux.us> Tested-by: Stijn Segers <foss@volatilesystems.org> [*]
* realtek: add debugfs support for mirroringBirger Koblitz2021-01-261-14/+391
| | | | | | This adds debugfs support to monitor mirroring via debugfs Signed-off-by: Birger Koblitz <git@birger-koblitz.de>
* realtek: add API for the hw tables of RTL83XX/93XX SoCsBirger Koblitz2021-01-261-100/+436
| | | | | | | | Add a table API that has per accss register locking and uses register description information to handle all table access through a single set of api calls. Signed-off-by: Birger Koblitz <git@birger-koblitz.de>
* realtek: add switch driver support for the RTL93XX based switchesBirger Koblitz2021-01-265-245/+1522
| | | | | | | Adds support for the RTL9300 and RTL9310 series of switches with 10GBit per port and up to 56 ports. Signed-off-by: Birger Koblitz <git@birger-koblitz.de>
* realtek: add internal and external SDS/PHYs of RTL9300 devicesBirger Koblitz2021-01-262-28/+523
| | | | | | | | This adds support for the internal SerDes of the RTL9300 SoC and for the RTL8218D and RTL8226B phys found in combination with this SoC in switches. Signed-off-by: Birger Koblitz <git@birger-koblitz.de>
* realtek: fix RTL8231 gpio expander usage with RTL839X SoCBirger Koblitz2021-01-261-24/+40
| | | | | | | | This fixes the usage of the RTL8231 GPIO extender chip when used with the RTL839X SoCs. Specifically, the PHY addresses may be different from 0. Signed-off-by: Birger Koblitz <git@birger-koblitz.de>
* realtek: enable default rate limiting and qos settingsBirger Koblitz2021-01-261-64/+0
| | | | | | | Enable default rate limiting and QoS support. Remove previous storm control code. Signed-off-by: Birger Koblitz <git@birger-koblitz.de>
* realtek: correct l2 offloading tag handlingBirger Koblitz2021-01-261-4/+7
| | | | | | | Makes sure the DSA trailer information on any L2 offloading done by the switch is honoured by the bridge layer Signed-off-by: Birger Koblitz <git@birger-koblitz.de>
* realtek: add QoS and rate controlBirger Koblitz2021-01-266-530/+1955
| | | | | | | | | This adds support for identifying QoS information in packets and use this and rate control information to submit to multiple egress queues. The ethernet driver is also made to support 2 egress and up to 32 egress queues. Signed-off-by: Birger Koblitz <git@birger-koblitz.de>
* realtek: add dtsi for RTL930X SoCsBirger Koblitz2021-01-261-0/+182
| | | | | | Add a default dtsi to support RTL930X SoCs. Signed-off-by: Birger Koblitz <git@birger-koblitz.de>
* realtek: add support for the RTL9300 timerBirger Koblitz2021-01-264-22/+349
| | | | | | | | this adds support for the SoC timer of the RTL9300 chips, it provides 6 independent timer/counters, of which the first one is used as a clocksource and the second one as event timer. Signed-off-by: Birger Koblitz <git@birger-koblitz.de>
* realtek: add support for the RTL8390 and RTL9300 SoC IRQsBirger Koblitz2021-01-264-150/+174
| | | | | | | | This adds support for the RTL8390 and RTL9300 SoCs it also cleans up unnecessary definitions in mach-rtl83xx.h and moves definitions relevant for irq routing to irq.h Signed-off-by: Birger Koblitz <git@birger-koblitz.de>
* realtek: add detection of RTL930X SoCs and RTL8313 SoCBirger Koblitz2021-01-261-6/+65
| | | | | | | | This adds support to detect RTL930X based SoCs and the RTL9313 SoC. Tested on Zyxel XGS1210-10 (RTL9302B SoC) and the Zyxel XS1930-12 (RTL9313 SoC) Signed-off-by: Birger Koblitz <git@birger-koblitz.de>
* realtek: build ZyXEL vendor firmware compatible initramfsBjørn Mork2021-01-241-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Append a device specific version trailer used by the stock firmware upgrade application to validate firmwares. The trailer contains a list of ZyXEL firmware version numbers, which includes a four letter hardware identifier. The stock web UI requires that the current hardware matches one of the listed versions, and that the version number is larger than a model specific minimum value. The minimum version varies between V1.00 and V2.60 for the currently known GS1900 models. The number is not used anywhere else to our knowlege, and has no direct relation to the version info in the u-image header. We can therefore use an arbitrary value larger than V2.60. The stock firmware upgrade application will only load and flash the part of the file specified in the u-image header, regardless of file size. It can therefore not be used to flash images with an appended rootfs. There is therefore no need to include the trailer in other images than the initramfs. This prevents accidentally bricking by attempts to flash other images from the stock web UI. Stock images support all models in the series, listing all of them in the version trailer. OpenWrt provide model specific images. We therefore only list the single supported hardware identifier for each image. This eliminates the risk of flashing the wrong OpenWrt image from stock web UI. OpenWrt can be installed from stock firmware in two steps: 1) flash OpenWrt initramfs image from stock web gui 2) boot OpenWrt and sysupgrade to a squasfs image The OpenWrt squashfs image depends on a static partition map in the DTS. It can only be installed to the "firmware" partition. This partition is labeled "RUNTIME1" in u-boot and in stock firmware, and is referred to as "image 0" in the stock flash management tool. The OpenWrt initramfs can be installed and run from either partitions. But if you want to keep stock irmware in the spare system partition, then you must make sure stock firmware is installed to the "RUNTIME2" partition referred to as "image 1" in the stock web UI. And the initial OpenWrt initramfs must be flashed to "RUNTIME1"/"image 0". The stock flash management application supports direct selection of both which partition to flash and which partition to boot next. This allows software controlled "dual-boot" between OpenWrt and stock firmware, without using console access to u-boot. u-boot use the "bootpartition" variable stored in the second u-boot environment to select which of the two system partitions to boot. This variable is set by the stock flash management application, by direct user input. It can also be set in OpenWrt using e.g fw_setsys bootpartition 1 to select "RUNTIME2"/"image 1" as default, assuming a stock firmware version is installed in that partition. Signed-off-by: Bjørn Mork <bjorn@mork.no>
* realtek: use vendor-specific magic for ZyXELBjørn Mork2021-01-242-1/+5
| | | | | | | | | | | | | | The stock firmware of the ZyXEL GS1900 series use a non-standard u-image magic. This is not enforced by the stock u-boot, which is why we could boot images with the default magic. The flash management application of the stock firmware will however verify the magic, and refuse any image with another value. Convert to vendor-specific value to get flash management support in stock firmware, including the ability to upgrade to OpenWrt directly from stock web UI. Signed-off-by: Bjørn Mork <bjorn@mork.no>
* treewide: provide global default for SUPPORTED_DEVICESAdrian Schmutzler2021-01-231-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The majority of our targets provide a default value for the variable SUPPORTED_DEVICES, which is used in images to check against the compatible on a running device: SUPPORTED_DEVICES := $(subst _,$(comma),$(1)) At the moment, this is implemented in the Device/Default block of the individual targets or even subtargets. However, since we standardized device names and compatible in the recent past, almost all targets are following the same scheme now: device/image name: vendor_model compatible: vendor,model The equal redundant definitions are a symptom of this process. Consequently, this patch moves the definition to image.mk making it a global default. For the few targets not using the scheme above, SUPPORTED_DEVICES will be defined to a different value in Device/Default anyway, overwriting the default. In other words: This change is supposed to be cosmetic. This can be used as a global measure to get the current compatible with: $(firstword $(SUPPORTED_DEVICES)) (Though this is not precisely an achievement of this commit.) Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
* kernel: mtdsplit_uimage: replace "netgear, uimage" parserBjørn Mork2021-01-221-1/+2
| | | | | | | | | | | | | | | | | | | The "netgear,uimage" parser can be replaced by the generic parser using device specific openwrt,ih-magic and openwrt,ih-type properties. Device tree properties for the following devices have not been set, as they have been dropped from OpenWrt with the removal of the ar71xx target: FW_MAGIC_WNR2000V1 0x32303031 FW_MAGIC_WNR2000V4 0x32303034 FW_MAGIC_WNR1000V2_VC 0x31303030 FW_MAGIC_WPN824N 0x31313030 Tested-by: Sander Vanheule <sander@svanheule.net> # WNDR3700v2 Tested-by: Stijn Segers <foss@volatilesystems.org> # WNDR3700v1 Signed-off-by: Bjørn Mork <bjorn@mork.no>
* kernel: mtdsplit_uimage: replace "allnet, uimage" parserBjørn Mork2021-01-221-1/+2
| | | | | | | Convert users to the generic "openwrt,uimage" using device specific "openwrt,ih-magic" properties, and remove "allnet,uimage". Signed-off-by: Bjørn Mork <bjorn@mork.no>
* kernel: bump 5.4 to 5.4.87John Audia2021-01-081-3/+3
| | | | | | | | | | | | | | | | | | All modification by update_kernel.sh. Build system: x86_64 Build-tested: ipq806x/R7800, bcm27xx/bcm2711 Run-tested: ipq806x/R7800 No dmesg regressions, everything functional Compile-tested [*]: ath79/{generic,tiny}, ipq40xx, octeon, ramips/mt7621, realtek, x86/64. Run-tested [*]: ramips/mt7621 (DIR-878 A1, R6800, RT-AC57U), octeon (EdgeRouter Lite). Signed-off-by: John Audia <graysky@archlinux.us> Tested-by: Stijn Segers <foss@volatilesystems.org> [*]
* realtek: add support for ZyXEL GS1900-8HP v1 and v2Stijn Segers2021-01-084-0/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The ZyXEL GS1900-8HP is an 8 port gigabit switch with PoE+ support. There are two versions on the market (v1 & v2) which share similar specs (same flash size and flash layout, same RAM size, same PoE+ power envelope) but have a different case and board layout that they each share with other GS1900 siblings. The v1 seems to share its PCB and case with non-PoE GS1900-8; as such, adding support for the GS1900-8 would probably be trivial. The v2 seems to share its casing and platform with its already supported bigger brother, the GS1900-10HP - its board looks the same, except for two holes where the GS1900-10 has its SFP ports. Like their 10 port sibling, both devices have a dual firmware layout. Both GS1900-8HP boards have the same 70W PoE+ power budget. In order to manipulate the PoE+, one needs the rtl83xx-poe package [1]. After careful consideration it was decided to go with separate images for each version. Specifications (v1) ------------------- * SoC: Realtek RTL8380M 500 MHz MIPS 4KEc * Flash: Macronix MX25L12835F 16 MiB * RAM: Nanya NT5TU128M8HE-AC 128 MiB DDR2 SDRAM * Ethernet: 8x 10/100/1000 Mbit * PoE+: Broadcom BCM59111KMLG (IEEE 802.3at-2009 compliant, 2x) * UART: 1 serial header with populated standard pin connector on the left side of the PCB, towards the bottom. Pins are labeled: + VCC (3.3V) + TX + RX + GND Specifications (v2) ------------------- * SoC: Realtek RTL8380M 500 MHz MIPS 4KEc * Flash: Macronix MX25L12835F 16 MiB * RAM: Samsung K4B1G0846G 128 MiB DDR3 SDRAM * Ethernet: 8x 10/100/1000 Mbit * PoE+: Broadcom BCM59121B0KMLG (IEEE 802.3at-2009 compliant) * UART: 1 angled serial header with populated standard pin connector accessible from outside through the ventilation slits on the side. Pins from top to bottom are clearly marked on the PCB: + VCC (3.3V) + TX + RX + GND Serial connection parameters for both devices: 115200 8N1. Installation ------------ Instructions are identical to those for the GS1900-10HP and apply both to the GS1900-8HP v1 and v2 as well. * Configure your client with a static 192.168.1.x IP (e.g. 192.168.1.10). * Set up a TFTP server on your client and make it serve the initramfs image. * Connect serial, power up the switch, interrupt U-boot by hitting the space bar, and enable the network: > rtk network on * Since the GS1900-10HP is a dual-partition device, you want to keep the OEM firmware on the backup partition for the time being. OpenWrt can only boot off the first partition anyway (hardcoded in the DTS). To make sure we are manipulating the first partition, issue the following commands: > setsys bootpartition 0 > savesys * Download the image onto the device and boot from it: > tftpboot 0x84f00000 192.168.1.10:openwrt-realtek-generic-zyxel_gs1900-8hp-v{1,2}-initramfs-kernel.bin > bootm * Once OpenWrt has booted, scp the sysupgrade image to /tmp and flash it: > sysupgrade /tmp//tmp/openwrt-realtek-generic-zyxel_gs1900-8hp-v{1,2}-squashfs-sysupgrade.bin Signed-off-by: Stijn Segers <foss@volatilesystems.org> [merge PoE case, keep device definitions separate, change all those hashes in the commit message to something else so they don't get removed when changing the commit ...] Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
* realtek: remove model prefix from LED label for ZyXEL GS1900Adrian Schmutzler2021-01-081-1/+1
| | | | | | This is used as fixed status LED, so no migration is needed. Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
* realtek: introduce shared DTSI for GS1900 seriesStijn Segers2021-01-082-208/+153
| | | | | | | | | | | The ZyXEL GS1900-8HP v1, v2 and GS1900-10HP are all built on a similar Realtek RTL8380M platform. Create a common DTSI in preparation for GS1900-8HP support, and switch to the macros defined in rtl838x.dtsi. Signed-off-by: Stijn Segers <foss@volatilesystems.org> [drop redundant includes, use &mdio directly, do not replace SFP ports] Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
* realtek: ZyXEL: spell as done by manufacturerStijn Segers2021-01-072-2/+2
| | | | | | | ZyXEL spells its own name all uppercase with just the Y lowercase. Adapt the realtek target to follow this (other OpenWrt targets already do so). Signed-off-by: Stijn Segers <foss@volatilesystems.org>
* realtek: move memory node to device DTSStijn Segers2021-01-076-5/+25
| | | | | | | | | Move the memory out of the rtl838x.dtsi and into the device family DTSI or device DTS if applicable. This aligns with upstream practice. Signed-off-by: Stijn Segers <foss@volatilesystems.org> [add missing block for dgs-1210-10p, move block below chosen node] Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
* realtek: remove duplicate '/dts-v1/;' identifierAdrian Schmutzler2021-01-072-2/+0
| | | | | | | The identifier is already present in rtl838x.dtsi, and adding it twice is not only redundant but actually wrong. Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
* realtek: set PoE power budget for ZyXEL GS1900-10HPStijn Segers2021-01-071-0/+3
| | | | | | | As per the manufacturer's specifications, set the GS1900-10HP PoE power budget to 77W. Signed-off-by: Stijn Segers <foss@volatilesystems.org>
* realtek: fix build issuesBirger Koblitz2021-01-052-4/+19
| | | | | | | This fixes the build problems for the REALTEK target by adding a proper configuration option for the phy module. Signed-off-by: Birger Koblitz <mail@birger-koblitz.de>
* realtek: use kernel defined haltSander Vanheule2020-12-221-7/+0
| | | | | | | | | If _machine_hang is not defined on MIPS, the kernel will check if the CPU can enter a more power efficient sleep mode. Since the realtek platform supports mips32_r2, this should issue a WAIT instruction instead of a trivial infinite loop. Signed-off-by: Sander Vanheule <sander@svanheule.net>
* realtek: Add missing case in switch statementRafał Mikrut2020-12-111-0/+1
| | | | | | | | | | | | Cppcheck shows here duplicated break. Code `state->speed = SPEED_1000;` will be never executed because above it there is break statement. Almost identical statement is placed in another realtek driver https://github.com/openwrt/openwrt/blob/18a53d43d646290053eff4736ec852efcf6bf510/target/linux/realtek/files-5.4/drivers/net/dsa/rtl83xx/dsa.c#L286-L294 Signed-off-by: Rafał Mikrut <mikrutrafal@protonmail.com>
* realtek: Fix self assignmentRafał Mikrut2020-12-111-1/+1
| | | | | | | | | Cppcheck shows self initialization error, which is an obvious bug. Basing on logic of similar fragment below I assigned to this variable, value `RTL838X_LED_GLB_CTRL` which I think is proper. Signed-off-by: Rafał Mikrut <mikrutrafal@protonmail.com>
* kernel: bump 5.4 to 5.4.82John Audia2020-12-091-1/+1
| | | | | | | | | | | | | | | | Removed since included upstream and could be reverse-applied by quilt: backport-5.4/315-v5.10-usbnet-ipeth-fix-connectivity-with-ios-14.patch Remaining modifications made by update_kernel.sh Build system: x86_64 Build-tested: ipq806x/R7800, ath79/generic, bcm27xx/bcm2711 Run-tested: ipq806x/R7800 No dmesg regressions, everything functional Signed-off-by: John Audia <graysky@archlinux.us> Tested-by: Curtis Deptuck <curtdept@me.com> [build/run x86_64]
* realtek: fix SFP ports on the dlink 10port switchJohn Crispin2020-12-022-2/+14
| | | | Signed-off-by: John Crispin <john@phrozen.org>
* realtek: add zyxel_gs1900-10hp supportJohn Crispin2020-12-023-0/+296
| | | | Signed-off-by: John Crispin <john@phrozen.org>
* realtek: cleanup package selectionJohn Crispin2020-12-022-4/+2
| | | | Signed-off-by: John Crispin <john@phrozen.org>
* realtek: clean up board.json generationJohn Crispin2020-12-021-31/+47
| | | | | | | | | | | | In this new setup the switch is treated as wan, lan1.100 is used as our mgmt vlan. The board mac is applied to eth0, switch and switch.1 The board mac is assigned with the LA bit set to all lan ports while incrementing it. Signed-off-by: John Crispin <john@phrozen.org>
* kernel: clean up patch fuzzKevin Darbyshire-Bryant2020-11-265-25/+13
| | | | | | | Recent kernel bumps & target patch refactors have left some patch fuzz around. Refreshed kernel patches using update_kernel script. Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
* realtek: update the tree to the latest refactored versionJohn Crispin2020-11-2656-0/+10374
* rename the target to realtek * add refactored DSA driver * add latest gpio driver * lots of arch cleanups * new irq driver * additional boards Signed-off-by: Bert Vermeulen <bert@biot.com> Signed-off-by: Birger Koblitz <mail@birger-koblitz.de> Signed-off-by: Sander Vanheule <sander@svanheule.net> Signed-off-by: Bjørn Mork <bjorn@mork.no> Signed-off-by: John Crispin <john@phrozen.org>