ramips: Add Alpha ASL-26555 support.
authorJohn Crispin <john@openwrt.org>
Thu, 25 Apr 2013 19:02:53 +0000 (19:02 +0000)
committerJohn Crispin <john@openwrt.org>
Thu, 25 Apr 2013 19:02:53 +0000 (19:02 +0000)
This board uses a TrendChip SOC with its own RAM/Flash for ADSL support.
We know both SOCs are connected through ethernet and use some kind of protocol for UART communication, but due to the lack of GPL sources we couldn't get it to work. For this reason the network is configured only for LAN.

There are two versions (Chile 8MB and Spain 16MB).

Wiki: http://wiki.openwrt.org/toh/alpha/asl26555

Signed-off-by: Esteban Benito <estebanjbs@gmail.com>
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
Patchwork: http://patchwork.openwrt.org/patch/3571/
Acked-by: John Crispin <blogic@openwrt.org>
SVN-Revision: 36433

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/base-files/lib/upgrade/platform.sh
target/linux/ramips/dts/ASL26555-16M.dts [new file with mode: 0644]
target/linux/ramips/dts/ASL26555-8M.dts [new file with mode: 0644]
target/linux/ramips/image/Makefile
target/linux/ramips/rt305x/profiles/alpha.mk [new file with mode: 0644]

index a82e1ce34c6ee9e5e8f59e0abaa5871da1887c6d..1970ae0bcd0969d6d27d7bd9f24d5c52cfcde3f6 100755 (executable)
@@ -15,6 +15,9 @@ get_status_led() {
        argus-atp52b)
                status_led="argus-atp52b:green:run"
                ;;
+       asl26555)
+               status_led="asl26555:green:power"
+               ;;
        br6524n)
                status_led="edimax:blue:power"
                ;;
index 5cd9313200144318ae84a5beca5e17b0af078646..538047b42d15d2c6fb7b7f3a2caf6ea776945b95 100644 (file)
@@ -30,6 +30,7 @@ board=$(ramips_board_name)
 case "$FIRMWARE" in
 "soc_wmac.eeprom")
        case $board in
+       asl26555 | \
        dir-300-b1 | \
        dir-600-b1 | \
        dir-600-b2 | \
index cfe5c621c5250be508561b22da4cd8c2bdb98bec..ec031883eab4c8335ec8ac9348563354ef85c4a2 100755 (executable)
@@ -35,6 +35,12 @@ case $board in
                ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "all0256n:green:rssihigh" "wlan0" "70" "100" "-69" "8"
                set_wifi_led "rt2800pci-phy0::radio"
                ;;
+       asl26555)
+               ucidef_set_led_default "power" "POWER" "asl26555:green:power" "1"
+               ucidef_set_led_netdev "eth" "ETH" "asl26555:green:eth" "eth0"
+               set_wifi_led "asl26555:green:wlan"
+               set_usb_led "asl26555:green:3g"
+               ;;
        bc2)
                set_usb_led "bc2:blue:usb"
                ;;
index 49c4f7f334c19a495bb87b1c8778d3542ae0fdaa..b3d87d288967df81e0c421dbe3866284629a07eb 100755 (executable)
@@ -63,6 +63,12 @@ ramips_setup_interfaces()
                ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
                ;;
 
+       asl26555)
+               ucidef_set_interface_lan "eth0.1"
+               ucidef_add_switch "switch0" "1" "1"
+               ucidef_add_switch_vlan "switch0" "1" "1 2 3 4 6t"
+               ;;
+
        dir-645)
                ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
                ucidef_add_switch "switch0" "1" "1"
@@ -176,6 +182,10 @@ ramips_setup_macs()
                wan_mac=$(macaddr_add "$lan_mac" 1)
                ;;
 
+       asl26555)
+               lan_mac=$(mtd_get_mac_binary devdata 16388)
+               ;;
+
        w306r-v20)
                lan_mac=$(mtd_get_mac_binary factory 4)
                wan_mac=$(macaddr_add "$lan_mac" 5)
