hikey: Add UEFI sources for reference

UEFI needs to be built outside Android build system.
Please follow the instructions in README.

The sources correspond to:
https://github.com/96boards/edk2/commit/14eae0c12e71fd33c4c0fc51e4475e8db02566cf
https://github.com/96boards/arm-trusted-firmware/commit/e9b4909dcd75fc4ae7041cfb83d28ab9adb7afdf
https://github.com/96boards/l-loader/commit/6b784ad5c4ab00e2b1c6f53cd5f74054e5d00a78
https://git.linaro.org/uefi/uefi-tools.git/commit/abe618f8ab72034fff1ce46c9c006a2c6bd40a7e

Change-Id: Ieeefdb63e673e0c8e64e0a1f02c7bddc63b2c7fb
Signed-off-by: Vishal Bhoj <vishal.bhoj@linaro.org>
diff --git a/uefi/uefi-tools/parse-platforms.py b/uefi/uefi-tools/parse-platforms.py
new file mode 100755
index 0000000..af44038
--- /dev/null
+++ b/uefi/uefi-tools/parse-platforms.py
@@ -0,0 +1,81 @@
+#!/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)