2
0

11-ath10k-caldata 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. #!/bin/sh
  2. [ -e /lib/firmware/$FIRMWARE ] && exit 0
  3. . /lib/functions/caldata.sh
  4. board=$(board_name)
  5. dt_base64_extract() {
  6. local target_dir="/sys$DEVPATH"
  7. local source="$target_dir/../../of_node/qcom,ath10k-calibration-data-base64"
  8. [ -e "$source" ] || caldata_die "cannot find base64 calibration data: $source"
  9. [ -d "$target_dir" ] || \
  10. caldata_die "no sysfs dir to write: $target"
  11. echo 1 > "$target_dir/loading"
  12. base64decode.uc "$source" > "$target_dir/data"
  13. if [ $? != 0 ]; then
  14. echo 1 > "$target_dir/loading"
  15. caldata_die \
  16. "failed to write calibration data to $target_dir/data"
  17. else
  18. echo 0 > "$target_dir/loading"
  19. fi
  20. }
  21. case "$FIRMWARE" in
  22. "ath10k/cal-pci-0000:01:00.0.bin")
  23. case "$board" in
  24. asus,onhub |\
  25. tplink,onhub)
  26. dt_base64_extract
  27. ;;
  28. meraki,mr52)
  29. CI_UBIPART=art
  30. caldata_extract_ubi "ART" 0x1000 0x844
  31. ;;
  32. esac
  33. ;;
  34. "ath10k/pre-cal-pci-0000:01:00.0.bin")
  35. case $board in
  36. asrock,g10)
  37. caldata_extract "0:art" 0x1000 0x2f20
  38. ;;
  39. linksys,ea7500-v1 |\
  40. linksys,ea8500)
  41. caldata_extract "art" 0x1000 0x2f20
  42. ath10k_patch_mac $(macaddr_add $(mtd_get_mac_ascii devinfo hw_mac_addr) 1)
  43. ;;
  44. meraki,mr42)
  45. CI_UBIPART=art
  46. caldata_extract_ubi "ART" 0x1000 0x2f20
  47. ;;
  48. zyxel,nbg6817)
  49. caldata_extract "0:art" 0x1000 0x2f20
  50. ath10k_patch_mac $(macaddr_add $(mtd_get_mac_ascii 0:appsblenv ethaddr) 1)
  51. ;;
  52. esac
  53. ;;
  54. "ath10k/cal-pci-0001:01:00.0.bin")
  55. case "$board" in
  56. asus,onhub |\
  57. tplink,onhub)
  58. dt_base64_extract
  59. ;;
  60. esac
  61. ;;
  62. "ath10k/pre-cal-pci-0001:01:00.0.bin")
  63. case $board in
  64. asrock,g10)
  65. caldata_extract "0:art" 0x5000 0x2f20
  66. ;;
  67. edgecore,ecw5410)
  68. caldata_extract "0:art" 0x1000 0x2f20
  69. ;;
  70. linksys,ea7500-v1 |\
  71. linksys,ea8500)
  72. caldata_extract "art" 0x5000 0x2f20
  73. ath10k_patch_mac $(macaddr_add $(mtd_get_mac_ascii devinfo hw_mac_addr) 2)
  74. ;;
  75. meraki,mr42 |\
  76. meraki,mr52)
  77. CI_UBIPART=art
  78. caldata_extract_ubi "ART" 0x5000 0x2f20
  79. ;;
  80. zyxel,nbg6817)
  81. caldata_extract "0:art" 0x5000 0x2f20
  82. ath10k_patch_mac $(mtd_get_mac_ascii 0:appsblenv ethaddr)
  83. ;;
  84. esac
  85. ;;
  86. "ath10k/cal-pci-0002:01:00.0.bin")
  87. case "$board" in
  88. asus,onhub |\
  89. tplink,onhub)
  90. dt_base64_extract
  91. ;;
  92. meraki,mr42)
  93. CI_UBIPART=art
  94. caldata_extract_ubi "ART" 0x9000 0x844
  95. ;;
  96. esac
  97. ;;
  98. "ath10k/pre-cal-pci-0002:01:00.0.bin")
  99. case $board in
  100. edgecore,ecw5410)
  101. caldata_extract "0:art" 0x5000 0x2f20
  102. ;;
  103. meraki,mr52)
  104. CI_UBIPART=art
  105. caldata_extract_ubi "ART" 0x9000 0x2f20
  106. ;;
  107. esac
  108. ;;
  109. *)
  110. exit 1
  111. ;;
  112. esac