0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

petalinuxをBuildrootでビルドする

Last updated at Posted at 2024-11-27

関連記事
EBAZ4205を使って、FPGAを使ったシステム開発の環境を構築する
EBAZ4205でLinuxを動かして見る
petalinuxをBuildrootでビルドする

はじめに

Zinqを使ったボードでNervesを動作させる事を目指しています。

その前段階として、petalinuxをbuildrootでビルドする方法を調査し、作成できるか試してみます。

使用するハードウエア

Zinqの評価boardを使うのがお手軽ですが、今回は次の理由から、ebaz4205を使う事にします。

  • ebaz4205は、マイニングマシーンに使われていたコントローラの中古販売品で価格が安い。
  • 必要最低限のハードウエアで、自身でハードウエアを作る場合もほぼ同等の構成になりそう。
  • 評価boardと違い、開発環境が整ってないので、大変だが、開発に必要な事を一通り経験できる

参考サイト

petalinuxについては、この記事で、実際に動作する事を確認しました。

Nervesを動作させるためには、buildrootでビルドする必要があるので、petalinuxをbuildrootでビルドしている事例がないか調査しました。

以下のコンテンツが見つかりました。

これを参考に、ebaz4205をbuildrootでビルドする事を試みます。

dtsファイル

Linuxからみたハードウエアの情報は、dtsファイルに記述されています。

本来は、FPGAの中身を開発した上で、dtsファイルを作成する必要がありますが、ebaz4205_buildrootで使われているdtsファイルを使って、buildrootの構築方法を習得する事にします。

petalinuxのビルドした結果にsystem.dtbは作成されていました。
このあたりの成果物から、ebaz4205_buildrootのdtsファイルを作成する事ができるのではないかと想定しています。
今後の課題です。

ビルド手順

cd /home/masa/ebaz4205
git clone https://github.com/buildroot/buildroot.git
git clone https://github.com/embed-me/ebaz4205_buildroot
cd buildroot/
make BR2_EXTERNAL=../ebaz4205_buildroot zynq_ebaz4205_defconfig
make 2>&1 | tee build.log

この手順でbuildしてみましたが、カーネルのコンパイル過程でエラーが発生しました。
どうやら、ebaz4205_buildrootが想定しているbuildrootが古く、最新のbuildrootとは合わないようです。

設定ファイルの修正

zynq_ebaz4205_defconfigのKernelの設定では、4.19を指定しています。これはいかにも古そうです。

zynq_ebaz4205_defconfig
BR2_LINUX_KERNEL_VERSION="4.19"
BR2_LINUX_KERNEL_CUSTOM_VERSION=y
BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.19"
BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_19=y

できるだけ、公式(Xilinx)のリポジトリを使うようにしたいです。次のように修正してみました。

zynq_ebaz4205_defconfig
BR2_LINUX_KERNEL_CUSTOM_REPO_URL="https://github.com/Xilinx/linux-xlnx.git"
BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="xlnx_rebase_v5.15_LTS"

U-bootも独自のものを使用しているようです。

BR2_TARGET_UBOOT_CUSTOM_REPO_URL="https://github.com/embed-me/u-boot.git"

これもpetalinuxのビルドと同じものを使うように修正したいですが、今回はこのままで進めます。今後の課題とします。

修正後のzyng_ebaz4205_defconfigは次のようになりました。

zynq_ebaz4205_defconfig
BR2_arm=y
BR2_cortex_a9=y
BR2_ARM_ENABLE_NEON=y
BR2_ARM_ENABLE_VFP=y
BR2_TARGET_GENERIC_GETTY_PORT="ttyPS0"
BR2_ROOTFS_OVERLAY="$(BR2_EXTERNAL_EMBEDME_EBAZ4205_PATH)/ebaz4205/fs-overlay"
BR2_LINUX_KERNEL=y
BR2_LINUX_KERNEL_CUSTOM_REPO_URL="https://github.com/Xilinx/linux-xlnx.git"
BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="xlnx_rebase_v5.15_LTS"
BR2_LINUX_KERNEL_USE_ARCH_DEFAULT_CONFIG=y
BR2_LINUX_KERNEL_UIMAGE=y
BR2_LINUX_KERNEL_UIMAGE_LOADADDR="0x8000"
BR2_LINUX_KERNEL_DTS_SUPPORT=y
BR2_LINUX_KERNEL_USE_CUSTOM_DTS=y
BR2_LINUX_KERNEL_CUSTOM_DTS_PATH="$(BR2_EXTERNAL_EMBEDME_EBAZ4205_PATH)/ebaz4205/dts/ebaz4205-zynq7.dts $(BR2_EXTERNAL_EMBEDME_EBAZ4205_PATH)/ebaz4205/dts/ebaz4205-board.dtsi $(BR2_EXTERNAL_EMBEDME_EBAZ4205_PATH)/ebaz4205/dts/ebaz4205-pl.dtsi"
BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="$(BR2_EXTERNAL_EMBEDME_EBAZ4205_PATH)/ebaz4205/linux/linux.config"
BR2_TARGET_ROOTFS_CPIO=y
BR2_TARGET_ROOTFS_CPIO_GZIP=y
BR2_TARGET_ROOTFS_CPIO_UIMAGE=y
BR2_TARGET_UBOOT=y
BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y
BR2_TARGET_UBOOT_CUSTOM_GIT=y
BR2_TARGET_UBOOT_CUSTOM_REPO_URL="https://github.com/embed-me/u-boot.git"
BR2_TARGET_UBOOT_CUSTOM_REPO_VERSION="v2019.07-ebaz4205"
BR2_TARGET_UBOOT_BOARD_DEFCONFIG="zynq_ebaz4205"
BR2_TARGET_UBOOT_NEEDS_DTC=y
BR2_TARGET_UBOOT_NEEDS_OPENSSL=y
BR2_TARGET_UBOOT_FORMAT_IMG=y
BR2_TARGET_UBOOT_SPL=y
BR2_TARGET_UBOOT_SPL_NAME="spl/boot.bin"
BR2_PACKAGE_HOST_DOSFSTOOLS=y
BR2_PACKAGE_HOST_GENIMAGE=y
BR2_PACKAGE_HOST_MTOOLS=y
BR2_TARGET_GENERIC_ROOT_PASSWD="root"
BR2_TARGET_GENERIC_HOSTNAME="ebaz4205"
BR2_PACKAGE_LINUX_TOOLS_GPIO=y
BR2_PACKAGE_MTD=y
BR2_PACKAGE_MTD_MKFSUBIFS=y
BR2_PACKAGE_STRACE=y
BR2_PACKAGE_COREUTILS=y
BR2_PACKAGE_DROPBEAR=y

