04-stock.patch 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. --- a/target/linux/ipq807x/image/generic.mk
  2. +++ b/target/linux/ipq807x/image/generic.mk
  3. @@ -134,12 +134,7 @@ define Device/xiaomi_ax3600
  4. PAGESIZE := 2048
  5. DEVICE_DTS_CONFIG := config@ac04
  6. SOC := ipq8071
  7. - KERNEL_SIZE := 36608k
  8. - DEVICE_PACKAGES := ipq-wifi-xiaomi_ax3600 kmod-ath10k-ct-smallbuffers ath10k-firmware-qca9887-ct
  9. -ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),)
  10. - ARTIFACTS := initramfs-factory.ubi
  11. - ARTIFACT/initramfs-factory.ubi := append-image-stage initramfs-uImage.itb | ubinize-kernel
  12. -endif
  13. + DEVICE_PACKAGES := ipq-wifi-xiaomi_ax3600 kmod-ath10k-ct-smallbuffers ath10k-firmware-qca9887-ct -kmod-usb3 -kmod-usb-dwc3 -kmod-usb-dwc3-qcom
  14. endef
  15. TARGET_DEVICES += xiaomi_ax3600
  16. @@ -152,13 +147,8 @@ define Device/xiaomi_ax9000
  17. PAGESIZE := 2048
  18. DEVICE_DTS_CONFIG := config@hk14
  19. SOC := ipq8072
  20. - KERNEL_SIZE := 57344k
  21. DEVICE_PACKAGES := ipq-wifi-xiaomi_ax9000 kmod-ath11k-pci ath11k-firmware-qcn9074 \
  22. kmod-ath10k-ct ath10k-firmware-qca9887-ct
  23. -ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),)
  24. - ARTIFACTS := initramfs-factory.ubi
  25. - ARTIFACT/initramfs-factory.ubi := append-image-stage initramfs-uImage.itb | ubinize-kernel
  26. -endif
  27. endef
  28. TARGET_DEVICES += xiaomi_ax9000
  29. --- a/target/linux/ipq807x/base-files/etc/init.d/bootcount
  30. +++ b/target/linux/ipq807x/base-files/etc/init.d/bootcount
  31. @@ -9,5 +9,13 @@ boot() {
  32. # Unset changed flag after sysupgrade complete
  33. fw_setenv changed
  34. ;;
  35. + redmi,ax6|\
  36. + xiaomi,ax3600|\
  37. + xiaomi,ax9000)
  38. + # OTA handling should not be used. Reset it just in case.
  39. + fw_setenv flag_ota_reboot 0
  40. + # Not strictly needed but useful to handle partition crash condition
  41. + fw_setenv flag_boot_success 1
  42. + ;;
  43. esac
  44. }
  45. --- a/target/linux/ipq807x/base-files/lib/upgrade/platform.sh
  46. +++ b/target/linux/ipq807x/base-files/lib/upgrade/platform.sh
  47. @@ -83,20 +83,29 @@ platform_do_upgrade() {
  48. redmi,ax6|\
  49. xiaomi,ax3600|\
  50. xiaomi,ax9000)
  51. - # Make sure that UART is enabled
  52. - fw_setenv boot_wait on
  53. - fw_setenv uart_en 1
  54. + part_num="$(fw_printenv -n flag_boot_rootfs)"
  55. + if [ "$part_num" -eq "1" ]; then
  56. + CI_UBIPART="rootfs_1"
  57. + target_num=1
  58. + # Reset fail flag for the current partition
  59. + # With both partition set to fail, the partition 2 (bit 1)
  60. + # is loaded
  61. + fw_setenv flag_try_sys2_failed 0
  62. + else
  63. + CI_UBIPART="rootfs"
  64. + target_num=0
  65. + # Reset fail flag for the current partition
  66. + # or uboot will skip the loading of this partition
  67. + fw_setenv flag_try_sys1_failed 0
  68. + fi
  69. +
  70. + # Tell uboot to switch partition
  71. + fw_setenv flag_boot_rootfs "$target_num"
  72. + fw_setenv flag_last_success "$target_num"
  73. - # Enforce single partition.
  74. - fw_setenv flag_boot_rootfs 0
  75. - fw_setenv flag_last_success 0
  76. - fw_setenv flag_boot_success 1
  77. - fw_setenv flag_try_sys1_failed 8
  78. - fw_setenv flag_try_sys2_failed 8
  79. + # Reset success flag
  80. + fw_setenv flag_boot_success 0
  81. - # Kernel and rootfs are placed in 2 different UBI
  82. - CI_KERN_UBIPART="ubi_kernel"
  83. - CI_ROOT_UBIPART="rootfs"
  84. nand_do_upgrade "$1"
  85. ;;
  86. *)
  87. --- /dev/null
  88. +++ b/target/linux/ipq807x/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
  89. @@ -0,0 +1,20 @@
  90. +#!/bin/sh
  91. +
  92. +[ -e /lib/firmware/$FIRMWARE ] && exit 0
  93. +
  94. +. /lib/functions/caldata.sh
  95. +
  96. +board=$(board_name)
  97. +
  98. +case "$FIRMWARE" in
  99. +"ath10k/cal-pci-0000:01:00.0.bin")
  100. + case "$board" in
  101. + xiaomi,ax3600)
  102. + caldata_extract "0:art" 0x33000 0x844
  103. + ;;
  104. + esac
  105. + ;;
  106. +*)
  107. + exit 1
  108. + ;;
  109. +esac
  110. --- a/target/linux/ipq807x/patches-5.15/0102-arm64-dts-ipq8074-add-reserved-memory-nodes.patch
  111. +++ b/target/linux/ipq807x/patches-5.15/0102-arm64-dts-ipq8074-add-reserved-memory-nodes.patch
  112. @@ -23,7 +23,7 @@ Signed-off-by: Robert Marko <[email protected]>
  113. #size-cells = <2>;
  114. ranges;
  115. -+ nss@40000000 {
  116. ++ nss_region: nss@40000000 {
  117. + no-map;
  118. + reg = <0x0 0x40000000 0x0 0x01000000>;
  119. + };