Advertisement
ficus

U-Boot Calculation for Arch Linux ARM on Odroid

Aug 26th, 2016
286
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.76 KB | None | 0 0
  1. DOING THE MATH:
  2. ((OFFSET X 512 BYTES) + (SIZE OF tzsw.bin IN BYTES)) / 512
  3. ((2111 x 512) + 262144) = 1342976 / 512 = 2623 SECTORS
  4.  
  5. I had the file size for u-boot.bin originally, but I am still getting over 2048 after correcting this.
  6. Am I doing something wrong here? I have looked at this a few times. I'll try this calculation again in the morning.
  7.  
  8. [alarm@xu4 boot]$ ls -l
  9. total 4352
  10. -rw-r--r-- 1 root root 15360 Aug 20 17:07 bl1.bin
  11. -rw-r--r-- 1 root root 14592 Aug 20 17:07 bl2.bin
  12. -rw-r--r-- 1 root root 2046 Aug 24 08:57 boot.scr
  13. -rw-r--r-- 1 root root 1974 Aug 24 08:57 boot.txt
  14. drwxr-xr-x 2 root root 4096 Aug 24 07:08 dtbs
  15. -rwxr-xr-x 1 root root 239 Aug 20 17:07 mkscr
  16. -rwxr-xr-x 1 root root 1746 Aug 20 17:07 sd_fusing.sh
  17. -rw-r--r-- 1 root root 262144 Aug 20 17:07 tzsw.bin
  18. -rw-r--r-- 1 root root 543414 Aug 20 17:07 u-boot.bin
  19. -rwxr-xr-x 1 root root 3592976 Aug 21 12:02 zImage
  20. [alarm@xu4 boot]$ more sd_fusing.sh
  21. #!/usr/bin/bash
  22. ####################################
  23. #
  24. # Copyright (C) 2011 Samsung Electronics Co., Ltd.
  25. # http://www.samsung.com/
  26. #
  27. # This program is free software; you can redistribute it and/or modify
  28. # it under the terms of the GNU General Public License version 2 as
  29. # published by the Free Software Foundation.
  30. #
  31. ####################################
  32. #
  33. # Modified for Arch Linux ARM package uboot-odroid-xu3
  34. #
  35. ####################################
  36.  
  37. if [ -z $1 ]
  38. then
  39. echo "usage: ./sd_fusing.sh <SD Reader's device file>"
  40. exit 0
  41. fi
  42.  
  43. if [ -b $1 ]
  44. then
  45. echo "$1 reader is identified."
  46. else
  47. echo "$1 is NOT identified."
  48. exit 0
  49. fi
  50.  
  51. if [ -d /sys/block/${1##*/}boot0 ]; then
  52. echo "$1 is an eMMC card, disabling ${1##*/}boot0 ro"
  53. if ! echo 0 > /sys/block/${1##*/}boot0/force_ro; then
  54. echo "Enabling r/w for $1boot0 failed"
  55. exit 1
  56. fi
  57. emmc=1
  58. fi
  59.  
  60. ####################################
  61. # fusing images
  62.  
  63. if [ -n "$emmc" ]; then
  64. signed_bl1_position=0
  65. bl2_position=30
  66. uboot_position=62
  67. tzsw_position=2110
  68. device=$1boot0
  69. else
  70. signed_bl1_position=1
  71. bl2_position=31
  72. uboot_position=63
  73. tzsw_position=2111
  74. device=$1
  75. fi
  76.  
  77. #<BL1 fusing>
  78. echo "BL1 fusing"
  79. dd iflag=dsync oflag=dsync if=./bl1.bin of=$device seek=$signed_bl1_position
  80.  
  81. #<BL2 fusing>
  82. echo "BL2 fusing"
  83. dd iflag=dsync oflag=dsync if=./bl2.bin of=$device seek=$bl2_position
  84.  
  85. #<u-boot fusing>
  86. echo "u-boot fusing"
  87. dd iflag=dsync oflag=dsync if=./u-boot.bin of=$device seek=$uboot_position
  88.  
  89. #<TrustZone S/W fusing>
  90. echo "TrustZone S/W fusing"
  91. dd iflag=dsync oflag=dsync if=./tzsw.bin of=$device seek=$tzsw_position
  92.  
  93. ####################################
  94. #<Message Display>
  95. echo "U-boot image is fused successfully."
  96. [alarm@xu4 boot]$
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement