04-stock.patch 4.6 KB

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