用于u-boot的linux内核的内存位置

时间:2019-01-20 05:08:12

标签: arm embedded-linux u-boot

当前,我有一个使用U-boot加载Android OS的ARM设备。我希望将android替换为linux。因此,我要做的是将为ARM设备编译的linux副本加载到sd卡上,然后引导到U-boot引导程序中。现在的问题是,我告诉U-boot在vmlinuz linux内核中启动哪个内存位置?

我如何找到这个?或指出一些资源也是很好的。

谢谢。

以下是当前连接到串行端口的启动顺序

Reg Version:  v1.1.0
Reg Time:     2014-10-115:15:35
Reg Name:     hi3719cdmo1a_hi3719cv100_ddr3_1gbyte_16bitx2_2layers_emmc.reg

Fastboot 3.3.0 (zengzhiliang@server180) (Nov 21 2014 - 13:41:16)

Fastboot:      Version 3.3.0
Build Date:    Nov 21 2014, 13:41:29
CPU:           Hi3719Cv100
Boot Media:    eMMC
DDR Size:      1GB

Check nand flash controller v610. found
Special NAND id table Version 1.36
Nand ID: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
No NAND device found!!!

Check spi flash controller v350. found
Can't find a valid spi flash chip.
Can't find a valid spi flash chip.

MMC/SD controller initialization.
MMC/SD Card:
    MID:         0xfe
    Read Block:  512 Bytes
    Write Block: 512 Bytes
    Chip Size:   3656M Bytes (High Capacity)
    Name:        "P1XXX"
    Chip Type:   MMC
    Version:     4.0
    Speed:       25000000Hz
    Bus Width:   8bit
    Boot Addr:   0 Bytes

*** Warning - bad CRC or eMMC, using default environment


Boot Env on eMMC
    Env Offset:          0x00100000
    Env Size:            0x00010000
    Env Range:           0x00010000


SDK Version: HiSTBAndroidV500R001C01CP0002_v2014070614

[Android_Main,34] begin
[sw_set_gpio,85] ok
[sw_ptable_init,66] begin
partition addr : [0x200000]
[swfastboot_flash_read,31]BaseAddress:0x200000, DataSize:0x100000, offset:0x0, b                         ytes:0xa10
[sw_ptable_check,176]cksum [0x6c94], ptable->checksum[0x6c94]
[sw_ptable_init,79] data at 0x200000 is ok
 0     fastboot 0x00000000 0x00200000
 1    partition 0x00200000 0x00200000
 2     recovery 0x00400000 0x01000000
 3   deviceinfo 0x01400000 0x00200000
 4    baseparam 0x01600000 0x00800000
 5      pqparam 0x01E00000 0x00800000
 6         logo 0x02600000 0x00800000
 7     fastplay 0x02E00000 0x02800000
 8         boot 0x05600000 0x01000000
 9         misc 0x06600000 0x00200000