ビルド再開

この修正によりビルド成功しました。

ebaz4205_buildrootの説明に従って、FATでフォーマットしたSDカードに、成果物をコピーして、ebaz4205に挿入して起動してみました。

次のような結果でした。

U-Boot SPL 2019.07 (Nov 26 2024 - 06:11:10 +0900)
mmc boot
Trying to boot from MMC1
spl_load_image_fat_os: error reading image system.dtb, err - -2


U-Boot 2019.07 (Nov 26 2024 - 06:11:10 +0900)

CPU:   Zynq 7z010
Silicon: v3.1
DRAM:  ECC disabled 256 MiB
MMC:   mmc@e0100000: 0
Loading Environment from SPI Flash... Invalid bus 0 (err=-19)
*** Warning - spi_flash_probe_bus_cs() failed, using default environment

In:    serial@e0001000
Out:   serial@e0001000
Err:   serial@e0001000
Net:   ZYNQ GEM: e000b000, phyaddr 0, interface rgmii-id

Warning: ethernet@e000b000 (eth0) using random MAC address - 02:ef:31:36:51:ea
eth0: ethernet@e000b000
Hit any key to stop autoboot:  0
gpio: pin 20 (gpio 20) value is 0
Device: mmc@e0100000
Manufacturer ID: 2
OEM: 544d
Name: SA16G
Bus Speed: 20000000
Mode: SD High Speed (50MHz)
Rd Block Len: 512
SD version 3.0
High Capacity: Yes
Capacity: 14.4 GiB
Bus Width: 4-bit
Erase Group Size: 512 Bytes
gpio: pin 54 (gpio 54) value is 0
gpio: pin 55 (gpio 55) value is 0
Copying Linux from SD to RAM...
10760768 bytes read in 1152 ms (8.9 MiB/s)
11520 bytes read in 17 ms (661.1 KiB/s)
Handoff to Linux kernel...
## Booting kernel from Legacy Image at 02080000 ...
   Image Name:   Linux-6.11.10
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    10760704 Bytes = 10.3 MiB
   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ... OK
Wrong Ramdisk Image Format
Ramdisk image is corrupt or invalid
## Error: "bootcmd_mmc" not defined
switch to partitions #0, OK
mmc0 is current device
Scanning mmc 0:1...
Invalid bus 0 (err=-19)
Failed to initialize SPI flash at 0:0 (error -19)
SCRIPT FAILED: continuing...
starting USB...
No working controllers found
USB is stopped. Please issue 'usb start' first.
starting USB...
No working controllers found
ethernet@e000b000 Waiting for PHY auto negotiation to complete......... TIMEOUT !
missing environment variable: pxefile_addr_r
starting USB...
No working controllers found
ethernet@e000b000 Waiting for PHY auto negotiation to complete......... TIMEOUT !
ethernet@e000b000 Waiting for PHY auto negotiation to complete......... TIMEOUT !
Device: mmc@e0100000
Manufacturer ID: 2
OEM: 544d
Name: SA16G
Bus Speed: 20000000
Mode: SD High Speed (50MHz)
Rd Block Len: 512
SD version 3.0
High Capacity: Yes
Capacity: 14.4 GiB
Bus Width: 4-bit
Erase Group Size: 512 Bytes
gpio: pin 54 (gpio 54) value is 0
gpio: pin 55 (gpio 55) value is 0
Copying Linux from SD to RAM...
10760768 bytes read in 1152 ms (8.9 MiB/s)
11520 bytes read in 17 ms (661.1 KiB/s)
Handoff to Linux kernel...
## Booting kernel from Legacy Image at 02080000 ...
   Image Name:   Linux-6.11.10
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    10760704 Bytes = 10.3 MiB
   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ... OK
Wrong Ramdisk Image Format
Ramdisk image is corrupt or invalid

動作はしてますが、ramdisk imageが不正となっています。なにかうまく行ってないようです。

U-bootの環境変数を確認してみます。

