ax6000.patch 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. --- a/target/linux/mediatek/image/filogic.mk
  2. +++ b/target/linux/mediatek/image/filogic.mk
  3. @@ -351,29 +351,18 @@ TARGET_DEVICES += xiaomi_redmi-router-ax6000-stock
  4. define Device/xiaomi_redmi-router-ax6000-ubootmod
  5. DEVICE_VENDOR := Xiaomi
  6. - DEVICE_MODEL := Redmi Router AX6000 (OpenWrt U-Boot layout)
  7. + DEVICE_MODEL := Redmi Router AX6000 (不死U-Boot)
  8. DEVICE_DTS := mt7986a-xiaomi-redmi-router-ax6000-ubootmod
  9. DEVICE_DTS_DIR := ../dts
  10. DEVICE_PACKAGES := kmod-leds-ws2812b kmod-mt7986-firmware mt7986-wo-firmware
  11. - KERNEL_INITRAMFS_SUFFIX := -recovery.itb
  12. - IMAGES := sysupgrade.itb
  13. UBINIZE_OPTS := -E 5
  14. BLOCKSIZE := 128k
  15. PAGESIZE := 2048
  16. + IMAGE_SIZE := 112640k
  17. KERNEL_IN_UBI := 1
  18. - UBOOTENV_IN_UBI := 1
  19. - KERNEL := kernel-bin | gzip
  20. - KERNEL_INITRAMFS := kernel-bin | lzma | \
  21. - fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
  22. - IMAGE/sysupgrade.itb := append-kernel | \
  23. - fit gzip $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb external-static-with-rootfs | append-metadata
  24. - ARTIFACTS := preloader.bin bl31-uboot.fip
  25. - ARTIFACT/preloader.bin := mt7986-bl2 spim-nand-ddr4
  26. - ARTIFACT/bl31-uboot.fip := mt7986-bl31-uboot xiaomi_redmi-router-ax6000
  27. -ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),)
  28. - ARTIFACTS += initramfs-factory.ubi
  29. - ARTIFACT/initramfs-factory.ubi := append-image-stage initramfs-recovery.itb | ubinize-kernel
  30. -endif
  31. + IMAGES += factory.bin
  32. + IMAGE/factory.bin := append-ubi | check-size $$$$(IMAGE_SIZE)
  33. + IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
  34. endef
  35. TARGET_DEVICES += xiaomi_redmi-router-ax6000-ubootmod
  36. --- a/package/boot/uboot-envtools/files/mediatek_filogic
  37. +++ b/package/boot/uboot-envtools/files/mediatek_filogic
  38. @@ -51,11 +51,13 @@ xiaomi,redmi-router-ax6000-stock)
  39. ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x10000" "0x20000"
  40. ubootenv_add_uci_sys_config "/dev/mtd2" "0x0" "0x10000" "0x20000"
  41. ;;
  42. +xiaomi,redmi-router-ax6000*)
  43. + ubootenv_add_uci_config "/dev/mtd2" "0x0" "0x10000" "0x20000" "1"
  44. + ;;
  45. qihoo,360t7|\
  46. tplink,tl-xdr4288|\
  47. tplink,tl-xdr6086|\
  48. -tplink,tl-xdr6088|\
  49. -xiaomi,redmi-router-ax6000-ubootmod)
  50. +tplink,tl-xdr6088)
  51. . /lib/upgrade/nand.sh
  52. local envubi=$(nand_find_ubi ubi)
  53. local envdev=/dev/$(nand_find_volume $envubi ubootenv)
  54. --- a/target/linux/mediatek/dts/mt7986a-xiaomi-redmi-router-ax6000-ubootmod.dts
  55. +++ b/target/linux/mediatek/dts/mt7986a-xiaomi-redmi-router-ax6000-ubootmod.dts
  56. @@ -4,13 +4,86 @@
  57. #include "mt7986a-xiaomi-redmi-router-ax6000.dtsi"
  58. / {
  59. - model = "Xiaomi Redmi Router AX6000 (OpenWrt U-Boot layout)";
  60. + model = "Xiaomi Redmi Router AX6000 (不死U-Boot)";
  61. compatible = "xiaomi,redmi-router-ax6000-ubootmod", "mediatek,mt7986a";
  62. };
  63. -&partitions {
  64. - partition@580000 {
  65. - label = "ubi";
  66. - reg = <0x580000 0x7a80000>;
  67. +&spi0 {
  68. + pinctrl-names = "default";
  69. + pinctrl-0 = <&spi_flash_pins>;
  70. + cs-gpios = <0>, <0>;
  71. + status = "okay";
  72. +
  73. + spi_nand: spi_nand@1 {
  74. + #address-cells = <1>;
  75. + #size-cells = <1>;
  76. + compatible = "spi-nand";
  77. + reg = <1>;
  78. + spi-max-frequency = <52000000>;
  79. + spi-tx-buswidth = <4>;
  80. + spi-rx-buswidth = <4>;
  81. + spi-cal-enable;
  82. + spi-cal-mode = "read-data";
  83. + spi-cal-datalen = <7>;
  84. + spi-cal-data = /bits/ 8 <0x53 0x50 0x49 0x4E 0x41 0x4E 0x44>; /* 'SPINAND' */
  85. + spi-cal-addrlen = <5>;
  86. + spi-cal-addr = /bits/ 32 <0x0 0x0 0x0 0x0 0x0>;
  87. + };
  88. +};
  89. +
  90. +/ {
  91. + nmbm_spim_nand {
  92. + compatible = "generic,nmbm";
  93. + #address-cells = <1>;
  94. + #size-cells = <1>;
  95. +
  96. + lower-mtd-device = <&spi_nand>;
  97. + forced-create;
  98. +
  99. + partitions {
  100. + compatible = "fixed-partitions";
  101. + #address-cells = <0x01>;
  102. + #size-cells = <0x01>;
  103. +
  104. + partition@0 {
  105. + label = "BL2";
  106. + reg = <0x00 0x100000>;
  107. + };
  108. +
  109. + partition@100000 {
  110. + label = "Nvram";
  111. + reg = <0x100000 0x40000>;
  112. + };
  113. +
  114. + partition@140000 {
  115. + label = "Bdata";
  116. + reg = <0x140000 0x40000>;
  117. + };
  118. +
  119. + partition@180000 {
  120. + label = "Factory";
  121. + reg = <0x180000 0x200000>;
  122. + };
  123. +
  124. + partition@380000 {
  125. + label = "FIP";
  126. + reg = <0x380000 0x200000>;
  127. + };
  128. +
  129. + partition@580000 {
  130. + label = "crash";
  131. + reg = <0x580000 0x40000>;
  132. + };
  133. +
  134. + partition@5c0000 {
  135. + label = "crash_log";
  136. + reg = <0x5c0000 0x40000>;
  137. + };
  138. +
  139. + partition@600000 {
  140. + label = "ubi";
  141. + reg = <0x600000 0x6e00000>;
  142. + };
  143. + };
  144. };
  145. };