[OpenWrt-Devel] [PATCH] [ramips] Add support for Omnima MiniCloudless boards

Ivan ivan at omnima.co.uk
Fri Apr 8 06:25:07 EDT 2016


This patch adds support for Omnima MiniCloudless MT7620 + MT76x12 
Concurrent Dual Band platform.

Tested on the board and patch applies to OpenWrt r49119 checked out on 
7th April 2016.

Signed-off-by: Ivan Ignjatic <ivan at omnima.co.uk>

---

diff --git a/target/linux/ramips/base-files/etc/board.d/01_leds 
b/target/linux/ramips/base-files/etc/board.d/01_leds
index 5816e60..2b11a9f 100755
--- a/target/linux/ramips/base-files/etc/board.d/01_leds
+++ b/target/linux/ramips/base-files/etc/board.d/01_leds
@@ -182,6 +182,10 @@ miniembplug)
      set_wifi_led "$board:red:wlan"
      set_usb_led "$board:green:mobile"
      ;;
+minicloudless)
+    set_wifi_led "$board:red:wifi"
+    ucidef_set_led_netdev "eth" "Ethernet" "$board:green:lan" "eth0"
+    ;;
  miwifi-mini)
      ucidef_set_led_default "power" "power" "$board:red:status" "1"
      ;;
diff --git a/target/linux/ramips/base-files/etc/board.d/02_network 
b/target/linux/ramips/base-files/etc/board.d/02_network
index 4b65d36..488ab50 100755
--- a/target/linux/ramips/base-files/etc/board.d/02_network
+++ b/target/linux/ramips/base-files/etc/board.d/02_network
@@ -129,7 +129,8 @@ ramips_setup_interfaces()
      wrtnode2p | \
      wrtnode2r | \
      wt3020|\
-    zbt-wa05)
+    zbt-wa05|\
+    minicloudless)
          ucidef_add_switch "switch0" \
              "1:lan" "2:lan" "3:lan" "4:lan" "0:wan" "6 at eth0"
          ;;
diff --git a/target/linux/ramips/base-files/etc/diag.sh 
b/target/linux/ramips/base-files/etc/diag.sh
index daa7fb1..809d780 100644
--- a/target/linux/ramips/base-files/etc/diag.sh
+++ b/target/linux/ramips/base-files/etc/diag.sh
@@ -131,6 +131,9 @@ get_status_led() {
      zte-q7)
          status_led="$board:red:status"
          ;;
+        minicloudless)
+                status_led="$board:red:wifi"
+                ;;
      mr-102n)
          status_led="$board:amber:status"
          ;;
diff --git a/target/linux/ramips/base-files/lib/ramips.sh 
b/target/linux/ramips/base-files/lib/ramips.sh
index 5f1df7b..58d367e 100755
--- a/target/linux/ramips/base-files/lib/ramips.sh
+++ b/target/linux/ramips/base-files/lib/ramips.sh
@@ -247,6 +247,9 @@ ramips_board_detect() {
      *"MiniEMBWiFi")
          name="miniembwifi"
          ;;
+        *"MiniCloudless")
+                name="minicloudless"
+                ;;
      *"MiWiFi Mini")
          name="miwifi-mini"
          ;;
