97-xgp.patch 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. diff --git a/package/boot/uboot-rockchip/Makefile b/package/boot/uboot-rockchip/Makefile
  2. index bc3297efa9d4e..4875f01b43617 100644
  3. --- a/package/boot/uboot-rockchip/Makefile
  4. +++ b/package/boot/uboot-rockchip/Makefile
  5. @@ -196,6 +196,17 @@ define U-Boot/opc-h68k-rk3568
  6. DDR:=rk3568_ddr_1560MHz_v1.13.bin
  7. endef
  8. +define U-Boot/nlnet-xgp-rk3568
  9. + BUILD_SUBTARGET:=armv8
  10. + NAME:=NLnet XGP Board
  11. + BUILD_DEVICES:= \
  12. + nlnet_xgp
  13. + DEPENDS:=+PACKAGE_u-boot-nlnet-xgp-rk3568:arm-trusted-firmware-rk3568
  14. + PKG_BUILD_DEPENDS:=arm-trusted-firmware-rockchip-vendor
  15. + ATF:=rk3568_bl31_v1.43.elf
  16. + DDR:=rk3568_ddr_1560MHz_v1.18.bin
  17. +endef
  18. +
  19. define U-Boot/photonicat-rk3568
  20. BUILD_SUBTARGET:=armv8
  21. NAME:=Ariaboard Photonicat
  22. @@ -255,6 +266,7 @@ endef
  23. UBOOT_TARGETS := \
  24. mrkaio-m68s-rk3568 \
  25. opc-h68k-rk3568 \
  26. + nlnet-xgp-rk3568 \
  27. photonicat-rk3568 \
  28. radxa-e25-rk3568 \
  29. rock-3a-rk3568 \
  30. diff --git a/target/linux/rockchip/armv8/base-files/etc/board.d/02_network b/target/linux/rockchip/armv8/base-files/etc/board.d/02_network
  31. index 8fed56a0027b9..95410bca3a518 100755
  32. --- a/target/linux/rockchip/armv8/base-files/etc/board.d/02_network
  33. +++ b/target/linux/rockchip/armv8/base-files/etc/board.d/02_network
  34. @@ -17,6 +17,7 @@
  35. friendlyarm,nanopi-r2s|\
  36. friendlyarm,nanopi-r4s|\
  37. friendlyarm,nanopi-r4se|\
  38. + nlnet,xgp|\
  39. rocktech,mpc1903|\
  40. sharevdi,h3399pc|\
  41. sharevdi,guangmiao-g4c|\
  42. @@ -88,6 +89,7 @@
  43. hinlink,opc-h66k|\
  44. hinlink,opc-h68k|\
  45. hinlink,opc-h69k|\
  46. + nlnet,xgp|\
  47. rocktech,mpc1903|\
  48. sharevdi,h3399pc)
  49. wan_mac=$(macaddr_generate_from_mmc_cid mmcblk0)
  50. diff --git a/target/linux/rockchip/image/armv8.mk b/target/linux/rockchip/image/armv8.mk
  51. index 88f40f98f45db..c8fe96f74d37e 100644
  52. --- a/target/linux/rockchip/image/armv8.mk
  53. +++ b/target/linux/rockchip/image/armv8.mk
  54. @@ -81,6 +80,17 @@ $(call Device/fastrhino_common)
  55. endef
  56. TARGET_DEVICES += fastrhino_r68s
  57. +define Device/nlnet_xgp
  58. + DEVICE_VENDOR := NLnet
  59. + DEVICE_MODEL := XiGuaPi
  60. + SOC := rk3568
  61. + UBOOT_DEVICE_NAME := nlnet-xgp-rk3568
  62. + IMAGE/sysupgrade.img.gz := boot-combined | boot-script nlnet-xgp | pine64-img | gzip | append-metadata
  63. + DEVICE_PACKAGES := kmod-hwmon-pwmfan kmod-mt7921e wpad-openssl
  64. + DEVICE_DTS = rockchip/rk3568-xgp rockchip/rk3568-xgp-v3
  65. +endef
  66. +TARGET_DEVICES += nlnet_xgp
  67. +
  68. define Device/friendlyarm_nanopi-neo3
  69. DEVICE_VENDOR := FriendlyARM
  70. DEVICE_MODEL := NanoPi NEO3
  71. diff --git a/target/linux/rockchip/patches-5.15/210-rockchip-rk356x-add-support-for-new-boards.patch b/target/linux/rockchip/patches-5.15/210-rockchip-rk356x-add-support-for-new-boards.patch
  72. index 2f9a26979dc4b..f66423793c78d 100644
  73. --- a/target/linux/rockchip/patches-5.15/210-rockchip-rk356x-add-support-for-new-boards.patch
  74. +++ b/target/linux/rockchip/patches-5.15/210-rockchip-rk356x-add-support-for-new-boards.patch
  75. @@ -1,6 +1,6 @@
  76. --- a/arch/arm64/boot/dts/rockchip/Makefile
  77. +++ b/arch/arm64/boot/dts/rockchip/Makefile
  78. -@@ -59,3 +59,19 @@ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-sa
  79. +@@ -59,3 +59,20 @@ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-sa
  80. dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-sapphire-excavator.dtb
  81. dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399pro-rock-pi-n10.dtb
  82. dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3568-evb1-v10.dtb
  83. @@ -20,3 +20,4 @@
  84. +dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3568-seewo-sv21.dtb
  85. +dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3568-t68m.dtb
  86. +dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3566-panther-x2.dtb
  87. ++dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3568-xgp.dtb
  88. --- a/target/linux/rockchip/armv8/base-files/etc/board.d/01_leds
  89. +++ b/target/linux/rockchip/armv8/base-files/etc/board.d/01_leds
  90. @@ -36,6 +36,9 @@ hinlink,opc-h68k|\
  91. hinlink,opc-h69k)
  92. ucidef_set_led_netdev "wan" "WAN" "blue:net" "eth0"
  93. ;;
  94. +nlnet,xgp)
  95. + ucidef_set_led_netdev "wan" "WAN" "blue:sys" "eth0"
  96. + ;;
  97. esac
  98. board_config_flush
  99. diff --git a/target/linux/rockchip/image/Makefile b/target/linux/rockchip/image/Makefile
  100. index a2b711a4367cb..b2c53fe0f97e4 100644
  101. --- a/target/linux/rockchip/image/Makefile
  102. +++ b/target/linux/rockchip/image/Makefile
  103. @@ -20,6 +20,23 @@ define Build/boot-common
  104. $(CP) $(IMAGE_KERNEL) [email protected]/kernel.img
  105. endef
  106. +define Build/boot-combined
  107. + # This creates a new folder copies the dtbs (as rockchip*.dtb)
  108. + # and the kernel image (as kernel.img)
  109. + rm -fR [email protected]
  110. + mkdir -p [email protected]
  111. +
  112. + i=0; \
  113. + for dts in $(DEVICE_DTS); do \
  114. + dts=$$(echo $${dts} | cut -d'/' -f2); \
  115. + $(CP) $(KDIR)/image-$$(echo $${dts} | cut -d'/' -f2).dtb [email protected]/rockchip$$(perl -e 'printf "%b\n",'$$i).dtb; \
  116. + let i+=1; \
  117. + done
  118. +
  119. + $(LN) rockchip0.dtb [email protected]/rockchip.dtb
  120. + $(CP) $(IMAGE_KERNEL) [email protected]/kernel.img
  121. +endef
  122. +
  123. define Build/boot-script
  124. # Make an U-boot image and copy it to the boot partition
  125. mkimage -A arm -O linux -T script -C none -a 0 -e 0 -d $(if $(1),$(1),mmc).bootscript [email protected]/boot.scr
  126. diff --git a/target/linux/rockchip/image/nlnet-xgp.bootscript b/target/linux/rockchip/image/nlnet-xgp.bootscript
  127. new file mode 100644
  128. index 0000000000000..80df26f6c1520
  129. --- /dev/null
  130. +++ b/target/linux/rockchip/image/nlnet-xgp.bootscript
  131. @@ -0,0 +1,38 @@
  132. +# nlnet-xgp rk3568 combined image, board detected by ADC
  133. +
  134. +env delete hwrev
  135. +env delete coreboard_adc_value
  136. +env delete motherboard_adc_value
  137. +
  138. +# using SARADC CH1 to detect coreboard hwrev
  139. +# using SARADC CH7 to detect motherboard hwrev
  140. +
  141. +adc single saradc@fe720000 1 coreboard_adc_value
  142. +adc single saradc@fe720000 7 motherboard_adc_value
  143. +
  144. +if test -n "$coreboard_adc_value"; then
  145. + if test "$coreboard_adc_value" -lt 225000; then
  146. + echo coreboard rev02
  147. + fi
  148. +fi
  149. +
  150. +if test -n "$motherboard_adc_value"; then
  151. + if test "$motherboard_adc_value" -lt 225000; then
  152. + echo motherboard rev03
  153. + setenv hwrev 1
  154. + fi
  155. +fi
  156. +
  157. +env delete coreboard_adc_value
  158. +env delete motherboard_adc_value
  159. +
  160. +part uuid mmc ${devnum}:2 uuid
  161. +
  162. +setenv bootargs "console=ttyS2,1500000 earlycon=uart8250,mmio32,0xfe660000 root=PARTUUID=${uuid} rw rootwait"
  163. +
  164. +load mmc ${devnum}:1 ${fdt_addr_r} rockchip${hwrev}.dtb
  165. +load mmc ${devnum}:1 ${kernel_addr_r} kernel.img
  166. +
  167. +env delete hwrev
  168. +
  169. +booti ${kernel_addr_r} - ${fdt_addr_r}