12fe4e5f8Sopenharmony_ci# Copyright (C) 2021 HiSilicon (Shanghai) Technologies CO., LIMITED. 22fe4e5f8Sopenharmony_ci# 32fe4e5f8Sopenharmony_ci# This program is free software; you can redistribute it and/or 42fe4e5f8Sopenharmony_ci# modify it under the terms of the GNU General Public License 52fe4e5f8Sopenharmony_ci# as published by the Free Software Foundation; either version 2 62fe4e5f8Sopenharmony_ci# of the License, or (at your option) any later version. 72fe4e5f8Sopenharmony_ci# 82fe4e5f8Sopenharmony_ci# This program is distributed in the hope that it will be useful, 92fe4e5f8Sopenharmony_ci# but WITHOUT ANY WARRANTY; without even the implied warranty of 102fe4e5f8Sopenharmony_ci# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 112fe4e5f8Sopenharmony_ci# GNU General Public License for more details. 122fe4e5f8Sopenharmony_ci# 132fe4e5f8Sopenharmony_ci# You should have received a copy of the GNU General Public License 142fe4e5f8Sopenharmony_ci# along with this program; if not, write to the Free Software 152fe4e5f8Sopenharmony_ci# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 162fe4e5f8Sopenharmony_ci 172fe4e5f8Sopenharmony_ci.PHONY:all 182fe4e5f8Sopenharmony_ciexport SOC 192fe4e5f8Sopenharmony_ci 202fe4e5f8Sopenharmony_ci 212fe4e5f8Sopenharmony_ciSOC := hi3518ev300 222fe4e5f8Sopenharmony_ci 232fe4e5f8Sopenharmony_ciall:prepare ddrinit rsa2048pem_gen rsa4096pem_gen u-boot-rsa.bin aeskey2reg 242fe4e5f8Sopenharmony_ci#all:prepare rsa2048pem_gen rsa4096pem_gen u-boot-rsa.bin aeskey2reg 252fe4e5f8Sopenharmony_ciprepare: 262fe4e5f8Sopenharmony_ci gcc hash_modify.c -o HASH 272fe4e5f8Sopenharmony_ci gcc aeskey2reg.c -o AES 282fe4e5f8Sopenharmony_ciddrinit: 292fe4e5f8Sopenharmony_ci pushd ddr_init;make;./mkddrinit.sh u-boot-original.bin;popd 302fe4e5f8Sopenharmony_ci cp ./ddr_init/ddr_init_reg_info.bin ./ 312fe4e5f8Sopenharmony_ci 322fe4e5f8Sopenharmony_cirsa2048pem_gen: prepare ddrinit 332fe4e5f8Sopenharmony_ci#rsa2048pem_gen: prepare 342fe4e5f8Sopenharmony_ci ./rsa2048pem.sh 352fe4e5f8Sopenharmony_ci 362fe4e5f8Sopenharmony_cirsa4096pem_gen: prepare ddrinit 372fe4e5f8Sopenharmony_ci#rsa4096pem_gen: prepare 382fe4e5f8Sopenharmony_ci ./rsa4096pem.sh 392fe4e5f8Sopenharmony_ci 402fe4e5f8Sopenharmony_ciu-boot-rsa.bin: prepare ddrinit rsa2048pem_gen rsa4096pem_gen 412fe4e5f8Sopenharmony_ci#u-boot-rsa.bin: prepare rsa2048pem_gen rsa4096pem_gen 422fe4e5f8Sopenharmony_ci ./create_secure_boot.sh 432fe4e5f8Sopenharmony_ci 442fe4e5f8Sopenharmony_ci#aeskey2reg: 452fe4e5f8Sopenharmony_ci ./AES ./create_secure_boot.sh > aes_otp_cfg.txt 462fe4e5f8Sopenharmony_ciclean: 472fe4e5f8Sopenharmony_ci pushd ddr_init;make clean;popd 482fe4e5f8Sopenharmony_ci find . -name "*.bin" -exec rm -rf {} \; 492fe4e5f8Sopenharmony_cidistclean:clean 502fe4e5f8Sopenharmony_ci rm rsa2048pem/* 512fe4e5f8Sopenharmony_ci rm rsa4096pem/* 522fe4e5f8Sopenharmony_ci rm -rf aes_otp_cfg.txt 53