U-bootの環境変数
ebaz4205> printenv
arch=arm
baudrate=115200
bitstream_image=download-ebaz4205-zynq7.bit
bitstream_load_address=0x100000
board=ebaz4205
board_name=ebaz4205
boot_a_script=load ${devtype} ${devnum}:${distro_bootpart} ${scriptaddr} ${prefix}${script}; source ${scriptaddr}
boot_efi_binary=if fdt addr ${fdt_addr_r}; then bootefi bootmgr ${fdt_addr_r};else bootefi bootmgr ${fdtcontroladdr};fi;load ${devtype} ${devnum}:${distro_bootpart} ${kernel_addr_r} efi/boot/bootarm.efi; if fdt addr ${fdt_addr_r}; then bootefi ${kernel_addr_r} ${fdt_addr_r};else bootefi ${kernel_addr_r} ${fdtcontroladdr};fi
boot_extlinux=sysboot ${devtype} ${devnum}:${distro_bootpart} any ${scriptaddr} ${prefix}${boot_syslinux_conf}
boot_net_usb_start=usb start
boot_prefixes=/ /boot/
boot_script_dhcp=boot.scr.uimg
boot_scripts=boot.scr.uimg boot.scr
boot_syslinux_conf=extlinux/extlinux.conf
boot_targets=mmc mmc0 qspi usb0 pxe dhcp xilinx
bootcmd=if run s2_button_pressed_test; then run $modeboot || run distro_bootcmd;else echo Abort boot...;fi;
bootcmd_dhcp=run boot_net_usb_start; if dhcp ${scriptaddr} ${boot_script_dhcp}; then source ${scriptaddr}; fi;setenv efi_fdtfile ${fdtfile}; if test -z "${fdtfile}" -a -n "${soc}"; then setenv efi_fdtfile ${soc}-${board}${boardver}.dtb; fi; setenv efi_old_vci ${bootp_vci};setenv efi_old_arch ${bootp_arch};setenv bootp_vci PXEClient:Arch:00010:UNDI:003000;setenv bootp_arch 0xa;if dhcp ${kernel_addr_r}; then tftpboot ${fdt_addr_r} dtb/${efi_fdtfile};if fdt addr ${fdt_addr_r}; then bootefi ${kernel_addr_r} ${fdt_addr_r}; else bootefi ${kernel_addr_r} ${fdtcontroladdr};fi;fi;setenv bootp_vci ${efi_old_vci};setenv bootp_arch ${efi_old_arch};setenv efi_fdtfile;setenv efi_old_arch;setenv efi_old_vci;
bootcmd_mmc0=devnum=0; run mmc_boot
bootcmd_pxe=run boot_net_usb_start; dhcp; if pxe get; then pxe boot; fi
bootcmd_qspi=sf probe 0 0 0 && sf read $scriptaddr $script_offset_f $script_size_f && source ${scriptaddr}; echo SCRIPT FAILED: continuing...;
bootcmd_usb0=devnum=0; run usb_boot
bootcmd_xilinx=run $modeboot
bootdelay=0
bootenv=uEnv.txt
bootfstype=fat
cpu=armv7
devicetree_image=ebaz4205-zynq7.dtb
devicetree_load_address=0x2000000
devicetree_size=0x20000
dfu_mmc=run dfu_mmc_info && dfu 0 mmc 0
dfu_mmc_info=setenv dfu_alt_info ${kernel_image} fat 0 1\\;${devicetree_image} fat 0 1\\;${ramdisk_image} fat 0 1
dfu_ram=run dfu_ram_info && dfu 0 ram 0
dfu_ram_info=setenv dfu_alt_info ${kernel_image} ram 0x3000000 0x500000\\;${devicetree_image} ram 0x2A00000 0x20000\\;${ramdisk_image} ram 0x2000000 0x600000
distro_bootcmd=for target in ${boot_targets}; do run bootcmd_${target}; done
efi_dtb_prefixes=/ /dtb/ /dtb/current/
ethact=ethernet@e000b000
fdtcontroladdr=ffd1e60
fileaddr=2000000
filesize=2d00
fpga_config=fpga load 0 ${bitstream_load_address} ${filesize}
importbootenv=echo Importing environment from SD ...; env import -t ${loadbootenv_addr} $filesize
jtagboot=echo TFTPing Linux to RAM... && tftpboot ${kernel_load_address} ${kernel_image} && tftpboot ${devicetree_load_address} ${devicetree_image} && tftpboot ${ramdisk_load_address} ${ramdisk_image} && bootm ${kernel_load_address} ${ramdisk_load_address} ${devicetree_load_address}
kernel_image=uImage
kernel_load_address=0x2080000
kernel_size=0x500000
leds_bootstate_0=gpio clear 54; gpio clear 55;
leds_bootstate_1=gpio clear 54; gpio set 55;
leds_bootstate_2=gpio set 54; gpio clear 55;
leds_bootstate_3=gpio set 54; gpio set 55;
load_efi_dtb=load ${devtype} ${devnum}:${distro_bootpart} ${fdt_addr_r} ${prefix}${efi_fdtfile}
loadbootenv=load mmc 0 ${loadbootenv_addr} ${bootenv}
loadbootenv_addr=0x2000000
mmc_boot=if mmc dev ${devnum}; then devtype=mmc; run scan_dev_for_boot_part; fi
mmc_loaddtb=load mmc 0 ${devicetree_load_address} ${devicetree_image}
mmc_loadfpga=load mmc 0 ${bitstream_load_address} ${bitstream_image}
mmc_loadkernel=load mmc 0 ${kernel_load_address} ${kernel_image}
mmc_loadramdisk=load mmc 0 ${ramdisk_load_address} ${ramdisk_image}
modeboot=sdboot
nandboot=echo Copying Linux from NAND flash to RAM... && nand read ${kernel_load_address} 0x100000 ${kernel_size} && nand read ${devicetree_load_address} 0x600000 ${devicetree_size} && echo Copying ramdisk... && nand read ${ramdisk_load_address} 0x620000 ${ramdisk_size} && bootm ${kernel_load_address} ${ramdisk_load_address} ${devicetree_load_address}
norboot=echo Copying Linux from NOR flash to RAM... && cp.b 0xE2100000 ${kernel_load_address} ${kernel_size} && cp.b 0xE2600000 ${devicetree_load_address} ${devicetree_size} && echo Copying ramdisk... && cp.b 0xE2620000 ${ramdisk_load_address} ${ramdisk_size} && bootm ${kernel_load_address} ${ramdisk_load_address} ${devicetree_load_address}
preboot=if test $modeboot = sdboot && env run sd_uEnvtxt_existence_test; then if env run loadbootenv; then env run importbootenv; fi; fi;
qspiboot=echo Copying Linux from QSPI flash to RAM... && sf probe 0 0 0 && sf read ${kernel_load_address} 0x100000 ${kernel_size} && sf read ${devicetree_load_address} 0x600000 ${devicetree_size} && echo Copying ramdisk... && sf read ${ramdisk_load_address} 0x620000 ${ramdisk_size} && bootm ${kernel_load_address} ${ramdisk_load_address} ${devicetree_load_address}
ramdisk_image=ebaz4205-image-minimal-ebaz4205-zynq7.cpio.gz.u-boot
ramdisk_load_address=0x4000000
ramdisk_size=0x5E0000
s2_button_pressed_test=gpio input 20;
scan_dev_for_boot=echo Scanning ${devtype} ${devnum}:${distro_bootpart}...; for prefix in ${boot_prefixes}; do run scan_dev_for_extlinux; run scan_dev_for_scripts; done;run scan_dev_for_efi;
scan_dev_for_boot_part=part list ${devtype} ${devnum} -bootable devplist; env exists devplist || setenv devplist 1; for distro_bootpart in ${devplist}; do if fstype ${devtype} ${devnum}:${distro_bootpart} bootfstype; then run scan_dev_for_boot; fi; done; setenv devplist
scan_dev_for_efi=setenv efi_fdtfile ${fdtfile}; if test -z "${fdtfile}" -a -n "${soc}"; then setenv efi_fdtfile ${soc}-${board}${boardver}.dtb; fi; for prefix in ${efi_dtb_prefixes}; do if test -e ${devtype} ${devnum}:${distro_bootpart} ${prefix}${efi_fdtfile}; then run load_efi_dtb; fi;done;if test -e ${devtype} ${devnum}:${distro_bootpart} efi/boot/bootarm.efi; then echo Found EFI removable media binary efi/boot/bootarm.efi; run boot_efi_binary; echo EFI LOAD FAILED: continuing...; fi; setenv efi_fdtfile
scan_dev_for_extlinux=if test -e ${devtype} ${devnum}:${distro_bootpart} ${prefix}${boot_syslinux_conf}; then echo Found ${prefix}${boot_syslinux_conf}; run boot_extlinux; echo SCRIPT FAILED: continuing...; fi
scan_dev_for_scripts=for script in ${boot_scripts}; do if test -e ${devtype} ${devnum}:${distro_bootpart} ${prefix}${script}; then echo Found U-Boot script ${prefix}${script}; run boot_a_script; echo SCRIPT FAILED: continuing...; fi; done
sd_uEnvtxt_existence_test=test -e mmc 0 /uEnv.txt
sdboot=if mmcinfo; then run leds_bootstate_0;run uenvboot;echo Copying Linux from SD to RAM...;run mmc_loadkernel && run mmc_loaddtb && run mmc_loadramdisk && run leds_bootstate_2;echo Handoff to Linux kernel...;bootm ${kernel_load_address} ${ramdisk_load_address} ${devicetree_load_address}; fi
soc=zynq
stderr=serial@e0001000
stdin=serial@e0001000
stdout=serial@e0001000
thor_mmc=run dfu_mmc_info && thordown 0 mmc 0
thor_ram=run dfu_ram_info && thordown 0 ram 0
uenvboot=if run loadbootenv; then echo Loaded environment from ${bootenv}; run importbootenv; fi; if test -n $uenvcmd; then echo Running uenvcmd ...; run uenvcmd; fi
usb_boot=usb start; if usb dev ${devnum}; then devtype=usb; run scan_dev_for_boot_part; fi
vendor=embedme
Environment size: 7530/131068 bytes