diff --git a/target/linux/ramips/base-files/lib/upgrade/platform.sh 
b/target/linux/ramips/base-files/lib/upgrade/platform.sh
index c329dce..5014316 100755
--- a/target/linux/ramips/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ramips/base-files/lib/upgrade/platform.sh
@@ -77,6 +77,7 @@ platform_check_image() {
      microwrt|\
      miniembplug|\
      miniembwifi|\
+    minicloudless|\
      miwifi-mini|\
      miwifi-nano|\
      mlw221|\
diff --git a/target/linux/ramips/dts/MINICLOUDLESS.dts 
b/target/linux/ramips/dts/MINICLOUDLESS.dts
new file mode 100644
index 0000000..e49977e
--- /dev/null
+++ b/target/linux/ramips/dts/MINICLOUDLESS.dts
@@ -0,0 +1,145 @@
+/dts-v1/;
+
+/include/ "mt7620a.dtsi"
+
+/ {
+    compatible = "minicloudless", "ralink,mt7620a-soc";
+    model = "Omnima MiniCloudless";
+
+    chosen {
+        bootargs = "console=ttyS0,57600";
+    };
+
+    palmbus at 10000000 {
+                gpio0: gpio at 600 {
+                        status = "okay";
+                };
+
+                gpio1: gpio at 638 {
+                        status = "okay";
+                };
+
+                gpio2: gpio at 660 {
+                        status = "okay";
+                };
+
+                gpio3: gpio at 688 {
+                        status = "okay";
+                };
+
+        spi at b00 {
+            status = "okay";
+
+            m25p80 at 0 {
+                #address-cells = <1>;
+                #size-cells = <1>;
+                compatible = "mx25l12805d";
+                reg = <0 0>;
+                linux,modalias = "m25p80", "m25p128";
+                spi-max-frequency = <10000000>;
+
+                partition at 0 {
+                    label = "u-boot";
+                    reg = <0x0 0x20000>;
+                    read-only;
+                };
+
+                partition at 20000 {
+                    label = "u-boot-env-ext";
+                    reg = <0x20000 0x10000>;
+                };
+
+                partition at 30000 {
+                    label = "u-boot-env";
+                    reg = <0x30000 0x2000>;
+                    read-only;
+                };
+
+                partition at 32000 {
+                    label = "u-boot-env+ext";
+                    reg = <0x32000 0xE000>;
+                };
+
+                factory: partition at 40000 {
+                    label = "factory";
+                    reg = <0x40000 0x10000>;
+                    read-only;
+                };
+
+                partition at 50000 {
+                    label = "firmware";
+                    reg = <0x50000 0xfb0000>;
+                };
+            };
+        };
+    };
+
+    ehci at 101c0000 {
+        status = "okay";
+    };
+
+    ohci at 101c1000 {
+        status = "okay";
+    };
+
+    pcie at 10140000 {
+        status = "okay";
+
+        pcie-bridge {
+            mt76 at 0,0 {
+                reg = <0x0000 0 0 0 0>;
+                device_type = "pci";
+                mediatek,mtd-eeprom = <&factory 0x8000>;
+                mediatek,2ghz = <0>;
+            };
+        };
+    };
+
+    ethernet at 10100000 {
+        mtd-mac-address = <&factory 0x4>;
+        ralink,port-map = "wllll";
+    };
+
+    wmac at 10180000 {
+        ralink,mtd-eeprom = <&factory 0>;
+    };
+
+    otg at 101c0000 {
+        status = "okay";
+    };
+
+    pinctrl {
+        state_default: pinctrl0 {
+            default {
+                ralink,group = "wled", "i2c", "wdt", "ephy", "uartf";
+                ralink,function = "gpio";
+            };
+        };
+    };
+
+
+    gpio-keys-polled {
+        compatible = "gpio-keys-polled";
+        #address-cells = <1>;
+        #size-cells = <0>;
+        poll-interval = <20>;
+        reset {
+            label = "reset";
+            gpios = <&gpio2 3 1>;
+            linux,code = <0x198>;
+        };
+    };
+
+        gpio-leds {
+                compatible = "gpio-leds";
+        wifi {
+            label = "minicloudless:red:wifi";
+            gpios = <&gpio3 0 1>;
+        };
+
+        lan {
+            label = "minicloudless:green:lan";
+            gpios = <&gpio2 4 1>;
+        };
+    };
+};
diff --git a/target/linux/ramips/image/mt7620.mk 
b/target/linux/ramips/image/mt7620.mk
index 18cd20a..0af9791 100644
--- a/target/linux/ramips/image/mt7620.mk
+++ b/target/linux/ramips/image/mt7620.mk
@@ -113,7 +113,7 @@ Image/Build/Profile/ArcherC20i=$(call 
BuildFirmware/Tplink/$(1),$(1),ArcherC20i,
  microwrt_mtd_size=16515072
  Image/Build/Profile/MicroWRT=$(call 
BuildFirmware/CustomFlash/$(1),$(1),microwrt,MicroWRT,$(microwrt_mtd_size))
  Image/Build/Profile/TINY-AC=$(call 
BuildFirmware/Default8M/$(1),$(1),tiny-ac,TINY-AC)
-
+Image/Build/Profile/MINICLOUDLESS=$(call 
BuildFirmware/Default16M/$(1),$(1),minicloudless,MINICLOUDLESS)

  define Image/Build/Profile/Default
      $(call Image/Build/Profile/E1700,$(1))
@@ -157,4 +157,5 @@ define Image/Build/Profile/Default
      $(call Image/Build/Profile/ArcherC20i,$(1))
      $(call Image/Build/Profile/MicroWRT,$(1))
      $(call Image/Build/Profile/TINY-AC,$(1))
+    $(call Image/Build/Profile/MINICLOUDLESS,$(1))
  endef
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


More information about the openwrt-devel mailing list