boot.cmd 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. setenv bootargs ''
  2. m4=''
  3. kernelimage=zImage
  4. bootcommand=bootz
  5. a_base=0x10000000
  6. #grab 1st 2/3 characters of string
  7. setexpr cpu2 sub "^(..?).*" "\\1" "${imx_cpu}"
  8. setexpr cpu3 sub "^(..?.?).*" "\\1" "${imx_cpu}"
  9. if itest.s x51 == "x${cpu2}" ; then
  10. a_base=0x90000000
  11. elif itest.s x53 == "x${cpu2}"; then
  12. a_base=0x70000000
  13. elif itest.s x6SX == "x${cpu3}" || itest.s x6U == "x${cpu2}" || itest.s x7D == "x${cpu2}"; then
  14. a_base=0x80000000
  15. elif itest.s x8M == "x${cpu2}"; then
  16. a_base=0x40000000
  17. kernelimage=Image
  18. bootcommand=booti
  19. fi
  20. if itest.s "x1" == "x${m4enabled}" ; then
  21. run m4boot;
  22. m4='-m4';
  23. fi
  24. setexpr a_script ${a_base} + 0x00800000
  25. setexpr a_zImage ${a_base} + 0x00800000
  26. setexpr a_fdt ${a_base} + 0x03000000
  27. setexpr a_initrd ${a_base} + 0x03100000
  28. setexpr a_reset_cause_marker ${a_base} + 0x80
  29. setexpr a_reset_cause ${a_base} + 0x84
  30. if itest.s "x" == "x${board}" ; then
  31. echo "!!!! Error: Your u-boot is outdated. Please upgrade.";
  32. exit;
  33. fi
  34. if itest.s "x" == "x${fdt_file}" ; then
  35. if itest.s x51 == "x${cpu2}" ; then
  36. fdt_file=imx51-${board}${m4}.dtb;
  37. elif itest.s x53 == "x${cpu2}" ; then
  38. fdt_file=imx53-${board}${m4}.dtb;
  39. elif itest.s x6DL == "x${cpu3}" || itest.s x6SO == "x${cpu3}" ; then
  40. fdt_file=imx6dl-${board}.dtb;
  41. elif itest.s x6QP == "x${cpu3}" ; then
  42. fdt_file=imx6qp-${board}.dtb;
  43. elif itest.s x6SX == "x${cpu3}" ; then
  44. fdt_file=imx6sx-${board}${m4}.dtb;
  45. elif itest.s x6UL == "x${cpu3}" ; then
  46. fdt_file=imx6ull-${board}.dtb;
  47. elif itest.s x7D == "x${cpu2}" ; then
  48. fdt_file=imx7d-${board}${m4}.dtb;
  49. elif itest.s x8MM == "x${cpu3}" ; then
  50. fdt_file=imx8mm-${board}${m4}.dtb;
  51. elif itest.s x8MN == "x${cpu3}" ; then
  52. fdt_file=imx8mn-${board}${m4}.dtb;
  53. elif itest.s x8MP == "x${cpu3}" ; then
  54. if itest *0x30360800 == 0x00824310 ; then
  55. fdt_file=imx8mp-a0-${board}${m4}.dtb;
  56. else
  57. fdt_file=imx8mp-${board}${m4}.dtb;
  58. fi
  59. elif itest.s x8MQ == "x${cpu3}" ; then
  60. fdt_file=imx8mq-${board}${m4}.dtb;
  61. else
  62. fdt_file=imx6q-${board}.dtb;
  63. fi
  64. fi
  65. if itest.s x${distro_bootpart} == x ; then
  66. distro_bootpart=1
  67. fi
  68. if load ${devtype} ${devnum}:${distro_bootpart} ${a_script} uEnv.txt ; then
  69. env import -t ${a_script} ${filesize}
  70. fi
  71. if itest.s x${console} != x ; then
  72. setenv bootargs ${bootargs} console=${console},115200
  73. fi
  74. if itest.s "x" == "x$vmalloc" ; then
  75. vmalloc=400M
  76. fi
  77. if itest.s x${consoleblank} == x ; then
  78. consoleblank=0
  79. fi
  80. setenv bootargs ${bootargs} vmalloc=${vmalloc} consoleblank=${consoleblank} rootwait fixrtc cpu=${imx_cpu} board=${board} uboot_release=${uboot_release}
  81. if load ${devtype} ${devnum}:${distro_bootpart} ${a_fdt} ${prefix}${fdt_file} ; then
  82. fdt addr ${a_fdt}
  83. else
  84. echo "!!!! Error loading ${prefix}${fdt_file}";
  85. exit;
  86. fi
  87. fdt resize 4096
  88. if itest.s "x" != "x${cmd_board}" ; then
  89. run cmd_board
  90. fi
  91. if itest.s "x" != "x${cmd_custom}" ; then
  92. run cmd_custom
  93. fi
  94. if itest.s "x" != "x${cmd_hdmi}" ; then
  95. run cmd_hdmi
  96. if itest.s x != x${allow_noncea} ; then
  97. setenv bootargs ${bootargs} mxc_hdmi.only_cea=0;
  98. echo "non-CEA modes allowed on HDMI, audio may be affected";
  99. fi
  100. fi
  101. if itest.s "x" != "x${cmd_lcd}" ; then
  102. run cmd_lcd
  103. fi
  104. if itest.s "x" != "x${cmd_lcd2}" ; then
  105. run cmd_lcd2
  106. fi
  107. if itest.s "x" != "x${cmd_lvds}" ; then
  108. run cmd_lvds
  109. fi
  110. if itest.s "x" != "x${cmd_lvds2}" ; then
  111. run cmd_lvds2
  112. fi
  113. if itest.s "x" != "x${cmd_mipi}" ; then
  114. run cmd_mipi
  115. fi
  116. if test "sata" = "${devtype}" ; then
  117. setenv bootargs "${bootargs} root=/dev/sda${distro_bootpart}" ;
  118. elif test "usb" = "${devtype}" ; then
  119. setenv bootargs "${bootargs} root=/dev/sda${distro_bootpart}" ;
  120. else
  121. setenv bootargs "${bootargs} root=/dev/mmcblk${devnum}p${distro_bootpart}"
  122. fi
  123. if itest.s "x" != "x${disable_msi}" ; then
  124. setenv bootargs ${bootargs} pci=nomsi
  125. fi;
  126. if itest.s "x" != "x${disable_giga}" ; then
  127. setenv bootargs ${bootargs} fec.disable_giga=1
  128. fi
  129. if itest.s "x" != "x${wlmac}" ; then
  130. setenv bootargs ${bootargs} wlcore.mac=${wlmac}
  131. fi
  132. if itest.s "x" != "x${gpumem}" ; then
  133. setenv bootargs ${bootargs} galcore.contiguousSize=${gpumem}
  134. fi
  135. if itest.s "x" != "x${cma}" ; then
  136. setenv bootargs ${bootargs} cma=${cma}
  137. fi
  138. if itest.s "x" != "x${loglevel}" ; then
  139. setenv bootargs ${bootargs} loglevel=${loglevel}
  140. fi
  141. if itest.s "x" != "x${show_fdt}" ; then
  142. fdt print /
  143. fi
  144. if itest.s "x" != "x${show_env}" ; then
  145. printenv
  146. fi
  147. if load ${devtype} ${devnum}:${distro_bootpart} ${a_zImage} ${prefix}${kernelimage} ; then
  148. ${bootcommand} ${a_zImage} - ${a_fdt}
  149. fi
  150. echo "Error loading kernel image"