aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/ramips
Commit message (Collapse)AuthorAgeFilesLines
* ramips: apply LED_POLARITY rt3050-esw on MT7628AN/MT7688Maximilian Pachl2020-01-191-0/+4
| | | | | | | | | | | The device tree property "mediatek,led_polarity" is ignored for MT7628AN and MT7688. According to the datasheet both SoCs have the matching register. Therefore the property should be applied on these two devices as well. Signed-off-by: Maximilian Pachl <m@ximilian.info> Reviewed-by: Sungbo Eo <mans0n@gorani.run> Tested-by: Sungbo Eo <mans0n@gorani.run>
* ramips: add support for TP-Link RE305 v1Steffen Förster2020-01-183-0/+175
| | | | | | | | | | | | | | | | | | | | | | Specification: SoC: MediaTek MT7628AN RAM: 64MiB Flash: 8MiB Wifi: - 2.4GHz: MT7628AN - 5GHz: MT7612EN LAN: 1x 10/100 Mbps Flash instructions: Flash factory image through stock firmware WEB UI. Back to stock is possible by using TFTP and stripping down the Firmware provided by TP-Link to a initramfs. The flash space between 0x650000 and 0x7f0000 is blank in the stock firmware so I left it out as well. Signed-off-by: Steffen Förster <nemesis@chemnitz.freifunk.net>
* ramips: rt305x: remove unnecessary mediatek,portmapSungbo Eo2020-01-182-2/+0
| | | | | | | | | "#mediatek,portmap" is not a valid property name. If mediatek,portmap equals 0x0, then the esw driver ditches it and uses the default value, 0x3f. Signed-off-by: Sungbo Eo <mans0n@gorani.run>
* ramips: mt76x8: fix bogus mediatek,portmapSungbo Eo2020-01-1818-14/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | | mt76x8 uses esw_rt3050 driver, which does not accept mediatek,portmap with string values. Convert the strings to integers to make it work. According to its switch setup, WRTnode 2P/2R have a WAN port at port 0, so the correct value should be 0x3e. tplink_8m.dtsi uses "llllw", but it does not match switch setups of any device using the DTSI. Remove it from the DTSI and add correct value to DTS for each device. These devices have a WAN port at port 0. Set the value to 0x3e. - tplink,archer-c20-v4 - tplink,archer-c50-v3 - tplink,tl-mr3420-v5 - tplink,tl-wr840n-v4 - tplink,tl-wr841n-v13 - tplink,tl-wr842n-v5 These devices have only one ethernet port. They don't need portmap setting. - tplink,tl-wa801nd-v5 - tplink,tl-wr802n-v4 - tplink,tl-wr902ac-v3 Signed-off-by: Sungbo Eo <mans0n@gorani.run>
* ramips: mt7620/mt7621: remove invalid mediatek,portmapSungbo Eo2020-01-183-5/+3
| | | | | | | | | | mt7620 and mt7621 use mt7530 driver, which only accepts "llllw", "wllll", and "lwlll" values. According to its switch setup, Mi Router 3G v2 has a WAN port at port 4, so the correct value should be "llllw". Signed-off-by: Sungbo Eo <mans0n@gorani.run>
* ramips: fix wps leds/btn for TP-Link TL-WA801ND v5Jan Alexander2020-01-171-4/+16
| | | | | | | | | | - fix color and active mode for existing wps led - add green wps led - add wps button Signed-off-by: Jan Alexander <jan@nalx.net> [wrap line] Signed-off-by: David Bauer <mail@david-bauer.net>
* ramips: fix HiWiFi HC5962 status LEDDENG Qingfang2020-01-161-3/+4
| | | | | | | | | Match LED behavior to stock firmware: Red: booting White: running Signed-off-by: DENG Qingfang <dengqf6@mail2.sysu.edu.cn>
* ramips: fix HiWiFi HC5962 switch configurationDENG Qingfang2020-01-161-1/+4
| | | | | | HC5962 has only 3 LAN ports, switch port 0 is unused Signed-off-by: DENG Qingfang <dengqf6@mail2.sysu.edu.cn>
* ramips: mt7621: disable images for gehua_ghl-r-001Petr Štetiar2020-01-141-0/+1
| | | | | | | | | | This device OOPs during the boot due to broken flash. It can be probably fixed with `broken-flash-reset` once ramips is on 4.19 kernel. So disable images for this device until its fixed. Ref: FS#2695, PR#2483 Signed-off-by: Petr Štetiar <ynezz@true.cz>
* ramips: add support for TP-Link Archer C20 v5Maxim Anisimov2020-01-095-1/+118
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | TP-Link Archer C20 v5 is a router with 5-port FE switch and non-detachable antennas. It's based on MediaTek MT7628N+MT7610EN. Specification: - MediaTek MT7628N/N (580 Mhz) - 64 MB of RAM - 8 MB of FLASH - 2T2R 2.4 GHz and 1T1R 5 GHz - 5x 10/100 Mbps Ethernet - 3x external, non-detachable antennas - UART (J1) header on PCB (115200 8n1) - 7x LED (GPIO-controlled*), 2x button, power input switch * WAN LED in this devices is a dual-color, dual-leads type which isn't (fully) supported by gpio-leds driver. This type of LED requires both GPIOs state change at the same time to select color or turn it off. For now, we support/use only the green part of the LED. Create Factory image -------------------- As all installation methods require a U-Boot to be integrated into the Image (and we do not ship one with the image) we are not able to create an image in the OpenWRT build-process. Download a TP-Link image from their Website and a OpenWRT sysupgrade image for the device and build yourself a factory image like following: TP-Link image: tpl.bin OpenWRT sysupgrade image: owrt.bin > dd if=tpl.bin of=boot.bin bs=131584 count=1 > cat owrt.bin >> boot.bin Installing via Web-UI --------------------- Upload the boot.bin via TP-Links firmware upgrade tool in the web-interface. Installing via Recovery ----------------------- Activate Web-Recovery by beginning the upgrade Process with a Firmware-Image from TP-Link. After starting the Firmware Upgrade, wait ~3 seconds (When update status is switching to 0%), then disconnect the power supply from the device. Upgrade flag (which activates Web-Recovery) is written before the OS-image is touched and removed after write is succesfull, so this procedure should be safe. Plug the power back in. It will come up in Recovery-Mode on 192.168.0.1. When active, all LEDs but the WPS LED are off. Remeber to assign yourself a static IP-address as DHCP is not active in this mode. The boot.bin can now be uploaded and flashed using the web-recovery. Installing via TFTP ------------------- Prepare an image like following (Filenames from factory image steps apply here) > dd if=/dev/zero of=tp_recovery.bin bs=196608 count=1 > dd if=tpl.bin of=tmp.bin bs=131584 count=1 > dd if=tmp.bin of=boot.bin bs=512 skip=1 > cat boot.bin >> tp_recovery.bin > cat owrt.bin >> tp_recovery.bin Place tp_recovery.bin in root directory of TFTP server and listen on 192.168.0.66/24. Connect router LAN ports with your computer and power up the router while pressing the reset button. The router will download the image via tftp and after ~1 Minute reboot into OpenWRT. U-Boot CLI ---------- U-Boot CLI can be activated by holding down '4' on bootup. Dual U-Boot ----------- This is TP-Link MediaTek device with a split-uboot feature design like a TP-Link Archer C50 v4. The first (factory-uboot) provides recovery via TFTP and HTTP, jumping straight into the second (firmware-uboot) if no recovery needs to be performed. The firmware-uboot unpacks and executed the kernel. Web-Recovery ------------ TP-Link integrated a new Web-Recovery like the one on the Archer C7v4 / TL-WR1043v5 / Archer C50v4. Stock-firmware sets a flag in the "romfile" partition before beginning to write and removes it afterwards. If the router boots with this flag set, bootloader will automatically start Web-recovery and listens on 192.168.0.1. This way, the vendor-firmware or an OpenWRT factory image can be written. By doing the same while performing sysupgrade, we can take advantage of the Web-recovery in OpenWRT. It is important to note that Web-Recovery is only based on this flag. It can't detect e.g. a crashing kernel or other means. Once activated it won't boot the OS before a recovery action (either via TFTP or HTTP) is performed. This recovery-mode is indicated by an illuminated WPS-LED on boot. Signed-off-by: Maxim Anisimov <maxim.anisimov.ua@gmail.com> [adjust some node names for LEDs in DTS] Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
* ramips: fix leds for TP-Link Archer C20 v4Maxim Anisimov2020-01-092-2/+3
| | | | | | | | | | - add "gpio" group for wan_orange led - use tpt triggers for wifi led indication - add wifi 5 GHz led support Signed-off-by: Maxim Anisimov <maxim.anisimov.ua@gmail.com> [slight commit message adjustment] Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
* ramips: disable image build for HiWiFi HC5962David Bauer2020-01-091-0/+2
| | | | | | | | Image builds for the ramips-mt7621 target currently fail with: > WARNING: Image file ./hiwifi_hc5962-kernel.bin is too big Disable this board for now. It can still be built using the SDK. Signed-off-by: David Bauer <mail@david-bauer.net>
* ramips: add label MAC address for Xiaomi MIR3GAdrian Schmutzler2020-01-081-5/+3
| | | | | | | | | | | | | | | | | | | | | | | The device label shows the address currently assigned to the OpenWrt LAN interface. Current setup is: LAN *:b8 factory 0xe006 label WAN *:b7 factory 0xe000 For vendor FW bootlog we get (manually removed parts of the address): [ 7.520000] set LAN/WAN LWLLL [ 7.530000] GMAC1_MAC_ADRH -- : 0x00004031 [ 7.530000] GMAC1_MAC_ADRL -- : 0x3c****b7 [ 7.530000] GDMA2_MAC_ADRH -- : 0x00004031 [ 7.540000] GDMA2_MAC_ADRL -- : 0x3c****b8 [ 7.540000] eth1: ===> VirtualIF_open Without further information, this does not allow verification of the currently unexpected LAN/WAN assignment (we would expect 0xe000 to be LAN). Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
* treewide: move mktplinkfw to tplink-v1-image in image-commands.mkAdrian Schmutzler2020-01-081-19/+2
| | | | | | | | | | | | | | | | | | | | | This move the slightly different target-specific implementations of mktplinkfw from the targets to include/image-commands.mk and renames it to tplink-v1-image. Having a common version will increase consistency between implementation and will complete the tplink build command already present in the new location. Due to the slight differences of the original implementations, this also does some adjustments to the device build commands/variables. This also moves rootfs_align as this is required as dependency. Tested on: - TL-WDR4300 v1 (ath79, factory) - TL-WDR4900 v1 (mpc85xx, sysupgrade) - RE210 v1 (ramips, see Tested-by) Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de> Tested-by: Christoph Krapp <achterin@googlemail.com>
* ramips: add support for ipTIME A8004TYong-hyu Ban2020-01-053-2/+148
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ipTIME A8004T is a 2.4/5GHz band AC2600 router, based on Mediatek MT7621A. Specifications: - SoC: MT7621A - RAM: DDR3 256M - Flash: SPI NOR 16MB - WiFi: - 2.4GHz: MT7615E - 5GHz: MT7615E - Ethernet: 5x 10/100/1000Mbps - Switch: SoC internal - USB: 1 * USB3.0 port - UART: - J4: 3.3V, TX, RX, GND (3.3V is the square pad) / 57600 8N1 - Other info: - J9: Unknown unpopulated header. Installation via web interface: 1. Flash **initramfs** image through the stock web interface. 2. Boot into OpenWrt and perform sysupgrade with sysupgrade image. Revert to stock firmware: 1. Perform sysupgrade with stock image. Signed-off-by: Yong-hyu Ban <perillamint@quendi.moe> [do not enable xhci node in DTS which is already enabled in DTSI] Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
* ramips: add label MAC address for Netgear EX6130Adrian Schmutzler2020-01-051-0/+1
| | | | | | | The MAC address on the label of this device corresponds to the 2.4 GHz and ethernet MAC address. Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
* ramips: remove duplicate dts nodes of MediaTek LinkIt Smart 7688Jack Chen2020-01-051-4/+0
| | | | | | | There are two identical wmac nodes in the dts file of MediaTek LinkIt Smart 7688, so delete one of them. Signed-off-by: Jack Chen <redchenjs@live.com>
* ramips: reduce lzma dictionary size for D-Link DIR-645Mason Clarke2020-01-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently this device fails to boot with the OpenWrt snapshot images (release images are unaffected). The error message is: "LZMA ERROR 1 - must RESET board to recover". This happens because the kernel image is too big for the bootloader to boot. This commit works around this by decreasing the lzma dictionary size option from the default 23 to 10. Before this change the current OpenWrt snapshot image (uncompressed kernel size 4875139 bytes) failed to boot, while now an even bigger image (kernel 4.19 with snapshot default config; uncompressed kernel size 5162833 bytes) boots just fine. The highest lzma dictionary size option this image booted with was 11. 10 was chosen to have a bit more room for growth. An unavoidable side-effect of this change is that the compressed kernel image will take up more space. Total image size with different dictionary size options: D23 - 3973903 bytes (base) D16 - 4113167 bytes (+3.5% - +139264 bytes) D12 - 4317967 bytes (+8.7% - +344064‬ bytes) D11 - 4383503 bytes (+10.3% - +409600 bytes) D10 - 4461327 bytes (+12.3% - +487424 bytes) Fixes: FS#1484 Signed-off-by: Mason Clarke <mclarke2355@gmail.com>
* ramips: fix sysupgrade image for TP-Link RE200v1Andreas Böhler2020-01-051-1/+1
| | | | | | | Images generated for the TP-Link RE200v1 cannot be updated using sysupgrade, because a necessary call to append-metadata was missing. Signed-off-by: Andreas Böhler <dev@aboehler.at>
* ramips: add support for Edimax RA21SMaksym Medvedev2020-01-045-107/+172
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Edimax RA21S is a dual band 11ac router, based on MediaTek MT7621A and MT7615N chips. Specification: - SoC: MediaTek MT7621A dual-core @ 880MHz - RAM: 256M (Nanya NT5CC128M16IP) - FLASH: 16MB (Macronix MX25L12835F) - WiFi: 2.4/5 GHz 4T4R - 2.4GHz MediaTek MT7615N bgn - 5GHz MediaTek MT7615N nac - Switch: SoC integrated Gigabit Switch (4 x LAN, 1 x WAN) - USB: No - BTN: Reset, WPS - LED: 4 red LEDs, indistinguishable when case closed - UART: through-hole on PCB. J1: 3.3V - RX - GND - TX / 57600-8N1. 3.3V is the square pad Installation: Update the factory image via the OEM web-interface (by default: http://192.168.2.1/) User: admin Password: 1234 The sysupgrade image can be installed via TFTP from the U-Boot bootloader. Connect via ethernet port 2. Tested on device by @UAb5eSMn Signed-off-by: Maksym Medvedev <redrathnure@gmail.com> [split DTS and take over improvements from RG21S, extend commit message] Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
* ramips: fix inverted reset button for Ravpower WD03Moritz Warning2020-01-031-1/+1
| | | | | | The button events "pressed" and "released" were switched. Tested with v18.06.4. Signed-off-by: Moritz Warning <moritzwarning@web.de>
* ramips: move set-irq-affinity script to mt7621 subtargetDENG Qingfang2020-01-031-0/+0
| | | | | | | Move the set-irq-affinity script to mt7621 because it is the only SMP subtarget. Signed-off-by: DENG Qingfang <dengqf6@mail2.sysu.edu.cn>
* ramips: fix Archer C20i wireless MAC addressDavid Bauer2020-01-021-0/+9
| | | | | | | | | | The TP-Link Archer C20i previously had a generic Ralink MAC address set for both radios, as the caldata does only contain a generic MAC address. Set the MAC address from the vendor firmware for both radios to assign unique MAC addresses to every device. Signed-off-by: David Bauer <mail@david-bauer.net>
* ramips: fix Archer C2 v1 5GHz MAC addressDavid Bauer2020-01-021-0/+2
| | | | | | | | | | | The TP-Link Archer C2 v1 previously had a generic Ralink MAC address set for the 5GHz radio (MT7610), as the caldata does only contain a generic MAC address. Set the MAC address from the vendor firmware for the 5GHz radio to assign unique MAC addresses to every device. Signed-off-by: David Bauer <mail@david-bauer.net>
* ramips: add system LED indicators for TP-Link C20iDavid Bauer2020-01-021-1/+5
| | | | | | | Use the WPS LED to indicate system status like it is done for the TP-Link Archer C2 v1 and many other boards. Signed-off-by: David Bauer <mail@david-bauer.net>
* ramips: convert TP-Link MT7620 boards to tpt triggerDavid Bauer2020-01-027-7/+8
| | | | | | | | | | | | This converts all MediaTek MT7620 boards from TP-Link to use the now supported WiFi throughput LED trigger. This way, the LED state now covers all VAPs regardless of their name. Also align all single-WiFi LEDs to represent the state of the 2.4GHz radio. This was not always the case previously, as later-added support for the MT7610 altered the phy probing order. Signed-off-by: David Bauer <mail@david-bauer.net>
* ramips: mt7620: use throughput trigger on HiWiFi HC5x61DENG Qingfang2019-12-314-8/+6
| | | | | | Throughput trigger support for MT7620 has been added, so switch to it Signed-off-by: DENG Qingfang <dengqf6@mail2.sysu.edu.cn>
* ramips: remove HiWiFi HC5661 non-existent 5GHz LEDDENG Qingfang2019-12-311-5/+0
| | | | | | | | HC5661 does not have 5GHz WiFi or LED. Fixes: e6e373d3480e ("ramips: Add DTS files for HiWiFi HC5x61 models") Signed-off-by: DENG Qingfang <dengqf6@mail2.sysu.edu.cn>
* ramips: add support for TP-Link RE200 v1Andreas Böhler2019-12-314-0/+198
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | TP-Link RE200 v1 is a wireless range extender with Ethernet and 2.4G and 5G WiFi with internal antennas. It's based on MediaTek MT7620A+MT7610EN. Specifications -------------- - MediaTek MT7620A (580 Mhz) - 64 MB of RAM - 8 MB of FLASH - 2T2R 2.4 GHz and 1T1R 5 GHz - 1x 10/100 Mbps Ethernet - UART header on PCB (57600 8n1) - 8x LED (GPIO-controlled; only 6 supported), 2x button There are 2.4G and 5G LEDs in red and green which are controlled separately. The 5G LED is currently not supported, since the GPIOs couldn't be determined. Installation ------------ Web Interface ------------- It is possible to upgrade to OpenWrt via the web interface. However, the OEM firmware upgrade file is required and a tool to fix the MD5 sum of the header. This procedure overwrites U-Boot and there is not failsafe / recovery mode present! To prepare an image, you need to take the header and U-Boot (i.e. 0x200 + 0x20000 bytes) from an OEM firmware file and attach the factory image to it. Then fix the header MD5Sum1. Serial console -------------- Opening the case is quite hard, since it is welded together. Rename the OpenWrt factory image to "test.bin", then plug in the device and quickly press "2" to enter flash mode (no line feed). Follow the prompts until OpenWrt is installed. Unfortunately, this devices does not offer a recovery mode or a tftp installation method. If the web interface upgrade fails, you have to open your device and attach serial console. Since the web upgrade overwrites the boot loader, you might also brick your device. Additional notes ---------------- MAC address assignment is based on stock-firmware. For me, the device assigns the MAC on the label to Ethernet and the 2.4G WiFi, while the 5G WiFi has a separate MAC with +2. *:88 Ethernet/2.4G label, uboot 0x1fc00, userconfig 0x0158 *:89 unused userconfig 0x0160 *:8A 5G not present in flash This seems to be the first ramips device with a TP-Link v1 header. The original firmware has the string "EU" embedded, there might be some region- checking going on during the firmware upgrade process. The original firmware also contains U-Boot and thus overwrites the boot loader during upgrade. In order to flash back to stock, the first header and U-Boot need to be stripped from the original firmware. Signed-off-by: Andreas Böhler <dev@aboehler.at>
* ramips: fix switch setup for Xiaomi MiWiFi NanoSungbo Eo2019-12-312-2/+10
| | | | | | | MiWiFi Nano has two LAN ports, which are in reverse order. Add port numbers to them, and disable unused ports. Signed-off-by: Sungbo Eo <mans0n@gorani.run>
* ramips: add LED trigger for TL-WR902AC v3 WAN LEDDavid Bauer2019-12-301-0/+1
| | | | | | | | | | | This adds an LED trigger for the WAN LED on top of the TP-Link TL-WR902AC v3. Currently, only the LED on the port itself shows the link state, while the LED on top of the device stays dark. The WAN port of the device is a hybrid LAN/WAN one, hence why the LED at the port was labled LAN. Signed-off-by: David Bauer <mail@david-bauer.net>
* ramips: remove bogus ralink,mtd-eeprom with offset 0x4Adrian Schmutzler2019-12-277-8/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Several devices in mt76x8 subtarget use the following line to set up wmac in their DTS(I) files: ralink,mtd-eeprom = <&factory 0x4> This is strange for several reasons: - They should use mediatek,mtd-eeprom on this SOC - The caldata is supposed to start at 0x0 - The parent DTSI mt7628an.dtsi specifies mediatek,mtd-eeprom anyway, starting from 0x0 - The offset coincides with the default location of the MAC address in caldata Based on the comment in b28e94d4bfa1 ("ramips: MiWiFi Nano fixes"), it looks like the author for this device wanted to actually use mtd-mac-address instead of ralink,mtd-eeprom. A check on the same device revealed that actually the MAC address start at offset 4 there, so the correct caldata offset is 0x0. Based on these findings, and the fact that the expected location on this SOC is 0x0, we remove the "ralink,mtd-eeprom = <&factory 0x4>" statement from all devices in ramips (being only mt7628an anyway). Thanks to Sungbo Eo for finding and researching this. Reported-by: Sungbo Eo <mans0n@gorani.run> Fixes: b28e94d4bfa1 ("ramips: MiWiFi Nano fixes") Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
* ramips: add label MAC address for Mikrotik RB750Gr3Sven Roederer2019-12-231-3/+1
| | | | | | | | | | | | The device label contains: E01: 74:4D:28:xx:xx:30 E05: 74:4D:28:xx:xx:34 The first value corresponds to the address set in hard_config 0x10. That one is taken for the label MAC address. Signed-off-by: Sven Roederer <freifunk@it-solutions.geroedel.de>
* ramips: simplify state_default/pinctrl0 in device DTS filesAdrian Schmutzler2019-12-23295-1941/+1355
| | | | | | | | | The node pinctrl0 is already set up in the SOC DTSI files, but defined again as member of pinctrl in most of the device DTS(I) files. This patch removes this redundancy for the entire ramips target. Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
* ramips: fix MAC address setup for Xiaomi MiWiFi NanoSungbo Eo2019-12-222-2/+2
| | | | | | | | MAC addresses are stored in factory partition at: 0x0004: WiFi 2.4GHz (label_mac +1) 0x0028: LAN, WAN (label_mac) Signed-off-by: Sungbo Eo <mans0n@gorani.run>
* ramips: further improve support for Xiaomi MiWiFi NanoSungbo Eo2019-12-221-15/+13
| | | | | | | | | | | | | | | | | This patch does the following: - prepend vendor name to model - set status LEDs to follow the behavior in stock FW - simplify state_default node definition - use generic name for flash node Stock FW status indicators: https://files.xiaomi-mi.com/files/Mi_Router_Wi-Fi_Nano/Mi_router-NANO_EN.pdf > Yellow: power on / off > Blue: during normal operation > Red: in case of problems with the operation of the device Signed-off-by: Sungbo Eo <mans0n@gorani.run>
* ramips: further DTS improvements for Edimax RG21SAdrian Schmutzler2019-12-221-8/+6
| | | | | | | | | | This fixes the state_default node by setting the correct groups and inheriting &state_default from parent DTSI directly. The compatible for the wifi nodes is changed to the more generic mediatek,mt76. Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
* ramips: add eth0 MAC address for Edimax RG21SAdrian Schmutzler2019-12-222-1/+3
| | | | | | | | | | | | | | | So far, lan/wan MAC address for Edimax RG21S are only read using mtd_get_mac_ascii, so eth0.1 and eth0.2 addresses are set, but eth0 address is random. Since the device's LAN address is the same as for 2.4 GHz, though, this patch set's the eth0 address based on the 2.4 GHz one, which can be extracted by mtd-mac-address. This will also allow to move the label MAC address setup to DT. The setup of lan_mac and wan_mac are kept in 02_network, so those locations are still in use, too. Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
* ramips: fix USB LED for Belkin F9K1109v1Sungbo Eo2019-12-201-1/+1
| | | | | | | | | | | | | | Device support for Belkin F9K1109v1 was added using set_usb_led() although this was removed in 772b27c20736 ("ramips: set F5D8235 v1 usb led trigger via devicetree"). Use ucidef_set_led_usbport() instead. Fixes: f2c83532f92c ("ramips: add support for Belkin F9K1109v1") Signed-off-by: Sungbo Eo <mans0n@gorani.run> [rephrase commit title and message] Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
* ramips: rename MTK_SOC to SOCAdrian Schmutzler2019-12-207-321/+320
| | | | | | | This replaces MTK_SOC by the newly introduced common SOC device variable. Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
* ramips: harmonize line breaks in image MakefilesAdrian Schmutzler2019-12-195-227/+235
| | | | | | | | | | | | | | | | This harmonizes the line wrapping in image Makefile device definitions, as those are frequently copy-pasted and are a common subject of review comments. Having the treatment unifying should reduce the cases where adjustment is necessary afterwards. Harmonization is achieved by consistently (read "strictly") applying certain rules: - Never put more than 80 characters into one line - Fill lines up (do not break after 40 chars because of ...) - Use one tab for indent after wrapping by "\" - Only break after pipe "|" for IMAGE variables Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
* ramips: fix portmap for TP-Link Archer C50 v4Maxim Anisimov2019-12-191-1/+1
| | | | | | According to 02_network portmap is wan=0 lan1=1 lan2=2 lan3=3 lan4=4 Signed-off-by: Maxim Anisimov <maxim.anisimov.ua@gmail.com>
* ramips: allow to set switchdev by board in ramips_set_preinit_ifaceAdrian Schmutzler2019-12-171-20/+47
| | | | | | | | | | | | | | This adds the option to determine switchdev by board when setting preinit iface for failsafe. The patch reorganizes the code to use functions for setting correct switchdev based on SOC and board, which is supposed to improve readability and maintainability. In this patch, the ramips_switchdev_from_board function is added without specifying an actual device using it. This is meant to make the life of device supporters waiting for merge easier, as there is less to rebase and keep track of. Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
* ramips: add support for ipTIME A104nsSungbo Eo2019-12-174-0/+162
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ipTIME A104ns is a 2.4/5GHz band AC750 router, based on MediaTek MT7620A. Specifications: - SoC: MT7620A - RAM: DDR2 64MB - Flash: SPI NOR 8MB - WiFi: - 2.4GHz: SoC internal - 5GHz: MT7610EN - Ethernet: 5x 10/100Mbps - Switch: SoC internal - USB: 1x 2.0 - UART: - J2: 3.3V, TX, RX, GND (3.3V is the square pad) / 57600 8N1 Installation via web interface: 1. Flash **initramfs** image through the stock web interface. 2. Boot into OpenWrt and perform sysupgrade with sysupgrade image. Revert to stock firmware: 1. Perform sysupgrade with stock image. In contrast to to-be-supported A1004ns, the A104ns has no usable value in 0x1fc40 (uboot), so wan_mac needs to be calculated. Also note that GPIOs for the LEDs really are inverted compared to the A1004ns. Signed-off-by: Sungbo Eo <mans0n@gorani.run> [moved state_default to device DTS, reordered properties in wmac, added comment about wan_mac and LED GPIOs] Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
* ramips: add label MAC address for Edimax RG21SAdrian Schmutzler2019-12-171-0/+1
| | | | | | | | | | | | | | | | The Edimax RG21S has a label which bears two MAC addresses: 2.4 GHz (n) and 5 GHz (n+1) The complete MAC address setup is as follows: 2.4 GHz *:83 factory 0x4, u-boot-env wlanaddr 5 GHz *:84 factory 0x8004 LAN *:83 u-boot-env ethaddr WAN *:85 u-boot-env wanaddr Since 2.4 GHz is the first address on the label and the same as used for ethernet, take this one for label MAC address. Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
* ramips: increase SPI frequency for Edimax RG21SBirger Koblitz2019-12-171-1/+1
| | | | | | | | This increases SPI frequency from the relatively low 10 MHz to 40 MHz. Signed-off-by: Birger Koblitz <mail@birger-koblitz.de> [added commit title/message, split patch] Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
* ramips: remove unnecessary nodes in DTS for Edimax RG21SBirger Koblitz2019-12-171-10/+0
| | | | | | | | | This sdhci and i2c nodes were copy-pasted, but are not needed as the device does not provide that functionality. Remove them. Signed-off-by: Birger Koblitz <mail@birger-koblitz.de> [added commit title/message, split patch] Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
* ramips: add support for JCG JHR-AC876MDENG Qingfang2019-12-133-0/+162
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | JCG JHR-AC876M is an AC2600M router Hardware specs: SoC: MT7621AT 2.4GHz: MT7615N 4x4 @ PCIe0 5GHz: MT7615N 4x4 @ PCIe1 Flash: Winbond W25Q128JVSQ 16MiB RAM: Nanya NT5CB128M16 256MiB USB 2.0 and 3.0 ports 6 LEDs, 3 of which are connected to SoC GPIO Reset and WPS buttons Flash instructions: Stock to OpenWrt: Upload factory.bin in stock firmware's upgrade page, do not preserve settings OpenWrt to stock: Push and hold the reset button for 5s while power cycling to enter recovery mode; Visit 192.168.1.1 and upload stock firmware MAC addresses map: 0x0004 *:1c wlan2g/wan/label 0x8004 *:20 wlan5g 0xe000 *:1b lan 0xe006 *:1a not used in stock fw Signed-off-by: DENG Qingfang <dengqf6@mail2.sysu.edu.cn>
* ramips: allow JCG_MAXSIZE in kiB in Build/jcg-headerAdrian Schmutzler2019-12-132-2/+4
| | | | | | | | | | This allows JCG_MAXSIZE to be specified in kilobytes. This makes this value more consistent and easier comparable with other size variables. This also changes the only occurence of the variable, for Cudy WR1000. Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
* ramips: add support for ipTIME A6ns-MSungbo Eo2019-12-133-0/+156
| | | | | | | | | | | | | | | | | | | | | | | | | ipTIME A6ns-M is a 2.4/5GHz band AC1900 router, based on MediaTek MT7621A. Specifications: - SoC: MT7621AT - RAM: DDR3 128MB - Flash: SPI NOR 16MB - WiFi: - 2.4GHz: MT7615 - 5GHz: MT7615 - Ethernet: 5x 10/100/1000Mbps - Switch: SoC internal - UART: - J4: 3.3V, TX, RX, GND (3.3V is the square pad) / 57600 8N1 Installation via web interface: 1. Flash **initramfs** image through the stock web interface. 2. Boot into OpenWrt and perform sysupgrade with sysupgrade image. Revert to stock firmware: 1. Perform sysupgrade with stock image. Signed-off-by: Sungbo Eo <mans0n@gorani.run>