From: Sean Anderson Date: Fri, 19 Feb 2021 09:19:52 -0500 Subject: =?UTF-8?Q?Re=3a_Can=e2=80=99t_boot_FIT_kernel_image?= In-Reply-To: <2c937366c56fe65bcc98ee50c4ac2eed@spider.vc> References: <2c937366c56fe65bcc98ee50c4ac2eed@spider.vc> Message-ID: <3a8b370d-e8e8-454c-9b75-99efd7b20fe0@seco.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 2/19/21 3:47 AM, ??????? ?????? wrote: > Hello! > > I'm trying to make FIT Kernel+dtb image for U-Boot. > ``` > mkimage -E -f Image.its Image.new > ``` > > Image.its: > ``` > /dts-v1/; > > / { > ??????? description = "ARM64 OpenWrt FIT (Flattened Image Tree)"; > ??????? #address-cells = <1>; > > ??????? images { > ??????????????? kernel at 1 { > ??????????????????????? description = "ARM64 OpenWrt Linux-5.4.60"; > ??????????????????????? data = /incbin/("arch/arm64/boot/Image.lzma"); > ??????????????????????? type = "kernel"; > ??????????????????????? arch = "arm64"; > ??????????????????????? os = "linux"; > ??????????????????????? compression = "lzma"; > ??????????????????????? load = <0x40008000>; > ??????????????????????? entry = <0x40008000>; > ??????????????????????? hash at 1 { > ??????????????????????????????? algo = "crc32"; > ??????????????????????? }; > ??????????????????????? hash at 2 { > ??????????????????????????????? algo = "sha1"; > ??????????????????????? }; > ??????????????? }; > > ??????????????? fdt at 1 { > ??????????????????????? description = "ARM64 OpenWrt xunlong_orangepi-zero-plus2 device tree blob"; > ??????????????????????? data = /incbin/("sun50i-h5-orangepi-zero-plus2.dtb"); > ??????????????????????? type = "flat_dt"; > ??????????????????????? arch = "arm64"; > ??????????????????????? compression = "none"; > ??????????????????????? load = <0x4FA00000>; > ??????????????????????? hash at 1 { > ??????????????????????????????? algo = "crc32"; > ??????????????????????? }; > ??????????????????????? hash at 2 { > ??????????????????????????????? algo = "sha1"; > ??????????????????????? }; > ??????????????? }; > > ??????? }; > > ??????? configurations { > ??????????????? default = "config at 1"; > ??????????????? config at 1 { > ??????????????????????? description = "OpenWRT"; > ??????????????????????? kernel = "kernel at 1"; > ??????????????????????? fdt = "fdt at 1"; > ??????????????? }; > ??????? }; > }; > ``` > > and it Look like good. U-boot print correct Information about it. > > ``` > U-Boot 2020.04 (Aug 28 2020 - 09:44:29 +0000) Allwinner Technology > > CPU:?? Allwinner H5 (SUN50I) > Model: OrangePi Zero Plus2 > DRAM:? 512 MiB > MMC:?? Device 'mmc at 1c11000': seq 1 is in use by 'mmc at 1c10000' > mmc at 1c0f000: 0, mmc at 1c10000: 2, mmc at 1c11000: 1 > > In:??? serial > Out:?? serial > Err:?? serial > Hit any key to stop autoboot:? 0 > => fatload mmc 0 53E00000 Image.new > 3561732 bytes read in 513 ms (6.6 MiB/s) > => setenv bootargs console=ttyS0,115200 earlyprintk root=PARTUUID=5452574f-02 rootwait earlycon=uart,mmio32,0x01c28000 > => bootm 53E00000 > ## Loading kernel from FIT Image at 53e00000 ... > ?? Using 'config at 1' configuration > ?? Trying 'kernel at 1' kernel subimage > ???? Description:? ARM64 OpenWrt Linux-5.4.60 > ???? Type:???????? Kernel Image > ???? Compression:? lzma compressed > ???? Data Start:?? 0x53e0043c > ???? Data Size:??? 3537003 Bytes = 3.4 MiB > ???? Architecture: AArch64 > ???? OS:?????????? Linux > ???? Load Address: 0x40008000 Here it is 40008000 > ???? Entry Point:? 0x40008000 > ???? Hash algo:??? crc32 > ???? Hash value:?? 1003b68e > ???? Hash algo:??? sha1 > ???? Hash value:?? 94d9ea6a0f543649d294b50bd2a7bba1857cf538 > ?? Verifying Hash Integrity ... crc32+ sha1+ OK > ## Loading fdt from FIT Image at 53e00000 ... > ?? Using 'config at 1' configuration > ?? Trying 'fdt at 1' fdt subimage > ???? Description:? ARM64 OpenWrt xunlong_orangepi-zero-plus2 device tree blob > ???? Type:???????? Flat Device Tree > ???? Compression:? uncompressed > ???? Data Start:?? 0x5415fca8 > ???? Data Size:??? 23641 Bytes = 23.1 KiB > ???? Architecture: AArch64 > ???? Load Address: 0x4fa00000 > ???? Hash algo:??? crc32 > ???? Hash value:?? fc8daabb > ???? Hash algo:??? sha1 > ???? Hash value:?? 6c18b66e1c9bb6dfb289701e1a478e294cb3568c > ?? Verifying Hash Integrity ... crc32+ sha1+ OK > ?? Loading fdt from 0x5415fca8 to 0x4fa00000 > ?? Booting using the fdt blob at 0x4fa00000 > ?? Uncompressing Kernel Image > ?? Loading Device Tree to 0000000049ff7000, end 0000000049fffc58 ... OK > > Starting kernel ... > ``` > And device has freeze. > > Kernel and dtb is fine. I have Image.lzma and "dtb" files distinctly and their work fine: > ``` > U-Boot 2020.04 (Aug 28 2020 - 09:44:29 +0000) Allwinner Technology > > CPU:?? Allwinner H5 (SUN50I) > Model: OrangePi Zero Plus2 > DRAM:? 512 MiB > MMC:?? Device 'mmc at 1c11000': seq 1 is in use by 'mmc at 1c10000' > mmc at 1c0f000: 0, mmc at 1c10000: 2, mmc at 1c11000: 1 > > In:??? serial > Out:?? serial > Err:?? serial > Hit any key to stop autoboot:? 0 > => load mmc 0 53E00000 Image.lzma > 3537067 bytes read in 506 ms (6.7 MiB/s) > => fatload mmc 0 0x4FA00000 sun50i-h5-orangepi-zero-plus2.dtb > 23641 bytes read in 5 ms (4.5 MiB/s) > => setenv bootargs console=ttyS0,115200 earlyprintk root=PARTUUID=5452574f-02 rootwait earlycon=uart,mmio32,0x01c28000 > =bootm 0x53E00000 - 0x4FA00000 > ## Booting kernel from Legacy Image at 53e00000 ... > ?? Image Name:?? Linux > ?? Image Type:?? AArch64 Linux Kernel Image (lzma compressed) > ?? Data Size:??? 3537003 Bytes = 3.4 MiB > ?? Load Address: 40080000 but here it is 40080000. Which one is correct? --Sean > ?? Entry Point:? 40080000 > ?? Verifying Checksum ... OK > ## Flattened Device Tree blob at 4fa00000 > ?? Booting using the fdt blob at 0x4fa00000 > ?? Uncompressing Kernel Image > ?? Loading Device Tree to 0000000049ff7000, end 0000000049fffc58 ... OK > > Starting kernel ... > > [??? 0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd034] > [??? 0.000000] Linux version 5.4.60 (spider at horoshiki.ru) (gcc version 8.4.0 (OpenWrt GCC 8.4.0 r14283-42d14ace3e)) #0 SMP Fri Aug 28 09:44:29 2020 > [??? 0.000000] Machine model: OrangePi Zero Plus2 > ``` > > What I do wrong? > > PS. Kernel boot normally by next command: > ``` > lzmadec 0x53e0043c 0x40008000 > imxtract 53e00000 fdt at 1 0x4FA00000 > booti 0x40008000 - 0x4FA00000 > ``` > >