九月, 2017 的封存

Note: How to use SD LLVM 3.9.x toolchain to rebuild devcfg/QSEE 4.0

Posted in Qualcomm with tags , on 2017 年 09 月 18 日 by Kun-Yi

need modify  toolchain path, I modify the below for change to SD llvm 3.9.9

--- a/trustzone_images/build/ms/setenv.sh
+++ b/trustzone_images/build/ms/setenv.sh

@@ -9,16 +9,16 @@ unamestr=`uname`
MAKE_PATH=/pkg/gnu/make/3.81/bin
export ARMTOOLS=ARMCT6 #FIXME
export LLVMTOOLS=LLVM
-export LLVMROOT=/pkg/qct/software/llvm/release/arm/3.5.2.4
+export LLVMROOT=/media/kunyi/Works/qcom-llvm/v3.9.9
export LLVMBIN=$LLVMROOT/bin
-export LLVMLIB=$LLVMROOT/lib/clang/3.5.2/lib/linux
-export MUSLPATH=$LLVMROOT/tools/lib64
-export MUSL32PATH=$LLVMROOT/tools/lib32
+export LLVMLIB=$LLVMROOT/lib/clang/3.9.9/lib/linux
+export MUSLPATH=$LLVMROOT/aarch64-linux-gnu/libc
+export MUSL32PATH=$LLVMROOT/armv7-linux-gnueabi/libc
export LLVMINC=$MUSLPATH/include
export LLVM32INC=$MUSL32PATH/include
export LLVMTOOLPATH=$LLVMROOT/tools/bin
-export GNUROOT=/pkg/qct/software/arm/linaro-toolchain/aarch64-none-elf/4.9-2014.07
-export GNUARM7=/prj/llvm-arm/home/common/build_tools/gcc-linaro-arm-linux-gnueabihf-4.8-2014.02_linux
+export GNUROOT=/media/kunyi/Works/gcc-linaro-aarch64-none-elf-4.9-2014.07_linux
+export GNUARM7=/media/kunyi/Works/gcc-linaro-arm-linux-gnueabihf-4.8-2014.02_linux

and modify llvm.py to support 3.9.x version toolchain

diff --git a/trustzone_images/tools/build/scons/scripts/llvm.py b/trustzone_images/tools/build/scons/scripts/llvm.py
index 0133201..b4daab7 100755
--- a/trustzone_images/tools/build/scons/scripts/llvm.py
+++ b/trustzone_images/tools/build/scons/scripts/llvm.py
@@ -222,6 +222,11 @@ def generate(env):
     is37llvm=True
     LinkByGNU=False
 
+   if llvmbin.find("3.9")!= -1:
+    LinkByQCLD=True
+    is39llvm=True
+    LinkByGNU=False
+
    #----------------------------------------------------------------------------
    # GNU path definitions - begin
    #----------------------------------------------------------------------------
