aboutsummaryrefslogtreecommitdiffstats
path: root/create_4412_emmc_image.sh
blob: f821d181f8781aa4d0aa25dd464733ae20b62632 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#
# Copyright (C) 2010 Samsung Electronics Co., Ltd.
#              http://www.samsung.com/
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
####################################
check_for_file()
{
    file="$1"
    if [ ! -f "${file}" ] ; then
        echo "Error: ${file} not found"
        exit 66 # EX_NOINPUT
    fi
}

if [ -z $1 ]
then
    echo "usage: ./create_4412_emmc_image.sh <output file>"
    exit 0
fi

block_size=512
#sizes are multiplied by block_size
#8kB
fwbl1_size=16
#16kB
bl2_size=32
#1024kB
uboot_size=2048

fwbl1_pos=0
bl2_pos=$(($fwbl1_pos + $fwbl1_size))
uboot_pos=$(($bl2_pos + $bl2_size))

####################################
check_for_file p4412_s_fwbl1.bin
dd if=p4412_s_fwbl1.bin of=$1 bs=$block_size seek=$fwbl1_pos
####################################
check_for_file spl/midas-spl.bin
dd if=spl/midas-spl.bin of=$1 bs=$block_size seek=$bl2_pos
####################################
check_for_file u-boot.bin
dd if=u-boot.bin of=$1 bs=$block_size seek=$uboot_pos
####################################

sync
#<Message Display>
echo "$1 - Exynos4412 U-Boot EMMC boot image is ready."