Advertisement
Guest User

Untitled

a guest
Oct 4th, 2023
34
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.41 KB | None | 0 0
  1. 'VqB�e�� �boot script
  2. #
  3. # flash-kernel: bootscr.uboot-generic
  4. #
  5.  
  6. # Bootscript using the new unified bootcmd handling
  7. # introduced with u-boot v2014.10
  8. #
  9. # Expects to be called with the following environment variables set:
  10. #
  11. # devtype e.g. mmc/scsi etc
  12. # devnum The device number of the given type
  13. # bootpart The partition containing the boot files
  14. # distro_bootpart The partition containing the boot files
  15. # (introduced in u-boot mainline 2016.01)
  16. # prefix Prefix within the boot partiion to the boot files
  17. # kernel_addr_r Address to load the kernel to
  18. # fdt_addr_r Address to load the FDT to
  19. # ramdisk_addr_r Address to load the initrd to.
  20. #
  21. # The uboot must support the booti and generic filesystem load commands.
  22.  
  23. # Workaround lack of baudrate included with console on various iMX
  24. # systems (e.g. wandboard, cubox-i, hummingboard)
  25. if test "${console}" = "ttymxc0" && test -n "${baudrate}"; then
  26. setenv console "${console},${baudrate}"
  27. fi
  28.  
  29. if test -n "${console}"; then
  30. setenv bootargs "${bootargs} console=${console}"
  31. fi
  32.  
  33. setenv bootargs "ro no_console_suspend cma=512M pci=nomsi cryptomgr.notests ${bootargs} console=ttymxc0,115200 console=tty1"
  34.  
  35. # Default bootargs for Linux are set here and can be overwritten using
  36. # LINUX_KERNEL_CMDLINE in /etc/default/flash-kernel or by setting them in
  37. # u-boot itself via the setenv command.
  38. setenv bootargs "ro no_console_suspend cma=512M@3G cryptomgr.notests ${bootargs}"
  39.  
  40. # Board-specific bootargs cannot be overwritten by above methods. If you
  41. # really need to overwrite below lines, create
  42. # /etc/flash-kernel/ubootenv.d/00reform2_ubootenv and fill it with what you
  43. # would like to replace the contents of this file with.
  44. if test "${board}" = "nitrogen8m_som"; then
  45. setenv bootargs "${bootargs} console=ttymxc0,115200 pci=nomsi"
  46. elif test "${board}" = "MNT Reform 2.0"; then
  47. # some imx8mq Reforms have this board value
  48. setenv bootargs "${bootargs} console=ttymxc0,115200 pci=nomsi"
  49. elif test "${board}" = "u200"; then
  50. # amlogic internal name for a311d dev board
  51. setenv bootargs "${bootargs} console=ttyAML0,115200 pci=pcie_bus_perf libata.force=noncq nvme_core.default_ps_max_latency_us=0"
  52. elif test "${board}" = "ls1028a"; then
  53. setenv bootargs "${bootargs} console=ttyS0,115200 iommu.passthrough=1 arm-smmu.disable_bypass=0"
  54. fi
  55.  
  56. # console=tty1 needs to go at the end of the kernel cmdline because the luks
  57. # passphrase prompt will show up on the last console which must not be the
  58. # serial terminal but the tty displayed to the screen
  59. setenv bootargs "${bootargs} console=tty1"
  60.  
  61. if test -z "${fk_kvers}"; then
  62. setenv fk_kvers '6.5.0-1-reform2-arm64'
  63. fi
  64.  
  65. # These two blocks should be the same apart from the use of
  66. # ${fk_kvers} in the first, the syntax supported by u-boot does not
  67. # lend itself to removing this duplication.
  68.  
  69. if test -n "${fdtfile}"; then
  70. setenv fdtpath dtbs/${fk_kvers}/${fdtfile}
  71. else
  72. setenv fdtpath dtb-${fk_kvers}
  73. fi
  74.  
  75. if test -z "${distro_bootpart}"; then
  76. setenv partition ${bootpart}
  77. else
  78. setenv partition ${distro_bootpart}
  79. fi
  80.  
  81.  
  82. # place here any u-boot commands to be executed before boot
  83.  
  84. if test -z "${fk_image_locations}"; then
  85. setenv fk_image_locations ${prefix}
  86. fi
  87.  
  88. for pathprefix in ${fk_image_locations}
  89. do
  90. if test -e ${devtype} ${devnum}:${partition} ${pathprefix}vmlinuz-${fk_kvers}
  91. then
  92. load ${devtype} ${devnum}:${partition} ${kernel_addr_r} ${pathprefix}vmlinuz-${fk_kvers} \
  93. && load ${devtype} ${devnum}:${partition} ${fdt_addr_r} ${pathprefix}${fdtpath} \
  94. && load ${devtype} ${devnum}:${partition} ${ramdisk_addr_r} ${pathprefix}initrd.img-${fk_kvers} \
  95. && echo "Booting Debian ${fk_kvers} from ${devtype} ${devnum}:${partition}..." \
  96. && booti ${kernel_addr_r} ${ramdisk_addr_r}:${filesize} ${fdt_addr_r}
  97. fi
  98. done
  99.  
  100. for pathprefix in ${fk_image_locations}
  101. do
  102. if test -e ${devtype} ${devnum}:${partition} ${pathprefix}vmlinuz
  103. then
  104. load ${devtype} ${devnum}:${partition} ${kernel_addr_r} ${pathprefix}vmlinuz \
  105. && load ${devtype} ${devnum}:${partition} ${fdt_addr_r} ${pathprefix}dtb \
  106. && load ${devtype} ${devnum}:${partition} ${ramdisk_addr_r} ${pathprefix}initrd.img \
  107. && echo "Booting Debian from ${devtype} ${devnum}:${partition}..." \
  108. && booti ${kernel_addr_r} ${ramdisk_addr_r}:${filesize} ${fdt_addr_r}
  109. fi
  110. done
  111.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement