• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (C) 2021 HiSilicon (Shanghai) Technologies CO., LIMITED.
2#
3# This program is free software; you can redistribute it and/or
4# modify it under the terms of the GNU General Public License
5# as published by the Free Software Foundation; either version 2
6# of the License, or (at your option) any later version.
7#
8# This program is distributed in the hope that it will be useful,
9# but WITHOUT ANY WARRANTY; without even the implied warranty of
10# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11# GNU General Public License for more details.
12#
13# You should have received a copy of the GNU General Public License
14# along with this program; if not, write to the Free Software
15# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
16
17.PHONY:all
18export SOC
19
20
21SOC := hi3518ev300
22
23all:prepare ddrinit rsa2048pem_gen rsa4096pem_gen u-boot-rsa.bin aeskey2reg
24#all:prepare rsa2048pem_gen rsa4096pem_gen u-boot-rsa.bin aeskey2reg
25prepare:
26	gcc hash_modify.c -o HASH
27	gcc aeskey2reg.c -o AES
28ddrinit:
29	pushd ddr_init;make;./mkddrinit.sh u-boot-original.bin;popd
30	cp ./ddr_init/ddr_init_reg_info.bin ./
31
32rsa2048pem_gen: prepare ddrinit
33#rsa2048pem_gen: prepare
34	./rsa2048pem.sh
35
36rsa4096pem_gen: prepare ddrinit
37#rsa4096pem_gen: prepare
38	./rsa4096pem.sh
39
40u-boot-rsa.bin: prepare ddrinit rsa2048pem_gen rsa4096pem_gen
41#u-boot-rsa.bin: prepare rsa2048pem_gen rsa4096pem_gen
42	./create_secure_boot.sh
43
44#aeskey2reg:
45	./AES ./create_secure_boot.sh > aes_otp_cfg.txt
46clean:
47	pushd ddr_init;make clean;popd
48	find . -name "*.bin" -exec rm -rf {} \;
49distclean:clean
50	rm rsa2048pem/*
51	rm rsa4096pem/*
52	rm -rf aes_otp_cfg.txt
53