手把手教你烧写烧写u-boot、kernel、rootfs(目标平台S3C2410)

时间:2022-12-01 19:12:30
内核分区空间:

Creating 4 MTD partitions on "NAND 64MiB 3,3V 8-bit":

0x00000000-0x00080000 : "Bootloader"

0x00080000-0x00280000 : "Linux Kernel"

0x00280000-0x00680000 : "Root File System"

0x00680000-0x04000000 : "User Space"

烧写u-boot:

tftp 0x30008000 u-boot.bin

nand erase 0x0 0x80000

nand write 0x30008000 0x0 0x80000

烧写内核:

tftp 0x30008000 uImage

nand erase 0x80000 0x200000

nand write 0x30008000 0x80000 0x200000

烧写文件系统:

tftp 0x30008000 root.cramfs

nand erase 0x280000 0x400000

nand write 0x30008000 0x280000 0x400000

[smdk2410#]setenv bootcmd nand read 0x30008000 0x80000 0x200000\;bootm

[smdk2410#]saveenv

[smdk2410#]setenv bootargs root=/dev/mtdblock2 init=/linuxrc console=ttySAC0,115200

[smdk2410#]saveenv

Saving Environment to NAND...

Erasing Nand...Writing to Nand... done

[smdk2410#]printenv

bootargs=root=/dev/mtdblock3 init=/linuxrc console=ttySAC0,115200

bootcmd=tftp; bootm

bootdelay=3

baudrate=115200

ethaddr=08:00:3e:26:0a:5b

ipaddr=192.168.1.131

serverip=192.168.1.132

netmask=255.255.255.0

bootfile="uImage"

stdin=serial

stdout=serial

stderr=serial

修改ROOT分区

[smdk2410#]setenv bootargs root=/dev/mtdblock2 init=/linuxrc

console=ttySAC0,115200

[smdk2410#]saveenv

修改TFTP到NANDFLASH

[smdk2410#]setenv bootcmd nand read 0x30008000 0x80000 0x200000\; bootm

[smdk2410 #]printenv

bootargs=root=/dev/mtdblock2 init=/linuxrc console=ttySAC0,115200

bootdelay=3

baudrate=115200

ethaddr=08:00:3e:26:0a:5b

ipaddr=192.168.1.131

serverip=192.168.1.132

netmask=255.255.255.0

bootfile="uImage"

stdin=serial

stdout=serial

stderr=serial

bootcmd=nand read 0x30008000 0x80000 0x160000; bootm

Environment size: 298/16380 bytes

[smdk2410#]saveenv

Saving Environment to NAND...

Erasing Nand...Writing to Nand... done

[smdk2410#]reset

这样重启过后就会进入我们所移植的linux系统中,所有烧写工作完成。