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#! /bin/sh 18 19[ -n "$1" ] || { 20 echo ""; 21 echo "usage:"; 22 echo " mkddrinit.sh <uboot bin>"; 23 echo " e.g." 24 echo " mkddrinit.sh u-boot.bin"; 25 echo ""; 26 exit 1; 27} 28 29if [ -f ../$1 ]; then 30 echo "get reginfo.bin from $1..." 31else 32 echo "no $1!!!" 33 exit 34fi 35dd if=../$1 of=./fb4 bs=1 count=8192 skip=64 36dd if=./ddr_init.bin of=./fb1 bs=1 count=64 37dd if=./fb4 of=./fb2 bs=8192 conv=sync 38dd if=./ddr_init.bin of=./fb3 bs=1 skip=8256 39cat fb1 fb2 fb3 > ddr_init_reg_info.bin 40rm -f fb1 fb2 fb3 fb4 41 42