qshinoの日記

Powershell関係と徒然なこと

Jetson nano dtb self update

DTB self update

Jetson Nano 自身でdtbを更新。

基本フロー

母艦から、

  1. dts変更 arch/arm64/boot/dts/
  2. make dtbs ; make dtbs_install
  3. create-jetson-nano-sd-card-image.sh
  4. nanoに移動し、sudo dd if=bootloader/signed/$dtb.encrypt of=/dev/mmcblk0p10

.flash.shを使わない簡素書込み方法。

dts 関連ファイル

  • sources-pkgのkernel_src.rbz2
  • nano dts : tegra210-p3448-0000-p3449-0000-a02.dts

想定ツリー

Top
+-- Linux_for_Tegra: l4t dir
    +-- rootfs : rootfs
    +-- kernel/dtb : dtb
    +-- bootloader/  : *.dtb.encrypted
    +-- jetson-nano-qspi-sd.conf
+-- kernel         : kernel src
    +-- kernel4.9/arch/arm64/boot/dts
    +-- nvidia/drivers/
+— hardware   : kernel src
    +-- nvidia
      +-- platform/t210/porg/kernel-dts/ : dtsi
      +-- soc/ : dtsi
+-- download      : tarball dir
+-- public_sources : srcpkg

手順

  1. ソースのboot/dts dirのdts編集
  2. kernel-4.9 dirにて make dtbs ; make INSTALL_PATH=Linux_for_Tegra/kernel dtbs_install
  3. l4t dirから ./create-jetson-nano-sd-card-image.sh -o sd.img -s 6G -r 200
  4. nanoから、 sudo dd if=bootloader/signed/$dtb.encrypt of=/dev/mmcblk0p10
#
# 下記リンクからダウンロード
#
devlink=開発パッケージリンク
rootlink=サンプルルートリンク
srclink= https://developer.nvidia.com/embedded/dlc/l4t-sources-32-1-jetson-nano
# 
# DLしたパッケージ名
#
ksrc=kernel_src.tbz2
devpkg=l4t-r32-1.tbz2
rootpkg=rootfs.tbz2
srcpkg=l4t-sources-32-1-0.tbz3
#
# dirs
#
dl=download
lt=Linux_for_Tegra
ps=public_sources
rt=rootfs
kk=kernel/kernel-4.9
#
# file
#
dtb=tegra210-p3448-0000-p3449-0000-a02.dtb
#
top=~

cd $top

if false ; then
    wget $devlink -O $dl/$devpkg
    wget $rootlink -O $dl/$rootpkg
    wget $srclink -O $dl/$srcpkg
fi
if false ; then
    tar jxvf $dl/$devpkg
    tar jxvf $dl/$rootpkg -C $lt
    tar jxvf $dl/$srcpkg
    tar jxvf $ps/$ksrc
fi

# build kernel

cd $kk

make -j2 Image ; make -j2 modules ; make dtbs

# update dtb

cp arch/arm64/boot/dts/$dtb $top/$lt/kernel/dtb/ 

# create sd image

cd $top/$lt

sudo ./create-jetson-nano-sd-card-image.sh -o sd-blob.img -s 6G -r 200

# write dtb

sudo dd if=bootloader/signed/$dtb.encrypt of=/dev/mmcblk0p10

Nano SD.card Partitions

Number Start (sector) End (sector) Size Code Name
1 24576 62521310 29.8 GiB 8300 APP
2 2048 2303 128.0 KiB 8300 TBC
3 4096 4991 448.0 KiB 8300 RP1
4 6144 7295 576.0 KiB 8300 EBT
5 8192 8319 64.0 KiB 8300 WB0
6 10240 10623 192.0 KiB 8300 BPF
7 12288 13439 576.0 KiB 8300 TOS
8 14336 14463 64.0 KiB 8300 EKS
9 16384 17663 640.0 KiB 8300 LNX
10 18432 19327 448.0 KiB 8300 DTB
11 20480 20735 128.0 KiB 8300 RP4
12 22528 22687 80.0 KiB 8300 BMP

ref

https://developer.ridgerun.com/wiki/index.php?title=NVIDIA_Jetson_Nano-Building_the_Kernel_from_Source

https://manual.atmark-techno.com/armadillo-eva-1500/armadillo-eva-1500_product_manual_ja-1.0.0/ch09.html