ramips: add support for OpenFi 5Pro Travel Router
authorSven Huang <1036456939@qq.com>
Sat, 1 Jun 2024 03:53:31 +0000 (11:53 +0800)
committerHauke Mehrtens <hauke@hauke-m.de>
Sun, 16 Jun 2024 22:01:51 +0000 (00:01 +0200)
OpenFi 5Pro is a DualBand Travel Router, based on MT7621A.

Specification:
- Type             : Travel Wi-Fi Router(built-in Type-C Power Cable)
- Size             : 63 x 93 x 24mm
- Power            : Internal Type-C Cable PD/DC 5V@2A
- SoC              : MediaTek MT7621A
- RAM              : DDR3 512 MB
- Flash            : SPI-NOR 64MB (W25Q512)
- WLAN             : 2.4/5GHz 2T2R (MediaTek MT7603e/MT7613)
- Ethernet         : 2x 10/100/1000Mbps
- USB              : 1 x USB 2.0
- SDHCI            : 1 x TF Slot (Max 512GB)
- LEDs             : 3 x LEDs  (GPIO#16 gpio#17 gpio#14)
- Button           : 1 x Reset (GPIO#18),  1 x WPS (GPIO#13)
- UART             : 1 x UART for Debug, 115200 8N1 (Pinout: GND TX RX 3.3V)
- UART 2           : 1xUART2  (Pinout: GND TX2 RX2 3.3V )

How to upgrade image in uboot

1. press reset button when boot for 5sec.
2. access 192.168.21.1 in web ui.
3. select image and upload

Signed-off-by: Sven Huang <1036456939@qq.com>
target/linux/ramips/dts/mt7621_openfi_5pro.dts [new file with mode: 0755]
target/linux/ramips/image/mt7621.mk
target/linux/ramips/mt7621/base-files/etc/board.d/02_network

diff --git a/target/linux/ramips/dts/mt7621_openfi_5pro.dts b/target/linux/ramips/dts/mt7621_openfi_5pro.dts
new file mode 100755 (executable)
index 0000000..0ac5032
--- /dev/null
@@ -0,0 +1,188 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT\r
+\r
+#include "mt7621.dtsi"\r
+\r
+#include <dt-bindings/gpio/gpio.h>\r
+#include <dt-bindings/input/input.h>\r
+#include <dt-bindings/leds/common.h>\r
+\r
+/ {\r
+       compatible = "openfi,5pro", "mediatek,mt7621-soc";\r
+       model = "OpenFi 5Pro";\r
+\r
+       aliases {\r
+               led-boot = &led_system_blue;\r
+               led-failsafe = &led_system_blue;\r
+               led-running = &led_system_blue;\r
+               led-upgrade = &led_system_blue;\r
+               label-mac-device = &gmac0;\r
+       };\r
+\r
+       chosen {\r
+               bootargs = "console=ttyS0,115200";\r
+       };\r
+\r
+       keys {\r
+               compatible = "gpio-keys";\r
+\r
+               reset {\r
+                       label = "reset";\r
+                       gpios = <&gpio 18 GPIO_ACTIVE_LOW>;\r
+                       linux,code = <KEY_RESTART>;\r
+               };\r
+\r
+               wps {\r
+                       label = "wps";\r
+                       gpios = <&gpio 13 GPIO_ACTIVE_LOW>;\r
+                       linux,code = <KEY_WPS_BUTTON>;\r
+               };\r
+       };\r
+\r
+       leds {\r
+               compatible = "gpio-leds";\r
+\r
+               led_system_blue: led-0 {\r
+                       color = <LED_COLOR_ID_BLUE>;\r
+                       function = LED_FUNCTION_STATUS;\r
+                       gpios = <&gpio 14 GPIO_ACTIVE_LOW>;\r
+               };\r
+\r
+               led-1 {\r
+                       color = <LED_COLOR_ID_BLUE>;\r
+                       function = LED_FUNCTION_WAN_ONLINE;\r
+                       gpios = <&gpio 17 GPIO_ACTIVE_LOW>;\r
+               };\r
+\r
+               led-2 {\r
+                       color = <LED_COLOR_ID_BLUE>;\r
+                       function = LED_FUNCTION_WLAN;\r
+                       linux,default-trigger = "phy0tpt";\r
+                       gpios = <&gpio 16 GPIO_ACTIVE_LOW>;\r
+               };\r
+       };\r
+};\r
+\r
+&spi0 {\r
+       status = "okay";\r
+\r
+       flash@0 {\r
+               compatible = "jedec,spi-nor";\r
+               reg = <0>;\r
+               spi-max-frequency = <40000000>;\r
+               broken-flash-reset;\r
+\r
+               partitions {\r
+                       compatible = "fixed-partitions";\r
+                       #address-cells = <1>;\r
+                       #size-cells = <1>;\r
+\r
+                       partition@0 {\r
+                               label = "u-boot";\r
+                               reg = <0x0 0x30000>;\r
+                               read-only;\r
+                       };\r
+\r
+                       partition@30000 {\r
+                               label = "config";\r
+                               reg = <0x30000 0x10000>;\r
+                               read-only;\r
+                       };\r
+\r
+                       partition@40000 {\r
+                               label = "factory";\r
+                               reg = <0x40000 0x10000>;\r
+                               read-only;\r
+\r
+                               nvmem-layout {\r
+                                       compatible = "fixed-layout";\r
+                                       #address-cells = <1>;\r
+                                       #size-cells = <1>;\r
+\r
+                                       eeprom_factory_0: eeprom@0 {\r
+                                               reg = <0x0 0x400>;\r
+                                       };\r
+\r
+                                       eeprom_factory_8000: eeprom@8000 {\r
+                                               reg = <0x8000 0x4da8>;\r
+                                       };\r
+\r
+                                       macaddr_factory_e000: macaddr@e000 {\r
+                                               reg = <0xe000 0x6>;\r
+                                       };\r
+\r
+                                       macaddr_factory_e006: macaddr@e006 {\r
+                                               reg = <0xe006 0x6>;\r
+                                       };\r
+                               };\r
+                       };\r
+\r
+                       partition@50000 {\r
+                               compatible = "denx,uimage";\r
+                               label = "firmware";\r
+                               reg = <0x50000 0x3fb0000>;\r
+                       };\r
+               };\r
+       };\r
+};\r
+\r
+&pcie {\r
+       status = "okay";\r
+};\r
+\r
+&pcie0 {\r
+       wifi@0,0 {\r
+               compatible = "mediatek,mt76";\r
+               reg = <0x0000 0 0 0 0>;\r
+               ieee80211-freq-limit = <2400000 2500000>;\r
+               nvmem-cells = <&eeprom_factory_0>;\r
+               nvmem-cell-names = "eeprom";\r
+       };\r
+};\r
+\r
+&pcie1 {\r
+       wifi@0,0 {\r
+               compatible = "mediatek,mt76";\r
+               reg = <0x0000 0 0 0 0>;\r
+               ieee80211-freq-limit = <5000000 6000000>;\r
+               nvmem-cells = <&eeprom_factory_8000>;\r
+               nvmem-cell-names = "eeprom";\r
+       };\r
+};\r
+\r
+&gmac0 {\r
+       nvmem-cells = <&macaddr_factory_e000>;\r
+       nvmem-cell-names = "mac-address";\r
+};\r
+\r
+&gmac1 {\r
+       status = "okay";\r
+       label = "wan";\r
+       phy-handle = <&ethphy0>;\r
+\r
+       nvmem-cells = <&macaddr_factory_e006>;\r
+       nvmem-cell-names = "mac-address";\r
+};\r
+\r
+&ethphy0 {\r
+       /delete-property/ interrupts;\r
+};\r
+\r
+&switch0 {\r
+       ports {\r
+               port@1 {\r
+                       status = "okay";\r
+                       label = "lan";\r
+               };\r
+       };\r
+};\r
+\r
+&sdhci {\r
+       status = "okay";\r
+};\r
+\r
+&state_default {\r
+       gpio {\r
+               groups = "jtag", "wdt";\r
+               function = "gpio";\r
+       };\r
+};\r
index ef374d6f4d18509fadf65de3e1333a8a6a93210e..13b6a5196696d1b96131fbfc8cefc127366abca6 100644 (file)
@@ -2148,6 +2148,16 @@ define Device/netis_wf2881
 endef
 TARGET_DEVICES += netis_wf2881
 
+define Device/openfi_5pro
+  $(Device/dsa-migration)
+  IMAGE_SIZE := 65216k
+  DEVICE_VENDOR := OpenFi
+  DEVICE_MODEL := 5Pro 
+  DEVICE_PACKAGES := kmod-mt7603 kmod-mt7615e kmod-mt7663-firmware-ap kmod-usb3 \
+       kmod-sdhci-mt7620
+endef
+TARGET_DEVICES += openfi_5pro
+
 define Device/oraybox_x3a
   $(Device/dsa-migration)
   $(Device/uimage-lzma-loader)
index 247a27d1459c6f382ad65f8db86b33a6f7ff77ac..386a3bb41d874fa3e5194d9bdd8b0060a8aaa46d 100644 (file)
@@ -66,6 +66,7 @@ ramips_setup_interfaces()
                ;;
        asiarf,ap7621-001|\
        humax,e10|\
+       openfi,5pro|\
        wavlink,ws-wn572hp3-4g|\
        winstars,ws-wn583a6)
                ucidef_set_interfaces_lan_wan "lan" "wan"