この内容をChatGPTに与えて内容を解析してみましたが、あまり役に立つ情報は得られませんでした。
手動で起動する方法を、ChatGPTに生成してもらって試して見ます。

ebaz4205> setenv ramdisk_image rootfs.cpio.gz
ebaz4205> run sdboot
Device: mmc@e0100000
Manufacturer ID: 2
OEM: 544d
Name: SA16G
Bus Speed: 20000000
Mode: SD High Speed (50MHz)
Rd Block Len: 512
SD version 3.0
High Capacity: Yes
Capacity: 14.4 GiB
Bus Width: 4-bit
Erase Group Size: 512 Bytes
gpio: pin 54 (gpio 54) value is 0
gpio: pin 55 (gpio 55) value is 0
Copying Linux from SD to RAM...
10760768 bytes read in 1153 ms (8.9 MiB/s)
11520 bytes read in 17 ms (661.1 KiB/s)
9637780 bytes read in 1035 ms (8.9 MiB/s)
gpio: pin 54 (gpio 54) value is 1
   Warning: value of pin is still 0
gpio: pin 55 (gpio 55) value is 0
Handoff to Linux kernel...
## Booting kernel from Legacy Image at 02080000 ...
   Image Name:   Linux-6.11.10
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    10760704 Bytes = 10.3 MiB
   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ... OK
