04-stock.patch 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. --- a/target/linux/qualcommax/ipq807x/base-files/etc/init.d/bootcount
  2. +++ b/target/linux/qualcommax/ipq807x/base-files/etc/init.d/bootcount
  3. @@ -9,5 +9,13 @@ boot() {
  4. # Unset changed flag after sysupgrade complete
  5. fw_setenv changed
  6. ;;
  7. + redmi,ax6|\
  8. + xiaomi,ax3600|\
  9. + xiaomi,ax9000)
  10. + # OTA handling should not be used. Reset it just in case.
  11. + fw_setenv flag_ota_reboot 0
  12. + # Not strictly needed but useful to handle partition crash condition
  13. + fw_setenv flag_boot_success 1
  14. + ;;
  15. esac
  16. }
  17. --- a/target/linux/qualcommax/ipq807x/base-files/lib/upgrade/platform.sh
  18. +++ b/target/linux/qualcommax/ipq807x/base-files/lib/upgrade/platform.sh
  19. @@ -83,20 +83,29 @@ platform_do_upgrade() {
  20. redmi,ax6|\
  21. xiaomi,ax3600|\
  22. xiaomi,ax9000)
  23. - # Make sure that UART is enabled
  24. - fw_setenv boot_wait on
  25. - fw_setenv uart_en 1
  26. + part_num="$(fw_printenv -n flag_boot_rootfs)"
  27. + if [ "$part_num" -eq "1" ]; then
  28. + CI_UBIPART="rootfs_1"
  29. + target_num=1
  30. + # Reset fail flag for the current partition
  31. + # With both partition set to fail, the partition 2 (bit 1)
  32. + # is loaded
  33. + fw_setenv flag_try_sys2_failed 0
  34. + else
  35. + CI_UBIPART="rootfs"
  36. + target_num=0
  37. + # Reset fail flag for the current partition
  38. + # or uboot will skip the loading of this partition
  39. + fw_setenv flag_try_sys1_failed 0
  40. + fi
  41. +
  42. + # Tell uboot to switch partition
  43. + fw_setenv flag_boot_rootfs "$target_num"
  44. + fw_setenv flag_last_success "$target_num"
  45. - # Enforce single partition.
  46. - fw_setenv flag_boot_rootfs 0
  47. - fw_setenv flag_last_success 0
  48. - fw_setenv flag_boot_success 1
  49. - fw_setenv flag_try_sys1_failed 8
  50. - fw_setenv flag_try_sys2_failed 8
  51. + # Reset success flag
  52. + fw_setenv flag_boot_success 0
  53. - # Kernel and rootfs are placed in 2 different UBI
  54. - CI_KERN_UBIPART="ubi_kernel"
  55. - CI_ROOT_UBIPART="rootfs"
  56. nand_do_upgrade "$1"
  57. ;;
  58. *)
  59. --- /dev/null
  60. +++ b/target/linux/qualcommax/ipq807x/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
  61. @@ -0,0 +1,20 @@
  62. +#!/bin/sh
  63. +
  64. +[ -e /lib/firmware/$FIRMWARE ] && exit 0
  65. +
  66. +. /lib/functions/caldata.sh
  67. +
  68. +board=$(board_name)
  69. +
  70. +case "$FIRMWARE" in
  71. +"ath10k/cal-pci-0000:01:00.0.bin")
  72. + case "$board" in
  73. + xiaomi,ax3600)
  74. + caldata_extract "0:art" 0x33000 0x844
  75. + ;;
  76. + esac
  77. + ;;
  78. +*)
  79. + exit 1
  80. + ;;
  81. +esac