diff options
Diffstat (limited to 'installer')
-rw-r--r-- | installer/hikey960/fip.bin | bin | 1518592 -> 0 bytes | |||
-rwxr-xr-x | installer/hikey960/flash-all.sh | 47 | ||||
-rw-r--r-- | installer/hikey960/hisi-bl31.bin | bin | 148968 -> 0 bytes | |||
-rw-r--r-- | installer/hikey960/hisi-fastboot.img | bin | 3426304 -> 0 bytes | |||
-rw-r--r-- | installer/hikey960/hisi-lpm3.img | bin | 217344 -> 0 bytes | |||
-rw-r--r-- | installer/hikey960/hisi-nvme.img | bin | 131072 -> 0 bytes | |||
-rw-r--r-- | installer/hikey960/hisi-ptable.img | bin | 200704 -> 0 bytes | |||
-rw-r--r-- | installer/hikey960/hisi-sec_xloader.img | bin | 154752 -> 0 bytes | |||
-rw-r--r-- | installer/hikey960/l-loader.bin | bin | 25697 -> 0 bytes | |||
-rwxr-xr-x | installer/hikey960/legacy-flash-all.sh | 30 | ||||
-rwxr-xr-x | installer/hikey960/mkdtimg | 159 | ||||
-rw-r--r-- | installer/hikey960/prm_ptable.img | bin | 24576 -> 0 bytes | |||
-rwxr-xr-x | installer/hikey960/uefi-flash-all.sh | 3 |
13 files changed, 32 insertions, 207 deletions
diff --git a/installer/hikey960/fip.bin b/installer/hikey960/fip.bin Binary files differdeleted file mode 100644 index dcf61e25..00000000 --- a/installer/hikey960/fip.bin +++ /dev/null diff --git a/installer/hikey960/flash-all.sh b/installer/hikey960/flash-all.sh index 70bb4328..c894558c 100755 --- a/installer/hikey960/flash-all.sh +++ b/installer/hikey960/flash-all.sh @@ -5,7 +5,7 @@ ECHO_PREFIX="=== " # for cases that don't run "lunch hikey960-userdebug" if [ -z "${ANDROID_BUILD_TOP}" ]; then - ANDROID_BUILD_TOP=${INSTALLER_DIR}/../../../../../ + ANDROID_BUILD_TOP=$(cd ${INSTALLER_DIR}/../../../../../; pwd) ANDROID_PRODUCT_OUT="${ANDROID_BUILD_TOP}/out/target/product/hikey960" fi @@ -16,6 +16,22 @@ fi echo ${ECHO_PREFIX}"android out dir:${ANDROID_PRODUCT_OUT}" +. "${ANDROID_BUILD_TOP}/device/linaro/hikey/vendor-package-ver.sh" + +VENDOR_DIR=$ANDROID_BUILD_TOP/vendor/linaro/hikey960/${EXPECTED_LINARO_VENDOR_VERSION}/ + +# TODO: Pull one-time recovery/qdl path out of standard install +# Flash bootloader firmware files +if [ ! -d "${VENDOR_DIR}/" ]; then + echo "FLASH-ALL-AOSP: Missing vendor firmware package?" + echo " Make sure the vendor binaries have been downloaded from" + echo " ${VND_PKG_URL}" + echo " and extracted to $ANDROID_BUILD_TOP." + exit +fi + +pushd $VENDOR_DIR/bootloader/ + function check_partition_table_version () { fastboot erase reserved if [ $? -eq 0 ] @@ -27,21 +43,21 @@ function check_partition_table_version () { } function flashing_atf_uefi () { - fastboot flash ptable "${INSTALLER_DIR}"/prm_ptable.img - fastboot flash xloader "${INSTALLER_DIR}"/hisi-sec_xloader.img + fastboot flash ptable prm_ptable.img + fastboot flash xloader 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 flash fastboot l-loader.bin + fastboot flash fip fip.bin + fastboot flash nvme hisi-nvme.img + fastboot flash fw_lpm3 hisi-lpm3.img + fastboot flash trustfirmware 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 ptable prm_ptable.img + fastboot flash xloader hisi-sec_xloader.img + fastboot flash fastboot l-loader.bin + fastboot flash fip fip.bin fastboot flash boot "${ANDROID_PRODUCT_OUT}"/boot.img fastboot flash super "${ANDROID_PRODUCT_OUT}"/super.img @@ -50,9 +66,9 @@ function flashing_atf_uefi () { } 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 flash xloader hisi-sec_xloader.img + fastboot flash ptable hisi-ptable.img + fastboot flash fastboot hisi-fastboot.img fastboot reboot-bootloader } @@ -73,3 +89,4 @@ else fi fastboot reboot +popd diff --git a/installer/hikey960/hisi-bl31.bin b/installer/hikey960/hisi-bl31.bin Binary files differdeleted file mode 100644 index abebea6d..00000000 --- a/installer/hikey960/hisi-bl31.bin +++ /dev/null diff --git a/installer/hikey960/hisi-fastboot.img b/installer/hikey960/hisi-fastboot.img Binary files differdeleted file mode 100644 index 72cbf90f..00000000 --- a/installer/hikey960/hisi-fastboot.img +++ /dev/null diff --git a/installer/hikey960/hisi-lpm3.img b/installer/hikey960/hisi-lpm3.img Binary files differdeleted file mode 100644 index bd0243bf..00000000 --- a/installer/hikey960/hisi-lpm3.img +++ /dev/null diff --git a/installer/hikey960/hisi-nvme.img b/installer/hikey960/hisi-nvme.img Binary files differdeleted file mode 100644 index ca5bc7c1..00000000 --- a/installer/hikey960/hisi-nvme.img +++ /dev/null diff --git a/installer/hikey960/hisi-ptable.img b/installer/hikey960/hisi-ptable.img Binary files differdeleted file mode 100644 index 269aa63d..00000000 --- a/installer/hikey960/hisi-ptable.img +++ /dev/null diff --git a/installer/hikey960/hisi-sec_xloader.img b/installer/hikey960/hisi-sec_xloader.img Binary files differdeleted file mode 100644 index 47c353b8..00000000 --- a/installer/hikey960/hisi-sec_xloader.img +++ /dev/null diff --git a/installer/hikey960/l-loader.bin b/installer/hikey960/l-loader.bin Binary files differdeleted file mode 100644 index e0c37260..00000000 --- a/installer/hikey960/l-loader.bin +++ /dev/null diff --git a/installer/hikey960/legacy-flash-all.sh b/installer/hikey960/legacy-flash-all.sh deleted file mode 100755 index 3f8bf9b4..00000000 --- a/installer/hikey960/legacy-flash-all.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/bash - -INSTALLER_DIR="`dirname ${0}`" - -# 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 "error in locating out directory, check if it exist" - exit -fi - -echo "android out dir:${ANDROID_PRODUCT_OUT}" - -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 -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 flash boot "${ANDROID_PRODUCT_OUT}"/boot.img -fastboot flash dts "${ANDROID_PRODUCT_OUT}"/dt.img -fastboot flash super "${ANDROID_PRODUCT_OUT}"/super.img -fastboot flash userdata "${ANDROID_PRODUCT_OUT}"/userdata.img -fastboot format:ext4:10000000 cache -fastboot reboot diff --git a/installer/hikey960/mkdtimg b/installer/hikey960/mkdtimg deleted file mode 100755 index 65722043..00000000 --- a/installer/hikey960/mkdtimg +++ /dev/null @@ -1,159 +0,0 @@ -#!/usr/bin/env python -# Copyright 2017, The Android Open Source Project -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -from __future__ import print_function -try: - from os import fstat, stat, remove - from sys import exit - from argparse import ArgumentParser, FileType - from ctypes import sizeof, Structure, c_char, c_int - from struct import pack, calcsize - import zlib -except Exception as e: - print("some module is needed:" + str(e)) - exit(-1) - -dt_head_info_fmt = '4sII' -dt_entry_fmt = 'Q4I2Q' -dtimg_version = 1 -dtb_count = 1 - -def write32(output, value): - output.write(chr(value & 255)) ; value=value // 256 - output.write(chr(value & 255)) ; value=value // 256 - output.write(chr(value & 255)) ; value=value // 256 - output.write(chr(value & 255)) - -def compress(filename, input, output): - output.write('\037\213\010') - output.write(chr(0)) - - statval = stat(filename) - write32(output, 0) - output.write('\002') - output.write('\003') - - crcval = zlib.crc32("") - compobj = zlib.compressobj(9, zlib.DEFLATED, -zlib.MAX_WBITS, - zlib.DEF_MEM_LEVEL, 0) - while True: - data = input.read(1024) - if data == "": - break - crcval = zlib.crc32(data, crcval) - output.write(compobj.compress(data)) - output.write(compobj.flush()) - write32(output, crcval) - write32(output, statval.st_size) - -def dtb_compress(dtb_file): - try: - outputname = dtb_file + '.gz' - input = open(dtb_file, 'rb') - output = open(outputname, 'wb') - compress(dtb_file, input, output) - input.close() - output.close() - except Exception as e: - print('dtb_compress error:' + str(e)) - exit(-1) - return outputname - -class dt_head_info(Structure): - _fields_ = [('magic', c_char * 4), - ('version', c_int), - ('dt_count', c_int)] - -class dt_entry_t(Structure): - _fields_ = [('dtb_size', c_int), - ('dtb_offset', c_int)] - -def align_page_size(offset, pagesize): - return (pagesize - (offset % pagesize)) - -def write_head_info(head_info, args): - args.output.write(pack(dt_head_info_fmt, - head_info.magic, - head_info.version, - head_info.dt_count)) - -def write_dtb_entry_t(dt_entry, args): - args.output.write(pack(dt_entry_fmt, - 0, # reserved - dt_entry.dtb_size, - 0, # reserved - dt_entry.dtb_offset, - 0, # reserved - 0, # reserved - 0)) # reserved - -def write_padding(args, padding): - for i in range(0, padding): - args.output.write('\x00') - -def write_dtb(args): - dtb_file = args.dtb - out_dtb = dtb_file - if args.compress == True: - out_dtb = dtb_compress(dtb_file) - try: - dtb_offset = calcsize(dt_head_info_fmt) + \ - calcsize(dt_entry_fmt) + \ - 4 - padding = align_page_size(dtb_offset, args.pagesize) - dtb_size = stat(out_dtb).st_size - dtb_size_padding = align_page_size(dtb_size, args.pagesize) - dt_entry = dt_entry_t(dtb_size + dtb_size_padding, - dtb_offset + padding) - write_dtb_entry_t(dt_entry, args) - args.output.write(pack('I', 0)) # SUCCESS code number - write_padding(args, padding) - with open(out_dtb, 'rb') as dtb_fd: - args.output.write(dtb_fd.read(dtb_size)) - write_padding(args, dtb_size_padding) - except Exception as e: - print('write dtb error:' + str(e)) - exit(-1) - -def clean_gz_file(args): - try: - if args.compress != True: - return - remove(args.dtb + '.gz') - except Exception as e: - print('clean gz file error:' + str(e)) - exit(-1) - -def parse_cmdline(): - parser = ArgumentParser() - parser.add_argument('-c', '--compress', help='compress dtb or not', - action='store_true') - parser.add_argument('-d', '--dtb', help='path to the dtb', type=str, - required=True) - parser.add_argument('-s', '--pagesize', help='align page size', - type=int, choices=[2**i for i in range(11,15)], - default=2048) - parser.add_argument('-o', '--output', help='output file name', - type=FileType('wb'), required=True) - return parser.parse_args() - -def main(): - args = parse_cmdline() - dtimg_head_info = dt_head_info('HSDT', dtimg_version, dtb_count) - write_head_info(dtimg_head_info, args) - write_dtb(args) - clean_gz_file(args) - -if __name__ == '__main__': - main() diff --git a/installer/hikey960/prm_ptable.img b/installer/hikey960/prm_ptable.img Binary files differdeleted file mode 100644 index e7b9b037..00000000 --- a/installer/hikey960/prm_ptable.img +++ /dev/null diff --git a/installer/hikey960/uefi-flash-all.sh b/installer/hikey960/uefi-flash-all.sh deleted file mode 100755 index 347b5b28..00000000 --- a/installer/hikey960/uefi-flash-all.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash -INSTALLER_DIR="`dirname ${0}`" -${INSTALLER_DIR}/flash-all.sh |