[Feature]add MT2731_MP2_MR2_SVN388 baseline version
Change-Id: Ief04314834b31e27effab435d3ca8ba33b499059
diff --git a/meta/meta-mediatek/recipes-bsp/lk/files/dev_info/dtb-transfer-array.py b/meta/meta-mediatek/recipes-bsp/lk/files/dev_info/dtb-transfer-array.py
new file mode 100644
index 0000000..c6b3583
--- /dev/null
+++ b/meta/meta-mediatek/recipes-bsp/lk/files/dev_info/dtb-transfer-array.py
@@ -0,0 +1,41 @@
+import os
+import sys
+
+def read_dtb(filename, raw_data):
+ fin = open(filename, 'rb')
+ fin.seek(0, 0)
+ while True:
+ t_byte = fin.read(1)
+ if len(t_byte) == 0:
+ break
+ else :
+ raw_data.append("0x%.2X" % ord(t_byte))
+
+def write_blob_head_file(filename, raw_data, length):
+ fout = open(filename, 'w+')
+ fout.write('#define CHECK_RSA 1 \n')
+ fout.write('#define CHECK_HASH 1 \n')
+ fout.write('const unsigned char blob[] __attribute__((aligned(4))) = \n')
+ fout.write('{\n ')
+
+ i = 0
+ for data in raw_data:
+ i += 1
+ if i != length:
+ fout.write(data + ', ')
+ else:
+ fout.write(data)
+ if i % 16 == 0:
+ fout.write('\n ')
+ if i == length:
+ break;
+ fout.write('\n};')
+ fout.close()
+
+if __name__ == "__main__":
+ raw_data = []
+ in_path = str(sys.argv[1]);
+ out_path = str(sys.argv[2]);
+ length = int(sys.argv[3],16);
+ read_dtb(in_path, raw_data)
+ write_blob_head_file(out_path, raw_data, length)