Note: SBL/LK on Qualcomm

Posted in Qualcomm on 2017 年 09 月 05 日 by Kun-Yi

目前看起來已經是UEFI base了, 做的事情差不多一樣

基本上就是載入下面的東西跟初始化PMIC/DDR, 已經支援DDR trainingCDT

  1. PMIC
  2. DDR init
  3. QSEE
  4. APDP
  5. SEC
  6. EFS
  7. QHEE
  8. RPM
  9. STI
  10. APPSBL

之後就跳進LK 去把全部載入的image 啟動起來, 可以從Log 看到那時把TZ/RPM等等連接起來
之後點LCD panel, 顯示開機畫面 然後執行Verify Boot確認Bootloader status 才去載入 Kernel

Ref.

  • boot_images/QcomPkg/Tools/cdt_generator.py
  • boot_images/QcomPkg/MsmXXXXPkg/Library/XBLLoaderLib/boot_cdt_array.c
廣告

Note: Qualcomm with Device Tree Blob

Posted in Qualcomm with tags , , on 2017 年 08 月 31 日 by Kun-Yi

see https://github.com/xiaolu/mkbootimg_tools/blob/master/dtbtool.txt

簡單講就是修改 Android Boot image 的 header 在加上 QCDT (Qualcomm Configuration Data Table)

然後在Bootloader 期間收集版上的硬體資訊去比較 PLATFORM/SOC/PMIC/REVISION 找到最接近的DTBs

  1) LK bootloader will obtain platform id/variant/subtype/soc rev/major ver/minor ver
     /pmic0/pmic1/pmic2/pmic3 info either from early bootloaders or via other means
  2) LK bootloader will check entries #10 for non-zero
     value (set to zero for standard boot.img).  If the
     value is non-zero, refer to page section after
     the "second stage" in the boot.img layout
  3) Check QCDT magic
  4) Check QCDT version (optional LK to handle multiple
     QCDT version)
  5) LK scans through the QCDT table to look for matching
     entry.  Search order is:
     1) msm ID exact match
     2) Platform type exact match
     3) subtype ID exact match
     4) HLOS subtype exact match
     5) Pmic0 model ID exact match
     6) Pmic1 model ID exact match
     7) Pmic2 model ID exact match
     8) Pmic3 model ID exact match
     9) foundry ID, look for exact match, if not found choose
    device tree with foundry-id(0x0)
     10) select the highest soc rev in QCDT that is
        equal to or lower than the runtime detected soc rev
     11) select the highest major&minor ver in QCDT that is
        equal to or lower than the runtime detected major ver
     12) select the highest pmic0 major&minor in QCDT that is
        equal to or lower than the runtime detected pmic0
     13) select the highest pmic1 major&minor in QCDT that is
        equal to or lower than the runtime detected pmic1
     14) select the highest pmic2 major&minor in QCDT that is
        equal to or lower than the runtime detected pmic2
     15) select the highest pmic3 major&minor in QCDT that is
        equal to or lower than the runtime detected pmic3
  6) Load the matching DTB blob to the tags addr
7) LK pass the correct DTB to the kernel

Ref.

Note: How to make Android O v8.0.0_r4 for Hikey960

