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