55-xgp.patch 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. --- a/target/linux/rockchip/image/Makefile
  2. +++ b/target/linux/rockchip/image/Makefile
  3. @@ -20,6 +20,23 @@ define Build/boot-common
  4. $(CP) $(IMAGE_KERNEL) [email protected]/kernel.img
  5. endef
  6. +define Build/boot-combined
  7. + # This creates a new folder copies the dtbs (as rockchip*.dtb)
  8. + # and the kernel image (as kernel.img)
  9. + rm -fR [email protected]
  10. + mkdir -p [email protected]
  11. +
  12. + i=0; \
  13. + for dts in $(DEVICE_DTS); do \
  14. + dts=$$(echo $${dts} | cut -d'/' -f2); \
  15. + $(CP) $(KDIR)/image-$$(echo $${dts} | cut -d'/' -f2).dtb [email protected]/rockchip$$(perl -e 'printf "%b\n",'$$i).dtb; \
  16. + let i+=1; \
  17. + done
  18. +
  19. + $(LN) rockchip0.dtb [email protected]/rockchip.dtb
  20. + $(CP) $(IMAGE_KERNEL) [email protected]/kernel.img
  21. +endef
  22. +
  23. define Build/boot-script
  24. # Make an U-boot image and copy it to the boot partition
  25. mkimage -A arm -O linux -T script -C none -a 0 -e 0 -d $(if $(1),$(1),mmc).bootscript [email protected]/boot.scr
  26. diff --git a/target/linux/rockchip/image/nlnet-xgp.bootscript b/target/linux/rockchip/image/nlnet-xgp.bootscript
  27. new file mode 100644
  28. index 0000000000000..80df26f6c1520
  29. --- /dev/null
  30. +++ b/target/linux/rockchip/image/nlnet-xgp.bootscript
  31. @@ -0,0 +1,38 @@
  32. +# nlnet-xgp rk3568 combined image, board detected by ADC
  33. +
  34. +env delete hwrev
  35. +env delete coreboard_adc_value
  36. +env delete motherboard_adc_value
  37. +
  38. +# using SARADC CH1 to detect coreboard hwrev
  39. +# using SARADC CH7 to detect motherboard hwrev
  40. +
  41. +adc single saradc@fe720000 1 coreboard_adc_value
  42. +adc single saradc@fe720000 7 motherboard_adc_value
  43. +
  44. +if test -n "$coreboard_adc_value"; then
  45. + if test "$coreboard_adc_value" -lt 225000; then
  46. + echo coreboard rev02
  47. + fi
  48. +fi
  49. +
  50. +if test -n "$motherboard_adc_value"; then
  51. + if test "$motherboard_adc_value" -lt 225000; then
  52. + echo motherboard rev03
  53. + setenv hwrev 1
  54. + fi
  55. +fi
  56. +
  57. +env delete coreboard_adc_value
  58. +env delete motherboard_adc_value
  59. +
  60. +part uuid mmc ${devnum}:2 uuid
  61. +
  62. +setenv bootargs "console=ttyS2,1500000 earlycon=uart8250,mmio32,0xfe660000 root=PARTUUID=${uuid} rw rootwait"
  63. +
  64. +load mmc ${devnum}:1 ${fdt_addr_r} rockchip${hwrev}.dtb
  65. +load mmc ${devnum}:1 ${kernel_addr_r} kernel.img
  66. +
  67. +env delete hwrev
  68. +
  69. +booti ${kernel_addr_r} - ${fdt_addr_r}