aboutsummaryrefslogtreecommitdiffstats
path: root/platforms/xu4/sd_fuse
diff options
context:
space:
mode:
authorDaniel Tartavel <contact@librepc.com>2019-09-29 06:50:44 +0200
committerDaniel Tartavel <contact@librepc.com>2019-09-29 06:50:44 +0200
commit2a82e889e8fc50d72be705ded4a50292c02b38b0 (patch)
treee6cd9365a439db56f8f69fc107243185be48a49d /platforms/xu4/sd_fuse
parent22115e7251b4526913948ab0b8780c8419cb6682 (diff)
downloadmageia4arm-2a82e889e8fc50d72be705ded4a50292c02b38b0.tar
mageia4arm-2a82e889e8fc50d72be705ded4a50292c02b38b0.tar.gz
mageia4arm-2a82e889e8fc50d72be705ded4a50292c02b38b0.tar.bz2
mageia4arm-2a82e889e8fc50d72be705ded4a50292c02b38b0.tar.xz
mageia4arm-2a82e889e8fc50d72be705ded4a50292c02b38b0.zip
added platform dir
Diffstat (limited to 'platforms/xu4/sd_fuse')
-rw-r--r--platforms/xu4/sd_fuse/bl1.bin.hardkernelbin0 -> 15616 bytes
-rwxr-xr-xplatforms/xu4/sd_fuse/bl2.bin.hardkernel.720k_ubootbin0 -> 14592 bytes
-rwxr-xr-xplatforms/xu4/sd_fuse/sd_fusing.sh91
-rw-r--r--platforms/xu4/sd_fuse/tzsw.bin.hardkernelbin0 -> 262144 bytes
-rwxr-xr-xplatforms/xu4/sd_fuse/u-boot.bin.hardkernelbin0 -> 620062 bytes
5 files changed, 91 insertions, 0 deletions
diff --git a/platforms/xu4/sd_fuse/bl1.bin.hardkernel b/platforms/xu4/sd_fuse/bl1.bin.hardkernel
new file mode 100644
index 0000000..a0b62ca
--- /dev/null
+++ b/platforms/xu4/sd_fuse/bl1.bin.hardkernel
Binary files differ
diff --git a/platforms/xu4/sd_fuse/bl2.bin.hardkernel.720k_uboot b/platforms/xu4/sd_fuse/bl2.bin.hardkernel.720k_uboot
new file mode 100755
index 0000000..50ba4bc
--- /dev/null
+++ b/platforms/xu4/sd_fuse/bl2.bin.hardkernel.720k_uboot
Binary files differ
diff --git a/platforms/xu4/sd_fuse/sd_fusing.sh b/platforms/xu4/sd_fuse/sd_fusing.sh
new file mode 100755
index 0000000..71c2e03
--- /dev/null
+++ b/platforms/xu4/sd_fuse/sd_fusing.sh
@@ -0,0 +1,91 @@
+#
+# Copyright (C) 2011 Samsung Electronics Co., Ltd.
+# http://www.samsung.com/
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+####################################
+set -x
+
+if [ -z $1 ]
+then
+ echo "usage: ./sd_fusing.sh <SD Reader's device file>"
+ exit 0
+fi
+
+if [ -b $1 ]
+then
+ echo "$1 reader is identified."
+else
+ echo "$1 is NOT identified."
+ exit 0
+fi
+
+if [ -d /sys/block/${1##*/}boot0 ]; then
+ echo "$1 is an eMMC card, disabling ${1##*/}boot0 ro"
+ if ! echo -n 0 | sudo tee /sys/block/${1##*/}boot0/force_ro; then
+ echo "Enabling r/w for $1boot0 failed"
+ exit 1
+ fi
+ emmc=1
+fi
+
+####################################
+# fusing images
+
+if [ -n "$emmc" ]; then
+ signed_bl1_position=0
+ bl2_position=30
+ uboot_position=62
+ tzsw_position=1502
+ device=$1boot0
+else
+ signed_bl1_position=1
+ bl2_position=31
+ uboot_position=63
+ tzsw_position=1503
+ device=$1
+fi
+
+env_position=2015
+
+# Get the U-Boot blob
+if [ -f ./u-boot-dtb.bin ]; then
+ uboot="./u-boot-dtb.bin"
+elif [ -f ./u-boot.bin ]; then
+ uboot="./u-boot.bin"
+elif [ -f ../u-boot-dtb.bin ]; then
+ uboot="../u-boot-dtb.bin"
+elif [ -f ./u-boot.bin.hardkernel ]; then
+ uboot="./u-boot.bin.hardkernel"
+else
+ echo "U-Boot blob not found."
+ exit
+fi
+
+#<BL1 fusing>
+echo "BL1 fusing"
+sudo dd iflag=dsync oflag=dsync if=./bl1.bin.hardkernel of=$device seek=$signed_bl1_position
+
+#<BL2 fusing>
+echo "BL2 fusing"
+sudo dd iflag=dsync oflag=dsync if=./bl2.bin.hardkernel.720k_uboot of=$device seek=$bl2_position
+
+#<u-boot fusing>
+echo "u-boot fusing"
+sudo dd iflag=dsync oflag=dsync if=$uboot of=$device seek=$uboot_position
+
+#<TrustZone S/W fusing>
+echo "TrustZone S/W fusing"
+sudo dd iflag=dsync oflag=dsync if=./tzsw.bin.hardkernel of=$device seek=$tzsw_position
+
+#<u-boot env erase>
+echo "u-boot env erase..."
+sudo dd iflag=dsync oflag=dsync if=/dev/zero of=$device seek=$env_position bs=512 count=32
+
+####################################
+#<Message Display>
+echo "U-boot image is fused successfully."
+echo "Eject $1 and insert it again."
diff --git a/platforms/xu4/sd_fuse/tzsw.bin.hardkernel b/platforms/xu4/sd_fuse/tzsw.bin.hardkernel
new file mode 100644
index 0000000..23ecc6e
--- /dev/null
+++ b/platforms/xu4/sd_fuse/tzsw.bin.hardkernel
Binary files differ
diff --git a/platforms/xu4/sd_fuse/u-boot.bin.hardkernel b/platforms/xu4/sd_fuse/u-boot.bin.hardkernel
new file mode 100755
index 0000000..a41fd73
--- /dev/null
+++ b/platforms/xu4/sd_fuse/u-boot.bin.hardkernel
Binary files differ