Posted in android with tags , on 2017 年 08 月 28 日 by Kun-Yi
  1.  ref .  Using Reference Boards step to download source code, but change branch name to android-8.0.0_r4, like the below
    repo init -u https://android.googlesource.com/platform/manifest -b android-8.0.0_r4
  2.  repo sync -jN (#N for your Host machine, Normally use 8~12, dependency network, SSD/HDD state)
  3. change the below projects to master branch and checkout with special commit hash
    device/linaro/bootloader/OpenPlatfprmPkg — “ca8a8eeb"
    device/linaro/bootloader/arm-trusted-firmware — “d2baddd"
    device/linaro/bootloader/edk2 — “99d893a"
    device/linaro/hikey-kernel — “7517d7dbe"
    device/linaro/hikey — “0ac1c5c5c41
  4. modify device/linaro/hikey/hikey960/BoardConfig.mk
    diff –git a/hikey960/BoardConfig.mk b/hikey960/BoardConfig.mk
    index 00598e7..92321b4 100644
    — a/hikey960/BoardConfig.mk
    +++ b/hikey960/BoardConfig.mk
    @@ -3,8 +3,20 @@ include device/linaro/hikey/BoardConfigCommon.mk
    TARGET_BOOTLOADER_BOARD_NAME := hikey960
    TARGET_BOARD_PLATFORM := hikey960
    -TARGET_CPU_VARIANT := cortex-a73
    -TARGET_2ND_CPU_VARIANT := cortex-a73
    +TARGET_ARCH := arm64
    +TARGET_ARCH_VARIANT := armv8-a
    +TARGET_CPU_ABI := arm64-v8a
    +TARGET_CPU_VARIANT := generic
    +
    +TARGET_2ND_ARCH := arm
    +TARGET_2ND_ARCH_VARIANT := armv7-a-neon
    +TARGET_2ND_CPU_ABI := armeabi-v7a
    +TARGET_2ND_CPU_ABI2 := armeabi
    +TARGET_2ND_CPU_VARIANT := generic
    +
    +#TARGET_CPU_VARIANT := cortex-a73
    +#TARGET_2ND_CPU_VARIANT := cortex-a73
  5. make -jN (dependency your build machine, for me, the value is 8)
  6. waiting build success, then to ref. Using Reference Boards, for update your hikey960 board
  7. enjoy the play

Note: Hikey960 with Android v8.0.0_r1 boot success!

Posted in android with tags , on 2017 年 08 月 25 日 by Kun-Yi

終於把Hikey960 with Android O v8.0.0_r1 弄開機啦!

https://plus.google.com/u/0/photos/115270660462348164673/album/6458121557908343953/6458121562021074946?authkey=CIHysdm7oNflwQE

https://plus.google.com/u/0/photos/115270660462348164673/album/6458121557908343953/6458121565094052034?authkey=CIHysdm7oNflwQE

https://plus.google.com/u/0/photos/115270660462348164673/album/6458121557908343953/6458121562288292002?authkey=CIHysdm7oNflwQE

https://plus.google.com/u/0/photos/115270660462348164673/album/6458121557908343953/6458121565165748434?authkey=CIHysdm7oNflwQE

Note: Firefly-RK3288 with Linux update

Posted in RK3288 with tags , , on 2017 年 08 月 24 日 by Kun-Yi

use linux tool (rkdeveloptool) to update image into EMMC, need remind device need force boot on maskrom mode

see here how to enforce into maskrom mode, it just break EMMC function, let bootrom stay in maskrom

Note: how to apply Shell environments into bitbak/yocto project

Posted in Yocto with tags , on 2017 年 07 月 26 日 by Kun-Yi

要讓 bitbake 可以吃到 shell environments 還要下一個
export BB_ENV_EXTRAWHITE 才行
如要指定 DL_DIR

export BB_ENV_EXTRAWHITE="$BB_ENV_EXTRAWHITE DL_DIR"

這樣才能透過 .bashrc 去指定想要的 DL_DIR
這樣才不用每個人去改自己的 local.conf

如果是 team work 可以指定一台NFS servers 放 DL_DIR, SSTATE_DIR 等目錄,這樣可以有效減少能源消耗跟避免讓電腦做一些已經做過的事情

 

Note: usage repo tips

Posted in programming, repo, SCM(Software Configuration Management) on 2017 年 07 月 26 日 by Kun-Yi
repo sync –no-tags –no-clone-bundle -jN -c
 
這就只會拉你要的那個 (repo init -u URI -b branch)branch or tags
N: integer for parallel process
repo init 時加上 –reference local_path 可以把使用自己已經先 mirror repositories
這是透過git clone 的 –reference 作到的
例如 先參考 https://source.android.com/source/downloading#using-a-local-mirror
做出一個 local mirror
搭配適當的指令可以快速repo sync