Can't start kernel when the uImage file is big then 6.7M

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Can't start kernel when the uImage file is big then 6.7M

ソリューションへジャンプ
1,420件の閲覧回数
liqi-c
Contributor II

I use MPC8313 board , but when i insert some file to initramfs ,then compiling, the  uImage file is bigger then 6.7M ,and then i can't start kernel success ,the print is belowd :

U-Boot 1.1.6 (Apr 20 2018 - 11:36:58) MPC83XX
Saisi SyncMaster 2000 (SM2000) MC
Clock configuration:
  Coherent System Bus:  166 MHz
  Core:                 333 MHz
  Local Bus Controller: 166 MHz
  Local Bus:             41 MHz
  DDR:                  333 MHz
  SEC:                   55 MHz
  I2C1:                 166 MHz
  I2C2:                 166 MHz
  TSEC1:                166 MHz
  TSEC2:                166 MHz
  USB MPH:                0 MHz
  USB DR:                55 MHz
CPU: MPC8313E, Rev: 21 at 333.333 MHz
INFO: Initializing IOMEM for regset 0
I2C:   ready
DRAM:  256 MB
NAND:  256 MB
Using default environment                  board_init_r  --》env_relocate
In:    serial
Out:   serial
Err:   serial
Net:   P: enter
NATSEMI: INFO: dp83815#0 using MAC: 00:04:9F:EF:23:34
NATSEMI: INFO: dp83815#0 changed to autoneg. enabled, advertise 100 full duplex.   打印来自:natsemi_initialize(netsemi.c)
Not find PCI device
TSEC1, TSEC2, dp83815#0 [PRIME]
Boot in 5 seconds
partition changed to nand0,3
INFO: next.scr loading
Scanning JFFS2 FS: . done.
INFO: next.scr load complete: 11 bytes loaded to 0x100000
INFO: last.scr loading
INFO: last.scr load complete: 22 bytes loaded to 0x100000
partition changed to nand0,4
INFO: fpga loading
Scanning JFFS2 FS: . done.
INFO: fpga load complete: 341436 bytes loaded to 0x100000
INFO: fpga load transferred 341436 bytes
INFO: Programmed binary fpga
INFO: loaded parallel fpga (bin)
### dtb load complete: 8192 bytes loaded to 0xfe00000
BOOT FROM UIMAGE
INFO: part: NAND 256MiB 3,3V 8-bit  off: 00000000  addr: 0f000000
INFO: Loading uImage from NAND 256MiB 3,3V 8-bit, offset 0x1300000  addr: f000000
## Booting image at 0f000000 ...
   Image Name:   
   Image Type:   PowerPC Linux Kernel Image (gzip compressed)
   Data Size:    6527303 Bytes =  6.2 MB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK
   Uncompressing Kernel Image ... OK
=> set upper limit to 0x0FE00000
   Booting using flat device tree at 0xfe00000

---------------------------------------------------------------------------------------------------------end .

Then it will start again  ,repert and repeat 

タグ(2)
0 件の賞賛
返信
1 解決策
1,176件の閲覧回数
liqi-c
Contributor II

I solved this problem  . 

because the kernel decompress function . we limit the decompress size then we decompress uimage  .  like this :

  unc_len = CFG_BOOTM_LEN

  gunzip ((void *)ntohl(hdr->ih_load), unc_len,  (uchar *)data, &len) 

if  the uimage is bigger then the unc_len ,then we decompress uimage is not complete ,and the kernel is not complete . so when we jump to run kernel ,cpu doesn't know how to run ,so it's will reboot by itself  .

元の投稿で解決策を見る

0 件の賞賛
返信
4 返答(返信)
1,177件の閲覧回数
liqi-c
Contributor II

I solved this problem  . 

because the kernel decompress function . we limit the decompress size then we decompress uimage  .  like this :

  unc_len = CFG_BOOTM_LEN

  gunzip ((void *)ntohl(hdr->ih_load), unc_len,  (uchar *)data, &len) 

if  the uimage is bigger then the unc_len ,then we decompress uimage is not complete ,and the kernel is not complete . so when we jump to run kernel ,cpu doesn't know how to run ,so it's will reboot by itself  .

0 件の賞賛
返信
1,176件の閲覧回数
liqi-c
Contributor II

And I see some discription in head.S ,like this :

-----------------------
If configured to pin some TLBs, we pin the first 8 Mbytes of kernel,
* 24 Mbytes of data, and the 8M IMMR space.  Anything not covered by
* these mappings is mapped by page tables.

------------------------

 So  , mabey the limit 8M is set by assembly code ? ,how can i fix it ? 

0 件の賞賛
返信
1,176件の閲覧回数
yipingwang
NXP TechSupport
NXP TechSupport

Hello li nes,

Please refer to the following definition in ./include/configs/MPC8313ERDB.h, this is Initial Memory map for Linux, please modify it according to your requirement.

#define CFG_BOOTMAPSZ   (8 << 20)

CFG_BOOTMAPSZ is used in the function do_bootm_linux in file ./common/cmd_bootm.c.

In addition, in LTIB released Linux BSP, we provide customers uImage + ramdisk rootfs filesystem, we recommend users use this method to boot up Linux system and add your own files in the rootfs filesystem.


Have a great day,
TIC

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

1,176件の閲覧回数
liqi-c
Contributor II

Think's very much .

but i set #define CFG_BOOTMAPSZ (254<<20) ,is max then my uimage file .

and the print like this : " => set upper limit to 0x0FE00000 " 254M is bigger then 6.7M

and uboot is boot finished ,no any abnormal message .

just when jump to boot kernel ,and no any message print out ,and then reset auto .

and I find the reset code is : EXCEPTION(0x100, Reset, unknown_exception, EXC_XFER_STD)

but I don't know how to fix it .

0 件の賞賛
返信