跳到主要内容

产测工具

本文档介绍产测工具。

简介

产测工具是一个用于测试板卡或整机硬件接口连通性的系统,基于bianbu linux裁剪,集成factorytest应用。

该系统通常运行在sdcard上。

编译

$ cd /path/to/bianbu-linux
$ make envconfig
Available configs in buildroot-ext/configs/:
1. spacemit_k1_defconfig
2. spacemit_k1_minimal_defconfig
3. spacemit_k1_plt_defconfig


your choice (1-3):

选择3,然后回车即开始编译。

编译完成,可以看到:

Images successfully packed into /path/to/bianbu-linux/output/k1_plt/images/bianbu-linux-k1_plt.zip


Generating sdcard.img...................................
INFO: cmd: "mkdir -p "/path/to/bianbu-linux/output/k1_plt/build/genimage.tmp"" (stderr):
INFO: cmd: "rm -rf "/path/to/bianbu-linux/output/k1_plt/build/genimage.tmp"/*" (stderr):
INFO: cmd: "mkdir -p "/path/to/work/bianbu-linux/output/k1_plt/images"" (stderr):
INFO: hdimage(sdcard.img): adding partition 'bootinfo' from 'factory/bootinfo_sd.bin' ...
INFO: hdimage(sdcard.img): adding partition 'fsbl' (in MBR) from 'factory/FSBL.bin' ...
INFO: hdimage(sdcard.img): adding partition 'env' (in MBR) from 'env.bin' ...
INFO: hdimage(sdcard.img): adding partition 'opensbi' (in MBR) from 'fw_dynamic.itb' ...
INFO: hdimage(sdcard.img): adding partition 'uboot' (in MBR) from 'u-boot.itb' ...
INFO: hdimage(sdcard.img): adding partition 'bootfs' (in MBR) from 'bootfs.img' ...
INFO: hdimage(sdcard.img): adding partition 'rootfs' (in MBR) from 'rootfs.ext4' ...
INFO: hdimage(sdcard.img): adding partition '[MBR]' ...
INFO: hdimage(sdcard.img): adding partition '[GPT header]' ...
INFO: hdimage(sdcard.img): adding partition '[GPT array]' ...
INFO: hdimage(sdcard.img): adding partition '[GPT backup]' ...
INFO: hdimage(sdcard.img): writing GPT
INFO: hdimage(sdcard.img): writing protective MBR
INFO: hdimage(sdcard.img): writing MBR
Successfully generated at /path/to/bianbu-linux/output/k1_plt/images/bianbu-linux-k1_plt-sdcard.img

其中bianbu-linux-k1_plt.zip适用于Titan Flasher,或者解压后用fastboot刷机;bianbu-linux-k1_plt-sdcard.img为sdcard固件,解压后可以用dd命令或者balenaEtcher写入sdcard。

固件默认用户名:root,密码:bianbu

定制

添加板型

已支持板型:

  • deb1

产测工具的系统通常不直接使用板型在u-boot和内核的dts,而是基于它定制。

添加新板型的步骤:

  1. 拷贝u-boot的dts到buildroot-ext/board/spacemit/k1/plt_dts/u-boot,例如k1-x_deb2.dts

  2. 定制

  3. 拷贝内核的dts到buildroot-ext/board/spacemit/k1/plt_dts/kernel,例如k1-x_deb2.dts

  4. 修改dtsi路径

    -#include "k1-x.dtsi"
    -#include "k1-x_pinctrl.dtsi"
    -#include "lcd/lcd_gx09inx101_mipi.dtsi"
    -#include "k1-x-hdmi.dtsi"
    -#include "k1-x-lcd.dtsi"
    -#include "k1-x-camera-sdk.dtsi"
    +#include "spacemit/k1-x.dtsi"
    +#include "spacemit/k1-x_pinctrl.dtsi"
    +#include "spacemit/lcd/lcd_gx09inx101_mipi.dtsi"
    +#include "spacemit/k1-x-hdmi.dtsi"
    +#include "spacemit/k1-x-lcd.dtsi"
    +#include "spacemit/k1-x-camera-sdk.dtsi"
  5. 修改其他配置

  6. 修改output/k1_plt/.config,添加新板型的dts

    -BR2_LINUX_KERNEL_INTREE_DTS_NAME="k1-x_deb1"
    -BR2_LINUX_KERNEL_CUSTOM_DTS_PATH="$(BR2_EXTERNAL_Bianbu_PATH)/board/spacemit/k1/plt_dts/kernel/k1-x_deb1.dts"
    -BR2_TARGET_UBOOT_CUSTOM_DTS_PATH="$(BR2_EXTERNAL_Bianbu_PATH)/board/spacemit/k1/plt_dts/u-boot/k1-x_deb1.dts"
    +BR2_LINUX_KERNEL_INTREE_DTS_NAME="k1-x_deb1 k1-x_deb2"
    +BR2_LINUX_KERNEL_CUSTOM_DTS_PATH="$(BR2_EXTERNAL_Bianbu_PATH)/board/spacemit/k1/plt_dts/kernel/k1-x_deb1.dts $(BR2_EXTERNAL_Bianbu_PATH)/board/spacemit/k1/plt_dts/kernel/k1-x_deb2.dts"
    +BR2_TARGET_UBOOT_CUSTOM_DTS_PATH="$(BR2_EXTERNAL_Bianbu_PATH)/board/spacemit/k1/plt_dts/u-boot/k1-x_deb1.dts $(BR2_EXTERNAL_Bianbu_PATH)/board/spacemit/k1/plt_dts/u-boot/k1-x_deb2.dts"
  7. 重新编译u-boot、内核和固件即可

    make uboot-rebuild
    make linux-rebuild
    make
  8. 保存配置

    make savedefconfig

定制rootfs

通过buildroot-ext/board/spacemit/k1/plt_overlay定制rootfs,该目录下的文件会在制作镜像前拷贝到output/k1_plt/target目录。