MPC8313ERDB starts the system from NAND FLASH
The linux System of mpc8313erdb is stored in Nor Flash, and Nor Flash is only 8 M. Recently, I added something to the root directory. As a result, the size of Ramdisk has soared, it suddenly exceeded 4 MB (the space allocated to Ramdisk in Nor Flash is only 4 MB). Fortunately, there is a 32 m nand Flash on the board, and the original ecology is not used in the system, the idea here is as follows: Write the uImage, Ramdisk, and dtb files to NAND Flash, read the memory when uboot is started, and then start from the memory.
Currently, my NAND Flash space is divided:
NAND Flash Space |
Usage goals |
Space size |
Location of the loaded memory |
0 ~ 1 MB |
NAND UBOOT |
1 MB |
|
2 MB ~ 6 MB |
UImage |
4 MB |
Zero x 200000 |
6 MB ~ 7 MB |
Dtb |
1 MB |
Zero x 800000 |
7 MB ~ 15 MB |
Ramdisk |
8 MB |
Zero x 1000000 |
Because there is no usb tag, we can prevent unexpected use of the NAND version of uboot. The original space occupied by the nand uboot is j512k, and we do not know where its parameters are stored, so it starts from 2 MB.
Introduce the nand command under uboot:
Nand erase [start address] [length] // erase a flashnand write [memory address] [nand start address] [length] // write the data in the memory to the nand flash nand read [memory Address] [nand start address] [length] // write data from nand flash to memory
Start the board to enter the uboot command line mode, set the tftp server address, and start working ~
UImage burning and writing:
nand erase 0x200000 0x400000tftp 0x200000 uImagenand write 0x200000 0x200000 0x400000
Dtb:
nand erase 0x600000 0x100000tftp 0x800000 mpc8313erdb.dtbnand write 0x800000 0x600000 0x100000
Rootfs.ext2.gz. uboot:
nand erase 0x700000 0x800000tftp 0x1000000 rootfs.ext2.gz.ubootnand write 0x1000000 0x700000 0x800000
Then modify the startup command:
set bootcmd "nand read 0x200000 0x200000 0x400000;nand read 0x800000 0x600000 0x100000;nand read 0x1000000 0x700000 0x800000;bootm 0x200000 0x1000000 0x800000"save