QCA 軟體開發套件 (QSDK) 使用與OpenWRT相同的構建框架,都是利用packaging/feed 機制。裡面包含了開源的Linux元件以及可選的高通專有元件,像是Wi-Fi驅動。
QSDK for IPQ807x/IPQ40xx/IPQ806x 特點概述:
- 基於配置檔的圖像生成改編
- 構建 SoC 特定圖像的子目標方式
- Linux-4.4 內核
- 初步執行時間初始化腳本
- 暫授權介面 (UCI) 可用性
- 界面設定使用者介面 (LuCI)
- 高通Wi-Fi 驅動程式
- 高通網路驅動程式
- uboot-2016
QSDK是Linux框架,因此第一步是找到Linux主機來設置發展環境。 (例如 ubuntu 16.04.) 或者您可以設定執行Linux操作系統的虛擬機器.
使用 Windows Hyper-v 創建虛擬機器並準備命名 ubuntu-16.04.7.amd64。
從Ubuntu官網上下載iso檔案。我下載的是ubuntu-16.04.7-desktop-amd64.iso。因為QSDK SPF11.4 有支持64bits 的single image,我建議開發環境也安裝成64位元的系統。
在完成Ubuntu的安裝之後,我們在Linux中安裝以下的套件來設置開發環境。
sudo apt-get install build-essential
sudo apt-get install ccache
sudo apt-get install ecj
sudo apt-get install fastjar
sudo apt-get install file
sudo apt-get install g++
sudo apt-get install gawk
sudo apt-get install gettext
sudo apt-get install git
sudo apt-get install java-propose-classpath
sudo apt-get install libelf-dev
sudo apt-get install libncurses5-dev
sudo apt-get install libncursesw5-dev
sudo apt-get install libssl-dev
sudo apt-get install python
sudo apt-get install python2.7-dev
sudo apt-get install unzip
sudo apt-get install wget
sudo apt-get install rsync
sudo apt-get install subversion
sudo apt-get install swig
sudo apt-get install time
sudo apt-get install xsltproc
sudo apt-get install zlib1g-dev
sudo apt-get -y install gcc
sudo apt-get -y install g++
sudo apt-get -y install binutils
sudo apt-get -y install patch
sudo apt-get -y install bzip2
sudo apt-get -y install flex
sudo apt-get -y install make
sudo apt-get -y install pkg-config
sudo apt-get -y install unzip
sudo apt-get -y install zlib1g-dev
sudo apt-get -y install libc6-dev
sudo apt-get -y install subversion
sudo apt-get -y install libncurses5-dev
sudo apt-get -y install sharutils
sudo apt-get -y install curl
sudo apt-get -y install libxml-parser-perl
sudo apt-get -y install python-yaml
sudo apt-get -y install ocaml-nox
sudo apt-get -y install ocaml
sudo apt-get -y install ocaml-findlib
sudo apt-get -y install libssl-dev
sudo apt-get -y install libfdt-dev
sudo apt-get -y install coccinelle
# python makeimage
sudo apt-get install gcc
sudo apt-get install g++
sudo apt-get install binutils
sudo apt-get install patch
sudo apt-get install bzip2
sudo apt-get install flex
sudo apt-get install make
sudo apt-get install pkg-config
sudo apt-get install unzip
sudo apt-get install zlib1g-dev
sudo apt-get install libc6-dev
sudo apt-get install subversion
sudo apt-get install libncurses5-dev
sudo apt-get install sharutils
sudo apt-get install curl
sudo apt-get install libxml-parser-perl
sudo apt-get install python-yaml
sudo apt-get install ocaml-nox
sudo apt-get install ocaml
sudo apt-get install ocaml-findlib
sudo apt-get install libssl-dev
sudo apt-get install libfdt-dev
sudo apt-get install device-tree-compiler
sudo apt-get install u-boot-tools
sudo apt-get install mtd-utils
sudo apt-get install device-tree-compiler
sudo apt-get install libc6-i386
sudo apt-get install libgl1-mesa-dri:i386
sudo apt-get install python2.7
mkdir -p ~/bin export PATH=~/bin:$PATH curl https://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo chmod a+x ~/bin/repo |
記得要對git設置全域變數 username 跟 email
Example:
git config --global user.email "your email@sample.com"
git config --global user.name "your name"
現在,我們可以嘗試去下載QSDK的套件跟編譯出single image。
- 從chipcode 下載4 csu1,高通專有的元件。
URL at: https://chipcode.qti.qualcomm.com/
- 從git://codeaurora.org上下載Linux OpenWRT的元件。
然後將兩者組合起來完成QSDK Framwork。
Qualcomm ChipCode 下載看到的目錄如下
執行repo init -u git://codeaurora.org/quic/qsdk/releases/manifest/qstak -b release -m caf_AU_LINUX_QSDK_NHSS.QSDK.11.4_TARGET_ALL.11.4.6938.7048.xml
以及repo sync 之後,下載的Linux OpenWRT目錄內容如下:
這個步驟若出現問題,就是repo 這個誠實與python的版本不相容。 像我就是用Ubuntu20 來執行repo,再將結果copy過來使用。
之後,將兩個目錄整合起來,形成您的工作目錄。執行以下的command
$ cp -rf apss_proc/out/proprietary/Wifi/qsdk-ieee1905-security/* qsdk
$ cp -rf apss_proc/out/proprietary/Wifi/qsdk-qca-art/* qsdk
$ cp -rf apss_proc/out/proprietary/Wifi/qsdk-qca-wifi/* qsdk
$ cp -rf apss_proc/out/proprietary/Wifi/qsdk-qca-wlan/* qsdk
$ cp -rf wlan_proc/src/components/QCA8074_v2.0/qca-wifi-fw-src-component-cmn-WLAN.HK.* qsdk/dl/ $ cp -rf wlan_proc/pkg/wlan_proc/bin/QCA8074_v1.0/qca-wifi-fw-QCA8074_v1.0- WLAN.HK.*.tar.bz2 qsdk/dl/
$ cp -rf wlan_proc/pkg/wlan_proc/bin/QCA8074_v2.0/qca-wifi-fw-QCA8074_v2.0- WLAN.HK.*.tar.bz2 qsdk/dl/
$ tar xvf cnss_proc/src/components/qca-wifi-fw-src-component-cmn-WLAN.BL.*.tgz -C qsdk/dl
$ tar xvf cnss_proc/src/components/qca-wifi-fw-src-component-halphy_toolsWLAN.BL.*.tgz -C qsdk/dl
$ cp -rf cnss_proc/src/components/* qsdk/dl
$ cp -rf cnss_proc/bin/QCA9888/hw.2/* qsdk/dl
$ cp -rf cnss_proc/bin/AR900B/hw.2/* qsdk/dl
$ cp -rf cnss_proc/bin/QCA9984/hw.1/* qsdk/dl
$ cp -rf cnss_proc/bin/IPQ4019/hw.1/* qsdk/dl $ cp -rf qca-wifi-fw-AR988* qsdk/dl
$ cp -rf apss_proc/out/proprietary/QSDK-Base/meta-tools/ .
$ cp -rf apss_proc/out/proprietary/QSDK-Base/common-tools/* qsdk/
$ cp -rf apss_proc/out/proprietary/QSDK-Base/qsdk-qca-nss/* qsdk/
$ cp -rf apss_proc/out/proprietary/QSDK-Base/qca-lib/* qsdk/
$ cp -rf apss_proc/out/proprietary/BLUETOPIA/qca-bluetopia/* qsdk
$ cp -rf apss_proc/out/proprietary/QSDK-Base/qca-mcs-apps/* qsdk
$ cp -rf apss_proc/out/proprietary/QSDK-Base/qca-nss-userspace/* qsdk
$ cp -rf apss_proc/out/proprietary/QSDK-Base/qca-time-services/* qsdk
$ cp -rf apss_proc/out/proprietary/QSDK-Base/qca-qmi-framework/* qsdk
$ cp -rf apss_proc/out/proprietary/QSDK-Base/gpio-debug/* qsdk
$ cp -rf apss_proc/out/proprietary/QSDK-Base/qca-diag/* qsdk
$ cp -rf apss_proc/out/proprietary/QSDK-Base/qca-cnss-daemon/* qsdk
$ cp -rf apss_proc/out/proprietary/QSDK-Base/athtestcmd/* qsdk
$ cp -rf apss_proc/out/proprietary/QSDK-Base/fw-qca-stats/* qsdk
$ cp -rf apss_proc/out/proprietary/QSDK-Base/btdaemon/* qsdk
$ cp -rf apss_proc/out/proprietary/QSDK-Base/minidump/* qsdk
$ tar xjvf apss_proc/out/proprietary/QSDK-Base/qca-IOT/qca-IOT.tar.bz2 -C qsdk
$ sed -i '/QCAHKSWPL_SILICONZ/c\PKG_VERSION:=WLAN.HK.2.5.r4-00683-QCAHKSWPL_SILICONZ1' qsdk/qca/feeds/qca_hk/net/qca-hk/Makefile
$ cp apss_proc/out/proprietary/QSDK-Base/qca-nss-fw-eip-hk/BIN-EIP*.HK.* qsdk/dl/
$ cp apss_proc/out/proprietary/RBIN-NSS-RETAIL/BIN-NSS.HK* qsdk/dl/
$ cp -rf apss_proc/out/proprietary/Hyfi/hyfi/* qsdk
$ cp -rf apss_proc/out/proprietary/Wifi/qsdk-whc/* qsdk
$ mkdir qsdk/qca/feeds/qca-son-mem-debug/qca-son-mem-debug
$ mv qsdk/qca/feeds/qca-son-mem-debug/Makefile qsdk/qca/feeds/qca-son-memdebug/Config.in qsdk/qca/feeds/qca-son-mem-debug/qca-son-mem-debug
$ cp -rf apss_proc/out/proprietary/Wifi/qsdk-whcpy/* qsdk $ sed -i "s/@PACKAGE_whc-son/@PACKAGE_whc-map/g" qsdk/qca/feeds/qca-lib/qcawifison-ext-lib/Makefile
$ cd qsdk
$ ./scripts/feeds update -a
$ ./scripts/feeds install -a -f
$ cp qca/configs/qsdk/ipq_premium.config .config
$ sed -i "s/TARGET_ipq_ipq806x/TARGET_ipq_ipq807x/g" .config
$ mv prebuilt/ipq807x/ipq_premium/* prebuilt/ipq807x/
$ make defconfig
$ make V=s
3-5 小時之後, 可以看到目標檔案被產出,存放在這個目錄{workfolder}/qsdk/bin/ipq
接著繼續來產出QSDK使用的single image。
再次回到工作目錄
然後執行以下動作
$ mkdir -p common/build/ipq
$ mkdir -p apss_proc/out/meta-scripts
$ cp qsdk/qca/src/u-boot-2016/tools/pack.py apss_proc/out/meta-scripts/pack_hk.py $ sed -i 's##/#' contents.xml
$ sed -i 's##\\#' contents.xml $ sed -i 's/WLAN.BL.3.15//g' contents.xml
$ sed -i 's/CNSS.PS.3.15//g' contents.xml $ cp qsdk/bin/ipq/openwrt* common/build/ipq
$ cp -r apss_proc/out/proprietary/QSDK-Base/meta-tools apss_proc/out/
$ cp -rf qsdk/bin/ipq/dtbs/* common/build/ipq/
$ cp -rf skales/* common/build/ipq/
$ cp qsdk/staging_dir/host/bin/ubinize common/build/ipq/
$ cd common/build
$ sed '/debug/d;/packages/d;/"ipq807x_64"/d;/t32/d;/ret_prep_64image/d;/skales/d;/os.system(cmd)/d;/os.chdir(ipq_dir)/d;/ret_pack_64image/d;/ret_pack_apps_64image/d;/ 64image/d' -i update_common_info.py
$ export BLD_ENV_BUILD_ID=
$ python update_common_info.py
這裡的 我是選 “P”
最後的single image 可以在 {workfolder}/common/build/bin找到
一切順利,我們已經完成了開發環境的建置,並且成功做出IPQ807x的single image了。
參考文件:
80-ya183-4_ab_qca_networking_2021.spf.11.4_csu1_release_notes
評論
AndyChen0629
2023年7月31日