Initial commit
Some checks failed
Build Kernel / Build all affected Kernels (push) Has been cancelled
Build all core packages / Build all core packages for selected target (push) Has been cancelled
Build and Push prebuilt tools container / Build and Push all prebuilt containers (push) Has been cancelled
Build Toolchains / Build Toolchains for each target (push) Has been cancelled
Build host tools / Build host tools for linux and macos based systems (push) Has been cancelled
Coverity scan build / Coverity x86/64 build (push) Has been cancelled

This commit is contained in:
domenico
2025-06-24 12:51:15 +02:00
commit 27c9d80f51
10493 changed files with 1885777 additions and 0 deletions

View File

@@ -0,0 +1,166 @@
#!/bin/sh
[ -e /lib/firmware/$FIRMWARE ] && exit 0
. /lib/functions/caldata.sh
board=$(board_name)
case "$FIRMWARE" in
"ath9k-eeprom-ahb-18100000.wmac.bin")
case $board in
aruba,ap-115)
caldata_extract "oemdata" 0x1000 0x440
;;
asus,pl-ac56|\
asus,rp-ac51|\
asus,rp-ac66)
caldata_extract "art" 0x1000 0x440
;;
avm,fritz1750e|\
avm,fritz4020|\
avm,fritz450e|\
avm,fritzdvbc)
caldata_extract_reverse "urlader" 0x1541 0x440
;;
dlink,dir-505)
caldata_extract "art" 0x1000 0x440
ath9k_patch_mac $(mtd_get_mac_text "mac" 0x4)
;;
dlink,dir-842-c1|\
dlink,dir-842-c2|\
dlink,dir-842-c3|\
nec,wf1200cr|\
nec,wg1200cr|\
wd,mynet-n600|\
wd,mynet-n750)
caldata_extract "art" 0x1000 0x440
ath9k_patch_mac $(mtd_get_mac_ascii devdata "wlan24mac")
;;
engenius,ecb1200|\
engenius,ecb1750)
caldata_extract "art" 0x1000 0x440
ath9k_patch_mac $(macaddr_add $(mtd_get_mac_ascii u-boot-env athaddr) 1)
;;
enterasys,ws-ap3705i)
caldata_extract "calibrate" 0x1000 0x440
ath9k_patch_mac $(mtd_get_mac_ascii u-boot-env0 RADIOADDR1)
;;
extreme-networks,ws-ap3805i)
caldata_extract "art" 0x1000 0x440
ath9k_patch_mac $(mtd_get_mac_ascii cfg1 RADIOADDR1)
;;
iodata,wn-ac1167dgr|\
iodata,wn-ac1600dgr|\
iodata,wn-ac1600dgr2|\
iodata,wn-ag300dgr|\
sitecom,wlr-7100|\
sitecom,wlr-8100)
caldata_extract "art" 0x1000 0x440
ath9k_patch_mac $(mtd_get_mac_ascii u-boot-env ethaddr)
;;
moxa,awk-1137c)
caldata_extract "art" 0x1000 0x440
ath9k_patch_mac $(mtd_get_mac_ascii u-boot-env mac_addr)
;;
nec,wg800hp)
caldata_extract "art" 0x1000 0x440
ath9k_patch_mac $(mtd_get_mac_text board_data 0x680)
;;
qihoo,c301)
caldata_extract "radiocfg" 0x1000 0x440
ath9k_patch_mac $(mtd_get_mac_ascii devdata "wlan24mac")
;;
tplink,deco-s4-v2)
caldata_extract "art" 0x1000 0x440
base_mac=$(mtd_get_mac_encrypted_deco $(find_mtd_part config))
ath9k_patch_mac $(macaddr_add $base_mac 1)
;;
*)
caldata_die "board $board is not supported yet"
;;
esac
;;
"ath9k-eeprom-pci-0000:00:00.0.bin")
case $board in
aruba,ap-115)
caldata_extract "oemdata" 0x5000 0x440
;;
avm,fritz300e)
caldata_extract_reverse "urloader" 0x1541 0x440
;;
buffalo,wzr-hp-g450h)
caldata_extract "art" 0x1000 0x440
;;
dlink,dir-825-c1|\
dlink,dir-835-a1)
caldata_extract "art" 0x5000 0x440
ath9k_patch_mac $(macaddr_add $(mtd_get_mac_text "mac" 0x18) 1)
;;
enterasys,ws-ap3705i)
caldata_extract "calibrate" 0x5000 0x440
ath9k_patch_mac $(mtd_get_mac_ascii u-boot-env0 RADIOADDR0)
;;
meraki,mr12)
caldata_extract "art" 0x11000 0xeb8
;;
netgear,wnr2200-8m|\
netgear,wnr2200-16m|\
tplink,tl-wr842n-v1)
caldata_extract "art" 0x1000 0x3e0
;;
ubnt,powerbridge-m|\
ubnt,rocket-m)
caldata_extract "art" 0x1000 0x1000
;;
wd,mynet-n600|\
wd,mynet-n750)
caldata_extract "art" 0x5000 0x440
ath9k_patch_mac $(mtd_get_mac_ascii devdata "wlan5mac")
;;
wd,mynet-wifi-rangeextender)
caldata_extract "art" 0x1000 0x440
ath9k_patch_mac $(nvram get wl0_hwaddr)
;;
*)
caldata_die "board $board is not supported yet"
;;
esac
;;
"ath9k-eeprom-pci-0000:00:11.0.bin")
case $board in
buffalo,wzr-600dhp|\
buffalo,wzr-hp-ag300h)
caldata_extract "art" 0x1000 0xeb8
;;
trendnet,tew-673gru)
caldata_extract "caldata" 0x1000 0xeb8
ath9k_patch_mac_crc $(mtd_get_mac_text "caldata" 0xffa0) 0x20c
;;
meraki,mr16)
caldata_extract "art" 0x11000 0xeb8
;;
*)
caldata_die "board $board is not supported yet"
;;
esac
;;
"ath9k-eeprom-pci-0000:00:12.0.bin")
case $board in
buffalo,wzr-600dhp|\
buffalo,wzr-hp-ag300h)
caldata_extract "art" 0x5000 0xeb8
;;
trendnet,tew-673gru)
caldata_extract "caldata" 0x5000 0xeb8
ath9k_patch_mac_crc $(macaddr_add $(mtd_get_mac_text "caldata" 0xffb4) 1) 0x20c
;;
meraki,mr16)
caldata_extract "art" 0x15000 0xeb8
;;
*)
caldata_die "board $board is not supported yet"
;;
esac
;;
esac

