This adds support for an unbranded small rt5350-based device. PCB
silkscreen layer has "MIFI-F5 V1.0" marking. Commonly available from
eBay as "2G/3G/4G WiFi router", it has 1 Ethernet port and 1 USB2.0
host connector, wireless is 802.11n 1x1 2.4 GHz with a chip antenna.

My version came with 32M RAM and 4M flash but there're reports of
people receiving 8M flash or 16M RAM.

To make use of this board one needs to reflash the bootloader to a
ralink stock first, as the vendor seems to be using a different CRC
calculation scheme. It's possible to perform this with "mtd_write"
command (which is actually an illegal copy of OpenWrt's "mtd"), as
well as flashing a squashfs image on top of the vendor's one.

Serial, leds, button, wifi, usb real-life tested. Wired ethernet is
possibly broken.

Signed-off-by: Paul Fertser <fercer...@gmail.com>
---
 target/linux/ramips/base-files/etc/diag.sh         |   3 +
 .../etc/hotplug.d/firmware/10-rt2x00-eeprom        |   1 +
 .../ramips/base-files/etc/uci-defaults/01_leds     |   4 +
 .../ramips/base-files/etc/uci-defaults/02_network  |   1 +
 .../ramips/base-files/lib/preinit/06_set_iface_mac |   1 +
 target/linux/ramips/base-files/lib/ramips.sh       |   3 +
 .../ramips/base-files/lib/upgrade/platform.sh      |   1 +
 target/linux/ramips/dts/MIFI-F5.dts                | 103 +++++++++++++++++++++
 target/linux/ramips/image/Makefile                 |   3 +
 target/linux/ramips/rt305x/profiles/mifi.mk        |  18 ++++
 10 files changed, 138 insertions(+)
 create mode 100644 target/linux/ramips/dts/MIFI-F5.dts
 create mode 100644 target/linux/ramips/rt305x/profiles/mifi.mk

diff --git a/target/linux/ramips/base-files/etc/diag.sh 
b/target/linux/ramips/base-files/etc/diag.sh
index 1d8bef1..bda18a3 100755
--- a/target/linux/ramips/base-files/etc/diag.sh
+++ b/target/linux/ramips/base-files/etc/diag.sh
@@ -160,6 +160,9 @@ get_status_led() {
                ;;
        f7c027)
                status_led="belkin:orange:status"
+               ;;
+       mifi-f5)
+               status_led="mifi:blue:wifi"
         ;;
        esac
 }
diff --git 
a/target/linux/ramips/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom 
b/target/linux/ramips/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom
index d38aadd..c5d3c1c 100644
--- a/target/linux/ramips/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom
+++ b/target/linux/ramips/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom
@@ -83,6 +83,7 @@ case "$FIRMWARE" in
        freestation5 | \
        hlk-rm04 | \
        hw550-3g | \
+       mifi-f5 | \
        mofi3500-3gn | \
        mpr-a1 | \
        mpr-a2 | \
diff --git a/target/linux/ramips/base-files/etc/uci-defaults/01_leds 
b/target/linux/ramips/base-files/etc/uci-defaults/01_leds
index 0c54cde..5455e04 100755
--- a/target/linux/ramips/base-files/etc/uci-defaults/01_leds
+++ b/target/linux/ramips/base-files/etc/uci-defaults/01_leds
@@ -100,6 +100,10 @@ case $board in
        hw550-3g)
                set_usb_led "hw550-3g:green:usb"
                ;;
+       mifi-f5)
+               set_usb_led "mifi:red:power"
+               set_wifi_led "mifi:blue:wifi"
+               ;;
        mofi3500-3gn)
                set_usb_led "mofi3500-3gn:green:usb"
                ;;
diff --git a/target/linux/ramips/base-files/etc/uci-defaults/02_network 
b/target/linux/ramips/base-files/etc/uci-defaults/02_network
index 7c14ad3..686bc61 100755
--- a/target/linux/ramips/base-files/etc/uci-defaults/02_network
+++ b/target/linux/ramips/base-files/etc/uci-defaults/02_network
@@ -139,6 +139,7 @@ ramips_setup_interfaces()
                ;;
 
        d105 | \
+       mifi-f5 | \
        omni-emb-hpm|\
        wli-tx4-ag300n)
                ucidef_set_interface_lan "eth0"
diff --git a/target/linux/ramips/base-files/lib/preinit/06_set_iface_mac 
b/target/linux/ramips/base-files/lib/preinit/06_set_iface_mac
index 96665bd..cb72e79 100644
--- a/target/linux/ramips/base-files/lib/preinit/06_set_iface_mac
+++ b/target/linux/ramips/base-files/lib/preinit/06_set_iface_mac
@@ -14,6 +14,7 @@ preinit_set_mac_address() {
        3g300m | \
        dir-620-d1 |\
        dir-300-b7 | \
+       mifi-f5 | \
        w150m | \
        mzk-w300nh2 |\
        wl-330n |\
diff --git a/target/linux/ramips/base-files/lib/ramips.sh 
b/target/linux/ramips/base-files/lib/ramips.sh
index 24aad1f..d45f8e5 100755
--- a/target/linux/ramips/base-files/lib/ramips.sh
+++ b/target/linux/ramips/base-files/lib/ramips.sh
@@ -277,6 +277,9 @@ ramips_board_detect() {
        *"V22SG")
                name="v22sg"
                ;;
+       *"MIFI F5")
+               name="mifi-f5"
+               ;;
        *)
                name="generic"
                ;;
