1*4882a593Smuzhiyun# 2*4882a593Smuzhiyun# (C) Copyright 2015 Mateusz Kulikowski <mateusz.kulikowski@gmail.com> 3*4882a593Smuzhiyun# 4*4882a593Smuzhiyun# SPDX-License-Identifier: GPL-2.0+ 5*4882a593Smuzhiyun# 6*4882a593Smuzhiyun 7*4882a593SmuzhiyunBuild & Run instructions: 8*4882a593Smuzhiyun 9*4882a593Smuzhiyun1) Install mkbootimg and dtbTool from 10*4882a593Smuzhiyun git://codeaurora.org/quic/kernel/skales (15ece94f09 worked for me) 11*4882a593Smuzhiyun2) Setup CROSS_COMPILE to aarch64 compiler 12*4882a593Smuzhiyun3) make dragonboard410c_config 13*4882a593Smuzhiyun4) make 14*4882a593Smuzhiyun5) generate fake, empty ramdisk (can have 0 bytes) 15*4882a593Smuzhiyun$ touch rd 16*4882a593Smuzhiyun 17*4882a593Smuzhiyun6) Generate qualcomm device tree table with dtbTool [1] 18*4882a593Smuzhiyun$ dtbTool -o dt.img arch/arm/dts 19*4882a593Smuzhiyun 20*4882a593Smuzhiyun7) Generate Android boot image with mkbootimg [2]: 21*4882a593Smuzhiyun$ mkbootimg --kernel=u-boot-dtb.bin --output=u-boot.img --dt=dt.img \ 22*4882a593Smuzhiyun --pagesize 2048 --base 0x80000000 --ramdisk=rd --cmdline="" 23*4882a593Smuzhiyun 24*4882a593Smuzhiyun8) Enter fastboot (reboot board with vol- button pressed) 25*4882a593Smuzhiyun 26*4882a593Smuzhiyun9) Boot it: 27*4882a593Smuzhiyun$ fastboot boot u-boot.img 28*4882a593Smuzhiyunor flash as kernel: 29*4882a593Smuzhiyun$ fastboot flash boot u-boot.img 30*4882a593Smuzhiyun$ fastboot reboot 31*4882a593Smuzhiyun 32*4882a593Smuzhiyun 33*4882a593SmuzhiyunWhat is working: 34*4882a593Smuzhiyun- UART 35*4882a593Smuzhiyun- GPIO (SoC) 36*4882a593Smuzhiyun- SD 37*4882a593Smuzhiyun- eMMC 38*4882a593Smuzhiyun- Reset 39*4882a593Smuzhiyun- USB in EHCI mode (usb starts does switch device->host, usb stop does the opposite) 40*4882a593Smuzhiyun- PMIC GPIOS (but not in generic subsystem) 41*4882a593Smuzhiyun- PMIC "special" buttons (power, vol-) 42*4882a593Smuzhiyun 43*4882a593SmuzhiyunWhat is not working / known bugs: 44*4882a593Smuzhiyun- SDHCI is slow (~2.5MiB/s for SD and eMMC) 45*4882a593Smuzhiyun 46*4882a593Smuzhiyun[1] To boot any kernel image, Little Kernel requires valid device tree for the 47*4882a593Smuzhiyunplatform it runs on. dtbTool creates device tree table that Little Kernel scans. 48*4882a593SmuzhiyunLater on proper device tree is passed to next boot stage. 49*4882a593SmuzhiyunFull device tree is not required to boot u-boot. Enough would be: 50*4882a593Smuzhiyun/dts-v1/; 51*4882a593Smuzhiyun 52*4882a593Smuzhiyun/ { 53*4882a593Smuzhiyun model = "Qualcomm Technologies, Inc. Dragonboard 410c"; 54*4882a593Smuzhiyun compatible = "qcom,dragonboard", "qcom,apq8016-sbc"; 55*4882a593Smuzhiyun qcom,msm-id = <0xce 0x0 0xf8 0x0 0xf9 0x0 0xfa 0x0 0xf7 0x0>; 56*4882a593Smuzhiyun qcom,board-id = <0x10018 0x0>; 57*4882a593Smuzhiyun #address-cells = <0x2>; 58*4882a593Smuzhiyun #size-cells = <0x2>; 59*4882a593Smuzhiyun chosen { }; 60*4882a593Smuzhiyun aliases { }; 61*4882a593Smuzhiyun 62*4882a593Smuzhiyun memory { 63*4882a593Smuzhiyun device_type = "memory"; 64*4882a593Smuzhiyun reg = <0 0x80000000 0 0x3da00000>; 65*4882a593Smuzhiyun }; 66*4882a593Smuzhiyun}; 67*4882a593Smuzhiyun 68*4882a593Smuzhiyunbut for simplicity (and because size of image is not that critical) we use 69*4882a593Smuzhiyunexisting Qualcomm device trees. 70*4882a593Smuzhiyun 71*4882a593Smuzhiyun[2] Note that ramdisk is required, even if it is unused. 72