]> git.sur5r.net Git - u-boot/blob - board/qualcomm/dragonboard820c/readme.txt
1f310b31c75d3e425f5ef03305cc28ab278c8f29
[u-boot] / board / qualcomm / dragonboard820c / readme.txt
1 #
2 # (C) Copyright 2017 Jorge Ramirez-Ortiz <jorge.ramirez-ortiz@linaro.org>
3 #
4 # SPDX-License-Identifier:      GPL-2.0+
5 #
6
7 ================================================================================
8              What is working (enough to boot a distro from SD card)
9 ================================================================================
10    - UART
11    - SD card
12    - PSCI reset
13    - Environment in EXT4 partition 1 in SD card (check defconfig for details)
14          dont forget to insert the card in the SD slot before booting if you
15          are going to make mods to the environment
16
17 ================================================================================
18                      Build & Run instructions
19 ================================================================================
20
21 1) Install mkbootimg and dtbTool from Codeaurora:
22
23    git://codeaurora.org/quic/kernel/skales
24    commit 8492547e404e969262d9070dee9bdd15668bb70f worked for me.
25
26 2) Setup CROSS_COMPILE to aarch64 compiler or if you use ccache just do
27    CROSS_COMPILE="ccache aarch64-linux-gnu-"
28
29 3) cd to the u-boot tree
30
31   $ make dragonboard820c_config
32   $ make -j `nproc`
33
34 4) generate fake, empty ramdisk (can have 0 bytes)
35
36    $ touch rd
37
38 5) Generate qualcomm device tree table with dtbTool
39
40    $ dtbTool -o dt.img arch/arm/dts
41
42 6) Generate Android boot image with mkbootimg:
43
44    $ mkbootimg --kernel=u-boot-dtb.bin             \
45                --output=u-boot.img                 \
46                --dt=dt.img                         \
47                --pagesize 4096                     \
48                --base 0x80000000                   \
49                --ramdisk=rd                        \
50                --cmdline=""
51
52 7) Reboot the board into fastboot mode
53    - plug the board micro-usb to your laptop usb host.
54    - reboot the board with vol- button pressed
55
56 8) Boot the uboot image using fastboot
57
58    $ fastboot boot u-boot.img
59
60    or flash it to the UFS drive boot partition:
61
62    $ fastboot flash boot u-boot.img
63    $ fastboot reboot
64
65
66 ================================================================================
67       To boot a linux kernel from SDHCI with the ROOTFS on an NFS share:
68 ================================================================================
69
70 1) create an EXT4 partition on the SD card (must be partition #1)
71
72 2) build the kernel image and dtb  (documented extensively somewhere else)
73
74 3) copy the drivers to the NFS partition (ie: 192.168.1.2 /exports/db820c-rootfs)
75
76 4) add the u-boot headers to the image:
77
78     $ mkimage -A arm64                                     \
79               -O linux                                     \
80               -C none                                      \
81               -T kernel                                    \
82               -a 0x80080000                                \
83               -e 0x80080000                                \
84               -n Dragonboard820c                           \
85               -d $kernel/arch/arm64/boot/Image             \
86               uImage
87
88 5) copy the generated uImage and the device tree binary to the SD card EXT4
89    partition
90
91     $ cp uImage /mnt/boot/
92     $ cp apq8096-db820c.dtb /mnt/boot/
93
94 6) on the SD card create /extlinux/extlinux.conf  as follows:
95
96    default nfs
97    prompt 1
98    timeout 10
99
100    LABEL nfs
101       MENU NFS entry
102       LINUX /uImage
103       FDT /apq8096-db820c.dtb
104       APPEND root=/dev/nfs rw                                         \
105              nfsroot=192.168.1.2:/exports/db829c-rootfs,v3,tcp        \
106              rootwait                                                 \
107              ip=dhcp consoleblank=0                                   \
108              console=tty0                                             \
109              console=ttyMSM0,115200n8                                 \
110              earlyprintk earlycon=msm_serial_dm,0x75b0000             \
111              androidboot.bootdevice=624000.ufshc                      \
112              androidboot.verifiedbootstate=orange                     \
113              androidboot.ver0
114
115 7) remove the SD card from the laptop and insert it back to the db820 board.
116    the SD card EXT4 partition#1 should contain:
117       /uImage
118       /apq8096-db820c.dtb
119       /extlinux/extlinux.conf
120
121 8) reboot the db820 board
122
123 ================================================================================
124                     Successful boot sequence
125 ================================================================================
126
127 Format: Log Type - Time(microsec) - Message - Optional Info
128 Log Type: B - Since Boot(Power On Reset),  D - Delta,  S - Statistic
129 S - QC_IMAGE_VERSION_STRING=BOOT.XF.1.0-00301
130 S - IMAGE_VARIANT_STRING=M8996LAB
131 S - OEM_IMAGE_VERSION_STRING=crm-ubuntu68
132 S - Boot Interface: UFS
133 S - Secure Boot: Off
134 S - Boot Config @ 0x00076044 = 0x000001c9
135 S - JTAG ID @ 0x000760f4 = 0x4003e0e1
136 S - OEM ID @ 0x000760f8 = 0x00000000
137 S - Serial Number @ 0x00074138 = 0x2e8844ce
138 S - OEM Config Row 0 @ 0x00074188 = 0x0000000000000000
139 S - OEM Config Row 1 @ 0x00074190 = 0x0000000000000000
140 S - Feature Config Row 0 @ 0x000741a0 = 0x0050000010000100
141 S - Feature Config Row 1 @ 0x000741a8 = 0x00fff00001ffffff
142 S - Core 0 Frequency, 1228 MHz
143 B -         0 - PBL, Start
144 B -     10412 - bootable_media_detect_entry, Start
145 B -     47480 - bootable_media_detect_success, Start
146 B -     47481 - elf_loader_entry, Start
147 B -     49027 - auth_hash_seg_entry, Start
148 B -     49129 - auth_hash_seg_exit, Start
149 B -     82403 - elf_segs_hash_verify_entry, Start
150 B -     84905 - PBL, End
151 B -     86955 - SBL1, Start
152 B -    182969 - usb: hs_phy_nondrive_start
153 B -    183305 - usb: PLL lock success - 0x3
154 B -    186294 - usb: hs_phy_nondrive_finish
155 B -    190442 - boot_flash_init, Start
156 D -        30 - boot_flash_init, Delta
157 B -    197548 - sbl1_ddr_set_default_params, Start
158 D -        30 - sbl1_ddr_set_default_params, Delta
159 B -    205509 - boot_config_data_table_init, Start
160 D -    200659 - boot_config_data_table_init, Delta - (60 Bytes)
161 B -    410713 - CDT Version:3,Platform ID:24,Major ID:1,Minor ID:0,Subtype:0
162 B -    415410 - Image Load, Start
163 D -     22570 - PMIC Image Loaded, Delta - (37272 Bytes)
164 B -    437980 - pm_device_init, Start
165 B -    443744 - PON REASON:PM0:0x200000061 PM1:0x200000021
166 B -    480161 - PM_SET_VAL:Skip
167 D -     40016 - pm_device_init, Delta
168 B -    482083 - pm_driver_init, Start
169 D -      2928 - pm_driver_init, Delta
170 B -    488671 - pm_sbl_chg_init, Start
171 D -        91 - pm_sbl_chg_init, Delta
172 B -    495442 - vsense_init, Start
173 D -         0 - vsense_init, Delta
174 B -    505171 - Pre_DDR_clock_init, Start
175 D -       396 - Pre_DDR_clock_init, Delta
176 B -    509045 - ddr_initialize_device, Start
177 B -    512766 - 8996 v3.x detected, Max frequency = 1.8 GHz
178 B -    522373 - ddr_initialize_device, Delta
179 B -    522404 - DDR ID, Rank 0, Rank 1, 0x6, 0x300, 0x300
180 B -    526247 - Basic DDR tests done
181 B -    594994 - clock_init, Start
182 D -       274 - clock_init, Delta
183 B -    598349 - Image Load, Start
184 D -      4331 - QSEE Dev Config Image Loaded, Delta - (46008 Bytes)
185 B -    603808 - Image Load, Start
186 D -      5338 - APDP Image Loaded, Delta - (0 Bytes)
187 B -    612409 - usb: UFS Serial - 2f490ecf
188 B -    616801 - usb: fedl, vbus_low
189 B -    620431 - Image Load, Start
190 D -     55418 - QSEE Image Loaded, Delta - (1640572 Bytes)
191 B -    675849 - Image Load, Start
192 D -      2013 - SEC Image Loaded, Delta - (4096 Bytes)
193 B -    683413 - sbl1_efs_handle_cookies, Start
194 D -       457 - sbl1_efs_handle_cookies, Delta
195 B -    691892 - Image Load, Start
196 D -     14396 - QHEE Image Loaded, Delta - (254184 Bytes)
197 B -    706319 - Image Load, Start
198 D -     14061 - RPM Image Loaded, Delta - (223900 Bytes)
199 B -    721111 - Image Load, Start
200 D -      3233 - STI Image Loaded, Delta - (0 Bytes)
201 B -    727913 - Image Load, Start
202 D -     34709 - APPSBL Image Loaded, Delta - (748716 Bytes)
203 B -    762713 - SBL1, End
204 D -    680028 - SBL1, Delta
205 S - Flash Throughput, 94000 KB/s  (2959024 Bytes,  31250 us)
206 S - DDR Frequency, 1017 MHz
207 Android Bootloader - UART_DM Initialized!!!
208
209 [0] BUILD_VERSION=
210 [0] BUILD_DATE=16:07:51 - Nov 17 2017
211 [0] welcome to lk
212 [10] platform_init()
213 [10] target_init()
214 [10] RPM GLink Init
215 [10] Opening RPM Glink Port success
216 [10] Opening SSR Glink Port success
217 [20] Glink Connection between APPS and RPM established
218 [20] Glink Connection between APPS and RPM established
219 [40] UFS init success
220 [80] Qseecom Init Done in Appsbl
221 [80] secure app region addr=0x86600000 size=0x2200000[90] TZ App region notif returned with status:0 addr:86600000 size:35651584
222 [100] TZ App log region register returned with status:0 addr:916d4000 size:4096
223 [100] Qseecom TZ Init Done in Appsbl
224 [120] Loading cmnlib done
225 [120] qseecom_start_app: Loading app keymaster for the first time
226 [150] <8>keymaster: "\"KEYMASTER Init \""
227 [160] Selected panel: none
228 Skip panel configuration
229 [160] pm8x41_get_is_cold_boot: cold boot
230 [170] boot_verifier: Device is in ORANGE boot state.
231 [180] Device is unlocked! Skipping verification...
232 [180] Loading (boot) image (348160): start
233 [190] Loading (boot) image (348160): done
234 [190] use_signed_kernel=1, is_unlocked=1, is_tampered=0.
235 [200] Your device has been unlocked and cant be trusted.
236 Wait for 5 seconds before proceeding
237
238 [5200] mdtp: mdtp_img loaded
239 [5210] mdtp: is_test_mode: test mode is set to 1
240 [5210] mdtp: read_metadata: SUCCESS
241 [5230] LK SEC APP Handle: 0x1
242 [5230] Return value from recv_data: 14
243 [5240] Return value from recv_data: 14
244 [5250] Return value from recv_data: 14
245 [5260] DTB Total entry: 1, DTB version: 3
246 [5260] Using DTB entry 0x00000123/00000000/0x00000018/0 for device 0x00000123/00030001/0x00010018/0
247 [5270] cmdline:  androidboot.bootdevice=624000.ufshc androidboot.verifiedbootstate=orange androidboot.veritymode=enforcing androidboot.serialno=2f490ecf androidboot.baseband=apq mdss_mdp.panel=0
248 [5290] Updating device tree: start
249 [5290] Updating device tree: done
250 [5290] Return value from recv_data: 14
251 [5300] RPM GLINK UnInit
252 [5300] Qseecom De-Init Done in Appsbl
253 [5300] booting linux @ 0x80080000, ramdisk @ 0x82200000 (0), tags/device tree @ 0x82000000
254 [5310] Jumping to kernel via monitor
255
256 U-Boot 2017.11-00145-ge895117 (Nov 29 2017 - 10:04:06 +0100)
257 Qualcomm-DragonBoard 820C
258
259 DRAM:  3 GiB
260 PSCI:  v1.0
261 MMC:   sdhci@74a4900: 0
262 In:    serial@75b0000
263 Out:   serial@75b0000
264 Err:   serial@75b0000
265 Net:   Net Initialization Skipped
266 No ethernet found.
267 Hit any key to stop autoboot:  0
268 switch to partitions #0, OK
269 mmc0 is current device
270 Scanning mmc 0:1...
271 Found /extlinux/extlinux.conf
272 Retrieving file: /extlinux/extlinux.conf
273 433 bytes read in 71 ms (5.9 KiB/s)
274 1:      nfs root
275
276 Retrieving file: /uImage
277 19397184 bytes read in 2024 ms (9.1 MiB/s)
278 append: root=/dev/nfs rw nfsroot=192.168.1.2:/db820c/rootfs,v3,tcp rootwait ip=dhcp consoleblank=0 console=tty0 console=ttyMSM0,115200n8 earlyprintk earlycon=msm_serial_dm,0x75b0000 androidboot.bootdevice=624000.ufshc androidboot.verifiedbootstate=orange androidboot.ver0
279
280 Retrieving file: /apq8096-db820c.dtb
281 38134 bytes read in 37 ms (1005.9 KiB/s)
282
283 ## Booting kernel from Legacy Image at 95000000 ...
284    Image Name:   Dragonboard820c
285    Image Type:   AArch64 Linux Kernel Image (uncompressed)
286    Data Size:    19397120 Bytes = 18.5 MiB
287    Load Address: 80080000
288    Entry Point:  80080000
289    Verifying Checksum ... OK
290 ## Flattened Device Tree blob at 93000000
291    Booting using the fdt blob at 0x93000000
292    Loading Kernel Image ... OK
293    Using Device Tree in place at 0000000093000000, end 000000009300c4f5
294
295 Starting kernel ...
296
297 [    0.000000] Booting Linux on physical CPU 0x0
298 [    0.000000] Linux version 4.11.3-30039-g5a922a1 (jramirez@igloo) (gcc version 6.3.1 20170404 (Linaro GCC 6.3-2017.05) ) #1 SMP PREEMPT Wed Oct 18 10:21:11 CEST 2017
299 [    0.000000] Boot CPU: AArch64 Processor [511f2112]
300 [    0.000000] earlycon: msm_serial_dm0 at MMIO 0x00000000075b0000 (options '')
301 [    0.000000] bootconsole [msm_serial_dm0] enabled
302 [    0.000000] efi: Getting EFI parameters from FDT:
303 [    0.000000] efi: UEFI not found.
304 [    0.000000] OF: reserved mem: OVERLAP DETECTED!
305 [    0.000000] adsp@8ea00000 (0x000000008ea00000--0x0000000090400000) overlaps with gpu@8f200000 (0x000000008f200000--0x000000008f300000)
306 [    0.000000] Reserved memory: created DMA memory pool at 0x000000008f200000, size 1 MiB
307 [    0.000000] OF: reserved mem: initialized node gpu@8f200000, compatible id shared-dma-pool
308 [    0.000000] Reserved memory: created DMA memory pool at 0x0000000090400000, size 8 MiB
309 [    0.000000] OF: reserved mem: initialized node venus@90400000, compatible id shared-dma-pool
310 [    0.000000] cma: Reserved 128 MiB at 0x00000000b8000000
311 [    0.000000] NUMA: No NUMA configuration found
312 [    0.000000] NUMA: Faking a node at [mem 0x0000000000000000-0x00000000bfffffff]
313 [    0.000000] NUMA: Adding memblock [0x80000000 - 0x857fffff] on node 0
314 [    0.000000] NUMA: Adding memblock [0x91800000 - 0xbfffffff] on node 0
315 [    0.000000] NUMA: Initmem setup node 0 [mem 0x80000000-0xbfffffff]
316 [    0.000000] NUMA: NODE_DATA [mem 0xb7fb6680-0xb7fb817f]
317 [    0.000000] Zone ranges:
318 [    0.000000]   DMA      [mem 0x0000000080000000-0x00000000bfffffff]
319 [    0.000000]   Normal   empty
320 [    0.000000] Movable zone start for each node
321 [    0.000000] Early memory node ranges
322 [    0.000000]   node   0: [mem 0x0000000080000000-0x00000000857fffff]
323 [    0.000000]   node   0: [mem 0x0000000091800000-0x00000000bfffffff]
324 [    0.000000] Initmem setup node 0 [mem 0x0000000080000000-0x00000000bfffffff]
325 [    0.000000] psci: probing for conduit method from DT.
326 [    0.000000] psci: PSCIv1.0 detected in firmware.
327 [    0.000000] psci: Using standard PSCI v0.2 function IDs
328 [    0.000000] psci: MIGRATE_INFO_TYPE not supported.
329 [    0.000000] percpu: Embedded 23 pages/cpu @ffff8000de9a3000 s57240 r8192 d28776 u94208
330 [    0.000000] pcpu-alloc: s57240 r8192 d28776 u94208 alloc=23*4096
331 [    0.000000] pcpu-alloc: [0] 0 [0] 1 [0] 2 [0] 3
332 [    0.000000] Detected PIPT I-cache on CPU0
333 [    0.000000] Built 1 zonelists in Node order, mobility grouping on.  Total pages: 720293
334 [    0.000000] Policy zone: Normal
335 [    0.000000] Kernel command line: root=/dev/nfs rw nfsroot=192.168.1.2:/db820c/rootfs,v3,tcp rootwait ip=dhcp consoleblank=0
336 console=tty0 console=ttyMSM0,115200n8 earlyprintk earlycon=msm_serial_dm,0x75b0000 androidboot.bootdevice=624000.ufshc androidboot.verifiedbootstate=orange a
337 ndroidboot.ver0
338 [    0.000000] PID hash table entries: 4096 (order: 3, 32768 bytes)
339 [    0.000000] software IO TLB [mem 0xd3fff000-0xd7fff000] (64MB) mapped at [ffff800053fff000-ffff800057ffefff]
340 [    0.000000] Memory: 2644172K/2926908K available (11196K kernel code, 1470K rwdata, 5132K rodata, 1088K init, 449K bss, 151664K reserved, 131072K cma-reser
341 ved)
342 [    0.000000] Virtual kernel memory layout:
343 [    0.000000]     modules : 0xffff000000000000 - 0xffff000008000000   (   128 MB)
344 [    0.000000]     vmalloc : 0xffff000008000000 - 0xffff7dffbfff0000   (129022 GB)
345 [    0.000000]       .text : 0xffff000008080000 - 0xffff000008b70000   ( 11200 KB)
346 [    0.000000]     .rodata : 0xffff000008b70000 - 0xffff000009080000   (  5184 KB)
347 [    0.000000]       .init : 0xffff000009080000 - 0xffff000009190000   (  1088 KB)
348 [    0.000000]       .data : 0xffff000009190000 - 0xffff0000092ffa00   (  1471 KB)
349 [    0.000000]        .bss : 0xffff0000092ffa00 - 0xffff00000937014c   (   450 KB)
350 [    0.000000]     fixed   : 0xffff7dfffe7fd000 - 0xffff7dfffec00000   (  4108 KB)
351 [    0.000000]     PCI I/O : 0xffff7dfffee00000 - 0xffff7dffffe00000   (    16 MB)
352 [    0.000000]     vmemmap : 0xffff7e0000000000 - 0xffff800000000000   (  2048 GB maximum)
353 [    0.000000]               0xffff7e0000000000 - 0xffff7e00037a93c0   (    55 MB actual)
354 [    0.000000]     memory  : 0xffff800000000000 - 0xffff8000dea4f000   (  3562 MB)
355 [    0.000000] SLUB: HWalign=128, Order=0-3, MinObjects=0, CPUs=4, Nodes=1
356 [    0.000000] Preemptible hierarchical RCU implementation.
357 [    0.000000]  Build-time adjustment of leaf fanout to 64.
358 [    0.000000]  RCU restricting CPUs from NR_CPUS=64 to nr_cpu_ids=4.
359 [    0.000000] RCU: Adjusting geometry for rcu_fanout_leaf=64, nr_cpu_ids=4
360 [    0.000000] NR_IRQS:64 nr_irqs:64 0
361 [    0.000000] GICv3: CPU0: found redistributor 0 region 0:0x0000000009c00000
362 [    0.000000] GICv2m: range[mem 0x09bd0000-0x09bd0fff], SPI[544:639]
363 [    0.000000] arm_arch_timer: Architected cp15 and mmio timer(s) running at 19.20MHz (virt/virt).
364 [    0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x46d987e47, max_idle_ns: 440795202767 ns
365 [    0.000002] sched_clock: 56 bits at 19MHz, resolution 52ns, wraps every 4398046511078ns
366
367 [....]
368
369
370 Some kernel information:
371
372 root@linaro-developer:~# cat /proc/cpuinfo
373 processor       : 0
374 BogoMIPS        : 38.40
375 Features        : fp asimd evtstrm aes pmull sha1 sha2 crc32 cpuid
376 CPU implementer : 0x51
377 CPU architecture: 8
378 CPU variant     : 0x1
379 CPU part        : 0x211
380 CPU revision    : 2
381
382 processor       : 1
383 BogoMIPS        : 38.40
384 Features        : fp asimd evtstrm aes pmull sha1 sha2 crc32 cpuid
385 CPU implementer : 0x51
386 CPU architecture: 8
387 CPU variant     : 0x1
388 CPU part        : 0x211
389 CPU revision    : 2
390
391 processor       : 2
392 BogoMIPS        : 38.40
393 Features        : fp asimd evtstrm aes pmull sha1 sha2 crc32 cpuid
394 CPU implementer : 0x51
395 CPU architecture: 8
396 CPU variant     : 0x1
397 CPU part        : 0x205
398 CPU revision    : 2
399
400 processor       : 3
401 BogoMIPS        : 38.40
402 Features        : fp asimd evtstrm aes pmull sha1 sha2 crc32 cpuid
403 CPU implementer : 0x51
404 CPU architecture: 8
405 CPU variant     : 0x1
406 CPU part        : 0x205
407 CPU revision    : 2
408
409 root@linaro-developer:~# uname -a
410 Linux linaro-developer 4.11.3-30039-g5a922a1 #1 SMP PREEMPT Wed Oct 18 10:21:11 CEST 2017 aarch64 GNU/Linux
411
412 root@linaro-developer:~# cat /proc/cmdline
413 root=/dev/nfs rw nfsroot=192.168.1.2:/db820c/rootfs,v3,tcp rootwait ip=dhcp consoleblank=0 console=tty0 console=ttyMSM0,115200n8 earlyprintk earlycon=msm_serial_dm,0x75b0000 androidboot.bootdevice=624000.ufshc androidboot.verifiedbootstate=orange androidboot.ver0
414
415 root@linaro-developer:~# cat /proc/meminfo
416 MemTotal:        2776332 kB
417 MemFree:         2593696 kB
418 MemAvailable:    2561432 kB
419 Buffers:               0 kB
420 Cached:            94744 kB
421 SwapCached:            0 kB
422 Active:            43888 kB
423 Inactive:          72972 kB
424 Active(anon):      22968 kB
425 Inactive(anon):    24616 kB
426 Active(file):      20920 kB
427 Inactive(file):    48356 kB
428 Unevictable:           0 kB
429 Mlocked:               0 kB
430 SwapTotal:             0 kB
431 SwapFree:              0 kB
432 Dirty:                 0 kB
433 Writeback:             0 kB
434 AnonPages:         22120 kB
435 Mapped:            29284 kB
436 Shmem:             25468 kB
437 Slab:              32876 kB
438 SReclaimable:      12924 kB
439 SUnreclaim:        19952 kB
440 KernelStack:        2144 kB
441 PageTables:          928 kB
442 NFS_Unstable:          0 kB
443 Bounce:                0 kB
444 WritebackTmp:          0 kB
445 CommitLimit:     1388164 kB
446 Committed_AS:     204192 kB
447 VmallocTotal:   135290290112 kB
448 VmallocUsed:           0 kB
449 VmallocChunk:          0 kB
450 AnonHugePages:      2048 kB
451 ShmemHugePages:        0 kB
452 ShmemPmdMapped:        0 kB
453 CmaTotal:         131072 kB
454 CmaFree:          130356 kB
455 HugePages_Total:       0
456 HugePages_Free:        0
457 HugePages_Rsvd:        0
458 HugePages_Surp:        0
459 Hugepagesize:       2048 kB