Remove uefi related artifacts am: da0c896d94 am: c36fe9a8a0 am: 6bb6a628ee am: 7378e1a083 am: 78081653c3

Original change: https://android-review.googlesource.com/c/device/linaro/hikey/+/1371596

Change-Id: I6ed933ff34fddbac5607aba936245119ef35b5cc
diff --git a/bootloader/Makefile b/bootloader/Makefile
deleted file mode 100644
index a209e35..0000000
--- a/bootloader/Makefile
+++ /dev/null
@@ -1,39 +0,0 @@
-AARCH64_TOOLCHAIN=GCC49
-EDK2_DIR=$(ANDROID_BUILD_TOP)/device/linaro/bootloader/edk2
-UEFI_TOOLS_DIR=$(ANDROID_BUILD_TOP)/device/linaro/hikey/uefi-tools
-ATF_DIR=$(ANDROID_BUILD_TOP)/device/linaro/bootloader/arm-trusted-firmware
-PRODUCT_OUT?=out/target/product/hikey
-DIST_DIR?=$(ANDROID_BUILD_TOP)/out/dist
-
-ifdef DEBUG
-	TARGET = DEBUG
-else
-	TARGET = RELEASE
-endif
-
-all: $(DIST_DIR)/fip.bin $(DIST_DIR)/l-loader.bin
-
-$(DIST_DIR)/fip.bin:
-	cd $(EDK2_DIR) && \
-	rm -rf Conf/tools_def.txt Conf/BuildEnv.sh  Conf/build_rule.txt Conf/target.txt  Conf/tools_def.txt && \
-	export CROSS_COMPILE_32=arm-linux-androideabi- && \
-	export CROSS_COMPILE_64=aarch64-linux-android- && \
-	rm -rf OpenPlatformPkg && \
-	ln -sf  $(EDK2_DIR)/../OpenPlatformPkg OpenPlatformPkg && \
-	rm -rf $(EDK2_DIR)/Build/  && \
-	mkdir -p $(EDK2_DIR)/Build/ && \
-	mkdir -p $(DIST_DIR) && \
-	mkdir -p $(ANDROID_BUILD_TOP)/$(PRODUCT_OUT)/obj/uefi && \
-	ln -sf $(ANDROID_BUILD_TOP)/$(PRODUCT_OUT)/obj/uefi $(EDK2_DIR)/Build/HiKey && \
-	$(UEFI_TOOLS_DIR)/uefi-build.sh -b $(TARGET) -D EDK2_OUT_DIR=$(ANDROID_BUILD_TOP)/$(PRODUCT_OUT)/obj/uefi -a $(ATF_DIR) hikey && \
-	cp $(EDK2_DIR)/Build/HiKey/$(TARGET)_GCC49/FV/fip.bin $(DIST_DIR)/
-
-$(DIST_DIR)/l-loader.bin: $(DIST_DIR)/fip.bin
-	cd $(ANDROID_BUILD_TOP)/device/linaro/hikey/l-loader && \
-	ln -sf $(EDK2_DIR)/Build/HiKey/$(TARGET)_GCC49/FV//bl1.bin && \
-	make CROSS_COMPILE=arm-linux-androideabi- hikey && \
-	mv l-loader.bin $(DIST_DIR)/
-
-clean:
-	rm -rf $(DIST_DIR)/fip.bin $(DIST_DIR)/l-loader.bin $(ANDROID_BUILD_TOP)/$(PRODUCT_OUT)/obj/uefi $(EDK2_DIR)/Build/HiKey
-	cd $(EDK2_DIR)/BaseTools && make clean
diff --git a/bootloader/README.md b/bootloader/README.md
deleted file mode 100644
index 1271cfd..0000000
--- a/bootloader/README.md
+++ /dev/null
@@ -1,10 +0,0 @@
-Bootloader is build with ArmTF and UEFI from sources located at:
-  device/linaro/bootloader
-To build fip.bin and l-loader.bin do:
-  $ cd device/linaro/hikey/bootloader
-  $ make
-Results will be in out/dist
-
-We can also generate ptable (needs root privilege) with below commands:
-  $ cd device/linaro/hikey/l-loader/
-  $ make ptable.img
diff --git a/installer/hikey/README b/installer/hikey/README
deleted file mode 100644
index b58cd96..0000000
--- a/installer/hikey/README
+++ /dev/null
@@ -1,38 +0,0 @@
-These instruction should help you in flashing the bootloader
-and AOSP images built from sources.
-Detailed instructions on how to setup the Board can be found
-here:
-https://github.com/96boards/documentation/wiki/HiKeyGettingStarted
-
-For flashing the bootloader, the top two links should be installed
-(closed) and the 3rd link should be removed (open):
-
----------------------------------------------------------
-|	Name 		|	Link 	|	State 	|
-| Auto Power up 	|     Link 1-2 	|      closed 	|
-| Boot Select 		|     Link 3-4 	|      closed 	|
-| GPIO3-1      		|     Link 5-6 	| 	open 	|
----------------------------------------------------------
-
-Link 1-2 causes HiKey to auto-power up when power is installed. Link
-3-4 causes the HiKey SoC internal ROM to start up in at a special
-"install bootloader" mode which will install a supplied bootloader
-from the microUSB OTG port into RAM, and will present itself to a
-connected PC as a ttyUSB device.
-
-Note: The HiKey board will remain in USB load mode for 90 seconds
-from power up. If you take longer than 90 seconds to start the install
-then power cycle the board before trying again.
-
-Wait about 5 seconds and then check that the HiKey board has been
-recognized by your Linux PC:
-$ ls /dev/ttyUSB*
-or
-$ dmesg
-
-
-Run the flash-all.sh script after building AOSP for hikey with the right
-right UART recognised in the above command:
-$ ./flash-all.sh /dev/ttyUSBX [4g]
-
-Remove the link 3-4 and power on the board.
diff --git a/installer/hikey/fip.bin b/installer/hikey/fip.bin
deleted file mode 100644
index e388d9e..0000000
--- a/installer/hikey/fip.bin
+++ /dev/null
Binary files differ
diff --git a/installer/hikey/flash-all.sh b/installer/hikey/flash-all.sh
deleted file mode 100755
index 4707d06..0000000
--- a/installer/hikey/flash-all.sh
+++ /dev/null
@@ -1,81 +0,0 @@
-#!/bin/bash
-if [ $# -eq 0 ]
-  then
-    echo "Provide the right /dev/ttyUSBX specific to recovery device"
-    exit
-fi
-
-if [ ! -e "${1}" ]
-  then
-    echo "device: ${1} does not exist"
-    exit
-fi
-DEVICE_PORT="${1}"
-PTABLE=ptable-aosp-8g.img
-if [ $# -gt 1 ]
-  then
-    if [ "${2}" == '4g' ]
-      then
-        PTABLE=ptable-aosp-4g.img
-    fi
-fi
-
-INSTALLER_DIR="`dirname ${0}`"
-FIRMWARE_DIR="${INSTALLER_DIR}"
-
-# for cases that not run "lunch hikey-userdebug"
-if [ -z "${ANDROID_BUILD_TOP}" ]; then
-    ANDROID_BUILD_TOP=${INSTALLER_DIR}/../../../../../
-    ANDROID_PRODUCT_OUT="${ANDROID_BUILD_TOP}/out/target/product/hikey"
-fi
-
-if [ -z "${DIST_DIR}" ]; then
-    DIST_DIR="${ANDROID_BUILD_TOP}"/out/dist
-fi
-
-#get out directory path
-while [ $# -ne 0 ]; do
-    case "${1}" in
-        --out) OUT_IMGDIR=${2};shift;;
-        --use-compiled-binaries) FIRMWARE_DIR="${DIST_DIR}";shift;;
-    esac
-    shift
-done
-
-if [[ "${FIRMWARE_DIR}" == "${DIST_DIR}" && ! -e "${DIST_DIR}"/fip.bin && ! -e "${DIST_DIR}"/l-loader.bin ]]; then
-    echo "No binaries found at ${DIST_DIR}. Please build the bootloader first"
-    exit
-fi
-
-if [ -z "${OUT_IMGDIR}" ]; then
-    if [ ! -z "${ANDROID_PRODUCT_OUT}" ]; then
-        OUT_IMGDIR="${ANDROID_PRODUCT_OUT}"
-    fi
-fi
-
-if [ ! -d "${OUT_IMGDIR}" ]; then
-    echo "error in locating out directory, check if it exist"
-    exit
-fi
-
-echo "android out dir:${OUT_IMGDIR}"
-
-sudo python "${INSTALLER_DIR}"/hisi-idt.py --img1="${FIRMWARE_DIR}"/l-loader.bin -d "${DEVICE_PORT}"
-sleep 3
-# set a unique serial number
-serialno=`fastboot getvar serialno 2>&1 > /dev/null`
-if [ "${serialno:10:6}" == "(null)" ]; then
-    fastboot oem serialno
-else
-    if [ "${serialno:10:15}" == "0123456789abcde" ]; then
-        fastboot oem serialno
-    fi
-fi
-fastboot getvar partition-size:ptable
-fastboot flash ptable "${INSTALLER_DIR}"/"${PTABLE}"
-fastboot flash fastboot "${FIRMWARE_DIR}"/fip.bin
-fastboot flash nvme "${INSTALLER_DIR}"/nvme.img
-fastboot flash boot "${OUT_IMGDIR}"/boot.img
-fastboot flash system "${OUT_IMGDIR}"/system.img
-fastboot flash vendor "${OUT_IMGDIR}"/vendor.img
-fastboot flash userdata "${OUT_IMGDIR}"/userdata.img
diff --git a/installer/hikey/hisi-idt.py b/installer/hikey/hisi-idt.py
deleted file mode 100644
index db66ef8..0000000
--- a/installer/hikey/hisi-idt.py
+++ /dev/null
@@ -1,263 +0,0 @@
-#!/usr/bin/env python
-#-*- coding: utf-8 -*-
-
-import os
-import os.path
-
-import serial, time
-import array
-import sys, getopt
-
-class bootdownload(object):
-    '''
-    Hisilicon boot downloader
-
-    >>> downloader = bootdownload()
-    >>> downloader.download(filename)
-
-    '''
-
-    # crctab calculated by Mark G. Mendel, Network Systems Corporation
-    crctable = [
-        0x0000, 0x1021, 0x2042, 0x3063, 0x4084, 0x50a5, 0x60c6, 0x70e7,
-        0x8108, 0x9129, 0xa14a, 0xb16b, 0xc18c, 0xd1ad, 0xe1ce, 0xf1ef,
-        0x1231, 0x0210, 0x3273, 0x2252, 0x52b5, 0x4294, 0x72f7, 0x62d6,
-        0x9339, 0x8318, 0xb37b, 0xa35a, 0xd3bd, 0xc39c, 0xf3ff, 0xe3de,
-        0x2462, 0x3443, 0x0420, 0x1401, 0x64e6, 0x74c7, 0x44a4, 0x5485,
-        0xa56a, 0xb54b, 0x8528, 0x9509, 0xe5ee, 0xf5cf, 0xc5ac, 0xd58d,
-        0x3653, 0x2672, 0x1611, 0x0630, 0x76d7, 0x66f6, 0x5695, 0x46b4,
-        0xb75b, 0xa77a, 0x9719, 0x8738, 0xf7df, 0xe7fe, 0xd79d, 0xc7bc,
-        0x48c4, 0x58e5, 0x6886, 0x78a7, 0x0840, 0x1861, 0x2802, 0x3823,
-        0xc9cc, 0xd9ed, 0xe98e, 0xf9af, 0x8948, 0x9969, 0xa90a, 0xb92b,
-        0x5af5, 0x4ad4, 0x7ab7, 0x6a96, 0x1a71, 0x0a50, 0x3a33, 0x2a12,
-        0xdbfd, 0xcbdc, 0xfbbf, 0xeb9e, 0x9b79, 0x8b58, 0xbb3b, 0xab1a,
-        0x6ca6, 0x7c87, 0x4ce4, 0x5cc5, 0x2c22, 0x3c03, 0x0c60, 0x1c41,
-        0xedae, 0xfd8f, 0xcdec, 0xddcd, 0xad2a, 0xbd0b, 0x8d68, 0x9d49,
-        0x7e97, 0x6eb6, 0x5ed5, 0x4ef4, 0x3e13, 0x2e32, 0x1e51, 0x0e70,
-        0xff9f, 0xefbe, 0xdfdd, 0xcffc, 0xbf1b, 0xaf3a, 0x9f59, 0x8f78,
-        0x9188, 0x81a9, 0xb1ca, 0xa1eb, 0xd10c, 0xc12d, 0xf14e, 0xe16f,
-        0x1080, 0x00a1, 0x30c2, 0x20e3, 0x5004, 0x4025, 0x7046, 0x6067,
-        0x83b9, 0x9398, 0xa3fb, 0xb3da, 0xc33d, 0xd31c, 0xe37f, 0xf35e,
-        0x02b1, 0x1290, 0x22f3, 0x32d2, 0x4235, 0x5214, 0x6277, 0x7256,
-        0xb5ea, 0xa5cb, 0x95a8, 0x8589, 0xf56e, 0xe54f, 0xd52c, 0xc50d,
-        0x34e2, 0x24c3, 0x14a0, 0x0481, 0x7466, 0x6447, 0x5424, 0x4405,
-        0xa7db, 0xb7fa, 0x8799, 0x97b8, 0xe75f, 0xf77e, 0xc71d, 0xd73c,
-        0x26d3, 0x36f2, 0x0691, 0x16b0, 0x6657, 0x7676, 0x4615, 0x5634,
-        0xd94c, 0xc96d, 0xf90e, 0xe92f, 0x99c8, 0x89e9, 0xb98a, 0xa9ab,
-        0x5844, 0x4865, 0x7806, 0x6827, 0x18c0, 0x08e1, 0x3882, 0x28a3,
-        0xcb7d, 0xdb5c, 0xeb3f, 0xfb1e, 0x8bf9, 0x9bd8, 0xabbb, 0xbb9a,
-        0x4a75, 0x5a54, 0x6a37, 0x7a16, 0x0af1, 0x1ad0, 0x2ab3, 0x3a92,
-        0xfd2e, 0xed0f, 0xdd6c, 0xcd4d, 0xbdaa, 0xad8b, 0x9de8, 0x8dc9,
-        0x7c26, 0x6c07, 0x5c64, 0x4c45, 0x3ca2, 0x2c83, 0x1ce0, 0x0cc1,
-        0xef1f, 0xff3e, 0xcf5d, 0xdf7c, 0xaf9b, 0xbfba, 0x8fd9, 0x9ff8,
-        0x6e17, 0x7e36, 0x4e55, 0x5e74, 0x2e93, 0x3eb2, 0x0ed1, 0x1ef0,
-    ]
-
-    startframe = {
-        'hi3716cv200':[0xFE,0x00,0xFF,0x01,0x00,0x00,0x00,0x04,0x00,0x00,0x02,0x01]
-    }
-
-    headframe = {
-        'hi3716cv200':[0xFE,0x00,0xFF,0x01,0x00,0x00,0x00,0x04,0x00,0x00,0x02,0x01]
-    }
-
-    bootheadaddress = {
-        'hi3716cv200':0xF9800800
-    }
-
-    bootdownloadaddress = {
-        'hi3716cv200':0x07000000
-    }
-
-    BOOT_HEAD_LEN = 0x4F00
-    MAX_DATA_LEN  = 0x400
-
-    def __init__(self,chiptype,serialport):
-        try:
-            self.s = serial.Serial(port=serialport, baudrate=115200, timeout=1)
-        except serial.serialutil.SerialException:
-            #no serial connection
-            self.s = None
-            print "\nFailed to open serial!", serialport
-            sys.exit(2)
-
-        self.chip = chiptype
-
-    def __del__(self):
-        if self.s != None:
-            self.s.close()
-
-    def calc_crc(self, data, crc=0):
-        for char in data:
-            crc = ((crc << 8) | ord(char)) ^ self.crctable[(crc >> 8) & 0xff]
-        for i in range(0,2):
-            crc = ((crc << 8) | 0) ^ self.crctable[(crc >> 8) & 0xff]
-        return crc & 0xffff
-
-    def getsize(self, filename):
-        st = os.stat(filename)
-        return st.st_size
-
-    def sendframe(self, data, loop):
-        for i in range(1, loop):
-            self.s.flushOutput()
-            self.s.write(data)
-            self.s.flushInput()
-            try:
-                ack = self.s.read()
-                if len(ack) == 1:
-                    if ack == chr(0xaa):
-                        return None
-            except:
-                return None
-
-        print 'failed'
-
-    def sendstartframe(self):
-	self.s.timeout = 0.01
-        data = array.array('B', self.startframe[self.chip]).tostring()
-        crc = self.calc_crc(data)
-        data += chr((crc >> 8)&0xff)
-        data += chr(crc&0xff)
-        self.sendframe(data,10000)
-
-    def sendheadframe(self,length,address):
-	self.s.timeout = 0.03
-        self.headframe[self.chip][4] = (length>>24)&0xff
-        self.headframe[self.chip][5] = (length>>16)&0xff
-        self.headframe[self.chip][6] = (length>>8)&0xff
-        self.headframe[self.chip][7] = (length)&0xff
-        self.headframe[self.chip][8] = (address>>24)&0xff
-        self.headframe[self.chip][9] = (address>>16)&0xff
-        self.headframe[self.chip][10] = (address>>8)&0xff
-        self.headframe[self.chip][11] = (address)&0xff
-
-        data = array.array('B', self.headframe[self.chip]).tostring()
-        crc = self.calc_crc(data)
-
-        data += chr((crc >> 8)&0xff)
-        data += chr(crc&0xff)
-
-        self.sendframe(data,16)
-
-
-    def senddataframe(self,seq,data):
-        self.s.timeout = 0.15
-        head = chr(0xDA)
-        head += chr(seq&0xFF)
-        head += chr((~seq)&0xFF)
-
-        data = head + data
-
-        crc = self.calc_crc(data)
-        data += chr((crc >> 8)&0xff)
-        data += chr(crc&0xff)
-
-        self.sendframe(data,32)
-
-    def sendtailframe(self,seq):
-        data = chr(0xED)
-        data += chr(seq&0xFF)
-        data += chr((~seq)&0xFF)
-        crc = self.calc_crc(data)
-        data += chr((crc >> 8)&0xff)
-        data += chr(crc&0xff)
-
-        self.sendframe(data,16)
-
-    def senddata(self, data, address):
-        length=len(data)
-        self.sendheadframe(length,address)
-        seq=1
-        while length > self.MAX_DATA_LEN:
-            self.senddataframe(seq,data[(seq-1)*self.MAX_DATA_LEN:seq*self.MAX_DATA_LEN])
-            seq = seq+1
-            length = length-self.MAX_DATA_LEN
-        self.senddataframe(seq,data[(seq-1)*self.MAX_DATA_LEN:])
-        self.sendtailframe(seq+1)
-
-
-    def download(self, filename1, filename2):
-
-        f=open(filename1,"rb")
-        data = f.read()
-        f.close()
-
-        print 'Sending', filename1, '...'
-        self.senddata(data,self.bootheadaddress[self.chip])
-        print 'Done\n'
-
-        if filename2:
-            f=open(filename2,"rb")
-            data = f.read()
-            f.close()
-
-            print 'Sending', filename2, '...'
-            self.senddata(data,self.bootdownloadaddress[self.chip])
-            print 'Done\n'
-
-
-def burnboot(chiptype, serialport, filename1, filename2=''):
-    downloader = bootdownload(chiptype, serialport)
-    downloader.download(filename1, filename2)
-
-def startterm(serialport=0):
-    try:
-        miniterm = Miniterm(
-            serialport,
-            115200,
-            'N',
-            rtscts=False,
-            xonxoff=False,
-            echo=False,
-            convert_outgoing=2,
-            repr_mode=0,
-        )
-    except serial.SerialException, e:
-        sys.stderr.write("could not open port %r: %s\n" % (port, e))
-        sys.exit(1)
-    miniterm.start()
-    miniterm.join(True)
-    miniterm.join()
-
-def main(argv):
-    '''
-    img2 = 'fastboot2.img'
-    '''
-    img1 = 'fastboot1.img'
-    img2 = ''
-    dev  = '/dev/serial/by-id/usb-䕇䕎䥎_㄰㌲㔴㜶㤸-if00-port0'
-    try:
-        opts, args = getopt.getopt(argv,"hd:",["img1=","img2="])
-    except getopt.GetoptError:
-        print 'hisi-idt.py -d device --img1 <fastboot1> --img2 <fastboot2>'
-        sys.exit(2)
-    for opt, arg in opts:
-        if opt == '-h':
-            print 'hisi-idt.py -d device --img1 <fastboot1> --img2 <fastboot2>'
-            sys.exit()
-        elif opt in ("-d"):
-            dev = arg
-        elif opt in ("--img1"):
-            img1 = arg
-        elif opt in ("--img2"):
-            img2 = arg
-    print '+----------------------+'
-    print ' Serial: ', dev
-    print ' Image1: ', img1
-    print ' Image2: ', img2
-    print '+----------------------+\n'
-
-    if not os.path.isfile(img1):
-        print "Image don't exists:", img1
-        sys.exit(1)
-
-    if (img2):
-        if not os.path.isfile(img2):
-            print "Image don't exists:", img2
-            sys.exit(1)
-
-    burnboot('hi3716cv200', dev, img1, img2)
-
-if __name__ == "__main__":
-    main(sys.argv[1:])
diff --git a/installer/hikey/l-loader.bin b/installer/hikey/l-loader.bin
deleted file mode 100644
index 3c271e3..0000000
--- a/installer/hikey/l-loader.bin
+++ /dev/null
Binary files differ
diff --git a/installer/hikey/nvme.img b/installer/hikey/nvme.img
deleted file mode 100644
index e2c8fe9..0000000
--- a/installer/hikey/nvme.img
+++ /dev/null
Binary files differ
diff --git a/installer/hikey/ptable-aosp-4g.img b/installer/hikey/ptable-aosp-4g.img
deleted file mode 100644
index 43bf8a9..0000000
--- a/installer/hikey/ptable-aosp-4g.img
+++ /dev/null
Binary files differ
diff --git a/installer/hikey/ptable-aosp-8g.img b/installer/hikey/ptable-aosp-8g.img
deleted file mode 100644
index 631fd8a..0000000
--- a/installer/hikey/ptable-aosp-8g.img
+++ /dev/null
Binary files differ
diff --git a/installer/hikey960/fip.bin b/installer/hikey960/fip.bin
deleted file mode 100644
index 53d4950..0000000
--- a/installer/hikey960/fip.bin
+++ /dev/null
Binary files differ
diff --git a/installer/hikey960/l-loader.bin b/installer/hikey960/l-loader.bin
deleted file mode 100644
index 2ad7a23..0000000
--- a/installer/hikey960/l-loader.bin
+++ /dev/null
Binary files differ
diff --git a/installer/hikey960/prm_ptable.img b/installer/hikey960/prm_ptable.img
deleted file mode 100644
index c81ffcf..0000000
--- a/installer/hikey960/prm_ptable.img
+++ /dev/null
Binary files differ
diff --git a/installer/hikey960/uefi-flash-all.sh b/installer/hikey960/uefi-flash-all.sh
deleted file mode 100755
index fe42486..0000000
--- a/installer/hikey960/uefi-flash-all.sh
+++ /dev/null
@@ -1,76 +0,0 @@
-#!/bin/bash
-
-INSTALLER_DIR="`dirname ${0}`"
-ECHO_PREFIX="=== "
-
-# for cases that don't run "lunch hikey960-userdebug"
-if [ -z "${ANDROID_BUILD_TOP}" ]; then
-    ANDROID_BUILD_TOP=${INSTALLER_DIR}/../../../../../
-    ANDROID_PRODUCT_OUT="${ANDROID_BUILD_TOP}/out/target/product/hikey960"
-fi
-
-if [ ! -d "${ANDROID_PRODUCT_OUT}" ]; then
-    echo ${ECHO_PREFIX}"error in locating out directory, check if it exist"
-    exit
-fi
-
-echo ${ECHO_PREFIX}"android out dir:${ANDROID_PRODUCT_OUT}"
-
-function check_partition_table_version () {
-	fastboot erase reserved
-	if [ $? -eq 0 ]
-	then
-		IS_PTABLE_1MB_ALIGNED=true
-	else
-		IS_PTABLE_1MB_ALIGNED=false
-	fi
-}
-
-function flashing_atf_uefi () {
-	fastboot flash ptable "${INSTALLER_DIR}"/prm_ptable.img
-	fastboot flash xloader "${INSTALLER_DIR}"/hisi-sec_xloader.img
-	fastboot reboot-bootloader
-
-	fastboot flash fastboot "${INSTALLER_DIR}"/l-loader.bin
-	fastboot flash fip "${INSTALLER_DIR}"/fip.bin
-	fastboot flash nvme "${INSTALLER_DIR}"/hisi-nvme.img
-	fastboot flash fw_lpm3   "${INSTALLER_DIR}"/hisi-lpm3.img
-	fastboot flash trustfirmware   "${INSTALLER_DIR}"/hisi-bl31.bin
-	fastboot reboot-bootloader
-
-	fastboot flash ptable "${INSTALLER_DIR}"/prm_ptable.img
-	fastboot flash xloader "${INSTALLER_DIR}"/hisi-sec_xloader.img
-	fastboot flash fastboot "${INSTALLER_DIR}"/l-loader.bin
-	fastboot flash fip "${INSTALLER_DIR}"/fip.bin
-
-	fastboot flash boot "${ANDROID_PRODUCT_OUT}"/boot.img
-	fastboot flash system "${ANDROID_PRODUCT_OUT}"/system.img
-	fastboot flash vendor "${ANDROID_PRODUCT_OUT}"/vendor.img
-	fastboot flash cache "${ANDROID_PRODUCT_OUT}"/cache.img
-	fastboot flash userdata "${ANDROID_PRODUCT_OUT}"/userdata.img
-}
-
-function upgrading_ptable_1mb_aligned () {
-	fastboot flash xloader "${INSTALLER_DIR}"/hisi-sec_xloader.img
-	fastboot flash ptable "${INSTALLER_DIR}"/hisi-ptable.img
-	fastboot flash fastboot "${INSTALLER_DIR}"/hisi-fastboot.img
-	fastboot reboot-bootloader
-}
-
-echo ${ECHO_PREFIX}"Checking partition table version..."
-check_partition_table_version
-
-if [ "${IS_PTABLE_1MB_ALIGNED}" == "true" ]
-then
-	echo ${ECHO_PREFIX}"Partition table is 1MB aligned. Flashing ATF/UEFI..."
-	flashing_atf_uefi
-else
-	echo ${ECHO_PREFIX}"Partition table is 512KB aligned."
-	echo ${ECHO_PREFIX}"Upgrading to 1MB aligned version..."
-	upgrading_ptable_1mb_aligned
-	echo ${ECHO_PREFIX}"Flasing ATF/UEFI..."
-	flashing_atf_uefi
-	echo ${ECHO_PREFIX}"Done"
-fi
-
-fastboot reboot
diff --git a/l-loader/.gitignore b/l-loader/.gitignore
deleted file mode 100644
index b282a0e..0000000
--- a/l-loader/.gitignore
+++ /dev/null
@@ -1,3 +0,0 @@
-/*.o
-/*.img
-/*.bin
diff --git a/l-loader/COPYING b/l-loader/COPYING
deleted file mode 100644
index 4ad3f20..0000000
--- a/l-loader/COPYING
+++ /dev/null
@@ -1,25 +0,0 @@
-Copyright (c) 2014-2016, Linaro Ltd. All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions
-are met:
-
-* Redistributions of source code must retain the above copyright
-  notice, this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above copyright
-  notice, this list of conditions and the following disclaimer in
-  the documentation and/or other materials provided with the
-  distribution.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGE.
diff --git a/l-loader/Makefile b/l-loader/Makefile
deleted file mode 100644
index 5331c39..0000000
--- a/l-loader/Makefile
+++ /dev/null
@@ -1,15 +0,0 @@
-.PHONY: hikey
-hikey:
-	$(MAKE) -f hikey.mk
-
-.PHONY: hikey-clean
-hikey-clean:
-	$(MAKE) -f hikey.mk clean
-
-.PHONY: hikey960
-hikey960:
-	$(MAKE) -f hikey960.mk
-
-.PHONY: hikey960-clean
-hikey960-clean:
-	$(MAKE) -f hikey960.mk clean
diff --git a/l-loader/README.md b/l-loader/README.md
deleted file mode 100644
index e5dcd99..0000000
--- a/l-loader/README.md
+++ /dev/null
@@ -1,6 +0,0 @@
-# l-loader
-
-Used to switch from aarch32 to aarch64 and boot. First image to be flashed
-when in recovery mode.
-
-HiKey specific.
diff --git a/l-loader/gen_loader.py b/l-loader/gen_loader.py
deleted file mode 100755
index 2d763ca..0000000
--- a/l-loader/gen_loader.py
+++ /dev/null
@@ -1,268 +0,0 @@
-#!/usr/bin/env python
-
-import os
-import os.path
-import sys, getopt
-import binascii
-import struct
-import string
-
-class generator(object):
-    #
-    # struct l_loader_head {
-    #      unsigned int	first_instr;
-    #      unsigned char	magic[16];	@ BOOTMAGICNUMBER!
-    #      unsigned int	l_loader_start;
-    #      unsigned int	l_loader_end;
-    # };
-    file_header = [0, 0, 0, 0, 0, 0, 0]
-
-    #
-    # struct entry_head {
-    #       unsigned char   magic[8];           @ ENTY
-    #       unsigned char   name[8];            @ loader/bl1
-    #       unsigned int    start_lba;
-    #       unsigned int    count_lba;
-    #       unsigned int    flag;               @ boot partition or not
-    # };
-
-    s1_entry_name = ['loader', 'bl1']
-    s2_entry_name = ['primary', 'second']
-
-    block_size = 512
-
-    stage = 0
-
-    # set in self.add()
-    idx = 0
-
-    # set in self.parse()
-    ptable_lba = 0
-    stable_lba = 0
-
-    # file pointer
-    p_entry = 0
-    p_file = 0
-
-    def __init__(self, out_img):
-        try:
-            self.fp = open(out_img, "wb+")
-        except IOError, e:
-            print "*** file open error:", e
-            sys.exit(3)
-        else:
-            self.entry_hd = [[0 for col in range(7)] for row in range(5)]
-
-    def __del__(self):
-        self.fp.close()
-
-    # parse partition from the primary ptable
-    def parse(self, fname):
-        try:
-            fptable = open(fname, "rb")
-        except IOError, e:
-            print "*** file open error:", e
-            sys.exit(3)
-        else:
-            # skip the first block in primary partition table
-            # that is MBR protection information
-            fptable.read(self.block_size)
-            # check whether it's a primary paritition table
-            data = struct.unpack("8s", fptable.read(8))
-            efi_magic = 'EFI PART'
-            if cmp("EFI PART", data[0]):
-                print "It's not partition table image."
-                fptable.close()
-                sys.exit(4)
-            # skip 16 bytes
-            fptable.read(16)
-            # get lba of both primary partition table and secondary partition table
-            data = struct.unpack("QQQQ", fptable.read(32))
-            self.ptable_lba = data[0] - 1
-            self.stable_lba = data[3] + 1
-            # skip 24 bytes
-            fptable.read(24)
-            data = struct.unpack("i", fptable.read(4))
-            pentries = data[0]
-            # skip the reset in this block
-            fptable.read(self.block_size - 84)
-
-            for i in range(1, pentries):
-                # name is encoded as UTF-16
-                d0,lba,d2,name = struct.unpack("32sQ16s72s", fptable.read(128))
-                plainname = unicode(name, "utf-16")
-                if (not cmp(plainname[0:7], 'l-loader'[0:7])):
-                    print 'bl1_lba: ', lba
-                    self.bl1_lba = lba
-                    sys.exit(1)
-
-            fptable.close()
-
-    def add(self, lba, fname):
-        try:
-            fsize = os.path.getsize(fname)
-        except IOError, e:
-            print "*** file open error:", e
-            sys.exit(4)
-        else:
-            blocks = (fsize + self.block_size - 1) / self.block_size
-            if (self.stage == 1):
-                # Boot Area1 in eMMC
-                bootp = 1
-                if self.idx == 0:
-                    self.p_entry = 28
-            elif (self.stage == 2):
-                # User Data Area in eMMC
-                bootp = 0
-                # create an empty block only for stage2
-                # This empty block is used to store entry head
-                print 'p_file: ', self.p_file, 'p_entry: ', self.p_entry
-                if self.idx == 0:
-                    self.fp.seek(self.p_file)
-                    for i in range (0, self.block_size):
-                        zero = struct.pack('x')
-                        self.fp.write(zero)
-                    self.p_file += self.block_size
-                    self.p_entry = 0
-            else:
-                print "wrong stage ", stage, "is specified"
-                sys.exit(4)
-            # Maybe the file size isn't aligned. So pad it.
-            if (self.idx == 0) and (self.stage == 1):
-                if fsize > 2048:
-                    print 'loader size exceeds 2KB. file size: ', fsize
-                    sys.exit(4)
-                else:
-                    left_bytes = 2048 - fsize
-            else:
-                left_bytes = fsize % self.block_size
-                if left_bytes:
-                    left_bytes = self.block_size - left_bytes
-            print 'lba: ', lba, 'blocks: ', blocks, 'bootp: ', bootp, 'fname: ', fname
-            # write images
-            fimg = open(fname, "rb")
-            for i in range (0, blocks):
-                buf = fimg.read(self.block_size)
-                self.fp.seek(self.p_file)
-                self.fp.write(buf)
-                # p_file is the file pointer of the new binary file
-                # At last, it means the total block size of the new binary file
-                self.p_file += self.block_size
-
-            if (self.idx == 0) and (self.stage == 1):
-                self.p_file = 2048
-            print 'p_file: ', self.p_file, 'last block is ', fsize % self.block_size, 'bytes', '  tell: ', self.fp.tell(), 'left_bytes: ', left_bytes
-            if left_bytes:
-                for i in range (0, left_bytes):
-                    zero = struct.pack('x')
-                    self.fp.write(zero)
-                print 'p_file: ', self.p_file, '  pad to: ', self.fp.tell()
-
-            # write entry information at the header
-            if self.stage == 1:
-                byte = struct.pack('8s8siii', 'ENTRYHDR', self.s1_entry_name[self.idx], lba, blocks, bootp)
-            elif self.stage == 2:
-                byte = struct.pack('8s8siii', 'ENTRYHDR', self.s2_entry_name[self.idx], lba, blocks, bootp)
-            self.fp.seek(self.p_entry)
-            self.fp.write(byte)
-            self.p_entry += 28
-            self.idx += 1
-
-            fimg.close()
-
-    def hex2(self, data):
-        return data > 0 and hex(data) or hex(data & 0xffffffff)
-
-    def end(self):
-        if self.stage == 1:
-            self.fp.seek(20)
-            start,end = struct.unpack("ii", self.fp.read(8))
-            print "start: ", self.hex2(start), 'end: ', self.hex2(end)
-            end = start + self.p_file
-            print "start: ", self.hex2(start), 'end: ', self.hex2(end)
-            self.fp.seek(24)
-            byte = struct.pack('i', end)
-            self.fp.write(byte)
-        self.fp.close()
-
-    def create_stage1(self, img_loader, img_bl1, output_img):
-        print '+-----------------------------------------------------------+'
-        print ' Input Images:'
-        print '     loader:                       ', img_loader
-        print '     bl1:                          ', img_bl1
-        print ' Ouput Image:                      ', output_img
-        print '+-----------------------------------------------------------+\n'
-
-        self.stage = 1
-
-        # The first 2KB is reserved
-        # The next 2KB is for loader image
-        self.add(4, img_loader)    # img_loader doesn't exist in partition table
-        print 'self.idx: ', self.idx
-        # bl1.bin starts from 4KB
-        self.add(8, img_bl1)      # img_bl1 doesn't exist in partition table
-
-    def create_stage2(self, img_prm_ptable, img_sec_ptable, output_img):
-        print '+-----------------------------------------------------------+'
-        print ' Input Images:'
-        print '     primary partition table:      ', img_prm_ptable
-        print '     secondary partition table:    ', img_sec_ptable
-        print ' Ouput Image:                      ', output_img
-        print '+-----------------------------------------------------------+\n'
-
-        self.stage = 2
-        self.parse(img_prm_ptable)
-        self.add(self.ptable_lba, img_prm_ptable)
-        if (cmp(img_sec_ptable, 'secondary partition table')):
-            # Doesn't match. It means that secondary ptable is specified.
-            self.add(self.stable_lba, img_sec_ptable)
-        else:
-            print 'Don\'t need secondary partition table'
-
-def main(argv):
-    stage1 = 0
-    stage2 = 0
-    img_prm_ptable = "primary partition table"
-    img_sec_ptable = "secondary partition table"
-    try:
-        opts, args = getopt.getopt(argv,"ho:",["img_loader=","img_bl1=","img_prm_ptable=","img_sec_ptable="])
-    except getopt.GetoptError:
-        print 'gen_loader.py -o <l-loader.bin> --img_loader <l-loader> --img_bl1 <bl1.bin> --img_prm_ptable <prm_ptable.img> --img_sec_ptable <sec_ptable.img>'
-        sys.exit(2)
-    for opt, arg in opts:
-        if opt == '-h':
-            print 'gen_loader.py -o <l-loader.bin> --img_loader <l-loader> --img_bl1 <bl1.bin> --img_prm_ptable <prm_ptable.img> --img_sec_ptable <sec_ptable.img>'
-            sys.exit(1)
-        elif opt == '-o':
-            output_img = arg
-        elif opt in ("--img_loader"):
-            img_loader = arg
-            stage1 = 1
-        elif opt in ("--img_bl1"):
-            img_bl1 = arg
-            stage1 = 1
-        elif opt in ("--img_prm_ptable"):
-            img_prm_ptable = arg
-            stage2 = 1
-        elif opt in ("--img_sec_ptable"):
-            img_sec_ptable = arg
-
-    loader = generator(output_img)
-    loader.idx = 0
-
-    if (stage1 == 1) and (stage2 == 1):
-        print 'There are only loader & BL1 in stage1.'
-        print 'And there are primary partition table, secondary partition table and FIP in stage2.'
-        sys.exit(1)
-    elif (stage1 == 0) and (stage2 == 0):
-        print 'No input images are specified.'
-        sys.exit(1)
-    elif stage1 == 1:
-        loader.create_stage1(img_loader, img_bl1, output_img)
-    elif stage2 == 1:
-        loader.create_stage2(img_prm_ptable, img_sec_ptable, output_img)
-
-    loader.end()
-
-if __name__ == "__main__":
-    main(sys.argv[1:])
diff --git a/l-loader/gen_loader_hikey.py b/l-loader/gen_loader_hikey.py
deleted file mode 100755
index a07eb98..0000000
--- a/l-loader/gen_loader_hikey.py
+++ /dev/null
@@ -1,184 +0,0 @@
-#!/usr/bin/env python
-
-import os
-import os.path
-import sys, getopt
-import binascii
-import struct
-import string
-
-# --------------------------
-# | loader | BL1 | NS BL1U |
-# --------------------------
-
-class generator(object):
-    #
-    # struct l_loader_head {
-    #      unsigned int	first_instr;
-    #      unsigned char	magic[16];	@ BOOTMAGICNUMBER!
-    #      unsigned int	l_loader_start;         @ start of loader
-    #      unsigned int	l_loader_end;           @ end of BL1 (without ns_bl1u)
-    # };
-    file_header = [0, 0, 0, 0, 0, 0, 0]
-
-    #
-    # struct entry_head {
-    #       unsigned char   magic[8];           @ ENTY
-    #       unsigned char   name[8];            @ loader/bl1/ns_bl1u
-    #       unsigned int    start_lba;
-    #       unsigned int    count_lba;
-    #       unsigned int    flag;               @ boot partition or not
-    # };
-    # size of struct entry_head is 28
-    #
-
-    s1_entry_name = ['loader', 'bl1', 'ns_bl1u']
-
-    block_size = 512
-
-    # set in self.add()
-    idx = 0
-
-    # file pointer
-    p_entry = 0        # pointer in header
-    p_file = 0         # pointer in file
-    p_loader_end = 0   # pointer in header
-
-    def __init__(self, out_img):
-        try:
-            self.fp = open(out_img, "wb+")
-        except IOError, e:
-            print "*** file open error:", e
-            sys.exit(3)
-        else:
-            self.entry_hd = [[0 for col in range(7)] for row in range(5)]
-
-    def __del__(self):
-        self.fp.close()
-
-    def add(self, lba, fname):
-        try:
-            fsize = os.path.getsize(fname)
-        except IOError, e:
-            print "*** file open error:", e
-            sys.exit(4)
-        else:
-            blocks = (fsize + self.block_size - 1) / self.block_size
-            # Boot Area1 in eMMC
-            bootp = 1
-            if self.idx == 0:
-                # both loader and bl1.bin locates in l-loader.bin bias 2KB
-                self.p_entry = 28
-            elif (self.idx > 1):
-                # image: ns_bl1u
-                # Record the end of loader & BL1. ns_bl1u won't be loaded by BootROM.
-                self.p_loader_end = self.p_file
-                # ns_bl1u should locates in l-loader.bin bias 2KB too
-                if (self.p_file < (lba * self.block_size - 2048)):
-                    self.p_file = lba * self.block_size - 2048
-
-            # Maybe the file size isn't aligned. So pad it.
-            if (self.idx == 0):
-                if fsize > 2048:
-                    print 'loader size exceeds 2KB. file size: ', fsize
-                    sys.exit(4)
-                else:
-                    left_bytes = 2048 - fsize
-            else:
-                left_bytes = fsize % self.block_size
-                if left_bytes:
-                    left_bytes = self.block_size - left_bytes
-            print 'lba: ', lba, 'blocks: ', blocks, 'bootp: ', bootp, 'fname: ', fname
-            # write images
-            fimg = open(fname, "rb")
-            for i in range (0, blocks):
-                buf = fimg.read(self.block_size)
-                # loader's p_file is 0 at here
-                self.fp.seek(self.p_file)
-                self.fp.write(buf)
-                # p_file is the file pointer of the new binary file
-                # At last, it means the total block size of the new binary file
-                self.p_file += self.block_size
-
-            if (self.idx == 0):
-                self.p_file = 2048
-            print 'p_file: ', self.p_file, 'last block is ', fsize % self.block_size, 'bytes', '  tell: ', self.fp.tell(), 'left_bytes: ', left_bytes
-            if left_bytes:
-                for i in range (0, left_bytes):
-                    zero = struct.pack('x')
-                    self.fp.write(zero)
-                print 'p_file: ', self.p_file, '  pad to: ', self.fp.tell()
-
-            # write entry information at the header
-            byte = struct.pack('8s8siii', 'ENTRYHDR', self.s1_entry_name[self.idx], lba, blocks, bootp)
-            self.fp.seek(self.p_entry)
-            self.fp.write(byte)
-            self.p_entry += 28
-            self.idx += 1
-
-            fimg.close()
-
-    def hex2(self, data):
-        return data > 0 and hex(data) or hex(data & 0xffffffff)
-
-    def end(self):
-        self.fp.seek(20)
-        start,end = struct.unpack("ii", self.fp.read(8))
-        print "start: ", self.hex2(start), 'end: ', self.hex2(end)
-        end = start + self.p_loader_end
-        print "start: ", self.hex2(start), 'end: ', self.hex2(end)
-        self.fp.seek(24)
-        byte = struct.pack('i', end)
-        self.fp.write(byte)
-        self.fp.close()
-
-    def create(self, img_loader, img_bl1, img_ns_bl1u, output_img):
-        print '+-----------------------------------------------------------+'
-        print ' Input Images:'
-        print '     loader:                       ', img_loader
-        print '     bl1:                          ', img_bl1
-        print '     ns_bl1u:                      ', img_ns_bl1u
-        print ' Ouput Image:                      ', output_img
-        print '+-----------------------------------------------------------+\n'
-
-        self.stage = 1
-
-        # The first 2KB is reserved
-        # The next 2KB is for loader image
-        self.add(4, img_loader)
-        print 'self.idx: ', self.idx
-        # bl1.bin starts from 4KB
-        self.add(8, img_bl1)
-        if img_ns_bl1u != 0:
-            # ns_bl1u.bin starts from 96KB
-            self.add(192, img_ns_bl1u)
-
-def main(argv):
-    img_ns_bl1u = 0
-    try:
-        opts, args = getopt.getopt(argv,"ho:",["img_loader=","img_bl1=","img_ns_bl1u="])
-    except getopt.GetoptError:
-        print 'gen_loader.py -o <l-loader.bin> --img_loader <l-loader> --img_bl1 <bl1.bin> --img_ns_bl1u <ns_bl1u.bin>'
-        sys.exit(2)
-    for opt, arg in opts:
-        if opt == '-h':
-            print 'gen_loader.py -o <l-loader.bin> --img_loader <l-loader> --img_bl1 <bl1.bin> --img_ns_bl1u <ns_bl1u.bin>'
-            sys.exit(1)
-        elif opt == '-o':
-            output_img = arg
-        elif opt in ("--img_loader"):
-            img_loader = arg
-        elif opt in ("--img_bl1"):
-            img_bl1 = arg
-        elif opt in ("--img_ns_bl1u"):
-            img_ns_bl1u = arg
-
-    loader = generator(output_img)
-    loader.idx = 0
-
-    loader.create(img_loader, img_bl1, img_ns_bl1u, output_img)
-
-    loader.end()
-
-if __name__ == "__main__":
-    main(sys.argv[1:])
diff --git a/l-loader/generate_ptable.sh b/l-loader/generate_ptable.sh
deleted file mode 100755
index f8a6a20..0000000
--- a/l-loader/generate_ptable.sh
+++ /dev/null
@@ -1,195 +0,0 @@
-#!/bin/sh
-#
-# Generate partition table for HiKey eMMC or HiKey960 UFS
-#
-# tiny: for testing purpose.
-# aosp: (same as linux with userdata).
-# linux: (same as aosp without userdata).
-# swap: (similar to asop, drop reserved, 1.5G of swap)
-
-PTABLE=${PTABLE:-aosp}
-SECTOR_SIZE=${SECTOR_SIZE:-512}
-SGDISK=${SGDISK:-sgdisk}
-TEMP_FILE=$(mktemp /tmp/${PTABLE}.XXXXXX)
-# 128 entries at most
-ENTRIES_IN_SECTOR=$(expr ${SECTOR_SIZE} / 128)
-ENTRY_SECTORS=$(expr 128 / ${ENTRIES_IN_SECTOR})
-PRIMARY_SECTORS=$(expr ${ENTRY_SECTORS} + 2)
-SECONDARY_SECTORS=$(expr ${ENTRY_SECTORS} + 1)
-
-case ${PTABLE} in
-  tiny)
-    SECTOR_NUMBER=81920
-    ;;
-  aosp-4g|linux-4g)
-    SECTOR_NUMBER=7471104
-    ;;
-  aosp-8g|linux-8g|swap-8g)
-    SECTOR_NUMBER=15269888
-    ;;
-  aosp-32g*|linux-32g)
-    SECTOR_NUMBER=62447650    # count with 512-byte block size
-    ;;
-  aosp-64g|linux-64g)
-    SECTOR_NUMBER=124895300   # count with 512-byte block size
-    ;;
-esac
-
-SECTOR_ALIGNMENT=$(expr ${SECTOR_SIZE} / 512)
-SECTOR_NUMBER=$(expr '(' ${SECTOR_NUMBER} '*' 512 + ${SECTOR_SIZE} - 1 ')' / ${SECTOR_SIZE})
-
-# get the partition table
-case ${PTABLE} in
-  tiny)
-    dd if=/dev/zero of=${TEMP_FILE} bs=${SECTOR_SIZE} count=${SECTOR_NUMBER} conv=sparse
-    fakeroot ${SGDISK} -U -R -v ${TEMP_FILE}
-    fakeroot ${SGDISK} -n 1:2048:4095 -t 1:0700 -u 1:F9F21F01-A8D4-5F0E-9746-594869AEC3E4 -c 1:"vrl" -p ${TEMP_FILE}
-    fakeroot ${SGDISK} -n 2:4096:6143 -t 2:0700 -u 2:F9F21F02-A8D4-5F04-9746-594869AEC3E4 -c 2:"vrl_backup" -p ${TEMP_FILE}
-    ;;
-  aosp-4g|aosp-8g)
-    dd if=/dev/zero of=${TEMP_FILE} bs=${SECTOR_SIZE} count=${SECTOR_NUMBER} conv=sparse
-    fakeroot ${SGDISK} -U 2CB85345-6A91-4043-8203-723F0D28FBE8 -v ${TEMP_FILE}
-    #[1: vrl: 1M-2M]
-    fakeroot ${SGDISK} -n 1:0:+1M -t 1:0700 -u 1:496847AB-56A1-4CD5-A1AD-47F4ACF055C9 -c 1:"vrl" ${TEMP_FILE}
-    #[2: vrl_backup: 2M-3M]
-    fakeroot ${SGDISK} -n 2:0:+1M -t 2:0700 -u 2:61A36FC1-8EFB-4899-84D8-B61642EFA723 -c 2:"vrl_backup" ${TEMP_FILE}
-    #[3: mcuimage: 3M-4M]
-    fakeroot ${SGDISK} -n 3:0:+1M -t 3:0700 -u 3:65007411-962D-4781-9B2C-51DD7DF22CC3 -c 3:"mcuimage" ${TEMP_FILE}
-    #[4: fastboot: 4M-12M]
-    fakeroot ${SGDISK} -n 4:0:+8M -t 4:EF02 -u 4:496847AB-56A1-4CD5-A1AD-47F4ACF055C9 -c 4:"fastboot" ${TEMP_FILE}
-    #[5: nvme: 12M-14M]
-    fakeroot ${SGDISK} -n 5:0:+2M -t 5:0700 -u 5:00354BCD-BBCB-4CB3-B5AE-CDEFCB5DAC43 -c 5:"nvme" ${TEMP_FILE}
-    #[6: boot: 14M-78M]
-    fakeroot ${SGDISK} -n 6:0:+64M -t 6:EF00 -u 6:5C0F213C-17E1-4149-88C8-8B50FB4EC70E -c 6:"boot" ${TEMP_FILE}
-    #[7: vendor: 78M-334M]
-    fakeroot ${SGDISK} -n 7:0:+256M -t 7:0700 -u 7:BED8EBDC-298E-4A7A-B1F1-2500D98453B7 -c 7:"vendor" ${TEMP_FILE}
-    #[8: cache: 334M-590M]
-    fakeroot ${SGDISK} -n 8:0:+256M -t 8:8301 -u 8:A092C620-D178-4CA7-B540-C4E26BD6D2E2 -c 8:"cache" ${TEMP_FILE}
-    #[9: system: 590M-2126M]
-    fakeroot ${SGDISK} -n 9:0:+1536M -t 9:8300 -u 9:FC56E345-2E8E-49AE-B2F8-5B9D263FE377 -c 9:"system" ${TEMP_FILE}
-    #[10: userdata: 2126M-End]
-    fakeroot ${SGDISK} -n -E -t 10:8300 -u 10:064111F6-463B-4CE1-876B-13F3684CE164 -c 10:"userdata" -p ${TEMP_FILE}
-    ;;
-  linux-4g|linux-8g)
-    dd if=/dev/zero of=${TEMP_FILE} bs=${SECTOR_SIZE} count=${SECTOR_NUMBER} conv=sparse
-    fakeroot ${SGDISK} -U 2CB85345-6A91-4043-8203-723F0D28FBE8 -v ${TEMP_FILE}
-    #[1: vrl: 1M-2M]
-    fakeroot ${SGDISK} -n 1:0:+1M -t 1:0700 -u 1:496847AB-56A1-4CD5-A1AD-47F4ACF055C9 -c 1:"vrl" ${TEMP_FILE}
-    #[2: vrl_backup: 2M-3M]
-    fakeroot ${SGDISK} -n 2:0:+1M -t 2:0700 -u 2:61A36FC1-8EFB-4899-84D8-B61642EFA723 -c 2:"vrl_backup" ${TEMP_FILE}
-    #[3: mcuimage: 3M-4M]
-    fakeroot ${SGDISK} -n 3:0:+1M -t 3:0700 -u 3:65007411-962D-4781-9B2C-51DD7DF22CC3 -c 3:"mcuimage" ${TEMP_FILE}
-    #[4: fastboot: 4M-12M]
-    fakeroot ${SGDISK} -n 4:0:+8M -t 4:EF02 -u 4:496847AB-56A1-4CD5-A1AD-47F4ACF055C9 -c 4:"fastboot" ${TEMP_FILE}
-    #[5: nvme: 12M-14M]
-    fakeroot ${SGDISK} -n 5:0:+2M -t 5:0700 -u 5:00354BCD-BBCB-4CB3-B5AE-CDEFCB5DAC43 -c 5:"nvme" ${TEMP_FILE}
-    #[6: boot: 14M-78M]
-    fakeroot ${SGDISK} -n 6:0:+64M -t 6:EF00 -u 6:5C0F213C-17E1-4149-88C8-8B50FB4EC70E -c 6:"boot" ${TEMP_FILE}
-    #[7: reserved: 78M-334M]
-    fakeroot ${SGDISK} -n 7:0:+256M -t 7:0700 -u 7:BED8EBDC-298E-4A7A-B1F1-2500D98453B7 -c 7:"reserved" ${TEMP_FILE}
-    #[8: cache: 334M-590M]
-    fakeroot ${SGDISK} -n 8:0:+256M -t 8:8301 -u 8:A092C620-D178-4CA7-B540-C4E26BD6D2E2 -c 8:"cache" ${TEMP_FILE}
-    #[9: system: 590M-End]
-    fakeroot ${SGDISK} -n -E -t 9:8300 -u 9:FC56E345-2E8E-49AE-B2F8-5B9D263FE377 -c 9:"system" ${TEMP_FILE}
-    ;;
-  swap-8g)
-    dd if=/dev/zero of=${TEMP_FILE} bs=${SECTOR_SIZE} count=${SECTOR_NUMBER} conv=sparse
-    fakeroot ${SGDISK} -U 2CB85345-6A91-4043-8203-723F0D28FBE8 -v ${TEMP_FILE}
-    #[1: vrl: 1M-2M]
-    fakeroot ${SGDISK} -n 1:0:+1M -t 1:0700 -u 1:496847AB-56A1-4CD5-A1AD-47F4ACF055C9 -c 1:"vrl" ${TEMP_FILE}
-    #[2: vrl_backup: 2M-3M]
-    fakeroot ${SGDISK} -n 2:0:+1M -t 2:0700 -u 2:61A36FC1-8EFB-4899-84D8-B61642EFA723 -c 2:"vrl_backup" ${TEMP_FILE}
-    #[3: mcuimage: 3M-4M]
-    fakeroot ${SGDISK} -n 3:0:+1M -t 3:0700 -u 3:65007411-962D-4781-9B2C-51DD7DF22CC3 -c 3:"mcuimage" ${TEMP_FILE}
-    #[4: fastboot: 4M-12M]
-    fakeroot ${SGDISK} -n 4:0:+8M -t 4:EF02 -u 4:496847AB-56A1-4CD5-A1AD-47F4ACF055C9 -c 4:"fastboot" ${TEMP_FILE}
-    #[5: nvme: 12M-14M]
-    fakeroot ${SGDISK} -n 5:0:+2M -t 5:0700 -u 5:00354BCD-BBCB-4CB3-B5AE-CDEFCB5DAC43 -c 5:"nvme" ${TEMP_FILE}
-    #[6: boot: 14M-78M]
-    fakeroot ${SGDISK} -n 6:0:+64M -t 6:EF00 -u 6:5C0F213C-17E1-4149-88C8-8B50FB4EC70E -c 6:"boot" ${TEMP_FILE}
-    #[7: cache: 78M-384M]
-    fakeroot ${SGDISK} -n 7:0:+256M -t 7:8301 -u 7:A092C620-D178-4CA7-B540-C4E26BD6D2E2 -c 7:"cache" ${TEMP_FILE}
-    #[8: swap: 384M-1920M]
-    fakeroot ${SGDISK} -n 8:0:+1536M -t 8:8200 -u 8:FC56E344-2E8E-49AE-B2F8-5B9D263FE377 -c 8:"swap" ${TEMP_FILE}
-    #[9: system: 1920M-3556M]
-    fakeroot ${SGDISK} -n 9:0:+1536M -t 9:8300 -u 9:FC56E345-2E8E-49AE-B2F8-5B9D263FE377 -c 9:"system" ${TEMP_FILE}
-    #[10: userdata: 3556M-End]
-    fakeroot ${SGDISK} -n -E -t 10:8300 -u 10:064111F6-463B-4CE1-876B-13F3684CE164 -c 10:"userdata" -p ${TEMP_FILE}
-    ;;
-  aosp-32g*|aosp-64g)
-    dd if=/dev/zero of=${TEMP_FILE} bs=${SECTOR_SIZE} count=${SECTOR_NUMBER} conv=sparse
-    fakeroot ${SGDISK} -U 2CB85345-6A91-4043-8203-723F0D28FBE8 -v ${TEMP_FILE}
-    #[1: xloader_reserved1: 1M-2M]
-    fakeroot ${SGDISK} -n 1:0:+1M -t 1:0700 -u 1:697c41e0-7a59-4dfa-a9a6-aa43ac5be684 -c 1:"xloader_reserved1" ${TEMP_FILE}
-    #[2: fastboot: 2M-14M]
-    fakeroot ${SGDISK} -n 2:0:+12M -t 2:0700 -u 2:3f5f8c48-4402-4ace-9058-30bfea4fa53f -c 2:"fastboot" ${TEMP_FILE}
-    #[3: nvme: 14M-20M]
-    fakeroot ${SGDISK} -n 3:0:+6M -t 3:0700 -u 3:e2f5e2a9-c9b7-4089-9859-4498f1d3ef7e -c 3:"nvme" ${TEMP_FILE}
-    #[4: fip: 20M-32M]
-    fakeroot ${SGDISK} -n 4:0:+12M -t 3:0700 -u 4:dc1a888e-f17c-4964-92d6-f8fcc402ed8b -c 4:"fip" ${TEMP_FILE}
-    #[5: cache: 32M-288M]
-    fakeroot ${SGDISK} -n 5:0:+256M -t 5:0700 -u 5:10cc3268-05f0-4db2-aa00-707361427fc8 -c 5:"cache" ${TEMP_FILE}
-    #[6: fw_lpm3: 288M-289M]
-    fakeroot ${SGDISK} -n 6:0:+1M -t 6:0700 -u 6:5d8481d4-c170-4aa8-9438-8743c73ea8f5 -c 6:"fw_lpm3" ${TEMP_FILE}
-    #[7: boot: 289M-353M]
-    fakeroot ${SGDISK} -n 7:0:+64M -t 7:EF00 -u 7:d3340696-9b95-4c64-8df6-e6d4548fba41 -c 7:"boot" ${TEMP_FILE}
-    #[8: dts: 353M-369M]
-    fakeroot ${SGDISK} -n 8:0:+16M -t 8:0700 -u 8:6e53b0bb-fa7e-4206-b607-5ae699e9f066 -c 8:"dts" ${TEMP_FILE}
-    #[9: trustfirmware: 369M-371M]
-    fakeroot ${SGDISK} -n 9:0:+2M -t 9:0700 -u 9:f1e126a6-ceef-45c1-aace-29f33ac9cf13 -c 9:"trustfirmware" ${TEMP_FILE}
-    #[10: system: 371M-5059M]
-    fakeroot ${SGDISK} -n 10:0:+4688M -t 10:8300 -u 10:c3e50923-fb85-4153-b925-759614d4dfcd -c 10:"system" ${TEMP_FILE}
-    #[11: vendor: 5059M-5843M]
-    fakeroot ${SGDISK} -n 11:0:+784M -t 11:0700 -u 11:919d7080-d71a-4ae1-9227-e4585210c837 -c 11:"vendor" ${TEMP_FILE}
-    #[12: reserved: 5843M-5844M]
-    fakeroot ${SGDISK} -n 12:0:+1M -t 12:0700 -u 12:611eac6b-bc42-4d72-90ac-418569c8e9b8 -c 12:"reserved" ${TEMP_FILE}
-    case ${PTABLE} in
-      aosp-32g)
-        #[13: userdata: 5844M-End]
-        fakeroot ${SGDISK} -n -E -t 13:8300 -u 13:fea80d9c-f3e3-45d9-aed0-1d06e4abd77f -c 13:"userdata" ${TEMP_FILE}
-        ;;
-      aosp-32g-spare)
-        #[13: userdata: 5844M-9844M]
-        fakeroot ${SGDISK} -n 13:0:+1000M -t 13:8300 -u 13:fea80d9c-f3e3-45d9-aed0-1d06e4abd77f -c 13:"userdata" ${TEMP_FILE}
-        #[14: swap: 9844M-End]
-        fakeroot ${SGDISK} -n -E -t 14:8300 -u 14:9501eade-20fb-4bc7-83d3-62c1be3ed92d -c 14:"swap" ${TEMP_FILE}
-        ;;
-    esac
-    ;;
-  linux-32g|linux-64g)
-    dd if=/dev/zero of=${TEMP_FILE} bs=${SECTOR_SIZE} count=${SECTOR_NUMBER} conv=sparse
-    fakeroot ${SGDISK} -U 2CB85345-6A91-4043-8203-723F0D28FBE8 -v ${TEMP_FILE}
-    #[1: vrl: 1M-2M]
-    fakeroot ${SGDISK} -n 1:0:+1M -t 1:0700 -u 1:697c41e0-7a59-4dfa-a9a6-aa43ac5be684 -c 1:"vrl" ${TEMP_FILE}
-    #[2: fastboot: 2M-14M]
-    fakeroot ${SGDISK} -n 2:0:+12M -t 2:0700 -u 2:3f5f8c48-4402-4ace-9058-30bfea4fa53f -c 2:"fastboot" ${TEMP_FILE}
-    #[3: nvme: 14M-20M]
-    fakeroot ${SGDISK} -n 3:0:+6M -t 3:0700 -u 3:e2f5e2a9-c9b7-4089-9859-4498f1d3ef7e -c 3:"nvme" ${TEMP_FILE}
-    #[4: fip: 20M-32M]
-    fakeroot ${SGDISK} -n 4:0:+12M -t 3:0700 -u 4:dc1a888e-f17c-4964-92d6-f8fcc402ed8b -c 4:"fip" ${TEMP_FILE}
-    #[5: cache: 32M-288M]
-    fakeroot ${SGDISK} -n 5:0:+256M -t 5:0700 -u 5:10cc3268-05f0-4db2-aa00-707361427fc8 -c 5:"cache" ${TEMP_FILE}
-    #[6: fw_lpm3: 288M-289M]
-    fakeroot ${SGDISK} -n 6:0:+1M -t 6:0700 -u 6:5d8481d4-c170-4aa8-9438-8743c73ea8f5 -c 6:"fw_lpm3" ${TEMP_FILE}
-    #[7: boot: 289M-353M]
-    fakeroot ${SGDISK} -n 7:0:+64M -t 7:EF00 -u 7:d3340696-9b95-4c64-8df6-e6d4548fba41 -c 7:"boot" ${TEMP_FILE}
-    #[8: dts: 353M-369M]
-    fakeroot ${SGDISK} -n 8:0:+16M -t 8:0700 -u 8:6e53b0bb-fa7e-4206-b607-5ae699e9f066 -c 8:"dts" ${TEMP_FILE}
-    #[9: trustfirmware: 369M-371M]
-    fakeroot ${SGDISK} -n 9:0:+2M -t 9:0700 -u 9:f1e126a6-ceef-45c1-aace-29f33ac9cf13 -c 9:"trustfirmware" ${TEMP_FILE}
-    #[10: system: 371M-5059M]
-    fakeroot ${SGDISK} -n 10:0:+4688M -t 10:8300 -u 10:c3e50923-fb85-4153-b925-759614d4dfcd -c 10:"system" ${TEMP_FILE}
-    #[11: vendor: 5059M-5843M]
-    fakeroot ${SGDISK} -n 11:0:+784M -t 11:0700 -u 11:919d7080-d71a-4ae1-9227-e4585210c837 -c 11:"vendor" ${TEMP_FILE}
-    #[12: reserved: 5843M-5844M]
-    fakeroot ${SGDISK} -n 12:0:+1M -t 12:0700 -u 12:611eac6b-bc42-4d72-90ac-418569c8e9b8 -c 12:"reserved" ${TEMP_FILE}
-    ;;
-esac
-
-# get the primary partition table
-dd if=${TEMP_FILE} of=prm_ptable.img bs=${SECTOR_SIZE} count=${PRIMARY_SECTORS}
-
-BK_PTABLE_LBA=$(expr ${SECTOR_NUMBER} - ${SECONDARY_SECTORS})
-dd if=${TEMP_FILE} of=sec_ptable.img skip=${BK_PTABLE_LBA} bs=${SECTOR_SIZE} count=${SECONDARY_SECTORS}
-
-rm -f ${TEMP_FILE}
diff --git a/l-loader/hikey.mk b/l-loader/hikey.mk
deleted file mode 100644
index 16c1d97..0000000
--- a/l-loader/hikey.mk
+++ /dev/null
@@ -1,31 +0,0 @@
-CROSS_COMPILE?=arm-linux-gnueabihf-
-CC=$(CROSS_COMPILE)gcc
-LD=$(CROSS_COMPILE)ld
-OBJCOPY=$(CROSS_COMPILE)objcopy
-CFLAGS=-march=armv7-a
-
-BL1=bl1.bin
-NS_BL1U=recovery-fastboot.bin
-PTABLE_LST?=aosp-8g aosp-4g
-
-.PHONY: all
-all: l-loader.bin prm_ptable.img
-
-%.o: %.S
-	$(CC) $(CFLAGS) -c -o $@ $<
-
-l-loader.bin: start.o $(BL1) $(NS_BL1U)
-	$(LD) -Bstatic -Tl-loader.lds -Ttext 0xf9800800 start.o -o loader
-	$(OBJCOPY) -O binary loader temp
-	python gen_loader_hikey.py -o $@ --img_loader=temp --img_bl1=$(BL1) --img_ns_bl1u=$(NS_BL1U)
-	rm -f loader temp
-
-prm_ptable.img:
-	for ptable in $(PTABLE_LST); do \
-		PTABLE=$${ptable} SECTOR_SIZE=512 bash -x generate_ptable.sh;\
-		cp prm_ptable.img ptable-$${ptable}.img;\
-	done
-
-.PHONY: clean
-clean:
-	rm -f *.o *.img l-loader.bin
diff --git a/l-loader/hikey960.mk b/l-loader/hikey960.mk
deleted file mode 100644
index e378b75..0000000
--- a/l-loader/hikey960.mk
+++ /dev/null
@@ -1,19 +0,0 @@
-BL1=bl1.bin
-NS_BL1U=BL33_AP_UEFI.fd
-PTABLE_LST:=aosp-32g aosp-32g-spare linux-32g
-
-.PHONY: all
-all: l-loader.bin prm_ptable.img
-
-l-loader.bin: $(BL1) $(NS_BL1U)
-	python gen_loader_hikey960.py -o $@ --img_bl1=$(BL1) --img_ns_bl1u=$(NS_BL1U)
-
-prm_ptable.img:
-	for ptable in $(PTABLE_LST); do \
-		PTABLE=$${ptable} SECTOR_SIZE=4096 SGDISK=./sgdisk bash -x generate_ptable.sh;\
-		cp prm_ptable.img ptable-$${ptable}.img;\
-	done
-
-.PHONY: clean
-clean:
-	rm -f *.img l-loader.bin
diff --git a/l-loader/l-loader.lds b/l-loader/l-loader.lds
deleted file mode 100644
index 41eb16f..0000000
--- a/l-loader/l-loader.lds
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Copyright (c) 2014 Linaro Ltd.
- */
-
-OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
-OUTPUT_ARCH(arm)
-ENTRY(_start)
-SECTIONS
-{
-	. = 0xf9800800;
-	LLOADER_START = .;
-
-	.text :
-	{
-		*(.text)
-		*(.rodata)
-	}
-
-	.data ALIGN(4):
-	{
-		*(.data)
-	}
-
-	. = ALIGN(4);
-
-	.bss ALIGN(4):
-	{
-		*(.bss)
-	}
-
-	LLOADER_BL1_BIN = 0xf9801000;
-}
diff --git a/l-loader/recovery-fastboot.bin b/l-loader/recovery-fastboot.bin
deleted file mode 100755
index fe56262..0000000
--- a/l-loader/recovery-fastboot.bin
+++ /dev/null
Binary files differ
diff --git a/l-loader/start.S b/l-loader/start.S
deleted file mode 100644
index a0d838a..0000000
--- a/l-loader/start.S
+++ /dev/null
@@ -1,100 +0,0 @@
-	.text
-
-/*
- * The head of l-loader is defined in below.
- * struct l_loader_head {
- *	unsigned int	first_instr;
- *	unsigned char	magic[16];	@ BOOTMAGICNUMBER!
- *	unsigned int	l_loader_start;
- *	unsigned int	l_loader_end;
- * };
- */
-
-#define CPU0_CTRL_OFFSET		0x100
-#define CPU7_CTRL_OFFSET		0x800
-#define CPU0_RVBARADDR_OFFSET		0x158
-#define CPU7_RVBARADDR_OFFSET		0x858
-
-#define CPU_CTRL_AARCH64_MODE		(1 << 7)
-
-#define SC_PERIPH_CLKEN3		0x230
-#define SC_PERIPH_RSTDIS3		0x334
-	.global	_start
-_start:
-	b	reset
-@ Android magic number: "BOOTMAGICNUMBER!"
-android_magic:
-	.word	0x544f4f42
-	.word	0x4947414d
-	.word	0x4d554e43
-	.word	0x21524542
-	.word	LLOADER_START		@ LLOADER_START in RAM
-	.word	0			@ LLOADER_END in RAM
-
-entries:
-	@ 5 entries with 7 words
-	.space	140
-
-	.align	7
-
-reset:
-	ldr	r8, =(0xf9800000 + 0x700)
-	str	r0, [r8]		@ download mode (1:usb,2:uart,0:boot)
-
-	ldr	r4, =0xf6504000		@ ACPU_CTRL register base
-	@ set RVBAR for cpu0
-	ldr	r5, =CPU0_RVBARADDR_OFFSET
-	ldr	r6, =LLOADER_BL1_BIN
-	mov	r6, r6, lsr #2
-	str	r6, [r4, r5]
-1:
-	ldr	r0, [r4, r5]
-	cmp	r0, r6
-	bne	1b
-
-	mov	r5, #CPU0_CTRL_OFFSET
-	mov	r6, #CPU7_CTRL_OFFSET
-2:
-	ldr	r0, [r4, r5]		@ Load ACPU_SC_CPUx_CTRL
-	orr	r0, r0, #CPU_CTRL_AARCH64_MODE
-	str	r0, [r4, r5]		@ Save to ACPU_SC_CPUx_CTRL
-	ldr	r0, [r4, r5]
-
-	add	r5, r5, #0x100		@ Iterate ACPU_SC_CPUx_CTRL
-	cmp	r5, r6
-	ble	2b
-
-	/*
-	 * Prepare UART2 & UART3 without baud rate initialization.
-	 * So always output on UART0 in l-loader.
-	 */
-	ldr	r4, =0xf70100e0		@ UART2_RXD IOMG register
-	mov	r0, #0
-	str	r0, [r4]
-	str	r0, [r4, #4]		@ UART2_TXD IOMG register
-	ldr	r0, [r4]
-
-	ldr	r4, =0xf7010188		@ UART3_RXD IOMG register
-	mov	r0, #1
-	str	r0, [r4]
-	str	r0, [r4, #4]		@ UART3_TXD IOMG register
-	ldr	r1, [r4]
-
-	ldr	r4, =0xf7030000		@ PERI_CTRL register base
-	@ By default, CLK_TXCO is the parent of CLK_UART3 in SC_CLK_SEL0
-
-	ldr	r5, =SC_PERIPH_RSTDIS3	@ unreset
-	ldr	r6, =SC_PERIPH_CLKEN3	@ enable PCLK
-	mov	r0, #(3 << 6)		@ bit'6' & bit'7' (UART2 & UART3)
-	str	r0, [r4, r5]
-	str	r0, [r4, r6]
-
-	@ execute warm reset to switch aarch64
-	mov	r2, #3
-	mcr	p15, 0, r2, c12, c0, 2
-	wfi
-panic:
-	b	panic
-
-str_aarch64:
-	.asciz	"\nSwitch to aarch64 mode. CPU0 executes at 0x"
diff --git a/uefi-tools/atf-build.sh b/uefi-tools/atf-build.sh
deleted file mode 100755
index 65d4dbc..0000000
--- a/uefi-tools/atf-build.sh
+++ /dev/null
@@ -1,239 +0,0 @@
-#!/bin/bash
-#
-# Builds ARM Trusted Firmware, and generates FIPs with UEFI and optionally
-# Trusted OS for the supported platforms.
-# Not intended to be called directly, invoked from uefi-build.sh.
-#
-# Board configuration is extracted from
-# parse-platforms.py and platforms.config.
-#
-
-. "$TOOLS_DIR"/common-functions
-OUTPUT_DIR="$PWD"/uefi-build
-
-ATF_BUILDVER=1
-
-function usage
-{
-	echo "usage:"
-	echo "atf-build.sh -e <EDK2 source directory> -t <UEFI build profile/toolchain> <platform>"
-	echo
-}
-
-function check_atf_buildver
-{
-	MAJOR=`grep "^VERSION_MAJOR" Makefile | sed 's/.*:= *\([0-9]*\).*/\1/'`
-	[ $? -ne 0 ] && return 1
-	MINOR=`grep "^VERSION_MINOR" Makefile | sed 's/.*:= *\([0-9]*\).*/\1/'`
-	[ $? -ne 0 ] && return 1
-
-	if [ "$MAJOR" -eq 1 -a "$MINOR" -ge 2 ]; then
-		ATF_BUILDVER=2
-	fi
-}
-
-function build_platform
-{
-	if [ X"$EDK2_DIR" = X"" ];then
-		echo "EDK2_DIR not set!" >&2
-		return 1
-	fi
-
-	check_atf_buildver || return 1
-
-	BUILD_ATF="`$TOOLS_DIR/parse-platforms.py $PLATFORM_CONFIG -p $1 get -o build_atf`"
-	if [ X"$BUILD_ATF" = X"" ]; then
-		echo "Platform '$1' is not configured to build ARM Trusted Firmware."
-		return 0
-	fi
-
-	ATF_PLATFORM="`$TOOLS_DIR/parse-platforms.py $PLATFORM_CONFIG -p $1 get -o atf_platform`"
-	if [ X"$ATF_PLATFORM" = X"" ]; then
-		ATF_PLATFORM=$1
-	fi
-
-	#
-	# Read platform configuration
-	#
-	PLATFORM_NAME="`$TOOLS_DIR/parse-platforms.py $PLATFORM_CONFIG -p $1 get -o longname`"
-	PLATFORM_ARCH="`$TOOLS_DIR/parse-platforms.py $PLATFORM_CONFIG -p $1 get -o arch`"
-	PLATFORM_IMAGE_DIR="`$TOOLS_DIR/parse-platforms.py $PLATFORM_CONFIG -p $1 get -o uefi_image_dir`"
-	PLATFORM_BUILDFLAGS="`$TOOLS_DIR/parse-platforms.py $PLATFORM_CONFIG -p $1 get -o atf_buildflags`"
-
-	if [ $VERBOSE -eq 1 ]; then
-		echo "PLATFORM_NAME=$PLATFORM_NAME"
-		echo "PLATFORM_ARCH=$PLATFORM_ARCH"
-		echo "PLATFORM_IMAGE_DIR=$PLATFORM_IMAGE_DIR"
-		echo "PLATFORM_BUILDFLAGS=$PLATFORM_BUILDFLAGS"
-	fi
-
-	unset BL30 BL31 BL32 BL33
-	BL30="`$TOOLS_DIR/parse-platforms.py $PLATFORM_CONFIG -p $1 get -o scp_bin`"
-	if [ $ATF_BUILDVER -gt 1 ]; then
-		unset SCP_BL2
-		SCP_BL2=`search_packages_path "$BL30"`
-	fi
-	BL31="`$TOOLS_DIR/parse-platforms.py $PLATFORM_CONFIG -p $1 get -o el3_bin`"
-	BL33="$WORKSPACE/Build/$PLATFORM_IMAGE_DIR/$BUILD_PROFILE/FV/`$TOOLS_DIR/parse-platforms.py $PLATFORM_CONFIG -p $1 get -o uefi_bin`"
-
-	#
-	# Set up cross compilation variables (if applicable)
-	#
-	set_cross_compile
-	CROSS_COMPILE="$TEMP_CROSS_COMPILE"
-	echo "Building ARM Trusted Firmware for $PLATFORM_NAME - $BUILD_PROFILE"
-	echo "CROSS_COMPILE=\"$TEMP_CROSS_COMPILE\""
-
-	if [ X"$BL30" != X"" ]; then
-		BL30=`search_packages_path "$BL30"`
-	fi
-	if [ X"$BL31" != X"" ]; then
-		BL31=`search_packages_path "$BL31"`
-	fi
-
-	#
-	# BL32 requires more attention
-	# If TOS_DIR is not set, we assume user does not want a Trusted OS,
-	# even if the source directory and/or binary for it exists
-	#
-	if [ X"$TOS_DIR" != X"" ]; then
-		SPD="`$TOOLS_DIR/parse-platforms.py $PLATFORM_CONFIG -p $1 get -o atf_spd`"
-
-		TOS_BIN="`$TOOLS_DIR/parse-platforms.py $PLATFORM_CONFIG -p $1 get -o tos_bin`"
-		if [ X"$TOS_BIN" != X"" ]; then
-			BL32=$WORKSPACE/Build/$PLATFORM_IMAGE_DIR/$BUILD_PROFILE/FV/$TOS_BIN
-		fi
-
-		if [ X"$SPD" != X"" ] && [ X"$BL32" != X"" ]; then
-			#
-			# Since SPD cannot be exported or undefined,
-			# we parametrise it here
-			#
-			SPD_OPTION="SPD=$SPD"
-		else
-			echo "WARNING:	Proceeding without Trusted OS!"
-			echo "		Please specify both ATF_SPD and TOS_BIN"
-			echo "		if you wish to use a Trusted OS!"
-		fi
-	else
-	#
-	# Since TOS_DIR is not set, user does not want a Trusted OS
-	# even if the source directory and/or binary for it exists.
-	# Next, Check whether user wants secure partition image.
-	# If SPM_BIN is set then include pre-built secure partition image as a
-	# BL32 Image and implicitly set SPM=1.
-	#
-		SPM_BIN="`$TOOLS_DIR/parse-platforms.py $PLATFORM_CONFIG -p $1 get -o spm_bin`"
-
-		if [ X"$SPM_BIN" != X"" ]; then
-			BL32=$WORKSPACE/Build/StandaloneSmmPkg/$BUILD_PROFILE/FV/$SPM_BIN
-			PLATFORM_BUILDFLAGS="$PLATFORM_BUILDFLAGS SPM=1"
-		fi
-	# We assume that user does not want secure partition either.
-	# Todo: Revisit if either one of Trusted OS or Secure Partition Image is Mandatory.
-	fi
-
-
-
-	#
-	# Debug extraction handling
-	#
-	case "$BUILD_ATF" in
-	debug*)
-		DEBUG=1
-		BUILD_TYPE="debug"
-		;;
-	*)
-		DEBUG=0
-		BUILD_TYPE="release"
-		;;
-	esac
-
-	export BL30 BL31 BL32 BL33
-
-	echo "BL30=$BL30"
-	if [ $ATF_BUILDVER -gt 1 ] && [ X"$BL30" != X"" ]; then
-		export SCP_BL2
-		echo "SCP_BL2=$BL30"
-	fi
-	echo "BL31=$BL31"
-	echo "BL32=$BL32"
-	echo "BL33=$BL33"
-	echo "$SPD_OPTION"
-	echo "BUILD_TYPE=$BUILD_TYPE"
-
-	#
-	# If a build was done with BL32, and followed by another without,
-	# the BL32 component remains in fip.bin, so we delete the build dir
-	# contents before calling make
-	#
-	rm -rf build/"$ATF_PLATFORM/$BUILD_TYPE"/*
-
-	#
-	# Build ARM Trusted Firmware and create FIP
-	#
-	if [ $VERBOSE -eq 1 ]; then
-		echo "Calling ARM Trusted Firmware build:"
-		echo "CROSS_COMPILE="$CROSS_COMPILE" make -j$NUM_THREADS PLAT="$ATF_PLATFORM" $SPD_OPTION DEBUG=$DEBUG ${PLATFORM_BUILDFLAGS} all fip"
-	fi
-	CROSS_COMPILE="$CROSS_COMPILE" make -j$NUM_THREADS PLAT="$ATF_PLATFORM" $SPD_OPTION DEBUG=$DEBUG ${PLATFORM_BUILDFLAGS} all fip
-	if [ $? -eq 0 ]; then
-		#
-		# Copy resulting images to UEFI image dir
-		#
-		if [ $VERBOSE -eq 1 ]; then
-			echo "Copying bl1.bin and fip.bin to "$WORKSPACE/Build/$PLATFORM_IMAGE_DIR/$BUILD_PROFILE/FV/""
-		fi
-		cp -a build/"$ATF_PLATFORM/$BUILD_TYPE"/{bl1,fip}.bin "$WORKSPACE/Build/$PLATFORM_IMAGE_DIR/$BUILD_PROFILE/FV/"
-	else
-		return 1
-	fi
-}
-
-# Check to see if we are in a trusted firmware directory
-# refuse to continue if we aren't
-if [ ! -d bl32 ]
-then
-	echo "ERROR: we aren't in the arm-trusted-firmware directory."
-	usage
-	exit 1
-fi
-
-build=
-
-if [ $# = 0 ]
-then
-	usage
-	exit 1
-else
-	while [ "$1" != "" ]; do
-		case $1 in
-			"-e" )
-				shift
-				EDK2_DIR="$1"
-				;;
-			"/h" | "/?" | "-?" | "-h" | "--help" )
-				usage
-				exit
-				;;
-			"-t" )
-				shift
-				BUILD_PROFILE="$1"
-				;;
-			* )
-				build="$1"
-				;;
-		esac
-		shift
-	done
-fi
-
-if [ X"$build" = X"" ]; then
-	echo "No platform specified!" >&2
-	echo
-	usage
-	exit 1
-fi
-
-build_platform $build
-exit $?
diff --git a/uefi-tools/common-functions b/uefi-tools/common-functions
deleted file mode 100644
index 9d01ae1..0000000
--- a/uefi-tools/common-functions
+++ /dev/null
@@ -1,214 +0,0 @@
-#!/bin/bash
-
-RESULT_BUF=`echo -e ------------------------------------------------------------`
-RESULT_PASS_COUNT=0
-RESULT_FAIL_COUNT=0
-
-function result_log
-{
-	if [ $1 -eq 0 ]; then
-		RESULT_BUF="`printf \"%s\n%55s\tpass\" \"$RESULT_BUF\" \"$2\"`"
-		RESULT_PASS_COUNT=$(($RESULT_PASS_COUNT + 1))
-	else
-		RESULT_BUF="`printf \"%s\n%55s\tfail\" \"$RESULT_BUF\" \"$2\"`"
-		RESULT_FAIL_COUNT=$(($RESULT_FAIL_COUNT + 1))
-	fi
-}
-
-function result_print
-{
-	printf "%s" "$RESULT_BUF"
-	echo -e "\n------------------------------------------------------------"
-	printf "pass\t$RESULT_PASS_COUNT\n"
-	printf "fail\t$RESULT_FAIL_COUNT\n"
-
-	exit $RESULT_FAIL_COUNT
-}
-
-function get_build_arch
-{
-	case `uname -m` in
-	    arm*)
-	        BUILD_ARCH=ARM;;
-	    aarch64*)
-	        BUILD_ARCH=AARCH64;;
-	    i?86*)
-		BUILD_ARCH=IA32;;
-	    x86_64*)
-		BUILD_ARCH=X64;;
-	    *)
-	        BUILD_ARCH=other;;
-	esac
-}
-
-function set_cross_compile
-{
-	get_build_arch
-
-	echo "Target: $PLATFORM_ARCH"
-	echo "Build: $BUILD_ARCH"
- 	if [ "$PLATFORM_ARCH" = "$BUILD_ARCH" ]; then
-	    TEMP_CROSS_COMPILE=
-	else
-	    case "$PLATFORM_ARCH" in
-		AARCH64)
-                    if [ X"$CROSS_COMPILE_64" != X"" ]; then
-                        TEMP_CROSS_COMPILE="$CROSS_COMPILE_64"
-                    else
-                        TEMP_CROSS_COMPILE=aarch64-linux-gnu-
-                    fi
-                ;;
-		ARM)
-		    TEMP_CROSS_COMPILE=arm-linux-gnueabihf- ;;
-		IA32)
-		    TEMP_CROSS_COMPILE=x86_64-linux-gnu-
-		    for family in 6 5 4 3; do
-		        if i$family86-linux-gnu-as -version >/dev/null 2>&1;then
-		            TEMP_CROSS_COMPILE=i$family86-linux-gnu-
-		            break
-		        fi
-		    done
-		;;
-		X64)
-		    TEMP_CROSS_COMPILE=x86_64-linux-gnu- ;;
-		*)
-	            echo "Unsupported target architecture '$PLATFORM_ARCH'!" >&2
-		;;
-	    esac
-	fi
-}
-
-function get_gcc_version
-{
-	$1 -v >/dev/null 2>&1 || return 1
-	gcc_version=$($1 -dumpversion)
-	MAJVER=`echo $gcc_version | cut -d. -f1`
-
-	case $gcc_version in
-		4*)
-			echo GCC$(echo ${gcc_version} | awk -F. '{print $1$2}')
-			;;
-		*)
-			if [ "$MAJVER" -ge 5 ]; then
-			    # We only have a GCC5 build profile for now, so...
-			    # echo GCC$MAJVER
-			    echo GCC5
-			else
-			    echo "Unknown toolchain version '$gcc_version'" >&2
-			    echo "Attempting to build using GCC49 profile." >&2
-			    echo GCC49
-			fi
-			;;
-	esac
-
-	return 0
-}
-
-function get_clang_version
-{
-	clang_version=`$1 --version | head -1 | sed 's/^.*version\s*\([0-9]*\).\([0-9]*\).*/\1\2/g'`
-	case $clang_version in
-		35*)
-			echo "CLANG$clang_version"
-			;;
-		*)
-			echo "Unknown toolchain version '$clang_version'" >&2
-			echo "Attempting to build using CLANG35 profile." >&2
-			echo CLANG35
-			;;
-	esac
-}
-
-function download_patch_openssl
-{
-    OPENSSL_VER=`ls EDKII_openssl-*.patch | sed 's/^.*-\([0-9.a-z]*\).patch/\1/'`
-    OPENSSL_TAR=openssl-${OPENSSL_VER}.tar.gz
-    OPENSSL_URL=http://www.openssl.org/source/${OPENSSL_TAR}
-    OPENSSL_DIR=openssl-${OPENSSL_VER}
-    OPENSSL_PATCH=EDKII_openssl-${OPENSSL_VER}.patch
-
-    if [ -e "$WORKSPACE"/CryptoPkg/Include/openssl/opensslconf.h ]; then
-        echo "OpenSSL already imported!"
-        return 0
-    fi
-
-    # Use cached copy if available
-    if [ -f "$WORKSPACE"/LinaroPkg/"$OPENSSL_TAR" ]; then
-	tar xzf "$WORKSPACE"/LinaroPkg/"$OPENSSL_TAR"
-    else
-	wget -O - -q ${OPENSSL_URL} | tar xzf -
-    fi
-
-    echo "Importing OpenSSL $OPENSSL_VER"
-    ( cd ${OPENSSL_DIR}; patch -p1 -i ../${OPENSSL_PATCH} )
-    ./Install.sh
-
-    if [ $? -eq 0 ]; then
-	OPENSSL_CONFIGURED=TRUE
-    else
-	echo "OpenSSL $OPENSSL_VER import failed!" >&2
-	rm -rf $OPENSSL_TAR $OPENSSL_DIR
-	return 1
-    fi
-}
-
-function clone_process_openssl
-{
-    if [ -e openssl/include/openssl/opensslconf.h ]; then
-        echo "OpenSSL already imported!"
-        return 0
-    fi
-
-    OPENSSL_VER=`git ls-remote --tags git://github.com/openssl/openssl.git | awk '{print $2;}' | sed 's-^refs/tags/--g' | grep -v '\^{}$' | grep '^OpenSSL' | grep -v '^OpenSSL_FIPS' | tail -1 | sed -n 's/^OpenSSL_\([0-9]*\)_\([0-9]*\)_\([0-9.a-z]*\)$/openssl-\1.\2.\3\n/p'`
-    OPENSSL_TAR="$OPENSSL_VER.tar.gz"
-    if [ -z "$OPENSSL_TAR" ]; then
-        return 1
-    fi
-    OPENSSL_URL=http://www.openssl.org/source/${OPENSSL_TAR}
-    if [ ! -f "$OPENSSL_TAR" ]; then
-        wget -q ${OPENSSL_URL}
-    else
-        rm -rf openssl
-    fi
-    tar xzf "$OPENSSL_TAR"
-    mv "$OPENSSL_VER" openssl
-    # perl process_files.pl # not needed and not currently working
-    return $?
-}
-
-function import_openssl
-{
-    # Don't re-import if already done
-    if [ "$OPENSSL_CONFIGURED" = "TRUE" ]; then
-	echo "Using existing OpenSSL $OPENSSL_VER"
-	return 0
-    fi
-
-    cd CryptoPkg/Library/OpensslLib/
-    if [ -f EDKII_openssl-*.patch ]; then
-        download_patch_openssl
-    else
-        clone_process_openssl
-    fi
-    RET=$?
-    cd - >/dev/null
-    return $RET
-}
-
-function search_packages_path
-{
-    file="$1"
-
-    IFS=:
-    for dir in $PACKAGES_PATH; do
-	if [ -e "$dir/$file" ]; then
-	    echo "$dir/$file"
-	    unset IFS
-	    return 0
-	fi
-    done
-
-    echo "$file not found in any directory on PACKAGES_PATH!" >&2
-    unset IFS
-    return 1
-}
diff --git a/uefi-tools/edk2-build.sh b/uefi-tools/edk2-build.sh
deleted file mode 100755
index 3e218b3..0000000
--- a/uefi-tools/edk2-build.sh
+++ /dev/null
@@ -1,401 +0,0 @@
-#!/bin/bash
-
-#
-# edk2-build.sh: evolution of uefi-build.sh for edk2-platforms
-#
-
-unset MAKEFLAGS  # BaseTools not safe to build parallel, prevent env overrides
-
-TOOLS_DIR="`dirname $0`"
-TOOLS_DIR="`readlink -f \"$TOOLS_DIR\"`"
-export TOOLS_DIR
-. "$TOOLS_DIR"/common-functions
-PLATFORM_CONFIG="-c $TOOLS_DIR/edk2-platforms.config"
-ARCH=
-VERBOSE=0                  # Override with -v
-ATF_DIR=
-TOS_DIR=
-TOOLCHAIN="gcc"            # Override with -T
-WORKSPACE=
-EDK2_DIR=
-PLATFORMS_DIR=
-NON_OSI_DIR=
-IMPORT_OPENSSL=TRUE
-OPENSSL_CONFIGURED=FALSE
-
-# Number of threads to use for build
-export NUM_THREADS=$((`getconf _NPROCESSORS_ONLN` + `getconf _NPROCESSORS_ONLN`))
-
-function do_build
-{
-	PLATFORM_ARCH=`echo $board | cut -s -d: -f2`
-	if [ -n "$PLATFORM_ARCH" ]; then
-		board=`echo $board | cut -d: -f1`
-	else
-		PLATFORM_ARCH="`$TOOLS_DIR/parse-platforms.py $PLATFORM_CONFIG -p $board get -o arch`"
-	fi
-	PLATFORM_NAME="`$TOOLS_DIR/parse-platforms.py $PLATFORM_CONFIG -p $board get -o longname` ($PLATFORM_ARCH)"
-	if [ -z "$PLATFORM_ARCH" ]; then
-		echo "Unknown target architecture - aborting!" >&2
-		return 1
-	fi
-	PLATFORM_PREBUILD_CMDS="`$TOOLS_DIR/parse-platforms.py $PLATFORM_CONFIG -p $board get -o prebuild_cmds`"
-	PLATFORM_BUILDFLAGS="`$TOOLS_DIR/parse-platforms.py $PLATFORM_CONFIG -p $board get -o buildflags`"
-	PLATFORM_BUILDFLAGS="$PLATFORM_BUILDFLAGS ${EXTRA_OPTIONS[@]}"
-	PLATFORM_BUILDCMD="`$TOOLS_DIR/parse-platforms.py $PLATFORM_CONFIG -p $board get -o buildcmd`"
-	PLATFORM_DSC="`$TOOLS_DIR/parse-platforms.py $PLATFORM_CONFIG -p $board get -o dsc`"
-	PLATFORM_PACKAGES_PATH=""
-	COMPONENT_INF="`$TOOLS_DIR/parse-platforms.py $PLATFORM_CONFIG -p $board get -o inf`"
-
-	TEMP_PACKAGES_PATH="$GLOBAL_PACKAGES_PATH:`$TOOLS_DIR/parse-platforms.py $PLATFORM_CONFIG -p $board get -o packages_path`"
-	IFS=:
-	for path in "$TEMP_PACKAGES_PATH"; do
-		case "$path" in
-			/*)
-				PLATFORM_PACKAGES_PATH="$PLATFORM_PACKAGES_PATH:$path"
-			;;
-			*)
-				PLATFORM_PACKAGES_PATH="$PLATFORM_PACKAGES_PATH:$PWD/$path"
-			;;
-	        esac
-	done
-	unset IFS
-
-	if [ $VERBOSE -eq 1 ]; then
-		echo "Setting build parallellism to $NUM_THREADS processes"
-		echo "PLATFORM_NAME=$PLATFORM_NAME"
-		echo "PLATFORM_PREBUILD_CMDS=$PLATFORM_PREBUILD_CMDS"
-		echo "PLATFORM_BUILDFLAGS=$PLATFORM_BUILDFLAGS"
-		echo "PLATFORM_BUILDCMD=$PLATFORM_BUILDCMD"
-		echo "PLATFORM_DSC=$PLATFORM_DSC"
-		echo "PLATFORM_ARCH=$PLATFORM_ARCH"
-		echo "PLATFORM_PACKAGES_PATH=$PLATFORM_PACKAGES_PATH"
-	fi
-
-	set_cross_compile
-	CROSS_COMPILE="$TEMP_CROSS_COMPILE"
-
-	echo "Building $PLATFORM_NAME - $PLATFORM_ARCH"
-	echo "CROSS_COMPILE=\"$TEMP_CROSS_COMPILE\""
-	echo "$board"_BUILDFLAGS="'$PLATFORM_BUILDFLAGS'"
-
-	if [ "$TARGETS" == "" ]; then
-		TARGETS=( RELEASE )
-	fi
-
-	case $TOOLCHAIN in
-		"gcc")
-			PLATFORM_TOOLCHAIN=`get_gcc_version "$CROSS_COMPILE"gcc`
-			;;
-		"clang")
-			PLATFORM_TOOLCHAIN=`get_clang_version clang`
-			;;
-		*)
-			# Use command-line specified profile directly
-			PLATFORM_TOOLCHAIN=$TOOLCHAIN
-			;;
-	esac
-	echo "PLATFORM_TOOLCHAIN is ${PLATFORM_TOOLCHAIN}"
-
-	export ${PLATFORM_TOOLCHAIN}_${PLATFORM_ARCH}_PREFIX=$CROSS_COMPILE
-	echo "Toolchain prefix: ${PLATFORM_TOOLCHAIN}_${PLATFORM_ARCH}_PREFIX=$CROSS_COMPILE"
-
-	export PACKAGES_PATH="$PLATFORM_PACKAGES_PATH"
-	for target in "${TARGETS[@]}" ; do
-		if [ X"$PLATFORM_PREBUILD_CMDS" != X"" ]; then
-			echo "Run pre-build commands:"
-			if [ $VERBOSE -eq 1 ]; then
-				echo "  ${PLATFORM_PREBUILD_CMDS}"
-			fi
-			eval ${PLATFORM_PREBUILD_CMDS}
-		fi
-
-		if [ -n "$COMPONENT_INF" ]; then
-			# Build a standalone component
-			if [ $VERBOSE -eq 1 ]; then
-				echo "build -n $NUM_THREADS -a \"$PLATFORM_ARCH\" -t ${PLATFORM_TOOLCHAIN} -p \"$PLATFORM_DSC\"" \
-					"-m \"$COMPONENT_INF\" -b "$target" ${PLATFORM_BUILDFLAGS}"
-			fi
-			build -n $NUM_THREADS -a "$PLATFORM_ARCH" -t ${PLATFORM_TOOLCHAIN} -p "$PLATFORM_DSC" \
-				-m "$COMPONENT_INF" -b "$target" ${PLATFORM_BUILDFLAGS}
-		else
-			# Build a platform
-			if [ $VERBOSE -eq 1 ]; then
-				echo "build -n $NUM_THREADS -a \"$PLATFORM_ARCH\" -t ${PLATFORM_TOOLCHAIN} -p \"$PLATFORM_DSC\"" \
-					"-b "$target" ${PLATFORM_BUILDFLAGS}"
-			fi
-			build -n $NUM_THREADS -a "$PLATFORM_ARCH" -t ${PLATFORM_TOOLCHAIN} -p "$PLATFORM_DSC" \
-				-b "$target" ${PLATFORM_BUILDFLAGS}
-		fi
-
-		RESULT=$?
-		if [ $RESULT -eq 0 ]; then
-			if [ X"$TOS_DIR" != X"" ]; then
-				pushd $TOS_DIR >/dev/null
-				if [ $VERBOSE -eq 1 ]; then
-					echo "$TOOLS_DIR/tos-build.sh -e "$EDK2_DIR" -t "$target"_${PLATFORM_TOOLCHAIN} $board"
-				fi
-				$TOOLS_DIR/tos-build.sh -e "$EDK2_DIR" -t "$target"_${PLATFORM_TOOLCHAIN} $board
-				RESULT=$?
-				popd >/dev/null
-			fi
-		fi
-		if [ $RESULT -eq 0 ]; then
-			if [ X"$ATF_DIR" != X"" ]; then
-				pushd $ATF_DIR >/dev/null
-				if [ $VERBOSE -eq 1 ]; then
-					echo "$TOOLS_DIR/atf-build.sh -e "$EDK2_DIR" -t "$target"_${PLATFORM_TOOLCHAIN} $board"
-				fi
-				$TOOLS_DIR/atf-build.sh -e "$EDK2_DIR" -t "$target"_${PLATFORM_TOOLCHAIN} $board
-				RESULT=$?
-				popd >/dev/null
-			fi
-		fi
-		result_log $RESULT "$PLATFORM_NAME $target"
-	done
-	unset PACKAGES_PATH
-}
-
-
-function configure_paths
-{
-	WORKSPACE="$PWD"
-
-	# Check to see if we are in a UEFI repository
-	# refuse to continue if we aren't
-	if [ ! -d "$EDK2_DIR"/BaseTools ]
-	then
-		if [ -d "$PWD"/edk2/BaseTools ]; then
-			EDK2_DIR="$PWD"/edk2
-		else
-			echo "ERROR: can't locate the edk2 directory" >&2
-			echo "       please specify -e/--edk2-dir" >&2
-			exit 1
-		fi
-	fi
-
-	GLOBAL_PACKAGES_PATH="$EDK2_DIR"
-
-	# locate edk2-platforms
-	if [ -z "$PLATFORMS_DIR" -a -d "$PWD"/edk2-platforms ]; then
-		PLATFORMS_DIR="$PWD"/edk2-platforms
-	fi
-	if [ -n "$PLATFORMS_DIR" ]; then
-		GLOBAL_PACKAGES_PATH="$GLOBAL_PACKAGES_PATH:$PLATFORMS_DIR"
-	fi
-
-	# locate edk2-non-osi
-	if [ -z "$NON_OSI_DIR" -a -d "$PWD"/edk2-non-osi ]; then
-		NON_OSI_DIR="$PWD"/edk2-non-osi
-	fi
-	if [ -n "$NON_OSI_DIR" ]; then
-		GLOBAL_PACKAGES_PATH="$GLOBAL_PACKAGES_PATH:$NON_OSI_DIR"
-	fi
-
-	# locate arm-trusted-firmware
-	if [ -z "$ATF_DIR" -a -d "$PWD"/arm-trusted-firmware ]; then
-		ATF_DIR="$PWD"/arm-trusted-firmware
-	fi
-
-	export WORKSPACE
-}
-
-
-function prepare_build
-{
-	get_build_arch
-	export ARCH=$BUILD_ARCH
-
-	export ARCH
-	cd $EDK2_DIR
-	PACKAGES_PATH=$GLOBAL_PACKAGES_PATH . edksetup.sh --reconfig
-	if [ $? -ne 0 ]; then
-		echo "Sourcing edksetup.sh failed!" >&2
-		exit 1
-	fi
-	if [ $VERBOSE -eq 1 ]; then
-		echo "Building BaseTools"
-	fi
-	make -C BaseTools
-	RET=$?
-	cd -
-	if [ $RET -ne 0 ]; then
-		echo " !!! BaseTools failed to build !!! " >&2
-		exit 1
-	fi
-
-	if [ "$IMPORT_OPENSSL" = "TRUE" ]; then
-		cd $EDK2_DIR
-		import_openssl
-		if [ $? -ne 0 ]; then
-			echo "Importing OpenSSL failed - aborting!" >&2
-			echo "  specify --no-openssl to attempt build anyway." >&2
-			exit 1
-		fi
-		cd $WORKSPACE
-	fi
-}
-
-
-function usage
-{
-	echo "usage:"
-	echo -n "uefi-build.sh [-b DEBUG | RELEASE] [ all "
-	for board in "${boards[@]}" ; do
-	    echo -n "| $board "
-	done
-	echo "]"
-	printf "%8s\tbuild %s\n" "all" "all supported platforms"
-	for board in "${boards[@]}" ; do
-		PLATFORM_NAME="`$TOOLS_DIR/parse-platforms.py $PLATFORM_CONFIG -p $board get -o longname`"
-		printf "%8s\tbuild %s\n" "$board" "${PLATFORM_NAME}"
-	done
-}
-
-#
-# Since we do a command line validation on whether specified platforms exist or
-# not, do a first pass of command line to see if there is an explicit config
-# file there to read valid platforms from.
-#
-commandline=( "$@" )
-i=0
-for arg;
-do
-	if [ $arg == "-c" ]; then
-		FILE_ARG=${commandline[i + 1]}
-		if [ ! -f "$FILE_ARG" ]; then
-			echo "ERROR: configuration file '$FILE_ARG' not found" >&2
-			exit 1
-		fi
-		case "$FILE_ARG" in
-			/*)
-				PLATFORM_CONFIG="-c $FILE_ARG"
-			;;
-			*)
-				PLATFORM_CONFIG="-c `readlink -f \"$FILE_ARG\"`"
-			;;
-		esac
-		echo "Platform config file: '$FILE_ARG'"
-	fi
-	i=$(($i + 1))
-done
-
-export PLATFORM_CONFIG
-
-builds=()
-boards=()
-boardlist="`$TOOLS_DIR/parse-platforms.py $PLATFORM_CONFIG shortlist`"
-for board in $boardlist; do
-    boards=(${boards[@]} $board)
-done
-
-NUM_TARGETS=0
-
-while [ "$1" != "" ]; do
-	case $1 in
-		-1)     # Disable build parallellism
-			NUM_THREADS=1
-			;;
-		-a | --arm-tf-dir)
-			shift
-			ATF_DIR="`readlink -f $1`"
-			;;
-		-c)     # Already parsed above - skip this + option
-			shift
-			;;
-		-b | --build-target)
-			shift
-			echo "Adding Build target: $1"
-			TARGETS=(${TARGETS[@]} $1)
-			;;
-		-D)     # Pass through as -D option to 'build'
-			shift
-			echo "Adding Macro: -D $1"
-			EXTRA_OPTIONS=(${EXTRA_OPTIONS[@]} "-D" $1)
-			;;
-		-e | --edk2-dir)
-			shift
-			export EDK2_DIR="`readlink -f $1`"
-			;;
-		-h | --help)
-			usage
-			exit
-			;;
-		--no-openssl)
-			IMPORT_OPENSSL=FALSE
-			;;
-		-n | --non-osi-dir)
-			shift
-			NON_OSI_DIR="`readlink -f $1`"
-			;;
-		-p | --platforms-dir)
-			shift
-			PLATFORMS_DIR="`readlink -f $1`"
-			;;
-		-s | --tos-dir)
-			shift
-			export TOS_DIR="`readlink -f $1`"
-			;;
-		-T)     # Set specific toolchain tag, or clang/gcc for autoselection
-			shift
-			echo "Setting toolchain tag to '$1'"
-			TOOLCHAIN="$1"
-			;;
-		-v)
-			VERBOSE=1
-			;;
-		all)    # Add all targets in configuration file to list
-			builds=(${boards[@]})
-			NUM_TARGETS=$(($NUM_TARGETS + 1))
-			;;
-		*)      # Try to match target in configuration file, add to list
-			MATCH=0
-			for board in "${boards[@]}" ; do
-				if [ "`echo $1 | cut -d: -f1`" == $board ]; then
-					MATCH=1
-					builds=(${builds[@]} "$1")
-					break
-				fi
-			done
-
-			if [ $MATCH -eq 0 ]; then
-				echo "unknown arg $1"
-				usage
-				exit 1
-			fi
-			NUM_TARGETS=$(($NUM_TARGETS + 1))
-			;;
-	esac
-	shift
-done
-
-if [ $NUM_TARGETS -le  0 ]; then
-	echo "No targets specified - exiting!" >&2
-	exit 0
-fi
-
-export VERBOSE
-
-configure_paths
-
-prepare_build
-
-if [[ "${EXTRA_OPTIONS[@]}" != *"FIRMWARE_VER"* ]]; then
-	if test -d .git && head=`git rev-parse --verify --short HEAD 2>/dev/null`; then
-		FIRMWARE_VER=`git rev-parse --short HEAD`
-		if ! git diff-index --quiet HEAD --; then
-			FIRMWARE_VER="${FIRMWARE_VER}-dirty"
-		fi
-		EXTRA_OPTIONS=( ${EXTRA_OPTIONS[@]} "-D" FIRMWARE_VER=$FIRMWARE_VER )
-		if [ $VERBOSE -eq 1 ]; then
-			echo "FIRMWARE_VER=$FIRMWARE_VER"
-			echo "EXTRA_OPTIONS=$EXTRA_OPTIONS"
-		fi
-	fi
-fi
-
-for board in "${builds[@]}" ; do
-	do_build
-done
-
-result_print
diff --git a/uefi-tools/edk2-platforms.config b/uefi-tools/edk2-platforms.config
deleted file mode 100644
index be74327..0000000
--- a/uefi-tools/edk2-platforms.config
+++ /dev/null
@@ -1,138 +0,0 @@
-# Platform build configurations for Linaro EDK2 builds
-# ====================================================
-# The configuration file format is extremely simplistic:
-# - Each platform has a short name.
-# - A platform entry starts by the short name held in square brackets, '[]'
-# - Within each entry, all options are described in a NAME=VALUE scheme,
-#   with the name being whatever comes before the first '=' on the line,
-#   and the value being everything that comes after it.
-#
-# Mandatory options:
-# - LONGNAME		A more descriptive name of the platform.
-# - DSC			Pointer to the EDK2 build description file. (The
-#			pandaboard is excused, all other ports must have this.)
-# - ARCH		String describing the architecture to build for.
-#			Currently supported are AARCH32 and AARCH64.
-# - UEFI_BIN		Name of executable image produced.
-# - UEFI_IMAGE_DIR	Build output directory name, relative to 'Build'.
-#
-# Options for Trusted OS
-# Note that OP-TEE (https://github.com/OP-TEE/optee_os) is the only currently
-# supported Trusted OS
-# - BUILD_TOS		Set to "yes" if the build should automatically build
-#   			Trusted OS, mainly for ARM Trusted Firmware.
-#			If this is set, you must also set ATF_SPD!
-#			Else we will not know which specific Trusted OS to
-#			build.
-#			Set to "debug" to create a debug build.
-# - TOS_PLATFORM	Platform name for Trusted OS build, if
-#   			different from ARM Trusted Firmware platform
-#			or UEFI platform name.
-# - TOS_PLATFORM_FLAVOR	If a core platform has multiple flavors, specify which
-#			flavor here.
-#
-# Options for ARM Trusted Firmware platforms
-# - BUILD_ATF		Set to "yes" if the build should automatically build
-#   			ARM Trusted Firmware and a fip containing UEFI image.
-#			Set to "debug" to create a debug build.
-# - ATF_PLATFORM	Platform name for ARM Trusted Firmware build, if
-#   			different from UEFI platform name.
-# - SCP_BIN		SCP image to pass to ARM Trusted Firmware.
-# - TOS_BIN		Trusted OS image to pass to ARM Trusted Firmware.
-#			The path is relative to
-#			$EDK2_DIR/Build/$PLATFORM_IMAGE_DIR/$BUILD_PROFILE/FV/.
-#			To actually build the Trusted OS, you must also set
-#			ATF_SPD.
-# - ATF_SPD		Name of Secure Payload Dispatcher
-#			To actually build the Trusted OS, you must also set
-#			TOS_BIN.
-#
-# Optional options:
-# - BUILDFLAGS		Any special flags you want to pass to the build command.
-# - ATF_BUILDFLAGS	Any special flags you want to pass to the ARM Trusted
-#			Firmware build command.
-# - TOS_BUILDFLAGS	Any special flags you want to pass to the Trusted OS
-#			build command.
-# - EXTRA_FILES		Any additional files to be copied to output dir.
-# - PREBUILD_CMDS	Any commands you want to execute before the build step.
-# - POSTBUILD_CMDS	Any commands you want to execute after the build step.
-# - PACKAGES_PATH	Additional directories to search for packages under.
-# - INF                 Point to a .inf (in addition to a .dsc) in order to
-#                       build a single component (standalone driver/app).
-#
-
-[juno]
-LONGNAME=aarch64 Juno
-DSC=Platform/ARM/JunoPkg/ArmJuno.dsc
-BUILDFLAGS=
-ARCH=AARCH64
-BUILD_ATF=yes
-SCP_BIN=Platform/ARM/Juno/bl30.bin
-UEFI_BIN=BL33_AP_UEFI.fd
-UEFI_IMAGE_DIR=ArmJuno
-
-# ARM FVP BASE AEMv8-A model
-[fvp]
-LONGNAME=aarch64 FVP RTSM
-DSC=Platform/ARM/VExpressPkg/ArmVExpress-FVP-AArch64.dsc
-BUILDFLAGS=-D EDK2_ENABLE_SMSC_91X=1 -D EDK2_ENABLE_PL111=1
-ARCH=AARCH64
-BUILD_ATF=yes
-UEFI_BIN=FVP_AARCH64_EFI.fd
-UEFI_IMAGE_DIR=ArmVExpress-FVP-AArch64
-
-[tc2]
-LONGNAME=Versatile Express TC2
-BUILDFLAGS=-D ARM_BIGLITTLE_TC2=1
-DSC=Platform/ARM/VExpressPkg/ArmVExpress-CTA15-A7.dsc
-ARCH=ARM
-
-[overdrive]
-LONGNAME=AMD Overdrive
-DSC=Platform/AMD/OverdriveBoard/OverdriveBoard.dsc
-ARCH=AARCH64
-
-[overdrive1000]
-LONGNAME=SoftIron Overdrive 1000
-DSC=Platform/SoftIron/Overdrive1000Board/Overdrive1000Board.dsc
-ARCH=AARCH64
-
-[cello]
-LONGNAME=LeMaker Cello
-DSC=Platform/LeMaker/CelloBoard/CelloBoard.dsc
-ARCH=AARCH64
-
-[hikey]
-LONGNAME=HiKey
-DSC=Platform/Hisilicon/HiKey/HiKey.dsc
-ARCH=AARCH64
-
-[d02]
-LONGNAME=Hisilicon D02
-DSC=Platform/Hisilicon/D02/Pv660D02.dsc
-ARCH=AARCH64
-
-[d03]
-LONGNAME=Hisilicon D03
-DSC=Platform/Hisilicon/D03/D03.dsc
-ARCH=AARCH64
-
-[d05]
-LONGNAME=HiSilicon D05
-DSC=Platform/Hisilicon/D05/D05.dsc
-ARCH=AARCH64
-
-[armada70x0]
-LONGNAME=Marvell Armada 70x0
-DSC=Platform/Marvell/Armada/Armada70x0.dsc
-ARCH=AARCH64
-
-[chaoskey]
-LONGNAME=Altus Metrum ChaosKey RNG
-DSC=Silicon/Openmoko/Openmoko.dsc
-ARCH=AARCH64
-
-[beagle]
-LONGNAME=Beagleboard (original)
-DSC=BeagleBoardPkg/BeagleBoardPkg.dsc
-ARCH=ARM
diff --git a/uefi-tools/edk2-to-git-am.sh b/uefi-tools/edk2-to-git-am.sh
deleted file mode 100755
index d3f8a27..0000000
--- a/uefi-tools/edk2-to-git-am.sh
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/bin/sh
-#
-# Convert one or more git patches that have had it's CR:s stripped out by SMTP
-# into something th
-
-if [ $# -lt 1 ]; then
-  echo "usage: `basename $0` <filename>" >&2
-  exit 1
-fi
-
-convert_file()
-{
-  sed -i "s/$/\r/g" "$1"
-  sed -i "s:^\(---\|+++ \)\(.*\)\r$:\1\2:g" "$1"
-}
-
-while [ $# -gt 0 ]; do
-  convert_file "$1"
-  shift
-done
diff --git a/uefi-tools/handy-snippets.sh b/uefi-tools/handy-snippets.sh
deleted file mode 100644
index 834ca74..0000000
--- a/uefi-tools/handy-snippets.sh
+++ /dev/null
@@ -1,8 +0,0 @@
-#
-# First step in looking for duplicate file GUIDs
-#
-# find . -name "*.inf" | \
-#   xargs grep -H FILE_GUID | \
-#   sed 's/^\(.*\):[ \t]*FILE_GUID[ \t]*=[ \t]*\([a-f.A-F.0-9.-]*\).*\r$/\2 \1/' | \
-#   sort
-#
diff --git a/uefi-tools/opteed-build.sh b/uefi-tools/opteed-build.sh
deleted file mode 100755
index 702860e..0000000
--- a/uefi-tools/opteed-build.sh
+++ /dev/null
@@ -1,158 +0,0 @@
-#!/bin/bash
-#
-# Builds OP-TEE Trusted OS.
-# Not intended to be called directly, invoked from tos-build.sh.
-#
-# Board configuration is extracted from
-# parse-platforms.py and platforms.config.
-#
-
-. "$TOOLS_DIR"/common-functions
-
-export CFG_TEE_CORE_LOG_LEVEL=2  # 0=none 1=err 2=info 3=debug 4=flow
-
-function usage
-{
-	echo "usage:"
-	echo "opteed-build.sh -e <EDK2 source directory> -t <UEFI build profile/toolchain> <platform>"
-	echo
-}
-
-function build_platform
-{
-	unset CFG_ARM64_core PLATFORM PLATFORM_FLAVOR DEBUG
-	TOS_PLATFORM="`$TOOLS_DIR/parse-platforms.py $PLATFORM_CONFIG -p $1 get -o tos_platform`"
-	if [ X"$TOS_PLATFORM" = X"" ]; then
-		TOS_PLATFORM="`$TOOLS_DIR/parse-platforms.py $PLATFORM_CONFIG -p $1 get -o atf_platform`"
-		if [ X"$TOS_PLATFORM" = X"" ]; then
-			TOS_PLATFORM=$1
-		fi
-	fi
-	TOS_PLATFORM_FLAVOR="`$TOOLS_DIR/parse-platforms.py $PLATFORM_CONFIG -p $1 get -o tos_platform_flavor`"
-
-	#
-	# Read platform configuration
-	#
-	PLATFORM_ARCH="`$TOOLS_DIR/parse-platforms.py $PLATFORM_CONFIG -p $1 get -o arch`"
-	PLATFORM_IMAGE_DIR="`$TOOLS_DIR/parse-platforms.py $PLATFORM_CONFIG -p $1 get -o uefi_image_dir`"
-	PLATFORM_BUILDFLAGS="`$TOOLS_DIR/parse-platforms.py $PLATFORM_CONFIG -p $1 get -o tos_buildflags`"
-
-	if [ $VERBOSE -eq 1 ]; then
-		echo "PLATFORM_ARCH=$PLATFORM_ARCH"
-		echo "PLATFORM_IMAGE_DIR=$PLATFORM_IMAGE_DIR"
-		echo "PLATFORM_BUILDFLAGS=$PLATFORM_BUILDFLAGS"
-	fi
-
-	#
-	# Set up cross compilation variables (if applicable)
-	#
-	# OP-TEE requires both 64- and 32-bit compilers for a 64-bit build
-	# For details, visit
-	# https://github.com/OP-TEE/optee_os/blob/master/documentation/build_system.md#cross_compile-cross-compiler-selection
-	#
-	set_cross_compile
-	if [ "$PLATFORM_ARCH" = "AARCH64" ]; then
-		export CFG_ARM64_core=y
-		export CROSS_COMPILE_core="$TEMP_CROSS_COMPILE"
-		export CROSS_COMPILE_ta_arm64="$TEMP_CROSS_COMPILE"
-		PLATFORM_ARCH="ARM"
-		set_cross_compile
-		PLATFORM_ARCH="AARCH64"
-		echo "CFG_ARM64_core=$CFG_ARM64_core"
-		echo "CROSS_COMPILE_ta_arm64=$CROSS_COMPILE_ta_arm64"
-	else
-		export CFG_ARM64_core=n
-	fi
-	export CROSS_COMPILE="$TEMP_CROSS_COMPILE"
-	echo "CROSS_COMPILE=$CROSS_COMPILE"
-	echo "CROSS_COMPILE_core=$CROSS_COMPILE_core"
-
-	#
-	# Set up build variables
-	#
-	BUILD_TOS="`$TOOLS_DIR/parse-platforms.py $PLATFORM_CONFIG -p $1 get -o build_tos`"
-	case "$BUILD_TOS" in
-	debug*)
-		export DEBUG=1
-		echo "PROFILE=DEBUG"
-		;;
-	*)
-		export DEBUG=0
-		echo "PROFILE=RELEASE"
-		;;
-	esac
-
-	export PLATFORM=$TOS_PLATFORM
-	export PLATFORM_FLAVOR=$TOS_PLATFORM_FLAVOR
-	echo "PLATFORM=$PLATFORM"
-	echo "PLATFORM_FLAVOR=$PLATFORM_FLAVOR"
-	echo "CFG_TEE_CORE_LOG_LEVEL=$CFG_TEE_CORE_LOG_LEVEL"
-
-	#
-	# Build OP-TEE
-	#
-	if [ $VERBOSE -eq 1 ]; then
-		echo "Calling OP-TEE build:"
-	fi
-	make -j$NUM_THREADS ${PLATFORM_BUILDFLAGS}
-	if [ $? -eq 0 ]; then
-		#
-		# Copy resulting images to UEFI image dir
-		#
-		TOS_BIN="`$TOOLS_DIR/parse-platforms.py $PLATFORM_CONFIG -p $1 get -o tos_bin`"
-		if [ $VERBOSE -eq 1 ]; then
-			echo "Copying '$TOS_BIN' to '$EDK2_DIR/Build/$PLATFORM_IMAGE_DIR/$BUILD_PROFILE/FV/'"
-		fi
-		cp -a out/arm-plat-"$TOS_PLATFORM"/core/"$TOS_BIN" "$EDK2_DIR/Build/$PLATFORM_IMAGE_DIR/$BUILD_PROFILE/FV/"
-	else
-		return 1
-	fi
-}
-
-# Check to see if we are in a trusted OS directory
-# refuse to continue if we aren't
-if [ ! -f documentation/optee_design.md ]
-then
-	echo "ERROR: we aren't in the optee_os directory."
-	usage
-	exit 1
-fi
-
-build=
-
-if [ $# = 0 ]
-then
-	usage
-	exit 1
-else
-	while [ "$1" != "" ]; do
-		case $1 in
-			"-e" )
-				shift
-				EDK2_DIR="$1"
-				;;
-			"/h" | "/?" | "-?" | "-h" | "--help" )
-				usage
-				exit
-				;;
-			"-t" )
-				shift
-				BUILD_PROFILE="$1"
-				;;
-			* )
-				build="$1"
-				;;
-		esac
-		shift
-	done
-fi
-
-if [ X"$build" = X"" ]; then
-	echo "No platform specified!" >&2
-	echo
-	usage
-	exit 1
-fi
-
-build_platform $build
-exit $?
diff --git a/uefi-tools/parse-platforms.py b/uefi-tools/parse-platforms.py
deleted file mode 100755
index af44038..0000000
--- a/uefi-tools/parse-platforms.py
+++ /dev/null
@@ -1,81 +0,0 @@
-#!/usr/bin/python
-
-import sys, os, argparse, ConfigParser
-
-default_filename='platforms.config'
-
-def list_platforms():
-    for p in platforms: print p
-
-def shortlist_platforms():
-    for p in platforms: print p,
-
-def get_images():
-    if args.platform:
-        try:
-            value = config.get(args.platform, "EXTRA_FILES")
-            print value,
-        except:
-            pass
-        try:
-            value = config.get(args.platform, "BUILD_ATF")
-            if value == "yes":
-                print "bl1.bin fip.bin"
-                return True
-        except:
-            try:
-                value = config.get(args.platform, "UEFI_BIN")
-                print value
-                return True
-            except:
-                print "No images found!"
-    else:
-        print "No platform specified!"
-
-    return False
-
-def get_option():
-    if args.platform:
-        if args.option:
-            try:
-                value = config.get(args.platform, args.option)
-                if value:
-                    print value
-                    return True
-            except:
-                return True   # Option not found, return True, and no output
-        else:
-            print "No option specified!"
-    else:
-        print "No platform specified!"
-    return False
-
-parser = argparse.ArgumentParser(description='Parses platform configuration for Linaro UEFI build scripts.')
-parser.add_argument('-c', '--config-file', help='Specify a non-default platform config file.', required=False)
-parser.add_argument('-p', '--platform', help='Read configuration for PLATFORM only.', required=False)
-parser.add_argument('command', action="store", help='Action to perform')
-parser.add_argument('-o', '--option', help='Option to retreive')
-
-args = parser.parse_args()
-if args.config_file:
-    config_filename = args.config_file
-else:
-    config_filename = os.path.dirname(os.path.realpath(sys.argv[0])) + '/' + default_filename
-
-config = ConfigParser.ConfigParser()
-config.read(config_filename)
-
-platforms = config.sections()
-
-commands = {"shortlist": shortlist_platforms,
-            "list": list_platforms,
-            "images": get_images,
-            "get": get_option}
-
-try:
-    retval = commands[args.command]()
-except:
-    print ("Unrecognized command '%s'" % args.command)
-
-if retval != True:
-    sys.exit(1)
diff --git a/uefi-tools/platforms.config b/uefi-tools/platforms.config
deleted file mode 100644
index deb02f4..0000000
--- a/uefi-tools/platforms.config
+++ /dev/null
@@ -1,306 +0,0 @@
-# Platform build configurations for Linaro EDK2 builds
-# ====================================================
-# The configuration file format is extremely simplistic:
-# - Each platform has a short name.
-# - A platform entry starts by the short name held in square brackets, '[]'
-# - Within each entry, all options are described in a NAME=VALUE scheme,
-#   with the name being whatever comes before the first '=' on the line,
-#   and the value being everything that comes after it.
-#
-# Mandatory options:
-# - LONGNAME		A more descriptive name of the platform.
-# - DSC			Pointer to the EDK2 build description file. (The
-#			pandaboard is excused, all other ports must have this.)
-# - ARCH		String describing the architecture to build for.
-#			Currently supported are AARCH32 and AARCH64.
-# - UEFI_BIN		Name of executable image produced.
-# - UEFI_IMAGE_DIR	Build output directory name, relative to 'Build'.
-#
-# Options for Trusted OS
-# Note that OP-TEE (https://github.com/OP-TEE/optee_os) is the only currently
-# supported Trusted OS
-# - BUILD_TOS		Set to "yes" if the build should automatically build
-#   			Trusted OS, mainly for ARM Trusted Firmware.
-#			If this is set, you must also set ATF_SPD!
-#			Else we will not know which specific Trusted OS to
-#			build.
-#			Set to "debug" to create a debug build.
-# - TOS_PLATFORM	Platform name for Trusted OS build, if
-#   			different from ARM Trusted Firmware platform
-#			or UEFI platform name.
-# - TOS_PLATFORM_FLAVOR	If a core platform has multiple flavors, specify which
-#			flavor here.
-#
-# Options for ARM Trusted Firmware platforms
-# - BUILD_ATF		Set to "yes" if the build should automatically build
-#   			ARM Trusted Firmware and a fip containing UEFI image.
-#			Set to "debug" to create a debug build.
-# - ATF_PLATFORM	Platform name for ARM Trusted Firmware build, if
-#   			different from UEFI platform name.
-# - SCP_BIN		SCP image to pass to ARM Trusted Firmware.
-# - TOS_BIN		Trusted OS image to pass to ARM Trusted Firmware.
-#			The path is relative to
-#			$EDK2_DIR/Build/$PLATFORM_IMAGE_DIR/$BUILD_PROFILE/FV/.
-#			To actually build the Trusted OS, you must also set
-#			ATF_SPD.
-# - ATF_SPD		Name of Secure Payload Dispatcher
-#			To actually build the Trusted OS, you must also set
-#			TOS_BIN.
-# - SPM_BIN		Prebuilt Secure Partition image to pass to ARM Trusted Firmware.
-#			The path is relative to
-#			$EDK2_DIR/Build/StandaloneSmmPkg/$BUILD_PROFILE/FV/.
-#
-# Optional options:
-# - BUILDFLAGS		Any special flags you want to pass to the build command.
-# - ATF_BUILDFLAGS	Any special flags you want to pass to the ARM Trusted
-#			Firmware build command.
-# - TOS_BUILDFLAGS	Any special flags you want to pass to the Trusted OS
-#			build command.
-# - EXTRA_FILES		Any additional files to be copied to output dir.
-# - PREBUILD_CMDS	Any commands you want to execute before the build step.
-# - POSTBUILD_CMDS	Any commands you want to execute after the build step.
-# - PACKAGES_PATH	Additional directories to search for packages under.
-# - INF                 Point to a .inf (in addition to a .dsc) in order to
-#                       build a single component (standalone driver/app).
-#
-
-[juno]
-LONGNAME=aarch64 Juno
-DSC=OpenPlatformPkg/Platforms/ARM/Juno/ArmJuno.dsc
-BUILDFLAGS=
-ARCH=AARCH64
-BUILD_ATF=yes
-UEFI_BIN=BL33_AP_UEFI.fd
-UEFI_IMAGE_DIR=ArmJuno
-SCP_BIN=OpenPlatformPkg/Platforms/ARM/Juno/Binary/bl30.bin
-EXTRA_FILES=../../../../OpenPlatformPkg/Platforms/ARM/Juno/Binary/bl0.bin ../../../../OpenPlatformPkg/Platforms/ARM/Juno/Binary/Copying.txt
-
-# ARM FVP BASE AEMv8-A model
-[fvp_full]
-LONGNAME=aarch64 FVP RTSM with full perhiperhal set
-DSC=OpenPlatformPkg/Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.dsc
-BUILDFLAGS=-D EDK2_OUT_DIR=Build/ArmVExpress-FVP-AArch64-Full -D EDK2_ENABLE_SMSC_91X=1 -D EDK2_ENABLE_PL111=1
-ARCH=AARCH64
-UEFI_BIN=FVP_AARCH64_EFI.fd
-UEFI_IMAGE_DIR=ArmVExpress-FVP-AArch64-Full
-
-[fvp]
-LONGNAME=aarch64 FVP RTSM
-DSC=OpenPlatformPkg/Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.dsc
-BUILDFLAGS=-D EDK2_ENABLE_SMSC_91X=1
-ARCH=AARCH64
-BUILD_ATF=yes
-UEFI_BIN=FVP_AARCH64_EFI.fd
-UEFI_IMAGE_DIR=ArmVExpress-FVP-AArch64
-
-# ARM FVP BASE AEMv8-A model
-[fvp_mm_standalone]
-LONGNAME=FVP Base for MM Standalone image in secure world
-DSC=StandaloneSmmPkg/StandaloneSmmPkg.dsc
-ARCH=AARCH64
-UEFI_BIN=FVP_AARCH64_EFI_MM_STANDALONE.fd
-UEFI_IMAGE_DIR=ArmVExpress-FVP-AArch64-MM-Standalone
-
-[fvp_mm_normal]
-LONGNAME=FVP Base for UEFI image with MM support in normal world
-DSC=OpenPlatformPkg/Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.dsc
-BUILDFLAGS=-D EDK2_OUT_DIR=Build/ArmVExpress-FVP-AArch64-MM-Normal -D ARM_STANDALONE_MM_ENABLE=TRUE
-ARCH=AARCH64
-BUILD_ATF=debug
-UEFI_BIN=FVP_AARCH64_EFI.fd
-UEFI_IMAGE_DIR=ArmVExpress-FVP-AArch64-MM-Normal
-ATF_PLATFORM=fvp
-SPM_BIN=STANDALONESMM.fd
-ATF_BUILDFLAGS=ARM_BL31_IN_DRAM=1
-
-[tc2]
-LONGNAME=Versatile Express TC2
-BUILDFLAGS=-D ARM_BIGLITTLE_TC2=1
-DSC=OpenPlatformPkg/Platforms/ARM/VExpress/ArmVExpress-CTA15-A7.dsc
-ARCH=ARM
-UEFI_BIN=ARM_VEXPRESS_CTA15A7_EFI.fd
-UEFI_IMAGE_DIR=ArmVExpress-CTA15-A7
-
-[beagle]
-LONGNAME=BeagleBoard
-BUILDFLAGS=
-DSC=BeagleBoardPkg/BeagleBoardPkg.dsc
-ARCH=ARM
-
-[d01]
-LONGNAME=HiSilicon D01 Cortex-A15 16-cores
-BUILDFLAGS=-D EDK2_ARMVE_STANDALONE=1
-DSC=HisiPkg/D01BoardPkg/D01BoardPkg.dsc
-ARCH=ARM
-UEFI_BIN=D01.fd
-UEFI_IMAGE_DIR=D01
-
-[d01-intelbds]
-LONGNAME=HiSilicon D01 Cortex-A15 16-cores Intel Bds
-BUILDFLAGS=-D EDK2_ARMVE_STANDALONE=1 -D INTEL_BDS -D NO_LINUX_LOADER -D EDK2_OUT_DIR=Build/D01-IntelBds
-DSC=HisiPkg/D01BoardPkg/D01BoardPkg.dsc
-ARCH=ARM
-UEFI_BIN=D01.fd
-UEFI_IMAGE_DIR=D01
-
-[qemu]
-LONGNAME=QEMU ARM Emulator
-BUILDFLAGS=-D INTEL_BDS
-DSC=ArmVirtPkg/ArmVirtQemu.dsc
-ARCH=ARM
-UEFI_BIN=QEMU_EFI.fd
-UEFI_IMAGE_DIR=ArmVirtQemu-ARM
-
-[qemu64]
-LONGNAME=QEMU AArch64 Emulator
-BUILDFLAGS=-D INTEL_BDS
-DSC=ArmVirtPkg/ArmVirtQemu.dsc
-ARCH=AARCH64
-UEFI_BIN=QEMU_EFI.fd
-UEFI_IMAGE_DIR=ArmVirtQemu-AARCH64
-
-[mustang]
-LONGNAME=APM XGene Mustang
-BUILDFLAGS=
-DSC=ArmPlatformPkg/APMXGenePkg/APMXGene-Mustang.dsc
-ARCH=AARCH64
-UEFI_BIN=APMXGENE-MUSTANG.fd SEC_APMXGENE-MUSTANG.fd
-UEFI_IMAGE_DIR=APMXGene-Mustang
-
-[overdrive]
-LONGNAME=AMD Overdrive
-BUILDFLAGS=-D INTEL_BDS
-DSC=OpenPlatformPkg/Platforms/AMD/Styx/OverdriveBoard/OverdriveBoard.dsc
-ARCH=AARCH64
-PACKAGES_PATH=OpenPlatformPkg/Platforms/AMD/Styx/Binary
-UEFI_BIN=STYX_ROM.fd
-UEFI_IMAGE_DIR=Overdrive
-
-[overdrive1000]
-LONGNAME=SoftIron Overdrive 1000
-BUILDFLAGS=-D INTEL_BDS
-DSC=OpenPlatformPkg/Platforms/AMD/Styx/Overdrive1000Board/Overdrive1000Board.dsc
-ARCH=AARCH64
-PACKAGES_PATH=OpenPlatformPkg/Platforms/AMD/Styx/Binary
-UEFI_BIN=OVERDRIVE1000_ROM.fd
-UEFI_IMAGE_DIR=Overdrive1000Board
-
-[cello]
-LONGNAME=LeMaker Cello
-BUILDFLAGS=-D INTEL_BDS
-DSC=OpenPlatformPkg/Platforms/AMD/Styx/CelloBoard/CelloBoard.dsc
-ARCH=AARCH64
-PACKAGES_PATH=OpenPlatformPkg/Platforms/AMD/Styx/Binary
-UEFI_BIN=STYX_ROM.fd
-UEFI_IMAGE_DIR=Cello
-
-# NOTE: If using upstream ATF, i.e.
-# https://github.com/ARM-software/arm-trusted-firmware
-# please set TOS_BIN=tee-pager.bin
-[hikey]
-LONGNAME=CircuitCo HiKey
-DSC=OpenPlatformPkg/Platforms/Hisilicon/HiKey/HiKey.dsc
-ARCH=AARCH64
-UEFI_BIN=BL33_AP_UEFI.fd
-UEFI_IMAGE_DIR=HiKey
-BUILD_ATF=yes
-ATF_SPD=opteed
-TOS_BIN=tee.bin
-TOS_PLATFORM_FLAVOR=hikey
-BUILD_TOS=yes
-SCP_BIN=OpenPlatformPkg/Platforms/Hisilicon/HiKey/Binary/mcuimage.bin
-# Uncomment this to use UART0 as the EDK2 console
-#BUILDFLAGS=-DSERIAL_BASE=0xF8015000
-# Uncomment this to use UART0 as the ARM Trusted Firmware console
-#ATF_BUILDFLAGS=CONSOLE_BASE=PL011_UART0_BASE CRASH_CONSOLE_BASE=PL011_UART0_BASE
-# Uncomment this to use UART0 as the OP-TEE Trusted OS console
-#TOS_BUILDFLAGS=CFG_CONSOLE_UART=0
-
-[hikey960]
-LONGNAME=Hikey960
-DSC=OpenPlatformPkg/Platforms/Hisilicon/HiKey960/HiKey960.dsc
-ARCH=AARCH64
-UEFI_BIN=BL33_AP_UEFI.fd
-UEFI_IMAGE_DIR=HiKey960
-BUILD_ATF=yes
-ATF_SPD=opteed
-TOS_BIN=tee-pager.bin
-TOS_PLATFORM=hikey
-TOS_PLATFORM_FLAVOR=hikey960
-BUILD_TOS=yes
-SCP_BIN=OpenPlatformPkg/Platforms/Hisilicon/HiKey960/Binary/lpm3.img
-# Uncomment this to use UART5 as the EDK2 console for v1 hardware
-#BUILDFLAGS=-DSERIAL_BASE=0xFDF05000
-
-[xen64]
-LONGNAME=AArch64 Xen guest
-BUILDFLAGS=
-DSC=ArmVirtPkg/ArmVirtXen.dsc
-ARCH=AARCH64
-UEFI_BIN=XEN_EFI.fd
-UEFI_IMAGE_DIR=ArmVirtXen-AARCH64
-
-[aarch64-shell]
-LONGNAME=AArch64 EFI Shell
-BUILDFLAGS=-D INCLUDE_TFTP_COMMAND
-DSC=ShellPkg/ShellPkg.dsc
-ARCH=AARCH64
-
-[aarch64-shell-minimal]
-LONGNAME=AArch64 EFI Shell (Minimal)
-BUILDFLAGS=-D NO_SHELL_PROFILES
-DSC=ShellPkg/ShellPkg.dsc
-ARCH=AARCH64
-
-[arm-shell]
-LONGNAME=ARM EFI Shell
-BUILDFLAGS=-D INCLUDE_TFTP_COMMAND
-DSC=ShellPkg/ShellPkg.dsc
-ARCH=ARM
-
-[arm-shell-minimal]
-LONGNAME=ARM EFI Shell (Minimal)
-BUILDFLAGS=-D NO_SHELL_PROFILES
-DSC=ShellPkg/ShellPkg.dsc
-ARCH=ARM
-
-[d02]
-LONGNAME=Hisilicon D02
-DSC=OpenPlatformPkg/Platforms/Hisilicon/D02/Pv660D02.dsc
-ARCH=AARCH64
-UEFI_BIN=PV660D02.fd
-UEFI_IMAGE_DIR=Pv660D02
-
-[d03]
-LONGNAME=Hisilicon D03
-DSC=OpenPlatformPkg/Platforms/Hisilicon/D03/D03.dsc
-ARCH=AARCH64
-UEFI_BIN=D03.fd
-UEFI_IMAGE_DIR=D03
-
-[d05]
-LONGNAME=HiSilicon D05
-DSC=OpenPlatformPkg/Platforms/Hisilicon/D05/D05.dsc
-ARCH=AARCH64
-UEFI_BIN=D05.fd
-UEFI_IMAGE_DIR=D05
-
-[armada70x0]
-LONGNAME=Marvell Armada 70x0
-DSC=OpenPlatformPkg/Platforms/Marvell/Armada/Armada70x0.dsc
-ARCH=AARCH64
-
-[ovmfx64]
-LONGNAME=OVMF Qemu X64
-DSC=OvmfPkg/OvmfPkgX64.dsc
-ARCH=X64
-
-[hello]
-LONGNAME=EDK2 Hello World Example
-DSC=MdeModulePkg/MdeModulePkg.dsc
-INF=MdeModulePkg/Application/HelloWorld/HelloWorld.inf
-
-[chaoskey]
-LONGNAME=Altus Metrum ChaosKey Driver
-DSC=OptionRomPkg/OptionRomPkg.dsc
-INF=OpenPlatformPkg/Drivers/Usb/Misc/ChaosKeyDxe/ChaosKeyDxe.inf
diff --git a/uefi-tools/tos-build.sh b/uefi-tools/tos-build.sh
deleted file mode 100755
index a3bf421..0000000
--- a/uefi-tools/tos-build.sh
+++ /dev/null
@@ -1,87 +0,0 @@
-#!/bin/bash
-#
-# Builds Trusted OS, mainly for ARM Trusted Firmware.
-# Calls $ATF_SPD-build.sh for the actual build of a specific Trusted OS.
-# Not intended to be called directly, invoked from uefi-build.sh.
-#
-# Board configuration is extracted from
-# parse-platforms.py and platforms.config.
-#
-
-. "$TOOLS_DIR"/common-functions
-
-function usage
-{
-	echo "usage:"
-	echo "tos-build.sh -e <EDK2 source directory> -t <UEFI build profile/toolchain> <platform>"
-	echo
-}
-
-function build_platform
-{
-	if [ X"$EDK2_DIR" = X"" ];then
-		echo "EDK2_DIR not set!" >&2
-		return 1
-	fi
-
-	if [ X"`$TOOLS_DIR/parse-platforms.py $PLATFORM_CONFIG -p $1 get -o build_tos`" = X"" ]; then
-		echo "Platform '$1' is not configured to build Trusted OS."
-		return 0
-	fi
-
-	#
-	# Build Trusted OS
-	#
-	ATF_SPD="`$TOOLS_DIR/parse-platforms.py $PLATFORM_CONFIG -p $1 get -o atf_spd`"
-	if [ -f $TOOLS_DIR/$ATF_SPD-build.sh ]; then
-		echo "Building $ATF_SPD Trusted OS"
-		if [ $VERBOSE -eq 1 ]; then
-			echo "$TOOLS_DIR/$ATF_SPD-build.sh -e "$EDK2_DIR" -t "$BUILD_PROFILE" $build"
-		fi
-		$TOOLS_DIR/$ATF_SPD-build.sh -e "$EDK2_DIR" -t "$BUILD_PROFILE" $build
-		return $?
-	else
-		echo "ERROR: missing Trusted OS build script."
-		echo "       Or build script not named $ATF_SPD-build.sh"
-		return 1
-	fi
-}
-
-build=
-
-if [ $# = 0 ]
-then
-	usage
-	exit 1
-else
-	while [ "$1" != "" ]; do
-		case $1 in
-			"-e" )
-				shift
-				EDK2_DIR="$1"
-				;;
-			"/h" | "/?" | "-?" | "-h" | "--help" )
-				usage
-				exit
-				;;
-			"-t" )
-				shift
-				BUILD_PROFILE="$1"
-				;;
-			* )
-				build="$1"
-				;;
-		esac
-		shift
-	done
-fi
-
-if [ X"$build" = X"" ]; then
-	echo "No platform specified!" >&2
-	echo
-	usage
-	exit 1
-fi
-
-build_platform $build
-exit $?
diff --git a/uefi-tools/uefi-build.sh b/uefi-tools/uefi-build.sh
deleted file mode 100755
index 7fec3d0..0000000
--- a/uefi-tools/uefi-build.sh
+++ /dev/null
@@ -1,398 +0,0 @@
-#!/bin/bash
-
-#
-# Board Configuration Section
-# ===========================
-#
-# Board configuration moved to parse-platforms.py and platforms.config.
-#
-# No need to edit below unless you are changing script functionality.
-#
-
-unset WORKSPACE EDK_TOOLS_DIR MAKEFLAGS
-
-TOOLS_DIR="`dirname $0`"
-export TOOLS_DIR
-. "$TOOLS_DIR"/common-functions
-PLATFORM_CONFIG=""
-VERBOSE=0
-ATF_DIR=
-TOS_DIR=
-TOOLCHAIN=
-OPENSSL_CONFIGURED=FALSE
-
-# Number of threads to use for build
-export NUM_THREADS=$((`getconf _NPROCESSORS_ONLN` + 1))
-
-function do_build
-{
-	PLATFORM_NAME="`$TOOLS_DIR/parse-platforms.py $PLATFORM_CONFIG -p $board get -o longname`"
-	PLATFORM_PREBUILD_CMDS="`$TOOLS_DIR/parse-platforms.py $PLATFORM_CONFIG -p $board get -o prebuild_cmds`"
-	PLATFORM_BUILDFLAGS="`$TOOLS_DIR/parse-platforms.py $PLATFORM_CONFIG -p $board get -o buildflags`"
-	PLATFORM_BUILDFLAGS="$PLATFORM_BUILDFLAGS ${EXTRA_OPTIONS[@]}"
-	PLATFORM_BUILDCMD="`$TOOLS_DIR/parse-platforms.py $PLATFORM_CONFIG -p $board get -o buildcmd`"
-	PLATFORM_DSC="`$TOOLS_DIR/parse-platforms.py $PLATFORM_CONFIG -p $board get -o dsc`"
-	PLATFORM_PACKAGES_PATH="$PWD"
-	COMPONENT_INF="`$TOOLS_DIR/parse-platforms.py $PLATFORM_CONFIG -p $board get -o inf`"
-
-	PLATFORM_ARCH="`$TOOLS_DIR/parse-platforms.py $PLATFORM_CONFIG -p $board get -o arch`"
-	if [ -n "$PLATFORM_ARCH" ]; then
-		if [ -n "$DEFAULT_PLATFORM_ARCH" -a "$DEFAULT_PLATFORM_ARCH" != "$PLATFORM_ARCH" ]; then
-			echo "Command line specified architecture '$DEFAULT_PLATFORM_ARCH'" >&2
-			echo "differs from config file specified '$PLATFORM_ARCH'" >&2
-			return 1
-		fi
-	else
-		if [ ! -n "$DEFAULT_PLATFORM_ARCH" ]; then
-			echo "Unknown target architecture - aborting!" >&2
-			return 1
-		fi
-		PLATFORM_ARCH="$DEFAULT_PLATFORM_ARCH"
-	fi
-	TEMP_PACKAGES_PATH="`$TOOLS_DIR/parse-platforms.py $PLATFORM_CONFIG -p $board get -o packages_path`"
-	if [ -n "$TEMP_PACKAGES_PATH" ]; then
-		IFS=:
-		for path in "$TEMP_PACKAGES_PATH"; do
-			case "$path" in
-				/*)
-					PLATFORM_PACKAGES_PATH="$PLATFORM_PACKAGES_PATH:$path"
-				;;
-				*)
-					PLATFORM_PACKAGES_PATH="$PLATFORM_PACKAGES_PATH:$PWD/$path"
-				;;
-		        esac
-		done
-		unset IFS
-	fi
-	if [ $VERBOSE -eq 1 ]; then
-		echo "Setting build parallellism to $NUM_THREADS processes\n"
-		echo "PLATFORM_NAME=$PLATFORM_NAME"
-		echo "PLATFORM_PREBUILD_CMDS=$PLATFORM_PREBUILD_CMDS"
-		echo "PLATFORM_BUILDFLAGS=$PLATFORM_BUILDFLAGS"
-		echo "PLATFORM_BUILDCMD=$PLATFORM_BUILDCMD"
-		echo "PLATFORM_DSC=$PLATFORM_DSC"
-		echo "PLATFORM_ARCH=$PLATFORM_ARCH"
-		echo "PLATFORM_PACKAGES_PATH=$PLATFORM_PACKAGES_PATH"
-	fi
-
-	if [[ "${PLATFORM_BUILDFLAGS}" =~ "SECURE_BOOT_ENABLE=TRUE" ]]; then
-	    import_openssl
-	fi
-
-	if [ -n "$CROSS_COMPILE_64" -a "$PLATFORM_ARCH" == "AARCH64" ]; then
-		TEMP_CROSS_COMPILE="$CROSS_COMPILE_64"
-	elif [ -n "$CROSS_COMPILE_32" -a "$PLATFORM_ARCH" == "ARM" ]; then
-		TEMP_CROSS_COMPILE="$CROSS_COMPILE_32"
-	else
-		set_cross_compile
-	fi
-
-	CROSS_COMPILE="$TEMP_CROSS_COMPILE"
-
-	echo "Building $PLATFORM_NAME - $PLATFORM_ARCH"
-	echo "CROSS_COMPILE=\"$TEMP_CROSS_COMPILE\""
-	echo "$board"_BUILDFLAGS="'$PLATFORM_BUILDFLAGS'"
-
-	if [ "$TARGETS" == "" ]; then
-		TARGETS=( RELEASE )
-	fi
-
-	case $TOOLCHAIN in
-		"gcc")
-			TOOLCHAIN=`get_gcc_version "$CROSS_COMPILE"gcc`
-			if [ $? -ne 0 ]; then
-				echo "${CROSS_COMPILE}gcc not found!" >&2
-				return 1
-			fi
-			;;
-		"clang")
-			TOOLCHAIN=`get_clang_version clang`
-			if [ $? -ne 0 ]; then
-				return 1
-			fi
-			;;
-	esac
-	export TOOLCHAIN
-	echo "TOOLCHAIN is ${TOOLCHAIN}"
-
-	export ${TOOLCHAIN}_${PLATFORM_ARCH}_PREFIX=$CROSS_COMPILE
-	echo "Toolchain prefix: ${TOOLCHAIN}_${PLATFORM_ARCH}_PREFIX=$CROSS_COMPILE"
-
-	export PACKAGES_PATH="$PLATFORM_PACKAGES_PATH"
-	for target in "${TARGETS[@]}" ; do
-		if [ X"$PLATFORM_PREBUILD_CMDS" != X"" ]; then
-			echo "Run pre build commands"
-			eval ${PLATFORM_PREBUILD_CMDS}
-		fi
-
-		if [ -n "$COMPONENT_INF" ]; then
-			# Build a standalone component
-			build -n $NUM_THREADS -a "$PLATFORM_ARCH" -t ${TOOLCHAIN} -p "$PLATFORM_DSC" \
-				-m "$COMPONENT_INF" -b "$target" ${PLATFORM_BUILDFLAGS}
-		else
-			# Build a platform
-			build -n $NUM_THREADS -a "$PLATFORM_ARCH" -t ${TOOLCHAIN} -p "$PLATFORM_DSC" \
-				-b "$target" ${PLATFORM_BUILDFLAGS}
-		fi
-
-		RESULT=$?
-		if [ $RESULT -eq 0 ]; then
-			if [ X"$TOS_DIR" != X"" ]; then
-				pushd $TOS_DIR >/dev/null
-				if [ $VERBOSE -eq 1 ]; then
-					echo "$TOOLS_DIR/tos-build.sh -e "$EDK2_DIR" -t "$target"_${TOOLCHAIN} $board"
-				fi
-				$TOOLS_DIR/tos-build.sh -e "$EDK2_DIR" -t "$target"_${TOOLCHAIN} $board
-				RESULT=$?
-				popd >/dev/null
-			fi
-		fi
-		if [ $RESULT -eq 0 ]; then
-			if [ X"$ATF_DIR" != X"" ]; then
-				pushd $ATF_DIR >/dev/null
-				if [ $VERBOSE -eq 1 ]; then
-					echo "$TOOLS_DIR/atf-build.sh -e "$EDK2_DIR" -t "$target"_${TOOLCHAIN} $board"
-				fi
-				$TOOLS_DIR/atf-build.sh -e "$EDK2_DIR" -t "$target"_${TOOLCHAIN} $board
-				RESULT=$?
-				popd >/dev/null
-			fi
-		fi
-		result_log $RESULT "$PLATFORM_NAME $target"
-	done
-	unset PACKAGES_PATH
-}
-
-
-function clearcache
-{
-  CONF_FILES="build_rule target tools_def"
-  if [ -z "$EDK_TOOLS_PATH" ]
-  then
-    TEMPLATE_PATH=./BaseTools/Conf/
-  else
-    TEMPLATE_PATH="$EDK_TOOLS_PATH/Conf/"
-  fi
-
-  for File in $CONF_FILES
-  do
-    TEMPLATE_FILE="$TEMPLATE_PATH/$File.template"
-    CACHE_FILE="Conf/$File.txt"
-    if [ -e "$CACHE_FILE" -a "$TEMPLATE_FILE" -nt "$CACHE_FILE" ]
-    then
-      echo "Removing outdated '$CACHE_FILE'."
-      rm "$CACHE_FILE"
-    fi
-  done
-
-  unset TEMPLATE_PATH TEMPLATE_FILE CACHE_FILE
-}
-
-
-function uefishell
-{
-	BUILD_ARCH=`uname -m`
-	case $BUILD_ARCH in
-		arm*)
-			ARCH=ARM
-			;;
-		aarch64)
-			ARCH=AARCH64
-			;;
-		*)
-			unset ARCH
-			;;
-	esac
-	export ARCH
-	export EDK_TOOLS_PATH=`pwd`/BaseTools
-	clearcache
-	. edksetup.sh BaseTools
-	if [ $VERBOSE -eq 1 ]; then
-		echo "Building BaseTools"
-	fi
-	make -C $EDK_TOOLS_PATH
-	if [ $? -ne 0 ]; then
-		echo " !!! UEFI BaseTools failed to build !!! " >&2
-		exit 1
-	fi
-}
-
-
-function usage
-{
-	echo "usage:"
-	echo -n "uefi-build.sh [-b DEBUG | RELEASE] [ all "
-	for board in "${boards[@]}" ; do
-	    echo -n "| $board "
-	done
-	echo "]"
-	printf "%8s\tbuild %s\n" "all" "all supported platforms"
-	for board in "${boards[@]}" ; do
-		PLATFORM_NAME="`$TOOLS_DIR/parse-platforms.py $PLATFORM_CONFIG -p $board get -o longname`"
-		printf "%8s\tbuild %s\n" "$board" "${PLATFORM_NAME}"
-	done
-}
-
-#
-# Since we do a command line validation on whether specified platforms exist or
-# not, do a first pass of command line to see if there is an explicit config
-# file there to read valid platforms from.
-#
-commandline=( "$@" )
-i=0
-for arg;
-do
-	if [ $arg == "-c" ]; then
-		FILE_ARG=${commandline[i + 1]}
-		if [ ! -f "$FILE_ARG" ]; then
-			echo "ERROR: configuration file '$FILE_ARG' not found" >&2
-			exit 1
-		fi
-		case "$FILE_ARG" in
-			/*)
-				PLATFORM_CONFIG="-c $FILE_ARG"
-			;;
-			*)
-				PLATFORM_CONFIG="-c `readlink -f \"$FILE_ARG\"`"
-			;;
-		esac
-		echo "Platform config file: '$FILE_ARG'"
-		export PLATFORM_CONFIG
-	fi
-	i=$(($i + 1))
-done
-
-builds=()
-boards=()
-boardlist="`$TOOLS_DIR/parse-platforms.py $PLATFORM_CONFIG shortlist`"
-for board in $boardlist; do
-    boards=(${boards[@]} $board)
-done
-
-NUM_TARGETS=0
-
-while [ "$1" != "" ]; do
-	case $1 in
-		all )
-			builds=(${boards[@]})
-			NUM_TARGETS=$(($NUM_TARGETS + 1))
-			;;
-		"/h" | "/?" | "-?" | "-h" | "--help" )
-			usage
-			exit
-			;;
-		"-v" )
-			VERBOSE=1
-			;;
-		"-a" )
-			shift
-			ATF_DIR="$1"
-			;;
-		"-A" )
-			shift
-			DEFAULT_PLATFORM_ARCH="$1"
-			;;
-		"-c" )
-			# Already parsed above - skip this + option
-			shift
-			;;
-		"-s" )
-			shift
-			export TOS_DIR="$1"
-			;;
-		"-b" | "--build" )
-			shift
-			echo "Adding Build profile: $1"
-			TARGETS=( ${TARGETS[@]} $1 )
-			;;
-		"-D" )
-			shift
-			echo "Adding option: -D $1"
-			EXTRA_OPTIONS=( ${EXTRA_OPTIONS[@]} "-D" $1 )
-			;;
-		"-T" )
-			shift
-			echo "Setting toolchain to '$1'"
-			TOOLCHAIN="$1"
-			;;
-		"-1" )
-			NUM_THREADS=1
-			;;
-		* )
-			MATCH=0
-			for board in "${boards[@]}" ; do
-				if [ "$1" == $board ]; then
-					MATCH=1
-					builds=(${builds[@]} "$board")
-					break
-				fi
-			done
-
-			if [ $MATCH -eq 0 ]; then
-				echo "unknown arg $1"
-				usage
-				exit 1
-			fi
-			NUM_TARGETS=$(($NUM_TARGETS + 1))
-			;;
-	esac
-	shift
-done
-
-# If there were no args, use a menu to select a single board / all boards to build
-if [ $NUM_TARGETS -eq 0 ]
-then
-	read -p "$(
-			f=0
-			for board in "${boards[@]}" ; do
-					echo "$((++f)): $board"
-			done
-			echo $((++f)): all
-
-			echo -ne '> '
-	)" selection
-
-	if [ "$selection" -eq $((${#boards[@]} + 1)) ]; then
-		builds=(${boards[@]})
-	else
-		builds="${boards[$((selection-1))]}"
-	fi
-fi
-
-# Check to see if we are in a UEFI repository
-# refuse to continue if we aren't
-if [ ! -e BaseTools ]
-then
-	echo "ERROR: we aren't in the UEFI directory."
-	echo "       I can tell because I can't see the BaseTools directory"
-	exit 1
-fi
-
-EDK2_DIR="$PWD"
-export VERBOSE
-
-if [[ "${EXTRA_OPTIONS[@]}" != *"FIRMWARE_VER"* ]]; then
-	if test -d .git && head=`git rev-parse --verify --short HEAD 2>/dev/null`; then
-		FIRMWARE_VER=`git rev-parse --short HEAD`
-		if ! git diff-index --quiet HEAD --; then
-			FIRMWARE_VER="${FIRMWARE_VER}-dirty"
-		fi
-		EXTRA_OPTIONS=( ${EXTRA_OPTIONS[@]} "-D" FIRMWARE_VER=$FIRMWARE_VER )
-		if [ $VERBOSE -eq 1 ]; then
-			echo "FIRMWARE_VER=$FIRMWARE_VER"
-			echo "EXTRA_OPTIONS=$EXTRA_OPTIONS"
-		fi
-	fi
-fi
-
-uefishell
-
-if [ X"$TOOLCHAIN" = X"" ]; then
-	TOOLCHAIN=gcc
-fi
-
-for board in "${builds[@]}" ; do
-	do_build
-done
-
-result_print
diff --git a/uefi-tools/uefi-build.sh.bash_completion b/uefi-tools/uefi-build.sh.bash_completion
deleted file mode 100644
index f0a5305..0000000
--- a/uefi-tools/uefi-build.sh.bash_completion
+++ /dev/null
@@ -1,24 +0,0 @@
-# bash completion for uefi-build.sh
-# copy this file to /etc/bash_completion.d/uefi-build.s
-
-have uefi-build.sh &&
-_uefi-build.sh()
-{
-    local cur prev
-
-    COMPREPLY=()
-    _get_comp_words_by_ref -n = cur
-
-    _expand || return 0
-
-    COMPREPLY=( $( compgen -W '--help -b --build RELEASE DEBUG a5 a9 tc1 tc2 panda origen arndale rtsm_a9x4 rtsm_a15x1 rtsm_a15mpcore rtsm_aarch64 beagle all' -- "$cur" ) )
-} &&
-complete -F _uefi-build.sh uefi-build.sh
-
-# Local variables:
-# mode: shell-script
-# sh-basic-offset: 4
-# sh-indent-comment: t
-# indent-tabs-mode: nil
-# End:
-# ex: ts=4 sw=4 et filetype=sh