boot.cmd 4.2 KB

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