ramips: DIR-610-A1 Support
authorblogic <blogic@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Wed, 14 Aug 2013 19:35:27 +0000 (19:35 +0000)
committerblogic <blogic@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Wed, 14 Aug 2013 19:35:27 +0000 (19:35 +0000)
http://patchwork.openwrt.org/patch/3933/

Signed-off-by: Flavio Silveira <fggs@terra.com.br>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@37785 3c298f89-4303-0410-b956-a3cf2f4a3e73

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/preinit/06_set_iface_mac
target/linux/ramips/base-files/lib/ramips.sh
target/linux/ramips/dts/DIR-610-A1.dts [new file with mode: 0644]
target/linux/ramips/image/Makefile
target/linux/ramips/rt305x/profiles/dlink.mk

index 6ecb133..c0fdc88 100755 (executable)
@@ -27,7 +27,7 @@ get_status_led() {
        d105)
                status_led="d105:red:power"
                ;;
        d105)
                status_led="d105:red:power"
                ;;
-       dir-300-b1 | dir-600-b1 | dir-600-b2 | dir-615-h1 | dir-615-d | dir-620-a1| dir-620-d1)
+       dir-300-b1 | dir-600-b1 | dir-600-b2 | dir-610-a1 | dir-615-h1 | dir-615-d | dir-620-a1| dir-620-d1)
                status_led="d-link:green:status"
                ;;
        dir-645)
                status_led="d-link:green:status"
                ;;
        dir-645)
index 9e9e09b..a80ea4f 100644 (file)
@@ -68,6 +68,7 @@ case "$FIRMWARE" in
        br6524n | \
        carambola | \
        d105 | \
        br6524n | \
        carambola | \
        d105 | \
+       dir-610-a1 | \
        dir-615-h1 | \
        dir-620-a1 | \
        dir-620-d1 | \
        dir-615-h1 | \
        dir-620-a1 | \
        dir-620-d1 | \
index 7bec16f..64c7c5e 100755 (executable)
@@ -77,6 +77,7 @@ case $board in
        dir-810l)
                ucidef_set_led_default "power" "POWER" "dlink:green:power" "1"
                ;;
        dir-810l)
                ucidef_set_led_default "power" "POWER" "dlink:green:power" "1"
                ;;
+       dir-610-a1 |\
        esr-9753)
                set_wifi_led "rt2800pci-phy0::radio"
                ;;
        esr-9753)
                set_wifi_led "rt2800pci-phy0::radio"
                ;;
index 1d77e7c..e444ef2 100755 (executable)
@@ -77,6 +77,7 @@ ramips_setup_interfaces()
                ucidef_add_switch_vlan "switch0" "2" "0 6t"
                ;;
 
                ucidef_add_switch_vlan "switch0" "2" "0 6t"
                ;;
 
+       dir-610-a1 | \
        dir-615-h1 | \
        mzk-w300nh2)
                ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
        dir-615-h1 | \
        mzk-w300nh2)
                ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
@@ -205,7 +206,8 @@ ramips_setup_macs()
 
        dir-300-b1 |\
        dir-300-b2 |\
 
        dir-300-b1 |\
        dir-300-b2 |\
-       dir-600-b1)
+       dir-600-b1 |\
+       dir-610-a1)
                lan_mac=$(mtd_get_mac_binary devdata 16388)
                wan_mac=$(macaddr_add "$lan_mac" 1)
                ;;
                lan_mac=$(mtd_get_mac_binary devdata 16388)
                wan_mac=$(macaddr_add "$lan_mac" 1)
                ;;
index a0d9b61..44cab3a 100644 (file)
@@ -39,7 +39,8 @@ preinit_set_mac_address() {
        asl26555 |\
        dir-300-b1 |\
        dir-300-b2 |\
        asl26555 |\
        dir-300-b1 |\
        dir-300-b2 |\
-       dir-600-b1)
+       dir-600-b1 |\
+       dir-610-a1)
                 mac=$(mtd_get_mac_binary devdata 16388)
                 ifconfig eth0 hw ether $mac 2>/dev/null
                 ;;
                 mac=$(mtd_get_mac_binary devdata 16388)
                 ifconfig eth0 hw ether $mac 2>/dev/null
                 ;;
index 3ec44d2..066f3bd 100755 (executable)
@@ -73,6 +73,9 @@ ramips_board_detect() {
        *"DIR-600 B2")
                name="dir-600-b2"
                ;;
        *"DIR-600 B2")
                name="dir-600-b2"
                ;;
+       *"DIR-610 A1")
+               name="dir-610-a1"
+               ;;
        *"DIR-620 A1")
                name="dir-620-a1"
                ;;
        *"DIR-620 A1")
                name="dir-620-a1"
                ;;
