ax6000.patch 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  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. @@ -54,8 +54,7 @@ xiaomi,redmi-router-ax6000-stock)
  39. qihoo,360t7|\
  40. tplink,tl-xdr4288|\
  41. tplink,tl-xdr6086|\
  42. -tplink,tl-xdr6088|\
  43. -xiaomi,redmi-router-ax6000-ubootmod)
  44. +tplink,tl-xdr6088)
  45. . /lib/upgrade/nand.sh
  46. local envubi=$(nand_find_ubi ubi)
  47. local envdev=/dev/$(nand_find_volume $envubi ubootenv)
  48. --- a/target/linux/mediatek/dts/mt7986a-xiaomi-redmi-router-ax6000-ubootmod.dts
  49. +++ b/target/linux/mediatek/dts/mt7986a-xiaomi-redmi-router-ax6000-ubootmod.dts
  50. @@ -4,13 +4,86 @@
  51. #include "mt7986a-xiaomi-redmi-router-ax6000.dtsi"
  52. / {
  53. - model = "Xiaomi Redmi Router AX6000 (OpenWrt U-Boot layout)";
  54. + model = "Xiaomi Redmi Router AX6000 (不死U-Boot)";
  55. compatible = "xiaomi,redmi-router-ax6000-ubootmod", "mediatek,mt7986a";
  56. };
  57. -&partitions {
  58. - partition@580000 {
  59. - label = "ubi";
  60. - reg = <0x580000 0x7a80000>;
  61. +&spi0 {
  62. + pinctrl-names = "default";
  63. + pinctrl-0 = <&spi_flash_pins>;
  64. + cs-gpios = <0>, <0>;
  65. + status = "okay";
  66. +
  67. + spi_nand: spi_nand@1 {
  68. + #address-cells = <1>;
  69. + #size-cells = <1>;
  70. + compatible = "spi-nand";
  71. + reg = <1>;
  72. + spi-max-frequency = <52000000>;
  73. + spi-tx-buswidth = <4>;
  74. + spi-rx-buswidth = <4>;
  75. + spi-cal-enable;
  76. + spi-cal-mode = "read-data";
  77. + spi-cal-datalen = <7>;
  78. + spi-cal-data = /bits/ 8 <0x53 0x50 0x49 0x4E 0x41 0x4E 0x44>; /* 'SPINAND' */
  79. + spi-cal-addrlen = <5>;
  80. + spi-cal-addr = /bits/ 32 <0x0 0x0 0x0 0x0 0x0>;
  81. + };
  82. +};
  83. +
  84. +/ {
  85. + nmbm_spim_nand {
  86. + compatible = "generic,nmbm";
  87. + #address-cells = <1>;
  88. + #size-cells = <1>;
  89. +
  90. + lower-mtd-device = <&spi_nand>;
  91. + forced-create;
  92. +
  93. + partitions {
  94. + compatible = "fixed-partitions";
  95. + #address-cells = <0x01>;
  96. + #size-cells = <0x01>;
  97. +
  98. + partition@0 {
  99. + label = "BL2";
  100. + reg = <0x00 0x100000>;
  101. + };
  102. +
  103. + partition@100000 {
  104. + label = "Nvram";
  105. + reg = <0x100000 0x40000>;
  106. + };
  107. +
  108. + partition@140000 {
  109. + label = "Bdata";
  110. + reg = <0x140000 0x40000>;
  111. + };
  112. +
  113. + partition@180000 {
  114. + label = "Factory";
  115. + reg = <0x180000 0x200000>;
  116. + };
  117. +
  118. + partition@380000 {
  119. + label = "FIP";
  120. + reg = <0x380000 0x200000>;
  121. + };
  122. +
  123. + partition@580000 {
  124. + label = "crash";
  125. + reg = <0x580000 0x40000>;
  126. + };
  127. +
  128. + partition@5c0000 {
  129. + label = "crash_log";
  130. + reg = <0x5c0000 0x40000>;
  131. + };
  132. +
  133. + partition@600000 {
  134. + label = "ubi";
  135. + reg = <0x600000 0x6e00000>;
  136. + };
  137. + };
  138. };
  139. };