6x_bootscript 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. echo "checking for U-Boot upgrades..";
  2. setenv offset 0x400
  3. if load ${dtype} ${disk}:1 12000000 /boot/u-boot.imx; then
  4. echo " found u-boot.imx $filesize bytes)";
  5. if sf probe || sf probe || sf probe 1 27000000 || sf probe 1 27000000; then
  6. echo "probed SPI ROM";
  7. if sf read 0x12400000 $offset $filesize; then
  8. if cmp.b 0x12000000 0x12400000 $filesize; then
  9. echo " no upgrade needed";
  10. else
  11. echo " need U-Boot upgrade, flashing in 5 seconds..";
  12. for n in 5 4 3 2 1; do
  13. echo $n;
  14. sleep 1;
  15. done
  16. echo " erasing flash..";
  17. sf erase 0 0xC0000;
  18. # two steps to prevent bricking
  19. echo " writing flash..";
  20. sf write 0x12000000 $offset $filesize;
  21. echo " verifying flash..";
  22. if sf read 0x12400000 $offset $filesize; then
  23. if cmp.b 0x12000000 0x12400000 $filesize; then
  24. echo "---- U-Boot upgraded. resetting..";
  25. reset;
  26. else
  27. echo " read verification error";
  28. fi
  29. else
  30. echo " error re-reading EEPROM";
  31. fi
  32. fi
  33. else
  34. echo " error reading boot loader from EEPROM";
  35. fi
  36. else
  37. echo " error initializing EEPROM";
  38. fi;
  39. else
  40. echo " no U-Boot image found on SD card";
  41. fi
  42. setenv bootargs
  43. setenv nextcon 0;
  44. if hdmidet ; then
  45. setenv bootargs $bootargs video=mxcfb${nextcon}:dev=hdmi,1280x720M@60,if=RGB24
  46. setenv fbmem "fbmem=28M";
  47. setexpr nextcon $nextcon + 1
  48. else
  49. echo "------ no HDMI monitor";
  50. fi
  51. i2c dev 2
  52. if i2c probe 0x04 ; then
  53. setenv bootargs $bootargs video=mxcfb${nextcon}:dev=ldb,LDB-XGA,if=RGB666
  54. if test "0" -eq $nextcon; then
  55. setenv fbmem "fbmem=10M";
  56. else
  57. setenv fbmem ${fbmem},10M
  58. fi
  59. setexpr nextcon $nextcon + 1
  60. else
  61. echo "------ no Freescale display";
  62. fi
  63. if i2c probe 0x38 ; then
  64. setenv bootargs $bootargs video=mxcfb${nextcon}:dev=ldb,1024x600M@60,if=RGB666
  65. if test "0" -eq $nextcon; then
  66. setenv fbmem "fbmem=10M";
  67. else
  68. setenv fbmem ${fbmem},10M
  69. fi
  70. setexpr nextcon $nextcon + 1
  71. else
  72. echo "------ no 1024x600 display";
  73. fi
  74. if i2c probe 0x48 ; then
  75. setenv bootargs $bootargs video=mxcfb${nextcon}:dev=lcd,CLAA-WVGA,if=RGB666
  76. if test "0" -eq $nextcon; then
  77. setenv fbmem "fbmem=10M";
  78. else
  79. setenv fbmem ${fbmem},10M
  80. fi
  81. setexpr nextcon $nextcon + 1
  82. else
  83. echo "------ no 800x480 display";
  84. fi
  85. while test "3" -ne $nextcon ; do
  86. setenv bootargs $bootargs video=mxcfb${nextcon}:off ;
  87. setexpr nextcon $nextcon + 1 ;
  88. done
  89. setenv bootargs $bootargs $fbmem
  90. part uuid ${dtype} ${disk}:1 uuid
  91. setenv bootargs $bootargs console=ttymxc1,115200 vmalloc=400M root=PARTUUID=${uuid} rw rootwait consoleblank=0
  92. setenv fdtfile imx6q-nitrogen6x.dtb
  93. load ${dtype} ${disk}:1 10800000 /boot/vmlinuz-linux-libre && load ${dtype} ${disk}:1 11000000 /boot/dtbs/linux-libre/${fdtfile} && bootz 10800000 - 11000000
  94. load ${dtype} ${disk}:1 10800000 /boot/uImage && bootm 10800000