diff --git a/target/linux/ramips/base-files/lib/upgrade/platform.sh 
b/target/linux/ramips/base-files/lib/upgrade/platform.sh
index 0230a18..a3e81ca 100755
--- a/target/linux/ramips/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ramips/base-files/lib/upgrade/platform.sh
@@ -52,6 +52,7 @@ platform_check_image() {
        ip2202 | \
        m3 | \
        m4 | \
+       mifi-f5 | \
        mofi3500-3gn | \
        mpr-a1 | \
        mpr-a2 | \
diff --git a/target/linux/ramips/dts/MIFI-F5.dts 
b/target/linux/ramips/dts/MIFI-F5.dts
new file mode 100644
index 0000000..1d1a76a
--- /dev/null
+++ b/target/linux/ramips/dts/MIFI-F5.dts
@@ -0,0 +1,103 @@
+/dts-v1/;
+
+/include/ "rt5350.dtsi"
+
+/ {
+       compatible = "MIFI-F5", "ralink,rt5350-soc";
+       model = "MIFI F5";
+
+       palmbus@10000000 {
+               spi@b00 {
+                       status = "okay";
+                       m25p80@0 {
+                               #address-cells = <1>;
+                               #size-cells = <1>;
+                               compatible = "mx25l3205d", "m25p80";
+                               reg = <0 0>;
+                               linux,modalias = "m25p80", "mx25l3205d";
+                               spi-max-frequency = <10000000>;
+
+                               partition@0 {
+                                       label = "u-boot";
+                                       reg = <0x0 0x30000>;
+                                       read-only;
+                               };
+
+                               partition@30000 {
+                                       label = "u-boot-env";
+                                       reg = <0x30000 0x10000>;
+                                       read-only;
+                               };
+
+                               factory: partition@40000 {
+                                       label = "factory";
+                                       reg = <0x40000 0x10000>;
+                                       read-only;
+                               };
+
+                               partition@50000 {
+                                       label = "firmware";
+                                       reg = <0x50000 0x1fb0000>;
+                               };
+                       };
+               };
+       };
+
+       pinctrl {
+               state_default: pinctrl0 {
+                       gpio {
+                               ralink,group = "jtag", "uartf";
+                               ralink,function = "gpio";
+                       };
+               };
+       };
+
+       esw@10110000 {
+               ralink,portmap = <0x3f>;
+       };
+
+       ehci@101c0000 {
+               status = "okay";
+       };
+
+       ohci@101c1000 {
+               status = "okay";
+       };
+
+       gpio-leds {
+               compatible = "gpio-leds";
+               wifi {
+                       label = "mifi:blue:wifi";
+                       gpios = <&gpio0 20 1>;
+               };
+               power {
+                       label = "mifi:red:power";
+                       gpios = <&gpio0 17 1>;
+               };
+       };
+        gpio-keys-polled {
+                compatible = "gpio-keys-polled";
+                poll-interval = <20>;
+                reset {
+                        label = "reset";
+                        gpios = <&gpio0 0 1>;
+                        linux,code = <0x198>;
+                };
+       };
+       gpio_export {
+               compatible = "gpio-export";
+
+               usb {
+                       gpio-export,name = "usb";
+                       gpio-export,output = <1>;
+                       gpios = <&gpio0 7 0>;
+               };
+
+               root_hub {
+                       gpio-export,name = "root_hub";
+                       gpio-export,output = <1>;
+                       gpios = <&gpio0 12 0>;
+               };
+       };
+};
+
diff --git a/target/linux/ramips/image/Makefile 
b/target/linux/ramips/image/Makefile
index adf5620..ea6913a 100644
--- a/target/linux/ramips/image/Makefile
+++ b/target/linux/ramips/image/Makefile
@@ -451,6 +451,8 @@ Image/Build/Profile/W502U=$(call 
BuildFirmware/Default8M/$(1),$(1),w502u,W502U)
 
 Image/Build/Profile/WCR150GN=$(call 
BuildFirmware/Default4M/$(1),$(1),wcr150gn,WCR150GN)
 
+Image/Build/Profile/MIFI-F5=$(call 
BuildFirmware/Default4M/$(1),$(1),mifi-f5,MIFI-F5)
+
 buffalo_whrg300n_mtd_size=3801088
 define BuildFirmware/WHRG300N/squashfs
        $(call BuildFirmware/Default4M/$(1),$(1),whr-g300n,WHR-G300N)
@@ -562,6 +564,7 @@ define Image/Build/Profile/Default
        $(call Image/Build/Profile/IP2202,$(1))
        $(call Image/Build/Profile/M3,$(1))
        $(call Image/Build/Profile/M4,$(1))
+       $(call Image/Build/Profile/MIFI-F5,$(1))
        $(call Image/Build/Profile/MOFI3500-3GN,$(1))
        $(call Image/Build/Profile/MPRA2,$(1))
        $(call Image/Build/Profile/MZKW300NH2,$(1))
diff --git a/target/linux/ramips/rt305x/profiles/mifi.mk 
b/target/linux/ramips/rt305x/profiles/mifi.mk
new file mode 100644
index 0000000..2df91d5
--- /dev/null
+++ b/target/linux/ramips/rt305x/profiles/mifi.mk
@@ -0,0 +1,18 @@
+#
+# Copyright (C) 2014 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+define Profile/MIFI-F5
+       NAME:=MIFI F5
+       PACKAGES:=kmod-usb-core kmod-usb2 kmod-ledtrig-netdev kmod-ledtrig-timer
+endef
+
+define Profile/MIFI-F5/Description
+       Package set for MIFI F5 board
+endef
+
+$(eval $(call Profile,MIFI-F5))
+
-- 
1.8.3.2
_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

Reply via email to