View File

@@ -0,0 +1,26 @@
#!/bin/sh
[ -e /lib/firmware/$FIRMWARE ] && exit 0
. /lib/functions/caldata.sh
board=$(board_name)
case "$FIRMWARE" in
"ath10k/pre-cal-pci-0000:00:00.0.bin")
case $board in
dlink,dir-842-c1|\
dlink,dir-842-c2|\
dlink,dir-842-c3)
caldata_extract "art" 0x5000 0x2f20
caldata_valid "202f" || caldata_extract "reserved" 0x15000 0x2f20
ath10k_patch_mac $(mtd_get_mac_ascii devdata wlan5mac)
ln -sf /lib/firmware/ath10k/pre-cal-pci-0000\:00\:00.0.bin \
/lib/firmware/ath10k/QCA9888/hw2.0/board.bin
;;
esac
;;
*)
exit 1
;;
esac

View File

@@ -0,0 +1,134 @@
#!/bin/ash
[ "$ACTION" = "add" ] || exit 0
PHYNBR=${DEVPATH##*/phy}
[ -n $PHYNBR ] || exit 0
. /lib/functions.sh
. /lib/functions/system.sh
. /lib/functions/k2t.sh
board=$(board_name)
case "$board" in
adtran,bsap1800-v2|\
adtran,bsap1840)
macaddr_add "$(mtd_get_mac_binary 'Board data' 2)" $(($PHYNBR * 8 + 1)) > /sys${DEVPATH}/macaddress
;;
dlink,covr-c1200-a1|\
dlink,covr-p2500-a1)
[ "$PHYNBR" -eq 0 ] && \
mtd_get_mac_ascii art "protest_ath1_mac" > /sys${DEVPATH}/macaddress
[ "$PHYNBR" -eq 1 ] && \
mtd_get_mac_ascii art "protest_ath0_mac" > /sys${DEVPATH}/macaddress
;;
dlink,dap-1330-a1|\
dlink,dap-1365-a1|\
dlink,dch-g020-a1)
mtd_get_mac_text "mp" 0x13 > /sys${DEVPATH}/macaddress
;;
dlink,dap-2230-a1|\
dlink,dap-3320-a1)
mtd_get_mac_ascii bdcfg "wlanmac" > /sys${DEVPATH}/macaddress
;;
dlink,dap-2660-a1|\
dlink,dap-2680-a1|\
dlink,dap-2695-a1|\
dlink,dap-3662-a1)
[ "$PHYNBR" -eq 0 ] && \
mtd_get_mac_ascii bdcfg "wlanmac_a" > /sys${DEVPATH}/macaddress
[ "$PHYNBR" -eq 1 ] && \
mtd_get_mac_ascii bdcfg "wlanmac" > /sys${DEVPATH}/macaddress
;;
elecom,wab-i1750-ps|\
elecom,wab-s1167-ps|\
elecom,wab-s600-ps)
# set the 5G MAC address (= ethaddr + 1)
[ "$PHYNBR" -eq 0 ] && \
macaddr_add "$(mtd_get_mac_ascii u-boot-env ethaddr)" 1 > /sys${DEVPATH}/macaddress
# set the 2.4G MAC address (= ethaddr)
[ "$PHYNBR" -eq 1 ] && \
mtd_get_mac_ascii u-boot-env "ethaddr" > /sys${DEVPATH}/macaddress
;;
engenius,ecb1200|\
engenius,ecb1750)
[ "$PHYNBR" -eq 0 ] && \
mtd_get_mac_ascii u-boot-env athaddr > /sys${DEVPATH}/macaddress
;;
engenius,epg5000|\
engenius,esr1200|\
engenius,esr1750|\
engenius,esr900)
macaddr_add "$(mtd_get_mac_ascii u-boot-env ethaddr)" "$PHYNBR" > /sys${DEVPATH}/macaddress
;;
engenius,ews511ap)
[ "$PHYNBR" -eq 0 ] && \
macaddr_add $(cat /sys/class/net/eth0/address) 1 > /sys${DEVPATH}/macaddress
;;
extreme-networks,ws-ap3805i)
[ "$PHYNBR" -eq 0 ] && \
mtd_get_mac_ascii cfg1 RADIOADDR0 > /sys${DEVPATH}/macaddress
;;
iodata,wn-ac1167dgr|\
iodata,wn-ac1600dgr|\
iodata,wn-ac1600dgr2|\
sitecom,wlr-7100|\
sitecom,wlr-8100|\
zyxel,nbg6616)
# There is no eeprom data for 5 GHz wlan in "art" partition
# which would allow to patch the macaddress
[ "$PHYNBR" -eq 0 ] && \
macaddr_add "$(mtd_get_mac_ascii u-boot-env ethaddr)" 1 > /sys${DEVPATH}/macaddress
;;
iodata,wn-ag300dgr)
# There is no eeprom data for 5 GHz wlan in "art" partition
# which would allow to patch the macaddress
[ "$PHYNBR" -eq 1 ] && \
macaddr_add "$(mtd_get_mac_ascii u-boot-env ethaddr)" 1 > /sys${DEVPATH}/macaddress
;;
nec,wf1200cr|\
nec,wg1200cr|\
qihoo,c301)
[ "$PHYNBR" -eq 0 ] && \
mtd_get_mac_ascii devdata wlan5mac > /sys${DEVPATH}/macaddress
;;
phicomm,k2t)
[ "$PHYNBR" -eq 0 ] && \
k2t_get_mac "5g_mac" > /sys${DEVPATH}/macaddress
# The K2T factory firmware does use LAN mac address as the 2.4G wifi mac address
[ "$PHYNBR" -eq 1 ] && \
k2t_get_mac "lan_mac" > /sys${DEVPATH}/macaddress
;;
siemens,ws-ap3610)
mtd_get_mac_ascii cfg1 RADIOADDR${PHYNBR} > /sys${DEVPATH}/macaddress
;;
tplink,deco-s4-v2)
base_mac=$(mtd_get_mac_encrypted_deco $(find_mtd_part config))
[ "$PHYNBR" -eq 0 ] && \
macaddr_add $base_mac 2 > /sys${DEVPATH}/macaddress
;;
trendnet,tew-823dru)
# set the 2.4G interface mac address to LAN MAC
[ "$PHYNBR" -eq 1 ] && \
mtd_get_mac_text mac 4 > /sys${DEVPATH}/macaddress
# set the 5G interface mac address to WAN MAC + 1
[ "$PHYNBR" -eq 0 ] && \
macaddr_add "$(mtd_get_mac_text mac 0x18)" 1 > /sys${DEVPATH}/macaddress
;;
zyxel,nbg6616)
# Set mac address for 2.4g device
[ "$PHYNBR" -eq 1 ] && \
mtd_get_mac_ascii u-boot-env ethaddr > /sys${DEVPATH}/macaddress
;;
zyxel,nwa1123-ac)
[ "$PHYNBR" -eq 0 ] && \
mtd_get_mac_text mib0 0x66 > /sys${DEVPATH}/macaddress
;;
zyxel,nwa1123-ni)
[ "$PHYNBR" -eq 1 ] && \
mtd_get_mac_text mib0 0x66 > /sys${DEVPATH}/macaddress
;;
esac

View File

@@ -0,0 +1,29 @@
#!/bin/sh
. /lib/functions.sh
inittab_add_console() {
local console
case $(board_name) in
elecom,wab-i1750-ps)
console="ttyATH1"
;;
*)
return
;;
esac
[ "$DEVNAME" != "$console" ] && \
return
# check existing (commented out) entry
grep -q "^#\{0,1\}${console}::askfirst" "/etc/inittab" && \
return
# append entry
echo -e "\n${console}::askfirst:/usr/libexec/login.sh" \
>> /etc/inittab
}
[ "${ACTION}" = "add" ] && inittab_add_console