From 7bfab6e308a54d4fc2b99d9f80b4a4cd735de5b1 Mon Sep 17 00:00:00 2001 From: John Crispin Date: Thu, 25 Apr 2013 19:02:53 +0000 Subject: [PATCH] ramips: Add Alpha ASL-26555 support. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Álvaro Fernández Rojas Patchwork: http://patchwork.openwrt.org/patch/3571/ Acked-by: John Crispin SVN-Revision: 36433 --- target/linux/ramips/base-files/etc/diag.sh | 3 + .../etc/hotplug.d/firmware/10-rt2x00-eeprom | 1 + .../base-files/etc/uci-defaults/01_leds | 6 + .../base-files/etc/uci-defaults/02_network | 10 ++ .../base-files/lib/preinit/06_set_iface_mac | 1 + target/linux/ramips/base-files/lib/ramips.sh | 3 + .../ramips/base-files/lib/upgrade/platform.sh | 1 + target/linux/ramips/dts/ASL26555-16M.dts | 138 ++++++++++++++++++ target/linux/ramips/dts/ASL26555-8M.dts | 133 +++++++++++++++++ target/linux/ramips/image/Makefile | 13 ++ target/linux/ramips/rt305x/profiles/alpha.mk | 19 +++ 11 files changed, 328 insertions(+) create mode 100644 target/linux/ramips/dts/ASL26555-16M.dts create mode 100644 target/linux/ramips/dts/ASL26555-8M.dts create mode 100644 target/linux/ramips/rt305x/profiles/alpha.mk diff --git a/target/linux/ramips/base-files/etc/diag.sh b/target/linux/ramips/base-files/etc/diag.sh index a82e1ce34c..1970ae0bcd 100755 --- a/target/linux/ramips/base-files/etc/diag.sh +++ b/target/linux/ramips/base-files/etc/diag.sh @@ -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" ;; diff --git a/target/linux/ramips/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom b/target/linux/ramips/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom index 5cd9313200..538047b42d 100644 --- a/target/linux/ramips/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom +++ b/target/linux/ramips/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom @@ -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 | \ diff --git a/target/linux/ramips/base-files/etc/uci-defaults/01_leds b/target/linux/ramips/base-files/etc/uci-defaults/01_leds index cfe5c621c5..ec031883ea 100755 --- a/target/linux/ramips/base-files/etc/uci-defaults/01_leds +++ b/target/linux/ramips/base-files/etc/uci-defaults/01_leds @@ -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" ;; diff --git a/target/linux/ramips/base-files/etc/uci-defaults/02_network b/target/linux/ramips/base-files/etc/uci-defaults/02_network index 49c4f7f334..b3d87d2889 100755 --- a/target/linux/ramips/base-files/etc/uci-defaults/02_network +++ b/target/linux/ramips/base-files/etc/uci-defaults/02_network @@ -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) diff --git a/target/linux/ramips/base-files/lib/preinit/06_set_iface_mac b/target/linux/ramips/base-files/lib/preinit/06_set_iface_mac index d0309fd6ee..7becaf7ad9 100644 --- a/target/linux/ramips/base-files/lib/preinit/06_set_iface_mac +++ b/target/linux/ramips/base-files/lib/preinit/06_set_iface_mac @@ -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) diff --git a/target/linux/ramips/base-files/lib/ramips.sh b/target/linux/ramips/base-files/lib/ramips.sh index 24823f6c07..c1355bcadc 100755 --- a/target/linux/ramips/base-files/lib/ramips.sh +++ b/target/linux/ramips/base-files/lib/ramips.sh @@ -66,6 +66,9 @@ ramips_board_detect() { *"Asus WL-330N3G") name="wl-330n3g" ;; + *"Alpha ASL26555") + name="asl26555" + ;; *"Aztech HW550-3G") name="hw550-3g" ;; diff --git a/target/linux/ramips/base-files/lib/upgrade/platform.sh b/target/linux/ramips/base-files/lib/upgrade/platform.sh index 8954559713..15c0007a04 100755 --- a/target/linux/ramips/base-files/lib/upgrade/platform.sh +++ b/target/linux/ramips/base-files/lib/upgrade/platform.sh @@ -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 index 0000000000..e9477b47d0 --- /dev/null +++ b/target/linux/ramips/dts/ASL26555-16M.dts @@ -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 index 0000000000..0a403c195c --- /dev/null +++ b/target/linux/ramips/dts/ASL26555-8M.dts @@ -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>; + }; + }; +}; diff --git a/target/linux/ramips/image/Makefile b/target/linux/ramips/image/Makefile index 703e1f09f6..99d4702403 100644 --- a/target/linux/ramips/image/Makefile +++ b/target/linux/ramips/image/Makefile @@ -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 index 0000000000..a537509a99 --- /dev/null +++ b/target/linux/ramips/rt305x/profiles/alpha.mk @@ -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)) -- 2.30.2