~ogra/+junk/dragonboard

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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
# Create a 16MB (or whatever size you want indeed :) ) disk image:

rm sdcard.img && dd if=/dev/zero of=sdcard.img bs=1024 count=1 seek=16384

# create the partitioning:

./partitioner.sh sdcard.img

# (that prints a lot of info for each partition it creates)

# now flash the firmware blobs and uboot.img:

./flasher.sh sdcard.img

# create your actual boot partition to hold kernel, initrd
# and dtb:

sudo sgdisk -a 1 -N 8 sdcard.img
sudo sgdisk -c 8:system-boot sdcard.img
sudo sgdisk -t 8:0700 sdcard.img

# format it as fat16:

sudo kpartx -av sdcard.img

mkdosfs -F 16 -n system-boot /dev/mapper/loop1p8

# (note, you might not have loop1, use whatever device name
# kpartx printed, you want p8 though)

# mount it and copy the uboot.env over (and if you want,
# initrd.img, vmlinuz and msm8916-mtp.dtb)

sudo mount /dev/mapper/loop1p8 /mnt
sudo cp uboot.env /mnt/
sudo umount /mnt

# clean up the loop devices

sudo kpartx -d sdcard.img

# finally write the whole thing to SD card (my reader shows
# up as /dev/sdc, yours might differ):

sudo dd if=sdcard.img of=/dev/sdc bs=4M

# now just plug that card into your dragonboard, make sure
# the dip switch at the bottom has SD booting enabled and
# boot away into uboot on serial console. the setup will
# auto-load "vmlinuz", "initrd.img" and "msm8916-mtp.dtb"
# from the vfat "system-boot" partition and boot them.


# The files:
#
# For all scripts and non external files in this folder the
# COPYING file applies
#
# qualcomm binary blobs needed to initialize the hardware
# downloaded from [1]
# hyp.mbn
# rpm.mbn
# sbl1.mbn
# sec.dat
# tz.mbn
#
# a build of the little-kernel (aboot) with SD card support
# downloaded with [2], patched with [3] (see [4] for details)
# sd_appsboot.mbn
#
# the uboot environment, uboot.env was created using the
# mkenvimage tool from a recent uboot build tree, using
# uboot.env.in as input file. the command used was:
# mkenvimage -r -s 131072  -o uboot.env uboot.env.in
# uboot.env
# uboot.env.in
# mkenvimage
#
# binary from the dragonboard uboot tree with a few config
# modifications downloaded from [5] patched with uboot.patch
# u-boot.img
# uboot.patch
#
# the scripts to assemble an image, parts.txt is the input
# file for the partitioner.sh script
# flasher.sh
# partitioner.sh
# parts.txt
#
# and there a fully built sdcard.img file that was created
# using the above process to dd to an SD card right away
# (you might want to adjust the uboot.env.in file for the
# "bootcmd" variable to match your desired kernel cmdline
# and regenerate uboot.env)
#
# [1] http://builds.96boards.org/releases/dragonboard410c/linaro/rescue/latest/dragonboard410c_bootloader_emmc_linux-40.zip
# [2] git clone http://git.linaro.org/landing-teams/working/qualcomm/lk.git -b ubuntu-qcom-dragonboard410c-LA.BR.1.2.4-00310-8x16.0-linaro1
# [3] https://git.linaro.org/landing-teams/working/qualcomm/lk.git/patch/?id=3bac025eb7a081f7f1598fdb5e7cb0c25912bdf0
# [4] https://github.com/96boards/documentation/wiki/CE-Debian-RPB-Dragonboard410c-15.10-Build#how-to-get-and-customize-the-bootloader
# [5] https://github.com/hallor/u-boot/releases/tag/dragonboard-2015.11.21