boot.cmd 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  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 x7D == "x${imx_cpu}"; then
  12. a_base=0x80000000
  13. elif itest.s x8MQ == "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 x7D == "x${imx_cpu}" ; then
  43. fdt_file=imx7d-${board}${m4}.dtb;
  44. elif itest.s x8MQ == "x${imx_cpu}" ; then
  45. fdt_file=imx8mq-${board}${m4}.dtb;
  46. elif itest.s x51 == "x${imx_cpu}" ; then
  47. fdt_file=imx51-${board}.dtb;
  48. elif itest.s x53 == "x${imx_cpu}" ; then
  49. fdt_file=imx53-${board}.dtb;
  50. else
  51. fdt_file=imx6q-${board}.dtb;
  52. fi
  53. fi
  54. if itest.s x${distro_bootpart} == x ; then
  55. distro_bootpart=1
  56. fi
  57. if load ${devtype} ${devnum}:${distro_bootpart} ${a_script} uEnv.txt ; then
  58. env import -t ${a_script} ${filesize}
  59. fi
  60. setenv bootargs ${bootargs} console=${console},115200 vmalloc=400M consoleblank=0 rootwait fixrtc cpu=${imx_cpu} board=${board}
  61. if load ${devtype} ${devnum}:${distro_bootpart} ${a_fdt} ${prefix}${fdt_file} ; then
  62. fdt addr ${a_fdt}
  63. setenv fdt_high 0xffffffff
  64. else
  65. echo "!!!! Error loading ${prefix}${fdt_file}";
  66. exit;
  67. fi
  68. fdt resize
  69. if itest.s "x" != "x${cmd_custom}" ; then
  70. run cmd_custom
  71. fi
  72. if itest.s "x" != "x${cmd_hdmi}" ; then
  73. run cmd_hdmi
  74. if itest.s x == x${allow_noncea} ; then
  75. setenv bootargs ${bootargs} mxc_hdmi.only_cea=1;
  76. echo "only CEA modes allowed on HDMI port";
  77. else
  78. setenv bootargs ${bootargs} mxc_hdmi.only_cea=0;
  79. echo "non-CEA modes allowed on HDMI, audio may be affected";
  80. fi
  81. fi
  82. if itest.s "x" != "x${cmd_lcd}" ; then
  83. run cmd_lcd
  84. fi
  85. if itest.s "x" != "x${cmd_lcd2}" ; then
  86. run cmd_lcd2
  87. fi
  88. if itest.s "x" != "x${cmd_lvds}" ; then
  89. run cmd_lvds
  90. fi
  91. if itest.s "x" != "x${cmd_lvds2}" ; then
  92. run cmd_lvds2
  93. fi
  94. if itest.s "x" != "x${cmd_mipi}" ; then
  95. run cmd_mipi
  96. fi
  97. if test "sata" = "${devtype}" ; then
  98. setenv bootargs "${bootargs} root=/dev/sda${distro_bootpart}" ;
  99. elif test "usb" = "${devtype}" ; then
  100. setenv bootargs "${bootargs} root=/dev/sda${distro_bootpart}" ;
  101. else
  102. setenv bootargs "${bootargs} root=/dev/mmcblk${devnum}p${distro_bootpart}"
  103. fi
  104. if itest.s "x" != "x${disable_msi}" ; then
  105. setenv bootargs ${bootargs} pci=nomsi
  106. fi;
  107. if itest.s "x" != "x${disable_giga}" ; then
  108. setenv bootargs ${bootargs} fec.disable_giga=1
  109. fi
  110. if itest.s "x" != "x${wlmac}" ; then
  111. setenv bootargs ${bootargs} wlcore.mac=${wlmac}
  112. fi
  113. if itest.s "x" != "x${gpumem}" ; then
  114. setenv bootargs ${bootargs} galcore.contiguousSize=${gpumem}
  115. fi
  116. if itest.s "x" != "x${cma}" ; then
  117. setenv bootargs ${bootargs} cma=${cma}
  118. fi
  119. if itest.s "x" != "x${loglevel}" ; then
  120. setenv bootargs ${bootargs} loglevel=${loglevel}
  121. fi
  122. if itest.s "x" != "x${show_fdt}" ; then
  123. fdt print /
  124. fi
  125. if itest.s "x" != "x${show_env}" ; then
  126. printenv
  127. fi
  128. if load ${devtype} ${devnum}:${distro_bootpart} ${a_zImage} ${prefix}${kernelimage} ; then
  129. ${bootcommand} ${a_zImage} - ${a_fdt}
  130. fi
  131. echo "Error loading kernel image"