@@ -293,10 +298,13 @@ def generate(env):
    -enable-android-compat: is to use hardware div which is available on QC hardware, so keep it.
    -mllvm -post-RA-scheduler=false is added a workaround for  issue in the scheduling algorithm, due to which when we select -mcpu=cortex-a7 , clang gets infinitely hung'''
    if do_64:
-      if is37llvm:
-        LLVMFlags += " -target aarch64-linux-gnu -w -mllvm -aarch64-strict-align -mcpu=cortex-a53 -mllvm -enable-global-merge=false -nostdinc -mllvm -inline-threshold-multicaller-size=20 "
+      if is39llvm:
+        LLVMFlags += " -target aarch64-linux-gnu -w -mcpu=cortex-a53 -mllvm -enable-global-merge=false -nostdinc -mllvm -inline-threshold-multicaller-size=20 "
       else:
-        LLVMFlags += " -target aarch64-linux-gnu -Werror -mllvm -aarch64-strict-align -mcpu=cortex-a53 -mllvm -enable-global-merge=false -nostdinc "
+        if is37llvm:
+            LLVMFlags += " -target aarch64-linux-gnu -w -mllvm -aarch64-strict-align -mcpu=cortex-a53 -mllvm -enable-global-merge=false -nostdinc -mllvm -inline-threshold-multicaller-size=20 "
+        else:
+            LLVMFlags += " -target aarch64-linux-gnu -Werror -mllvm -aarch64-strict-align -mcpu=cortex-a53 -mllvm -enable-global-merge=false -nostdinc "
       #env.Replace(AS = ARMBIN + "armasm${EXE_EXT} -g --no_unaligned_access ")
       if UseClangAs:
          #env.Replace(AS = "clang_wrap " + "aarch64-linux-gnu-as -c ")
@@ -314,10 +322,13 @@ def generate(env):
          ASM_DBG = "-g "
    else:
       do_32 = True
-      if is37llvm:
+      if is39llvm:
         LLVMFlags += " -target arm-linux-gnueabi -w -mfloat-abi=softfp -mllvm -enable-android-compat -mcpu=cortex-a7 -mllvm -post-RA-scheduler=false -mno-unaligned-access  -mllvm -inline-threshold-multicaller-size=20 "
       else:
-        LLVMFlags += " -target arm-linux-gnueabi -Werror -mfloat-abi=softfp -mfpu=none -fno-vectorize-loops -mllvm -enable-android-compat -mcpu=krait2 -mno-unaligned-access "        
+        if is37llvm:
+            LLVMFlags += " -target arm-linux-gnueabi -w -mfloat-abi=softfp -mllvm -enable-android-compat -mcpu=cortex-a7 -mllvm -post-RA-scheduler=false -mno-unaligned-access  -mllvm -inline-threshold-multicaller-size=20 "
+        else:
+            LLVMFlags += " -target arm-linux-gnueabi -Werror -mfloat-abi=softfp -mfpu=none -fno-vectorize-loops -mllvm -enable-android-compat -mcpu=krait2 -mno-unaligned-access "        
       #env.Replace(AS = ARMBIN + "armasm${EXE_EXT} --apcs /noswst/interwork --no_unaligned_access ")
       if UseClangAs:
         env.Replace(AS = LLVMBIN + "clang${EXE_EXT} -target arm-linux-gnu -mfloat-abi=softfp -mcpu=cortex-a8 -x assembler -allow-integrated-as-for-asm-input -c ")

 

廣告

Note: Qualcomm BLSP/UART loopback testing

Posted in Qualcomm with tags , , on 2017 年 09 月 14 日 by Kun-Yi

when ref. lm80-p0436-5_peripherals_programming_guide.pdf to testing loopback method. you need break RX path if you have external UART connection and continuous send packet to your board, will confuse your testing result.

I guess just enabled an wire-and function by loopback. so recv. external packet & internal tx packet on same time.

 

 

Note: BAM/BLSP_UART IRQ Table for MSM8996

Posted in Qualcomm with tags , , , on 2017 年 09 月 12 日 by Kun-Yi

 

BLSP1:MasterID:86, BAM IRQ: 238, Below Core IRQ

  • BLSP1_QUP1, 95
  • BLSP1_QUP2, 96
  • BLSP1_QUP3, 97
  • BLSP1_QUP4, 98
  • BLSP1_QUP5, 99
  • BLSP1_QUP6, 100
  • BLSP1_UART1,107
  • BLSP1_UART2,108
  • BLSP1_UART3,109
  • BLSP1_UART4,110
  • BLSP1_UART5,111
  • BLSP1_UART6,112

BLSP2:MasterID:84, BAM IRQ: 239, Below Core IRQ

  • BLSP2_QUP1, 101
  • BLSP2_QUP2, 102
  • BLSP2_QUP3, 103
  • BLSP2_QUP4, 104
  • BLSP2_QUP5, 105
  • BLSP2_QUP6, 106
  • BLSP2_UART1,113
  • BLSP2_UART2,114
  • BLSP2_UART3,115
  • BLSP2_UART4,116
  • BLSP2_UART5,117
  • BLSP2_UART6,118

Note: Rebuild TrustZone/QSEE 4.0 image for OEM

Posted in Qualcomm with tags , , , on 2017 年 09 月 11 日 by Kun-Yi

Just following the below steps, must remove -mno-ae compiler optional from llvm.py

  1. Prepare Toolchain from CreatePoint (now SD LLVM 3.7.6),
    and linaro gcc (maybe you can to check step 2 first, to get gcc version)
  2. modify setenv.sh to setting toolchain path
  3. use clean build command ./build.sh CHIPSET=<target> devcfg sampleapp

more detail ref. BSP user manual.

ref. http://blog.csdn.net/u013308744/article/details/50523469

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