From ba33fec925ccd1a96921437a31a1ca49352d0595 Mon Sep 17 00:00:00 2001 From: John Crispin Date: Mon, 15 Sep 2014 10:19:38 +0000 Subject: ar71xx: add qihoo 360 c301 router support Qihoo 360 C301 is a dual band wireless router supports 802.11n and 802.11ac. Its chipset is AR9344 + AR9882 with two 16MB flashes. This patch adds its initial support. v2: * use mtd_get_mac_ascii to fetch MAC address for ath10k. * use ath79_register_pci to initialize AR9882. Signed-off-by: Weijie Gao git-svn-id: svn://svn.openwrt.org/openwrt/trunk@42552 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- target/linux/ar71xx/base-files/etc/diag.sh | 3 +++ target/linux/ar71xx/base-files/etc/uci-defaults/01_leds | 4 ++++ .../linux/ar71xx/base-files/etc/uci-defaults/02_network | 1 + target/linux/ar71xx/base-files/lib/ar71xx.sh | 3 +++ .../base-files/lib/preinit/81_load_ath10k_board_bin | 17 +++++++++++++++++ target/linux/ar71xx/base-files/lib/upgrade/platform.sh | 1 + 6 files changed, 29 insertions(+) (limited to 'target/linux/ar71xx/base-files') diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh index fba6032271..ac7e20d7f0 100755 --- a/target/linux/ar71xx/base-files/etc/diag.sh +++ b/target/linux/ar71xx/base-files/etc/diag.sh @@ -166,6 +166,9 @@ get_status_led() { oolite) status_led="oolite:red:system" ;; + qihoo-c301) + status_led="qihoo:green:status" + ;; tew-632brp) status_led="tew-632brp:green:status" ;; diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds index 3f97d37f12..ef6cf0b53a 100755 --- a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds +++ b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds @@ -192,6 +192,10 @@ om5p) ucidef_set_led_netdev "port2" "port2" "om5p:blue:lan" "eth1" ;; +qihoo-c301) + ucidef_set_led_wlan "wlan2g" "WLAN2G" "qihoo:red:status" "phy1tpt" + ;; + smart-300) ucidef_set_led_netdev "wan" "WAN" "nc-link:green:wan" "eth0" ucidef_set_led_switch "lan1" "LAN1" "nc-link:green:lan1" "switch0" "0x04" diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network index 8a0159c01a..fdbca5166b 100755 --- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network +++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network @@ -347,6 +347,7 @@ hiwifi-hc6361 |\ ja76pf |\ mynet-n600 |\ oolite |\ +qihoo-c301 |\ rb-750 |\ rb-751 |\ tew-632brp |\ diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh index a7cbb80946..78d67fae4d 100755 --- a/target/linux/ar71xx/base-files/lib/ar71xx.sh +++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh @@ -433,6 +433,9 @@ ar71xx_board_detect() { *PB92) name="pb92" ;; + *"Qihoo 360 C301") + name="qihoo-c301" + ;; *"RouterBOARD 411/A/AH") name="rb-411" ;; diff --git a/target/linux/ar71xx/base-files/lib/preinit/81_load_ath10k_board_bin b/target/linux/ar71xx/base-files/lib/preinit/81_load_ath10k_board_bin index a28932f824..2c06d7f1a1 100644 --- a/target/linux/ar71xx/base-files/lib/preinit/81_load_ath10k_board_bin +++ b/target/linux/ar71xx/base-files/lib/preinit/81_load_ath10k_board_bin @@ -24,6 +24,23 @@ do_load_ath10k_board_bin() { bs=1 skip=20492 count=2104 >> /tmp/ath10k-board.bin ;; + qihoo-c301) + local mac + + mac=$(mtd_get_mac_ascii devdata wlan5mac) + + if [ -z "$mac" ]; then + mac=$(macaddr_add $(cat /sys/class/net/eth0/address) -2) + fi + + dd if=/dev/mtdblock10 \ + bs=1 skip=20480 count=6 \ + of=/tmp/ath10k-board.bin + macaddr_2bin $mac >> /tmp/ath10k-board.bin + dd if=/dev/mtdblock10 \ + bs=1 skip=20492 count=2104 >> /tmp/ath10k-board.bin + + ;; esac [ -f /tmp/ath10k-board.bin ] || { return diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh index d1617bfb44..b8b2fa9980 100755 --- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh +++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh @@ -226,6 +226,7 @@ platform_check_image() { return 1 ;; + qihoo-c301 | \ mynet-n600 | \ mynet-n750) [ "$magic_long" != "5ea3a417" ] && { -- cgit v1.2.3