summaryrefslogtreecommitdiffstats
path: root/bsp/meta-freescale/recipes-security/optee-imx/optee-os
diff options
context:
space:
mode:
Diffstat (limited to 'bsp/meta-freescale/recipes-security/optee-imx/optee-os')
-rw-r--r--bsp/meta-freescale/recipes-security/optee-imx/optee-os/0001-optee-os-fix-gcc10-compilation-issue-and-missing-cc-.patch158
-rw-r--r--bsp/meta-freescale/recipes-security/optee-imx/optee-os/0001-scripts-update-scripts-to-use-python3.patch427
2 files changed, 585 insertions, 0 deletions
diff --git a/bsp/meta-freescale/recipes-security/optee-imx/optee-os/0001-optee-os-fix-gcc10-compilation-issue-and-missing-cc-.patch b/bsp/meta-freescale/recipes-security/optee-imx/optee-os/0001-optee-os-fix-gcc10-compilation-issue-and-missing-cc-.patch
new file mode 100644
index 00000000..509c7fb6
--- /dev/null
+++ b/bsp/meta-freescale/recipes-security/optee-imx/optee-os/0001-optee-os-fix-gcc10-compilation-issue-and-missing-cc-.patch
@@ -0,0 +1,158 @@
+From 027a3b9a33fbb23e1d1d7ed6411d4d112d2a55a1 Mon Sep 17 00:00:00 2001
+From: Andrey Zhizhikin <andrey.z@gmail.com>
+Date: Sat, 30 May 2020 22:00:59 +0000
+Subject: [PATCH] optee-os: fix gcc10 compilation issue and missing cc-options
+
+Backport PR 3891 from upstream to imx fork, which addressed compilation
+failure when GCC10 is used.
+
+Additional changes ported fixed cc-options macro, which allows to query
+compiler used if the desired option exists before it could be set. This
+solves also the build issues when GCC9 is used to build this component.
+
+Upstream-Status: Backport [https://github.com/OP-TEE/optee_os/pull/3891]
+
+Signed-off-by: Andrey Zhizhikin <andrey.z@gmail.com>
+---
+ core/arch/arm/arm.mk | 21 ++++++++++++++++-----
+ core/core.mk | 5 +----
+ mk/cc-option.mk | 9 +++++++++
+ mk/gcc.mk | 2 +-
+ ta/mk/ta_dev_kit.mk | 3 +++
+ ta/ta.mk | 1 +
+ 6 files changed, 31 insertions(+), 10 deletions(-)
+ create mode 100644 mk/cc-option.mk
+
+diff --git a/core/arch/arm/arm.mk b/core/arch/arm/arm.mk
+index aa101be8..4123d85d 100644
+--- a/core/arch/arm/arm.mk
++++ b/core/arch/arm/arm.mk
+@@ -1,3 +1,16 @@
++# Setup compiler for the core module
++ifeq ($(CFG_ARM64_core),y)
++arch-bits-core := 64
++else
++arch-bits-core := 32
++endif
++CROSS_COMPILE_core := $(CROSS_COMPILE$(arch-bits-core))
++COMPILER_core := $(COMPILER)
++include mk/$(COMPILER_core).mk
++
++# Defines the cc-option macro using the compiler set for the core module
++include mk/cc-option.mk
++
+ CFG_LTC_OPTEE_THREAD ?= y
+ # Size of emulated TrustZone protected SRAM, 448 kB.
+ # Only applicable when paging is enabled.
+@@ -88,7 +101,7 @@ arm32-platform-aflags-no-hard-float ?=
+
+ arm64-platform-cflags-no-hard-float ?= -mgeneral-regs-only
+ arm64-platform-cflags-hard-float ?=
+-arm64-platform-cflags-generic ?= -mstrict-align
++arm64-platform-cflags-generic := -mstrict-align $(call cc-option,-mno-outline-atomics,)
+
+ ifeq ($(DEBUG),1)
+ # For backwards compatibility
+@@ -117,14 +130,12 @@ core-platform-aflags += $(platform-aflags-generic)
+ core-platform-aflags += $(platform-aflags-debug-info)
+
+ ifeq ($(CFG_ARM64_core),y)
+-arch-bits-core := 64
+ core-platform-cppflags += $(arm64-platform-cppflags)
+ core-platform-cflags += $(arm64-platform-cflags)
+ core-platform-cflags += $(arm64-platform-cflags-generic)
+ core-platform-cflags += $(arm64-platform-cflags-no-hard-float)
+ core-platform-aflags += $(arm64-platform-aflags)
+ else
+-arch-bits-core := 32
+ core-platform-cppflags += $(arm32-platform-cppflags)
+ core-platform-cflags += $(arm32-platform-cflags)
+ core-platform-cflags += $(arm32-platform-cflags-no-hard-float)
+@@ -196,5 +207,5 @@ ta-mk-file-export-add-ta_arm64 += CROSS_COMPILE64 ?= $$(CROSS_COMPILE)_nl_
+ ta-mk-file-export-add-ta_arm64 += CROSS_COMPILE_ta_arm64 ?= $$(CROSS_COMPILE64)_nl_
+ endif
+
+-# Set cross compiler prefix for each submodule
+-$(foreach sm, core $(ta-targets), $(eval CROSS_COMPILE_$(sm) ?= $(CROSS_COMPILE$(arch-bits-$(sm)))))
++# Set cross compiler prefix for each TA target
++$(foreach sm, $(ta-targets), $(eval CROSS_COMPILE_$(sm) ?= $(CROSS_COMPILE$(arch-bits-$(sm)))))
+diff --git a/core/core.mk b/core/core.mk
+index c05815f3..68f45552 100644
+--- a/core/core.mk
++++ b/core/core.mk
+@@ -8,6 +8,7 @@ arch-dir := core/arch/$(ARCH)
+ platform-dir := $(arch-dir)/plat-$(PLATFORM)
+ include $(platform-dir)/conf.mk
+ include mk/config.mk
++# $(ARCH).mk also sets the compiler for the core module
+ include core/arch/$(ARCH)/$(ARCH).mk
+
+ PLATFORM_$(PLATFORM) := y
+@@ -16,10 +17,6 @@ PLATFORM_FLAVOR_$(PLATFORM_FLAVOR) := y
+ $(call cfg-depends-all,CFG_PAGED_USER_TA,CFG_WITH_PAGER CFG_WITH_USER_TA)
+ include core/crypto.mk
+
+-# Setup compiler for this sub module
+-COMPILER_$(sm) ?= $(COMPILER)
+-include mk/$(COMPILER_$(sm)).mk
+-
+ cppflags$(sm) += -D__KERNEL__
+
+ cppflags$(sm) += -Icore/include
+diff --git a/mk/cc-option.mk b/mk/cc-option.mk
+new file mode 100644
+index 00000000..4699fbcc
+--- /dev/null
++++ b/mk/cc-option.mk
+@@ -0,0 +1,9 @@
++_cc-option-supported = $(if $(shell $(CC$(sm)) $(1) -c -x c /dev/null -o /dev/null 2>/dev/null >/dev/null || echo "Not supported"),,1)
++_cc-opt-cached-var-name = $(subst =,~,$(strip cached-cc-option-$(1)-$(subst $(empty) $(empty),,$(CC$(sm)))))
++define _cc-option
++$(eval _var_name := $(call _cc-opt-cached-var-name,$(1)))
++$(eval $(_var_name) := $(if $(filter $(origin $(_var_name)),undefined),$(call _cc-option-supported,$(1)),$($(_var_name))))
++$(if $($(_var_name)),$(1),$(2))
++endef
++cc-option = $(strip $(call _cc-option,$(1),$(2)))
++
+diff --git a/mk/gcc.mk b/mk/gcc.mk
+index 1f2c5990..c53a23b1 100644
+--- a/mk/gcc.mk
++++ b/mk/gcc.mk
+@@ -12,7 +12,7 @@ nostdinc$(sm) := -nostdinc -isystem $(shell $(CC$(sm)) \
+ -print-file-name=include 2> /dev/null)
+
+ # Get location of libgcc from gcc
+-libgcc$(sm) := $(shell $(CC$(sm)) $(CFLAGS$(arch-bits-$(sm))) $(comp-cflags$(sm)) \
++libgcc$(sm) := $(shell $(CC$(sm)) $(CFLAGS$(arch-bits-$(sm))) \
+ -print-libgcc-file-name 2> /dev/null)
+
+ # Define these to something to discover accidental use
+diff --git a/ta/mk/ta_dev_kit.mk b/ta/mk/ta_dev_kit.mk
+index fa0bddfe..ae70ef87 100644
+--- a/ta/mk/ta_dev_kit.mk
++++ b/ta/mk/ta_dev_kit.mk
+@@ -78,6 +78,9 @@ clean:
+ @$(cmd-echo-silent) ' CLEAN $(O)'
+ ${q}if [ -d "$(O)" ]; then $(RMDIR) $(O); fi
+
++include $(ta-dev-kit-dir$(sm))/mk/$(COMPILER_$(sm)).mk
++include $(ta-dev-kit-dir$(sm))/mk/cc-option.mk
++
+ subdirs = .
+ include $(ta-dev-kit-dir)/mk/subdir.mk
+
+diff --git a/ta/ta.mk b/ta/ta.mk
+index 32353de3..9c64319d 100644
+--- a/ta/ta.mk
++++ b/ta/ta.mk
+@@ -98,6 +98,7 @@ $(foreach f, $(libfiles), \
+
+ # Copy .mk files
+ ta-mkfiles = mk/compile.mk mk/subdir.mk mk/gcc.mk mk/cleandirs.mk \
++ mk/cc-option.mk \
+ ta/arch/$(ARCH)/link.mk ta/arch/$(ARCH)/link_shlib.mk \
+ ta/mk/ta_dev_kit.mk
+
+--
+2.17.1
+
diff --git a/bsp/meta-freescale/recipes-security/optee-imx/optee-os/0001-scripts-update-scripts-to-use-python3.patch b/bsp/meta-freescale/recipes-security/optee-imx/optee-os/0001-scripts-update-scripts-to-use-python3.patch
new file mode 100644
index 00000000..9621cf6c
--- /dev/null
+++ b/bsp/meta-freescale/recipes-security/optee-imx/optee-os/0001-scripts-update-scripts-to-use-python3.patch
@@ -0,0 +1,427 @@
+From 0d4941123b5a88351f5954f6de00892f85ed5abc Mon Sep 17 00:00:00 2001
+From: Andrey Zhizhikin <andrey.zhizhikin@leica-geosystems.com>
+Date: Mon, 20 Jan 2020 22:32:13 +0000
+Subject: [PATCH] scripts: update scripts to use python3
+
+Python2 is deprecated effective Jan. 2020, and is not available in
+several distributions.
+
+Update scripts here to re-target then onto python version 3.
+
+Upstream-Status: Pending
+
+Signed-off-by: Andrey Zhizhikin <andrey.zhizhikin@leica-geosystems.com>
+---
+ scripts/gen_hashed_bin.py | 282 ++++++++++++++++++++------------------
+ scripts/gen_ld_sects.py | 8 +-
+ scripts/pem_to_pub_c.py | 2 +-
+ scripts/sign.py | 2 +-
+ scripts/symbolize.py | 2 +-
+ scripts/ta_bin_to_c.py | 2 +-
+ scripts/tee_bin_parser.py | 2 +-
+ 7 files changed, 157 insertions(+), 143 deletions(-)
+
+diff --git a/scripts/gen_hashed_bin.py b/scripts/gen_hashed_bin.py
+index 32350a47..a76a62cc 100755
+--- a/scripts/gen_hashed_bin.py
++++ b/scripts/gen_hashed_bin.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ # SPDX-License-Identifier: BSD-2-Clause
+ #
+ # Copyright (c) 2014-2017, Linaro Limited
+@@ -14,163 +14,177 @@ import hashlib
+ arch_id = {'arm32': 0, 'arm64': 1}
+ image_id = {'pager': 0, 'paged': 1}
+
++
+ def write_header_v1(outf, init_size, args, paged_size):
+- magic = 0x4554504f # 'OPTE'
+- version = 1;
+- outf.write(struct.pack('<IBBHIIIII', \
+- magic, version, arch_id[args.arch], args.flags, init_size, \
+- args.init_load_addr_hi, args.init_load_addr_lo, \
+- args.init_mem_usage, paged_size))
++ magic = 0x4554504f # 'OPTE'
++ version = 1
++ outf.write(struct.pack('<IBBHIIIII',
++ magic,
++ version,
++ arch_id[args.arch],
++ args.flags,
++ init_size,
++ args.init_load_addr_hi,
++ args.init_load_addr_lo,
++ args.init_mem_usage,
++ paged_size))
++
+
+ def write_header_v2(outf, init_size, args, paged_size):
+- magic = 0x4554504f # 'OPTE'
+- version = 2
+- nb_images = 1 if paged_size == 0 else 2
+- outf.write(struct.pack('<IBBHI', \
+- magic, version, arch_id[args.arch], args.flags, nb_images))
+- outf.write(struct.pack('<IIII', \
+- args.init_load_addr_hi, args.init_load_addr_lo, \
+- image_id['pager'], init_size))
+- if nb_images == 2:
+- outf.write(struct.pack('<IIII', \
+- 0xffffffff, 0xffffffff, image_id['paged'], paged_size))
++ magic = 0x4554504f # 'OPTE'
++ version = 2
++ nb_images = 1 if paged_size == 0 else 2
++ outf.write(struct.pack('<IBBHI', magic, version,
++ arch_id[args.arch], args.flags, nb_images))
++ outf.write(struct.pack('<IIII',
++ args.init_load_addr_hi, args.init_load_addr_lo,
++ image_id['pager'], init_size))
++ if nb_images == 2:
++ outf.write(
++ struct.pack(
++ '<IIII',
++ 0xffffffff,
++ 0xffffffff,
++ image_id['paged'],
++ paged_size))
++
+
+ def append_to(outf, start_offs, in_fname, max_bytes=0xffffffff):
+- #print "Appending %s@0x%x 0x%x bytes at position 0x%x" % \
+- #( in_fname, start_offs, max_bytes, int(outf.tell()) )
+- inf = open(in_fname, 'rb');
+- inf.seek(start_offs)
+- while True :
+- nbytes = min(16 * 1024, max_bytes)
+- if nbytes == 0 :
+- break
+- #print "Reading %s %d bytes" % (in_fname, nbytes)
+- buf = inf.read(nbytes)
+- if not buf :
+- break
+- outf.write(buf)
+- max_bytes -= len(buf)
+- inf.close()
++ inf = open(in_fname, 'rb')
++ inf.seek(start_offs)
++ while True:
++ nbytes = min(16 * 1024, max_bytes)
++ if nbytes == 0:
++ break
++ buf = inf.read(nbytes)
++ if not buf:
++ break
++ outf.write(buf)
++ max_bytes -= len(buf)
++ inf.close()
++
+
+ def append_hashes(outf, in_fname):
+- page_size = 4 * 1024
+-
+- inf = open(in_fname, 'r')
+- while True :
+- page = inf.read(page_size)
+- if len(page) == page_size :
+- #print "Writing hash at position 0x%x" % \
+- #int(outf.tell())
+- outf.write(hashlib.sha256(page).digest())
+- elif len(page) == 0 :
+- break
+- else :
+- print("Error: short read, got " + repr(len(page)))
+- sys.exit(1)
+-
+- inf.close()
++ page_size = 4 * 1024
++
++ inf = open(in_fname, 'rb')
++ while True:
++ page = inf.read(page_size)
++ if len(page) == page_size:
++ outf.write(hashlib.sha256(page).digest())
++ elif len(page) == 0:
++ break
++ else:
++ print("Error: short read, got {}".format(len(page)))
++ sys.exit(1)
++
++ inf.close()
++
+
+ def int_parse(str):
+- return int(str, 0)
++ return int(str, 0)
++
+
+ def get_args():
+- parser = argparse.ArgumentParser()
+- parser.add_argument('--arch', required=True, \
+- choices=arch_id.keys(), \
+- help='Architecture')
++ parser = argparse.ArgumentParser()
++ parser.add_argument('--arch', required=True,
++ choices=list(arch_id.keys()),
++ help='Architecture')
+
+- parser.add_argument('--flags', \
+- type=int, default=0, \
+- help='Flags, currently none defined')
++ parser.add_argument('--flags',
++ type=int, default=0,
++ help='Flags, currently none defined')
+
+- parser.add_argument('--init_size', \
+- required=True, type=int_parse, \
+- help='Size of initialization part of binary')
++ parser.add_argument('--init_size',
++ required=True, type=int_parse,
++ help='Size of initialization part of binary')
+
+- parser.add_argument('--init_load_addr_hi', \
+- type=int_parse, default=0, \
+- help='Upper 32 bits of load address of binary')
++ parser.add_argument('--init_load_addr_hi',
++ type=int_parse, default=0,
++ help='Upper 32 bits of load address of binary')
+
+- parser.add_argument('--init_load_addr_lo', \
+- required=True, type=int_parse, \
+- help='Lower 32 bits of load address of binary')
++ parser.add_argument('--init_load_addr_lo',
++ required=True, type=int_parse,
++ help='Lower 32 bits of load address of binary')
+
+- parser.add_argument('--init_mem_usage', \
+- required=True, type=int_parse, \
+- help='Total amount of used memory when initializing');
++ parser.add_argument('--init_mem_usage',
++ required=True, type=int_parse,
++ help='Total amount of used memory when initializing')
+
+- parser.add_argument('--tee_pager_bin', \
+- required=True, \
+- help='The input tee_pager.bin')
++ parser.add_argument('--tee_pager_bin',
++ required=True,
++ help='The input tee_pager.bin')
+
+- parser.add_argument('--tee_pageable_bin', \
+- required=True, \
+- help='The input tee_pageable.bin')
++ parser.add_argument('--tee_pageable_bin',
++ required=True,
++ help='The input tee_pageable.bin')
+
+- parser.add_argument('--out', \
+- required=False, type=argparse.FileType('wb'), \
+- help='The output tee.bin')
++ parser.add_argument('--out',
++ required=False, type=argparse.FileType('wb'),
++ help='The output tee.bin')
+
+- parser.add_argument('--out_header_v2', \
+- required=False, type=argparse.FileType('wb'), \
+- help='The output tee_header_v2.bin')
++ parser.add_argument('--out_header_v2',
++ required=False, type=argparse.FileType('wb'),
++ help='The output tee_header_v2.bin')
+
+- parser.add_argument('--out_pager_v2', \
+- required=False, type=argparse.FileType('wb'), \
+- help='The output tee_pager_v2.bin')
++ parser.add_argument('--out_pager_v2',
++ required=False, type=argparse.FileType('wb'),
++ help='The output tee_pager_v2.bin')
+
+- parser.add_argument('--out_pageable_v2', \
+- required=False, type=argparse.FileType('wb'), \
+- help='The output tee_pageable_v2.bin')
++ parser.add_argument('--out_pageable_v2',
++ required=False, type=argparse.FileType('wb'),
++ help='The output tee_pageable_v2.bin')
++
++ return parser.parse_args()
+
+- return parser.parse_args();
+
+ def main():
+- args = get_args()
+- init_bin_size = args.init_size
+- tee_pager_fname = args.tee_pager_bin
+- tee_pageable_fname = args.tee_pageable_bin
+- pager_input_size = os.path.getsize(tee_pager_fname);
+- paged_input_size = os.path.getsize(tee_pageable_fname);
+- hash_size = paged_input_size / (4 * 1024) * \
+- hashlib.sha256().digest_size
+-
+- if paged_input_size % (4 * 1024) != 0:
+- print("Error: pageable size not a multiple of 4K:" + \
+- repr(paged_input_size))
+- sys.exit(1)
+-
+- init_size = pager_input_size + \
+- min(init_bin_size, paged_input_size) + \
+- hash_size
+- paged_size = paged_input_size - \
+- min(init_bin_size, paged_input_size)
+-
+- if args.out is not None:
+- outf = args.out
+- write_header_v1(outf, init_size, args, paged_size)
+- append_to(outf, 0, tee_pager_fname)
+- append_to(outf, 0, tee_pageable_fname, init_bin_size)
+- append_hashes(outf, tee_pageable_fname)
+- append_to(outf, init_bin_size, tee_pageable_fname)
+- outf.close()
+-
+- if args.out_header_v2 is not None:
+- outf = args.out_header_v2
+- write_header_v2(outf, init_size, args, paged_size)
+- outf.close()
+-
+- if args.out_pager_v2 is not None:
+- outf = args.out_pager_v2
+- append_to(outf, 0, tee_pager_fname)
+- append_to(outf, 0, tee_pageable_fname, init_bin_size)
+- append_hashes(outf, tee_pageable_fname)
+- outf.close()
+-
+- if args.out_pageable_v2 is not None:
+- outf = args.out_pageable_v2
+- append_to(outf, init_bin_size, tee_pageable_fname)
+- outf.close()
++ args = get_args()
++ init_bin_size = args.init_size
++ tee_pager_fname = args.tee_pager_bin
++ tee_pageable_fname = args.tee_pageable_bin
++ pager_input_size = os.path.getsize(tee_pager_fname)
++ paged_input_size = os.path.getsize(tee_pageable_fname)
++ hash_size = paged_input_size // (4 * 1024) * \
++ hashlib.sha256().digest_size
++
++ if paged_input_size % (4 * 1024) != 0:
++ print("Error: pageable size not a multiple of 4K: {}".format(
++ paged_input_size))
++ sys.exit(1)
++
++ init_size = pager_input_size + \
++ min(init_bin_size, paged_input_size) + \
++ hash_size
++ paged_size = paged_input_size - \
++ min(init_bin_size, paged_input_size)
++
++ if args.out is not None:
++ outf = args.out
++ write_header_v1(outf, init_size, args, paged_size)
++ append_to(outf, 0, tee_pager_fname)
++ append_to(outf, 0, tee_pageable_fname, init_bin_size)
++ append_hashes(outf, tee_pageable_fname)
++ append_to(outf, init_bin_size, tee_pageable_fname)
++ outf.close()
++
++ if args.out_header_v2 is not None:
++ outf = args.out_header_v2
++ write_header_v2(outf, init_size, args, paged_size)
++ outf.close()
++
++ if args.out_pager_v2 is not None:
++ outf = args.out_pager_v2
++ append_to(outf, 0, tee_pager_fname)
++ append_to(outf, 0, tee_pageable_fname, init_bin_size)
++ append_hashes(outf, tee_pageable_fname)
++ outf.close()
++
++ if args.out_pageable_v2 is not None:
++ outf = args.out_pageable_v2
++ append_to(outf, init_bin_size, tee_pageable_fname)
++ outf.close()
++
+
+ if __name__ == "__main__":
+- main()
++ main()
+diff --git a/scripts/gen_ld_sects.py b/scripts/gen_ld_sects.py
+index c5dc3a7b..2bdbb192 100755
+--- a/scripts/gen_ld_sects.py
++++ b/scripts/gen_ld_sects.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ # SPDX-License-Identifier: BSD-2-Clause
+ #
+ # Copyright (c) 2017, Linaro Limited
+@@ -8,8 +8,8 @@ import sys
+ import re
+
+ def usage():
+- print "Usage: {0} <section reg exp match> [<skip section>...]".format( \
+- sys.argv[0])
++ print("Usage: {0} <section reg exp match> [<skip section>...]".format( \
++ sys.argv[0]))
+ sys.exit (1)
+
+ def main():
+@@ -55,7 +55,7 @@ def main():
+ if sect_name in skip_sections :
+ continue
+
+- print '\t*({0})'.format(sect_name)
++ print ('\t*({0})'.format(sect_name))
+
+ if __name__ == "__main__":
+ main()
+diff --git a/scripts/pem_to_pub_c.py b/scripts/pem_to_pub_c.py
+index 6b8fa365..0b03d62e 100755
+--- a/scripts/pem_to_pub_c.py
++++ b/scripts/pem_to_pub_c.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ # SPDX-License-Identifier: BSD-2-Clause
+ #
+ # Copyright (c) 2015, Linaro Limited
+diff --git a/scripts/sign.py b/scripts/sign.py
+index ad47479b..348b40a2 100755
+--- a/scripts/sign.py
++++ b/scripts/sign.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ #
+ # Copyright (c) 2015, 2017, Linaro Limited
+ #
+diff --git a/scripts/symbolize.py b/scripts/symbolize.py
+index 1eecf758..0e9bd3ed 100755
+--- a/scripts/symbolize.py
++++ b/scripts/symbolize.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ # SPDX-License-Identifier: BSD-2-Clause
+ #
+ # Copyright (c) 2017, Linaro Limited
+diff --git a/scripts/ta_bin_to_c.py b/scripts/ta_bin_to_c.py
+index cabddbbd..f325fda0 100755
+--- a/scripts/ta_bin_to_c.py
++++ b/scripts/ta_bin_to_c.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ # SPDX-License-Identifier: BSD-2-Clause
+ #
+ # Copyright (c) 2017, Linaro Limited
+diff --git a/scripts/tee_bin_parser.py b/scripts/tee_bin_parser.py
+index 5f7dd3f0..07da5791 100755
+--- a/scripts/tee_bin_parser.py
++++ b/scripts/tee_bin_parser.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ # SPDX-License-Identifier: BSD-2-Clause
+ #
+ # Copyright (c) 2016, Linaro Limited
+--
+2.17.1
+