ramips: add asiarf awapn2403 support
authorJohn Crispin <john@openwrt.org>
Fri, 13 Jun 2014 09:16:15 +0000 (09:16 +0000)
committerJohn Crispin <john@openwrt.org>
Fri, 13 Jun 2014 09:16:15 +0000 (09:16 +0000)
Signed-off-by: John Crispin <blogic@openwrt.org>
SVN-Revision: 41177

target/linux/ramips/base-files/etc/diag.sh
target/linux/ramips/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom
target/linux/ramips/base-files/etc/uci-defaults/01_leds
target/linux/ramips/base-files/etc/uci-defaults/02_network
target/linux/ramips/base-files/lib/ramips.sh
target/linux/ramips/base-files/lib/upgrade/platform.sh
target/linux/ramips/dts/AWAPN2403.dts [new file with mode: 0644]
target/linux/ramips/image/Makefile
target/linux/ramips/rt305x/profiles/asiarf.mk

index f9b4168245d010a252d9c44940513bf886a88d1d..14d630edcf170b41471319e08d74c5a40d8b783d 100755 (executable)
@@ -15,6 +15,9 @@ get_status_led() {
        ar725w)
                status_led="ar725w:green:power"
                ;;
+       awapn2403)
+               status_led="asiarf:green:wps"
+               ;;
        argus-atp52b)
                status_led="argus-atp52b:green:run"
                ;;
index b57bfd82ae441ad5cb8f90005c69aa8fd1abffbd..904afd1a41236e72a9b4536cef0f3a54a07734c4 100644 (file)
@@ -64,6 +64,7 @@ case "$FIRMWARE" in
        all5003 | \
        argus-atp52b | \
        awm002-evb | \
+       awapn2403 | \
        bc2 | \
        br6425 | \
        br-6475nd | \
index 23c24515e220fb46e71dace7790fa7dff0d17b77..c5e380cbc6e37c2fde840dafcae90b21ada6ca8f 100755 (executable)
@@ -35,6 +35,9 @@ case $board in
                ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "all0256n:green:rssihigh" "wlan0" "70" "100" "-69" "8"
                set_wifi_led "rt2800pci-phy0::radio"
                ;;
+       awapn2403)
+               set_wifi_led "rt2800soc-phy0::radio"
+               ;;
        ar725w)
                set_wifi_led "rt2800soc-phy0::radio"
                ;;
index 02a4da9d3a4add7e1472ae012441e461185be6a6..0c3daff960e7db7ea73b86ce9671ad4709990a84 100755 (executable)
@@ -64,6 +64,13 @@ ramips_setup_interfaces()
                ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
                ;;
 
+       awapn2403)
+               ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
+               ucidef_add_switch "switch0" "1" "1"
+               ucidef_add_switch_vlan "switch0" "1" "0 6t"
+               ucidef_add_switch_vlan "switch0" "2" "1 6t"
+               ;;
+
        br-6475nd)
                ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
                ucidef_add_switch "switch0" "1" "1"
index f9732f8eeb9dae8088e85ed4e068eed99a4497bb..5d897fc521da922647c86bea68d2a38b63a87bca 100755 (executable)
@@ -55,6 +55,9 @@ ramips_board_detect() {
        *"AsiaRF AWM002 EVB")
                name="awm002-evb"
                ;;
+       *"AsiaRF AWAPN2403")
+               name="awapn2403"
+               ;;
        *"BR6524N")
                name="br6524n"
                ;;