Wrong Ramdisk Image Format
Ramdisk image is corrupt or invalid

rootfsとして、rootfs.cpioも生成されてたので、これにしてみます。

ebaz4205> setenv ramdisk_image rootfs.cpio
ebaz4205> run sdboot
Device: mmc@e0100000
Manufacturer ID: 2
OEM: 544d
Name: SA16G
Bus Speed: 20000000
Mode: SD High Speed (50MHz)
Rd Block Len: 512
SD version 3.0
High Capacity: Yes
Capacity: 14.4 GiB
Bus Width: 4-bit
Erase Group Size: 512 Bytes
gpio: pin 54 (gpio 54) value is 0
gpio: pin 55 (gpio 55) value is 0
Copying Linux from SD to RAM...
10760768 bytes read in 1152 ms (8.9 MiB/s)
11520 bytes read in 17 ms (661.1 KiB/s)
26316288 bytes read in 2793 ms (9 MiB/s)
gpio: pin 54 (gpio 54) value is 1
   Warning: value of pin is still 0
gpio: pin 55 (gpio 55) value is 0
Handoff to Linux kernel...
## Booting kernel from Legacy Image at 02080000 ...
   Image Name:   Linux-6.11.10
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    10760704 Bytes = 10.3 MiB
   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ... OK
Wrong Ramdisk Image Format
Ramdisk image is corrupt or invalid

同じ結果でした。
setenv ramdisk_image rootfs.tarもやってみたけど同じ。

一端、rootfsの事は保留して、カーネルのみを起動してみます。
U-bootのプロンプトから手動でカーネルを起動してみる

カーネル起動時のログ
ebaz4205> setenv kernel_image uImage
ebaz4205> setenv devicetree_image ebaz4205-zynq7.dtb
ebaz4205> setenv ramdisk_image rootfs.cpio.gz
ebaz4205> setenv bootargs console=ttyPS0,115200 root=/dev/ram rw earlyprintk
ebaz4205> mmc rescan
ebaz4205> fatload mmc 0 ${kernel_load_address} ${kernel_image}
10760768 bytes read in 1152 ms (8.9 MiB/s)
ebaz4205> fatload mmc 0 ${devicetree_load_address} ${devicetree_image}
11520 bytes read in 17 ms (661.1 KiB/s)
ebaz4205> fatload mmc 0 ${ramdisk_load_address} ${ramdisk_image}
9637780 bytes read in 1035 ms (8.9 MiB/s)
ebaz4205> bootm ${kernel_load_address} - ${devicetree_load_address}
## Booting kernel from Legacy Image at 02080000 ...
   Image Name:   Linux-6.11.10
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    10760704 Bytes = 10.3 MiB
   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ... OK
## Flattened Device Tree blob at 02000000
   Booting using the fdt blob at 0x2000000
   Loading Kernel Image ... OK
   Loading Device Tree to 0eb33000, end 0eb38cff ... OK

Starting kernel ...

