2020年1月26日日曜日

ultra96v2_oobをカスタムする話その3_device-treeとu-bootをカスタムするためのメモ

u-bootとhw-dtbを修正する方法を調べるためにyoctoの機能を確認中。

u-bootの設定はpetalinuxで指定したダウンロードしたソースの中のdefconfigを使用している模様。petalinux-configのu-boot config targetで指定したものを使用しているのか。

targetのdefconfig(avnet_ultra96_rev1_defconfig)にパッチ当てればOKかな。

適当なフォルダにgit clone u-boot-xlnxを行い、avnet_ultra96_rev1_defconfigのCONFIG_SYS_TEXT_BASEを0x10080000に変更する。
その後、git add . && git commit -m "test"などとして登録し、git format-patch -o <path> -1とすることで<path>にパッチを得る。
これを<petalinux>/project-spec/meta-user/recipes-bsp/u-boot/files配下に保存し、u-boot-xlnx_%.bbappendのSRC_URI+="<patch_name>"を追加してビルドすると適用された。作成したパッチは以下の通り。

From 809983f8a42eb8cc94e1e5a1e107d40508b8a1de Mon Sep 17 00:00:00 2001
From: Akira Nishiyama <xxxx@xxxx.xxx>
Date: Mon, 27 Jan 2020 09:44:12 +0000
Subject: [PATCH] test

---
 configs/avnet_ultra96_rev1_defconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configs/avnet_ultra96_rev1_defconfig b/configs/avnet_ultra96_rev1_defconfig
index f6d583083b..ef6ff271d9 100644
--- a/configs/avnet_ultra96_rev1_defconfig
+++ b/configs/avnet_ultra96_rev1_defconfig
@@ -1,6 +1,6 @@
 CONFIG_ARM=y
 CONFIG_ARCH_ZYNQMP=y
-CONFIG_SYS_TEXT_BASE=0x8000000
+CONFIG_SYS_TEXT_BASE=0x10080000
 CONFIG_SYS_MALLOC_F_LEN=0x8000
 CONFIG_SPL=y
 CONFIG_DEBUG_UART_BASE=0xff010000
-- 
2.18.1 

次はhw-dtbの対応。




device-treeのレシピを確認。
コマンドはbitbake-layers show-recipes。

$ bitbake-layers show-recipes
...
device-tree:
  meta-xilinx-bsp      xilinx-v2019.2+gitAUTOINC+a8b39cf536
...

meta-xilinx-bspレイヤーを見ればいいらしい。

$ bitbake-layers show-layers
NOTE: Starting bitbake server...
layer                 path                                      priority
==========================================================================
...
meta-xilinx-bsp       /opt/petalinux/components/yocto/source/aarch64/layers/meta-xilinx/meta-xilinx-bsp  5
...
Appendしているものをチェック。
$ bitbake-layers show-appends
...
device-tree.bb:
  /opt/petalinux/components/yocto/source/aarch64/layers/meta-xilinx/meta-xilinx-contrib/recipes-bsp/device-tree/device-tree.bbappend
  /opt/petalinux/components/yocto/source/aarch64/layers/meta-xilinx-tools/recipes-bsp/device-tree/device-tree.bbappend
  /home/akira/work/ultra96v2_oob/ultra96v2_oob/petalinux/project-spec/meta-plnx-generated/recipes-bsp/device-tree/device-tree.bbappend
  /home/akira/work/ultra96v2_oob/ultra96v2_oob/petalinux/project-spec/meta-user/recipes-bsp/device-tree/device-tree.bbappend
... 

ここまで調べている最中にカスタム方法を記載したページを見つける。
machine-conf設定を調べている最中。オーバライド機能で動作しているよう。
ただし、hw-dtbのデータにたどり着かない。
どこで名前変更してコピーしてるんだ?

bitbake -e <package_name> | grep '^FILE'
でパッチを置く場所を検索可能。


参考ページ
https://qiita.com/ahoki/items/1e1594cbd90c722de56a
https://www.slideshare.net/wata2ki/yocto-bsp
https://www.slideshare.net/iwamatsu/ss-31662659?next_slideshow=4
http://www.sinby.com/misc/yocto-08.html
https://xilinx-wiki.atlassian.net/wiki/x/IgKtAw
https://stackoverflow.com/questions/45561697/what-does-machineoverrides-flag-mean
https://qiita.com/AngryMane/items/61d2fa47246a9f9217f5

0 件のコメント:

コメントを投稿