summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDongjin Kim <tobetter@gmail.com>2019-12-09 18:50:41 +0300
committerDongjin Kim <tobetter@gmail.com>2020-03-28 13:52:55 +0300
commit8c5681f3278858e505fd7308a9c577297930e24c (patch)
treed4585e102297378d4d99e0f861e053330bb66a6e
parent92b1d12825cb3d3de4ac1106befb3547e582019a (diff)
downloadu-boot-8c5681f3278858e505fd7308a9c577297930e24c.tar.xz
ODROID-XU4: fix to build only for ODROID
Change-Id: I652337824d250d0dd04a92ee0b1d22abdfad2d08 Signed-off-by: Dongjin Kim <tobetter@gmail.com>
-rw-r--r--Makefile4
-rw-r--r--board/hardkernel/odroid-xu3/Makefile22
-rw-r--r--board/hardkernel/odroid-xu3/bl1.bin.hardkernelbin0 -> 15616 bytes
-rw-r--r--board/hardkernel/odroid-xu3/bl2.bin.hardkernel.1mb_ubootbin0 -> 14592 bytes
-rw-r--r--board/hardkernel/odroid-xu3/sd_fusing.sh81
-rw-r--r--board/hardkernel/odroid-xu3/tzsw.bin.hardkernelbin0 -> 262144 bytes
6 files changed, 107 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 1766f5ab18..34b46955f5 100644
--- a/Makefile
+++ b/Makefile
@@ -2169,3 +2169,7 @@ FORCE:
# Declare the contents of the .PHONY variable as phony. We keep that
# information in a variable so we can use it in if_changed and friends.
.PHONY: $(PHONY)
+
+ifneq ($(CONFIG_TARGET_ODROID_XU3),)
+include board/hardkernel/odroid-xu3/Makefile
+endif
diff --git a/board/hardkernel/odroid-xu3/Makefile b/board/hardkernel/odroid-xu3/Makefile
new file mode 100644
index 0000000000..88d69351c2
--- /dev/null
+++ b/board/hardkernel/odroid-xu3/Makefile
@@ -0,0 +1,22 @@
+# SPDX-License-Identifier: GPL-2.0+
+#
+# Copyright (C) 2020 Dongjin Kim <tobetter@gmail.com>
+#
+
+files = bl1.bin.hardkernel \
+ bl2.bin.hardkernel.1mb_uboot \
+ tzsw.bin.hardkernel \
+ sd_fusing.sh
+
+targets = $(foreach blob, $(files), $(srctree)/sd_fuse/$(blob))
+
+$(targets):
+ $(Q)cp board/hardkernel/odroid-xu3/$(shell basename $@) \
+ $(shell dirname $@)
+prepare:
+ $(Q)mkdir -p $(srctree)/sd_fuse
+
+$(srctree)/sd_fuse/u-boot.bin: u-boot.bin
+ $(Q)cp u-boot.bin $(srctree)/sd_fuse
+
+all: $(srctree)/sd_fuse/u-boot.bin $(targets)
diff --git a/board/hardkernel/odroid-xu3/bl1.bin.hardkernel b/board/hardkernel/odroid-xu3/bl1.bin.hardkernel
new file mode 100644
index 0000000000..a0b62caabc
--- /dev/null
+++ b/board/hardkernel/odroid-xu3/bl1.bin.hardkernel
Binary files differ
diff --git a/board/hardkernel/odroid-xu3/bl2.bin.hardkernel.1mb_uboot b/board/hardkernel/odroid-xu3/bl2.bin.hardkernel.1mb_uboot
new file mode 100644
index 0000000000..6d3658770e
--- /dev/null
+++ b/board/hardkernel/odroid-xu3/bl2.bin.hardkernel.1mb_uboot
Binary files differ
diff --git a/board/hardkernel/odroid-xu3/sd_fusing.sh b/board/hardkernel/odroid-xu3/sd_fusing.sh
new file mode 100644
index 0000000000..5a163fa611
--- /dev/null
+++ b/board/hardkernel/odroid-xu3/sd_fusing.sh
@@ -0,0 +1,81 @@
+#
+# 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=2110
+ device=$1boot0
+else
+ signed_bl1_position=1
+ bl2_position=31
+ uboot_position=63
+ tzsw_position=2111
+ device=$1
+fi
+
+# 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"
+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.1mb_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
+
+####################################
+#<Message Display>
+echo "U-boot image is fused successfully."
+echo "Eject $1 and insert it again."
diff --git a/board/hardkernel/odroid-xu3/tzsw.bin.hardkernel b/board/hardkernel/odroid-xu3/tzsw.bin.hardkernel
new file mode 100644
index 0000000000..23ecc6efc7
--- /dev/null
+++ b/board/hardkernel/odroid-xu3/tzsw.bin.hardkernel
Binary files differ