May 2018 began on JZ2440 gradually transplanted the Boot-2016.11-U, the Boot-U-SPL-2016.11,
linux-4.17 and busybox-1.28.4, which linux-4.17 and busybox-1.28.4 was the latest official
version, as summarized learning linux two years.
Unfortunately, I did not take notes at each stage of the migration process, just want to complete as soon as possible. Cause now
in 7788 have been forgotten, almost not even compile burn not remember how to operate. After the migration is complete, because the
busy it has not submitted the code to github. Just recently starting up a new notebook, he intended
to refresh the information below.
Fortunately, git commit log record in detail the migration process. Submit records by referring to
how migration solution from scratch a complete Linux system.
With respect JZ2440 development board comes u-boot-1.1.6, linux- 2.6.22.6, fs_qtopia, since I
have transplantation u-boot-2016.11 major increase independent SPL guide support u-boot, dts device tree , by
adding the spl and dtb partition, I had also tried to re-transplantation u-boot-1.1.6, found JZ2440 development board comes with the
u-boot-1.1.6 engage in complex, no need to modify a lot of things, It looks very difficult to understand. If readers need
to be a message, I will submit to github.
For linux-4.17 is to increase support in the device tree JZ2440, substantially by setting the peripheral drivers are
configured apparatus tree.
github仓库:
u-boot-2016.11:https://github.com/cgw201410/u-boot-2016.11_jz2440.git
linux-4.17: https://github.com/cgw201410/linux-4.17_jz2440.git
busybox-1.28.4:https://github.com/cgw201410/rootfs_jz2440.git
1. Install the compilation tools
decompression arm-linux-gcc-4.4.3.tar.gz to / usr / local / ARM
the tar -zxvf arm-linux-gcc-4.4.3.tar.gz
2. Set the environment variable
in ~ / .bashrc finally add a line: export PATH = $ PATH: /usr/local/arm/4.4.3/bin
update the environment variables: source ~ / .bashrc
1. Compile-Boot U / U-Boot-SPL
the make O = .. / tmp / Build the distclean
the make O = .. / tmp / Build JZ2440_defconfig
the make O = .. / tmp / All Build
2. start the NAND-Boo U T
in the include / configs / JZ2440.h close the macro: CONFIG_SYS_BOOT_FROM_NOR_FLASH
U-boot.bin directory: ../ tmp / Build / boot.bin U-
U-boot-SPL. bin directory: ../ tmp / Build / SPL / u-boot-spl.bin
3. NOR u-boot boot
in include / configs / JZ2440.h open the macro: CONFIG_SYS_BOOT_FROM_NOR_FLASH
U-boot.bin directory: ../ tmp /build/u-boot.bin
u-boot-spl.bin directory: ../ tmp / build / spl /
u-boot-spl.bin NOTE: the above coding modes out of the u-boot-spl.bin is the same.
Three, u-boot / u-boot -spl burning
1. u-boot NOR initiated
J-Link by directly burning u-boot.bin, u-boot- spl.bin not burn, because NOR SPL does not need to start u-boot to boot directly from NOR u-boot in.
Reference: "How to program the program S3C2440 bare board"
2. the NAND u-boot to start
here as an example to burn tftp:
2.1 Set the environment variable
SET ipaddr 192.168.xxx.xxx
SET ServerIP 192.168.xxx.xxx
2.2 burning
tftp 0x30000000 spl.bin-u-boot; 0x20000 NAND ERASE 0; 0 0x30000000 NAND Write 0x20000
TFTP 0x30000000 U-boot.bin; NAND erase.part the bootloader; 0x30000000 NAND Write the bootloader
four, environment variables
1. enter u-boot command mode, set environment variables (in addition to network-related, other default settings).
= 115200 baudrate
the bootcmd = NAND Kernel Read 0x30007FC0; 0x31000000 DTB NAND Read; the bootm 0x30007FC0 - 0x31000000
the bootdelay =. 5
ethact = DM9000
ethaddr = 08: 00: 3E: 26 is: 0A: 5B
ipaddr=192.168.1.10
mtddevname=rootfs
mtddevnum=5
netmask=255.255.255.0
partition=nand0,5
serverip=192.168.1.167
stderr=serial
stdin=serial
stdout=serial
2. 分区规划
device nand0 <jz2440-nand0>, # parts = 6
#: name size offset mask_flags
0: spl 0x00020000 0x00000000 0
1: bootloader 0x000a0000 0x00020000 0
2: params 0x00020000 0x000c0000 0
3: dtb 0x00020000 0x000e0000 0
4: kernel 0x00500000 0x00100000 0
5: rootfs 0x0fa00000 0x00600000 0
mtdids: NAND0 = jz2440-NAND0
mtdparts: mtdparts = jz2440-NAND0: 128K @ 0 (SPL), 640K (the bootloader), 128K (the params), 128K (DTB), 5m (Kernel), - (the rootfs)
V. linux kernel compiled programming
1. compile
the make the distclean
the make jz2440_defconfig
the make uImage
zImage directory: Arch / ARM / Boot / uImage
DTB directory: arch / arm / boot / dts / s3c2440-jz2440.dtb
TFTP 0x30000000 S3C2440-jz2440.dtb; NAND erase.part DTB; Write 0x30000000 NAND DTB
TFTP 0x30000000 uImage; Kernel NAND erase.part; 0x30000000 Kernel Write NAND
six, making burn busybox file system
1. compiled busybox production jffs2 file system format
mkfs.jffs2 -n -s 0x800 -e -d 0x800000 = 0x20000 --pad the rootfs -o fs_root.jffs2
2. burn
tftp 0x30000000 rootfs-1.28.4.jffs2; nand erase.part rootfs; nand write 0x30000000 0x600000 $ filesize