10       system 0x06800000 0x27000000
11        cache 0x2D800000 0x19000000
12       backup 0x46800000 0x19000000
13         swdb 0x5F800000 0x03000000
14     userdata 0x62800000 0x80000000
ptable info:2M(fastboot),2M(partition),16M(recovery),2M(deviceinfo),8M(baseparam                         ),8M(pqparam),8M(logo),40M(fastplay),16M(boot),2M(misc),624M(system),400M(cache)                         ,400M(backup),48M(swdb),2048M(userdata)
[sw_ptable_init,104] ok
[sw_devinfo_init,25] begin
deviceinfo addr : [0x01400000]
[swfastboot_flash_read,31]BaseAddress:0x1400000, DataSize:0x100000, offset:0x0,                          bytes:0x514
[sw_devinfo_check,166] start...
[sw_devinfo_check,184] ok,checksum:0x9aad
[sw_devinfo_init,44] data at 0x1400000 is ok
[0] count:[4] name:[serialno] value:[xxxxxxxxxxxxxxxx]
[1] count:[4] name:[mac] value:[00:03:63:f4:33:12]
[2] count:[4] name:[standard] value:[1080i_50Hz]
[3] count:[4] name:[secureline] value:[20100]
[sw_devinfo_init,71] ok
[swfastboot_flash_read,31]BaseAddress:0x6600000, DataSize:0x100000, offset:0x0,                          bytes:0x10000
boot normal!!!
[swfastboot_flash_read,31]BaseAddress:0x5602000, DataSize:0x100000, offset:0x0,                          bytes:0x2000
use boot cmdline,disable serial, cmdline:[mem=1G console=NULL,115200 blkdevparts                         =mmcblk0:]
bootargs:[mem=1G console=NULL,115200 blkdevparts=mmcblk0:2M(fastboot),2M(partiti                         on),16M(recovery),2M(deviceinfo),8M(baseparam),8M(pqparam),8M(logo),40M(fastplay                         ),16M(boot),2M(misc),624M(system),400M(cache),400M(backup),48M(swdb),2048M(userd                         ata) androidboot.mac=00:03:63:f4:33:12 androidboot.standard=1080i_50Hz androidbo                         ot.serialno=xxxxxxxxxxxxxxx]
authenticat kernel begin
CA_GetFlashImgInfoByAddr,683: Img has already be encrypted
CA_GetFlashImgInfoByAddr,689: Magic number check right
CA_FlashAuthenticateByAddr,898: CA_FlashAuthenticateByAddr   0x5600000  successe                         d
offset = 0x5600000 KernelImgInDDRAddress = 0x4002000bootimg now: bootm 4002000
[Android_Main,52] ok
stDispParam.enFormat = 6
sw_EdidAll[0] = 10
sw_EdidAll[1] = 5
sw_EdidAll[2] = 9
sw_EdidAll[3] = 8
sw_EdidAll[4] = 7
sw_EdidAll[5] = 6
sw_EdidAll[6] = 5
sw_EdidAll[7] = 1
sw_EdidAll[8] = 0
sw_EdidAll[9] = 101
use baseparam format [6]

Reserve Memory
    Start Addr:          0xFFFF000
    Bound Addr:          0x8D3B000
    Free  Addr:          0xF2FA000
    Alloc Block:  Addr        Size
                  0xF2FA000       8192
                  0xF2FD000       2764800
                  0xF5A1000       3686400
                  0xF926000       1658880
                  0xFABC000       3686400
                  0xFE41000       12288
                  0xFE45000       1048576
                  0xFF46000       212992
                  0xFF7B000       8192
                  0xFF7E000       524288

Press Ctrl+C to stop autoboot

Found Initrd at 0x04E00000 (Size 535422 Bytes), align at 2048 Bytes

## Booting kernel from Legacy Image at 04002800 ...
   Image Name:   Linux-3.10.0_s40
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    8925824 Bytes = 8.5 MiB
   Load Address: 02000000
   Entry Point:  02000000
   Loading Kernel Image ... OK
OK

Starting kernel ...

Uncompressing Linux... done, booting the kernel.

1 个答案:

答案 0 :(得分:5)

  

所以我要做的是将为ARM设备编译的linux副本加载到sd卡上...

与x86不同,没有一个Linux内核的构建可以在所有“ ARM设备”上执行。
较旧的ARM Linux内核(即设备前树)已针对每种SoC /板版本进行了配置和构建。
可以为一个或多个SoC构建现代的ARM Linux内核,并且使用设备树blob引导内核以描述所使用的板。

您没有提供任何详细信息来表明您拥有的内核是否足以启动“ ARM设备”。

  

现在的问题是,我告诉U-boot在vmlinuz linux内核中启动哪个内存位置?

ARM Linux应该使用 zImage 文件而不是 vmlinuz 文件启动。

设备上物理RAM的起始地址是什么?

约定是ARM Linux内核将在物理RAM的基础上执行,偏移量为0x8000(32K)。有关更多详细信息,请参见this answer

zImage 文件是自解压的,可以(通过SD卡中的U-Boot)加载到内核加载/执行地址上方的任何合适的内存地址中(同时留出空间以供存储)。 DT blob,而不是破坏性的U-Boot)。

  

或者指出一些资源也很好。

尝试拉塞尔·金(Russel King)的Booting ARM Linux和文森特·桑德斯(Vincent Sanders)的Booting ARM Linux