index d0309fd6eec541df0a6c423fd0dfa3c756f5b0ad..7becaf7ad9cb7ac888cb59018856b89da7a5f144 100644 (file)
@@ -34,6 +34,7 @@ preinit_set_mac_address() {
                mac=$(macaddr_setbit_la "$mac")
                ifconfig eth0 hw ether $mac 2>/dev/null
                ;;
+       asl26555 |\
        dir-300-b1 |\
        dir-300-b2 |\
        dir-600-b1)
index 24823f6c0702a1e57c379d71fdcb501e047f742a..c1355bcadc8a8e11b0cf40e55cd3c5e2f7bdb544 100755 (executable)
@@ -66,6 +66,9 @@ ramips_board_detect() {
        *"Asus WL-330N3G")
                name="wl-330n3g"
                ;;
+       *"Alpha ASL26555")
+               name="asl26555"
+               ;;
        *"Aztech HW550-3G")
                name="hw550-3g"
                ;;
index 89545597139581301063f2a5cc1120bac1f9c649..15c0007a04b8a13944d444b39b0315bb2a854025 100755 (executable)
@@ -22,6 +22,7 @@ platform_check_image() {
        all0239-3g | \
        all0256n | \
        all5002 | \
+       asl26555 | \
        bc2 | \
        broadway | \
        carambola | \
diff --git a/target/linux/ramips/dts/ASL26555-16M.dts b/target/linux/ramips/dts/ASL26555-16M.dts
new file mode 100644 (file)
index 0000000..e9477b4
--- /dev/null
@@ -0,0 +1,138 @@
+/dts-v1/;
+
+/include/ "rt3050.dtsi"
+
+/ {
+       compatible = "ASL26555", "ralink,rt3050-soc";
+       model = "Alpha ASL26555";
+
+       palmbus@10000000 {
+               sysc@0 {
+                       ralink,pinmux = "spi", "mdio", "uartlite", "sdram", "rgmii";
+                       ralink,gpiomux = "i2c", "jtag";
+                       ralink,uartmux = "gpio";
+                       ralink,wdtmux = <1>;
+               };
+
+               gpio0: gpio@600 {
+                       status = "okay";
+               };
+
+               spi@b00 {
+                       status = "okay";
+                       m25p80@0 {
+                               #address-cells = <1>;
+                               #size-cells = <1>;
+                               compatible = "s25sl12801";
+                               reg = <0 0>;
+                               linux,modalias = "m25p80", "s25sl12801";
+                               spi-max-frequency = <10000000>;
+
+                               partition@0 {
+                                       label = "uboot";
+                                       reg = <0x0 0x30000>;
+                                       read-only;
+                               };
+                               partition@30000 {
+                                       label = "uboot-env";
+                                       reg = <0x30000 0x10000>;
+                                       read-only;
+                               };
+                               partition@40000 {
+                                       label = "factory";
+                                       reg = <0x40000 0x10000>;
+                                       read-only;
+                               };
+                               partition@50000 {
+                                       label = "firmware";
+                                       reg = <0x50000 0xf80000>;
+                               };
+                               partition@fd0000 {
+                                       label = "cert";
+                                       reg = <0xfd0000 0x10000>;
+                                       read-only;
+                               };
+                               partition@fe0000 {
+                                       label = "langpack";
+                                       reg = <0xfe0000 0x10000>;
+                                       read-only;
+                               };
+                               partition@ff0000 {
+                                       label = "devdata";
+                                       reg = <0xff0000 0x10000>;
+                                       read-only;
+                               };
+                       };
+               };
+       };
+
+       ethernet@10100000 {
+               status = "okay";
+       };
+
+       esw@10110000 {
+               status = "okay";
+               ralink,portmap = <0x1e>;
+       };
+
+       wmac@10180000 {
+               status = "okay";
+       };
+
+       otg@101c0000 {
+               status = "okay";
+       };
+
+       gpio-keys-polled {
+               compatible = "gpio-keys-polled";
+               #address-cells = <1>;
+               #size-cells = <0>;
+               poll-interval = <20>;
+               reset {
+                       label = "reset";
+                       gpios = <&gpio0 10 0>;
+                       linux,code = <0x198>;
+               };
+               wps {
+                       label = "wps";
+                       gpios = <&gpio0 12 0>;
+                       linux,code = <0x211>;
+               };
+       };
+
+       gpio-leds {
+               compatible = "gpio-leds";
+               eth {
+                       label = "asl26555:green:eth";
+                       gpios = <&gpio0 0 1>;
+               };
+               wan-red {
+                       label = "asl26555:red:wan";
+                       gpios = <&gpio0 1 0>;
+               };
+               wan-green {
+                       label = "asl26555:green:wan";
+                       gpios = <&gpio0 2 0>;
+               };
+               wlan {
+                       label = "asl26555:green:wlan";
+                       gpios = <&gpio0 7 0>;
+               };
+               power-green {
+                       label = "asl26555:green:power";
+                       gpios = <&gpio0 8 0>;
+               };
+               power-red {
+                       label = "asl26555:red:power";
+                       gpios = <&gpio0 9 0>;
+               };
+               3g-green {
+                       label = "asl26555:green:3g";
+                       gpios = <&gpio0 14 1>;
+               };
+               3g-red {
+                       label = "asl26555:red:3g";
+                       gpios = <&gpio0 17 1>;
+               };
+       };
+};
diff --git a/target/linux/ramips/dts/ASL26555-8M.dts b/target/linux/ramips/dts/ASL26555-8M.dts
new file mode 100644 (file)
index 0000000..0a403c1
--- /dev/null
@@ -0,0 +1,133 @@
+/dts-v1/;
+
+/include/ "rt3050.dtsi"
+
+/ {
+       compatible = "ASL26555", "ralink,rt3050-soc";
+       model = "Alpha ASL26555";
+
+       palmbus@10000000 {
+               sysc@0 {
+                       ralink,pinmux = "spi", "mdio", "uartlite", "sdram", "rgmii";
+                       ralink,gpiomux = "i2c", "jtag";
+                       ralink,uartmux = "gpio";
+                       ralink,wdtmux = <1>;
+               };
+
+               gpio0: gpio@600 {
+                       status = "okay";
+               };
+
+               spi@b00 {
+                       status = "okay";
+                       m25p80@0 {
+                               #address-cells = <1>;
+                               #size-cells = <1>;
+                               compatible = "s25sl064p";
+                               reg = <0 0>;
+                               linux,modalias = "m25p80", "s25sl064p";
+                               spi-max-frequency = <10000000>;
+
+                               partition@0 {
+                                       label = "uboot";
+                                       reg = <0x0 0x30000>;
+                                       read-only;
+                               };
+                               partition@30000 {
+                                       label = "devdata";
+                                       reg = <0x30000 0x10000>;
+                                       read-only;
+                               };
+                               partition@40000 {
+                                       label = "rgdb";
+                                       reg = <0x40000 0x10000>;
+                                       read-only;
+                               };
+                               partition@50000 {
+                                       label = "firmware";
+                                       reg = <0x50000 0x790000>;
+                               };
+                               partition@7e0000 {
+                                       label = "cert";
+                                       reg = <0x7e0000 0x10000>;
+                                       read-only;
+                               };
+                               partition@7f0000 {
+                                       label = "langpack";
+                                       reg = <0x7f0000 0x10000>;
+                                       read-only;
+                               };
+                       };
+               };
+       };
+
+       ethernet@10100000 {
+               status = "okay";
+       };
+
+       esw@10110000 {
+               status = "okay";
+               ralink,portmap = <0x1e>;
+       };
+
+       wmac@10180000 {
+               status = "okay";
+       };
+
+       otg@101c0000 {
+               status = "okay";
+       };
+
+       gpio-keys-polled {
+               compatible = "gpio-keys-polled";
+               #address-cells = <1>;
+               #size-cells = <0>;
+               poll-interval = <20>;
+               reset {
+                       label = "reset";
+                       gpios = <&gpio0 10 0>;
+                       linux,code = <0x198>;
+               };
+               wps {
+                       label = "wps";
+                       gpios = <&gpio0 12 0>;
+                       linux,code = <0x211>;
+               };
+       };
+
+       gpio-leds {
+               compatible = "gpio-leds";
+               eth {
+                       label = "asl26555:green:eth";
+                       gpios = <&gpio0 0 1>;
+               };
+               wan-red {
+                       label = "asl26555:red:wan";
+                       gpios = <&gpio0 1 0>;
+               };
+               wan-green {
+                       label = "asl26555:green:wan";
+                       gpios = <&gpio0 2 0>;
+               };
+               wlan {
+                       label = "asl26555:green:wlan";
+                       gpios = <&gpio0 7 0>;
+               };
+               power-green {
+                       label = "asl26555:green:power";
+                       gpios = <&gpio0 8 0>;
+               };
+               power-red {
+                       label = "asl26555:red:power";
+                       gpios = <&gpio0 9 0>;
+               };
+               3g-green {
+                       label = "asl26555:green:3g";
+                       gpios = <&gpio0 14 1>;
+               };
+               3g-red {
+                       label = "asl26555:red:3g";
+                       gpios = <&gpio0 17 1>;
+               };
+       };
+};
index 703e1f09f6f259a81acb88f9c71bc3964b0ac68b..99d47024034d5720655bc0c25a5b839dcd5018c4 100644 (file)
@@ -269,6 +269,18 @@ Image/Build/Profile/ALL5002=$(call BuildFirmware/CustomFlash/$(1),$(1),all5002,A
 argus_atp52b_mtd_size=7995392
 Image/Build/Profile/ARGUS_ATP52B=$(call BuildFirmware/CustomFlash/$(1),$(1),argus_atp52b,ARGUS_ATP52B,$(argus_atp52b_mtd_size))
 
+asl26555_8mb_mtd_size=7929856
+asl26555_16mb_mtd_size=16252928
+define BuildFirmware/ASL26555/squashfs
+       $(call BuildFirmware/CustomFlash/$(1),$(1),$(2)-8M,$(3)-8M,$(asl26555_8mb_mtd_size))
+       $(call BuildFirmware/CustomFlash/$(1),$(1),$(2)-16M,$(3)-16M,$(asl26555_16mb_mtd_size))
+endef
+define BuildFirmware/ASL26555/initramfs
+       $(call BuildFirmware/OF/initramfs,$(1),$(2)-8M,$(3)-8M)
+       $(call BuildFirmware/OF/initramfs,$(1),$(2)-16M,$(3)-16M)
+endef
+Image/Build/Profile/ASL26555=$(call BuildFirmware/ASL26555/$(1),$(1),asl26555,ASL26555)
+
 Image/Build/Profile/BC2=$(call BuildFirmware/Default8M/$(1),$(1),bc2,BC2)
 
 broadway_mtd_size=7929856
@@ -425,6 +437,7 @@ define Image/Build/Profile/Default
        $(call Image/Build/Profile/ALL0256N,$(1))
        $(call Image/Build/Profile/ALL5002,$(1))
        $(call Image/Build/Profile/ARGUS_ATP52B,$(1))
+       $(call Image/Build/Profile/ASL26555,$(1))
        $(call Image/Build/Profile/BC2,$(1))
        $(call Image/Build/Profile/BROADWAY,$(1))
        $(call Image/Build/Profile/CARAMBOLA,$(1))
diff --git a/target/linux/ramips/rt305x/profiles/alpha.mk b/target/linux/ramips/rt305x/profiles/alpha.mk
new file mode 100644 (file)
index 0000000..a537509
--- /dev/null
@@ -0,0 +1,19 @@
+#
+# Copyright (C) 2013 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+define Profile/ASL26555
+       NAME:=Alpha ASL26555
+       PACKAGES:=\
+               kmod-usb-core kmod-usb-rt305x-dwc_otg \
+               kmod-ledtrig-usbdev
+endef
+
+define Profile/ASL26555/Description
+       Package set for Alpha ASL26555
+endef
+
+$(eval $(call Profile,ASL26555))