Explorar o código

ramips: Basic support for the AsiaRF RT5350 based AWM002 module and evaluation board.

Basic support for the AsiaRF RT5350 based AWM002 module and evaluation board.
http://www.asiarf.com/Smallest-Tiny-Ralink-802-11n-Wireless-AP-Router-Module-Board-AWM002-product-view-375.html

Signed-off-by Jon Smirl <[email protected]>

SVN-Revision: 37521
John Crispin %!s(int64=12) %!d(string=hai) anos
pai
achega
3ad136d9e3

+ 1 - 0
target/linux/ramips/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom

@@ -61,6 +61,7 @@ case "$FIRMWARE" in
 	all5002 | \
 	all5003 | \
 	argus-atp52b | \
+	awm002-evb | \
 	bc2 | \
 	br6425 | \
 	broadway | \

+ 1 - 0
target/linux/ramips/base-files/etc/uci-defaults/02_network

@@ -41,6 +41,7 @@ ramips_setup_interfaces()
 	all0256n | \
 	all5002 | \
 	all5003 | \
+	awm002-evb | \
 	broadway | \
 	wnce2001)
 		ucidef_add_switch "switch0" "1" "0"

+ 1 - 0
target/linux/ramips/base-files/lib/preinit/06_set_iface_mac

@@ -55,6 +55,7 @@ preinit_set_mac_address() {
 	all0256n |\
 	all5002 |\
 	all5003 |\
+	awm002-evb |\
 	carambola |\
 	dir-615-h1 |\
 	fonera20n |\

+ 3 - 0
target/linux/ramips/base-files/lib/ramips.sh

@@ -46,6 +46,9 @@ ramips_board_detect() {
 	*"Argus ATP-52B")
 		name="argus-atp52b"
 		;;
+	*"AsiaRF AWM002-EVB")
+		name="awm002-evb"
+		;;
 	*"BR6524N")
 		name="br6524n"
 		;;

+ 1 - 0
target/linux/ramips/base-files/lib/upgrade/platform.sh