diff --git a/target/linux/ramips/dts/DIR-610-A1.dts b/target/linux/ramips/dts/DIR-610-A1.dts
new file mode 100644 (file)
index 0000000..ed5606a
--- /dev/null
@@ -0,0 +1,100 @@
+/dts-v1/;
+
+/include/ "rt5350.dtsi"
+
+/ {
+       compatible = "DIR-610-A1", "ralink,rt5350-soc";
+       model = "D-Link DIR-610 A1";
+       
+       palmbus@10000000 {
+               sysc@0 {
+                       ralink,pinmux = "i2c", "spi", "jtag", "uartlite", "mdio", "sdram", "rgmii";
+                       ralink,uartmux = "gpio";
+                       ralink,wdtmux = <1>;
+               };
+
+               gpio0: gpio@600 {
+                       status = "okay";
+               };
+
+               spi@b00 {
+                       status = "okay";
+                       m25p80@0 {
+                               #address-cells = <1>;
+                               #size-cells = <1>;
+                               compatible = "f25l32pa", "m25p80";
+                               reg = <0 0>;
+                               linux,modalias = "m25p80";
+                               spi-max-frequency = <10000000>;
+
+                               partition@0 {
+                                       label = "u-boot";
+                                       reg = <0x0 0x30000>;
+                                       read-only;
+                               };
+
+                               partition@30000 {
+                                       label = "devdata";
+                                       reg = <0x30000 0x10000>;
+                                       read-only;
+                               };
+
+                               factory: partition@40000 {
+                                       label = "factory";
+                                       reg = <0x40000 0x10000>;
+                                       read-only;
+                               };
+
+                               partition@50000 {
+                                       label = "firmware";
+                                       reg = <0x50000 0x3b0000>;
+                               };
+                       };
+               };
+       };
+
+       ethernet@10100000 {
+               status = "okay";
+       };
+
+       esw@10110000 {
+               status = "okay";
+               ralink,portmap = <0x1f>;
+               ralink,led-polarity = <0>;
+       };
+
+       gpio-leds {
+               compatible = "gpio-leds";
+               status {
+                       label = "d-link:green:status";
+                       gpios = <&gpio0 9 1>;
+               };
+               wps {
+                       label = "d-link:green:wps";
+                       gpios = <&gpio0 13 1>;
+               };
+        };
+
+        gpio-keys-polled {
+               gpio-keys-polled {
+               compatible = "gpio-keys-polled";
+               #address-cells = <1>;
+               #size-cells = <0>;
+               poll-interval = <20>;
+                       reset {
+                               label = "reset";
+                               gpios = <&gpio0 10 1>;
+                               linux,code = <0x198>;
+                       };
+                       wps {
+                               label = "wps";
+                               gpios = <&gpio0 0 1>;
+                               linux,code = <0x211>;
+                       };
+               };
+       };
+
+       wmac@10180000 {
+               status = "okay";
+       };
+};
index ccae6be..18f0fe5 100644 (file)
@@ -280,6 +280,8 @@ endif
 # RT305X Profiles
 #
 
 # RT305X Profiles
 #
 
+Image/Build/Profile/DIR610A1=$(call BuildFirmware/Seama/$(1),$(1),dir-610-a1,DIR-610-A1,wrgn59_dlob.hans_dir610,ralink_default_fw_size_4M)
+
 edimax_3g6200n_mtd_size=3735552
 Image/Build/Profile/3G6200N=$(call BuildFirmware/Edimax/$(1),$(1),3g-6200n,3G-6200N,$(edimax_3g6200n_mtd_size),CSYS,3G62,0x50000,0xc0000)
 
 edimax_3g6200n_mtd_size=3735552
 Image/Build/Profile/3G6200N=$(call BuildFirmware/Edimax/$(1),$(1),3g-6200n,3G-6200N,$(edimax_3g6200n_mtd_size),CSYS,3G62,0x50000,0xc0000)
 
@@ -505,6 +507,7 @@ define Image/Build/Profile/Default
        $(call Image/Build/Profile/DIR-300-B1,$(1))
        $(call Image/Build/Profile/DIR-600-B1,$(1))
        $(call Image/Build/Profile/DIR-600-B2,$(1))
        $(call Image/Build/Profile/DIR-300-B1,$(1))
        $(call Image/Build/Profile/DIR-600-B1,$(1))
        $(call Image/Build/Profile/DIR-600-B2,$(1))
+       $(call Image/Build/Profile/DIR610A1,$(1))
        $(call Image/Build/Profile/DIR-615-D,$(1))
        $(call Image/Build/Profile/DIR-620-A1,$(1))
        $(call Image/Build/Profile/DIR-620-D1,$(1))
        $(call Image/Build/Profile/DIR-615-D,$(1))
        $(call Image/Build/Profile/DIR-620-A1,$(1))
        $(call Image/Build/Profile/DIR-620-D1,$(1))
index 29d8b7c..877724d 100644 (file)
@@ -18,3 +18,13 @@ endef
 
 $(eval $(call Profile,DIR615H1))
 
 
 $(eval $(call Profile,DIR615H1))
 
+define Profile/DIR610A1
+       NAME:=Dlink DIR-610 A1
+       PACKAGES:=kmod-ledtrig-netdev kmod-ledtrig-timer
+endef
+
+define Profile/DIR610A1/Description
+       Package set for Dlink DIR610 A1 board
+endef
+
+$(eval $(call Profile,DIR610A1))