index 190de9fbf1f35400d47df9eb1e8871acc82286b1..a39c433e8f5b82bda7571c88d271debb97547a06 100755 (executable)
@@ -26,6 +26,7 @@ platform_check_image() {
        ar725w | \
        asl26555 | \
        awm002-evb | \
+       awapn2403 | \
        bc2 | \
        broadway | \
        carambola | \
diff --git a/target/linux/ramips/dts/AWAPN2403.dts b/target/linux/ramips/dts/AWAPN2403.dts
new file mode 100644 (file)
index 0000000..068c800
--- /dev/null
@@ -0,0 +1,78 @@
+/dts-v1/;
+
+/include/ "rt3050.dtsi"
+
+/ {
+       compatible = "AWAPN2403", "ralink,rt3052-soc";
+       model =  "AsiaRF AWAPN2403";
+
+       palmbus@10000000 {
+               spi@b00 {
+                       status = "okay";
+                       m25p80@0 {
+                               #address-cells = <1>;
+                               #size-cells = <1>;
+                               compatible = "mx25l3205d";
+                               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 0x3b0000>;
+                               };
+                       };
+               };
+       };
+
+       pinctrl {
+               state_default: pinctrl0 {
+                       gpio {
+                               ralink,group = "i2c", "jtag", "rgmii", "mdio", "uartf";
+                               ralink,function = "gpio";
+                       };
+               };
+       };
+
+       esw@10110000 {
+               ralink,portmap = <0x3e>;
+       };
+
+       gpio-leds {
+               compatible = "gpio-leds";
+               link {
+                       label = "asiarf:green:wps";
+                       gpios = <&gpio0 14 1>;
+               };
+       };
+
+       gpio-keys-polled {
+               compatible = "gpio-keys-polled";
+               #address-cells = <1>;
+               #size-cells = <0>;
+               poll-interval = <20>;
+               reset {
+                       label = "reset";
+                       gpios = <&gpio0 0 1>;
+                       linux,code = <0x198>;
+               };
+       };
+};
index 3b813d8be5c8773e83df2308d269295fcdd15365..58a54773c2806073ef983a601f9861ef24d88326 100644 (file)
@@ -348,6 +348,7 @@ endef
 Image/Build/Profile/ASL26555=$(call BuildFirmware/ASL26555/$(1),$(1),asl26555,ASL26555)
 
 Image/Build/Profile/AWM002EVB=$(call BuildFirmware/DefaultDualSize/$(1),$(1),awm002-evb,AWM002-EVB)
+Image/Build/Profile/AWAPN2403=$(call BuildFirmware/Default4M/$(1),$(1),awmapn2403,AWAPN2403)
 
 Image/Build/Profile/BC2=$(call BuildFirmware/Default8M/$(1),$(1),bc2,BC2)
 
@@ -562,6 +563,7 @@ define Image/Build/Profile/Default
        $(call Image/Build/Profile/ARGUS_ATP52B,$(1))
        $(call Image/Build/Profile/ASL26555,$(1))
        $(call Image/Build/Profile/AWM002EVB,$(1))
+       $(call Image/Build/Profile/AWAPN2403,$(1))
        $(call Image/Build/Profile/BC2,$(1))
        $(call Image/Build/Profile/BROADWAY,$(1))
        $(call Image/Build/Profile/CARAMBOLA,$(1))
index 8b1f75700b2c9df2271c2c52333f12991a0dcddb..2d5231d08e3bd4ee8db5174156303f5f56526cbe 100644 (file)
@@ -1,18 +1,16 @@
 #
-# Copyright (C) 2012 OpenWrt.org
+# Copyright (C) 2014 OpenWrt.org
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
 #
 
-define Profile/AWM002EVB
-       NAME:=AsiaRF AWM002-EVB
-       PACKAGES:=kmod-usb-core kmod-usb-ohci kmod-usb2 kmod-ledtrig-usbdev \
-       kmod-i2c-core kmod-i2c-gpio
+define Profile/AWAPN2403
+       NAME:=AisaRF AWAPN2403
 endef
 
-define Profile/AWM002EVB/Description
-       Package set for AsiaRF AWM002 Evaluation Board
+define Profile/AWAPN2403/Description
+       Package set for Allnet ALL0239-3G
 endef
 
-$(eval $(call Profile,AWM002EVB))
+$(eval $(call Profile,AWAPN2403))