[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 6.11.10 (masa@wsl-elixir) (arm-buildroot-linux-gnueabihf-gcc.br_real (Buildroot 2024.11-rc2-6-ged590a22e2) 13.3.0, GNU ld (GNU Binutils) 2.42) #1 SMP Tue Nov 26 13:07:02 JST 2024
[    0.000000] CPU: ARMv7 Processor [413fc090] revision 0 (ARMv7), cr=18c5387d
[    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[    0.000000] OF: fdt: Machine model: xlnx,zynq-7000
[    0.000000] Memory policy: Data cache writealloc
[    0.000000] efi: UEFI not found.
[    0.000000] cma: Reserved 64 MiB at 0x0a800000 on node -1
[    0.000000] Zone ranges:
[    0.000000]   DMA      [mem 0x0000000000000000-0x000000000fffffff]
[    0.000000]   Normal   empty
[    0.000000]   HighMem  empty
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000000000000-0x000000000fffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x000000000fffffff]
[    0.000000] percpu: Embedded 17 pages/cpu s40076 r8192 d21364 u69632
[    0.000000] Kernel command line: console=ttyPS0,115200 root=/dev/ram rw earlyprintk
[    0.000000] Unknown kernel command line parameters "earlyprintk", will be passed to user space.
[    0.000000] Dentry cache hash table entries: 32768 (order: 5, 131072 bytes, linear)
[    0.000000] Inode-cache hash table entries: 16384 (order: 4, 65536 bytes, linear)
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 65536
[    0.000000] mem auto-init: stack:all(zero), heap alloc:off, heap free:off
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=2, Nodes=1
[    0.000000] trace event string verifier disabled
[    0.000000] rcu: Hierarchical RCU implementation.
[    0.000000] rcu:     RCU event tracing is enabled.
[    0.000000] rcu:     RCU restricting CPUs from NR_CPUS=16 to nr_cpu_ids=2.
[    0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 10 jiffies.
[    0.000000] rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=2
[    0.000000] NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
[    0.000000] slcr mapped to (ptrval)
[    0.000000] L2C: platform modifies aux control register: 0x02060000 -> 0x02460000
[    0.000000] L2C: DT/platform modifies aux control register: 0x02060000 -> 0x02460000
[    0.000000] L2C-310 erratum 769419 enabled
[    0.000000] L2C-310 enabling early BRESP for Cortex-A9
[    0.000000] L2C-310 full line of zeros enabled for Cortex-A9
[    0.000000] L2C-310 dynamic clock gating enabled, standby mode enabled
[    0.000000] L2C-310 cache controller enabled, 8 ways, 512 kB
[    0.000000] L2C-310: CACHE_ID 0x410000c8, AUX_CTRL 0x46460001
[    0.000000] rcu: srcu_init: Setting srcu_struct sizes based on contention.
[    0.000000] zynq_clock_init: clkc starts at (ptrval)
[    0.000000] Zynq clock init
[    0.000000] ps_clk frequency not specified, using 33 MHz.
[    0.000002] sched_clock: 64 bits at 167MHz, resolution 6ns, wraps every 4398046511103ns
[    0.000025] clocksource: arm_global_timer: mask: 0xffffffffffffffff max_cycles: 0x26703d7dd8, max_idle_ns: 440795208065 ns
[    0.000058] Switching to timer-based delay loop, resolution 6ns
[    0.001083] Console: colour dummy device 80x30
[    0.001134] Calibrating delay loop (skipped), value calculated using timer frequency.. 333.33 BogoMIPS (lpj=1666666)
[    0.001153] CPU: Testing write buffer coherency: ok
[    0.001189] CPU0: Spectre v2: using BPIALL workaround
[    0.001199] pid_max: default: 32768 minimum: 301
[    0.001348] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.001365] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.002194] CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
[    0.003282] Setting up static identity map for 0x300000 - 0x3000ac
[    0.003983] rcu: Hierarchical SRCU implementation.
[    0.003993] rcu:     Max phase no-delay instances is 1000.
[    0.004316] Timer migration: 1 hierarchy levels; 8 children per group; 1 crossnode level
[    0.005547] EFI services will not be available.
[    0.005763] smp: Bringing up secondary CPUs ...
[    0.006670] CPU1: thread -1, cpu 1, socket 0, mpidr 80000001
[    0.006694] CPU1: Spectre v2: using BPIALL workaround
[    0.006863] smp: Brought up 1 node, 2 CPUs
[    0.006878] SMP: Total of 2 processors activated (666.66 BogoMIPS).
[    0.006891] CPU: All CPU(s) started in SVC mode.
[    0.007304] Memory: 164852K/262144K available (15360K kernel code, 2274K rwdata, 6164K rodata, 2048K init, 412K bss, 30380K reserved, 65536K cma-reserved, 0K highmem)
[    0.007760] devtmpfs: initialized
[    0.011236] VFP support v0.3: implementor 41 architecture 3 part 30 variant 9 rev 4
[    0.011511] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.011536] futex hash table entries: 512 (order: 3, 32768 bytes, linear)
[    0.015260] pinctrl core: initialized pinctrl subsystem
[    0.017053] DMI not present or invalid.
[    0.017874] NET: Registered PF_NETLINK/PF_ROUTE protocol family
[    0.021264] DMA: preallocated 256 KiB pool for atomic coherent allocations
[    0.023455] thermal_sys: Registered thermal governor 'step_wise'
[    0.023530] cpuidle: using governor menu
[    0.027615] platform axi: Fixed dependency cycle(s) with /axi/interrupt-controller@f8f01000
[    0.032261] platform replicator: Fixed dependency cycle(s) with /axi/etb@f8801000
[    0.032365] amba f8801000.etb: Fixed dependency cycle(s) with /replicator
[    0.032612] platform replicator: Fixed dependency cycle(s) with /axi/tpiu@f8803000
[    0.032708] amba f8803000.tpiu: Fixed dependency cycle(s) with /replicator
[    0.032969] platform replicator: Fixed dependency cycle(s) with /axi/funnel@f8804000
[    0.033064] amba f8804000.funnel: Fixed dependency cycle(s) with /axi/ptm@f889d000
[    0.033088] amba f8804000.funnel: Fixed dependency cycle(s) with /axi/ptm@f889c000
[    0.033108] amba f8804000.funnel: Fixed dependency cycle(s) with /replicator
[    0.033352] amba f8804000.funnel: Fixed dependency cycle(s) with /axi/ptm@f889c000
[    0.033451] amba f889c000.ptm: Fixed dependency cycle(s) with /axi/funnel@f8804000
[    0.033702] amba f8804000.funnel: Fixed dependency cycle(s) with /axi/ptm@f889d000
[    0.033792] amba f889d000.ptm: Fixed dependency cycle(s) with /axi/funnel@f8804000
[    0.034737] No ATAGs?
[    0.034838] hw-breakpoint: found 5 (+1 reserved) breakpoint and 1 watchpoint registers.
[    0.034852] hw-breakpoint: maximum watchpoint size is 4 bytes.
[    0.038036] Serial: AMBA PL011 UART driver
[    0.038856] e0001000.serial: ttyPS0 at MMIO 0xe0001000 (irq = 26, base_baud = 6249999) is a xuartps
[    0.038941] printk: legacy console [ttyPS0] enabled
[    0.653658] iommu: Default domain type: Translated
[    0.658450] iommu: DMA domain TLB invalidation policy: strict mode
[    0.666194] SCSI subsystem initialized
[    0.670508] usbcore: registered new interface driver usbfs
[    0.676027] usbcore: registered new interface driver hub
[    0.681407] usbcore: registered new device driver usb
[    0.687198] pps_core: LinuxPPS API ver. 1 registered
[    0.692194] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[    0.701351] PTP clock support registered
[    0.705432] EDAC MC: Ver: 3.0.0
[    0.712422] vgaarb: loaded
[    0.716353] clocksource: Switched to clocksource arm_global_timer
[    0.753026] NET: Registered PF_INET protocol family
[    0.758117] IP idents hash table entries: 4096 (order: 3, 32768 bytes, linear)
[    0.766251] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 4096 bytes, linear)
[    0.774657] Table-perturb hash table entries: 65536 (order: 6, 262144 bytes, linear)
[    0.782428] TCP established hash table entries: 2048 (order: 1, 8192 bytes, linear)
[    0.790104] TCP bind hash table entries: 2048 (order: 3, 32768 bytes, linear)
[    0.797315] TCP: Hash tables configured (established 2048 bind 2048)
[    0.803749] UDP hash table entries: 256 (order: 1, 8192 bytes, linear)
[    0.810319] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes, linear)
[    0.817431] NET: Registered PF_UNIX/PF_LOCAL protocol family
[    0.830594] RPC: Registered named UNIX socket transport module.
[    0.836521] RPC: Registered udp transport module.
[    0.841240] RPC: Registered tcp transport module.
[    0.845937] RPC: Registered tcp-with-tls transport module.
[    0.851431] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    0.857872] PCI: CLS 0 bytes, default 64
[    0.863023] Initialise system trusted keyrings
[    0.867810] workingset: timestamp_bits=30 max_order=16 bucket_order=0
[    0.874652] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.881090] NFS: Registering the id_resolver key type
[    0.886174] Key type id_resolver registered
[    0.890392] Key type id_legacy registered
[    0.894591] Key type asymmetric registered
[    0.898689] Asymmetric key parser 'x509' registered
[    0.903641] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 247)
[    0.911046] io scheduler mq-deadline registered
[    0.915570] io scheduler kyber registered
[    0.934362] zynq-pinctrl 700.pinctrl: zynq pinctrl initialized
[    0.961558] dma-pl330 f8003000.dma-controller: Loaded driver for PL330 DMAC-241330
[    0.969136] dma-pl330 f8003000.dma-controller:       DBUFF-128x8bytes Num_Chans-8 Num_Peri-4 Num_Events-16
[    1.049184] Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
[    1.059398] msm_serial: driver initialized
[    1.063825] SuperH (H)SCI(F) driver initialized
[    1.068541] STMicroelectronics ASC driver initialized
[    1.089265] brd: module loaded
[    1.098867] loop: module loaded
[    1.111308] CAN device driver interface
[    2.331162] macb e000b000.ethernet eth0: Cadence GEM rev 0x00020118 at 0xe000b000 irq 37 (02:ef:31:36:51:ea)
[    2.341313] bgmac_bcma: Broadcom 47xx GBit MAC driver loaded
[    2.347890] e1000e: Intel(R) PRO/1000 Network Driver
[    2.352893] e1000e: Copyright(c) 1999 - 2015 Intel Corporation.
[    2.358852] igb: Intel(R) Gigabit Ethernet Network Driver
[    2.364261] igb: Copyright (c) 2007-2014 Intel Corporation.
[    2.372530] pegasus: Pegasus/Pegasus II USB Ethernet driver
[    2.378144] usbcore: registered new interface driver pegasus
[    2.383856] usbcore: registered new interface driver asix
[    2.389282] usbcore: registered new interface driver ax88179_178a
[    2.395429] usbcore: registered new interface driver cdc_ether
[    2.401302] usbcore: registered new interface driver smsc75xx
[    2.407076] usbcore: registered new interface driver smsc95xx
[    2.412877] usbcore: registered new interface driver net1080
[    2.418562] usbcore: registered new interface driver cdc_subset
[    2.424522] usbcore: registered new interface driver zaurus
[    2.430123] usbcore: registered new interface driver cdc_ncm
[    2.439005] usbcore: registered new interface driver usb-storage
[    2.447058] input: buttons as /devices/soc0/buttons/input/input0
[    2.456053] i2c_dev: i2c /dev entries driver
[    2.468437] cpufreq: cpufreq_online: CPU0: Running at unlisted initial frequency: 666666 KHz, changing to: 666667 KHz
[    2.479851] Xilinx Zynq CpuIdle Driver started
[    2.485060] sdhci: Secure Digital Host Controller Interface driver
[    2.491263] sdhci: Copyright(c) Pierre Ossman
[    2.496876] Synopsys Designware Multimedia Card Interface Driver
[    2.503936] sdhci-pltfm: SDHCI platform and OF driver helper
[    2.514335] ledtrig-cpu: registered to indicate activity on CPUs
[    2.521279] clocksource: ttc_clocksource: mask: 0xffff max_cycles: 0xffff, max_idle_ns: 537538477 ns
[    2.530527] timer #0 at (ptrval), irq=39
[    2.534787] usbcore: registered new interface driver usbhid
[    2.540384] usbhid: USB HID core driver
[    2.542818] mmc0: SDHCI controller on e0100000.mmc [e0100000.mmc] using ADMA
[    2.553081] armv7-pmu f8891000.pmu: hw perfevents: no interrupt-affinity property, guessing.
[    2.561904] hw perfevents: enabled with armv7_cortex_a9 PMU driver, 7 counters available
[    2.571214] NET: Registered PF_INET6 protocol family
[    2.577776] Segment Routing with IPv6
[    2.581519] In-situ OAM (IOAM) with IPv6
[    2.585533] sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver
[    2.588327] mmc0: new high speed SDHC card at address 1234
[    2.592212] NET: Registered PF_PACKET protocol family
[    2.597610] mmcblk0: mmc0:1234 SA16G 14.4 GiB
[    2.602008] can: controller area network core
[    2.609437]  mmcblk0: p1 p2
[    2.610807] NET: Registered PF_CAN protocol family
[    2.618379] can: raw protocol
[    2.621355] can: broadcast manager protocol
[    2.625540] can: netlink gateway - max_hops=1
[    2.630430] Key type dns_resolver registered
[    2.635009] ThumbEE CPU extension supported.
[    2.639347] Registering SWP/SWPB emulation handler
[    2.656179] Loading compiled-in X.509 certificates
[    2.677696] clk: Disabling unused clocks
[    2.681712] PM: genpd: Disabling unused power domains
[    2.688272] ntfs3: ram0: Primary boot signature is not NTFS.
[    2.693951] ntfs3: ram0: try to read out of volume at offset 0x3fffe00
[    2.700752] ntfs3: ram0: Primary boot signature is not NTFS.
[    2.706472] ntfs3: ram0: try to read out of volume at offset 0x3fffe00
[    2.713728] ntfs3: ram0: Primary boot signature is not NTFS.
[    2.719427] ntfs3: ram0: try to read out of volume at offset 0x3fffe00
[    2.726046] ntfs3: ram0: Primary boot signature is not NTFS.
[    2.731749] ntfs3: ram0: try to read out of volume at offset 0x3fffe00
[    2.738313] List of all partitions:
[    2.741805] 0100           65536 ram0
[    2.741815]  (driver?)
[    2.747946] 0101           65536 ram1
[    2.747956]  (driver?)
[    2.754047] 0102           65536 ram2
[    2.754056]  (driver?)
[    2.760167] 0103           65536 ram3
[    2.760176]  (driver?)
[    2.766259] 0104           65536 ram4
[    2.766268]  (driver?)
[    2.772371] 0105           65536 ram5
[    2.772380]  (driver?)
[    2.778478] 0106           65536 ram6
[    2.778487]  (driver?)
[    2.784574] 0107           65536 ram7
[    2.784582]  (driver?)
[    2.790695] 0108           65536 ram8
[    2.790704]  (driver?)
[    2.796803] 0109           65536 ram9
[    2.796812]  (driver?)
[    2.802897] 010a           65536 ram10
[    2.802905]  (driver?)
[    2.809096] 010b           65536 ram11
[    2.809106]  (driver?)
[    2.815275] 010c           65536 ram12
[    2.815283]  (driver?)
[    2.821474] 010d           65536 ram13
[    2.821482]  (driver?)
[    2.827668] 010e           65536 ram14
[    2.827677]  (driver?)
[    2.833851] 010f           65536 ram15
[    2.833859]  (driver?)
[    2.840056] b300        15126528 mmcblk0
[    2.840066]  driver: mmcblk
[    2.846865]   b301         2097152 mmcblk0p1 e970f82a-01
[    2.846876]
[    2.853657]   b302         4194304 mmcblk0p2 e970f82a-02
[    2.853666]
[    2.860466] No filesystem could mount root, tried:
[    2.860471]  ext3
[    2.865338]  ext2
[    2.867276]  ext4
[    2.869192]  squashfs
[    2.871110]  vfat
[    2.873376]  msdos
[    2.875294]  ntfs
[    2.877313]  ntfs3
[    2.879226]
[    2.882710] Kernel panic - not syncing: VFS: Unable to mount root fs on "/dev/ram" or unknown-block(1,0)
[    2.892189] CPU: 0 UID: 0 PID: 1 Comm: swapper/0 Not tainted 6.11.10 #1
[    2.898809] Hardware name: Xilinx Zynq Platform
[    2.903332] Call trace:
[    2.903346]  unwind_backtrace from show_stack+0x10/0x14
[    2.911111]  show_stack from dump_stack_lvl+0x54/0x68
[    2.916188]  dump_stack_lvl from panic+0x10c/0x344
[    2.920996]  panic from mount_root_generic+0x2a0/0x2a8
[    2.926153]  mount_root_generic from prepare_namespace+0x1fc/0x254
[    2.932341]  prepare_namespace from kernel_init+0x1c/0x12c
[    2.937835]  kernel_init from ret_from_fork+0x14/0x28
[    2.942895] Exception stack(0xd0815fb0 to 0xd0815ff8)
[    2.947941] 5fa0:                                     00000000 00000000 00000000 00000000
[    2.956119] 5fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[    2.964294] 5fe0: 00000000 00000000 00000000 00000000 00000013 00000000
[    2.970966] ---[ end Kernel panic - not syncing: VFS: Unable to mount root fs on "/dev/ram" or unknown-block(1,0) ]---

起動しました!
rootfsが見つからないので、Kernel panicにはなってますが、カーネル自体は、起動しています。

この検証で、rootfsの構築や、デフォルトのU-bootの起動設定で起動しない点は課題ですが、U-bootの起動や、Kernelの起動はできることがわかりました。

rootfsの問題は、Nervesのポーティングをする場合、rootfsはNerves提供のものに置き換わるので、この問題は解決できると思います。

まとめ

  • この調査で、完全ではありませんが、動作するBuildrootの設定を得る事ができました。
  • この設定を元にNervesのポーティングを試してみたいと思います。

関連記事
EBAZ4205を使って、FPGAを使ったシステム開発の環境を構築する
EBAZ4205でLinuxを動かして見る
petalinuxをBuildrootでビルドする

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?