@@ -24,6 +24,7 @@ platform_check_image() {
 	all5002 | \
 	all5003 | \
 	asl26555 | \
+	awm002-evb | \
 	bc2 | \
 	broadway | \
 	carambola | \

+ 18 - 0
target/linux/ramips/dts/AWM002-4M.dtsi

@@ -0,0 +1,18 @@
+/dts-v1/;
+
+/include/ "AWM002.dtsi"
+
+/ {
+	compatible = "AWM002", "ralink,rt5350-soc";
+	model = "AsiaRF AWM002";
+
+	palmbus@10000000 {
+
+		spi@b00 {
+			m25p80@0 {
+				compatible = "mx25l3205d";
+				linux,modalias = "m25p80", "mx25l3205d";
+			};
+		};
+	};
+};

+ 18 - 0
target/linux/ramips/dts/AWM002-8M.dtsi

@@ -0,0 +1,18 @@
+/dts-v1/;
+
+/include/ "AWM002.dtsi"
+
+/ {
+	compatible = "AWM002", "ralink,rt5350-soc";
+	model = "AsiaRF AWM002";
+
+	palmbus@10000000 {
+
+		spi@b00 {
+			m25p80@0 {
+				compatible = "mx25l6405d";
+				linux,modalias = "m25p80", "mx25l6405d";
+			};
+		};
+	};
+};

+ 40 - 0
target/linux/ramips/dts/AWM002-EVB-4M.dts

@@ -0,0 +1,40 @@
+/dts-v1/;
+
+/include/ "AWM002-4M.dtsi"
+
+/ {
+	model = "AsiaRF AWM002 EVB";
+
+	gpio-leds {
+		compatible = "gpio-leds";
+		tx {
+			label = "awm002-evb:green:tx";
+			gpios = <&gpio0 15 1>;
+		};
+		rx {
+			label = "awm002-evb:green:rx";
+			gpios = <&gpio0 16 1>;
+		};
+		wps {
+			label = "awm002-evb:green:wps";
+			gpios = <&gpio0 21 1>;
+		};
+	};
+
+	gpio-keys-polled {
+		compatible = "gpio-keys-polled";
+		#address-cells = <1>;
+		#size-cells = <0>;
+		poll-interval = <20>;
+		reset_wps {
+			label = "reset_wps";
+			gpios = <&gpio0 0 1>;
+			linux,code = <0x198>;
+		};
+		mode {
+			label = "mode";
+			gpios = <&gpio0 21 1>;
+			linux,code = <0x32>;
+		};
+	};
+};

+ 40 - 0
target/linux/ramips/dts/AWM002-EVB-8M.dts

@@ -0,0 +1,40 @@
+/dts-v1/;
+
+/include/ "AWM002-8M.dtsi"
+
+/ {
+	model = "AsiaRF AWM002 EVB";
+
+	gpio-leds {
+		compatible = "gpio-leds";
+		tx {
+			label = "awm002-evb:green:tx";
+			gpios = <&gpio0 15 1>;
+		};
+		rx {
+			label = "awm002-evb:green:rx";
+			gpios = <&gpio0 16 1>;
+		};
+		wps {
+			label = "awm002-evb:green:wps";
+			gpios = <&gpio0 21 1>;
+		};
+	};
+
+	gpio-keys-polled {
+		compatible = "gpio-keys-polled";
+		#address-cells = <1>;
+		#size-cells = <0>;
+		poll-interval = <20>;
+		reset_wps {
+			label = "reset_wps";
+			gpios = <&gpio0 0 1>;
+			linux,code = <0x198>;
+		};
+		mode {
+			label = "mode";
+			gpios = <&gpio0 21 1>;
+			linux,code = <0x32>;
+		};
+	};
+};

+ 87 - 0
target/linux/ramips/dts/AWM002.dtsi

@@ -0,0 +1,87 @@
+/dts-v1/;
+
+/include/ "rt5350.dtsi"
+
+/ {
+	compatible = "AWM002", "ralink,rt5350-soc";
+	model = "AsiaRF AWM002";
+
+	palmbus@10000000 {
+		sysc@0 {
+			ralink,pinmux = "spi", "uartlite", "jtag", "mdio", "sdram", "rgmii";
+			ralink,gpiomux = "i2c";
+			ralink,uartmux = "gpio";
+			ralink,wdtmux = <1>;
+		};
+
+		gpio0: gpio@600 {
+			status = "okay";
+		};
+
+		spi@b00 {
+			status = "okay";
+			m25p80@0 {
+				#address-cells = <1>;
+				#size-cells = <1>;
+				reg = <0 0>;
+				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>;
+				};
+			};
+		};
+	};
+
+	ethernet@10100000 {
+		status = "okay";
+	};
+
+	esw@10110000 {
+		status = "okay";
+		ralink,portmap = <0x3f>;
+	};
+
+	wmac@10180000 {
+		status = "okay";
+	};
+
+	ehci@101c0000 {
+		status = "okay";
+	};
+
+	ohci@101c1000 {
+		status = "okay";
+	};
+
+	gpio-leds {
+		compatible = "gpio-leds";
+		ld1 {
+			label = "asiarf:green:ld1";
+			gpios = <&gpio0 0 1>;
+		};
+		ld2 {
+			label = "asiarf:green:ld2";
+			gpios = <&gpio0 1 1>;
+		};
+	};
+};

+ 3 - 0
target/linux/ramips/image/Makefile

@@ -281,6 +281,8 @@ define BuildFirmware/ASL26555/initramfs
 endef
 Image/Build/Profile/ASL26555=$(call BuildFirmware/ASL26555/$(1),$(1),asl26555,ASL26555)
 
+Image/Build/Profile/AWM002-EVB=$(call BuildFirmware/DefaultDualSize/$(1),$(1),awm002-evb,AWM002-EVB)
+
 Image/Build/Profile/BC2=$(call BuildFirmware/Default8M/$(1),$(1),bc2,BC2)
 
 broadway_mtd_size=7929856
@@ -448,6 +450,7 @@ define Image/Build/Profile/Default
 	$(call Image/Build/Profile/ALL5003,$(1))
 	$(call Image/Build/Profile/ARGUS_ATP52B,$(1))
 	$(call Image/Build/Profile/ASL26555,$(1))
+	$(call Image/Build/Profile/AWM002-EVB,$(1))
 	$(call Image/Build/Profile/BC2,$(1))
 	$(call Image/Build/Profile/BROADWAY,$(1))
 	$(call Image/Build/Profile/CARAMBOLA,$(1))

+ 18 - 0
target/linux/ramips/rt305x/profiles/asiarf.mk

@@ -0,0 +1,18 @@
+#
+# Copyright (C) 2012 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+define Profile/AWM002-EVB
+	NAME:=AsiaRF AWM002-EVB
+	PACKAGES:=kmod-usb-core kmod-usb-ohci kmod-usb2 kmod-ledtrig-usbdev \
+	kmod-i2c-core kmod-i2c-gpio
+endef
+
+define Profile/AWM002-EVB/Description
+	Package set for AsiaRF AWM002 Evaluation Board
+endef
+
+$(eval $(call Profile,AWM002-EVB))