mirror of
https://github.com/openwrt/openwrt.git
synced 2024-12-27 01:11:14 +00:00
098f7156cc
This patch adds support for the Airtight C-60. SOC: Atheros AR9344 rev 2 (CPU:560.000MHz) RAM: 128 MiB NOR: MX25L3205D 4MiB NAND: ST Micro NAND 32MiB 3,3V 8-bit SW-NET: AR8327N (2 Ports) WLAN1: Dual-Band AR9340 Rev:2 (built-in SoC) WLAN2: Dual-Band AR9300 Rev:4 PCIe Chip The switch is setup for an accesspoint: LAN1: (gigabit) is the wan-port. LAN2: (fast ethernet) is bridged with the br-lan. Flashing Guide (via initramfs): 1. Connect a PC to the serial port of the C-60. power up the C-60. Enter u-boot command prompt: #> nand erase #> setenv bootcmd "bootm 0x9f060000" #> saveenv #> setenv ipaddr 192.168.1.1 #> setenv netmask 255.255.255.0 #> setenv serverip 192.168.1.100 #> setenv bootfile lede-ar71xx-nand-c-60-initramfs-kernel.bin #> tftpboot #> bootm 2. Wait for the C-60 to boot LEDE. On the root prompt. Enter: # ubiformat /dev/mtd4 # ubiattach -p /dev/mtd4 3. After that copy the sysupgrade.tar onto the router and run: # sysupgrade sysupgrade.tar to flash the image. Special thanks to Chris Blake <chrisrblake93@gmail.com>. He provided a C-60 unit and he helped with debugging the switch, LEDs and platfrom support. Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
148 lines
3.3 KiB
Bash
148 lines
3.3 KiB
Bash
#!/bin/sh
|
|
|
|
[ -e /lib/firmware/$FIRMWARE ] && exit 0
|
|
|
|
. /lib/ar71xx.sh
|
|
. /lib/functions.sh
|
|
. /lib/functions/system.sh
|
|
|
|
ath9k_eeprom_die() {
|
|
echo "ath9k eeprom: " "$*"
|
|
exit 1
|
|
}
|
|
|
|
ath9k_eeprom_extract() {
|
|
local part=$1
|
|
local offset=$2
|
|
local count=$3
|
|
local mtd
|
|
|
|
mtd=$(find_mtd_chardev $part)
|
|
[ -n "$mtd" ] || \
|
|
ath9k_eeprom_die "no mtd device found for partition $part"
|
|
|
|
dd if=$mtd of=/lib/firmware/$FIRMWARE bs=1 skip=$offset count=$count 2>/dev/null || \
|
|
ath9k_eeprom_die "failed to extract from $mtd"
|
|
}
|
|
|
|
ath9k_ubi_eeprom_extract() {
|
|
local part=$1
|
|
local offset=$2
|
|
local count=$3
|
|
local ubidev=$(nand_find_ubi $CI_UBIPART)
|
|
local ubi
|
|
|
|
ubi=$(nand_find_volume $ubidev $part)
|
|
[ -n "$ubi" ] || \
|
|
ath9k_eeprom_die "no UBI volume found for $part"
|
|
|
|
dd if=/dev/$ubi of=/lib/firmware/$FIRMWARE bs=1 skip=$offset count=$count 2>/dev/null || \
|
|
ath9k_eeprom_die "failed to extract from $ubi"
|
|
}
|
|
|
|
ath9k_patch_firmware_mac() {
|
|
local mac=$1
|
|
|
|
[ -z "$mac" ] && return
|
|
|
|
macaddr_2bin $mac | dd of=/lib/firmware/$FIRMWARE conv=notrunc bs=1 seek=2 count=6
|
|
}
|
|
|
|
board=$(ar71xx_board_name)
|
|
|
|
case "$FIRMWARE" in
|
|
"soc_wmac.eeprom")
|
|
case $board in
|
|
c-55|\
|
|
c-60)
|
|
ath9k_eeprom_extract "art" 4096 2048
|
|
ath9k_patch_firmware_mac $(macaddr_add $(mtd_get_mac_binary art 0) +1)
|
|
;;
|
|
mr18)
|
|
. /lib/upgrade/nand.sh
|
|
|
|
if [ -n "$(nand_find_volume ubi0 caldata)" ]; then
|
|
ath9k_ubi_eeprom_extract "caldata" 4096 2048
|
|
else
|
|
ath9k_eeprom_extract "odm-caldata" 4096 2048
|
|
fi
|
|
ath9k_patch_firmware_mac $(macaddr_add $(mtd_get_mac_binary_ubi board-config 102) +1)
|
|
;;
|
|
r6100 | \
|
|
wndr3700v4 | \
|
|
wndr4300)
|
|
ath9k_eeprom_extract "caldata" 4096 2048
|
|
ath9k_patch_firmware_mac $(mtd_get_mac_binary caldata 0)
|
|
;;
|
|
z1)
|
|
. /lib/upgrade/nand.sh
|
|
|
|
if [ -n "$(nand_find_volume ubi0 caldata)" ]; then
|
|
ath9k_ubi_eeprom_extract "caldata" 4096 2048
|
|
else
|
|
ath9k_eeprom_extract "origcaldata" 4096 2048
|
|
fi
|
|
ath9k_patch_firmware_mac $(macaddr_add $(mtd_get_mac_binary_ubi board-config 102) +2)
|
|
;;
|
|
*)
|
|
ath9k_eeprom_die "board $board is not supported yet"
|
|
;;
|
|
esac
|
|
;;
|
|
|
|
"pci_wmac0.eeprom")
|
|
case $board in
|
|
c-55)
|
|
ath9k_eeprom_extract "art" 20480 2048
|
|
ath9k_patch_firmware_mac $(macaddr_add $(mtd_get_mac_binary art 0) +2)
|
|
;;
|
|
mr18)
|
|
. /lib/upgrade/nand.sh
|
|
|
|
if [ -n "$(nand_find_volume ubi0 caldata)" ]; then
|
|
ath9k_ubi_eeprom_extract "caldata" 20480 2048
|
|
else
|
|
ath9k_eeprom_extract "odm-caldata" 20480 2048
|
|
fi
|
|
ath9k_patch_firmware_mac $(macaddr_add $(mtd_get_mac_binary_ubi board-config 102) +2)
|
|
;;
|
|
wndr3700v4 | \
|
|
wndr4300)
|
|
ath9k_eeprom_extract "caldata" 20480 2048
|
|
ath9k_patch_firmware_mac $(mtd_get_mac_binary caldata 12)
|
|
;;
|
|
z1)
|
|
. /lib/upgrade/nand.sh
|
|
|
|
if [ -n "$(nand_find_volume ubi0 caldata)" ]; then
|
|
ath9k_ubi_eeprom_extract "caldata" 86016 4096
|
|
else
|
|
ath9k_eeprom_extract "origcaldata" 86016 4096
|
|
fi
|
|
ath9k_patch_firmware_mac $(macaddr_add $(mtd_get_mac_binary_ubi board-config 102) +3)
|
|
;;
|
|
*)
|
|
ath9k_eeprom_die "board $board is not supported yet"
|
|
;;
|
|
esac
|
|
;;
|
|
|
|
"pci_wmac1.eeprom")
|
|
case $board in
|
|
mr18)
|
|
. /lib/upgrade/nand.sh
|
|
|
|
if [ -n "$(nand_find_volume ubi0 caldata)" ]; then
|
|
ath9k_ubi_eeprom_extract "caldata" 36864 2048
|
|
else
|
|
ath9k_eeprom_extract "odm-caldata" 36864 2048
|
|
fi
|
|
ath9k_patch_firmware_mac $(macaddr_add $(mtd_get_mac_binary_ubi board-config 102) +3)
|
|
;;
|
|
*)
|
|
ath9k_eeprom_die "board $board is not supported yet"
|
|
;;
|
|
esac
|
|
;;
|
|
esac
|