자일링스 Zynq-7000 SoC와 함께 작업 중이며 "기존"(uImage + DTB + initramfs 이미지)에서 "현대"(FIT 이미지) 부팅 흐름으로 전환하려고합니다. . 이것은 (출력 생략) 내 보드를 부팅하는 데 사용하고 명령의 현재의 순서입니다 :FIT 이미지에서 부팅 할 수 없음
setenv bootargs "console=ttyPS0,115200 root=/dev/ram rw ramdisk_size=0x1600000 earlyprintk init=/sbin/init"
tftpboot 0x2000000 devicetree.dtb
tftpboot 0x2080000 uImage
tftpboot 0x4000000 initramfs.img
bootm 0x2080000 0x4000000 0x2000000
내가 기존 프로젝트에서 일하고 있어요, 그리고 지금까지 내가 아는 한, TFTP의로드 주소 (0x2080000
등 .)는 임의적입니다. 나는하지 않는다. 은 그들이 RAM에 매핑되고로드 주소와 겹치지 않는다는 사실 외에도,을 중요하게 생각한다. 내가 틀렸다면 나를 바로 잡아라. 즉
Zynq> bootm 0x2080000 0x4000000 0x2000000
## Booting kernel from Legacy Image at 02080000 ...
Image Name: Linux-4.0.0-00011-gcfd1f62
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 3297728 Bytes = 3.1 MiB
Load Address: 00008000
Entry Point: 00008000
Verifying Checksum ... OK
## Loading init Ramdisk from Legacy Image at 04000000 ...
Image Name: Ramdisk Image
Image Type: ARM Linux RAMDisk Image (gzip compressed)
Data Size: 22569621 Bytes = 21.5 MiB
Load Address: 00000000
Entry Point: 00000000
Verifying Checksum ... OK
## Flattened Device Tree blob at 02000000
Booting using the fdt blob at 0x2000000
Loading Kernel Image ... OK
Loading Ramdisk to 1ea79000, end 1ffff295 ... OK
Loading Device Tree to 1ea73000, end 1ea78ba1 ... OK
Starting kernel ...
Uncompressing Linux... done, booting the kernel.
Booting Linux on physical CPU 0x0
[Omitted]
, bootm
올바르게 커널을 부팅하십시오 bootm
명령을 실행
다음과 같은 출력을 생성합니다.
각 이미지를로드하고 주소를 bootm
에 전달하는 대신 세 가지 이미지를 모두 사용하여 단일 FIT 이미지를 만들고 싶습니다. 필요하다면 나는 .its
소스를 제공 할 수 있지만, 나는 모든 세 가지 이미지 (uImage, DTB 및 다시 initramfs를) 지정이는 mkimage
출력 :
FIT description: Test FIT Image
Created: Mon Dec 19 13:13:06 2016
Image 0 ([email protected])
Description: Linux Kernel
Created: Mon Dec 19 13:13:06 2016
Type: Kernel Image
Compression: uncompressed
Data Size: 3297792 Bytes = 3220.50 kB = 3.15 MB
Architecture: ARM
OS: Linux
Load Address: 0x00008000
Entry Point: 0x00008000
Image 1 ([email protected])
Description: Device Tree Blob
Created: Mon Dec 19 13:13:06 2016
Type: Flat Device Tree
Compression: uncompressed
Data Size: 11170 Bytes = 10.91 kB = 0.01 MB
Architecture: ARM
Image 2 ([email protected])
Description: initramfs
Created: Mon Dec 19 13:13:06 2016
Type: RAMDisk Image
Compression: gzip compressed
Data Size: 22569685 Bytes = 22040.71 kB = 21.52 MB
Architecture: ARM
OS: Linux
Load Address: 0x00000000
Entry Point: 0x00000000
Default Configuration: '[email protected]'
Configuration 0 ([email protected])
Description: Boot Linux kernel with FDT blob
Kernel: [email protected]
Init Ramdisk: [email protected]
FDT: [email protected]
로드 주소와 엔트리 포인트에서 bootm
출력 정렬 내 이전 부팅 절차. bootm
에서 여기
setenv bootargs "console=ttyPS0,115200 root=/dev/ram rw ramdisk_size=0x1600000 earlyprintk init=/sbin/init"
tftpboot 0x2000000 image.itb
bootm 0x2000000
출력입니다 :
Zynq> bootm 0x2000000
## Loading kernel from FIT Image at 02000000 ...
Using '[email protected]' configuration
Verifying Hash Integrity ... OK
Trying '[email protected]' kernel subimage
Description: Linux Kernel
Type: Kernel Image
Compression: uncompressed
Data Start: 0x020000c4
Data Size: 3297792 Bytes = 3.1 MiB
Architecture: ARM
OS: Linux
Load Address: 0x00008000
Entry Point: 0x00008000
Verifying Hash Integrity ... OK
## Loading ramdisk from FIT Image at 02000000 ...
Using '[email protected]' configuration
Trying '[email protected]' ramdisk subimage
Description: initramfs
Type: RAMDisk Image
Compression: gzip compressed
Data Start: 0x02327f88
Data Size: 22569685 Bytes = 21.5 MiB
Architecture: ARM
OS: Linux
Load Address: 0x00000000
Entry Point: 0x00000000
Verifying Hash Integrity ... OK
## Loading fdt from FIT Image at 02000000 ...
Using '[email protected]' configuration
Trying '[email protected]' fdt subimage
Description: Device Tree Blob
Type: Flat Device Tree
Compression: uncompressed
Data Start: 0x02325370
Data Size: 11170 Bytes = 10.9 KiB
Architecture: ARM
Verifying Hash Integrity ... OK
Booting using the fdt blob at 0x2325370
Loading Kernel Image ... OK
Loading Ramdisk to 1ea79000, end 1ffff2d5 ... OK
Loading Device Tree to 1ea73000, end 1ea78ba1 ... OK
Starting kernel ...
undefined instruction
pc : [<0000800c>] lr : [<3ff2b834>]
reloc pc : [<c40dd00c>] lr : [<04000834>]
sp : 3f30acb0 ip : 0000000c fp : 3ff2b8c0
r10: 00000000 r9 : 3f30aee0 r8 : 020000c4
r7 : 00000000 r6 : 00008000 r5 : 3ff9c868 r4 : 00000000
r3 : 00002ba2 r2 : 1ea73000 r1 : 00000000 r0 : 3f30afb0
Flags: nZCv IRQs off FIQs off Mode SVC_32
Resetting CPU ...
resetting ...
을 이것은 FIT 이미지를 사용하여 내 처음이지만, 이것은 내가 나의 새로운 .itb
파일 (출력 생략)를 사용하여 부팅을 시도하고있어 어떻게 모든 것이 충돌 할 때까지 나를 잘 보입니다. 로드 및 진입 점 주소가 일렬로 배열되고, 출력은 Starting kernel...
까지 올라갑니다.
FIT 이미지를 만들고 사용하는 방법에 대한 오해가 있습니까?
저는 FIT 이미지로 U-Boot가 uImage를로드 주소 인 0x8000
으로로드하고 있음을 확신합니다. 나는 U-부팅에 md
테스트 : FIT 이미지를로드 한 후에 FIT 이미지
Zynq> md 0x8000
00008000: dfdc3ffc dd5ffbfe ff7fbabe ffffd7fe .?...._.........
00008010: 777fccfb fbbfeefb dde9f8cf ffffeee7 ...w............
00008020: ffcefebc f76ffffb ffadf2ed f5f776ff ......o......v..
00008030: eb31fdd9 fff28fff df5fb77f ffdbeeeb ..1......._.....
00008040: dedfef7f ebeffebe fddfbbbf f7f7d4ff ................
00008050: ddcfaed7 e7fe33ee ff8eb89f fedd3df7 .....3.......=..
00008060: ffdffd7f 75bff5ad f2dff52b ffb7f03f .......u+...?...
00008070: f7fffef3 ff9fbffb bf7fabfe ff96db5f ............_...
00008080: f777feff f6b7bf5b fb27dffb e5beb98f ..w.[.....'.....
00008090: ffbdf8f7 f3fefce7 e8fefdf6 ffc639ef .............9..
000080a0: f6ef8bfe f6bffcfd ffffd4cf defffdff ................
000080b0: edbf46bf ffdfbdbf 7edff6b7 fde5afbf .F.........~....
000080c0: b7cdf9bf fffefdbb ffbdfa7f eeffffb7 ................
000080d0: c5affdef ffcffbaf e73f6fef fdeff37f .........o?.....
000080e0: f3ffeffb 76af599b ffff7dff 6dafbd8f .....Y.v.}.....m
000080f0: efffaafd fdfff7fe effffbff bebf6cbe .............l..
을 넣기 전에
00008000: 56190527 3328f51d dc265858 c0513200 '..V..(3XX&..2Q.
00008010: 00800000 00800000 368dbc5f 00020205 ........_..6....
00008020: 756e694c 2e342d78 2d302e30 31303030 Linux-4.0.0-0001
00008030: 63672d31 66316466 00003236 00000000 1-gcfd1f62......
00008040: e1a00000 e1a00000 e1a00000 e1a00000 ................
00008050: e1a00000 e1a00000 e1a00000 e1a00000 ................
00008060: ea000003 016f2818 00000000 003251c0 .....(o......Q2.
00008070: 04030201 e10f9000 eb000bf8 e1a07001 .............p..
00008080: e1a08002 e10f2000 e3120003 1a000001 ..... ..........
00008090: e3a00017 ef123456 e10f0000 e220001a ....V4........ .
000080a0: e310001f e3c0001f e38000d3 1a000004 ................
000080b0: e3800c01 e28fe00c e16ff000 e12ef30e ..........o.....
000080c0: e160006e e121f000 e16ff009 00000000 n.`...!...o.....
000080d0: 00000000 00000000 00000000 00000000 ................
000080e0: e1a0400f e204433e e2844902 e1a0000f [email protected]>C...I......
000080f0: e1500004 359f01ac 3080000f 31540000 ..P....5...0..T1
U-부팅 커널 이미지 데이터가 0xc4
의 오프셋 (offset)에서 시작보고 어디에서 FIT 이미지를로드했는지 확인합니다. 해당 주소 (0x20000c4
)에서 읽으면 데이터가 부팅 시도 후 0x8000
에있는 것과 동일합니다. 따라서 U-Boot는 확실히 커널을로드하고 있습니다. uImage를 만들 때
여기 내 커널 빌드의 출력입니다 :
이/bin/sh ./scripts/mkuboot.sh -A arm -O linux -C none -T kernel -a 0x8000 -e 0x8000 -n 'Linux-4.0.0-00011-gcfd1f62' -d arch/arm/boot/zImage arch/arm/boot/uImage
Image Name: Linux-4.0.0-00011-gcfd1f62
Created: Mon Dec 19 13:32:30 2016
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 3297728 Bytes = 3220.44 kB = 3.14 MB
Load Address: 00008000
Entry Point: 00008000
다시 말하지만, 모든 정결 여기 보인다.
아이디어가 있으십니까?
그건 티켓입니다. FIT 이미지에 U-Boot 형식의 커널을 포함시킬 수 없다는 것을 알지 못했습니다. 이제 나는 나의 FIT 소스를 게시했으면 좋겠다 ... 그것은 당신의 일을 좀 더 쉽게 만들었을 것이다! 감사! –